83 lines
No EOL
4.6 KiB
TypeScript
83 lines
No EOL
4.6 KiB
TypeScript
import { BotAdapter } from './botAdapter';
|
|
import { TurnContext } from './turnContext';
|
|
import { AuthenticateRequestResult, BotFrameworkAuthentication, ClaimsIdentity } from 'botframework-connector';
|
|
import { Activity, ConversationParameters, ConversationReference, InvokeResponse, ResourceResponse } from 'botframework-schema';
|
|
/**
|
|
* An adapter that implements the Bot Framework Protocol and can be hosted in different cloud environments both public and private.
|
|
*/
|
|
export declare abstract class CloudAdapterBase extends BotAdapter {
|
|
protected readonly botFrameworkAuthentication: BotFrameworkAuthentication;
|
|
readonly ConnectorFactoryKey: symbol;
|
|
readonly UserTokenClientKey: symbol;
|
|
/**
|
|
* Create a new [CloudAdapterBase](xref:botbuilder.CloudAdapterBase) instance.
|
|
*
|
|
* @param botFrameworkAuthentication A [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) used for validating and creating tokens.
|
|
*/
|
|
constructor(botFrameworkAuthentication: BotFrameworkAuthentication);
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
sendActivities(context: TurnContext, activities: Partial<Activity>[]): Promise<ResourceResponse[]>;
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
updateActivity(context: TurnContext, activity: Partial<Activity>): Promise<ResourceResponse | void>;
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
deleteActivity(context: TurnContext, reference: Partial<ConversationReference>): Promise<void>;
|
|
/**
|
|
* @inheritdoc
|
|
* @deprecated
|
|
*/
|
|
continueConversation(_reference: Partial<ConversationReference>, _logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* @internal
|
|
*/
|
|
continueConversationAsync(botAppIdOrClaimsIdentity: string | ClaimsIdentity, reference: Partial<ConversationReference>, logicOrAudience: ((context: TurnContext) => Promise<void>) | string, maybeLogic?: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
createConversationAsync(botAppId: string, channelId: string, serviceUrl: string, audience: string, conversationParameters: ConversationParameters, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
private createCreateActivity;
|
|
/**
|
|
* The implementation for continue conversation.
|
|
*
|
|
* @param claimsIdentity The [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) for the conversation.
|
|
* @param continuationActivity The continuation [Activity](xref:botframework-schema.Activity) used to create the [TurnContext](xref:botbuilder-core.TurnContext).
|
|
* @param audience The audience for the call.
|
|
* @param logic The function to call for the resulting bot turn.
|
|
* @returns a Promise representing the async operation
|
|
*/
|
|
protected processProactive(claimsIdentity: ClaimsIdentity, continuationActivity: Partial<Activity>, audience: string | undefined, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
/**
|
|
* The implementation for processing an Activity sent to this bot.
|
|
*
|
|
* @param authHeader The authorization header from the http request.
|
|
* @param activity The [Activity](xref:botframework-schema.Activity) to process.
|
|
* @param logic The function to call for the resulting bot turn.
|
|
* @returns a Promise resolving to an invoke response, or undefined.
|
|
*/
|
|
protected processActivity(authHeader: string, activity: Activity, logic: (context: TurnContext) => Promise<void>): Promise<InvokeResponse | undefined>;
|
|
/**
|
|
* The implementation for processing an Activity sent to this bot.
|
|
*
|
|
* @param authenticateRequestResult The [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult) for this turn.
|
|
* @param activity The [Activity](xref:botframework-schema.Activity) to process.
|
|
* @param logic The function to call for the resulting bot turn.
|
|
* @returns a Promise resolving to an invoke response, or undefined.
|
|
*/
|
|
protected processActivity(authenticateRequestResult: AuthenticateRequestResult, activity: Activity, logic: (context: TurnContext) => Promise<void>): Promise<InvokeResponse | undefined>;
|
|
/**
|
|
* This is a helper to create the ClaimsIdentity structure from an appId that will be added to the TurnContext.
|
|
* It is intended for use in proactive and named-pipe scenarios.
|
|
*
|
|
* @param botAppId The bot's application id.
|
|
* @returns a [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) with the audience and appId claims set to the botAppId.
|
|
*/
|
|
protected createClaimsIdentity(botAppId?: string): ClaimsIdentity;
|
|
private createTurnContext;
|
|
private processTurnResults;
|
|
}
|
|
//# sourceMappingURL=cloudAdapterBase.d.ts.map
|