UNPKG

4.64 kBTypeScriptView Raw
1/**
2 * @module botbuilder-azure
3 */
4/**
5 * Copyright (c) Microsoft Corporation. All rights reserved.
6 * Licensed under the MIT License.
7 */
8import { Activity, PagedResult, TranscriptInfo, TranscriptStore } from 'botbuilder';
9import { BlobStorageSettings } from './blobStorage';
10/**
11 * @private
12 * Unique ket used to access the static <code>checkedCollections</code>
13 * property of the AzureBlobTranscriptStore. Accessing it is necessary for
14 * proper testing and debugging.
15 */
16export declare const checkedCollectionsKey: unique symbol;
17/**
18 * Stores transcripts in an Azure Blob container.
19 *
20 * @remarks
21 * Each activity is stored as JSON blob with a structure of
22 * `container/{channelId]/{conversationId}/{Timestamp.ticks}-{activity.id}.json`.
23 *
24 * @deprecated This class is deprecated in favor of [BlobsTranscriptStore](xref:botbuilder-azure-blobs.BlobsTranscriptStore)
25 */
26export declare class AzureBlobTranscriptStore implements TranscriptStore {
27 /**
28 * @private
29 * Internal dictionary with the containers where entities will be stored.
30 */
31 private static [checkedCollectionsKey];
32 private readonly settings;
33 private client;
34 private pageSize;
35 /**
36 * Creates a new AzureBlobTranscriptStore instance.
37 *
38 * @param settings Settings required for configuring an instance of BlobStorage
39 */
40 constructor(settings: BlobStorageSettings);
41 /**
42 * Log an activity to the transcript.
43 *
44 * @param activity Activity being logged.
45 */
46 logActivity(activity: Activity): Promise<void>;
47 /**
48 * Get activities for a conversation (Aka the transcript)
49 *
50 * @param channelId Channel Id.
51 * @param conversationId Conversation Id.
52 * @param continuationToken Continuation token to page through results.
53 * @param startDate Earliest time to include.
54 */
55 getTranscriptActivities(channelId: string, conversationId: string, continuationToken?: string, startDate?: Date): Promise<PagedResult<Activity>>;
56 /**
57 * List conversations in the channelId.
58 *
59 * @param channelId Channel Id.
60 * @param continuationToken ContinuationToken token to page through results.
61 */
62 listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>>;
63 /**
64 * Delete a specific conversation and all of it's activities.
65 *
66 * @param channelId Channel Id where conversation took place.
67 * @param conversationId Id of the conversation to delete.
68 */
69 deleteTranscript(channelId: string, conversationId: string): Promise<void>;
70 /**
71 * Parse a BlobResult as an [Activity](xref:botframework-schema.Activity).
72 *
73 * @param blob BlobResult to parse as an [Activity](xref:botframework-schema.Activity).
74 * @returns The parsed [Activity](xref:botframework-schema.Activity).
75 */
76 private blobToActivity;
77 /**
78 * @private
79 */
80 private getActivityBlobs;
81 /**
82 * @private
83 */
84 private getTranscriptsFolders;
85 /**
86 * @private
87 */
88 private getConversationsBlobs;
89 /**
90 * Check if a container name is valid.
91 *
92 * @param container String representing the container name to validate.
93 * @returns A boolean value that indicates whether or not the name is valid.
94 */
95 private checkContainerName;
96 /**
97 * Get the blob name based on the [Activity](xref:botframework-schema.Activity).
98 *
99 * @param activity [Activity](xref:botframework-schema.Activity) to get the blob name from.
100 * @returns The blob name.
101 */
102 private getBlobName;
103 /**
104 * Get the directory name.
105 *
106 * @param channelId Channel Id.
107 * @param conversationId Id of the conversation to get the directory name from.
108 * @returns The sanitized directory name.
109 */
110 private getDirName;
111 /**
112 * Escape a given key to be compatible for use with BlobStorage.
113 *
114 * @param key Key to be sanitized(scaped).
115 * @returns The sanitized key.
116 */
117 private sanitizeKey;
118 /**
119 * @private
120 */
121 private getTicks;
122 /**
123 * Delay Container creation if it does not exist.
124 */
125 private ensureContainerExists;
126 /**
127 * Create a Blob Service.
128 *
129 * @param param0 Settings required for configuring the Blob Service.
130 * @param param0.storageAccountOrConnectionString Storage account or connection string.
131 * @param param0.storageAccessKey Storage access key.
132 * @param param0.host Blob Service host.
133 * @returns The BlobService created.
134 */
135 private createBlobService;
136}
137//# sourceMappingURL=azureBlobTranscriptStore.d.ts.map
\No newline at end of file