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

104 lines (99 loc) 3.01 kB
'use strict'; var http = require('@microsoft/teams.common/http'); var bot = require('./bot'); var conversation = require('./conversation'); var meeting = require('./meeting'); var team = require('./team'); var user = require('./user'); function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var http__namespace = /*#__PURE__*/_interopNamespace(http); class Client { serviceUrl; bots; users; conversations; teams; meetings; get http() { return this._http; } set http(v) { this.bots.http = v; this.conversations.http = v; this.users.http = v; this.teams.http = v; this.meetings.http = v; this._http = v; } _http; constructor(serviceUrl, options) { this.serviceUrl = serviceUrl; if (!options) { this._http = new http__namespace.Client(); } else if ("request" in options) { this._http = options; } else { this._http = new http__namespace.Client({ ...options, headers: { ...options?.headers, "Content-Type": "application/json" } }); } this.bots = new bot.BotClient(this.http); this.users = new user.UserClient(this.http); this.conversations = new conversation.ConversationClient(serviceUrl, this.http); this.teams = new team.TeamClient(serviceUrl, this.http); this.meetings = new meeting.MeetingClient(serviceUrl, this.http); } } exports.Client = Client; Object.keys(bot).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bot[k]; } }); }); Object.keys(conversation).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return conversation[k]; } }); }); Object.keys(meeting).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return meeting[k]; } }); }); Object.keys(team).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return team[k]; } }); }); Object.keys(user).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return user[k]; } }); }); //# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map