@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
66 lines (63 loc) • 2.48 kB
JavaScript
;
var teams_common = require('@microsoft/teams.common');
var models = require('../../models');
var apiClientSettings = require('../api-client-settings');
var serviceUrl = require('../service-url');
class ConversationMemberClient {
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);
}
async get(conversationId) {
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/members`;
const res = await this.http.get(url);
return res.data.map(models.resolveAadObjectId);
}
async getById(conversationId, id) {
const url = `${this.serviceUrl}/v3/conversations/${conversationId}/members/${id}`;
const res = await this.http.get(url);
return models.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(models.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;
}
}
exports.ConversationMemberClient = ConversationMemberClient;
//# sourceMappingURL=member.js.map
//# sourceMappingURL=member.js.map