/** Interface for a vault which provides values. */ export interface Vault { error: string | undefined; getValue(name: string, fieldName: string): string | undefined; } /** Represents a Bitwarden vault accessed through Bitwarden CLI commands. */ export declare class BitwardenVault implements Vault { private serverUrl; constructor(serverUrl: string | undefined); /** If there is an error getting items from the vault this will not be undefined. */ error: string | undefined; private readonly items; /** Get a value from the vault. If the value is not found returns undefined. */ getValue(name: string, fieldName: string): string | undefined; /** * Syncs the Bitwarden vault. Note: this only downloads data. * * We could make this more interactive: * - Get status ('yarn bw status') and parse it * - Set server url automatically if its not set. Fail with error if it is set but different * - Prompt for username & password if not logged in. Login and store session id in memory * - Prompt for password if locked. Unlock and store session id in memory * - Session id can then be passed to `sync` & `list items` commands with --session * Reasons to not do this: * - The script becomes more complex * - Additional security concern of handling password entry * - Password would need to be entered every time the script is run (rather than just once per terminal session) * - Blocker: unlocked status is not reported correctly: https://github.com/bitwarden/clients/issues/2729. This * makes it really hard to determine the correct course of action. */ private sync; /** * Gets Bitwarden collection items from the vault. */ private fetchItems; }