botbuilder-azure
Version:
Azure extensions for Microsoft BotBuilder.
141 lines • 4.87 kB
TypeScript
/**
* @module botbuilder-azure
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Activity, PagedResult, TranscriptInfo, TranscriptStore } from 'botbuilder';
import { BlobStorageSettings } from './blobStorage';
/**
* @private
* Unique ket used to access the static <code>checkedCollections</code>
* property of the AzureBlobTranscriptStore. Accessing it is necessary for
* proper testing and debugging.
*/
export declare const checkedCollectionsKey: unique symbol;
/**
* Stores transcripts in an Azure Blob container.
*
* @remarks
* Each activity is stored as JSON blob with a structure of
* `container/{channelId]/{conversationId}/{Timestamp.ticks}-{activity.id}.json`.
*
* @deprecated This class is deprecated in favor of [BlobsTranscriptStore](xref:botbuilder-azure-blobs.BlobsTranscriptStore)
*/
export declare class AzureBlobTranscriptStore implements TranscriptStore {
/**
* @private
* Internal dictionary with the containers where entities will be stored.
*/
private static [checkedCollectionsKey];
private readonly settings;
private client;
private pageSize;
/**
* Creates a new AzureBlobTranscriptStore instance.
*
* @param settings Settings required for configuring an instance of BlobStorage
*/
constructor(settings: BlobStorageSettings);
/**
* Log an activity to the transcript.
*
* @param activity Activity being logged.
*/
logActivity(activity: Activity): Promise<void>;
/**
* Get activities for a conversation (Aka the transcript)
*
* @param channelId Channel Id.
* @param conversationId Conversation Id.
* @param continuationToken Continuation token to page through results.
* @param startDate Earliest time to include.
* @returns The PagedResult of activities.
*/
getTranscriptActivities(channelId: string, conversationId: string, continuationToken?: string, startDate?: Date): Promise<PagedResult<Activity>>;
/**
* List conversations in the channelId.
*
* @param channelId Channel Id.
* @param continuationToken ContinuationToken token to page through results.
* @returns A promise representation of [PagedResult<TranscriptInfo>](xref:botbuilder-core.PagedResult)
*/
listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>>;
/**
* Delete a specific conversation and all of it's activities.
*
* @param channelId Channel Id where conversation took place.
* @param conversationId Id of the conversation to delete.
*/
deleteTranscript(channelId: string, conversationId: string): Promise<void>;
/**
* Parse a BlobResult as an [Activity](xref:botframework-schema.Activity).
*
* @param blob BlobResult to parse as an [Activity](xref:botframework-schema.Activity).
* @returns The parsed [Activity](xref:botframework-schema.Activity).
*/
private blobToActivity;
/**
* @private
*/
private getActivityBlobs;
/**
* @private
*/
private getTranscriptsFolders;
/**
* @private
*/
private getConversationsBlobs;
/**
* Check if a container name is valid.
*
* @param container String representing the container name to validate.
* @returns A boolean value that indicates whether or not the name is valid.
*/
private checkContainerName;
/**
* Get the blob name based on the [Activity](xref:botframework-schema.Activity).
*
* @param activity [Activity](xref:botframework-schema.Activity) to get the blob name from.
* @returns The blob name.
*/
private getBlobName;
/**
* Get the directory name.
*
* @param channelId Channel Id.
* @param conversationId Id of the conversation to get the directory name from.
* @returns The sanitized directory name.
*/
private getDirName;
/**
* Escape a given key to be compatible for use with BlobStorage.
*
* @param key Key to be sanitized(scaped).
* @returns The sanitized key.
*/
private sanitizeKey;
/**
* @private
*/
private getTicks;
/**
* Delay Container creation if it does not exist.
*
* @returns A promise representing the asynchronous operation.
*/
private ensureContainerExists;
/**
* Create a Blob Service.
*
* @param param0 Settings required for configuring the Blob Service.
* @param param0.storageAccountOrConnectionString Storage account or connection string.
* @param param0.storageAccessKey Storage access key.
* @param param0.host Blob Service host.
* @returns The BlobService created.
*/
private createBlobService;
}
//# sourceMappingURL=azureBlobTranscriptStore.d.ts.map