/** * @module botbuilder-azure */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ /// import type { Agent } from 'http'; import { ConnectionPolicy, RequestOptions } from 'documentdb'; import { Storage, StoreItems } from 'botbuilder'; /** * Additional settings for configuring an instance of `CosmosDbStorage`. * * @deprecated Please use CosmosDbPartitionedStorageOptions with CosmosDbPartitionedStorage instead. */ export interface CosmosDbStorageSettings { /** * The endpoint Uri for the service endpoint from the Azure Cosmos DB service. */ serviceEndpoint: string; /** * The AuthKey used by the client from the Azure Cosmos DB service. */ authKey: string; /** * The Database ID. */ databaseId: string; /** * The Collection ID. */ collectionId: string; /** * (Optional) Cosmos DB RequestOptions that are passed when the database is created. */ databaseCreationRequestOptions?: RequestOptions; /** * (Optional) Cosmos DB RequestOptiones that are passed when the document collection is created. */ documentCollectionRequestOptions?: RequestOptions; /** * (Optional) partitionKey that are passed when the document CosmosDbStorage is created. * * @deprecated Please use [[CosmosDbPartitionedStorage]]. See https://github.com/microsoft/botframework-sdk/issues/5467 */ partitionKey?: string; /** * (Optional) http agent to use for outbound requests */ agent?: Agent; } /** * Middleware that implements a CosmosDB based storage provider for a bot. * * @deprecated Please use CosmosDbPartitionedStorage instead. * * @remarks * The `connectionPolicyConfigurator` handler can be used to further customize the connection to * CosmosDB (Connection mode, retry options, timeouts). More information at * http://azure.github.io/azure-documentdb-node/global.html#ConnectionPolicy */ export declare class CosmosDbStorage implements Storage { private settings; private client; private collectionExists; private documentCollectionCreationRequestOption; private databaseCreationRequestOption; /** * Creates a new CosmosDbStorage instance. * * @param settings Setting to configure the provider. * @param connectionPolicyConfigurator (Optional) An optional delegate that accepts a ConnectionPolicy for customizing policies. More information at http://azure.github.io/azure-documentdb-node/global.html#ConnectionPolicy */ constructor(settings: CosmosDbStorageSettings, connectionPolicyConfigurator?: (policy: ConnectionPolicy) => void); /** * Read storage items from storage. * * @param keys Keys of the items to read from the store. * @returns The read items. */ read(keys: string[]): Promise; /** * Write storage items to storage. * * @param changes Items to write to storage, indexed by key. */ write(changes: StoreItems): Promise; /** * Delete storage items from storage. * * @param keys Keys of the items to remove from the store. */ delete(keys: string[]): Promise; /** * Delayed Database and Collection creation if they do not exist. */ private ensureCollectionExists; } //# sourceMappingURL=cosmosDbStorage.d.ts.map