UNPKG

@microsoft/teams.api

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.api/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.api?activeTab=code" t

74 lines (71 loc) • 2.49 kB
'use strict'; var teams_common = require('@microsoft/teams.common'); var apiClientSettings = require('./api-client-settings'); var serviceUrl = require('./service-url'); class MeetingClient { serviceUrl; get http() { return this._http; } set http(v) { this._http = v; } _http; _apiClientSettings; constructor(serviceUrl$1, options, apiClientSettings$1) { this.serviceUrl = serviceUrl.normalizeServiceUrl(serviceUrl$1); if (!options) { this._http = new teams_common.Client(); } else if ("request" in options) { this._http = options; } else { this._http = new teams_common.Client(options); } this._apiClientSettings = apiClientSettings.mergeApiClientSettings(apiClientSettings$1); } /** * Retrieves meeting information including details, organizer, and conversation. * @param id - The meeting ID. */ async getById(id) { const url = `${this.serviceUrl}/v1/meetings/${id}`; const res = await this.http.get(url); return res.data; } /** * Retrieves information about a specific participant in a meeting. * @param meetingId - The meeting ID. * @param id - The user AAD object ID * @param tenantId - The tenant ID of the meeting and user. * @returns {MeetingParticipant} The meeting participant information. */ async getParticipant(meetingId, id, tenantId) { const url = `${this.serviceUrl}/v1/meetings/${meetingId}/participants/${id}?tenantId=${tenantId}`; const res = await this.http.get(url); return res.data; } /** * Send a targeted in-meeting notification to specific participants. * * Returns `undefined` on full success (HTTP 202). Returns a `MeetingNotificationResponse` * with per-recipient failure info on partial success (HTTP 207). * * Requires the RSC permission `OnlineMeetingNotification.Send.Chat` and the ECS flag * enabled for the tenant/bot. * * @param meetingId - The BASE64-encoded meeting ID. * @param params - The notification parameters including recipients and surfaces. */ async sendNotification(meetingId, params) { const body = { type: params.type ?? "targetedMeetingNotification", value: params.value }; const url = `${this.serviceUrl}/v1/meetings/${meetingId}/notification`; const res = await this.http.post(url, body); return res.data || void 0; } } exports.MeetingClient = MeetingClient; //# sourceMappingURL=meeting.js.map //# sourceMappingURL=meeting.js.map