UNPKG

10.8 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, ChannelInfo, TeamsChannelAccount, TeamDetails, TurnContext, TeamsPagedMembersResult, ConversationReference, TeamsMeetingParticipant, MeetingInfo, MeetingNotification, MeetingNotificationResponse, TeamsMember, BatchOperationResponse, BatchOperationStateResponse, BatchFailedEntriesResponse } from 'botbuilder-core';
9import { CancelOperationResponse } from 'botframework-connector';
10/**
11 * Provides utility methods for the events and interactions that occur within Microsoft Teams.
12 */
13export declare class TeamsInfo {
14 /**
15 * Gets the meeting participant for the given meeting id and participant id. This only works in
16 * teams scoped meeting conversations.
17 *
18 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
19 * @param meetingId The meeting ID to fetch
20 * @param participantId The participant ID to fetch
21 * @param tenantId The tenant ID to use when scoping the request
22 * @returns The [TeamsMeetingParticipant](xref:botbuilder-core.TeamsMeetingParticipant) fetched
23 */
24 static getMeetingParticipant(context: TurnContext, meetingId?: string, participantId?: string, tenantId?: string): Promise<TeamsMeetingParticipant>;
25 /**
26 * Gets the information for the given meeting id.
27 *
28 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
29 * @param meetingId The BASE64-encoded id of the Teams meeting.
30 * @returns The [MeetingInfo](xref:botframework-schema.MeetingInfo) fetched
31 */
32 static getMeetingInfo(context: TurnContext, meetingId?: string): Promise<MeetingInfo>;
33 /**
34 * Gets the details for the given team id. This only works in teams scoped conversations.
35 *
36 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
37 * @param teamId The id of the Teams team.
38 * @returns The [TeamDetails](xref:botbuilder-core.TeamDetails) fetched
39 */
40 static getTeamDetails(context: TurnContext, teamId?: string): Promise<TeamDetails>;
41 /**
42 * Creates a new thread in a Teams chat and sends an [Activity](xref:botframework-schema.Activity) to that new thread.
43 *
44 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
45 * @param activity The [Activity](xref:botframework-schema.Activity) to send.
46 * @param teamsChannelId The Team's Channel ID, note this is distinct from the Bot Framework activity property with same name.
47 * @param botAppId The bot's appId. This is only used when context.adapter is an instance of CloudAdapter.
48 * @returns The [ConversationReference](xref:botframework-schema.ConversationReference) and the id of the [Activity](xref:botframework-schema.Activity) (if sent).
49 */
50 static sendMessageToTeamsChannel(context: TurnContext, activity: Activity, teamsChannelId: string, botAppId?: string): Promise<[ConversationReference, string]>;
51 /**
52 * Returns a list of channels in a Team. This only works in teams scoped conversations.
53 *
54 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
55 * @param teamId ID of the Teams team.
56 * @returns The list of [ChannelInfo](xref:botframework-schema.ChannelInfo) objects with the conversations.
57 */
58 static getTeamChannels(context: TurnContext, teamId?: string): Promise<ChannelInfo[]>;
59 /**
60 * Gets the conversation members of a one-on-one or group chat.
61 *
62 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
63 * @returns The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount).
64 *
65 * @deprecated Use `getPagedTeamMembers` instead.
66 */
67 static getMembers(context: TurnContext): Promise<TeamsChannelAccount[]>;
68 /**
69 * Gets a pagined list of members of one-on-one, group, or team conversation.
70 *
71 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
72 * @param pageSize Suggested number of entries on a page.
73 * @param continuationToken A continuation token.
74 * @returns The [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.
75 */
76 static getPagedMembers(context: TurnContext, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
77 /**
78 * Gets the account of a single conversation member.
79 *
80 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
81 * @param userId ID of the user in question.
82 * @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.
83 */
84 static getMember(context: TurnContext, userId: string): Promise<TeamsChannelAccount>;
85 /**
86 * Gets the list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) within a team.
87 *
88 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
89 * @param teamId ID of the Teams team.
90 * @returns The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the members.
91 *
92 * @deprecated Use `getPagedTeamMembers` instead.
93 */
94 static getTeamMembers(context: TurnContext, teamId?: string): Promise<TeamsChannelAccount[]>;
95 /**
96 * Gets a paginated list of members of a team.
97 *
98 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
99 * @param teamId ID of the Teams team.
100 * @param pageSize The number of entries on the page.
101 * @param continuationToken The continuationToken token.
102 * @returns A [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.
103 */
104 static getPagedTeamMembers(context: TurnContext, teamId?: string, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
105 /**
106 * Gets the account of a member in a teams scoped conversation.
107 *
108 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
109 * @param teamId ID of the Teams team.
110 * @param userId ID of the Teams user.
111 * @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.
112 */
113 static getTeamMember(context: TurnContext, teamId?: string, userId?: string): Promise<TeamsChannelAccount>;
114 /**
115 * Sends a meeting notification to specific users in a Teams meeting.
116 *
117 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
118 * @param notification The meeting notification payload.
119 * @param meetingId Id of the Teams meeting.
120 * @returns Promise with either an empty object if notifications were successfully sent to all recipients or
121 * [MeetingNotificationResponse](xref:botframework-schema.MeetingNotificationResponse) if notifications
122 * were sent to some but not all recipients.
123 */
124 static sendMeetingNotification(context: TurnContext, notification: MeetingNotification, meetingId?: string): Promise<MeetingNotificationResponse>;
125 /**
126 * Sends a message to the provided users in the list of Teams members.
127 *
128 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
129 * @param activity The activity to send.
130 * @param tenantId The tenant ID.
131 * @param members The list of users recipients for the message.
132 * @returns Promise with operationId.
133 */
134 static sendMessageToListOfUsers(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
135 /**
136 * Sends a message to all the users in a tenant.
137 *
138 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
139 * @param activity The activity to send.
140 * @param tenantId The tenant ID.
141 * @returns Promise with operationId.
142 */
143 static sendMessageToAllUsersInTenant(context: TurnContext, activity: Activity, tenantId: string): Promise<BatchOperationResponse>;
144 /**
145 * Sends a message to all the users in a team.
146 *
147 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
148 * @param activity The activity to send.
149 * @param tenantId The tenant ID.
150 * @param teamId The team ID.
151 * @returns Promise with operationId.
152 */
153 static sendMessageToAllUsersInTeam(context: TurnContext, activity: Activity, tenantId: string, teamId: string): Promise<BatchOperationResponse>;
154 /**
155 * Sends a message to the provided list of Teams channels.
156 *
157 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
158 * @param activity The activity to send.
159 * @param tenantId The tenant ID.
160 * @param members The list of channels recipients for the message.
161 * @returns Promise with operationId.
162 */
163 static sendMessageToListOfChannels(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
164 /**
165 * Gets the operation state.
166 *
167 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
168 * @param operationId The operationId to get the state of.
169 * @returns Promise with The state and responses of the operation.
170 */
171 static getOperationState(context: TurnContext, operationId: string): Promise<BatchOperationStateResponse>;
172 /**
173 * Gets the failed entries of an executed operation.
174 *
175 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
176 * @param operationId The operationId to get the failed entries of.
177 * @returns Promise with the list of failed entries of the operation.
178 */
179 static getFailedEntries(context: TurnContext, operationId: string): Promise<BatchFailedEntriesResponse>;
180 /**
181 * Cancels a pending operation.
182 *
183 * @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
184 * @param operationId The id of the operation to cancel.
185 * @returns Promise representing the asynchronous operation.
186 */
187 static cancelOperation(context: TurnContext, operationId: string): Promise<CancelOperationResponse>;
188 /**
189 * @private
190 */
191 private static getMembersInternal;
192 /**
193 * @private
194 */
195 private static getPagedMembersInternal;
196 /**
197 * @private
198 */
199 private static getMemberInternal;
200 /**
201 * @private
202 */
203 private static getTeamId;
204 /**
205 * @private
206 */
207 private static getConnectorClient;
208 /**
209 * @private
210 */
211 private static getTeamsConnectorClient;
212}
213//# sourceMappingURL=teamsInfo.d.ts.map
\No newline at end of file