@microsoft/agents-hosting-storage-cosmos package

Classes

CosmosDbPartitionedStorage

Cosmos DB partitioned storage provider.

This class implements the legacy CosmosDbPartitionedStorage contract. Use CosmosDbPartitionedStorageV2 for the structured StorageV2 contract.

CosmosDbPartitionedStorageV2

A Cosmos DB provider for the structured CosmosDbPartitionedStorageV2 contract.

This is the V2 counterpart to CosmosDbPartitionedStorage and uses the same CosmosDbPartitionedStorageOptions. Each read, write, and delete returns an outcome for every requested key. Cosmos DB ETags are returned as separate storage versions, and writes support create-only, replace, and expected-version conditions for optimistic concurrency.

ExceptionHelper

Helper class for generating exceptions with error codes.

Interfaces

AgentError

Enhanced error type with additional properties for error code, help link, and inner exception. This interface extends the standard Error type with custom properties added by ExceptionHelper.

AgentErrorDefinition

Represents an error definition for the Agents SDK. Each error definition includes an error code, description, and an optional help link. If helplink is not provided, a default help link will be used.

CosmosDbPartitionedStorageOptions

Options for configuring Cosmos DB partitioned storage.

Variables

Errors

Error definitions for the CosmosDB storage system. This contains localized error codes for the CosmosDB storage subsystem of the AgentSDK.

Each error definition includes an error code (starting from -100000), a description, and a help link pointing to an AKA link to get help for the given error.

Usage example:

throw ExceptionHelper.generateException(
  ReferenceError,
  Errors.MissingCosmosDbStorageOptions
);

Variable Details

Errors

Error definitions for the CosmosDB storage system. This contains localized error codes for the CosmosDB storage subsystem of the AgentSDK.

Each error definition includes an error code (starting from -100000), a description, and a help link pointing to an AKA link to get help for the given error.

Usage example:

throw ExceptionHelper.generateException(
  ReferenceError,
  Errors.MissingCosmosDbStorageOptions
);
Errors: {[key: string]: AgentErrorDefinition}

Type

{[key: string]: AgentErrorDefinition}