UNPKG

2.65 kBTypeScriptView Raw
1import type { BotFrameworkHttpAdapter } from './botFrameworkHttpAdapter';
2import { CloudAdapterBase, TurnContext } from 'botbuilder-core';
3import { Request, Response } from './interfaces';
4import { BotFrameworkAuthentication } from 'botframework-connector';
5import { INodeBuffer, INodeSocket } from 'botframework-streaming';
6export declare class CloudAdapter extends CloudAdapterBase implements BotFrameworkHttpAdapter {
7 /**
8 * Initializes a new instance of the [CloudAdapter](xref:botbuilder:CloudAdapter) class.
9 *
10 * @param botFrameworkAuthentication Optional [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) instance
11 */
12 constructor(botFrameworkAuthentication?: BotFrameworkAuthentication);
13 /**
14 * Process a web request by applying a logic function.
15 *
16 * @param req An incoming HTTP [Request](xref:botbuilder.Request)
17 * @param req The corresponding HTTP [Response](xref:botbuilder.Response)
18 * @param logic The logic function to apply
19 * @returns a promise representing the asynchronous operation.
20 */
21 process(req: Request, res: Response, logic: (context: TurnContext) => Promise<void>): Promise<void>;
22 /**
23 * Handle a web socket connection by applying a logic function to
24 * each streaming request.
25 *
26 * @param req An incoming HTTP [Request](xref:botbuilder.Request)
27 * @param socket The corresponding [INodeSocket](xref:botframework-streaming.INodeSocket)
28 * @param head The corresponding [INodeBuffer](xref:botframework-streaming.INodeBuffer)
29 * @param logic The logic function to apply
30 * @returns a promise representing the asynchronous operation.
31 */
32 process(req: Request, socket: INodeSocket, head: INodeBuffer, logic: (context: TurnContext) => Promise<void>): Promise<void>;
33 /**
34 * Used to connect the adapter to a named pipe.
35 *
36 * @param pipeName Pipe name to connect to (note: yields two named pipe servers by appending ".incoming" and ".outgoing" to this name)
37 * @param logic The logic function to call for resulting bot turns.
38 * @param appId The Bot application ID
39 * @param audience The audience to use for outbound communication. The will vary by cloud environment.
40 * @param callerId Optional, the caller ID
41 * @param retryCount Optional, the number of times to retry a failed connection (defaults to 7)
42 */
43 connectNamedPipe(pipeName: string, logic: (context: TurnContext) => Promise<void>, appId: string, audience: string, callerId?: string, retryCount?: number): Promise<void>;
44 private connect;
45}
46//# sourceMappingURL=cloudAdapter.d.ts.map
\No newline at end of file