@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
64 lines (62 loc) • 2.4 kB
JavaScript
import { Client } from '@microsoft/teams.common';
import { resolveAadObjectId } from '../../models/index.mjs';
import { mergeApiClientSettings } from '../api-client-settings.mjs';
import { normalizeServiceUrl } from '../service-url.mjs';
class ConversationMemberClient {
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);
}
async get(conversationId) {
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/members`;
const res = await this.http.get(url);
return res.data.map(resolveAadObjectId);
}
async getById(conversationId, id) {
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/members/${id}`;
const res = await this.http.get(url);
return resolveAadObjectId(res.data);
}
/**
* Get paged members in a conversation.
* @param conversationId - The ID of the conversation.
* @param pageSize - Optional maximum number of members per page (min 50, default 200, max 500).
* @param continuationToken - Optional token from a previous call to fetch the next page.
* @returns PagedMembersResult containing members and an optional continuation token.
*/
async getPaged(conversationId, pageSize, continuationToken) {
const params = {};
if (pageSize !== void 0) params["pageSize"] = pageSize;
if (continuationToken !== void 0) params["continuationToken"] = continuationToken;
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/pagedMembers`;
const res = await this.http.get(url, { params });
return { ...res.data, members: res.data.members.map(resolveAadObjectId) };
}
/**
* @deprecated This will be removed by end of summer 2026.
*/
async delete(conversationId, id) {
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/members/${id}`;
const res = await this.http.delete(url);
return res.data;
}
}
export { ConversationMemberClient };
//# sourceMappingURL=member.mjs.map
//# sourceMappingURL=member.mjs.map