Documentation - v1.2.0-alpha.3
    Preparing search index...

    Adapter for handling agent interactions with various channels through cloud-based services.

    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.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    connectionManager: Connections

    Client for connecting to the Azure Bot Service

    ConnectorClientKey: symbol = ...

    Symbol key used to store connector client instances in the TurnContext.

    middleware: MiddlewareSet = ...

    The middleware set used to process the pipeline of middleware handlers.

    UserTokenClientKey: symbol = ...

    Symbol key used to store User Token Client instances in the TurnContext.

    Accessors

    Methods

    • Creates a conversation.

      Parameters

      • agentAppId: string

        The agent application ID.

      • channelId: string

        The channel ID.

      • serviceUrl: string

        The service URL.

      • audience: string

        The audience.

      • conversationParameters: ConversationParameters

        The conversation parameters.

      • logic: (context: TurnContext) => Promise<void>

        The logic to execute.

      Returns Promise<void>

      A promise representing the completion of the create operation.

    • Creates an activity to represent the result of creating a conversation.

      Parameters

      • createdConversationId: string | undefined

        The ID of the created conversation.

      • channelId: string

        The channel ID.

      • serviceUrl: string

        The service URL.

      • conversationParameters: ConversationParameters

        The conversation parameters.

      Returns Activity

      The created activity.

    • Protected

      Creates a user token client for a specific service URL and scope.

      Parameters

      • identity: JwtPayload
      • tokenServiceEndpoint: string = ...
      • scope: string = 'https://api.botframework.com'

        The authentication scope to use

      • audience: string = 'https://api.botframework.com'
      • Optionalheaders: HeaderPropagationCollection

        Optional headers to propagate in the request

      Returns Promise<UserTokenClient>

      A promise that resolves to a ConnectorClient instance

    • Parameters

      • context: TurnContext
      • attachmentId: string

        The attachment ID.

      • viewId: string

        The view ID.

      Returns Promise<ReadableStream>

      A promise representing the NodeJS.ReadableStream for the requested attachment.

      This function will not be supported in future versions. Use TurnContext.turnState.get(CloudAdapter.ConnectorClientKey). Gets an attachment.

    • Protected

      Determines whether a connector client is needed based on the delivery mode and service URL of the given activity.

      Parameters

      • activity: Activity

        The activity to evaluate.

      Returns boolean

      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.