UNPKG

@microsoft/agents-hosting-extensions-teams

Version:

Microsoft 365 Agents SDK for JavaScript. Teams extensions

175 lines (174 loc) 8.61 kB
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { TeamsChannelAccount } from './activity-extensions/teamsChannelAccount'; import { TeamsMeetingParticipant } from './meeting/teamsMeetingParticipant'; import { MeetingInfo } from './meeting/meetingInfo'; import { MeetingNotification } from './meeting/meetingNotification'; import { MeetingNotificationResponse } from './meeting/meetingNotificationResponse'; import { Activity, ConversationReference } from '@microsoft/agents-activity'; import { TurnContext, TurnState } from '@microsoft/agents-hosting'; import { ChannelInfo } from './activity-extensions/channelInfo'; import { BatchFailedEntriesResponse, BatchOperationResponse, BatchOperationStateResponse, CancelOperationResponse, TeamDetails, TeamsMember, TeamsPagedMembersResult } from './client/teamsConnectorClient.types'; /** * 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<TurnState>>; /** * 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; }