Creates an instance of CloudAdapter.
OptionalauthConfig: AuthConfigurationThe authentication configuration for securing communications.
OptionalauthProvider: AuthProviderNo longer used.
OptionaluserTokenClient: UserTokenClientNo longer used.
Client for connecting to the Azure Bot Service
ReadonlyConnectorSymbol key used to store connector client instances in the TurnContext.
ProtectedmiddlewareThe middleware set used to process the pipeline of middleware handlers.
ReadonlyUserSymbol key used to store User Token Client instances in the TurnContext.
Gets the error handler for the adapter.
The current error handler function.
Sets the error handler for the adapter.
The error handler function to set.
Continues a conversation.
The bot identity to use when continuing the conversation. This can be either: a string containing the bot's App ID (botId) or a JwtPayload object containing identity claims (must include aud).
The conversation reference to continue.
The logic to execute.
No longer used.
A promise representing the completion of the continue operation.
ProtectedcreateProtectedCreates a connector client for a specific service URL and scope.
The URL of the service to connect to.
The authentication scope to use.
The identity used to select the token provider.
Optionalheaders: HeaderPropagationCollectionOptional headers to propagate in the request.
A promise that resolves to a ConnectorClient instance.
ProtectedcreateProtectedCreates a connector client for a specific identity and activity.
The identity used to select the token provider.
The activity used to select the token provider.
Optionalheaders: HeaderPropagationCollectionOptional headers to propagate in the request.
A promise that resolves to a ConnectorClient instance.
Creates a conversation.
The agent application ID.
The channel ID.
The service URL.
The audience.
The conversation parameters.
The logic to execute.
A promise representing the completion of the create operation.
ProtectedcreateCreates an activity to represent the result of creating a conversation.
The ID of the created conversation.
The channel ID.
The service URL.
The conversation parameters.
The created activity.
The activity to process.
The logic to execute.
Optionalidentity: JwtPayloadThe identity used for the new context.
The created TurnContext.
ProtectedcreateProtectedCreates a user token client for a specific service URL and scope.
The identity used to select the token provider.
The endpoint to connect to.
The authentication scope to use.
No longer used.
Optionalheaders: HeaderPropagationCollectionOptional headers to propagate in the request
A promise that resolves to a UserTokenClient instance.
Deletes an activity.
The TurnContext for the current turn.
The conversation reference of the activity to delete.
A promise representing the completion of the delete operation.
The context for the turn.
The attachment ID.
The view ID.
A promise representing the NodeJS.ReadableStream for the requested attachment.
The context for the turn.
The attachment ID.
A promise representing the AttachmentInfo for the requested attachment.
Processes an incoming request and sends the response.
The incoming request.
The response to send.
The logic to execute.
OptionalheaderPropagation: HeaderPropagationDefinitionOptional function to handle header propagation.
This function supports both authenticated and unauthenticated requests. When the request is not authenticated,
the adapter will use anonymous identity. For authenticated requests, the adapter relies on the presence of a user identity
on request.user. It is strongly recommended to use the authorizeJWT middleware to ensure that requests are correctly authenticated.
ProtectedprocessProcesses the turn results and returns an InvokeResponse if applicable.
The TurnContext for the current turn.
The InvokeResponse if applicable, otherwise undefined.
ProtectedresolveProtectedDetermines whether a connector client is needed based on the delivery mode and service URL of the given activity.
The activity to evaluate.
true if a ConnectorClient is needed, false otherwise. A connector client is required if the activity's delivery mode is not "ExpectReplies" and the service URL is not null or empty.
ProtectedrunRuns the middleware pipeline in sequence.
The TurnContext for the current turn.
The next function to call in the pipeline.
A promise representing the completion of the middleware pipeline.
Sends multiple activities to the conversation.
The TurnContext for the current turn.
The activities to send.
A promise representing the array of ResourceResponses for the sent activities.
ProtectedsetProtectedSets the connector client on the turn context.
The current turn context.
OptionalconnectorClient: ConnectorClientProtectedsetProtectedSets the user token client on the turn context.
The current turn context.
OptionaluserTokenClient: UserTokenClientUpdates an activity.
The TurnContext for the current turn.
The activity to update.
A promise representing the ResourceResponse for the updated activity.
The context for the turn.
The conversation ID.
The attachment data.
A promise representing the ResourceResponse for the uploaded attachment.
Adds middleware to the adapter's middleware pipeline.
The middleware to add.
The adapter instance.
StaticcreateCreates the JwtPayload object with the provided appId.
The bot's appId.
The JwtPayload object containing the appId as aud.
Adapter for handling agent interactions with various channels through cloud-based services.
Remarks
CloudAdapter processes incoming HTTP requests from Azure Bot Service channels, authenticates them, and generates outgoing responses. It manages the communication flow between agents and users across different channels, handling activities, attachments, and conversation continuations.