UNPKG

zaccl

Version:

The Zoom App Complete Connection Library, a project that handles everything required to build a zoom-integrated app.

257 lines (230 loc) 12.1 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>ECatUser.js - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> <script src="scripts/nav.js" defer></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav style="border-right: 2px solid #ccc; padding-bottom: 25px;" > <h2><a style="font-size: 30px;" href="index.html">ZACCL API</a></h2><h3>Endpoint Functions</h3><ul><li><a href="api.cloudRecording.html">api.cloudRecording</a><ul class='methods'><li data-type='method'><a href="api.cloudRecording.html#listAccountRecordings">listAccountRecordings</a></li><li data-type='method'><a href="api.cloudRecording.html#listMeetingRecordings">listMeetingRecordings</a></li><li data-type='method'><a href="api.cloudRecording.html#listUserRecordings">listUserRecordings</a></li><li data-type='method'><a href="api.cloudRecording.html#recoverMeetingRecordings">recoverMeetingRecordings</a></li></ul></li><li><a href="api.group.html">api.group</a><ul class='methods'><li data-type='method'><a href="api.group.html#listGroupMembers">listGroupMembers</a></li></ul></li><li><a href="api.meeting.html">api.meeting</a><ul class='methods'><li data-type='method'><a href="api.meeting.html#addAltHost">addAltHost</a></li><li data-type='method'><a href="api.meeting.html#create">create</a></li><li data-type='method'><a href="api.meeting.html#delete">delete</a></li><li data-type='method'><a href="api.meeting.html#get">get</a></li><li data-type='method'><a href="api.meeting.html#getActivitiesReport">getActivitiesReport</a></li><li data-type='method'><a href="api.meeting.html#getParticipantReport">getParticipantReport</a></li><li data-type='method'><a href="api.meeting.html#getPastMeetingDetails">getPastMeetingDetails</a></li><li data-type='method'><a href="api.meeting.html#getPollInfo">getPollInfo</a></li><li data-type='method'><a href="api.meeting.html#getQAReport">getQAReport</a></li><li data-type='method'><a href="api.meeting.html#getTranscript">getTranscript</a></li><li data-type='method'><a href="api.meeting.html#listPastInstances">listPastInstances</a></li><li data-type='method'><a href="api.meeting.html#listPastMeetingParticipants">listPastMeetingParticipants</a></li><li data-type='method'><a href="api.meeting.html#listPastPollOccurrences">listPastPollOccurrences</a></li><li data-type='method'><a href="api.meeting.html#update">update</a></li></ul></li><li><a href="api.user.html">api.user</a><ul class='methods'><li data-type='method'><a href="api.user.html#activate">activate</a></li><li data-type='method'><a href="api.user.html#addWebinarLicense">addWebinarLicense</a></li><li data-type='method'><a href="api.user.html#get">get</a></li><li data-type='method'><a href="api.user.html#getZAKToken">getZAKToken</a></li><li data-type='method'><a href="api.user.html#promoteToLicensed">promoteToLicensed</a></li></ul></li><li><a href="api.webinar.html">api.webinar</a><ul class='methods'><li data-type='method'><a href="api.webinar.html#addPanelist">addPanelist</a></li><li data-type='method'><a href="api.webinar.html#create">create</a></li><li data-type='method'><a href="api.webinar.html#get">get</a></li><li data-type='method'><a href="api.webinar.html#getParticipantReport">getParticipantReport</a></li><li data-type='method'><a href="api.webinar.html#getPollReport">getPollReport</a></li><li data-type='method'><a href="api.webinar.html#getQAReport">getQAReport</a></li><li data-type='method'><a href="api.webinar.html#listPanelists">listPanelists</a></li></ul></li></ul> </nav> <div id="main"> <section> <article> <pre class="prettyprint source linenums"><code>"use strict"; /** * Category of endpoints for Zoom users * @author Aryan Pandey * @namespace api.user */ var __awaiter = (this &amp;&amp; this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this &amp;&amp; this.__importDefault) || function (mod) { return (mod &amp;&amp; mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); // Import shared interfaces const EndpointCategory_1 = __importDefault(require("../shared/interfaces/EndpointCategory")); class ECatUser extends EndpointCategory_1.default { /** * Retrieve a user's ZAK token (Light) * @author Aryan Pandey * @instance * @memberof api.user * @method getZAKToken * @param opts object containing all arguments * @param opts.userId the user ID or email address of the user * @returns the ZAK token of the user */ getZAKToken(opts) { return __awaiter(this, void 0, void 0, function* () { return this.visitEndpoint({ path: `/users/${opts.userId}/token`, action: 'retrieve a user\'s ZAK token', method: 'GET', params: { type: 'zak', }, itemKey: 'token', errorMap: { 404: { 1001: `We could not retrieve a token for Zoom user ${opts.userId} since this user does not exist`, }, }, }); }); } /** * (Re)activate a user and promote them to a "licensed" user (unless * dontPromoteToLicensed is true) (Light) * @author Gabe Abrams * @instance * @memberof api.user * @method activate * @param opts object containing all arguments * @param opts.userId the user ID or email address of the user * @param [opts.dontPromoteToLicensed] - if true, the user will not * be promoted to a "licensed" user just after activation */ activate(opts) { return __awaiter(this, void 0, void 0, function* () { // Activate the user const activatePromise = this.visitEndpoint({ path: `/users/${opts.userId}/status`, action: 'activate or reactivate a user', method: 'PUT', params: { action: 'activate', }, errorMap: { 400: { 200: 'That Zoom user could not be activated.', 3412: 'The Zoom account has reached its max allowed active accounts.', 2033: 'The Zoom account reached its basic user limit.', }, 404: { 1001: 'That Zoom user could not be found.', }, }, }); // Optionally promote to "licensed" if (!opts.dontPromoteToLicensed) { return activatePromise.then(() => { // Promote user to "licensed" return this.api.user.promoteToLicensed({ userId: opts.userId, }); }); } // Just activate and resolve return activatePromise; }); } /** * Add a webinar license to the user of interest (Medium) * @author Gabe Abrams * @instance * @memberof api.user * @method addWebinarLicense * @param opts object containing all arguments * @param opts.userId the user ID or email address of the user * @param [opts.webinarCapacity=500] the max capacity for this * user's webinars. Allowed values: 100, 500, 1000, 3000, 5000, 10000 */ addWebinarLicense(opts) { var _a; return __awaiter(this, void 0, void 0, function* () { return this.visitEndpoint({ path: `/users/${opts.userId}/settings`, action: 'add a webinar license to a user', method: 'PATCH', params: { feature: { webinar: true, webinar_capacity: ((_a = opts.webinarCapacity) !== null &amp;&amp; _a !== void 0 ? _a : 500), }, }, errorMap: { 400: { 1122: 'Webinar feature can only be enabled for Licensed or On-prem users.', }, 404: { 1001: 'That Zoom user could not be found.', }, }, }); }); } /** * Get a user (Light) * @author Gabe Abrams * @instance * @memberof api.user * @method get * @param opts object containing all arguments * @param opts.userId the user ID or email address of the user * @returns Zoom user object {@link https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/user} */ get(opts) { return __awaiter(this, void 0, void 0, function* () { return this.visitEndpoint({ path: `/users/${opts.userId}`, action: 'get a user', method: 'GET', errorMap: { 404: { 1001: 'That Zoom user could not be found.', }, }, }); }); } /** * Promote a user to "licensed" type (Light) * @author Gabe Abrams * @instance * @memberof api.user * @method promoteToLicensed * @param opts object containing all arguments * @param opts.userId the user ID or email address of the user */ promoteToLicensed(opts) { return __awaiter(this, void 0, void 0, function* () { return this.visitEndpoint({ path: `/users/${opts.userId}`, action: 'promote a user to "licensed" type', method: 'PATCH', params: { type: 2, // Licensed }, errorMap: { 400: { 2034: 'The Zoom account has reached its max allowed active accounts.', 2033: 'The Zoom account reached its basic user limit.', }, 404: { 1001: 'That Zoom user could not be found.', }, }, }); }); } } /*------------------------------------------------------------------------*/ /* Export */ /*------------------------------------------------------------------------*/ exports.default = ECatUser; //# sourceMappingURL=ECatUser.js.map</code></pre> </article> </section> </div> <br class="clear"> <footer> We use <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> and the <a href="https://github.com/clenemt/docdash">docdash</a> theme to generate our docs. </footer> <script>prettyPrint();</script> <script src="scripts/polyfill.js"></script> <script src="scripts/linenumber.js"></script> </body> </html>