UNPKG

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