botbuilder

  • Version 4.14.1
  • Published
  • 1.08 MB
  • 12 dependencies
  • MIT license

Install

npm i botbuilder
yarn add botbuilder
pnpm add botbuilder

Overview

Bot Builder is a framework for building rich bots on virtually any platform.

Index

Functions

Classes

Interfaces

Type Aliases

Functions

function teamsGetChannelId

teamsGetChannelId: (activity: any) => string | null;
  • Activity helper methods for Teams. * Activity helper methods for Teams.

function teamsGetTeamId

teamsGetTeamId: (activity: any) => string | null;
  • Gets the Team Id from the current [Activity](xref:botframework-schema.Activity).

    Parameter activity

    The current [Activity](xref:botframework-schema.Activity).

    Returns

    The current [Activity](xref:botframework-schema.Activity)'s team's Id, or null.

function teamsGetTeamInfo

teamsGetTeamInfo: (activity: any) => TeamInfo | null;
  • Gets the TeamsInfo object from the current [Activity](xref:botframework-schema.Activity).

    Parameter activity

    The current [Activity](xref:botframework-schema.Activity).

    Returns

    The current [Activity](xref:botframework-schema.Activity)'s team's info, or null.

function teamsGetTeamMeetingInfo

teamsGetTeamMeetingInfo: (activity: any) => TeamsMeetingInfo | null;
  • Gets the TeamsMeetingInfo object from the current [Activity](xref:botframework-schema.Activity).

    Parameter activity

    The current [Activity](xref:botframework-schema.Activity).

    Returns

    The current [Activity](xref:botframework-schema.Activity)'s team meeting info, or null.

function teamsGetTenant

teamsGetTenant: (activity: any) => TenantInfo | null;
  • Gets the TenantInfo object from the current [Activity](xref:botframework-schema.Activity).

    Parameter activity

    The current [Activity](xref:botframework-schema.Activity).

    Returns

    The current [Activity](xref:botframework-schema.Activity)'s tenant info, or null.

function teamsNotifyUser

teamsNotifyUser: (
activity: any,
alertInMeeting?: boolean,
externalResourceUrl?: string
) => void;
  • Configures the current [Activity](xref:botframework-schema.Activity) to generate a notification within Teams.

    Parameter activity

    The current [Activity](xref:botframework-schema.Activity).

Classes

class BotFrameworkAdapter

class BotFrameworkAdapter
extends BotAdapter
implements
BotFrameworkHttpAdapter,
ConnectorClientBuilder,
ExtendedUserTokenProvider,
RequestHandler {}
  • A [BotAdapter](xref:botbuilder-core.BotAdapter) that can connect a bot to a service endpoint. Implements [IUserTokenProvider](xref:botbuilder-core.IUserTokenProvider).

    Remarks

    The bot adapter encapsulates authentication processes and sends activities to and receives activities from the Bot Connector Service. When your bot receives an activity, the adapter creates a turn context object, passes it to your bot application logic, and sends responses back to the user's channel.

    The adapter processes and directs incoming activities in through the bot middleware pipeline to your bot logic and then back out again. As each activity flows in and out of the bot, each piece of middleware can inspect or act upon the activity, both before and after the bot logic runs. Use the [use](xref:botbuilder-core.BotAdapter.use) method to add [Middleware](xref:botbuilder-core.Middleware) objects to your adapter's middleware collection.

    For more information, see the articles on [How bots work](https://docs.microsoft.com/azure/bot-service/bot-builder-basics) and [Middleware](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-middleware).

    For example:

    const { BotFrameworkAdapter } = require('botbuilder');
    const adapter = new BotFrameworkAdapter({
    appId: process.env.MicrosoftAppId,
    appPassword: process.env.MicrosoftAppPassword
    });
    adapter.onTurnError = async (context, error) => {
    // Catch-all logic for errors.
    };

constructor

constructor(settings?: Partial<BotFrameworkAdapterSettings>);
  • Creates a new instance of the [BotFrameworkAdapter](xref:botbuilder.BotFrameworkAdapter) class.

    Parameter settings

    Optional. The settings to use for this adapter instance.

    Remarks

    If the settings parameter does not include [channelService](xref:botbuilder.BotFrameworkAdapterSettings.channelService) or [openIdMetadata](xref:botbuilder.BotFrameworkAdapterSettings.openIdMetadata) values, the constructor checks the process' environment variables for these values. These values may be set when a bot is provisioned on Azure and if so are required for the bot to work properly in the global cloud or in a national cloud.

    The [BotFrameworkAdapterSettings](xref:botbuilder.BotFrameworkAdapterSettings) class defines the available adapter settings.

property credentials

protected readonly credentials: any;

    property credentialsProvider

    protected readonly credentialsProvider: any;

      property isStreamingConnectionOpen

      readonly isStreamingConnectionOpen: boolean;
      • Used in streaming contexts to check if the streaming connection is still open for the bot to send activities.

      property settings

      protected readonly settings: BotFrameworkAdapterSettings;

        property TokenApiClientCredentialsKey

        readonly TokenApiClientCredentialsKey: Symbol;

          method authenticateRequest

          protected authenticateRequest: (
          request: any,
          authHeader: string
          ) => Promise<void>;
          • Allows for the overriding of authentication in unit tests.

            Parameter request

            Received request.

            Parameter authHeader

            Received authentication header.

          method buildCredentials

          protected buildCredentials: (
          appId: string,
          oAuthScope?: string
          ) => Promise<AppCredentials>;
          • Parameter appId

            Parameter oAuthScope

            Remarks

            When building credentials for bot-to-bot communication, oAuthScope must be passed in.

          method checkEmulatingOAuthCards

          protected checkEmulatingOAuthCards: (context: any) => void;
          • Checks the environment and can set a flag to emulate OAuth cards.

            Parameter context

            The context object for the turn.

            Remarks

            Override this in a derived class to control how OAuth cards are emulated for unit testing.

          method continueConversation

          continueConversation: {
          (reference: any, logic: (context: any) => Promise<void>): Promise<void>;
          (
          reference: any,
          oAuthScope: string,
          logic: (context: any) => Promise<void>
          ): Promise<void>;
          };
          • Asynchronously resumes a conversation with a user, possibly after some time has gone by.

            Parameter reference

            A reference to the conversation to continue.

            Parameter oAuthScope

            The intended recipient of any sent activities.

            Parameter logic

            The asynchronous method to call after the adapter middleware runs.

            Remarks

            This is often referred to as a _proactive notification_, the bot can proactively send a message to a conversation or user without waiting for an incoming message. For example, a bot can use this method to send notifications or coupons to a user.

            To send a proactive message: 1. Save a copy of a [ConversationReference](xref:botframework-schema.ConversationReference) from an incoming activity. For example, you can store the conversation reference in a database. 1. Call this method to resume the conversation at a later time. Use the saved reference to access the conversation. 1. On success, the adapter generates a [TurnContext](xref:botbuilder-core.TurnContext) object and calls the logic function handler. Use the logic function to send the proactive message.

            To copy the reference from any incoming activity in the conversation, use the [TurnContext.getConversationReference](xref:botbuilder-core.TurnContext.getConversationReference) method.

            This method is similar to the [processActivity](xref:botbuilder.BotFrameworkAdapter.processActivity) method. The adapter creates a [TurnContext](xref:botbuilder-core.TurnContext) and routes it through its middleware before calling the logic handler. The created activity will have a [type](xref:botframework-schema.Activity.type) of 'event' and a [name](xref:botframework-schema.Activity.name) of 'continueConversation'.

            For example:

            server.post('/api/notifyUser', async (req, res) => {
            // Lookup previously saved conversation reference.
            const reference = await findReference(req.body.refId);
            // Proactively notify the user.
            if (reference) {
            await adapter.continueConversation(reference, async (context) => {
            await context.sendActivity(req.body.message);
            });
            res.send(200);
            } else {
            res.send(404);
            }
            });
          • Asynchronously resumes a conversation with a user, possibly after some time has gone by.

            Parameter reference

            [ConversationReference](xref:botframework-schema.ConversationReference) of the conversation to continue.

            Parameter oAuthScope

            The intended recipient of any sent activities or the function to call to continue the conversation.

            Parameter logic

            Optional. The asynchronous method to call after the adapter middleware runs.

          method createConnectorClient

          createConnectorClient: (serviceUrl: string) => any;
          • Creates a connector client.

            Parameter serviceUrl

            The client's service URL.

            Remarks

            Override this in a derived class to create a mock connector client for unit testing.

          method createConnectorClientWithIdentity

          createConnectorClientWithIdentity: {
          (serviceUrl: string, identity: any): Promise<ConnectorClient>;
          (serviceUrl: string, identity: any, audience: string): Promise<any>;
          };
          • Create a ConnectorClient with a ClaimsIdentity.

            Parameter serviceUrl

            The client's service URL.

            Parameter identity

            ClaimsIdentity

            Remarks

            If the ClaimsIdentity contains the claims for a Skills request, create a ConnectorClient for use with Skills. Derives the correct audience from the ClaimsIdentity, or the instance's credentials property.

          • Create a ConnectorClient with a ClaimsIdentity and an explicit audience.

            Parameter serviceUrl

            The client's service URL.

            Parameter identity

            ClaimsIdentity

            Parameter audience

            The recipient of the ConnectorClient's messages. Normally the Bot Framework Channel Service or the AppId of another bot.

            Remarks

            If the trimmed audience is not a non-zero length string, the audience will be derived from the ClaimsIdentity or the instance's credentials property.

          method createContext

          protected createContext: (request: any) => any;
          • Creates a turn context.

            Parameter request

            An incoming request body.

            Remarks

            Override this in a derived class to modify how the adapter creates a turn context.

          method createConversation

          createConversation: {
          (reference: any, logic: (context: any) => Promise<void>): Promise<void>;
          (
          reference: any,
          parameters: any,
          logic: (context: any) => Promise<void>
          ): Promise<void>;
          };
          • Asynchronously creates and starts a conversation with a user on a channel.

            Parameter reference

            A reference for the conversation to create.

            Parameter logic

            The asynchronous method to call after the adapter middleware runs.

            Returns

            {Promise} a promise representing the asynchronous operation

            To use this method, you need both the bot's and the user's account information on a channel. The Bot Connector service supports the creating of group conversations; however, this method and most channels only support initiating a direct message (non-group) conversation.

            To create and start a new conversation: 1. Get a copy of a [ConversationReference](xref:botframework-schema.ConversationReference) from an incoming activity. 1. Set the [user](xref:botframework-schema.ConversationReference.user) property to the [ChannelAccount](xref:botframework-schema.ChannelAccount) value for the intended recipient. 1. Call this method to request that the channel create a new conversation with the specified user. 1. On success, the adapter generates a turn context and calls the logic function handler.

            To get the initial reference, use the [TurnContext.getConversationReference](xref:botbuilder-core.TurnContext.getConversationReference) method on any incoming activity in the conversation.

            If the channel establishes the conversation, the generated event activity's [conversation](xref:botframework-schema.Activity.conversation) property will contain the ID of the new conversation.

            This method is similar to the [processActivity](xref:botbuilder.BotFrameworkAdapter.processActivity) method. The adapter creates a [TurnContext](xref:botbuilder-core.TurnContext) and routes it through middleware before calling the logic handler. The created activity will have a [type](xref:botframework-schema.Activity.type) of 'event' and a [name](xref:botframework-schema.Activity.name) of 'createConversation'.

            For example:

            // Get group members conversation reference
            const reference = TurnContext.getConversationReference(context.activity);
            // ...
            // Start a new conversation with the user
            await adapter.createConversation(reference, async (ctx) => {
            await ctx.sendActivity(`Hi (in private)`);
            });
          • Asynchronously creates and starts a conversation with a user on a channel.

            Parameter reference

            A reference for the conversation to create.

            Parameter parameters

            Parameters used when creating the conversation

            Parameter logic

            The asynchronous method to call after the adapter middleware runs.

            Returns

            {Promise} a promise representing the asynchronous operation

          method createTokenApiClient

          protected createTokenApiClient: (
          serviceUrl: string,
          oAuthAppCredentials?: any
          ) => any;
          • Creates an OAuth API client.

            Parameter serviceUrl

            The client's service URL.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

            Remarks

            Override this in a derived class to create a mock OAuth API client for unit testing.

          method deleteActivity

          deleteActivity: (context: any, reference: any) => Promise<void>;
          • Asynchronously deletes an existing activity.

            This interface supports the framework and is not intended to be called directly for your code. Use [TurnContext.deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) to delete an activity from your bot code.

            Parameter context

            The context object for the turn.

            Parameter reference

            Conversation reference information for the activity to delete.

            Remarks

            Not all channels support this operation. For channels that don't, this call may throw an exception.

          method deleteConversationMember

          deleteConversationMember: (context: any, memberId: string) => Promise<void>;
          • Asynchronously removes a member from the current conversation.

            Parameter context

            The context object for the turn.

            Parameter memberId

            The ID of the member to remove from the conversation.

            Remarks

            Remove a member's identity information from the conversation.

            Not all channels support this operation. For channels that don't, this call may throw an exception.

          method emulateOAuthCards

          emulateOAuthCards: (
          contextOrServiceUrl: TurnContext | string,
          emulate: boolean
          ) => Promise<void>;
          • Asynchronously sends an emulated OAuth card for a channel.

            This method supports the framework and is not intended to be called directly for your code.

            Parameter contextOrServiceUrl

            The URL of the emulator.

            Parameter emulate

            true to send an emulated OAuth card to the emulator; or false to not send the card.

            Remarks

            When testing a bot in the Bot Framework Emulator, this method can emulate the OAuth card interaction.

          method exchangeToken

          exchangeToken: (
          context: any,
          connectionName: string,
          userId: string,
          tokenExchangeRequest: any,
          appCredentials?: any
          ) => Promise<TokenResponse>;
          • Asynchronously Performs a token exchange operation such as for single sign-on.

            Parameter context

            Context for the current turn of conversation with the user.

            Parameter connectionName

            Name of the auth connection to use.

            Parameter userId

            The user id that will be associated with the token.

            Parameter tokenExchangeRequest

            The exchange request details, either a token to exchange or a uri to exchange.

            Parameter appCredentials

            Optional. The CoreAppCredentials for OAuth.

          method getAadTokens

          getAadTokens: {
          (context: any, connectionName: string, resourceUrls: string[]): Promise<{
          [propertyName: string]: any;
          }>;
          (
          context: any,
          connectionName: string,
          resourceUrls: string[],
          oAuthAppCredentials?: any
          ): Promise<{ [propertyName: string]: any }>;
          };
          • Asynchronously signs out the user from the token server.

            Parameter context

            The context object for the turn.

            Parameter connectionName

            The name of the auth connection to use.

            Parameter resourceUrls

            The list of resource URLs to retrieve tokens for.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

            Returns

            A map of the [TokenResponse](xref:botframework-schema.TokenResponse) objects by resource URL.

          method getActivityMembers

          getActivityMembers: (
          context: any,
          activityId?: string
          ) => Promise<ChannelAccount[]>;
          • Asynchronously lists the members of a given activity.

            Parameter context

            The context object for the turn.

            Parameter activityId

            Optional. The ID of the activity to get the members of. If not specified, the current activity ID is used.

            Returns

            An array of [ChannelAccount](xref:botframework-schema.ChannelAccount) objects for the users involved in a given activity.

            Remarks

            Returns an array of [ChannelAccount](xref:botframework-schema.ChannelAccount) objects for the users involved in a given activity.

            This is different from [getConversationMembers](xref:botbuilder.BotFrameworkAdapter.getConversationMembers) in that it will return only those users directly involved in the activity, not all members of the conversation.

          method getConversationMembers

          getConversationMembers: (context: any) => Promise<ChannelAccount[]>;
          • Asynchronously lists the members of the current conversation.

            Parameter context

            The context object for the turn.

            Returns

            An array of [ChannelAccount](xref:botframework-schema.ChannelAccount) objects for all users currently involved in a conversation.

            Remarks

            Returns an array of [ChannelAccount](xref:botframework-schema.ChannelAccount) objects for all users currently involved in a conversation.

            This is different from [getActivityMembers](xref:botbuilder.BotFrameworkAdapter.getActivityMembers) in that it will return all members of the conversation, not just those directly involved in a specific activity.

          method getConversations

          getConversations: (
          contextOrServiceUrl: TurnContext | string,
          continuationToken?: string
          ) => Promise<ConversationsResult>;
          • For the specified channel, asynchronously gets a page of the conversations in which this bot has participated.

            Parameter contextOrServiceUrl

            The URL of the channel server to query or a [TurnContext](xref:botbuilder-core.TurnContext) object from a conversation on the channel.

            Parameter continuationToken

            Optional. The continuation token from the previous page of results. Omit this parameter or use undefined to retrieve the first page of results.

            Returns

            A [ConversationsResult](xref:botframework-schema.ConversationsResult) object containing a page of results and a continuation token.

            Remarks

            The the return value's [conversations](xref:botframework-schema.ConversationsResult.conversations) property contains a page of [ConversationMembers](xref:botframework-schema.ConversationMembers) objects. Each object's [id](xref:botframework-schema.ConversationMembers.id) is the ID of a conversation in which the bot has participated on this channel. This method can be called from outside the context of a conversation, as only the bot's service URL and credentials are required.

            The channel batches results in pages. If the result's [continuationToken](xref:botframework-schema.ConversationsResult.continuationToken) property is not empty, then there are more pages to get. Use the returned token to get the next page of results. If the contextOrServiceUrl parameter is a [TurnContext](xref:botbuilder-core.TurnContext), the URL of the channel server is retrieved from contextOrServiceUrl.[activity](xref:botbuilder-core.TurnContext.activity).[serviceUrl](xref:botframework-schema.Activity.serviceUrl).

          getSignInLink: {
          (
          context: any,
          connectionName: string,
          oAuthAppCredentials?: any,
          userId?: string,
          finalRedirect?: string
          ): Promise<string>;
          (
          context: any,
          connectionName: string,
          oAuthAppCredentials?: any,
          userId?: string,
          finalRedirect?: string
          ): Promise<string>;
          };
          • Asynchronously gets a sign-in link from the token server that can be sent as part of a [SigninCard](xref:botframework-schema.SigninCard).

            Parameter context

            The context object for the turn.

            Parameter connectionName

            The name of the auth connection to use.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

            Parameter userId

            The user id that will be associated with the token.

            Parameter finalRedirect

            The final URL that the OAuth flow will redirect to.

          method getSignInResource

          getSignInResource: (
          context: any,
          connectionName: string,
          userId?: string,
          finalRedirect?: string,
          appCredentials?: any
          ) => Promise<SignInUrlResponse>;
          • Asynchronously Get the raw signin resource to be sent to the user for signin.

            Parameter context

            The context object for the turn.

            Parameter connectionName

            The name of the auth connection to use.

            Parameter userId

            The user id that will be associated with the token.

            Parameter finalRedirect

            The final URL that the OAuth flow will redirect to.

            Returns

            The [BotSignInGetSignInResourceResponse](xref:botframework-connector.BotSignInGetSignInResourceResponse) object.

          method getTokenStatus

          getTokenStatus: {
          (context: any, userId?: string, includeFilter?: string): Promise<
          TokenStatus[]
          >;
          (
          context: any,
          userId?: string,
          includeFilter?: string,
          oAuthAppCredentials?: any
          ): Promise<any[]>;
          };
          • Asynchronously retrieves the token status for each configured connection for the given user.

            Parameter context

            The context object for the turn.

            Parameter userId

            Optional. If present, the ID of the user to retrieve the token status for. Otherwise, the ID of the user who sent the current activity is used.

            Parameter includeFilter

            Optional. A comma-separated list of connection's to include. If present, the includeFilter parameter limits the tokens this method returns.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

            Returns

            The [TokenStatus](xref:botframework-connector.TokenStatus) objects retrieved.

          method getUserToken

          getUserToken: {
          (
          context: any,
          connectionName: string,
          magicCode?: string
          ): Promise<TokenResponse>;
          (
          context: any,
          connectionName: string,
          magicCode?: string,
          oAuthAppCredentials?: any
          ): Promise<any>;
          };
          • Asynchronously attempts to retrieve the token for a user that's in a login flow.

            Parameter context

            The context object for the turn.

            Parameter connectionName

            The name of the auth connection to use.

            Parameter magicCode

            Optional. The validation code the user entered.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

            Returns

            A [TokenResponse](xref:botframework-schema.TokenResponse) object that contains the user token.

          method oauthApiUrl

          protected oauthApiUrl: (contextOrServiceUrl: TurnContext | string) => string;
          • Gets the OAuth API endpoint.

            Parameter contextOrServiceUrl

            The URL of the channel server to query or a [TurnContext](xref:botbuilder-core.TurnContext). For a turn context, the context's [activity](xref:botbuilder-core.TurnContext.activity).[serviceUrl](xref:botframework-schema.Activity.serviceUrl) is used for the URL.

            Remarks

            Override this in a derived class to create a mock OAuth API endpoint for unit testing.

          method process

          process: {
          (
          req: Request,
          res: Response,
          logic: (context: any) => Promise<void>
          ): Promise<void>;
          (
          req: Request<Record<string, unknown>, Record<string, string | string[]>>,
          socket: any,
          head: any,
          logic: (context: any) => Promise<void>
          ): Promise<void>;
          };
          • Process a web request by applying a logic function.

            Parameter req

            An incoming HTTP [Request](xref:botbuilder.Request)

            Parameter req

            The corresponding HTTP [Response](xref:botbuilder.Response)

            Parameter logic

            The logic function to apply

            Returns

            a promise representing the asynchronous operation.

          • Handle a web socket connection by applying a logic function to each streaming request.

            Parameter req

            An incoming HTTP [Request](xref:botbuilder.Request)

            Parameter socket

            The corresponding [INodeSocket](xref:botframework-streaming.INodeSocket)

            Parameter head

            The corresponding [INodeBuffer](xref:botframework-streaming.INodeBuffer)

            Parameter logic

            The logic function to apply

            Returns

            a promise representing the asynchronous operation.

          method processActivity

          processActivity: (
          req: WebRequest,
          res: WebResponse,
          logic: (context: any) => Promise<any>
          ) => Promise<void>;
          • Asynchronously creates a turn context and runs the middleware pipeline for an incoming activity.

            Parameter req

            An Express or Restify style request object.

            Parameter res

            An Express or Restify style response object.

            Parameter logic

            The function to call at the end of the middleware pipeline.

            Remarks

            This is the main way a bot receives incoming messages and defines a turn in the conversation. This method:

            1. Parses and authenticates an incoming request. - The activity is read from the body of the incoming request. An error will be returned if the activity can't be parsed. - The identity of the sender is authenticated as either the Emulator or a valid Microsoft server, using the bot's appId and appPassword. The request is rejected if the sender's identity is not verified. 1. Creates a [TurnContext](xref:botbuilder-core.TurnContext) object for the received activity. - This object is wrapped with a [revocable proxy](https://www.ecma-international.org/ecma-262/6.0/#sec-proxy.revocable). - When this method completes, the proxy is revoked. 1. Sends the turn context through the adapter's middleware pipeline. 1. Sends the turn context to the logic function. - The bot may perform additional routing or processing at this time. Returning a promise (or providing an async handler) will cause the adapter to wait for any asynchronous operations to complete. - After the logic function completes, the promise chain set up by the middleware is resolved.

            > [!TIP] > If you see the error TypeError: Cannot perform 'set' on a proxy that has been revoked > in your bot's console output, the likely cause is that an async function was used > without using the await keyword. Make sure all async functions use await!

            Middleware can _short circuit_ a turn. When this happens, subsequent middleware and the logic function is not called; however, all middleware prior to this point still run to completion. For more information about the middleware pipeline, see the [how bots work](https://docs.microsoft.com/azure/bot-service/bot-builder-basics) and [middleware](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-middleware) articles. Use the adapter's [use](xref:botbuilder-core.BotAdapter.use) method to add middleware to the adapter.

            For example:

            server.post('/api/messages', (req, res) => {
            // Route received request to adapter for processing
            adapter.processActivity(req, res, async (context) => {
            // Process any messages received
            if (context.activity.type === ActivityTypes.Message) {
            await context.sendActivity(`Hello World`);
            }
            });
            });

          method processActivityDirect

          processActivityDirect: (
          activity: any,
          logic: (context: any) => Promise<any>
          ) => Promise<void>;
          • Asynchronously creates a turn context and runs the middleware pipeline for an incoming activity.

            Parameter activity

            The activity to process.

            Parameter logic

            The function to call at the end of the middleware pipeline.

            Remarks

            This is the main way a bot receives incoming messages and defines a turn in the conversation. This method:

            1. Creates a [TurnContext](xref:botbuilder-core.TurnContext) object for the received activity. - This object is wrapped with a [revocable proxy](https://www.ecma-international.org/ecma-262/6.0/#sec-proxy.revocable). - When this method completes, the proxy is revoked. 1. Sends the turn context through the adapter's middleware pipeline. 1. Sends the turn context to the logic function. - The bot may perform additional routing or processing at this time. Returning a promise (or providing an async handler) will cause the adapter to wait for any asynchronous operations to complete. - After the logic function completes, the promise chain set up by the middleware is resolved.

            Middleware can _short circuit_ a turn. When this happens, subsequent middleware and the logic function is not called; however, all middleware prior to this point still run to completion. For more information about the middleware pipeline, see the [how bots work](https://docs.microsoft.com/azure/bot-service/bot-builder-basics) and [middleware](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-middleware) articles. Use the adapter's [use](xref:botbuilder-core.BotAdapter.use) method to add middleware to the adapter.

          method processRequest

          processRequest: (request: any) => Promise<StreamingResponse>;
          • Checks the validity of the request and attempts to map it the correct virtual endpoint, then generates and returns a response if appropriate.

            Parameter request

            A ReceiveRequest from the connected channel.

            Returns

            A response created by the BotAdapter to be sent to the client that originated the request.

          method sendActivities

          sendActivities: (
          context: any,
          activities: Partial<Activity>[]
          ) => Promise<ResourceResponse[]>;
          • Asynchronously sends a set of outgoing activities to a channel server.

            This method supports the framework and is not intended to be called directly for your code. Use the turn context's [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) or [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) method from your bot code.

            Parameter context

            The context object for the turn.

            Parameter activities

            The activities to send.

            Returns

            An array of [ResourceResponse](xref:)

            Remarks

            The activities will be sent one after another in the order in which they're received. A response object will be returned for each sent activity. For message activities this will contain the ID of the delivered message.

          method signOutUser

          signOutUser: {
          (context: any, connectionName?: string, userId?: string): Promise<void>;
          (
          context: any,
          connectionName?: string,
          userId?: string,
          oAuthAppCredentials?: any
          ): Promise<void>;
          };
          • Asynchronously signs out the user from the token server.

            Parameter context

            The context object for the turn.

            Parameter connectionName

            The name of the auth connection to use.

            Parameter userId

            The ID of user to sign out.

            Parameter oAuthAppCredentials

            AppCredentials for OAuth.

          method updateActivity

          updateActivity: (
          context: any,
          activity: any
          ) => Promise<ResourceResponse | void>;
          • Asynchronously replaces a previous activity with an updated version.

            This interface supports the framework and is not intended to be called directly for your code. Use [TurnContext.updateActivity](xref:botbuilder-core.TurnContext.updateActivity) to update an activity from your bot code.

            Parameter context

            The context object for the turn.

            Parameter activity

            The updated version of the activity to replace.

            Remarks

            Not all channels support this operation. For channels that don't, this call may throw an exception.

          method useNamedPipe

          useNamedPipe: (
          logic: (context: any) => Promise<any>,
          pipeName?: string,
          retryCount?: number,
          onListen?: () => void
          ) => Promise<void>;
          • Connects the handler to a Named Pipe server and begins listening for incoming requests.

            Parameter logic

            The logic that will handle incoming requests.

            Parameter pipeName

            The name of the named pipe to use when creating the server.

            Parameter retryCount

            Number of times to attempt to bind incoming and outgoing pipe

            Parameter onListen

            Optional callback that fires once when server is listening on both incoming and outgoing pipe

          method useWebSocket

          useWebSocket: (
          req: WebRequest,
          socket: any,
          head: any,
          logic: (context: any) => Promise<any>
          ) => Promise<void>;
          • Process the initial request to establish a long lived connection via a streaming server.

            Parameter req

            The connection request.

            Parameter socket

            The raw socket connection between the bot (server) and channel/caller (client).

            Parameter head

            The first packet of the upgraded stream.

            Parameter logic

            The logic that handles incoming streaming requests for the lifetime of the WebSocket connection.

          class BotFrameworkHttpClient

          class BotFrameworkHttpClient implements BotFrameworkClient {}
          • HttpClient for calling skills from a Node.js BotBuilder V4 SDK bot.

          constructor

          constructor(credentialProvider: any, channelService?: string);
          • Creates a new instance of the [BotFrameworkHttpClient](xref:botbuilder.BotFrameworkHttpClient) class

            Parameter credentialProvider

            An instance of [ICredentialProvider](xref:botframework-connector.ICredentialProvider).

            Parameter channelService

            Optional. The channel service.

          property channelService

          protected readonly channelService: string;

            method buildCredentials

            protected buildCredentials: (
            appId: string,
            oAuthScope?: string
            ) => Promise<AppCredentials>;
            • Logic to build an [AppCredentials](xref:botframework-connector.AppCredentials) to be used to acquire tokens for this HttpClient.

              Parameter appId

              The application id.

              Parameter oAuthScope

              Optional. The OAuth scope.

              Returns

              The app credentials to be used to acquire tokens.

            method postActivity

            postActivity: <T = any>(
            fromBotId: string,
            toBotId: string,
            toUrl: string,
            serviceUrl: string,
            conversationId: string,
            activity: any
            ) => Promise<InvokeResponse<T>>;
            • Forwards an activity to another bot.

              Parameter fromBotId

              The MicrosoftAppId of the bot sending the activity.

              Parameter toBotId

              The MicrosoftAppId of the bot receiving the activity.

              Parameter toUrl

              The URL of the bot receiving the activity.

              Parameter serviceUrl

              The callback Url for the skill host.

              Parameter conversationId

              A conversation ID to use for the conversation with the skill.

              Parameter activity

              Activity to forward.

              Remarks

              T The type of body in the InvokeResponse.

            class ChannelServiceHandler

            class ChannelServiceHandler extends ChannelServiceHandlerBase {}
            • The ChannelServiceHandler implements API to forward activity to a skill and implements routing ChannelAPI calls from the Skill up through the bot/adapter.

            constructor

            constructor(credentialProvider: any, authConfig: any, channelService?: string);
            • Initializes a new instance of the ChannelServiceHandler class, using a credential provider.

              Parameter credentialProvider

              The credential provider.

              Parameter authConfig

              The authentication configuration.

              Parameter channelService

              A string representing the channel provider.

            property channelService

            protected readonly channelService: string;

              method authenticate

              protected authenticate: (authHeader: string) => Promise<ClaimsIdentity>;

                class ChannelServiceHandlerBase

                abstract class ChannelServiceHandlerBase {}
                • The ChannelServiceHandlerBase implements API to forward activity to a skill and implements routing ChannelAPI calls from the Skill up through the bot/adapter.

                method authenticate

                protected abstract authenticate: (authHeader: string) => Promise<ClaimsIdentity>;
                • Helper to authenticate the header token and extract the claims.

                  Parameter authHeader

                  HTTP authorization header

                  Returns

                  a promise resolving to the authorization header claims

                method handleCreateConversation

                handleCreateConversation: (
                authHeader: string,
                parameters: any
                ) => Promise<ConversationResourceResponse>;
                • Creates a new Conversation.

                  Parameter authHeader

                  The authentication header.

                  Parameter parameters

                  [ConversationParameters](xref:botbuilder-core.ConversationParameters) to create the conversation from.

                  Returns

                  A Promise representation for the operation.

                method handleDeleteActivity

                handleDeleteActivity: (
                authHeader: string,
                conversationId: string,
                activityId: string
                ) => Promise<void>;
                • Deletes an existing [Activity](xref:botframework-schema.Activity).

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter activityId

                  The activity Id to delete.

                method handleDeleteConversationMember

                handleDeleteConversationMember: (
                authHeader: string,
                conversationId: string,
                memberId: string
                ) => Promise<void>;
                • Deletes a member from a conversation.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter memberId

                  Id of the member to delete from this conversation.

                method handleGetActivityMembers

                handleGetActivityMembers: (
                authHeader: string,
                conversationId: string,
                activityId: string
                ) => Promise<ChannelAccount[]>;
                • Enumerates the members of an [Activity](xref:botframework-schema.Activity).

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter activityId

                  The activity Id.

                  Returns

                  The enumerated [ChannelAccount](xref:botframework-schema.ChannelAccount) list.

                method handleGetConversationMembers

                handleGetConversationMembers: (
                authHeader: string,
                conversationId: string
                ) => Promise<ChannelAccount[]>;
                • Enumerates the members of a conversation.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Returns

                  The enumerated [ChannelAccount](xref:botframework-schema.ChannelAccount) list.

                method handleGetConversationPagedMembers

                handleGetConversationPagedMembers: (
                authHeader: string,
                conversationId: string,
                pageSize?: number,
                continuationToken?: string
                ) => Promise<PagedMembersResult>;
                • Enumerates the members of a conversation one page at a time.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter pageSize

                  Suggested page size.

                  Parameter continuationToken

                  A continuation token.

                  Returns

                  A Promise representing the [PagedMembersResult](xref:botframework-schema.PagedMembersResult) for the operation.

                method handleGetConversations

                handleGetConversations: (
                authHeader: string,
                conversationId: string,
                continuationToken?: string
                ) => Promise<ConversationsResult>;
                • Lists the Conversations in which the bot has participated.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter continuationToken

                  A skip or continuation token.

                  Returns

                  A Promise representation for the operation.

                method handleReplyToActivity

                handleReplyToActivity: (
                authHeader: string,
                conversationId: string,
                activityId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • Sends a reply to an [Activity](xref:botframework-schema.Activity).

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter activityId

                  The activity Id the reply is to.

                  Parameter activity

                  The [Activity](xref:botframework-schema.Activity) to send.

                  Returns

                  A Promise representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation.

                method handleSendConversationHistory

                handleSendConversationHistory: (
                authHeader: string,
                conversationId: string,
                transcript: any
                ) => Promise<ResourceResponse>;
                • Uploads the historic activities of the conversation.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter transcript

                  [Transcript](xref:botframework-schema.Transcript) of activities.

                  Returns

                  A Promise representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation.

                method handleSendToConversation

                handleSendToConversation: (
                authHeader: string,
                conversationId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • Sends an [Activity](xref:botframework-schema.Activity) to the end of a conversation.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter activity

                  The [Activity](xref:botframework-schema.Activity) to send.

                  Returns

                  A Promise representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation.

                method handleUpdateActivity

                handleUpdateActivity: (
                authHeader: string,
                conversationId: string,
                activityId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • Edits a previously sent existing [Activity](xref:botframework-schema.Activity).

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter activityId

                  The activity Id to update.

                  Parameter activity

                  The replacement [Activity](xref:botframework-schema.Activity).

                  Returns

                  A Promise representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation.

                method handleUploadAttachment

                handleUploadAttachment: (
                authHeader: string,
                conversationId: string,
                attachmentUpload: any
                ) => Promise<ResourceResponse>;
                • Stores data in a compliant store when dealing with enterprises.

                  Parameter authHeader

                  The authentication header.

                  Parameter conversationId

                  The conversation Id.

                  Parameter attachmentUpload

                  [AttachmentData](xref:botframework-schema.AttachmentData).

                  Returns

                  A Promise representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation.

                method onCreateConversation

                protected onCreateConversation: (
                claimsIdentity: any,
                parameters: any
                ) => Promise<ConversationResourceResponse>;
                • CreateConversation() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter parameters

                  Parameters to create the conversation from.

                  Remarks

                  Create a new Conversation.

                  POST to this method with a * Bot being the bot creating the conversation * IsGroup set to true if this is not a direct message (default is false) * Array containing the members to include in the conversation

                  The return value is a ResourceResponse which contains a conversation id which is suitable for use in the message payload and REST API uris.

                  Most channels only support the semantics of bots initiating a direct message conversation.

                method onDeleteActivity

                protected onDeleteActivity: (
                claimsIdentity: any,
                conversationId: string,
                activityId: string
                ) => Promise<void>;
                • DeleteActivity() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter activityId

                  activityId to delete.

                  Remarks

                  Delete an existing activity.

                  Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity.

                method onDeleteConversationMember

                protected onDeleteConversationMember: (
                claimsIdentity: any,
                conversationId: string,
                memberId: string
                ) => Promise<void>;
                • DeleteConversationMember() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter memberId

                  ID of the member to delete from this conversation.

                  Remarks

                  Deletes a member from a conversation.

                  This REST API takes a ConversationId and a memberId (of type string) and removes that member from the conversation. If that member was the last member of the conversation, the conversation will also be deleted.

                method onGetActivityMembers

                protected onGetActivityMembers: (
                claimsIdentity: any,
                conversationId: string,
                activityId: string
                ) => Promise<ChannelAccount[]>;
                • GetActivityMembers() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter activityId

                  Activity ID.

                  Remarks

                  Enumerate the members of an activity.

                  This REST API takes a ConversationId and a ActivityId, returning an array of ChannelAccount objects representing the members of the particular activity in the conversation.

                method onGetConversationMembers

                protected onGetConversationMembers: (
                claimsIdentity: any,
                conversationId: string
                ) => Promise<ChannelAccount[]>;
                • getConversationMembers() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Remarks

                  Enumerate the members of a conversation.

                  This REST API takes a ConversationId and returns an array of ChannelAccount objects representing the members of the conversation.

                method onGetConversationPagedMembers

                protected onGetConversationPagedMembers: (
                claimsIdentity: any,
                conversationId: string,
                pageSize?: number,
                continuationToken?: string
                ) => Promise<PagedMembersResult>;
                • getConversationPagedMembers() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter pageSize

                  Suggested page size.

                  Parameter continuationToken

                  Continuation Token.

                  Remarks

                  Enumerate the members of a conversation one page at a time.

                  This REST API takes a ConversationId. Optionally a pageSize and/or continuationToken can be provided. It returns a PagedMembersResult, which contains an array of ChannelAccounts representing the members of the conversation and a continuation token that can be used to get more values.

                  One page of ChannelAccounts records are returned with each call. The number of records in a page may vary between channels and calls. The pageSize parameter can be used as a suggestion. If there are no additional results the response will not contain a continuation token. If there are no members in the conversation the Members will be empty or not present in the response.

                  A response to a request that has a continuation token from a prior request may rarely return members from a previous request.

                method onGetConversations

                protected onGetConversations: (
                claimsIdentity: any,
                conversationId: string,
                continuationToken?: string
                ) => Promise<ConversationsResult>;
                • onGetConversations() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter continuationToken

                  Skip or continuation token.

                  Remarks

                  List the Conversations in which this bot has participated.

                  GET from this method with a skip token

                  The return value is a ConversationsResult, which contains an array of ConversationMembers and a skip token. If the skip token is not empty, then there are further values to be returned. Call this method again with the returned token to get more values.

                  Each ConversationMembers object contains the ID of the conversation and an array of ChannelAccounts that describe the members of the conversation.

                method onReplyToActivity

                protected onReplyToActivity: (
                claimsIdentity: any,
                conversationId: string,
                activityId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • ReplyToActivity() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter activityId

                  activityId the reply is to (OPTIONAL).

                  Parameter activity

                  Activity to send.

                  Remarks

                  This method allows you to reply to an activity.

                  This is slightly different from SendToConversation(). * SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation.

                  Use ReplyToActivity when replying to a specific activity in the conversation.

                  Use SendToConversation in all other cases.

                method onSendConversationHistory

                protected onSendConversationHistory: (
                claimsIdentity: any,
                conversationId: string,
                transcript: any
                ) => Promise<ResourceResponse>;
                • SendConversationHistory() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter transcript

                  Transcript of activities.

                  Remarks

                  This method allows you to upload the historic activities to the conversation.

                  Sender must ensure that the historic activities have unique ids and appropriate timestamps. The ids are used by the client to deal with duplicate activities and the timestamps are used by the client to render the activities in the right order.

                method onSendToConversation

                protected onSendToConversation: (
                claimsIdentity: any,
                conversationId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • SendToConversation() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation identifier

                  Parameter activity

                  Activity to send

                  Remarks

                  This method allows you to send an activity to the end of a conversation. This is slightly different from ReplyToActivity(). * SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation.

                  Use ReplyToActivity when replying to a specific activity in the conversation.

                  Use SendToConversation in all other cases.

                method onUpdateActivity

                protected onUpdateActivity: (
                claimsIdentity: any,
                conversationId: string,
                activityId: string,
                activity: any
                ) => Promise<ResourceResponse>;
                • UpdateActivity() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter activityId

                  activityId to update.

                  Parameter activity

                  replacement Activity.

                  Remarks

                  Edit an existing activity.

                  Some channels allow you to edit an existing activity to reflect the new state of a bot conversation.

                  For example, you can remove buttons after someone has clicked "Approve" button.

                method onUploadAttachment

                protected onUploadAttachment: (
                claimsIdentity: any,
                conversationId: string,
                attachmentUpload: any
                ) => Promise<ResourceResponse>;
                • UploadAttachment() API for Skill.

                  Parameter claimsIdentity

                  ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                  Parameter conversationId

                  Conversation ID.

                  Parameter attachmentUpload

                  Attachment data.

                  Remarks

                  Upload an attachment directly into a channel's blob storage.

                  This is useful because it allows you to store data in a compliant store when dealing with enterprises.

                  The response is a ResourceResponse which contains an AttachmentId which is suitable for using with the attachments API.

                class ChannelServiceRoutes

                class ChannelServiceRoutes {}
                • Routes the API calls with the ChannelServiceHandler methods.

                constructor

                constructor(channelServiceHandler: ChannelServiceHandlerBase);
                • Parameter channelServiceHandler

                method register

                register: (server: WebServer, basePath?: string) => void;
                • Registers all Channel Service paths on the provided WebServer.

                  Parameter server

                  WebServer

                  Parameter basePath

                  Optional basePath which is appended before the service's REST API is configured on the WebServer.

                class CloudAdapter

                class CloudAdapter extends CloudAdapterBase implements BotFrameworkHttpAdapter {}

                  constructor

                  constructor(botFrameworkAuthentication?: any);
                  • Initializes a new instance of the [CloudAdapter](xref:botbuilder:CloudAdapter) class.

                    Parameter botFrameworkAuthentication

                    Optional [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) instance

                  method connectNamedPipe

                  connectNamedPipe: (
                  pipeName: string,
                  logic: (context: any) => Promise<void>,
                  appId: string,
                  audience: string,
                  callerId?: string,
                  retryCount?: number
                  ) => Promise<void>;
                  • Used to connect the adapter to a named pipe.

                    Parameter pipeName

                    Pipe name to connect to (note: yields two named pipe servers by appending ".incoming" and ".outgoing" to this name)

                    Parameter logic

                    The logic function to call for resulting bot turns.

                    Parameter appId

                    The Bot application ID

                    Parameter audience

                    The audience to use for outbound communication. The will vary by cloud environment.

                    Parameter callerId

                    Optional, the caller ID

                    Parameter retryCount

                    Optional, the number of times to retry a failed connection (defaults to 7)

                  method process

                  process: {
                  (
                  req: Request,
                  res: Response,
                  logic: (context: any) => Promise<void>
                  ): Promise<void>;
                  (
                  req: Request<Record<string, unknown>, Record<string, string | string[]>>,
                  socket: any,
                  head: any,
                  logic: (context: any) => Promise<void>
                  ): Promise<void>;
                  };
                  • Process a web request by applying a logic function.

                    Parameter req

                    An incoming HTTP [Request](xref:botbuilder.Request)

                    Parameter req

                    The corresponding HTTP [Response](xref:botbuilder.Response)

                    Parameter logic

                    The logic function to apply

                    Returns

                    a promise representing the asynchronous operation.

                  • Handle a web socket connection by applying a logic function to each streaming request.

                    Parameter req

                    An incoming HTTP [Request](xref:botbuilder.Request)

                    Parameter socket

                    The corresponding [INodeSocket](xref:botframework-streaming.INodeSocket)

                    Parameter head

                    The corresponding [INodeBuffer](xref:botframework-streaming.INodeBuffer)

                    Parameter logic

                    The logic function to apply

                    Returns

                    a promise representing the asynchronous operation.

                  class CloudSkillHandler

                  class CloudSkillHandler extends CloudChannelServiceHandler {}

                    constructor

                    constructor(
                    adapter: any,
                    logic: (context: any) => Promise<void>,
                    conversationIdFactory: any,
                    auth: any
                    );
                    • Initializes a new instance of the CloudSkillHandler class.

                      Parameter adapter

                      An instance of the BotAdapter that will handle the request.

                      Parameter logic

                      The Bot logic function

                      Parameter conversationIdFactory

                      A SkillConversationIdFactoryBase to unpack the conversation ID and map it to the calling bot.

                      Parameter auth

                      Bot Framework Authentication to use

                    property SkillConversationReferenceKey

                    readonly SkillConversationReferenceKey: Symbol;
                    • Used to access the CovnersationReference sent from the Skill to the Parent.

                    method onDeleteActivity

                    protected onDeleteActivity: (
                    claimsIdentity: any,
                    conversationId: string,
                    activityId: string
                    ) => Promise<void>;
                    • DeleteActivity() API for Skill.

                      Parameter claimsIdentity

                      ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                      Parameter conversationId

                      Conversation ID.

                      Parameter activityId

                      activityId to delete.

                      Returns

                      a promise representing the async operation

                      Remarks

                      Delete an existing activity.

                      Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity.

                    method onReplyToActivity

                    protected onReplyToActivity: (
                    claimsIdentity: any,
                    conversationId: string,
                    activityId: string,
                    activity: any
                    ) => Promise<ResourceResponse>;
                    • replyToActivity() API for Skill.

                      Parameter claimsIdentity

                      ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                      Parameter conversationId

                      Conversation ID.

                      Parameter activityId

                      activityId the reply is to.

                      Parameter activity

                      Activity to send.

                      Returns

                      A Promise with a ResourceResponse.

                      Remarks

                      This method allows you to reply to an activity.

                      This is slightly different from sendToConversation(). * sendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * replyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, replyToActivity falls back to sendToConversation.

                      Use replyToActivity when replying to a specific activity in the conversation.

                      Use sendToConversation in all other cases.

                    method onSendToConversation

                    protected onSendToConversation: (
                    claimsIdentity: any,
                    conversationId: string,
                    activity: any
                    ) => Promise<ResourceResponse>;
                    • sendToConversation() API for Skill.

                      Parameter claimsIdentity

                      ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                      Parameter conversationId

                      Conversation ID.

                      Parameter activity

                      Activity to send.

                      Returns

                      A Promise with a ResourceResponse.

                      Remarks

                      This method allows you to send an activity to the end of a conversation.

                      This is slightly different from replyToActivity(). * sendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * replyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, replyToActivity falls back to sendToConversation.

                      Use replyToActivity when replying to a specific activity in the conversation.

                      Use sendToConversation in all other cases.

                    method onUpdateActivity

                    protected onUpdateActivity: (
                    claimsIdentity: any,
                    conversationId: string,
                    activityId: string,
                    activity: any
                    ) => Promise<ResourceResponse>;
                    • UpdateActivity() API for Skill.

                      Parameter claimsIdentity

                      ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                      Parameter conversationId

                      Conversation ID.

                      Parameter activityId

                      activityId to update.

                      Parameter activity

                      replacement Activity.

                      Returns

                      a promise resolving to the underlying resource response

                      Remarks

                      Edit an existing activity.

                      Some channels allow you to edit an existing activity to reflect the new state of a bot conversation.

                      For example, you can remove buttons after someone has clicked "Approve" button.

                    class EventFactory

                    class EventFactory {}
                    • Contains utility methods for creating various event types.

                    method createHandoffInitiation

                    static createHandoffInitiation: <T = unknown>(
                    context: any,
                    handoffContext: T,
                    transcript?: any
                    ) => any;
                    • Create handoff initiation event.

                      Parameter context

                      The context object for the turn.

                      Parameter handoffContext

                      Agent hub-specific context.

                      Parameter transcript

                      Transcript of the conversation.

                    method createHandoffStatus

                    static createHandoffStatus: (
                    conversation: any,
                    state: string,
                    message?: string
                    ) => any;
                    • Create handoff status event.

                      Parameter conversation

                      Conversation being handed over.

                      Parameter state

                      State, possible values are: "accepted", "failed", "completed".

                      Parameter message

                      Additional message for failed handoff.

                    class FileTranscriptStore

                    class FileTranscriptStore implements TranscriptStore {}
                    • The file transcript store stores transcripts in file system with each activity as a file.

                      Remarks

                      This class provides an interface to log all incoming and outgoing activities to the filesystem. It implements the features necessary to work alongside the TranscriptLoggerMiddleware plugin. When used in concert, your bot will automatically log all conversations.

                      Below is the boilerplate code needed to use this in your app:

                      const { FileTranscriptStore, TranscriptLoggerMiddleware } = require('botbuilder');
                      adapter.use(new TranscriptLoggerMiddleware(new FileTranscriptStore(__dirname + '/transcripts/')));

                    constructor

                    constructor(folder: string);
                    • Creates an instance of FileTranscriptStore.

                      Parameter folder

                      Root folder where transcript will be stored.

                    method deleteTranscript

                    deleteTranscript: (channelId: string, conversationId: string) => Promise<void>;
                    • Delete a conversation and all of it's activities.

                      Parameter channelId

                      Channel Id where conversation took place.

                      Parameter conversationId

                      Id of the conversation to delete.

                    method getTranscriptActivities

                    getTranscriptActivities: (
                    channelId: string,
                    conversationId: string,
                    continuationToken?: string,
                    startDate?: Date
                    ) => Promise<PagedResult<Activity>>;
                    • Get all activities associated with a conversation id (aka get the transcript).

                      Parameter channelId

                      Channel Id.

                      Parameter conversationId

                      Conversation Id.

                      Parameter continuationToken

                      (Optional) Continuation token to page through results.

                      Parameter startDate

                      (Optional) Earliest time to include.

                    method listTranscripts

                    listTranscripts: (
                    channelId: string,
                    continuationToken?: string
                    ) => Promise<PagedResult<TranscriptInfo>>;
                    • List all the logged conversations for a given channelId.

                      Parameter channelId

                      Channel Id.

                      Parameter continuationToken

                      (Optional) Continuation token to page through results.

                    method logActivity

                    logActivity: (activity: any) => Promise<void>;
                    • Log an activity to the transcript.

                      Parameter activity

                      Activity being logged.

                    class HandoffEventNames

                    class HandoffEventNames {}
                    • Defines values for handoff event names.

                    property HandoffStatus

                    static readonly HandoffStatus: string;

                      property InitiateHandoff

                      static readonly InitiateHandoff: string;

                        class InspectionMiddleware

                        class InspectionMiddleware extends InterceptionMiddleware {}
                        • InspectionMiddleware for emulator inspection of runtime Activities and BotState.

                          Remarks

                          InspectionMiddleware for emulator inspection of runtime Activities and BotState.

                        constructor

                        constructor(
                        inspectionState: InspectionState,
                        userState?: any,
                        conversationState?: any,
                        credentials?: any
                        );
                        • Create the Inspection middleware for sending trace activities out to an emulator session

                        method inbound

                        protected inbound: (turnContext: any, traceActivity: any) => Promise<any>;
                        • Processes inbound activities.

                          Parameter turnContext

                          The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                          Parameter traceActivity

                          The trace activity.

                        method outbound

                        protected outbound: (
                        turnContext: any,
                        traceActivities: Partial<Activity>[]
                        ) => Promise<any>;
                        • Processes outbound activities.

                          Parameter turnContext

                          The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                          Parameter traceActivities

                          A collection of trace activities.

                        method processCommand

                        processCommand: (turnContext: any) => Promise<any>;
                        • Indentifies open and attach commands and calls the appropriate method.

                          Parameter turnContext

                          The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                          Returns

                          True if the command is open or attached, otherwise false.

                        method traceState

                        protected traceState: (turnContext: any) => Promise<any>;
                        • Processes the state management object.

                          Parameter turnContext

                          The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                        class InspectionState

                        class InspectionState extends BotState {}
                        • InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.

                          Remarks

                          InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.

                        constructor

                        constructor(storage: any);
                        • Creates a new instance of the [InspectionState](xref:botbuilder.InspectionState) class.

                          Parameter storage

                          The [Storage](xref:botbuilder-core.Storage) layer this state management object will use to store and retrieve state.

                        method getStorageKey

                        protected getStorageKey: (turnContext: any) => string;
                        • Gets the key to use when reading and writing state to and from storage.

                          Parameter turnContext

                          The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                        class SetSpeakMiddleware

                        class SetSpeakMiddleware implements Middleware {}
                        • Support the DirectLine speech and telephony channels to ensure the appropriate SSML tags are set on the Activity Speak property.

                        constructor

                        constructor(voiceName: string, fallbackToTextForSpeak: boolean);
                        • Initializes a new instance of the SetSpeakMiddleware class.

                          Parameter voiceName

                          The SSML voice name attribute value.

                          Parameter fallbackToTextForSpeak

                          true if an empty Activity.Speak is populated with Activity.Text.

                        method onTurn

                        onTurn: (turnContext: any, next: () => Promise<void>) => Promise<void>;
                        • Processes an incoming activity.

                          Parameter turnContext

                          The context object for this turn.

                          Parameter next

                          The delegate to call to continue the bot middleware pipeline.

                          Returns

                          A promise representing the async operation.

                        class SkillHandler

                        class SkillHandler extends ChannelServiceHandler {}
                        • A Bot Framework Handler for skills.

                        constructor

                        constructor(
                        adapter: any,
                        bot: any,
                        conversationIdFactory: any,
                        credentialProvider: any,
                        authConfig: any,
                        channelService?: string
                        );
                        • Initializes a new instance of the SkillHandler class.

                          Parameter adapter

                          An instance of the BotAdapter that will handle the request.

                          Parameter bot

                          The ActivityHandlerBase instance.

                          Parameter conversationIdFactory

                          A SkillConversationIdFactoryBase to unpack the conversation ID and map it to the calling bot.

                          Parameter credentialProvider

                          The credential provider.

                          Parameter authConfig

                          The authentication configuration.

                          Parameter channelService

                          The string indicating if the bot is working in Public Azure or in Azure Government (https://aka.ms/AzureGovDocs).

                        property SkillConversationReferenceKey

                        readonly SkillConversationReferenceKey: Symbol;
                        • Used to access the CovnersationReference sent from the Skill to the Parent.

                          Remarks

                          The value is the same as the SkillConversationReferenceKey exported from botbuilder-core.

                        method onDeleteActivity

                        protected onDeleteActivity: (
                        claimsIdentity: any,
                        conversationId: string,
                        activityId: string
                        ) => Promise<void>;
                        • DeleteActivity() API for Skill.

                          Parameter claimsIdentity

                          ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                          Parameter conversationId

                          Conversation ID.

                          Parameter activityId

                          activityId to delete.

                          Returns

                          a promise representing the async operation

                          Remarks

                          Delete an existing activity.

                          Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity.

                        method onReplyToActivity

                        protected onReplyToActivity: (
                        claimsIdentity: any,
                        conversationId: string,
                        activityId: string,
                        activity: any
                        ) => Promise<ResourceResponse>;
                        • replyToActivity() API for Skill.

                          Parameter claimsIdentity

                          ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                          Parameter conversationId

                          Conversation ID.

                          Parameter activityId

                          activityId the reply is to.

                          Parameter activity

                          Activity to send.

                          Returns

                          A Promise with a ResourceResponse.

                          Remarks

                          This method allows you to reply to an activity.

                          This is slightly different from sendToConversation(). * sendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * replyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, replyToActivity falls back to sendToConversation.

                          Use replyToActivity when replying to a specific activity in the conversation.

                          Use sendToConversation in all other cases.

                        method onSendToConversation

                        protected onSendToConversation: (
                        claimsIdentity: any,
                        conversationId: string,
                        activity: any
                        ) => Promise<ResourceResponse>;
                        • sendToConversation() API for Skill.

                          Parameter claimsIdentity

                          ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                          Parameter conversationId

                          Conversation ID.

                          Parameter activity

                          Activity to send.

                          Returns

                          A Promise with a ResourceResponse.

                          Remarks

                          This method allows you to send an activity to the end of a conversation.

                          This is slightly different from replyToActivity(). * sendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * replyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, replyToActivity falls back to sendToConversation.

                          Use replyToActivity when replying to a specific activity in the conversation.

                          Use sendToConversation in all other cases.

                        method onUpdateActivity

                        protected onUpdateActivity: (
                        claimsIdentity: any,
                        conversationId: string,
                        activityId: string,
                        activity: any
                        ) => Promise<ResourceResponse>;
                        • UpdateActivity() API for Skill.

                          Parameter claimsIdentity

                          ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

                          Parameter conversationId

                          Conversation ID.

                          Parameter activityId

                          activityId to update.

                          Parameter activity

                          replacement Activity.

                          Returns

                          a promise resolving to the underlying resource response

                          Remarks

                          Edit an existing activity.

                          Some channels allow you to edit an existing activity to reflect the new state of a bot conversation.

                          For example, you can remove buttons after someone has clicked "Approve" button.

                        class SkillHttpClient

                        class SkillHttpClient extends BotFrameworkHttpClient {}
                        • A BotFrameworkHttpClient specialized for Skills that encapsulates Conversation ID generation.

                        constructor

                        constructor(
                        credentialProvider: any,
                        conversationIdFactory: any,
                        channelService?: string
                        );
                        • Creates a new instance of the [SkillHttpClient](xref:botbuilder-core.SkillHttpClient) class.

                          Parameter credentialProvider

                          An instance of [ICredentialProvider](xref:botframework-connector.ICredentialProvider).

                          Parameter conversationIdFactory

                          An instance of a class derived from [SkillConversationIdFactoryBase](xref:botbuilder-core.SkillConversationIdFactoryBase).

                          Parameter channelService

                          Optional. The channel service.

                        method postToSkill

                        postToSkill: {
                        <T>(
                        originatingAudience: string,
                        fromBotId: string,
                        toSkill: any,
                        callbackUrl: string,
                        activity: any
                        ): Promise<InvokeResponse<T>>;
                        (
                        fromBotId: string,
                        toSkill: any,
                        callbackUrl: string,
                        activity: any
                        ): Promise<any>;
                        };
                        • Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity. T The type of body in the InvokeResponse.

                          Parameter originatingAudience

                          The OAuth audience scope, used during token retrieval. (Either https://api.botframework.com or bot app id.)

                          Parameter fromBotId

                          The MicrosoftAppId of the bot sending the activity.

                          Parameter toSkill

                          The skill to create the Conversation Id for.

                          Parameter callbackUrl

                          The callback Url for the skill host.

                          Parameter activity

                          The activity to send.

                        • Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity.

                          Parameter fromBotId

                          The MicrosoftAppId of the bot sending the activity.

                          Parameter toSkill

                          The skill to create the Conversation Id for.

                          Parameter callbackUrl

                          The callback Url for the skill host.

                          Parameter activity

                          The activity to send.

                          Deprecated

                          This overload is deprecated. Please use SkillHttpClient.postToSkill() that takes an originatingAudience.

                        class StatusCodeError

                        class StatusCodeError extends Error {}
                        • Extends Error to provide specialized error messages.

                        constructor

                        constructor(statusCode: any, message?: string);
                        • Creates a new instance of the [StatusCodeError](xref:botbuilder.StatusCodeError) class.

                          Parameter statusCode

                          The status code.

                          Parameter message

                          Optional. The error message.

                        property statusCode

                        readonly statusCode: any;

                          class StreamingHttpClient

                          class StreamingHttpClient implements HttpClient {}
                          • An implementation of HttpClient that adds compatibility with streaming connections.

                          constructor

                          constructor(server: any);
                          • Creates a new streaming Http client.

                            Parameter server

                            Transport server implementation to be used.

                          method sendRequest

                          sendRequest: (httpRequest: any) => Promise<HttpOperationResponse>;
                          • This function hides the default sendRequest of the HttpClient, replacing it with a version that takes the WebResource created by the BotFrameworkAdapter and converting it to a form that can be sent over a streaming transport.

                            Parameter httpRequest

                            The outgoing request created by the BotframeworkAdapter. The streaming transport compatible response to send back to the client.

                          class TeamsActivityHandler

                          class TeamsActivityHandler extends ActivityHandler {}
                          • Adds support for Microsoft Teams specific events and interactions.

                            Remarks

                            Developers may handle Conversation Update activities sent from Microsoft Teams via two methods: 1. Overriding methods starting with on.. and *not* ending in ..Event() (e.g. onTeamsMembersAdded()), or instead 2. Passing callbacks to methods starting with on.. *and* ending in ...Event() (e.g. onTeamsMembersAddedEvent()), to stay in line with older implementation.

                            Developers should use either #1 or #2, above for all Conversation Update activities and not *both* #2 and #3 for the same activity. Meaning, developers should override onTeamsMembersAdded() and not use both onTeamsMembersAdded() and onTeamsMembersAddedEvent().

                            Developers wanting to handle Invoke activities *must* override methods starting with handle...() (e.g. handleTeamsTaskModuleFetch()).

                          method dispatchConversationUpdateActivity

                          protected dispatchConversationUpdateActivity: (context: any) => Promise<void>;
                          • Override this method to change the dispatching of ConversationUpdate activities.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                          method dispatchEventActivity

                          protected dispatchEventActivity: (context: any) => Promise<void>;
                          • Runs the _event_ sub-type handlers, as appropriate, and then continues the event emission process.

                            Parameter context

                            The context object for the current turn.

                            Returns

                            A promise that represents the work queued.

                            Remarks

                            Override this method to support channel-specific behavior across multiple channels or to add custom event sub-type events.

                          method handleAdaptiveCardAction

                          protected handleAdaptiveCardAction: (
                          context: any
                          ) => Promise<AdaptiveCardInvokeResponse>;
                          • Receives invoke activities with the name 'adaptiveCard/action'

                            Parameter context

                            A context object for this turn.

                            Returns

                            The Messaging Extension Action Response for the query.

                          method handleTeamsAppBasedLinkQuery

                          protected handleTeamsAppBasedLinkQuery: (
                          context: any,
                          query: any
                          ) => Promise<MessagingExtensionResponse>;
                          • Receives invoke activities with Activity name of 'composeExtension/queryLink'

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            he invoke request body type for app-based link query.

                            Returns

                            The Messaging Extension Response for the query.

                            Remarks

                            Used in creating a Search-based Message Extension.

                          method handleTeamsCardActionInvoke

                          protected handleTeamsCardActionInvoke: (context: any) => Promise<InvokeResponse>;
                          • Handles a Teams Card Action Invoke activity.

                            Parameter context

                            A context object for this turn.

                            Returns

                            An Invoke Response for the activity.

                          method handleTeamsFileConsent

                          protected handleTeamsFileConsent: (
                          context: any,
                          fileConsentCardResponse: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'fileConsent/invoke'. Handlers registered here run before handleTeamsFileConsentAccept and handleTeamsFileConsentDecline. Developers are not passed a pointer to the next handleTeamsFileConsent handler because the _wrapper_ around the handler will call onDialogs handlers after delegating to handleTeamsFileConsentAccept or handleTeamsFileConsentDecline.

                            Parameter context

                            A context object for this turn.

                            Parameter fileConsentCardResponse

                            Represents the value of the invoke activity sent when the user acts on a file consent card.

                            Returns

                            A promise that represents the work queued.

                          method handleTeamsFileConsentAccept

                          protected handleTeamsFileConsentAccept: (
                          context: any,
                          fileConsentCardResponse: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'fileConsent/invoke' with confirmation from user

                            Parameter context

                            A context object for this turn.

                            Parameter fileConsentCardResponse

                            Represents the value of the invoke activity sent when the user acts on a file consent card.

                            Returns

                            A promise that represents the work queued.

                            Remarks

                            This type of invoke activity occur during the File Consent flow.

                          method handleTeamsFileConsentDecline

                          protected handleTeamsFileConsentDecline: (
                          context: any,
                          fileConsentCardResponse: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'fileConsent/invoke' with decline from user

                            Parameter context

                            A context object for this turn.

                            Parameter fileConsentCardResponse

                            Represents the value of the invoke activity sent when the user acts on a file consent card.

                            Returns

                            A promise that represents the work queued.

                            Remarks

                            This type of invoke activity occur during the File Consent flow.

                          method handleTeamsMessagingExtensionBotMessagePreviewEdit

                          protected handleTeamsMessagingExtensionBotMessagePreviewEdit: (
                          context: any,
                          action: any
                          ) => Promise<MessagingExtensionActionResponse>;
                          • Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value. The value for 'botMessagePreview' is 'edit'.

                            Parameter context

                            A context object for this turn.

                            Parameter action

                            The messaging extension action.

                            Returns

                            The Messaging Extension Action Response for the action.

                          method handleTeamsMessagingExtensionBotMessagePreviewSend

                          protected handleTeamsMessagingExtensionBotMessagePreviewSend: (
                          context: any,
                          action: any
                          ) => Promise<MessagingExtensionActionResponse>;
                          • Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value. The value for 'botMessagePreview' is 'send'.

                            Parameter context

                            A context object for this turn.

                            Parameter action

                            The messaging extension action.

                            Returns

                            The Messaging Extension Action Response for the action.

                          method handleTeamsMessagingExtensionCardButtonClicked

                          protected handleTeamsMessagingExtensionCardButtonClicked: (
                          context: any,
                          cardData: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'composeExtension/onCardButtonClicked'

                            Parameter context

                            A context object for this turn.

                            Parameter cardData

                            Object representing the card data.

                            Returns

                            A promise that represents the work queued.

                          method handleTeamsMessagingExtensionConfigurationQuerySettingUrl

                          protected handleTeamsMessagingExtensionConfigurationQuerySettingUrl: (
                          context: any,
                          query: any
                          ) => Promise<MessagingExtensionResponse>;
                          • Receives invoke activities with the name 'composeExtension/querySettingUrl'

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            The Messaging extension query.

                            Returns

                            The Messaging Extension Action Response for the query.

                          method handleTeamsMessagingExtensionConfigurationSetting

                          protected handleTeamsMessagingExtensionConfigurationSetting: (
                          context: any,
                          settings: any
                          ) => Promise<void>;
                          • Receives invoke activities with the name 'composeExtension/setting'

                            Parameter context

                            A context object for this turn.

                            Parameter settings

                            Object representing the configuration settings.

                            Returns

                            A promise that represents the work queued.

                          method handleTeamsMessagingExtensionFetchTask

                          protected handleTeamsMessagingExtensionFetchTask: (
                          context: any,
                          action: any
                          ) => Promise<MessagingExtensionActionResponse>;
                          • Receives invoke activities with the name 'composeExtension/fetchTask'

                            Parameter context

                            A context object for this turn.

                            Parameter action

                            The messaging extension action.

                            Returns

                            The Messaging Extension Action Response for the action.

                          method handleTeamsMessagingExtensionQuery

                          protected handleTeamsMessagingExtensionQuery: (
                          context: any,
                          query: any
                          ) => Promise<MessagingExtensionResponse>;
                          • Receives invoke activities with the name 'composeExtension/query'.

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            The query for the search command.

                            Returns

                            The Messaging Extension Response for the query.

                            Remarks

                            Used in creating a Search-based Message Extension.

                          method handleTeamsMessagingExtensionSelectItem

                          protected handleTeamsMessagingExtensionSelectItem: (
                          context: any,
                          query: any
                          ) => Promise<MessagingExtensionResponse>;
                          • Receives invoke activities with the name 'composeExtension/selectItem'.

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            he object representing the query.

                            Returns

                            The Messaging Extension Response for the query.

                            Remarks

                            Used in creating a Search-based Message Extension.

                          method handleTeamsMessagingExtensionSubmitAction

                          protected handleTeamsMessagingExtensionSubmitAction: (
                          context: any,
                          action: any
                          ) => Promise<MessagingExtensionActionResponse>;
                          • Receives invoke activities with the name 'composeExtension/submitAction'.

                            Parameter context

                            A context object for this turn.

                            Parameter action

                            The messaging extension action.

                            Returns

                            The Messaging Extension Action Response for the action.

                          method handleTeamsMessagingExtensionSubmitActionDispatch

                          protected handleTeamsMessagingExtensionSubmitActionDispatch: (
                          context: any,
                          action: any
                          ) => Promise<MessagingExtensionActionResponse>;
                          • Receives invoke activities with the name 'composeExtension/submitAction' and dispatches to botMessagePreview-flows as applicable.

                            Parameter context

                            A context object for this turn.

                            Parameter action

                            The messaging extension action.

                            Returns

                            The Messaging Extension Action Response for the action.

                            Remarks

                            A handler registered through this method does not dispatch to the next handler (either handleTeamsMessagingExtensionSubmitAction, handleTeamsMessagingExtensionBotMessagePreviewEdit, or handleTeamsMessagingExtensionBotMessagePreviewSend). This method exists for developers to optionally add more logic before the TeamsActivityHandler routes the activity to one of the previously mentioned handlers.

                          method handleTeamsO365ConnectorCardAction

                          protected handleTeamsO365ConnectorCardAction: (
                          context: any,
                          query: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'actionableMessage/executeAction'.

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            The O365 connector card HttpPOST invoke query. A promise that represents the work queued.

                          method handleTeamsSigninTokenExchange

                          protected handleTeamsSigninTokenExchange: (
                          context: any,
                          query: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'signin/tokenExchange'

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            Signin state (part of signin action auth flow) verification invoke query

                            Returns

                            A promise that represents the work queued.

                          method handleTeamsSigninVerifyState

                          protected handleTeamsSigninVerifyState: (
                          context: any,
                          query: any
                          ) => Promise<void>;
                          • Receives invoke activities with Activity name of 'signin/verifyState'.

                            Parameter context

                            A context object for this turn.

                            Parameter query

                            Signin state (part of signin action auth flow) verification invoke query.

                            Returns

                            A promise that represents the work queued.

                          method handleTeamsTabFetch

                          protected handleTeamsTabFetch: (
                          context: any,
                          tabRequest: any
                          ) => Promise<TabResponse>;
                          • Receives invoke activities with Activity name of 'tab/fetch'

                            Parameter context

                            A context object for this turn.

                            Parameter tabRequest

                            The tab invoke request value payload.

                            Returns

                            A Tab Response for the request.

                          method handleTeamsTabSubmit

                          protected handleTeamsTabSubmit: (
                          context: any,
                          tabSubmit: any
                          ) => Promise<TabResponse>;
                          • Receives invoke activities with Activity name of 'tab/submit'

                            Parameter context

                            A context object for this turn.

                            Parameter tabSubmit

                            The tab submit invoke request value payload.

                            Returns

                            A Tab Response for the request.

                          method handleTeamsTaskModuleFetch

                          protected handleTeamsTaskModuleFetch: (
                          context: any,
                          taskModuleRequest: any
                          ) => Promise<TaskModuleResponse>;
                          • Receives invoke activities with Activity name of 'task/fetch'

                            Parameter context

                            A context object for this turn.

                            Parameter taskModuleRequest

                            The task module invoke request value payload.

                            Returns

                            A Task Module Response for the request.

                          method handleTeamsTaskModuleSubmit

                          protected handleTeamsTaskModuleSubmit: (
                          context: any,
                          taskModuleRequest: any
                          ) => Promise<TaskModuleResponse>;
                          • Receives invoke activities with Activity name of 'task/submit'

                            Parameter context

                            A context object for this turn.

                            Parameter taskModuleRequest

                            The task module invoke request value payload.

                            Returns

                            A Task Module Response for the request.

                          method onInvokeActivity

                          protected onInvokeActivity: (context: any) => Promise<InvokeResponse>;
                          • Invoked when an invoke activity is received from the connector. Invoke activities can be used to communicate many different things.

                            Parameter context

                            A context object for this turn.

                            Returns

                            An Invoke Response for the activity.

                          method onSignInInvoke

                          protected onSignInInvoke: (context: any) => Promise<void>;
                          • Invoked when a signIn invoke activity is received from the connector.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelCreated

                          protected onTeamsChannelCreated: (context: any) => Promise<void>;
                          • Invoked when a Channel Created event activity is received from the connector. Channel Created corresponds to the user creating a new channel. Override this in a derived class to provide logic for when a channel is created.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelCreatedEvent

                          onTeamsChannelCreatedEvent: (
                          handler: (
                          channelInfo: any,
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsChannelCreated events, such as for when a channel is created.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelDeleted

                          protected onTeamsChannelDeleted: (context: any) => Promise<void>;
                          • Invoked when a Channel Deleted event activity is received from the connector. Channel Deleted corresponds to the user deleting a channel. Override this in a derived class to provide logic for when a channel is deleted.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelDeletedEvent

                          onTeamsChannelDeletedEvent: (
                          handler: (
                          channelInfo: any,
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsChannelDeleted events, such as for when a channel is deleted.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelRenamed

                          protected onTeamsChannelRenamed: (context: any) => Promise<void>;
                          • Invoked when a Channel Renamed event activity is received from the connector. Channel Renamed corresponds to the user renaming a new channel. Override this in a derived class to provide logic for when a channel is renamed.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelRenamedEvent

                          onTeamsChannelRenamedEvent: (
                          handler: (
                          channelInfo: any,
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsChannelRenamed events, such as for when a channel is renamed.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelRestored

                          protected onTeamsChannelRestored: (context: any) => Promise<void>;
                          • Parameter context

                            Invoked when a Channel Restored event activity is received from the connector. Channel Restored corresponds to the user restoring a previously deleted channel. Override this in a derived class to provide logic for when a channel is restored.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsChannelRestoredEvent

                          onTeamsChannelRestoredEvent: (
                          handler: (
                          channelInfo: any,
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsChannelRestored events, such as for when a channel is restored.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMeetingEnd

                          protected onTeamsMeetingEnd: (context: any) => Promise<void>;
                          • Invoked when a Meeting End event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is ended.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMeetingEndEvent

                          onTeamsMeetingEndEvent: (
                          handler: (
                          meeting: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for when a Teams meeting ends.

                            Parameter handler

                            A callback that handles Meeting End events.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMeetingStart

                          protected onTeamsMeetingStart: (context: any) => Promise<void>;
                          • Invoked when a Meeting Started event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is started.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMeetingStartEvent

                          onTeamsMeetingStartEvent: (
                          handler: (
                          meeting: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for when a Teams meeting starts.

                            Parameter handler

                            A callback that handles Meeting Start events.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMembersAdded

                          protected onTeamsMembersAdded: (context: any) => Promise<void>;
                          • Called in dispatchConversationUpdateActivity() to trigger the 'TeamsMembersAdded' handlers. Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                            Remarks

                            If no handlers are registered for the 'TeamsMembersAdded' event, the 'MembersAdded' handlers will run instead.

                          method onTeamsMembersAddedEvent

                          onTeamsMembersAddedEvent: (
                          handler: (
                          membersAdded: TeamsChannelAccount[],
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsMembersAdded events, such as for when members other than the bot join the channel, such as your bot's welcome logic.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsMembersRemoved

                          protected onTeamsMembersRemoved: (context: any) => Promise<void>;
                          • Called in dispatchConversationUpdateActivity() to trigger the 'TeamsMembersRemoved' handlers. Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic.

                            Parameter context

                            A context object for this turn.

                            Returns

                            A promise that represents the work queued.

                            Remarks

                            If no handlers are registered for the 'TeamsMembersRemoved' event, the 'MembersRemoved' handlers will run instead.

                          method onTeamsMembersRemovedEvent

                          onTeamsMembersRemovedEvent: (
                          handler: (
                          membersRemoved: TeamsChannelAccount[],
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsMembersRemoved events, such as for when members other than the bot leave the channel, such as your bot's good-bye logic.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamArchived

                          protected onTeamsTeamArchived: (context: any) => Promise<void>;
                          • Invoked when a Team Archived event activity is received from the connector. Team Archived corresponds to the user archiving a team. Override this in a derived class to provide logic for when a team is archived.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamArchivedEvent

                          onTeamsTeamArchivedEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamArchived events, such as for when a team is archived.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamDeleted

                          protected onTeamsTeamDeleted: (context: any) => Promise<void>;
                          • Invoked when a Team Deleted event activity is received from the connector. Team Deleted corresponds to the user deleting a team. Override this in a derived class to provide logic for when a team is deleted.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamDeletedEvent

                          onTeamsTeamDeletedEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamDeleted events, such as for when a team is deleted.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamHardDeleted

                          protected onTeamsTeamHardDeleted: (context: any) => Promise<void>;
                          • Invoked when a Team Hard Deleted event activity is received from the connector. Team Hard Deleted corresponds to the user hard-deleting a team. Override this in a derived class to provide logic for when a team is hard-deleted.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamHardDeletedEvent

                          onTeamsTeamHardDeletedEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamHardDeleted events, such as for when a team is hard-deleted.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamRenamed

                          protected onTeamsTeamRenamed: (context: any) => Promise<void>;
                          • Invoked when a Team Renamed event activity is received from the connector. Team Renamed corresponds to the user renaming a team. Override this in a derived class to provide logic for when a team is renamed.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamRenamedEvent

                          onTeamsTeamRenamedEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamRenamed events, such as for when a team is renamed.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamRestored

                          protected onTeamsTeamRestored: (context: any) => Promise<void>;
                          • Invoked when a Team Restored event activity is received from the connector. Team Restored corresponds to the user restoring a team. Override this in a derived class to provide logic for when a team is restored.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamRestoredEvent

                          onTeamsTeamRestoredEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamRestored events, such as for when a team is restored.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamUnarchived

                          protected onTeamsTeamUnarchived: (context: any) => Promise<void>;
                          • Invoked when a Team Unarchived event activity is received from the connector. Team Unarchived corresponds to the user unarchiving a team. Override this in a derived class to provide logic for when a team is unarchived.

                            Parameter context

                            The context for this turn.

                            Returns

                            A promise that represents the work queued.

                          method onTeamsTeamUnarchivedEvent

                          onTeamsTeamUnarchivedEvent: (
                          handler: (
                          teamInfo: any,
                          context: any,
                          next: () => Promise<void>
                          ) => Promise<void>
                          ) => this;
                          • Registers a handler for TeamsTeamUnarchived events, such as for when a team is unarchived.

                            Parameter handler

                            Returns

                            A promise that represents the work queued.

                          class TeamsInfo

                          class TeamsInfo {}
                          • Provides utility methods for the events and interactions that occur within Microsoft Teams.

                          method getMeetingInfo

                          static getMeetingInfo: (
                          context: any,
                          meetingId?: string
                          ) => Promise<TeamsMeetingInfo>;
                          • Gets the information for the given meeting id.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter meetingId

                            The BASE64-encoded id of the Teams meeting.

                            Returns

                            The [TeamsMeetingInfo](xref:botbuilder-core.TeamsMeetingInfo) fetched

                          method getMeetingParticipant

                          static getMeetingParticipant: (
                          context: any,
                          meetingId?: string,
                          participantId?: string,
                          tenantId?: string
                          ) => Promise<TeamsMeetingParticipant>;
                          • Gets the meeting participant for the given meeting id and participant id. This only works in teams scoped meeting conversations.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter meetingId

                            The meeting ID to fetch

                            Parameter participantId

                            The participant ID to fetch

                            Parameter tenantId

                            The tenant ID to use when scoping the request

                            Returns

                            The [TeamsMeetingParticipant](xref:botbuilder-core.TeamsMeetingParticipant) fetched

                          method getMember

                          static getMember: (context: any, userId: string) => Promise<TeamsChannelAccount>;
                          • Gets the account of a single conversation member.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter userId

                            ID of the user in question.

                            Returns

                            The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.

                          method getMembers

                          static getMembers: (context: any) => Promise<TeamsChannelAccount[]>;
                          • Gets the conversation members of a one-on-one or group chat.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Returns

                            The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount).

                          method getPagedMembers

                          static getPagedMembers: (
                          context: any,
                          pageSize?: number,
                          continuationToken?: string
                          ) => Promise<TeamsPagedMembersResult>;
                          • Gets a pagined list of members of one-on-one, group, or team conversation.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter pageSize

                            Suggested number of entries on a page.

                            Parameter continuationToken

                            A continuation token.

                            Returns

                            The [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.

                          method getPagedTeamMembers

                          static getPagedTeamMembers: (
                          context: any,
                          teamId?: string,
                          pageSize?: number,
                          continuationToken?: string
                          ) => Promise<TeamsPagedMembersResult>;
                          • Gets a paginated list of members of a team.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter teamId

                            ID of the Teams team.

                            Parameter pageSize

                            The number of entries on the page.

                            Parameter continuationToken

                            The continuationToken token.

                            Returns

                            A [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.

                          method getTeamChannels

                          static getTeamChannels: (
                          context: any,
                          teamId?: string
                          ) => Promise<ChannelInfo[]>;
                          • Returns a list of channels in a Team. This only works in teams scoped conversations.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter teamId

                            ID of the Teams team.

                            Returns

                            The list of [ChannelInfo](xref:botframework-schema.ChannelInfo) objects with the conversations.

                          method getTeamDetails

                          static getTeamDetails: (context: any, teamId?: string) => Promise<TeamDetails>;
                          • Gets the details for the given team id. This only works in teams scoped conversations.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter teamId

                            The id of the Teams team.

                            Returns

                            The [TeamDetails](xref:botbuilder-core.TeamDetails) fetched

                          method getTeamMember

                          static getTeamMember: (
                          context: any,
                          teamId?: string,
                          userId?: string
                          ) => Promise<TeamsChannelAccount>;
                          • Gets the account of a member in a teams scoped conversation.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter teamId

                            ID of the Teams team.

                            Parameter userId

                            ID of the Teams user.

                            Returns

                            The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.

                          method getTeamMembers

                          static getTeamMembers: (
                          context: any,
                          teamId?: string
                          ) => Promise<TeamsChannelAccount[]>;
                          • Gets the list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) within a team.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter teamId

                            ID of the Teams team.

                            Returns

                            The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the members.

                          method sendMessageToTeamsChannel

                          static sendMessageToTeamsChannel: (
                          context: any,
                          activity: any,
                          teamsChannelId: string,
                          botAppId?: string
                          ) => Promise<[ConversationReference, string]>;
                          • Creates a new thread in a Teams chat and sends an [Activity](xref:botframework-schema.Activity) to that new thread.

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter activity

                            The [Activity](xref:botframework-schema.Activity) to send.

                            Parameter teamsChannelId

                            The Team's Channel ID, note this is distinct from the Bot Framework activity property with same name.

                            Parameter botAppId

                            The bot's appId. This is only used when context.adapter is an instance of CloudAdapter.

                            Returns

                            The [ConversationReference](xref:botframework-schema.ConversationReference) and the id of the [Activity](xref:botframework-schema.Activity) (if sent).

                          class TeamsSSOTokenExchangeMiddleware

                          class TeamsSSOTokenExchangeMiddleware implements Middleware {}
                          • If the activity name is signin/tokenExchange, this middleware will attempt to exchange the token, and deduplicate the incoming call, ensuring only one exchange request is processed.

                            If a user is signed into multiple Teams clients, the Bot could receive a "signin/tokenExchange" from each client. Each token exchange request for a specific user login will have an identical activity.value.id.

                            Only one of these token exchange requests should be processed by the bot. The others return [StatusCodes.PRECONDITION_FAILED](xref:botframework-schema:StatusCodes.PRECONDITION_FAILED). For a distributed bot in production, this requires distributed storage ensuring only one token exchange is processed. This middleware supports CosmosDb storage found in botbuilder-azure, or MemoryStorage for local development.

                          constructor

                          constructor(storage: any, oAuthConnectionName: string);
                          • Initializes a new instance of the TeamsSSOTokenExchangeMiddleware class.

                            Parameter storage

                            The [Storage](xref:botbuilder-core.Storage) to use for deduplication

                            Parameter oAuthConnectionName

                            The connection name to use for the single sign on token exchange

                          method onTurn

                          onTurn: (context: any, next: () => Promise<void>) => Promise<void>;
                          • Called each time the bot receives a new request.

                            Parameter context

                            Context for current turn of conversation with the user.

                            Parameter next

                            Function to call to continue execution to the next step in the middleware chain.

                          class TokenResolver

                          class TokenResolver {}
                          • Looks for OAuthCards in Activity attachments and takes action on them

                          method checkForOAuthCards

                          static checkForOAuthCards: (
                          adapter: BotFrameworkAdapter,
                          context: any,
                          activity: any,
                          log?: string[]
                          ) => void;
                          • Checks if we have token responses from OAuth cards.

                            Parameter adapter

                            The [BotFrameworkAdapter](xref:botbuilder.BotFrameworkAdapter).

                            Parameter context

                            The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.

                            Parameter activity

                            The [Activity](xref:botframework-schema.Activity) to be checked.

                            Parameter log

                            Optional. The log to write on.

                          Interfaces

                          interface BotFrameworkAdapterSettings

                          interface BotFrameworkAdapterSettings {}
                          • Contains settings used to configure a [BotFrameworkAdapter](xref:botbuilder.BotFrameworkAdapter) instance.

                          property appId

                          appId: string;
                          • The ID assigned to your bot in the [Bot Framework Portal](https://dev.botframework.com/).

                          property appPassword

                          appPassword: string;
                          • The password assigned to your bot in the [Bot Framework Portal](https://dev.botframework.com/).

                          property authConfig

                          authConfig?: AuthenticationConfiguration;
                          • Optional. Used to require specific endorsements and verify claims. Recommended for Skills.

                          property certificatePrivateKey

                          certificatePrivateKey?: string;
                          • Optional. Certificate key to authenticate the appId against AAD.

                          property certificateThumbprint

                          certificateThumbprint?: string;
                          • Optional. Certificate thumbprint to authenticate the appId against AAD.

                          property channelAuthTenant

                          channelAuthTenant?: string;
                          • Optional. The tenant to acquire the bot-to-channel token from.

                          property channelService

                          channelService?: string;
                          • Optional. The channel service option for this bot to validate connections from Azure or other channel locations.

                          property clientOptions

                          clientOptions?: ConnectorClientOptions;
                          • Optional. Used when creating new ConnectorClients.

                          property oAuthEndpoint

                          oAuthEndpoint?: string;
                          • Optional. The OAuth API endpoint for your bot to use.

                          property openIdMetadata

                          openIdMetadata?: string;
                          • Optional. The OpenID Metadata endpoint for your bot to use.

                          property webSocketFactory

                          webSocketFactory?: NodeWebSocketFactoryBase;
                          • Optional. Used to pass in a NodeWebSocketFactoryBase instance.

                          interface BotFrameworkHttpAdapter

                          interface BotFrameworkHttpAdapter {}
                          • BotFrameworkHttpAdapter is the interface that describes a Bot Framework adapter that operates on HTTP requests.

                          method process

                          process: {
                          (
                          req: Request,
                          res: Response,
                          logic: (context: any) => Promise<void>
                          ): Promise<void>;
                          (
                          req: Request<Record<string, unknown>, Record<string, string | string[]>>,
                          socket: any,
                          head: any,
                          logic: (context: any) => Promise<void>
                          ): Promise<void>;
                          };
                          • Process a web request by applying a logic callback function.

                          • Handle a web socket connection by applying a logic callback function to each streaming request.

                          interface Request

                          interface Request<
                          Body extends Record<string, unknown> = Record<string, unknown>,
                          Headers extends Record<string, string[] | string | undefined> = Record<
                          string,
                          string[] | string | undefined
                          >
                          > {}
                          • Represents a Node.js HTTP Request, including the minimal set of use properties. Compatible with Restify, Express, and Node.js core http.

                          property body

                          body?: Body;

                            property headers

                            headers: Headers;

                              property method

                              method?: string;

                                interface Response

                                interface Response {}

                                  property socket

                                  socket: unknown;

                                    method end

                                    end: (...args: unknown[]) => unknown;

                                      method header

                                      header: (name: string, value: unknown) => unknown;

                                        method send

                                        send: (...args: unknown[]) => unknown;

                                          method status

                                          status: (code: number) => unknown;

                                            interface WebRequest

                                            interface WebRequest {}
                                            • Represents an Express or Restify request object.

                                              This interface supports the framework and is not intended to be called directly for your code.

                                            property body

                                            body?: any;
                                            • Optional. The request body.

                                            property headers

                                            headers: any;
                                            • * Optional. The request headers.

                                            property method

                                            method?: any;
                                            • * Optional. The request method.

                                            property params

                                            params?: any;
                                            • * Optional. The request parameters from the url.

                                            property query

                                            query?: any;
                                            • * Optional. The values from the query string.

                                            method on

                                            on: (event: string, ...args: any[]) => any;
                                            • When implemented in a derived class, adds a listener for an event. The framework uses this method to retrieve the request body when the [body](xref:botbuilder.WebRequest.body) property is null or undefined.

                                              Parameter event

                                              The event name.

                                              Parameter args

                                              Arguments used to handle the event.

                                              Returns

                                              A reference to the request object.

                                            interface WebResponse

                                            interface WebResponse {}
                                            • Represents an Express or Restify response object.

                                              This interface supports the framework and is not intended to be called directly for your code.

                                            property socket

                                            socket?: any;
                                            • Optional. The underlying socket.

                                            method end

                                            end: (...args: any[]) => any;
                                            • When implemented in a derived class, sends a FIN packet.

                                              Parameter args

                                              The arguments for the end event.

                                              Returns

                                              A reference to the response object.

                                            method send

                                            send: (body: any) => any;
                                            • When implemented in a derived class, sends the response.

                                              Parameter body

                                              The response payload.

                                              Returns

                                              A reference to the response object.

                                            method status

                                            status: (status: number) => any;
                                            • When implemented in a derived class, sets the HTTP status code for the response.

                                              Parameter status

                                              The status code to use.

                                              Returns

                                              The status code.

                                            interface WebServer

                                            interface WebServer {}
                                            • Interface representing an Express Application or a Restify Server.

                                            property del

                                            del?: (path: string, handler: RouteHandler) => void;

                                              property delete

                                              delete?: (path: string, handler: RouteHandler) => void;

                                                property get

                                                get: (path: string, handler: RouteHandler) => void;

                                                  property post

                                                  post: (path: string, handler: RouteHandler) => void;

                                                    property put

                                                    put: (path: string, handler: RouteHandler) => void;

                                                      Type Aliases

                                                      type RouteHandler

                                                      type RouteHandler = (request: WebRequest, response: WebResponse) => void;

                                                        Package Files (27)

                                                        Dependencies (12)

                                                        Dev Dependencies (4)

                                                        Peer Dependencies (0)

                                                        No peer dependencies.

                                                        Badge

                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/botbuilder.

                                                        • Markdown
                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/botbuilder)
                                                        • HTML
                                                          <a href="https://www.jsdocs.io/package/botbuilder"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>