@flowscripter/dynamic-cli-framework
    Preparing search index...

    Interface KeyValueService

    Service providing keystore functionality for the CLI. The keystore data is scoped to the service or Command instances accessing this service via Context.getServiceById.

    Values can optionally be stored as OS-native secrets using the isSecret parameter on setKey. Secret values are stored via SecretService and only a sentinel reference is kept in the key-value Map. The sentinel prefix __SECRET__: is reserved.

    interface KeyValueService {
        deleteKey(key: string): Promise<void>;
        getKey(key: string): Promise<string>;
        hasKey(key: string): Promise<boolean>;
        setKey(key: string, value: string, isSecret?: boolean): Promise<void>;
    }

    Implemented by

    Index
    • Delete the value for a specified key in the keystore. If the stored value is a secret sentinel, the secret is also deleted from the OS secret store.

      Parameters

      • key: string

      Returns Promise<void>

    • Get a value for a specified key in the keystore. If the stored value is a secret sentinel, the actual value is retrieved from the OS secret store.

      Parameters

      • key: string

      Returns Promise<string>

    • Check if a value for a specified key exists in the keystore.

      Parameters

      • key: string

      Returns Promise<boolean>

    • Set a value for a specified key in the keystore.

      Parameters

      • key: string
      • value: string
      • OptionalisSecret: boolean

        if true, the value is stored in the OS-native secret store and a sentinel reference is kept in the key-value Map. Requires that the service was constructed with secret support enabled.

      Returns Promise<void>