UNPKG

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