@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
72 lines (70 loc) • 2.42 kB
JavaScript
import { Client } from '@microsoft/teams.common';
import { mergeApiClientSettings } from './api-client-settings.mjs';
import { normalizeServiceUrl } from './service-url.mjs';
class MeetingClient {
serviceUrl;
get http() {
return this._http;
}
set http(v) {
this._http = v;
}
_http;
_apiClientSettings;
constructor(serviceUrl, options, apiClientSettings) {
this.serviceUrl = normalizeServiceUrl(serviceUrl);
if (!options) {
this._http = new Client();
} else if ("request" in options) {
this._http = options;
} else {
this._http = new Client(options);
}
this._apiClientSettings = mergeApiClientSettings(apiClientSettings);
}
/**
* 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;
}
}
export { MeetingClient };
//# sourceMappingURL=meeting.mjs.map
//# sourceMappingURL=meeting.mjs.map