UNPKG

2.3 kBTypeScriptView Raw
1/**
2 * @module botbuilder
3 */
4/**
5 * Copyright (c) Microsoft Corporation. All rights reserved.
6 * Licensed under the MIT License.
7 */
8import { Activity, BotFrameworkClient, InvokeResponse } from 'botbuilder-core';
9import { AppCredentials, ICredentialProvider } from 'botframework-connector';
10/**
11 * HttpClient for calling skills from a Node.js BotBuilder V4 SDK bot.
12 */
13export declare class BotFrameworkHttpClient implements BotFrameworkClient {
14 protected readonly channelService: string;
15 /**
16 * Cache for appCredentials to speed up token acquisition (a token is not requested unless is expired)
17 * AppCredentials are cached using appId + scope (this last parameter is only used if the app credentials are used to call a skill)
18 */
19 private static readonly appCredentialMapCache;
20 private readonly credentialProvider;
21 constructor(credentialProvider: ICredentialProvider, channelService?: string);
22 /**
23 * Forwards an activity to a another bot.
24 * @remarks
25 *
26 * @template T The type of body in the InvokeResponse.
27 * @param fromBotId The MicrosoftAppId of the bot sending the activity.
28 * @param toBotId The MicrosoftAppId of the bot receiving the activity.
29 * @param toUrl The URL of the bot receiving the activity.
30 * @param serviceUrl The callback Url for the skill host.
31 * @param conversationId A conversation ID to use for the conversation with the skill.
32 * @param activity Activity to forward.
33 */
34 postActivity<T>(fromBotId: string, toBotId: string, toUrl: string, serviceUrl: string, conversationId: string, activity: Activity): Promise<InvokeResponse<T>>;
35 postActivity(fromBotId: string, toBotId: string, toUrl: string, serviceUrl: string, conversationId: string, activity: Activity): Promise<InvokeResponse>;
36 protected buildCredentials(appId: string, oAuthScope?: string): Promise<AppCredentials>;
37 /**
38 * Gets the application credentials. App Credentials are cached so as to ensure we are not refreshing
39 * token every time.
40 * @private
41 * @param appId The application identifier (AAD Id for the bot).
42 * @param oAuthScope The scope for the token, skills will use the Skill App Id.
43 */
44 private getAppCredentials;
45}
46//# sourceMappingURL=botFrameworkHttpClient.d.ts.map
\No newline at end of file