botbuilder
Version:
Bot Builder is a framework for building rich bots on virtually any platform.
85 lines • 3.38 kB
TypeScript
import { Activity, PagedResult, TranscriptInfo, TranscriptStore } from 'botbuilder-core';
/**
* The file transcript store stores transcripts in file system with each activity as a file.
*
* @remarks
* This class provides an interface to log all incoming and outgoing activities to the filesystem.
* It implements the features necessary to work alongside the TranscriptLoggerMiddleware plugin.
* When used in concert, your bot will automatically log all conversations.
*
* Below is the boilerplate code needed to use this in your app:
* ```javascript
* const { FileTranscriptStore, TranscriptLoggerMiddleware } = require('botbuilder');
*
* adapter.use(new TranscriptLoggerMiddleware(new FileTranscriptStore(__dirname + '/transcripts/')));
* ```
*/
export declare class FileTranscriptStore implements TranscriptStore {
private static readonly PageSize;
private readonly rootFolder;
/**
* Creates an instance of FileTranscriptStore.
*
* @param folder Root folder where transcript will be stored.
*/
constructor(folder: string);
/**
* Log an activity to the transcript.
*
* @param activity Activity being logged.
* @returns {Promise<void>} a promise representing the asynchronous operation.
*/
logActivity(activity: Activity): Promise<void>;
/**
* Get all activities associated with a conversation id (aka get the transcript).
*
* @param channelId Channel Id.
* @param conversationId Conversation Id.
* @param continuationToken (Optional) Continuation token to page through results.
* @param startDate (Optional) Earliest time to include.
* @returns {Promise<PagedResult<Activity>>} PagedResult of activities.
*/
getTranscriptActivities(channelId: string, conversationId: string, continuationToken?: string, startDate?: Date): Promise<PagedResult<Activity>>;
/**
* List all the logged conversations for a given channelId.
*
* @param channelId Channel Id.
* @param continuationToken (Optional) Continuation token to page through results.
* @returns {Promise<PagedResult<TranscriptInfo>>} PagedResult of transcripts.
*/
listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>>;
/**
* Delete a conversation and all of it's activities.
*
* @param channelId Channel Id where conversation took place.
* @param conversationId Id of the conversation to delete.
* @returns {Promise<void>} A promise representing the asynchronous operation.
*/
deleteTranscript(channelId: string, conversationId: string): Promise<void>;
/**
* Saves the [Activity](xref:botframework-schema.Activity) as a JSON file.
*
* @param activity The [Activity](xref:botframework-schema.Activity) to transcript.
* @param transcriptPath The path where the transcript will be saved.
* @param activityFilename The name for the file.
* @returns {Promise<void>} A promise representing the asynchronous operation.
*/
private saveActivity;
/**
* @private
*/
private getActivityFilename;
/**
* @private
*/
private getChannelFolder;
/**
* @private
*/
private getTranscriptFolder;
/**
* @private
*/
private sanitizeKey;
}
//# sourceMappingURL=fileTranscriptStore.d.ts.map