@microsoft/agents-hosting-teams
Version:
Microsoft 365 Agents SDK for JavaScript
181 lines (180 loc) • 8.95 kB
TypeScript
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { TeamsChannelAccount } from './connector-client/teamsChannelAccount';
import { TeamsMeetingParticipant } from './meeting/teamsMeetingParticipant';
import { MeetingInfo } from './connector-client/meetingInfo';
import { TeamDetails } from './connector-client/teamDetails';
import { TeamsPagedMembersResult } from './connector-client/teamsPagedMembersResult';
import { MeetingNotification } from './connector-client/meetingNotification';
import { MeetingNotificationResponse } from './connector-client/meetingNotificationResponse';
import { TeamsMember } from './connector-client/teamsMember';
import { BatchOperationStateResponse } from './connector-client/batchOperationStateResponse';
import { BatchFailedEntriesResponse } from './connector-client/batchFailedEntriesResponse';
import { CancelOperationResponse } from './connector-client/cancelOperationResponse';
import { Activity, ConversationReference } from '@microsoft/agents-activity';
import { ChannelInfo } from './channel-data';
import { BatchOperationResponse } from './connector-client/batchOperationResponse';
import { TurnContext } from '@microsoft/agents-hosting';
/**
* Provides utility methods for interacting with Microsoft Teams-specific features.
* This class includes methods for retrieving team details, meeting information, sending messages,
* and managing operations within the Teams environment.
*/
export declare class TeamsInfo {
/**
* Gets the meeting participant information.
*
* @param {TurnContext} context - The turn context.
* @param {string} [meetingId] - The meeting ID.
* @param {string} [participantId] - The participant ID.
* @param {string} [tenantId] - The tenant ID.
* @returns {Promise<TeamsMeetingParticipant>} - The meeting participant information.
*/
static getMeetingParticipant(context: TurnContext, meetingId?: string, participantId?: string, tenantId?: string): Promise<TeamsMeetingParticipant>;
/**
* Gets the meeting information.
*
* @param {TurnContext} context - The turn context.
* @param {string} [meetingId] - The meeting ID.
* @returns {Promise<MeetingInfo>} - The meeting information.
*/
static getMeetingInfo(context: TurnContext, meetingId?: string): Promise<MeetingInfo>;
/**
* Gets the team details.
*
* @param {TurnContext} context - The turn context.
* @param {string} [teamId] - The team ID.
* @returns {Promise<TeamDetails>} - The team details.
*/
static getTeamDetails(context: TurnContext, teamId?: string): Promise<TeamDetails>;
/**
* Sends a message to a Teams channel.
*
* @param {TurnContext} context - The turn context.
* @param {Activity} activity - The activity to send.
* @param {string} teamsChannelId - The Teams channel ID.
* @param {string} [appId] - The application ID.
* @returns {Promise<[ConversationReference, string]>} - The conversation reference and new activity ID.
*/
static sendMessageToTeamsChannel(context: TurnContext, activity: Activity, teamsChannelId: string, appId?: string): Promise<[ConversationReference, string]>;
/**
* Gets the channels of a team.
*
* @param {TurnContext} context - The turn context.
* @param {string} [teamId] - The team ID.
* @returns {Promise<ChannelInfo[]>} - The list of channels.
*/
static getTeamChannels(context: TurnContext, teamId?: string): Promise<ChannelInfo[]>;
/**
* Gets the paged members of a team or conversation.
*
* @param {TurnContext} context - The turn context.
* @param {number} [pageSize] - The page size.
* @param {string} [continuationToken] - The continuation token.
* @returns {Promise<TeamsPagedMembersResult>} - The paged members result.
*/
static getPagedMembers(context: TurnContext, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
/**
* Gets a member of a team or conversation.
*
* @param {TurnContext} context - The turn context.
* @param {string} userId - The user ID.
* @returns {Promise<TeamsChannelAccount>} - The member information.
*/
static getMember(context: TurnContext, userId: string): Promise<TeamsChannelAccount>;
/**
* Gets the paged members of a team.
*
* @param {TurnContext} context - The turn context.
* @param {string} [teamId] - The team ID.
* @param {number} [pageSize] - The page size.
* @param {string} [continuationToken] - The continuation token.
* @returns {Promise<TeamsPagedMembersResult>} - The paged members result.
*/
static getPagedTeamMembers(context: TurnContext, teamId?: string, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
/**
* Gets a member of a team.
*
* @param {TurnContext} context - The turn context.
* @param {string} teamId - The team ID.
* @param {string} userId - The user ID.
* @returns {Promise<TeamsChannelAccount>} - The member information.
*/
static getTeamMember(context: TurnContext, teamId: string, userId: string): Promise<TeamsChannelAccount>;
/**
* Sends a meeting notification.
*
* @param {TurnContext} context - The turn context.
* @param {MeetingNotification} notification - The meeting notification.
* @param {string} [meetingId] - The meeting ID.
* @returns {Promise<MeetingNotificationResponse>} - The meeting notification response.
*/
static sendMeetingNotification(context: TurnContext, notification: MeetingNotification, meetingId?: string): Promise<MeetingNotificationResponse>;
/**
* Sends a message to a list of users.
*
* @param {TurnContext} context - The turn context.
* @param {Activity} activity - The activity to send.
* @param {string} tenantId - The tenant ID.
* @param {TeamsMember[]} members - The list of members.
* @returns {Promise<BatchOperationResponse>} - The batch operation response.
*/
static sendMessageToListOfUsers(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
/**
* Sends a message to all users in a tenant.
*
* @param {TurnContext} context - The turn context.
* @param {Activity} activity - The activity to send.
* @param {string} tenantId - The tenant ID.
* @returns {Promise<BatchOperationResponse>} - The batch operation response.
*/
static sendMessageToAllUsersInTenant(context: TurnContext, activity: Activity, tenantId: string): Promise<BatchOperationResponse>;
/**
* Sends a message to all users in a team.
*
* @param {TurnContext} context - The turn context.
* @param {Activity} activity - The activity to send.
* @param {string} tenantId - The tenant ID.
* @param {string} teamId - The team ID.
* @returns {Promise<BatchOperationResponse>} - The batch operation response.
*/
static sendMessageToAllUsersInTeam(context: TurnContext, activity: Activity, tenantId: string, teamId: string): Promise<BatchOperationResponse>;
/**
* Sends a message to a list of channels.
*
* @param {TurnContext} context - The turn context.
* @param {Activity} activity - The activity to send.
* @param {string} tenantId - The tenant ID.
* @param {TeamsMember[]} members - The list of members.
* @returns {Promise<BatchOperationResponse>} - The batch operation response.
*/
static sendMessageToListOfChannels(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
/**
* Gets the operation state.
*
* @param {TurnContext} context - The turn context.
* @param {string} operationId - The operation ID.
* @returns {Promise<BatchOperationStateResponse>} - The operation state response.
*/
static getOperationState(context: TurnContext, operationId: string): Promise<BatchOperationStateResponse>;
/**
* Gets the failed entries of an operation.
*
* @param {TurnContext} context - The turn context.
* @param {string} operationId - The operation ID.
* @returns {Promise<BatchFailedEntriesResponse>} - The failed entries response.
*/
static getFailedEntries(context: TurnContext, operationId: string): Promise<BatchFailedEntriesResponse>;
/**
* Cancels an operation.
*
* @param {TurnContext} context - The turn context.
* @param {string} operationId - The operation ID.
* @returns {Promise<CancelOperationResponse>} - The cancel operation response.
*/
static cancelOperation(context: TurnContext, operationId: string): Promise<CancelOperationResponse>;
private static getMemberInternal;
private static getRestClient;
}