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

70 lines (68 loc) • 1.72 kB
import { Client } from '@microsoft/teams.common'; import { mergeApiClientSettings } from '../api-client-settings.mjs'; import { UserTokenClient } from './token.mjs'; export * from './token.mjs'; class UserClient { get http() { return this._http; } set http(v) { this._token.http = v; this._http = v; } /** * @deprecated Use the flattened methods on `UserClient` instead * (e.g. `users.getToken(...)`). This grouped accessor will be removed * in a future release. */ get token() { return this._token; } _http; _token; _apiClientSettings; constructor(options, apiClientSettings, cloud) { if (!options) { this._http = new Client(); } else if ("request" in options) { this._http = options; } else { this._http = new Client(options); } this._apiClientSettings = mergeApiClientSettings(apiClientSettings, cloud); this._token = new UserTokenClient(this.http, this._apiClientSettings, cloud); } /** * Get a user token for the given connection. */ getToken(params) { return this._token.get(params); } /** * Get AAD tokens for the given connection and resource urls. */ getAadTokens(params) { return this._token.getAad(params); } /** * Get the token status for a user. */ getTokenStatus(params) { return this._token.getStatus(params); } /** * Sign a user out of the given connection. */ signOut(params) { return this._token.signOut(params); } /** * Exchange a user token for the given connection. */ exchangeToken(params) { return this._token.exchange(params); } } export { UserClient }; //# sourceMappingURL=index.mjs.map //# sourceMappingURL=index.mjs.map