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

77 lines (74 loc) • 1.98 kB
'use strict'; var teams_common = require('@microsoft/teams.common'); var apiClientSettings = require('../api-client-settings'); var token = require('./token'); 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$1, cloud) { 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, cloud); this._token = new token.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); } } exports.UserClient = UserClient; Object.keys(token).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return token[k]; } }); }); //# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map