UNPKG

2.93 kBTypeScriptView Raw
1import { Activity, PagedResult, TranscriptInfo, TranscriptStore } from 'botbuilder-core';
2/**
3 * The file transcript store stores transcripts in file system with each activity as a file.
4 *
5 * @remarks
6 * This class provides an interface to log all incoming and outgoing activities to the filesystem.
7 * It implements the features necessary to work alongside the TranscriptLoggerMiddleware plugin.
8 * When used in concert, your bot will automatically log all conversations.
9 *
10 * Below is the boilerplate code needed to use this in your app:
11 * ```javascript
12 * const { FileTranscriptStore, TranscriptLoggerMiddleware } = require('botbuilder');
13 *
14 * adapter.use(new TranscriptLoggerMiddleware(new FileTranscriptStore(__dirname + '/transcripts/')));
15 * ```
16 */
17export declare class FileTranscriptStore implements TranscriptStore {
18 private static readonly PageSize;
19 private readonly rootFolder;
20 /**
21 * Creates an instance of FileTranscriptStore.
22 * @param folder Root folder where transcript will be stored.
23 */
24 constructor(folder: string);
25 /**
26 * Log an activity to the transcript.
27 * @param activity Activity being logged.
28 */
29 logActivity(activity: Activity): Promise<void>;
30 /**
31 * Get all activities associated with a conversation id (aka get the transcript).
32 * @param channelId Channel Id.
33 * @param conversationId Conversation Id.
34 * @param continuationToken (Optional) Continuation token to page through results.
35 * @param startDate (Optional) Earliest time to include.
36 */
37 getTranscriptActivities(channelId: string, conversationId: string, continuationToken?: string, startDate?: Date): Promise<PagedResult<Activity>>;
38 /**
39 * List all the logged conversations for a given channelId.
40 * @param channelId Channel Id.
41 * @param continuationToken (Optional) Continuation token to page through results.
42 */
43 listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>>;
44 /**
45 * Delete a conversation and all of it's activities.
46 * @param channelId Channel Id where conversation took place.
47 * @param conversationId Id of the conversation to delete.
48 */
49 deleteTranscript(channelId: string, conversationId: string): Promise<void>;
50 /**
51 * Saves the [Activity](xref:botframework-schema.Activity) as a JSON file.
52 * @param activity The [Activity](xref:botframework-schema.Activity) to transcript.
53 * @param transcriptPath The path where the transcript will be saved.
54 * @param activityFilename The name for the file.
55 */
56 private saveActivity;
57 /**
58 * @private
59 */
60 private getActivityFilename;
61 /**
62 * @private
63 */
64 private getChannelFolder;
65 /**
66 * @private
67 */
68 private getTranscriptFolder;
69 /**
70 * @private
71 */
72 private sanitizeKey;
73}
74//# sourceMappingURL=fileTranscriptStore.d.ts.map
\No newline at end of file