60 lines
3 KiB
TypeScript
60 lines
3 KiB
TypeScript
/**
|
|
* @module botbuilder
|
|
*/
|
|
/**
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
import { Activity, BotFrameworkClient, InvokeResponse } from 'botbuilder-core';
|
|
import { AppCredentials, ICredentialProvider } from 'botframework-connector';
|
|
/**
|
|
* @deprecated Use `BotFrameworkAuthentication.createBotFrameworkClient()` to obtain a client and perform the operations that were accomplished through `BotFrameworkHttpClient`.
|
|
* HttpClient for calling skills from a Node.js BotBuilder V4 SDK bot.
|
|
*/
|
|
export declare class BotFrameworkHttpClient implements BotFrameworkClient {
|
|
protected readonly channelService: string;
|
|
/**
|
|
* Cache for appCredentials to speed up token acquisition (a token is not requested unless is expired)
|
|
* AppCredentials are cached using appId + scope (this last parameter is only used if the app credentials are used to call a skill)
|
|
*/
|
|
private static readonly appCredentialMapCache;
|
|
private readonly credentialProvider;
|
|
/**
|
|
* Creates a new instance of the [BotFrameworkHttpClient](xref:botbuilder.BotFrameworkHttpClient) class
|
|
*
|
|
* @param credentialProvider An instance of [ICredentialProvider](xref:botframework-connector.ICredentialProvider).
|
|
* @param channelService Optional. The channel service.
|
|
*/
|
|
constructor(credentialProvider: ICredentialProvider, channelService?: string);
|
|
/**
|
|
* Forwards an activity to another bot.
|
|
*
|
|
* @remarks
|
|
* @template T The type of body in the InvokeResponse.
|
|
* @param fromBotId The MicrosoftAppId of the bot sending the activity.
|
|
* @param toBotId The MicrosoftAppId of the bot receiving the activity.
|
|
* @param toUrl The URL of the bot receiving the activity.
|
|
* @param serviceUrl The callback Url for the skill host.
|
|
* @param conversationId A conversation ID to use for the conversation with the skill.
|
|
* @param activity Activity to forward.
|
|
* @returns {Promise<InvokeResponse<T>>} A promise representing the asynchronous operation.
|
|
*/
|
|
postActivity<T = any>(fromBotId: string, toBotId: string, toUrl: string, serviceUrl: string, conversationId: string, activity: Activity): Promise<InvokeResponse<T>>;
|
|
/**
|
|
* Logic to build an [AppCredentials](xref:botframework-connector.AppCredentials) to be used to acquire tokens for this `HttpClient`.
|
|
*
|
|
* @param appId The application id.
|
|
* @param oAuthScope Optional. The OAuth scope.
|
|
* @returns The app credentials to be used to acquire tokens.
|
|
*/
|
|
protected buildCredentials(appId: string, oAuthScope?: string): Promise<AppCredentials>;
|
|
/**
|
|
* Gets the application credentials. App Credentials are cached so as to ensure we are not refreshing
|
|
* token every time.
|
|
* @private
|
|
* @param appId The application identifier (AAD Id for the bot).
|
|
* @param oAuthScope The scope for the token, skills will use the Skill App Id.
|
|
*/
|
|
private getAppCredentials;
|
|
}
|
|
//# sourceMappingURL=botFrameworkHttpClient.d.ts.map
|