UNPKG

5.47 kBTypeScriptView Raw
1import { ChannelServiceHandler } from '../channelServiceHandler';
2import { AuthenticationConfiguration, ClaimsIdentity, ICredentialProvider } from 'botframework-connector';
3import { Activity, ActivityHandlerBase, BotAdapter, ResourceResponse, SkillConversationIdFactoryBase } from 'botbuilder-core';
4/**
5 * A Bot Framework Handler for skills.
6 */
7export declare class SkillHandler extends ChannelServiceHandler {
8 /**
9 * Used to access the CovnersationReference sent from the Skill to the Parent.
10 *
11 * @remarks
12 * The value is the same as the SkillConversationReferenceKey exported from botbuilder-core.
13 */
14 readonly SkillConversationReferenceKey: symbol;
15 private readonly inner;
16 /**
17 * Initializes a new instance of the SkillHandler class.
18 *
19 * @param adapter An instance of the BotAdapter that will handle the request.
20 * @param bot The ActivityHandlerBase instance.
21 * @param conversationIdFactory A SkillConversationIdFactoryBase to unpack the conversation ID and map it to the calling bot.
22 * @param credentialProvider The credential provider.
23 * @param authConfig The authentication configuration.
24 * @param channelService The string indicating if the bot is working in Public Azure or in Azure Government (https://aka.ms/AzureGovDocs).
25 */
26 constructor(adapter: BotAdapter, bot: ActivityHandlerBase, conversationIdFactory: SkillConversationIdFactoryBase, credentialProvider: ICredentialProvider, authConfig: AuthenticationConfiguration, channelService?: string);
27 /**
28 * sendToConversation() API for Skill.
29 *
30 * @remarks
31 * This method allows you to send an activity to the end of a conversation.
32 *
33 * This is slightly different from replyToActivity().
34 * * sendToConversation(conversationId) - will append the activity to the end
35 * of the conversation according to the timestamp or semantics of the channel.
36 * * replyToActivity(conversationId,ActivityId) - adds the activity as a reply
37 * to another activity, if the channel supports it. If the channel does not
38 * support nested replies, replyToActivity falls back to sendToConversation.
39 *
40 * Use replyToActivity when replying to a specific activity in the conversation.
41 *
42 * Use sendToConversation in all other cases.
43 * @param claimsIdentity ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.
44 * @param conversationId Conversation ID.
45 * @param activity Activity to send.
46 * @returns A Promise with a ResourceResponse.
47 */
48 protected onSendToConversation(claimsIdentity: ClaimsIdentity, conversationId: string, activity: Activity): Promise<ResourceResponse>;
49 /**
50 * replyToActivity() API for Skill.
51 *
52 * @remarks
53 * This method allows you to reply to an activity.
54 *
55 * This is slightly different from sendToConversation().
56 * * sendToConversation(conversationId) - will append the activity to the end
57 * of the conversation according to the timestamp or semantics of the channel.
58 * * replyToActivity(conversationId,ActivityId) - adds the activity as a reply
59 * to another activity, if the channel supports it. If the channel does not
60 * support nested replies, replyToActivity falls back to sendToConversation.
61 *
62 * Use replyToActivity when replying to a specific activity in the conversation.
63 *
64 * Use sendToConversation in all other cases.
65 * @param claimsIdentity ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.
66 * @param conversationId Conversation ID.
67 * @param activityId activityId the reply is to.
68 * @param activity Activity to send.
69 * @returns A Promise with a ResourceResponse.
70 */
71 protected onReplyToActivity(claimsIdentity: ClaimsIdentity, conversationId: string, activityId: string, activity: Activity): Promise<ResourceResponse>;
72 /**
73 *
74 * UpdateActivity() API for Skill.
75 *
76 * @remarks
77 * Edit an existing activity.
78 *
79 * Some channels allow you to edit an existing activity to reflect the new
80 * state of a bot conversation.
81 *
82 * For example, you can remove buttons after someone has clicked "Approve" button.
83 * @param claimsIdentity ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.
84 * @param conversationId Conversation ID.
85 * @param activityId activityId to update.
86 * @param activity replacement Activity.
87 * @returns a promise resolving to the underlying resource response
88 */
89 protected onUpdateActivity(claimsIdentity: ClaimsIdentity, conversationId: string, activityId: string, activity: Activity): Promise<ResourceResponse>;
90 /**
91 * DeleteActivity() API for Skill.
92 *
93 * @remarks
94 * Delete an existing activity.
95 *
96 * Some channels allow you to delete an existing activity, and if successful
97 * this method will remove the specified activity.
98 *
99 *
100 * @param claimsIdentity ClaimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.
101 * @param conversationId Conversation ID.
102 * @param activityId activityId to delete.
103 * @returns a promise representing the async operation
104 */
105 protected onDeleteActivity(claimsIdentity: ClaimsIdentity, conversationId: string, activityId: string): Promise<void>;
106}
107//# sourceMappingURL=skillHandler.d.ts.map
\No newline at end of file