Setu-TS
    Preparing search index...

    Type Alias CosmosAdapterOptions

    CosmosAdapterOptions:
        | CosmosAdapterOptionsBase & {
            client?: ICosmosClient;
            endpoint: string;
            key: string;
        }
        | CosmosAdapterOptionsBase & {
            client: ICosmosClient;
            endpoint?: string;
            key?: string;
        }

    Options for the CosmosAdapter — the 'cosmos' arm.

    A union of two arms, so supplying neither an endpoint/key pair nor a client is a compile error rather than a connect() throw. Both members stay readable on either arm, so the adapter reads options.client and options.endpoint without narrowing first. An application using Entra ID (managed identity) constructs its own client and injects it, which is why this carries no credential surface beyond the account key.

    Type Declaration

    • CosmosAdapterOptionsBase & {
          client?: ICosmosClient;
          endpoint: string;
          key: string;
      }
      • Optional Readonlyclient?: ICosmosClient

        An already-constructed client; omit it to load the SDK lazily.

      • Readonlyendpoint: string

        The account endpoint, used to construct a client when none is injected.

      • Readonlykey: string

        The account key.

    • CosmosAdapterOptionsBase & {
          client: ICosmosClient;
          endpoint?: string;
          key?: string;
      }
      • Readonlyclient: ICosmosClient

        An already-constructed ICosmosClient.

        When present, the lazy import('@azure/cosmos') never runs — the seam that keeps the branching unit-testable.

      • Optional Readonlyendpoint?: string

        The account endpoint; unread once a client is injected.

      • Optional Readonlykey?: string

        The account key; unread once a client is injected.

    const lazy: CosmosAdapterOptions = { endpoint, key, database: 'app' };
    const injected: CosmosAdapterOptions = { client: myCosmosClient, database: 'app' };

    0.2.0