UNPKG

2.64 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, BotFrameworkSkill, InvokeResponse, SkillConversationIdFactoryBase } from 'botbuilder-core';
9import { ICredentialProvider } from 'botframework-connector';
10import { BotFrameworkHttpClient } from '../botFrameworkHttpClient';
11/**
12 * A BotFrameworkHttpClient specialized for Skills that encapsulates Conversation ID generation.
13 */
14export declare class SkillHttpClient extends BotFrameworkHttpClient {
15 private readonly conversationIdFactory;
16 /**
17 * Creates a new instance of the [SkillHttpClient](xref:botbuilder-core.SkillHttpClient) class.
18 *
19 * @param credentialProvider An instance of [ICredentialProvider](xref:botframework-connector.ICredentialProvider).
20 * @param conversationIdFactory An instance of a class derived from [SkillConversationIdFactoryBase](xref:botbuilder-core.SkillConversationIdFactoryBase).
21 * @param channelService Optional. The channel service.
22 */
23 constructor(credentialProvider: ICredentialProvider, conversationIdFactory: SkillConversationIdFactoryBase, channelService?: string);
24 /**
25 * Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity.
26 *
27 * @template T The type of body in the InvokeResponse.
28 * @param originatingAudience The OAuth audience scope, used during token retrieval. (Either https://api.botframework.com or bot app id.)
29 * @param fromBotId The MicrosoftAppId of the bot sending the activity.
30 * @param toSkill The skill to create the Conversation Id for.
31 * @param callbackUrl The callback Url for the skill host.
32 * @param activity The activity to send.
33 */
34 postToSkill<T>(originatingAudience: string, fromBotId: string, toSkill: BotFrameworkSkill, callbackUrl: string, activity: Activity): Promise<InvokeResponse<T>>;
35 /**
36 * Uses the SkillConversationIdFactory to create or retrieve a Skill Conversation Id, and sends the activity.
37 *
38 * @deprecated This overload is deprecated. Please use SkillHttpClient.postToSkill() that takes an `originatingAudience`.
39 * @param fromBotId The MicrosoftAppId of the bot sending the activity.
40 * @param toSkill The skill to create the Conversation Id for.
41 * @param callbackUrl The callback Url for the skill host.
42 * @param activity The activity to send.
43 */
44 postToSkill(fromBotId: string, toSkill: BotFrameworkSkill, callbackUrl: string, activity: Activity): Promise<InvokeResponse>;
45}
46//# sourceMappingURL=skillHttpClient.d.ts.map
\No newline at end of file