69 lines
No EOL
3.9 KiB
TypeScript
69 lines
No EOL
3.9 KiB
TypeScript
import type { BotFrameworkHttpAdapter } from './botFrameworkHttpAdapter';
|
|
import { Activity, CloudAdapterBase, TurnContext } from 'botbuilder-core';
|
|
import { Request, Response } from './interfaces';
|
|
import { AuthenticateRequestResult, BotFrameworkAuthentication } from 'botframework-connector';
|
|
import { INodeBuffer, INodeSocket, INodeDuplex } from 'botframework-streaming';
|
|
/**
|
|
* An adapter that implements the Bot Framework Protocol and can be hosted in different cloud environmens both public and private.
|
|
*/
|
|
export declare class CloudAdapter extends CloudAdapterBase implements BotFrameworkHttpAdapter {
|
|
/**
|
|
* Initializes a new instance of the [CloudAdapter](xref:botbuilder:CloudAdapter) class.
|
|
*
|
|
* @param botFrameworkAuthentication Optional [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) instance
|
|
*/
|
|
constructor(botFrameworkAuthentication?: BotFrameworkAuthentication);
|
|
/**
|
|
* Process a web request by applying a logic function.
|
|
*
|
|
* @param req An incoming HTTP [Request](xref:botbuilder.Request)
|
|
* @param req The corresponding HTTP [Response](xref:botbuilder.Response)
|
|
* @param logic The logic function to apply
|
|
* @returns a promise representing the asynchronous operation.
|
|
*/
|
|
process(req: Request, res: Response, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* Handle a web socket connection by applying a logic function to
|
|
* each streaming request.
|
|
*
|
|
* @param req An incoming HTTP [Request](xref:botbuilder.Request)
|
|
* @param socket The corresponding [INodeSocket](xref:botframework-streaming.INodeSocket)
|
|
* @param head The corresponding [INodeBuffer](xref:botframework-streaming.INodeBuffer)
|
|
* @param logic The logic function to apply
|
|
* @returns a promise representing the asynchronous operation.
|
|
*/
|
|
process(req: Request, socket: INodeSocket, head: INodeBuffer, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* Handle a web socket connection by applying a logic function to
|
|
* each streaming request.
|
|
*
|
|
* @param req An incoming HTTP [Request](xref:botbuilder.Request)
|
|
* @param socket The corresponding [INodeDuplex](xref:botframework-streaming.INodeDuplex)
|
|
* @param head The corresponding [INodeBuffer](xref:botframework-streaming.INodeBuffer)
|
|
* @param logic The logic function to apply
|
|
* @returns a promise representing the asynchronous operation.
|
|
*/
|
|
process(req: Request, socket: INodeDuplex, head: INodeBuffer, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* Asynchronously process an activity running the provided logic function.
|
|
*
|
|
* @param authorization The authorization header in the format: "Bearer [longString]" or the AuthenticateRequestResult for this turn.
|
|
* @param activity The activity to process.
|
|
* @param logic The logic function to apply.
|
|
* @returns a promise representing the asynchronous operation.
|
|
*/
|
|
processActivityDirect(authorization: string | AuthenticateRequestResult, activity: Activity, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* Used to connect the adapter to a named pipe.
|
|
*
|
|
* @param pipeName Pipe name to connect to (note: yields two named pipe servers by appending ".incoming" and ".outgoing" to this name)
|
|
* @param logic The logic function to call for resulting bot turns.
|
|
* @param appId The Bot application ID
|
|
* @param audience The audience to use for outbound communication. The will vary by cloud environment.
|
|
* @param callerId Optional, the caller ID
|
|
* @param retryCount Optional, the number of times to retry a failed connection (defaults to 7)
|
|
*/
|
|
connectNamedPipe(pipeName: string, logic: (context: TurnContext) => Promise<void>, appId: string, audience: string, callerId?: string, retryCount?: number): Promise<void>;
|
|
private connect;
|
|
}
|
|
//# sourceMappingURL=cloudAdapter.d.ts.map
|