API Reference
    Preparing search index...

    Base class for all providers.

    As an abstract class, it should not be used directly, but rather extended by other providers.

    It implements the common logic for all providers, such as caching, transformation, etc. Each provider that extends this class must implement the _get and _getMultiple abstract methods.

    These methods are responsible for retrieving the values from the underlying parameter store. They are called by the get and getMultiple methods, which are responsible for caching and transformation.

    Cached values are keyed by the method used, the parameter name, and every request option that can change the value returned by the store (for example transform, decrypt, recursive, or sdkOptions). Calls that differ in any of these are cached separately, so a value is only ever served to a request that would have produced it.

    This means that we need to make multiple calls to the underlying parameter store if we need the same parameter in different transforms or with different options. Since a given parameter is usually always requested the same way, this should be an acceptable tradeoff.

    Hierarchy (View Summary)

    Implements

    Index
    client: unknown
    store: Map<string, ExpirableValue>
    • Retrieve parameter value from the underlying parameter store.

      Parameters

      • name: string

        Parameter name

      • Optionaloptions: unknown

        Options to pass to the underlying implemented method

      Returns Promise<unknown>

    • Retrieve multiple parameter values from the underlying parameter store.

      Parameters

      • path: string

        Parameter name

      • Optionaloptions: unknown

        Options to pass to the underlying implementated method

      Returns Promise<Record<string, unknown> | undefined>

    • Add a value to the cache.

      Parameters

      • key: string

        Key of the cached value

      • value: unknown

        Value to be cached

      • maxAge: number

        Maximum age in seconds for the value to be cached

      Returns void

    • Build the cache key for a request.

      The key covers the method, the name, and every option that can affect the cached value, so requests that would receive different values never share an entry. Object keys are sorted so option order does not matter.

      Parameters

      • kind: CacheKeyKindOptions

        Whether the request is for a single value or multiple values

      • name: string

        Parameter name or path

      • Optionaloptions: object

        Options passed to the request

      Returns string

    • Check whether a key has expired in the cache or not.

      It returns true if the key is expired or not present in the cache.

      Parameters

      • key: string

        Stringified representation of the key to retrieve

      Returns boolean