UNPKG

4.83 kBTypeScriptView Raw
1import { MicrosoftAppCredentials } from 'botframework-connector';
2import { Activity, Middleware, TurnContext, BotState, UserState, ConversationState, Storage } from 'botbuilder-core';
3/** @private */
4declare abstract class InterceptionMiddleware implements Middleware {
5 /**
6 * Implement middleware signature
7 *
8 * @param turnContext {TurnContext} An incoming TurnContext object.
9 * @param next {function} The next delegate function.
10 */
11 onTurn(turnContext: TurnContext, next: () => Promise<void>): Promise<void>;
12 protected abstract inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
13 protected abstract outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
14 protected abstract traceState(turnContext: TurnContext): Promise<any>;
15 private invokeInbound;
16 private invokeOutbound;
17 private invokeTraceState;
18}
19/**
20 * InspectionMiddleware for emulator inspection of runtime Activities and BotState.
21 *
22 * @remarks
23 * InspectionMiddleware for emulator inspection of runtime Activities and BotState.
24 * @deprecated This class will be removed in a future version of the framework.
25 */
26export declare class InspectionMiddleware extends InterceptionMiddleware {
27 private static readonly command;
28 private readonly inspectionState;
29 private readonly inspectionStateAccessor;
30 private readonly userState;
31 private readonly conversationState;
32 private readonly credentials;
33 /**
34 * Create the Inspection middleware for sending trace activities out to an emulator session
35 *
36 * @param inspectionState A state management object for inspection state.
37 * @param userState A state management object for user state.
38 * @param conversationState A state management object for conversation state.
39 * @param credentials The authentication credentials.
40 */
41 constructor(inspectionState: InspectionState, userState?: UserState, conversationState?: ConversationState, credentials?: Partial<MicrosoftAppCredentials>);
42 /**
43 * Indentifies open and attach commands and calls the appropriate method.
44 *
45 * @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
46 * @returns True if the command is open or attached, otherwise false.
47 */
48 processCommand(turnContext: TurnContext): Promise<any>;
49 /**
50 * Processes inbound activities.
51 *
52 * @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
53 * @param traceActivity The trace activity.
54 * @returns {Promise<any>} A promise representing the asynchronous operation.
55 */
56 protected inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
57 /**
58 * Processes outbound activities.
59 *
60 * @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
61 * @param traceActivities A collection of trace activities.
62 */
63 protected outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
64 /**
65 * Processes the state management object.
66 *
67 * @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
68 */
69 protected traceState(turnContext: TurnContext): Promise<any>;
70 /**
71 * @private
72 */
73 private processOpenCommand;
74 /**
75 * @private
76 */
77 private processAttachCommand;
78 /**
79 * @private
80 */
81 private openCommand;
82 /**
83 * @private
84 */
85 private attachCommand;
86 /**
87 * @private
88 */
89 private findSession;
90 /**
91 * @private
92 */
93 private invokeSend;
94 /**
95 * @private
96 */
97 private cleanUpSession;
98 /**
99 * @private
100 */
101 private getAttachId;
102}
103/**
104 * InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
105 *
106 * @remarks
107 * InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
108 * @deprecated This class will be removed in a future version of the framework.
109 */
110export declare class InspectionState extends BotState {
111 /**
112 * Creates a new instance of the [InspectionState](xref:botbuilder.InspectionState) class.
113 *
114 * @param storage The [Storage](xref:botbuilder-core.Storage) layer this state management object will use to store and retrieve state.
115 */
116 constructor(storage: Storage);
117 /**
118 * Gets the key to use when reading and writing state to and from storage.
119 *
120 * @param _turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
121 * @returns The storage key.
122 */
123 protected getStorageKey(_turnContext: TurnContext): string;
124}
125export {};
126//# sourceMappingURL=inspectionMiddleware.d.ts.map
\No newline at end of file