UNPKG

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