@dereekb/zoom 13.38.0 → 13.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nestjs/package.json +10 -10
- package/package.json +11 -12
- package/index.cjs.default.js +0 -1
- package/index.cjs.js +0 -2209
- package/index.cjs.mjs +0 -2
- package/nestjs/index.cjs.default.js +0 -1
- package/nestjs/index.cjs.js +0 -1948
- package/nestjs/index.cjs.mjs +0 -2
package/index.cjs.js
DELETED
|
@@ -1,2209 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fetch = require('@dereekb/util/fetch');
|
|
4
|
-
var util = require('@dereekb/util');
|
|
5
|
-
var makeError = require('make-error');
|
|
6
|
-
|
|
7
|
-
function _define_property$2(obj, key, value) {
|
|
8
|
-
if (key in obj) {
|
|
9
|
-
Object.defineProperty(obj, key, {
|
|
10
|
-
value: value,
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
obj[key] = value;
|
|
17
|
-
}
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
function _object_spread(target) {
|
|
21
|
-
for(var i = 1; i < arguments.length; i++){
|
|
22
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
23
|
-
var ownKeys = Object.keys(source);
|
|
24
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
25
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
26
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
ownKeys.forEach(function(key) {
|
|
30
|
-
_define_property$2(target, key, source[key]);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
}
|
|
35
|
-
function ownKeys(object, enumerableOnly) {
|
|
36
|
-
var keys = Object.keys(object);
|
|
37
|
-
if (Object.getOwnPropertySymbols) {
|
|
38
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
39
|
-
keys.push.apply(keys, symbols);
|
|
40
|
-
}
|
|
41
|
-
return keys;
|
|
42
|
-
}
|
|
43
|
-
function _object_spread_props(target, source) {
|
|
44
|
-
source = source != null ? source : {};
|
|
45
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
-
} else {
|
|
48
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return target;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The Zoom API returns the data for a page for a specific key.
|
|
56
|
-
*
|
|
57
|
-
* This function maps the data under that key to a ZoomPageResult with the data on the "data" variable.
|
|
58
|
-
|
|
59
|
-
* @param dataTypeKey
|
|
60
|
-
* @returns
|
|
61
|
-
*/ function mapToZoomPageResult(dataTypeKey) {
|
|
62
|
-
return function(data) {
|
|
63
|
-
var next_page_token = data.next_page_token, page_count = data.page_count, page_number = data.page_number, page_size = data.page_size, total_records = data.total_records;
|
|
64
|
-
return {
|
|
65
|
-
data: data[dataTypeKey],
|
|
66
|
-
next_page_token: next_page_token,
|
|
67
|
-
page_count: page_count,
|
|
68
|
-
page_number: page_number,
|
|
69
|
-
page_size: page_size,
|
|
70
|
-
total_records: total_records
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Creates a FetchPageFactory using the input ZoomFetchPageFetchFunction.
|
|
76
|
-
*
|
|
77
|
-
* @param fetch - Function that fetches a single page of results from the Zoom API.
|
|
78
|
-
* @param defaults - Optional default pagination configuration.
|
|
79
|
-
* @returns A configured FetchPageFactory that handles Zoom's cursor-based pagination using `next_page_token`
|
|
80
|
-
*
|
|
81
|
-
* @__NO_SIDE_EFFECTS__
|
|
82
|
-
*/ function zoomFetchPageFactory(fetch$1, defaults) {
|
|
83
|
-
return fetch.fetchPageFactory(_object_spread_props(_object_spread({}, defaults), {
|
|
84
|
-
fetch: fetch$1,
|
|
85
|
-
readFetchPageResultInfo: function readFetchPageResultInfo(result) {
|
|
86
|
-
return {
|
|
87
|
-
nextPageCursor: result.next_page_token,
|
|
88
|
-
hasNext: Boolean(result.next_page_token) // has more when a non-empty next_page_token is returned
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
buildInputForNextPage: function buildInputForNextPage(pageResult, input, options) {
|
|
92
|
-
var _options_maxItemsPerPage;
|
|
93
|
-
return _object_spread_props(_object_spread({}, input), {
|
|
94
|
-
next_page_token: pageResult.nextPageCursor,
|
|
95
|
-
page_size: (_options_maxItemsPerPage = options.maxItemsPerPage) !== null && _options_maxItemsPerPage !== void 0 ? _options_maxItemsPerPage : input.page_size
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _assert_this_initialized$1(self) {
|
|
102
|
-
if (self === void 0) {
|
|
103
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
104
|
-
}
|
|
105
|
-
return self;
|
|
106
|
-
}
|
|
107
|
-
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
108
|
-
try {
|
|
109
|
-
var info = gen[key](arg);
|
|
110
|
-
var value = info.value;
|
|
111
|
-
} catch (error) {
|
|
112
|
-
reject(error);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (info.done) {
|
|
116
|
-
resolve(value);
|
|
117
|
-
} else {
|
|
118
|
-
Promise.resolve(value).then(_next, _throw);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function _async_to_generator$5(fn) {
|
|
122
|
-
return function() {
|
|
123
|
-
var self = this, args = arguments;
|
|
124
|
-
return new Promise(function(resolve, reject) {
|
|
125
|
-
var gen = fn.apply(self, args);
|
|
126
|
-
function _next(value) {
|
|
127
|
-
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
128
|
-
}
|
|
129
|
-
function _throw(err) {
|
|
130
|
-
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
131
|
-
}
|
|
132
|
-
_next(undefined);
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function _call_super$1(_this, derived, args) {
|
|
137
|
-
derived = _get_prototype_of$1(derived);
|
|
138
|
-
return _possible_constructor_return$1(_this, _is_native_reflect_construct$1() ? Reflect.construct(derived, args || [], _get_prototype_of$1(_this).constructor) : derived.apply(_this, args));
|
|
139
|
-
}
|
|
140
|
-
function _class_call_check$1(instance, Constructor) {
|
|
141
|
-
if (!(instance instanceof Constructor)) {
|
|
142
|
-
throw new TypeError("Cannot call a class as a function");
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function _defineProperties(target, props) {
|
|
146
|
-
for(var i = 0; i < props.length; i++){
|
|
147
|
-
var descriptor = props[i];
|
|
148
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
149
|
-
descriptor.configurable = true;
|
|
150
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
151
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
155
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
156
|
-
return Constructor;
|
|
157
|
-
}
|
|
158
|
-
function _define_property$1(obj, key, value) {
|
|
159
|
-
if (key in obj) {
|
|
160
|
-
Object.defineProperty(obj, key, {
|
|
161
|
-
value: value,
|
|
162
|
-
enumerable: true,
|
|
163
|
-
configurable: true,
|
|
164
|
-
writable: true
|
|
165
|
-
});
|
|
166
|
-
} else {
|
|
167
|
-
obj[key] = value;
|
|
168
|
-
}
|
|
169
|
-
return obj;
|
|
170
|
-
}
|
|
171
|
-
function _get_prototype_of$1(o) {
|
|
172
|
-
_get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
173
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
174
|
-
};
|
|
175
|
-
return _get_prototype_of$1(o);
|
|
176
|
-
}
|
|
177
|
-
function _inherits$1(subClass, superClass) {
|
|
178
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
179
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
180
|
-
}
|
|
181
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
182
|
-
constructor: {
|
|
183
|
-
value: subClass,
|
|
184
|
-
writable: true,
|
|
185
|
-
configurable: true
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
if (superClass) _set_prototype_of$1(subClass, superClass);
|
|
189
|
-
}
|
|
190
|
-
function _instanceof(left, right) {
|
|
191
|
-
"@swc/helpers - instanceof";
|
|
192
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
193
|
-
return !!right[Symbol.hasInstance](left);
|
|
194
|
-
} else {
|
|
195
|
-
return left instanceof right;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function _possible_constructor_return$1(self, call) {
|
|
199
|
-
if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
|
|
200
|
-
return call;
|
|
201
|
-
}
|
|
202
|
-
return _assert_this_initialized$1(self);
|
|
203
|
-
}
|
|
204
|
-
function _set_prototype_of$1(o, p) {
|
|
205
|
-
_set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
206
|
-
o.__proto__ = p;
|
|
207
|
-
return o;
|
|
208
|
-
};
|
|
209
|
-
return _set_prototype_of$1(o, p);
|
|
210
|
-
}
|
|
211
|
-
function _type_of$1(obj) {
|
|
212
|
-
"@swc/helpers - typeof";
|
|
213
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
214
|
-
}
|
|
215
|
-
function _is_native_reflect_construct$1() {
|
|
216
|
-
try {
|
|
217
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
218
|
-
} catch (_) {}
|
|
219
|
-
return (_is_native_reflect_construct$1 = function() {
|
|
220
|
-
return !!result;
|
|
221
|
-
})();
|
|
222
|
-
}
|
|
223
|
-
function _ts_generator$5(thisArg, body) {
|
|
224
|
-
var f, y, t, _ = {
|
|
225
|
-
label: 0,
|
|
226
|
-
sent: function() {
|
|
227
|
-
if (t[0] & 1) throw t[1];
|
|
228
|
-
return t[1];
|
|
229
|
-
},
|
|
230
|
-
trys: [],
|
|
231
|
-
ops: []
|
|
232
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
233
|
-
return d(g, "next", {
|
|
234
|
-
value: verb(0)
|
|
235
|
-
}), d(g, "throw", {
|
|
236
|
-
value: verb(1)
|
|
237
|
-
}), d(g, "return", {
|
|
238
|
-
value: verb(2)
|
|
239
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
240
|
-
value: function() {
|
|
241
|
-
return this;
|
|
242
|
-
}
|
|
243
|
-
}), g;
|
|
244
|
-
function verb(n) {
|
|
245
|
-
return function(v) {
|
|
246
|
-
return step([
|
|
247
|
-
n,
|
|
248
|
-
v
|
|
249
|
-
]);
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function step(op) {
|
|
253
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
254
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
255
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
256
|
-
if (y = 0, t) op = [
|
|
257
|
-
op[0] & 2,
|
|
258
|
-
t.value
|
|
259
|
-
];
|
|
260
|
-
switch(op[0]){
|
|
261
|
-
case 0:
|
|
262
|
-
case 1:
|
|
263
|
-
t = op;
|
|
264
|
-
break;
|
|
265
|
-
case 4:
|
|
266
|
-
_.label++;
|
|
267
|
-
return {
|
|
268
|
-
value: op[1],
|
|
269
|
-
done: false
|
|
270
|
-
};
|
|
271
|
-
case 5:
|
|
272
|
-
_.label++;
|
|
273
|
-
y = op[1];
|
|
274
|
-
op = [
|
|
275
|
-
0
|
|
276
|
-
];
|
|
277
|
-
continue;
|
|
278
|
-
case 7:
|
|
279
|
-
op = _.ops.pop();
|
|
280
|
-
_.trys.pop();
|
|
281
|
-
continue;
|
|
282
|
-
default:
|
|
283
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
284
|
-
_ = 0;
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
288
|
-
_.label = op[1];
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
292
|
-
_.label = t[1];
|
|
293
|
-
t = op;
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
if (t && _.label < t[2]) {
|
|
297
|
-
_.label = t[2];
|
|
298
|
-
_.ops.push(op);
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
if (t[2]) _.ops.pop();
|
|
302
|
-
_.trys.pop();
|
|
303
|
-
continue;
|
|
304
|
-
}
|
|
305
|
-
op = body.call(thisArg, _);
|
|
306
|
-
} catch (e) {
|
|
307
|
-
op = [
|
|
308
|
-
6,
|
|
309
|
-
e
|
|
310
|
-
];
|
|
311
|
-
y = 0;
|
|
312
|
-
} finally{
|
|
313
|
-
f = t = 0;
|
|
314
|
-
}
|
|
315
|
-
if (op[0] & 5) throw op[1];
|
|
316
|
-
return {
|
|
317
|
-
value: op[0] ? op[1] : void 0,
|
|
318
|
-
done: true
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* A code used in some cases to denote success.
|
|
324
|
-
*/ var ZOOM_SUCCESS_CODE = 'SUCCESS';
|
|
325
|
-
/**
|
|
326
|
-
* Zoom Server Error
|
|
327
|
-
*/ var ZoomServerError = /*#__PURE__*/ function(BaseError) {
|
|
328
|
-
_inherits$1(ZoomServerError, BaseError);
|
|
329
|
-
function ZoomServerError(error) {
|
|
330
|
-
_class_call_check$1(this, ZoomServerError);
|
|
331
|
-
var _this;
|
|
332
|
-
_this = _call_super$1(this, ZoomServerError, [
|
|
333
|
-
error.message
|
|
334
|
-
]), _define_property$1(_this, "error", void 0);
|
|
335
|
-
_this.error = error;
|
|
336
|
-
return _this;
|
|
337
|
-
}
|
|
338
|
-
_create_class(ZoomServerError, [
|
|
339
|
-
{
|
|
340
|
-
key: "code",
|
|
341
|
-
get: function get() {
|
|
342
|
-
return this.error.code;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
]);
|
|
346
|
-
return ZoomServerError;
|
|
347
|
-
}(makeError.BaseError);
|
|
348
|
-
/**
|
|
349
|
-
* Zoom Server Error that includes the FetchResponseError
|
|
350
|
-
*/ var ZoomServerFetchResponseError = /*#__PURE__*/ function(ZoomServerError) {
|
|
351
|
-
_inherits$1(ZoomServerFetchResponseError, ZoomServerError);
|
|
352
|
-
function ZoomServerFetchResponseError(data, responseError) {
|
|
353
|
-
_class_call_check$1(this, ZoomServerFetchResponseError);
|
|
354
|
-
var _this;
|
|
355
|
-
_this = _call_super$1(this, ZoomServerFetchResponseError, [
|
|
356
|
-
data
|
|
357
|
-
]), _define_property$1(_this, "data", void 0), _define_property$1(_this, "responseError", void 0);
|
|
358
|
-
_this.data = data;
|
|
359
|
-
_this.responseError = responseError;
|
|
360
|
-
return _this;
|
|
361
|
-
}
|
|
362
|
-
return ZoomServerFetchResponseError;
|
|
363
|
-
}(ZoomServerError);
|
|
364
|
-
/**
|
|
365
|
-
* Creates a logZoomServerErrorFunction that logs the error to console.
|
|
366
|
-
*
|
|
367
|
-
* @param zoomApiNamePrefix - Prefix to use when logging. I.E. ZoomError, etc.
|
|
368
|
-
* @returns
|
|
369
|
-
*
|
|
370
|
-
* @__NO_SIDE_EFFECTS__
|
|
371
|
-
*/ function logZoomServerErrorFunction(zoomApiNamePrefix) {
|
|
372
|
-
return function(error) {
|
|
373
|
-
if (_instanceof(error, ZoomServerFetchResponseError)) {
|
|
374
|
-
console.log("".concat(zoomApiNamePrefix, "Error(").concat(error.responseError.response.status, "): "), {
|
|
375
|
-
error: error,
|
|
376
|
-
errorData: error.data
|
|
377
|
-
});
|
|
378
|
-
} else if (_instanceof(error, ZoomServerError)) {
|
|
379
|
-
console.log("".concat(zoomApiNamePrefix, "Error(code:").concat(error.code, "): "), {
|
|
380
|
-
error: error
|
|
381
|
-
});
|
|
382
|
-
} else {
|
|
383
|
-
console.log("".concat(zoomApiNamePrefix, "Error(name:").concat(error.name, "): "), {
|
|
384
|
-
error: error
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Wraps a ConfiguredFetch to support handling errors returned by fetch.
|
|
391
|
-
*
|
|
392
|
-
* @param parseZoomError - Function to parse fetch response errors into typed Zoom errors.
|
|
393
|
-
* @param defaultLogError - Default error logging function.
|
|
394
|
-
* @returns A factory that wraps ConfiguredFetch with error handling.
|
|
395
|
-
*
|
|
396
|
-
* @__NO_SIDE_EFFECTS__
|
|
397
|
-
*/ function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
|
|
398
|
-
return function(fetch$1) {
|
|
399
|
-
var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError;
|
|
400
|
-
return function(x, y) {
|
|
401
|
-
return _async_to_generator$5(function() {
|
|
402
|
-
var e, error;
|
|
403
|
-
return _ts_generator$5(this, function(_state) {
|
|
404
|
-
switch(_state.label){
|
|
405
|
-
case 0:
|
|
406
|
-
_state.trys.push([
|
|
407
|
-
0,
|
|
408
|
-
2,
|
|
409
|
-
,
|
|
410
|
-
5
|
|
411
|
-
]);
|
|
412
|
-
return [
|
|
413
|
-
4,
|
|
414
|
-
fetch$1(x, y)
|
|
415
|
-
];
|
|
416
|
-
case 1:
|
|
417
|
-
return [
|
|
418
|
-
2,
|
|
419
|
-
_state.sent()
|
|
420
|
-
]; // await to catch thrown errors
|
|
421
|
-
case 2:
|
|
422
|
-
e = _state.sent();
|
|
423
|
-
if (!_instanceof(e, fetch.FetchResponseError)) return [
|
|
424
|
-
3,
|
|
425
|
-
4
|
|
426
|
-
];
|
|
427
|
-
return [
|
|
428
|
-
4,
|
|
429
|
-
parseZoomError(e)
|
|
430
|
-
];
|
|
431
|
-
case 3:
|
|
432
|
-
error = _state.sent();
|
|
433
|
-
if (error) {
|
|
434
|
-
logError(error); // log before throwing.
|
|
435
|
-
throw error;
|
|
436
|
-
}
|
|
437
|
-
_state.label = 4;
|
|
438
|
-
case 4:
|
|
439
|
-
throw e;
|
|
440
|
-
case 5:
|
|
441
|
-
return [
|
|
442
|
-
2
|
|
443
|
-
];
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
})();
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
// MARK: Parsed Errors
|
|
451
|
-
/**
|
|
452
|
-
* The status code that Zoom uses to indicates that too many requests have been made in a short period of time.
|
|
453
|
-
*/ var ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = 429;
|
|
454
|
-
/**
|
|
455
|
-
* Also shares the same 429 code as ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE.
|
|
456
|
-
*/ var ZOOM_TOO_MANY_REQUESTS_ERROR_CODE = 429;
|
|
457
|
-
var ZOOM_RATE_LIMIT_CATEGORY_HEADER = 'X-RateLimit-Category';
|
|
458
|
-
var ZOOM_RATE_LIMIT_TYPE_HEADER = 'X-RateLimit-Type';
|
|
459
|
-
var ZOOM_RATE_LIMIT_LIMIT_HEADER = 'X-RateLimit-Limit';
|
|
460
|
-
var ZOOM_RATE_LIMIT_REMAINING_HEADER = 'X-RateLimit-Remaining';
|
|
461
|
-
var ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = 'Retry-After';
|
|
462
|
-
var DEFAULT_ZOOM_API_RATE_LIMIT = 2;
|
|
463
|
-
var DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = util.MS_IN_SECOND;
|
|
464
|
-
/**
|
|
465
|
-
* Parses rate limit header details from a Zoom API response.
|
|
466
|
-
*
|
|
467
|
-
* @param headers - The response headers to parse.
|
|
468
|
-
* @returns Parsed rate limit details, or null if required headers are missing.
|
|
469
|
-
*/ function zoomRateLimitHeaderDetails(headers) {
|
|
470
|
-
var limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
|
|
471
|
-
var remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
|
|
472
|
-
var retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
|
|
473
|
-
var categoryHeader = headers.get(ZOOM_RATE_LIMIT_CATEGORY_HEADER);
|
|
474
|
-
var typeHeader = headers.get(ZOOM_RATE_LIMIT_TYPE_HEADER);
|
|
475
|
-
var result = null;
|
|
476
|
-
if (categoryHeader != null && typeHeader != null) {
|
|
477
|
-
var category = categoryHeader;
|
|
478
|
-
var type = typeHeader;
|
|
479
|
-
var limit = limitHeader ? Number(limitHeader) : undefined;
|
|
480
|
-
var remaining = remainingHeader ? Number(remainingHeader) : undefined;
|
|
481
|
-
var retryAfter = retryAfterHeader ? Number(retryAfterHeader) : undefined;
|
|
482
|
-
var retryAfterAt = retryAfterHeader ? new Date(retryAfterHeader) : undefined;
|
|
483
|
-
result = {
|
|
484
|
-
limit: limit,
|
|
485
|
-
remaining: remaining,
|
|
486
|
-
retryAfter: retryAfter,
|
|
487
|
-
retryAfterAt: retryAfterAt,
|
|
488
|
-
category: category,
|
|
489
|
-
type: type
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
return result;
|
|
493
|
-
}
|
|
494
|
-
var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseError) {
|
|
495
|
-
_inherits$1(ZoomTooManyRequestsError, ZoomServerFetchResponseError);
|
|
496
|
-
function ZoomTooManyRequestsError() {
|
|
497
|
-
_class_call_check$1(this, ZoomTooManyRequestsError);
|
|
498
|
-
return _call_super$1(this, ZoomTooManyRequestsError, arguments);
|
|
499
|
-
}
|
|
500
|
-
_create_class(ZoomTooManyRequestsError, [
|
|
501
|
-
{
|
|
502
|
-
key: "headerDetails",
|
|
503
|
-
get: function get() {
|
|
504
|
-
return zoomRateLimitHeaderDetails(this.responseError.response.headers);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
]);
|
|
508
|
-
return ZoomTooManyRequestsError;
|
|
509
|
-
}(ZoomServerFetchResponseError);
|
|
510
|
-
/**
|
|
511
|
-
* Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
|
|
512
|
-
*
|
|
513
|
-
* @param zoomServerError - The error data from the Zoom API.
|
|
514
|
-
* @param responseError - The original fetch response error.
|
|
515
|
-
* @returns A typed ZoomServerFetchResponseError, or undefined.
|
|
516
|
-
*/ function parseZoomServerErrorData(zoomServerError, responseError) {
|
|
517
|
-
var result;
|
|
518
|
-
if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
|
|
519
|
-
result = new ZoomTooManyRequestsError(zoomServerError, responseError);
|
|
520
|
-
console.warn('ZoomTooManyRequestsError', {
|
|
521
|
-
result: result,
|
|
522
|
-
responseError: responseError,
|
|
523
|
-
headerDetails: result.headerDetails
|
|
524
|
-
});
|
|
525
|
-
} else {
|
|
526
|
-
switch(zoomServerError.code){
|
|
527
|
-
default:
|
|
528
|
-
result = new ZoomServerFetchResponseError(zoomServerError, responseError);
|
|
529
|
-
break;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
return result;
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
|
|
536
|
-
*
|
|
537
|
-
* If other options are input, it merges those two options together and adds silenceError to the omitted keys.
|
|
538
|
-
*
|
|
539
|
-
* @param options - Optional additional MakeUrlSearchParamsOptions to merge.
|
|
540
|
-
* @returns A MakeUrlSearchParamsOptions that omits silenceError.
|
|
541
|
-
*/ function omitSilenceZoomErrorKeys(options) {
|
|
542
|
-
var omitKeys = [
|
|
543
|
-
'silenceError'
|
|
544
|
-
];
|
|
545
|
-
return fetch.mergeMakeUrlSearchParamsOptions([
|
|
546
|
-
options,
|
|
547
|
-
{
|
|
548
|
-
omitKeys: omitKeys
|
|
549
|
-
}
|
|
550
|
-
]);
|
|
551
|
-
}
|
|
552
|
-
// @__NO_SIDE_EFFECTS__
|
|
553
|
-
function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
554
|
-
var codesSet = new Set(util.asArray(codes));
|
|
555
|
-
return function(silence) {
|
|
556
|
-
return function(reason) {
|
|
557
|
-
if (silence !== false && _instanceof(reason, ZoomServerFetchResponseError) && codesSet.has(reason.code)) {
|
|
558
|
-
return returnFn === null || returnFn === void 0 ? void 0 : returnFn(reason);
|
|
559
|
-
}
|
|
560
|
-
throw reason;
|
|
561
|
-
};
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* Https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting.
|
|
567
|
-
*
|
|
568
|
-
* @param context - The Zoom API context.
|
|
569
|
-
* @returns Retrieves a meeting by ID.
|
|
570
|
-
*/ function getMeeting(context) {
|
|
571
|
-
return function(input) {
|
|
572
|
-
return context.fetchJson("/meetings/".concat(input.meetingId), 'GET');
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings.
|
|
577
|
-
*
|
|
578
|
-
* @param context - The Zoom API context.
|
|
579
|
-
* @returns Lists meetings for a user.
|
|
580
|
-
*/ function listMeetingsForUser(context) {
|
|
581
|
-
return function(input) {
|
|
582
|
-
return context.fetchJson("/users/".concat(input.user, "/meetings"), 'GET').then(mapToZoomPageResult('meetings'));
|
|
583
|
-
};
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Creates a page factory for listing meetings for a user.
|
|
587
|
-
*
|
|
588
|
-
* @param context - The Zoom API context.
|
|
589
|
-
* @returns A page factory for paginated meeting listing.
|
|
590
|
-
*
|
|
591
|
-
* @__NO_SIDE_EFFECTS__
|
|
592
|
-
*/ function listMeetingsForUserPageFactory(context) {
|
|
593
|
-
return zoomFetchPageFactory(listMeetingsForUser(context));
|
|
594
|
-
}
|
|
595
|
-
/**
|
|
596
|
-
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings.
|
|
597
|
-
*
|
|
598
|
-
* @param context - The Zoom API context.
|
|
599
|
-
* @returns Creates a meeting for a user.
|
|
600
|
-
*
|
|
601
|
-
* @__NO_SIDE_EFFECTS__
|
|
602
|
-
*/ function createMeetingForUser(context) {
|
|
603
|
-
return function(input) {
|
|
604
|
-
return context.fetchJson("/users/".concat(input.user, "/meetings"), {
|
|
605
|
-
method: 'POST',
|
|
606
|
-
body: JSON.stringify(input.template)
|
|
607
|
-
});
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/PUT/meetings/{meetingId}
|
|
612
|
-
*
|
|
613
|
-
* @param context - The Zoom API context.
|
|
614
|
-
* @returns Updates a meeting.
|
|
615
|
-
*/ function updateMeeting(context) {
|
|
616
|
-
return function(input) {
|
|
617
|
-
return context.fetchJson("/meetings/".concat(input.meetingId, "?").concat(fetch.makeUrlSearchParams({
|
|
618
|
-
occurrence_id: input.occurrence_id
|
|
619
|
-
})), {
|
|
620
|
-
method: 'PATCH',
|
|
621
|
-
body: JSON.stringify(input.template)
|
|
622
|
-
});
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
626
|
-
/**
|
|
627
|
-
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
|
|
628
|
-
*
|
|
629
|
-
* @param context - The Zoom API context.
|
|
630
|
-
* @returns Deletes a meeting (silences 3001 "not found" errors by default)
|
|
631
|
-
*/ function deleteMeeting(context) {
|
|
632
|
-
var silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
|
|
633
|
-
return function(input) {
|
|
634
|
-
return context.fetchJson("/meetings/".concat(input.meetingId, "?").concat(fetch.makeUrlSearchParams(input, omitSilenceZoomErrorKeys())), 'DELETE').catch(silenceDoesNotExistError(input.silenceError));
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}
|
|
639
|
-
*
|
|
640
|
-
* @param context - The Zoom API context.
|
|
641
|
-
* @returns Retrieves a past meeting.
|
|
642
|
-
*/ function getPastMeeting(context) {
|
|
643
|
-
return function(input) {
|
|
644
|
-
return context.fetchJson("/past_meetings/".concat(input.meetingId), 'GET');
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}/participants.
|
|
649
|
-
*
|
|
650
|
-
* @param context - The Zoom API context.
|
|
651
|
-
* @returns Retrieves participants from a past meeting.
|
|
652
|
-
*/ function getPastMeetingParticipants(context) {
|
|
653
|
-
return function(input) {
|
|
654
|
-
return context.fetchJson("/past_meetings/".concat(input.meetingId, "/participants"), 'GET').then(mapToZoomPageResult('participants'));
|
|
655
|
-
};
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Creates a page factory for listing past meeting participants.
|
|
659
|
-
*
|
|
660
|
-
* @param context - The Zoom API context.
|
|
661
|
-
* @returns A page factory for paginated participant listing.
|
|
662
|
-
*
|
|
663
|
-
* @__NO_SIDE_EFFECTS__
|
|
664
|
-
*/ function getPastMeetingParticipantsPageFactory(context) {
|
|
665
|
-
return zoomFetchPageFactory(getPastMeetingParticipants(context));
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* The type of meeting:
|
|
670
|
-
* - `1` - An instant meeting.
|
|
671
|
-
* - `2` - A scheduled meeting.
|
|
672
|
-
* - `3` - A recurring meeting with no fixed time.
|
|
673
|
-
* - `4` - A PMI Meeting.
|
|
674
|
-
* - `8` - A recurring meeting with fixed time.
|
|
675
|
-
* - `10` - A screen share only meeting.
|
|
676
|
-
*/ exports.ZoomMeetingType = void 0;
|
|
677
|
-
(function(ZoomMeetingType) {
|
|
678
|
-
ZoomMeetingType[ZoomMeetingType["INSTANT"] = 1] = "INSTANT";
|
|
679
|
-
ZoomMeetingType[ZoomMeetingType["SCHEDULED"] = 2] = "SCHEDULED";
|
|
680
|
-
ZoomMeetingType[ZoomMeetingType["RECURRING_NO_FIXED_TIME"] = 3] = "RECURRING_NO_FIXED_TIME";
|
|
681
|
-
ZoomMeetingType[ZoomMeetingType["PMI"] = 4] = "PMI";
|
|
682
|
-
ZoomMeetingType[ZoomMeetingType["RECURRING_FIXED_TIME"] = 8] = "RECURRING_FIXED_TIME";
|
|
683
|
-
ZoomMeetingType[ZoomMeetingType["SCREEN_SHARE_ONLY"] = 10] = "SCREEN_SHARE_ONLY";
|
|
684
|
-
})(exports.ZoomMeetingType || (exports.ZoomMeetingType = {}));
|
|
685
|
-
exports.ZoomRecurrenceType = void 0;
|
|
686
|
-
(function(ZoomRecurrenceType) {
|
|
687
|
-
ZoomRecurrenceType[ZoomRecurrenceType["DAILY"] = 1] = "DAILY";
|
|
688
|
-
ZoomRecurrenceType[ZoomRecurrenceType["WEEKLY"] = 2] = "WEEKLY";
|
|
689
|
-
ZoomRecurrenceType[ZoomRecurrenceType["MONTHLY"] = 3] = "MONTHLY";
|
|
690
|
-
})(exports.ZoomRecurrenceType || (exports.ZoomRecurrenceType = {}));
|
|
691
|
-
exports.ZoomMonthlyWeek = void 0;
|
|
692
|
-
(function(ZoomMonthlyWeek) {
|
|
693
|
-
ZoomMonthlyWeek[ZoomMonthlyWeek["LAST_WEEK"] = -1] = "LAST_WEEK";
|
|
694
|
-
ZoomMonthlyWeek[ZoomMonthlyWeek["FIRST_WEEK"] = 1] = "FIRST_WEEK";
|
|
695
|
-
ZoomMonthlyWeek[ZoomMonthlyWeek["SECOND_WEEK"] = 2] = "SECOND_WEEK";
|
|
696
|
-
ZoomMonthlyWeek[ZoomMonthlyWeek["THIRD_WEEK"] = 3] = "THIRD_WEEK";
|
|
697
|
-
ZoomMonthlyWeek[ZoomMonthlyWeek["FOURTH_WEEK"] = 4] = "FOURTH_WEEK";
|
|
698
|
-
})(exports.ZoomMonthlyWeek || (exports.ZoomMonthlyWeek = {}));
|
|
699
|
-
exports.ZoomMonthlyWeekDay = void 0;
|
|
700
|
-
(function(ZoomMonthlyWeekDay) {
|
|
701
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SUNDAY"] = 1] = "SUNDAY";
|
|
702
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["MONDAY"] = 2] = "MONDAY";
|
|
703
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["TUESDAY"] = 3] = "TUESDAY";
|
|
704
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["WEDNESDAY"] = 4] = "WEDNESDAY";
|
|
705
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["THURSDAY"] = 5] = "THURSDAY";
|
|
706
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["FRIDAY"] = 6] = "FRIDAY";
|
|
707
|
-
ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SATURDAY"] = 7] = "SATURDAY";
|
|
708
|
-
})(exports.ZoomMonthlyWeekDay || (exports.ZoomMonthlyWeekDay = {}));
|
|
709
|
-
exports.ZoomApprovalType = void 0;
|
|
710
|
-
(function(ZoomApprovalType) {
|
|
711
|
-
/**
|
|
712
|
-
* Automatically approve.
|
|
713
|
-
*/ ZoomApprovalType[ZoomApprovalType["AUTOMATICALLY_APPROVE"] = 0] = "AUTOMATICALLY_APPROVE";
|
|
714
|
-
/**
|
|
715
|
-
* Manually approve.
|
|
716
|
-
*/ ZoomApprovalType[ZoomApprovalType["MANUALLY_APPROVE"] = 1] = "MANUALLY_APPROVE";
|
|
717
|
-
/**
|
|
718
|
-
* No registration required.
|
|
719
|
-
*/ ZoomApprovalType[ZoomApprovalType["NO_REGISTRATION_REQUIRED"] = 2] = "NO_REGISTRATION_REQUIRED";
|
|
720
|
-
})(exports.ZoomApprovalType || (exports.ZoomApprovalType = {}));
|
|
721
|
-
exports.ZoomRegistrationType = void 0;
|
|
722
|
-
(function(ZoomRegistrationType) {
|
|
723
|
-
/**
|
|
724
|
-
* Attendees register once and can attend any meeting occurrence.
|
|
725
|
-
*/ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_ATTEND_ANY"] = 1] = "REGISTER_ONCE_ATTEND_ANY";
|
|
726
|
-
/**
|
|
727
|
-
* Attendees must register for each meeting occurrence.
|
|
728
|
-
*/ ZoomRegistrationType[ZoomRegistrationType["REGISTER_FOR_EACH_OCCURRENCE"] = 2] = "REGISTER_FOR_EACH_OCCURRENCE";
|
|
729
|
-
/**
|
|
730
|
-
* Attendees register once and can select one or more meeting occurrences to attend.
|
|
731
|
-
*/ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_CHOOSE_OCCURRENCES"] = 3] = "REGISTER_ONCE_CHOOSE_OCCURRENCES";
|
|
732
|
-
})(exports.ZoomRegistrationType || (exports.ZoomRegistrationType = {}));
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* Https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}
|
|
736
|
-
*
|
|
737
|
-
* @param context
|
|
738
|
-
* @returns
|
|
739
|
-
*/ function getUser(context) {
|
|
740
|
-
return function(input) {
|
|
741
|
-
return context.fetchJson("/users/".concat(input.userId), 'GET');
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Https://developers.zoom.us/docs/api/users/#tag/users/GET/users.
|
|
746
|
-
*
|
|
747
|
-
* @param context
|
|
748
|
-
* @returns
|
|
749
|
-
*/ function listUsers(context) {
|
|
750
|
-
return function(input) {
|
|
751
|
-
return context.fetchJson("/users?".concat(fetch.makeUrlSearchParams(input)), 'GET').then(mapToZoomPageResult('users'));
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Creates a page factory for listing users.
|
|
756
|
-
*
|
|
757
|
-
* @param context - The Zoom API context.
|
|
758
|
-
* @returns A page factory for paginated user listing.
|
|
759
|
-
*
|
|
760
|
-
* @__NO_SIDE_EFFECTS__
|
|
761
|
-
*/ function listUsersPageFactory(context) {
|
|
762
|
-
return zoomFetchPageFactory(listUsers(context));
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
exports.ZoomUserType = void 0;
|
|
766
|
-
(function(ZoomUserType) {
|
|
767
|
-
ZoomUserType[ZoomUserType["Basic"] = 1] = "Basic";
|
|
768
|
-
ZoomUserType[ZoomUserType["Licensed"] = 2] = "Licensed";
|
|
769
|
-
ZoomUserType[ZoomUserType["Unassigned"] = 4] = "Unassigned";
|
|
770
|
-
ZoomUserType[ZoomUserType["None"] = 99] = "None";
|
|
771
|
-
})(exports.ZoomUserType || (exports.ZoomUserType = {}));
|
|
772
|
-
|
|
773
|
-
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
774
|
-
try {
|
|
775
|
-
var info = gen[key](arg);
|
|
776
|
-
var value = info.value;
|
|
777
|
-
} catch (error) {
|
|
778
|
-
reject(error);
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
if (info.done) {
|
|
782
|
-
resolve(value);
|
|
783
|
-
} else {
|
|
784
|
-
Promise.resolve(value).then(_next, _throw);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
function _async_to_generator$4(fn) {
|
|
788
|
-
return function() {
|
|
789
|
-
var self = this, args = arguments;
|
|
790
|
-
return new Promise(function(resolve, reject) {
|
|
791
|
-
var gen = fn.apply(self, args);
|
|
792
|
-
function _next(value) {
|
|
793
|
-
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
|
|
794
|
-
}
|
|
795
|
-
function _throw(err) {
|
|
796
|
-
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
|
|
797
|
-
}
|
|
798
|
-
_next(undefined);
|
|
799
|
-
});
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
function _ts_generator$4(thisArg, body) {
|
|
803
|
-
var f, y, t, _ = {
|
|
804
|
-
label: 0,
|
|
805
|
-
sent: function() {
|
|
806
|
-
if (t[0] & 1) throw t[1];
|
|
807
|
-
return t[1];
|
|
808
|
-
},
|
|
809
|
-
trys: [],
|
|
810
|
-
ops: []
|
|
811
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
812
|
-
return d(g, "next", {
|
|
813
|
-
value: verb(0)
|
|
814
|
-
}), d(g, "throw", {
|
|
815
|
-
value: verb(1)
|
|
816
|
-
}), d(g, "return", {
|
|
817
|
-
value: verb(2)
|
|
818
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
819
|
-
value: function() {
|
|
820
|
-
return this;
|
|
821
|
-
}
|
|
822
|
-
}), g;
|
|
823
|
-
function verb(n) {
|
|
824
|
-
return function(v) {
|
|
825
|
-
return step([
|
|
826
|
-
n,
|
|
827
|
-
v
|
|
828
|
-
]);
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function step(op) {
|
|
832
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
833
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
834
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
835
|
-
if (y = 0, t) op = [
|
|
836
|
-
op[0] & 2,
|
|
837
|
-
t.value
|
|
838
|
-
];
|
|
839
|
-
switch(op[0]){
|
|
840
|
-
case 0:
|
|
841
|
-
case 1:
|
|
842
|
-
t = op;
|
|
843
|
-
break;
|
|
844
|
-
case 4:
|
|
845
|
-
_.label++;
|
|
846
|
-
return {
|
|
847
|
-
value: op[1],
|
|
848
|
-
done: false
|
|
849
|
-
};
|
|
850
|
-
case 5:
|
|
851
|
-
_.label++;
|
|
852
|
-
y = op[1];
|
|
853
|
-
op = [
|
|
854
|
-
0
|
|
855
|
-
];
|
|
856
|
-
continue;
|
|
857
|
-
case 7:
|
|
858
|
-
op = _.ops.pop();
|
|
859
|
-
_.trys.pop();
|
|
860
|
-
continue;
|
|
861
|
-
default:
|
|
862
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
863
|
-
_ = 0;
|
|
864
|
-
continue;
|
|
865
|
-
}
|
|
866
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
867
|
-
_.label = op[1];
|
|
868
|
-
break;
|
|
869
|
-
}
|
|
870
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
871
|
-
_.label = t[1];
|
|
872
|
-
t = op;
|
|
873
|
-
break;
|
|
874
|
-
}
|
|
875
|
-
if (t && _.label < t[2]) {
|
|
876
|
-
_.label = t[2];
|
|
877
|
-
_.ops.push(op);
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
if (t[2]) _.ops.pop();
|
|
881
|
-
_.trys.pop();
|
|
882
|
-
continue;
|
|
883
|
-
}
|
|
884
|
-
op = body.call(thisArg, _);
|
|
885
|
-
} catch (e) {
|
|
886
|
-
op = [
|
|
887
|
-
6,
|
|
888
|
-
e
|
|
889
|
-
];
|
|
890
|
-
y = 0;
|
|
891
|
-
} finally{
|
|
892
|
-
f = t = 0;
|
|
893
|
-
}
|
|
894
|
-
if (op[0] & 5) throw op[1];
|
|
895
|
-
return {
|
|
896
|
-
value: op[0] ? op[1] : void 0,
|
|
897
|
-
done: true
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
// MARK: Parser
|
|
902
|
-
var logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
|
|
903
|
-
/**
|
|
904
|
-
* Parses a FetchResponseError into a typed Zoom API error.
|
|
905
|
-
*
|
|
906
|
-
* @param responseError - The fetch response error to parse.
|
|
907
|
-
* @returns The parsed error, or undefined if parsing fails.
|
|
908
|
-
*/ function parseZoomApiError(responseError) {
|
|
909
|
-
return _async_to_generator$4(function() {
|
|
910
|
-
var data, result;
|
|
911
|
-
return _ts_generator$4(this, function(_state) {
|
|
912
|
-
switch(_state.label){
|
|
913
|
-
case 0:
|
|
914
|
-
return [
|
|
915
|
-
4,
|
|
916
|
-
responseError.response.json().catch(function() {
|
|
917
|
-
return undefined;
|
|
918
|
-
})
|
|
919
|
-
];
|
|
920
|
-
case 1:
|
|
921
|
-
data = _state.sent();
|
|
922
|
-
if (data) {
|
|
923
|
-
result = parseZoomApiServerErrorResponseData(data, responseError);
|
|
924
|
-
}
|
|
925
|
-
return [
|
|
926
|
-
2,
|
|
927
|
-
result
|
|
928
|
-
];
|
|
929
|
-
}
|
|
930
|
-
});
|
|
931
|
-
})();
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* Parses a ZoomServerErrorData into a Zoom API-specific error.
|
|
935
|
-
*
|
|
936
|
-
* @param zoomServerError - The raw error data from the Zoom API.
|
|
937
|
-
* @param responseError - The original fetch response error.
|
|
938
|
-
* @returns A parsed error, or undefined if the error is unrecognized.
|
|
939
|
-
*/ function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
|
|
940
|
-
var result;
|
|
941
|
-
{
|
|
942
|
-
switch(zoomServerError.code){
|
|
943
|
-
default:
|
|
944
|
-
result = parseZoomServerErrorData(zoomServerError, responseError);
|
|
945
|
-
break;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
return result;
|
|
949
|
-
}
|
|
950
|
-
var handleZoomErrorFetch = handleZoomErrorFetchFactory(parseZoomApiError, logZoomErrorToConsole);
|
|
951
|
-
|
|
952
|
-
function _assert_this_initialized(self) {
|
|
953
|
-
if (self === void 0) {
|
|
954
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
955
|
-
}
|
|
956
|
-
return self;
|
|
957
|
-
}
|
|
958
|
-
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
959
|
-
try {
|
|
960
|
-
var info = gen[key](arg);
|
|
961
|
-
var value = info.value;
|
|
962
|
-
} catch (error) {
|
|
963
|
-
reject(error);
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
if (info.done) {
|
|
967
|
-
resolve(value);
|
|
968
|
-
} else {
|
|
969
|
-
Promise.resolve(value).then(_next, _throw);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
function _async_to_generator$3(fn) {
|
|
973
|
-
return function() {
|
|
974
|
-
var self = this, args = arguments;
|
|
975
|
-
return new Promise(function(resolve, reject) {
|
|
976
|
-
var gen = fn.apply(self, args);
|
|
977
|
-
function _next(value) {
|
|
978
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
979
|
-
}
|
|
980
|
-
function _throw(err) {
|
|
981
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
982
|
-
}
|
|
983
|
-
_next(undefined);
|
|
984
|
-
});
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
function _call_super(_this, derived, args) {
|
|
988
|
-
derived = _get_prototype_of(derived);
|
|
989
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
990
|
-
}
|
|
991
|
-
function _class_call_check(instance, Constructor) {
|
|
992
|
-
if (!(instance instanceof Constructor)) {
|
|
993
|
-
throw new TypeError("Cannot call a class as a function");
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
function _define_property(obj, key, value) {
|
|
997
|
-
if (key in obj) {
|
|
998
|
-
Object.defineProperty(obj, key, {
|
|
999
|
-
value: value,
|
|
1000
|
-
enumerable: true,
|
|
1001
|
-
configurable: true,
|
|
1002
|
-
writable: true
|
|
1003
|
-
});
|
|
1004
|
-
} else {
|
|
1005
|
-
obj[key] = value;
|
|
1006
|
-
}
|
|
1007
|
-
return obj;
|
|
1008
|
-
}
|
|
1009
|
-
function _get_prototype_of(o) {
|
|
1010
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
1011
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
1012
|
-
};
|
|
1013
|
-
return _get_prototype_of(o);
|
|
1014
|
-
}
|
|
1015
|
-
function _inherits(subClass, superClass) {
|
|
1016
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
1017
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
1018
|
-
}
|
|
1019
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
1020
|
-
constructor: {
|
|
1021
|
-
value: subClass,
|
|
1022
|
-
writable: true,
|
|
1023
|
-
configurable: true
|
|
1024
|
-
}
|
|
1025
|
-
});
|
|
1026
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
1027
|
-
}
|
|
1028
|
-
function _possible_constructor_return(self, call) {
|
|
1029
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
1030
|
-
return call;
|
|
1031
|
-
}
|
|
1032
|
-
return _assert_this_initialized(self);
|
|
1033
|
-
}
|
|
1034
|
-
function _set_prototype_of(o, p) {
|
|
1035
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1036
|
-
o.__proto__ = p;
|
|
1037
|
-
return o;
|
|
1038
|
-
};
|
|
1039
|
-
return _set_prototype_of(o, p);
|
|
1040
|
-
}
|
|
1041
|
-
function _type_of(obj) {
|
|
1042
|
-
"@swc/helpers - typeof";
|
|
1043
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1044
|
-
}
|
|
1045
|
-
function _is_native_reflect_construct() {
|
|
1046
|
-
try {
|
|
1047
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
1048
|
-
} catch (_) {}
|
|
1049
|
-
return (_is_native_reflect_construct = function() {
|
|
1050
|
-
return !!result;
|
|
1051
|
-
})();
|
|
1052
|
-
}
|
|
1053
|
-
function _ts_generator$3(thisArg, body) {
|
|
1054
|
-
var f, y, t, _ = {
|
|
1055
|
-
label: 0,
|
|
1056
|
-
sent: function() {
|
|
1057
|
-
if (t[0] & 1) throw t[1];
|
|
1058
|
-
return t[1];
|
|
1059
|
-
},
|
|
1060
|
-
trys: [],
|
|
1061
|
-
ops: []
|
|
1062
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
1063
|
-
return d(g, "next", {
|
|
1064
|
-
value: verb(0)
|
|
1065
|
-
}), d(g, "throw", {
|
|
1066
|
-
value: verb(1)
|
|
1067
|
-
}), d(g, "return", {
|
|
1068
|
-
value: verb(2)
|
|
1069
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
1070
|
-
value: function() {
|
|
1071
|
-
return this;
|
|
1072
|
-
}
|
|
1073
|
-
}), g;
|
|
1074
|
-
function verb(n) {
|
|
1075
|
-
return function(v) {
|
|
1076
|
-
return step([
|
|
1077
|
-
n,
|
|
1078
|
-
v
|
|
1079
|
-
]);
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
function step(op) {
|
|
1083
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1084
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1085
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1086
|
-
if (y = 0, t) op = [
|
|
1087
|
-
op[0] & 2,
|
|
1088
|
-
t.value
|
|
1089
|
-
];
|
|
1090
|
-
switch(op[0]){
|
|
1091
|
-
case 0:
|
|
1092
|
-
case 1:
|
|
1093
|
-
t = op;
|
|
1094
|
-
break;
|
|
1095
|
-
case 4:
|
|
1096
|
-
_.label++;
|
|
1097
|
-
return {
|
|
1098
|
-
value: op[1],
|
|
1099
|
-
done: false
|
|
1100
|
-
};
|
|
1101
|
-
case 5:
|
|
1102
|
-
_.label++;
|
|
1103
|
-
y = op[1];
|
|
1104
|
-
op = [
|
|
1105
|
-
0
|
|
1106
|
-
];
|
|
1107
|
-
continue;
|
|
1108
|
-
case 7:
|
|
1109
|
-
op = _.ops.pop();
|
|
1110
|
-
_.trys.pop();
|
|
1111
|
-
continue;
|
|
1112
|
-
default:
|
|
1113
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1114
|
-
_ = 0;
|
|
1115
|
-
continue;
|
|
1116
|
-
}
|
|
1117
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1118
|
-
_.label = op[1];
|
|
1119
|
-
break;
|
|
1120
|
-
}
|
|
1121
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1122
|
-
_.label = t[1];
|
|
1123
|
-
t = op;
|
|
1124
|
-
break;
|
|
1125
|
-
}
|
|
1126
|
-
if (t && _.label < t[2]) {
|
|
1127
|
-
_.label = t[2];
|
|
1128
|
-
_.ops.push(op);
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
if (t[2]) _.ops.pop();
|
|
1132
|
-
_.trys.pop();
|
|
1133
|
-
continue;
|
|
1134
|
-
}
|
|
1135
|
-
op = body.call(thisArg, _);
|
|
1136
|
-
} catch (e) {
|
|
1137
|
-
op = [
|
|
1138
|
-
6,
|
|
1139
|
-
e
|
|
1140
|
-
];
|
|
1141
|
-
y = 0;
|
|
1142
|
-
} finally{
|
|
1143
|
-
f = t = 0;
|
|
1144
|
-
}
|
|
1145
|
-
if (op[0] & 5) throw op[1];
|
|
1146
|
-
return {
|
|
1147
|
-
value: op[0] ? op[1] : void 0,
|
|
1148
|
-
done: true
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* Error in the following cases:
|
|
1154
|
-
* - the refresh token string is invalid
|
|
1155
|
-
*/ var ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE = 'invalid_grant';
|
|
1156
|
-
/**
|
|
1157
|
-
* Thrown if the call to the Zoom API creating an access token using a refresh token fails.
|
|
1158
|
-
*/ var ZoomOAuthAccessTokenError = /*#__PURE__*/ function(FetchRequestFactoryError) {
|
|
1159
|
-
_inherits(ZoomOAuthAccessTokenError, FetchRequestFactoryError);
|
|
1160
|
-
function ZoomOAuthAccessTokenError(errorCode) {
|
|
1161
|
-
_class_call_check(this, ZoomOAuthAccessTokenError);
|
|
1162
|
-
var _this;
|
|
1163
|
-
_this = _call_super(this, ZoomOAuthAccessTokenError, [
|
|
1164
|
-
"ZoomOAuthAccessTokenError: ".concat(errorCode)
|
|
1165
|
-
]), _define_property(_this, "errorCode", void 0);
|
|
1166
|
-
_this.errorCode = errorCode;
|
|
1167
|
-
return _this;
|
|
1168
|
-
}
|
|
1169
|
-
return ZoomOAuthAccessTokenError;
|
|
1170
|
-
}(fetch.FetchRequestFactoryError);
|
|
1171
|
-
/**
|
|
1172
|
-
* Thrown if a valid ZoomAccessToken cannot be retrieved successfully.
|
|
1173
|
-
*/ var ZoomOAuthAuthFailureError = /*#__PURE__*/ function(FetchRequestFactoryError) {
|
|
1174
|
-
_inherits(ZoomOAuthAuthFailureError, FetchRequestFactoryError);
|
|
1175
|
-
function ZoomOAuthAuthFailureError(reason) {
|
|
1176
|
-
_class_call_check(this, ZoomOAuthAuthFailureError);
|
|
1177
|
-
var _this;
|
|
1178
|
-
_this = _call_super(this, ZoomOAuthAuthFailureError, [
|
|
1179
|
-
"Failed to retrieve proper authentication for the API call. Reason: ".concat(reason)
|
|
1180
|
-
]), _define_property(_this, "reason", void 0);
|
|
1181
|
-
_this.reason = reason;
|
|
1182
|
-
return _this;
|
|
1183
|
-
}
|
|
1184
|
-
return ZoomOAuthAuthFailureError;
|
|
1185
|
-
}(fetch.FetchRequestFactoryError);
|
|
1186
|
-
var logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
|
|
1187
|
-
/**
|
|
1188
|
-
* Parses a FetchResponseError into a typed Zoom OAuth error.
|
|
1189
|
-
*
|
|
1190
|
-
* @param responseError - The fetch response error to parse.
|
|
1191
|
-
* @returns The parsed error, or undefined if parsing fails.
|
|
1192
|
-
*/ function parseZoomOAuthError(responseError) {
|
|
1193
|
-
return _async_to_generator$3(function() {
|
|
1194
|
-
var data, result;
|
|
1195
|
-
return _ts_generator$3(this, function(_state) {
|
|
1196
|
-
switch(_state.label){
|
|
1197
|
-
case 0:
|
|
1198
|
-
return [
|
|
1199
|
-
4,
|
|
1200
|
-
responseError.response.json().catch(function() {
|
|
1201
|
-
return undefined;
|
|
1202
|
-
})
|
|
1203
|
-
];
|
|
1204
|
-
case 1:
|
|
1205
|
-
data = _state.sent();
|
|
1206
|
-
if (data) {
|
|
1207
|
-
result = parseZoomOAuthServerErrorResponseData(data, responseError);
|
|
1208
|
-
}
|
|
1209
|
-
return [
|
|
1210
|
-
2,
|
|
1211
|
-
result
|
|
1212
|
-
];
|
|
1213
|
-
}
|
|
1214
|
-
});
|
|
1215
|
-
})();
|
|
1216
|
-
}
|
|
1217
|
-
/**
|
|
1218
|
-
* Parses a ZoomServerErrorData into a Zoom OAuth-specific error.
|
|
1219
|
-
*
|
|
1220
|
-
* @param zoomServerError - The raw error data from the Zoom API.
|
|
1221
|
-
* @param responseError - The original fetch response error.
|
|
1222
|
-
* @returns A parsed error, or undefined if the error is unrecognized.
|
|
1223
|
-
*/ function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
|
|
1224
|
-
var result;
|
|
1225
|
-
{
|
|
1226
|
-
var potentialErrorStringCode = zoomServerError.error;
|
|
1227
|
-
var errorCode = potentialErrorStringCode !== null && potentialErrorStringCode !== void 0 ? potentialErrorStringCode : zoomServerError.code;
|
|
1228
|
-
switch(errorCode){
|
|
1229
|
-
case ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE:
|
|
1230
|
-
result = new ZoomOAuthAccessTokenError(errorCode);
|
|
1231
|
-
break;
|
|
1232
|
-
default:
|
|
1233
|
-
result = parseZoomServerErrorData(zoomServerError, responseError);
|
|
1234
|
-
break;
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
return result;
|
|
1238
|
-
}
|
|
1239
|
-
var handleZoomOAuthErrorFetch = handleZoomErrorFetchFactory(parseZoomOAuthError, logZoomOAuthErrorToConsole);
|
|
1240
|
-
|
|
1241
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1242
|
-
try {
|
|
1243
|
-
var info = gen[key](arg);
|
|
1244
|
-
var value = info.value;
|
|
1245
|
-
} catch (error) {
|
|
1246
|
-
reject(error);
|
|
1247
|
-
return;
|
|
1248
|
-
}
|
|
1249
|
-
if (info.done) {
|
|
1250
|
-
resolve(value);
|
|
1251
|
-
} else {
|
|
1252
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
function _async_to_generator$2(fn) {
|
|
1256
|
-
return function() {
|
|
1257
|
-
var self = this, args = arguments;
|
|
1258
|
-
return new Promise(function(resolve, reject) {
|
|
1259
|
-
var gen = fn.apply(self, args);
|
|
1260
|
-
function _next(value) {
|
|
1261
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
1262
|
-
}
|
|
1263
|
-
function _throw(err) {
|
|
1264
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1265
|
-
}
|
|
1266
|
-
_next(undefined);
|
|
1267
|
-
});
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
function _ts_generator$2(thisArg, body) {
|
|
1271
|
-
var f, y, t, _ = {
|
|
1272
|
-
label: 0,
|
|
1273
|
-
sent: function() {
|
|
1274
|
-
if (t[0] & 1) throw t[1];
|
|
1275
|
-
return t[1];
|
|
1276
|
-
},
|
|
1277
|
-
trys: [],
|
|
1278
|
-
ops: []
|
|
1279
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
1280
|
-
return d(g, "next", {
|
|
1281
|
-
value: verb(0)
|
|
1282
|
-
}), d(g, "throw", {
|
|
1283
|
-
value: verb(1)
|
|
1284
|
-
}), d(g, "return", {
|
|
1285
|
-
value: verb(2)
|
|
1286
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
1287
|
-
value: function() {
|
|
1288
|
-
return this;
|
|
1289
|
-
}
|
|
1290
|
-
}), g;
|
|
1291
|
-
function verb(n) {
|
|
1292
|
-
return function(v) {
|
|
1293
|
-
return step([
|
|
1294
|
-
n,
|
|
1295
|
-
v
|
|
1296
|
-
]);
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
|
-
function step(op) {
|
|
1300
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1301
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1302
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1303
|
-
if (y = 0, t) op = [
|
|
1304
|
-
op[0] & 2,
|
|
1305
|
-
t.value
|
|
1306
|
-
];
|
|
1307
|
-
switch(op[0]){
|
|
1308
|
-
case 0:
|
|
1309
|
-
case 1:
|
|
1310
|
-
t = op;
|
|
1311
|
-
break;
|
|
1312
|
-
case 4:
|
|
1313
|
-
_.label++;
|
|
1314
|
-
return {
|
|
1315
|
-
value: op[1],
|
|
1316
|
-
done: false
|
|
1317
|
-
};
|
|
1318
|
-
case 5:
|
|
1319
|
-
_.label++;
|
|
1320
|
-
y = op[1];
|
|
1321
|
-
op = [
|
|
1322
|
-
0
|
|
1323
|
-
];
|
|
1324
|
-
continue;
|
|
1325
|
-
case 7:
|
|
1326
|
-
op = _.ops.pop();
|
|
1327
|
-
_.trys.pop();
|
|
1328
|
-
continue;
|
|
1329
|
-
default:
|
|
1330
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1331
|
-
_ = 0;
|
|
1332
|
-
continue;
|
|
1333
|
-
}
|
|
1334
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1335
|
-
_.label = op[1];
|
|
1336
|
-
break;
|
|
1337
|
-
}
|
|
1338
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1339
|
-
_.label = t[1];
|
|
1340
|
-
t = op;
|
|
1341
|
-
break;
|
|
1342
|
-
}
|
|
1343
|
-
if (t && _.label < t[2]) {
|
|
1344
|
-
_.label = t[2];
|
|
1345
|
-
_.ops.push(op);
|
|
1346
|
-
break;
|
|
1347
|
-
}
|
|
1348
|
-
if (t[2]) _.ops.pop();
|
|
1349
|
-
_.trys.pop();
|
|
1350
|
-
continue;
|
|
1351
|
-
}
|
|
1352
|
-
op = body.call(thisArg, _);
|
|
1353
|
-
} catch (e) {
|
|
1354
|
-
op = [
|
|
1355
|
-
6,
|
|
1356
|
-
e
|
|
1357
|
-
];
|
|
1358
|
-
y = 0;
|
|
1359
|
-
} finally{
|
|
1360
|
-
f = t = 0;
|
|
1361
|
-
}
|
|
1362
|
-
if (op[0] & 5) throw op[1];
|
|
1363
|
-
return {
|
|
1364
|
-
value: op[0] ? op[1] : void 0,
|
|
1365
|
-
done: true
|
|
1366
|
-
};
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
/**
|
|
1370
|
-
* Generates a new ZoomAccessTokenStringFactory from a ZoomAccessTokenFactory.
|
|
1371
|
-
*
|
|
1372
|
-
* @param zoomAccessTokenFactory - The factory to extract the token string from.
|
|
1373
|
-
* @returns A factory that returns the access token string.
|
|
1374
|
-
*
|
|
1375
|
-
* @__NO_SIDE_EFFECTS__
|
|
1376
|
-
*/ function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
|
|
1377
|
-
return function() {
|
|
1378
|
-
return _async_to_generator$2(function() {
|
|
1379
|
-
var token;
|
|
1380
|
-
return _ts_generator$2(this, function(_state) {
|
|
1381
|
-
switch(_state.label){
|
|
1382
|
-
case 0:
|
|
1383
|
-
return [
|
|
1384
|
-
4,
|
|
1385
|
-
zoomAccessTokenFactory()
|
|
1386
|
-
];
|
|
1387
|
-
case 1:
|
|
1388
|
-
token = _state.sent();
|
|
1389
|
-
if (!token.accessToken) {
|
|
1390
|
-
throw new ZoomOAuthAuthFailureError();
|
|
1391
|
-
}
|
|
1392
|
-
return [
|
|
1393
|
-
2,
|
|
1394
|
-
token.accessToken
|
|
1395
|
-
];
|
|
1396
|
-
}
|
|
1397
|
-
});
|
|
1398
|
-
})();
|
|
1399
|
-
};
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION(headers) {
|
|
1403
|
-
console.warn("zoomRateLimitedFetchHandler(): Too many requests made. The limit is ".concat(headers.limit, " requests per reset period. RetryAt is set for ").concat(headers.retryAfterAt, "."));
|
|
1404
|
-
};
|
|
1405
|
-
/**
|
|
1406
|
-
* Creates a rate-limited fetch handler configured for the Zoom API.
|
|
1407
|
-
*
|
|
1408
|
-
* @param config - Optional configuration for rate limiting behavior.
|
|
1409
|
-
* @returns A configured rate-limited fetch handler.
|
|
1410
|
-
*/ function zoomRateLimitedFetchHandler(config) {
|
|
1411
|
-
var _ref, _ref1, _ref2;
|
|
1412
|
-
var onTooManyRequests = (config === null || config === void 0 ? void 0 : config.onTooManyRequests) === false ? undefined : (_ref = config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== null && _ref !== void 0 ? _ref : DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
1413
|
-
var defaultLimit = (_ref1 = config === null || config === void 0 ? void 0 : config.maxRateLimit) !== null && _ref1 !== void 0 ? _ref1 : DEFAULT_ZOOM_API_RATE_LIMIT;
|
|
1414
|
-
var defaultResetPeriod = (_ref2 = config === null || config === void 0 ? void 0 : config.resetPeriod) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
|
|
1415
|
-
function configForLimit(limit, resetAt) {
|
|
1416
|
-
return {
|
|
1417
|
-
limit: defaultLimit,
|
|
1418
|
-
startLimitAt: 2,
|
|
1419
|
-
cooldownRate: 1,
|
|
1420
|
-
exponentRate: 1.2,
|
|
1421
|
-
maxWaitTime: util.MS_IN_SECOND * 5,
|
|
1422
|
-
resetPeriod: defaultResetPeriod,
|
|
1423
|
-
resetAt: resetAt
|
|
1424
|
-
};
|
|
1425
|
-
}
|
|
1426
|
-
var defaultConfig = configForLimit();
|
|
1427
|
-
var rateLimiter = util.resetPeriodPromiseRateLimiter(defaultConfig);
|
|
1428
|
-
return fetch.rateLimitedFetchHandler({
|
|
1429
|
-
rateLimiter: rateLimiter,
|
|
1430
|
-
updateWithResponse: function updateWithResponse(response, fetchResponseError) {
|
|
1431
|
-
var hasLimitHeader = response.headers.has(ZOOM_RATE_LIMIT_REMAINING_HEADER);
|
|
1432
|
-
var shouldRetry = false;
|
|
1433
|
-
// let enabled = false; // rate limiter should not be turned off
|
|
1434
|
-
if (hasLimitHeader) {
|
|
1435
|
-
var headerDetails = zoomRateLimitHeaderDetails(response.headers);
|
|
1436
|
-
if (headerDetails) {
|
|
1437
|
-
var type = headerDetails.type, limit = headerDetails.limit, retryAfterAt = headerDetails.retryAfterAt, remaining = headerDetails.remaining;
|
|
1438
|
-
if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE && // For simple query-per-second rate limits, just schedule a retry
|
|
1439
|
-
type === 'QPS') {
|
|
1440
|
-
shouldRetry = true;
|
|
1441
|
-
try {
|
|
1442
|
-
void (onTooManyRequests === null || onTooManyRequests === void 0 ? void 0 : onTooManyRequests(headerDetails, response, fetchResponseError));
|
|
1443
|
-
} catch (unused) {
|
|
1444
|
-
// ignored: onTooManyRequests is for logging only
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
// NOTE: typically it seems like these headers are not available usually.
|
|
1448
|
-
// There is a daily limit for message requests
|
|
1449
|
-
if (limit != null && retryAfterAt != null && remaining != null) {
|
|
1450
|
-
if (limit !== defaultLimit) {
|
|
1451
|
-
var newConfig = configForLimit(limit, retryAfterAt);
|
|
1452
|
-
rateLimiter.setConfig(newConfig, false);
|
|
1453
|
-
}
|
|
1454
|
-
rateLimiter.setRemainingLimit(remaining);
|
|
1455
|
-
rateLimiter.setNextResetAt(retryAfterAt);
|
|
1456
|
-
// enabled = true;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
// rateLimiter.setEnabled(enabled);
|
|
1461
|
-
return shouldRetry;
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
}
|
|
1465
|
-
// MARK: Compat
|
|
1466
|
-
// COMPAT: Deprecated aliases
|
|
1467
|
-
/**
|
|
1468
|
-
* @deprecated use DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
|
|
1469
|
-
*/ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* The Zoom API URL for the US datacenter.
|
|
1473
|
-
*/ var ZOOM_API_URL = 'https://api.zoom.us/v2';
|
|
1474
|
-
|
|
1475
|
-
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1476
|
-
try {
|
|
1477
|
-
var info = gen[key](arg);
|
|
1478
|
-
var value = info.value;
|
|
1479
|
-
} catch (error) {
|
|
1480
|
-
reject(error);
|
|
1481
|
-
return;
|
|
1482
|
-
}
|
|
1483
|
-
if (info.done) {
|
|
1484
|
-
resolve(value);
|
|
1485
|
-
} else {
|
|
1486
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
function _async_to_generator$1(fn) {
|
|
1490
|
-
return function() {
|
|
1491
|
-
var self = this, args = arguments;
|
|
1492
|
-
return new Promise(function(resolve, reject) {
|
|
1493
|
-
var gen = fn.apply(self, args);
|
|
1494
|
-
function _next(value) {
|
|
1495
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
1496
|
-
}
|
|
1497
|
-
function _throw(err) {
|
|
1498
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1499
|
-
}
|
|
1500
|
-
_next(undefined);
|
|
1501
|
-
});
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
function _ts_generator$1(thisArg, body) {
|
|
1505
|
-
var f, y, t, _ = {
|
|
1506
|
-
label: 0,
|
|
1507
|
-
sent: function() {
|
|
1508
|
-
if (t[0] & 1) throw t[1];
|
|
1509
|
-
return t[1];
|
|
1510
|
-
},
|
|
1511
|
-
trys: [],
|
|
1512
|
-
ops: []
|
|
1513
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
1514
|
-
return d(g, "next", {
|
|
1515
|
-
value: verb(0)
|
|
1516
|
-
}), d(g, "throw", {
|
|
1517
|
-
value: verb(1)
|
|
1518
|
-
}), d(g, "return", {
|
|
1519
|
-
value: verb(2)
|
|
1520
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
1521
|
-
value: function() {
|
|
1522
|
-
return this;
|
|
1523
|
-
}
|
|
1524
|
-
}), g;
|
|
1525
|
-
function verb(n) {
|
|
1526
|
-
return function(v) {
|
|
1527
|
-
return step([
|
|
1528
|
-
n,
|
|
1529
|
-
v
|
|
1530
|
-
]);
|
|
1531
|
-
};
|
|
1532
|
-
}
|
|
1533
|
-
function step(op) {
|
|
1534
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1535
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1536
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1537
|
-
if (y = 0, t) op = [
|
|
1538
|
-
op[0] & 2,
|
|
1539
|
-
t.value
|
|
1540
|
-
];
|
|
1541
|
-
switch(op[0]){
|
|
1542
|
-
case 0:
|
|
1543
|
-
case 1:
|
|
1544
|
-
t = op;
|
|
1545
|
-
break;
|
|
1546
|
-
case 4:
|
|
1547
|
-
_.label++;
|
|
1548
|
-
return {
|
|
1549
|
-
value: op[1],
|
|
1550
|
-
done: false
|
|
1551
|
-
};
|
|
1552
|
-
case 5:
|
|
1553
|
-
_.label++;
|
|
1554
|
-
y = op[1];
|
|
1555
|
-
op = [
|
|
1556
|
-
0
|
|
1557
|
-
];
|
|
1558
|
-
continue;
|
|
1559
|
-
case 7:
|
|
1560
|
-
op = _.ops.pop();
|
|
1561
|
-
_.trys.pop();
|
|
1562
|
-
continue;
|
|
1563
|
-
default:
|
|
1564
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1565
|
-
_ = 0;
|
|
1566
|
-
continue;
|
|
1567
|
-
}
|
|
1568
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1569
|
-
_.label = op[1];
|
|
1570
|
-
break;
|
|
1571
|
-
}
|
|
1572
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1573
|
-
_.label = t[1];
|
|
1574
|
-
t = op;
|
|
1575
|
-
break;
|
|
1576
|
-
}
|
|
1577
|
-
if (t && _.label < t[2]) {
|
|
1578
|
-
_.label = t[2];
|
|
1579
|
-
_.ops.push(op);
|
|
1580
|
-
break;
|
|
1581
|
-
}
|
|
1582
|
-
if (t[2]) _.ops.pop();
|
|
1583
|
-
_.trys.pop();
|
|
1584
|
-
continue;
|
|
1585
|
-
}
|
|
1586
|
-
op = body.call(thisArg, _);
|
|
1587
|
-
} catch (e) {
|
|
1588
|
-
op = [
|
|
1589
|
-
6,
|
|
1590
|
-
e
|
|
1591
|
-
];
|
|
1592
|
-
y = 0;
|
|
1593
|
-
} finally{
|
|
1594
|
-
f = t = 0;
|
|
1595
|
-
}
|
|
1596
|
-
if (op[0] & 5) throw op[1];
|
|
1597
|
-
return {
|
|
1598
|
-
value: op[0] ? op[1] : void 0,
|
|
1599
|
-
done: true
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
/**
|
|
1604
|
-
* Creates a Zoom API factory from the given configuration.
|
|
1605
|
-
*
|
|
1606
|
-
* @param factoryConfig - Configuration including OAuth context, rate limiting, and fetch settings.
|
|
1607
|
-
* @returns A factory function that creates a configured Zoom API instance.
|
|
1608
|
-
*
|
|
1609
|
-
* @__NO_SIDE_EFFECTS__
|
|
1610
|
-
*/ function zoomFactory(factoryConfig) {
|
|
1611
|
-
var oauthContext = factoryConfig.oauthContext;
|
|
1612
|
-
var serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
|
|
1613
|
-
var fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
|
|
1614
|
-
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(input) {
|
|
1615
|
-
return fetch.fetchApiFetchService.makeFetch({
|
|
1616
|
-
baseUrl: ZOOM_API_URL,
|
|
1617
|
-
baseRequest: function baseRequest() {
|
|
1618
|
-
return _async_to_generator$1(function() {
|
|
1619
|
-
var _tmp, _tmp1, _, _1;
|
|
1620
|
-
return _ts_generator$1(this, function(_state) {
|
|
1621
|
-
switch(_state.label){
|
|
1622
|
-
case 0:
|
|
1623
|
-
_tmp = {};
|
|
1624
|
-
_tmp1 = {
|
|
1625
|
-
'Content-Type': 'application/json'
|
|
1626
|
-
};
|
|
1627
|
-
_1 = (_ = "Bearer ").concat;
|
|
1628
|
-
return [
|
|
1629
|
-
4,
|
|
1630
|
-
input.zoomAccessTokenStringFactory()
|
|
1631
|
-
];
|
|
1632
|
-
case 1:
|
|
1633
|
-
return [
|
|
1634
|
-
2,
|
|
1635
|
-
(_tmp.headers = (_tmp1.Authorization = _1.apply(_, [
|
|
1636
|
-
_state.sent()
|
|
1637
|
-
]), _tmp1), _tmp)
|
|
1638
|
-
];
|
|
1639
|
-
}
|
|
1640
|
-
});
|
|
1641
|
-
})();
|
|
1642
|
-
},
|
|
1643
|
-
fetchHandler: fetchHandler,
|
|
1644
|
-
timeout: 20 * 1000,
|
|
1645
|
-
requireOkResponse: true,
|
|
1646
|
-
useTimeout: true // use timeout
|
|
1647
|
-
});
|
|
1648
|
-
} : _factoryConfig_fetchFactory;
|
|
1649
|
-
return function(config) {
|
|
1650
|
-
var baseFetch = fetchFactory({
|
|
1651
|
-
zoomAccessTokenStringFactory: serverAccessTokenStringFactory
|
|
1652
|
-
});
|
|
1653
|
-
var serverFetch = handleZoomErrorFetch(baseFetch, logZoomServerErrorFunction);
|
|
1654
|
-
var serverFetchJson = fetch.fetchJsonFunction(serverFetch, {
|
|
1655
|
-
handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
|
|
1656
|
-
});
|
|
1657
|
-
// MARK: Make User Context
|
|
1658
|
-
var makeUserContext = function makeUserContext(input) {
|
|
1659
|
-
var userAccessTokenFactory = oauthContext.makeAccessTokenFactory({
|
|
1660
|
-
refreshToken: input.refreshToken,
|
|
1661
|
-
accessTokenCache: input.accessTokenCache
|
|
1662
|
-
});
|
|
1663
|
-
var userAccessTokenStringFactory = zoomAccessTokenStringFactory(userAccessTokenFactory);
|
|
1664
|
-
var userBaseFetch = fetchFactory({
|
|
1665
|
-
zoomAccessTokenStringFactory: userAccessTokenStringFactory
|
|
1666
|
-
});
|
|
1667
|
-
// wrapped for the same reason the server fetch is: without it a per-user call's error skips
|
|
1668
|
-
// Zoom's parsed error family and its rate-limit header handling
|
|
1669
|
-
var userFetch = handleZoomErrorFetch(userBaseFetch, logZoomServerErrorFunction);
|
|
1670
|
-
var userFetchJson = fetch.fetchJsonFunction(userFetch, {
|
|
1671
|
-
handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
|
|
1672
|
-
});
|
|
1673
|
-
var result = {
|
|
1674
|
-
zoomServerContext: zoomContext,
|
|
1675
|
-
type: 'user',
|
|
1676
|
-
fetch: userFetch,
|
|
1677
|
-
fetchJson: userFetchJson,
|
|
1678
|
-
userFetch: userFetch,
|
|
1679
|
-
userFetchJson: userFetchJson,
|
|
1680
|
-
zoomRateLimiter: fetchHandler._rateLimiter
|
|
1681
|
-
};
|
|
1682
|
-
return result;
|
|
1683
|
-
};
|
|
1684
|
-
var zoomContext = {
|
|
1685
|
-
type: 'server',
|
|
1686
|
-
fetch: serverFetch,
|
|
1687
|
-
fetchJson: serverFetchJson,
|
|
1688
|
-
serverFetch: serverFetch,
|
|
1689
|
-
serverFetchJson: serverFetchJson,
|
|
1690
|
-
makeUserContext: makeUserContext,
|
|
1691
|
-
config: config,
|
|
1692
|
-
zoomRateLimiter: fetchHandler._rateLimiter
|
|
1693
|
-
};
|
|
1694
|
-
var zoom = {
|
|
1695
|
-
zoomServerContext: zoomContext
|
|
1696
|
-
};
|
|
1697
|
-
return zoom;
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
/**
|
|
1702
|
-
* Retrieves a new AccessToken for Server to Server authentication.
|
|
1703
|
-
*
|
|
1704
|
-
* @param context
|
|
1705
|
-
* @returns
|
|
1706
|
-
*/ function serverAccessToken(context) {
|
|
1707
|
-
return function(input) {
|
|
1708
|
-
var _ref;
|
|
1709
|
-
return context.fetchJson("/token?grant_type=account_credentials&account_id=".concat((_ref = input === null || input === void 0 ? void 0 : input.accountId) !== null && _ref !== void 0 ? _ref : context.config.accountId), zoomOAuthApiFetchJsonInput(context, input));
|
|
1710
|
-
};
|
|
1711
|
-
}
|
|
1712
|
-
/**
|
|
1713
|
-
* Retrieves a new AccessToken for a user using their refresh token.
|
|
1714
|
-
*
|
|
1715
|
-
* @param context
|
|
1716
|
-
* @returns
|
|
1717
|
-
*/ function userAccessToken(context) {
|
|
1718
|
-
return function(input) {
|
|
1719
|
-
var refreshToken = input.refreshToken;
|
|
1720
|
-
return context.fetchJson("/token?grant_type=refresh_token&refresh_token=".concat(refreshToken), zoomOAuthApiFetchJsonInput(context, input));
|
|
1721
|
-
};
|
|
1722
|
-
}
|
|
1723
|
-
/**
|
|
1724
|
-
* Builds a FetchJsonInput for Zoom OAuth API calls with Basic auth.
|
|
1725
|
-
*
|
|
1726
|
-
* @param context - The Zoom OAuth context.
|
|
1727
|
-
* @param input - Optional override for client credentials.
|
|
1728
|
-
* @returns A configured FetchJsonInput for the OAuth API call.
|
|
1729
|
-
*/ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
1730
|
-
var _ref, _ref1;
|
|
1731
|
-
var _input_client, _input_client1;
|
|
1732
|
-
var clientId = (_ref = input === null || input === void 0 ? void 0 : (_input_client = input.client) === null || _input_client === void 0 ? void 0 : _input_client.clientId) !== null && _ref !== void 0 ? _ref : context.config.clientId;
|
|
1733
|
-
var clientSecret = (_ref1 = input === null || input === void 0 ? void 0 : (_input_client1 = input.client) === null || _input_client1 === void 0 ? void 0 : _input_client1.clientSecret) !== null && _ref1 !== void 0 ? _ref1 : context.config.clientSecret;
|
|
1734
|
-
var fetchJsonInput = {
|
|
1735
|
-
headers: {
|
|
1736
|
-
Authorization: zoomOAuthServerBasicAuthorizationHeaderValue({
|
|
1737
|
-
clientId: clientId,
|
|
1738
|
-
clientSecret: clientSecret
|
|
1739
|
-
})
|
|
1740
|
-
},
|
|
1741
|
-
method: 'POST'
|
|
1742
|
-
};
|
|
1743
|
-
return fetchJsonInput;
|
|
1744
|
-
}
|
|
1745
|
-
/**
|
|
1746
|
-
* Generates a Basic Authorization header value for Zoom OAuth.
|
|
1747
|
-
*
|
|
1748
|
-
* @param input - The client ID and secret pair.
|
|
1749
|
-
* @returns The Base64-encoded Basic auth header value.
|
|
1750
|
-
*/ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
|
|
1751
|
-
var credentials = input.clientId + ':' + input.clientSecret;
|
|
1752
|
-
return "Basic ".concat(Buffer.from(credentials).toString('base64'));
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
/**
|
|
1756
|
-
* The Zoom OAuth API URL for the US datacenter.
|
|
1757
|
-
*/ var ZOOM_OAUTH_API_URL = 'https://zoom.us/oauth';
|
|
1758
|
-
/**
|
|
1759
|
-
* Returns whether the credential is a {@link ZoomRefreshTokenCredential}.
|
|
1760
|
-
*
|
|
1761
|
-
* Checked before the account arm on purpose: `accountId` is also ambient on {@link ZoomOAuthConfig},
|
|
1762
|
-
* so a credential carrying both reads as a user credential that picked up an accountId — never the
|
|
1763
|
-
* reverse.
|
|
1764
|
-
*
|
|
1765
|
-
* @param credential - The credential to check.
|
|
1766
|
-
* @returns True when the credential carries a refresh token.
|
|
1767
|
-
*
|
|
1768
|
-
* @__NO_SIDE_EFFECTS__
|
|
1769
|
-
*/ function isZoomRefreshTokenCredential(credential) {
|
|
1770
|
-
return credential.refreshToken != null;
|
|
1771
|
-
}
|
|
1772
|
-
/**
|
|
1773
|
-
* The ambient credential a {@link ZoomOAuthConfig} authenticates the app's own calls with.
|
|
1774
|
-
*
|
|
1775
|
-
* Zoom's ambient credential is fully determined by the config — there is no choice to configure, so
|
|
1776
|
-
* it is derived here rather than being a settable field.
|
|
1777
|
-
*
|
|
1778
|
-
* @param config - The OAuth configuration.
|
|
1779
|
-
* @returns The account credential for that configuration.
|
|
1780
|
-
*
|
|
1781
|
-
* @__NO_SIDE_EFFECTS__
|
|
1782
|
-
*/ function zoomOAuthConfigAccountCredential(config) {
|
|
1783
|
-
return {
|
|
1784
|
-
accountId: config.accountId,
|
|
1785
|
-
accessTokenCache: config.accessTokenCache
|
|
1786
|
-
};
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1790
|
-
try {
|
|
1791
|
-
var info = gen[key](arg);
|
|
1792
|
-
var value = info.value;
|
|
1793
|
-
} catch (error) {
|
|
1794
|
-
reject(error);
|
|
1795
|
-
return;
|
|
1796
|
-
}
|
|
1797
|
-
if (info.done) {
|
|
1798
|
-
resolve(value);
|
|
1799
|
-
} else {
|
|
1800
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
function _async_to_generator(fn) {
|
|
1804
|
-
return function() {
|
|
1805
|
-
var self = this, args = arguments;
|
|
1806
|
-
return new Promise(function(resolve, reject) {
|
|
1807
|
-
var gen = fn.apply(self, args);
|
|
1808
|
-
function _next(value) {
|
|
1809
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1810
|
-
}
|
|
1811
|
-
function _throw(err) {
|
|
1812
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1813
|
-
}
|
|
1814
|
-
_next(undefined);
|
|
1815
|
-
});
|
|
1816
|
-
};
|
|
1817
|
-
}
|
|
1818
|
-
function _ts_generator(thisArg, body) {
|
|
1819
|
-
var f, y, t, _ = {
|
|
1820
|
-
label: 0,
|
|
1821
|
-
sent: function() {
|
|
1822
|
-
if (t[0] & 1) throw t[1];
|
|
1823
|
-
return t[1];
|
|
1824
|
-
},
|
|
1825
|
-
trys: [],
|
|
1826
|
-
ops: []
|
|
1827
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
1828
|
-
return d(g, "next", {
|
|
1829
|
-
value: verb(0)
|
|
1830
|
-
}), d(g, "throw", {
|
|
1831
|
-
value: verb(1)
|
|
1832
|
-
}), d(g, "return", {
|
|
1833
|
-
value: verb(2)
|
|
1834
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
1835
|
-
value: function() {
|
|
1836
|
-
return this;
|
|
1837
|
-
}
|
|
1838
|
-
}), g;
|
|
1839
|
-
function verb(n) {
|
|
1840
|
-
return function(v) {
|
|
1841
|
-
return step([
|
|
1842
|
-
n,
|
|
1843
|
-
v
|
|
1844
|
-
]);
|
|
1845
|
-
};
|
|
1846
|
-
}
|
|
1847
|
-
function step(op) {
|
|
1848
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1849
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
1850
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1851
|
-
if (y = 0, t) op = [
|
|
1852
|
-
op[0] & 2,
|
|
1853
|
-
t.value
|
|
1854
|
-
];
|
|
1855
|
-
switch(op[0]){
|
|
1856
|
-
case 0:
|
|
1857
|
-
case 1:
|
|
1858
|
-
t = op;
|
|
1859
|
-
break;
|
|
1860
|
-
case 4:
|
|
1861
|
-
_.label++;
|
|
1862
|
-
return {
|
|
1863
|
-
value: op[1],
|
|
1864
|
-
done: false
|
|
1865
|
-
};
|
|
1866
|
-
case 5:
|
|
1867
|
-
_.label++;
|
|
1868
|
-
y = op[1];
|
|
1869
|
-
op = [
|
|
1870
|
-
0
|
|
1871
|
-
];
|
|
1872
|
-
continue;
|
|
1873
|
-
case 7:
|
|
1874
|
-
op = _.ops.pop();
|
|
1875
|
-
_.trys.pop();
|
|
1876
|
-
continue;
|
|
1877
|
-
default:
|
|
1878
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1879
|
-
_ = 0;
|
|
1880
|
-
continue;
|
|
1881
|
-
}
|
|
1882
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1883
|
-
_.label = op[1];
|
|
1884
|
-
break;
|
|
1885
|
-
}
|
|
1886
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1887
|
-
_.label = t[1];
|
|
1888
|
-
t = op;
|
|
1889
|
-
break;
|
|
1890
|
-
}
|
|
1891
|
-
if (t && _.label < t[2]) {
|
|
1892
|
-
_.label = t[2];
|
|
1893
|
-
_.ops.push(op);
|
|
1894
|
-
break;
|
|
1895
|
-
}
|
|
1896
|
-
if (t[2]) _.ops.pop();
|
|
1897
|
-
_.trys.pop();
|
|
1898
|
-
continue;
|
|
1899
|
-
}
|
|
1900
|
-
op = body.call(thisArg, _);
|
|
1901
|
-
} catch (e) {
|
|
1902
|
-
op = [
|
|
1903
|
-
6,
|
|
1904
|
-
e
|
|
1905
|
-
];
|
|
1906
|
-
y = 0;
|
|
1907
|
-
} finally{
|
|
1908
|
-
f = t = 0;
|
|
1909
|
-
}
|
|
1910
|
-
if (op[0] & 5) throw op[1];
|
|
1911
|
-
return {
|
|
1912
|
-
value: op[0] ? op[1] : void 0,
|
|
1913
|
-
done: true
|
|
1914
|
-
};
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
/**
|
|
1918
|
-
* Maps a {@link ZoomOAuthAccessTokenResponse} to a {@link ZoomAccessToken}.
|
|
1919
|
-
*
|
|
1920
|
-
* @param response - The token response returned by the Zoom token endpoint.
|
|
1921
|
-
* @returns The equivalent ZoomAccessToken, with `expiresAt` resolved against the current time.
|
|
1922
|
-
*
|
|
1923
|
-
* @__NO_SIDE_EFFECTS__
|
|
1924
|
-
*/ function zoomAccessTokenFromTokenResponse(response) {
|
|
1925
|
-
var createdAt = Date.now();
|
|
1926
|
-
var access_token = response.access_token, api_url = response.api_url, scope = response.scope, expires_in = response.expires_in;
|
|
1927
|
-
var accessToken = {
|
|
1928
|
-
accessToken: access_token,
|
|
1929
|
-
apiDomain: api_url,
|
|
1930
|
-
expiresIn: expires_in,
|
|
1931
|
-
expiresAt: new Date(createdAt + expires_in * util.MS_IN_SECOND),
|
|
1932
|
-
scope: scope
|
|
1933
|
-
};
|
|
1934
|
-
return accessToken;
|
|
1935
|
-
}
|
|
1936
|
-
/**
|
|
1937
|
-
* Creates a ZoomOAuth instance factory from the given configuration.
|
|
1938
|
-
*
|
|
1939
|
-
* @param factoryConfig - Configuration for the OAuth factory.
|
|
1940
|
-
* @returns A factory that creates configured ZoomOAuth instances.
|
|
1941
|
-
*
|
|
1942
|
-
* @__NO_SIDE_EFFECTS__
|
|
1943
|
-
*/ function zoomOAuthFactory(factoryConfig) {
|
|
1944
|
-
var _factoryConfig_fetchHandler;
|
|
1945
|
-
var fetchHandler = (_factoryConfig_fetchHandler = factoryConfig.fetchHandler) !== null && _factoryConfig_fetchHandler !== void 0 ? _factoryConfig_fetchHandler : zoomRateLimitedFetchHandler();
|
|
1946
|
-
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function() {
|
|
1947
|
-
return fetch.fetchApiFetchService.makeFetch({
|
|
1948
|
-
baseUrl: ZOOM_OAUTH_API_URL,
|
|
1949
|
-
baseRequest: {
|
|
1950
|
-
headers: {
|
|
1951
|
-
'Content-Type': 'application/json'
|
|
1952
|
-
}
|
|
1953
|
-
},
|
|
1954
|
-
fetchHandler: fetchHandler,
|
|
1955
|
-
timeout: 20 * 1000,
|
|
1956
|
-
requireOkResponse: true,
|
|
1957
|
-
useTimeout: true // use timeout
|
|
1958
|
-
});
|
|
1959
|
-
} : _factoryConfig_fetchFactory;
|
|
1960
|
-
return function(config) {
|
|
1961
|
-
if (!config.clientId) {
|
|
1962
|
-
throw new Error('ZoomOAuthConfig missing clientId.');
|
|
1963
|
-
} else if (!config.clientSecret) {
|
|
1964
|
-
throw new Error('ZoomOAuthConfig missing clientSecret.');
|
|
1965
|
-
} else if (!config.accountId) {
|
|
1966
|
-
throw new Error('ZoomOAuthConfig missing accountId.');
|
|
1967
|
-
}
|
|
1968
|
-
var baseFetch = fetchFactory();
|
|
1969
|
-
var fetch$1 = handleZoomOAuthErrorFetch(baseFetch, logZoomServerErrorFunction);
|
|
1970
|
-
var fetchJson = fetch.fetchJsonFunction(fetch$1, {
|
|
1971
|
-
handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
|
|
1972
|
-
});
|
|
1973
|
-
// MARK: Access Token
|
|
1974
|
-
// both grants are Basic-authed with the SAME client pair (see zoomOAuthApiFetchJsonInput), and the
|
|
1975
|
-
// guards above already require it — so unlike Cal.com there is no credential this context cannot
|
|
1976
|
-
// exchange. All a credential selects is which grant is used
|
|
1977
|
-
var makeAccessTokenFactory = function makeAccessTokenFactory(credential) {
|
|
1978
|
-
var tokenRefresher;
|
|
1979
|
-
if (isZoomRefreshTokenCredential(credential)) {
|
|
1980
|
-
var refreshToken = credential.refreshToken;
|
|
1981
|
-
tokenRefresher = function tokenRefresher() {
|
|
1982
|
-
return _async_to_generator(function() {
|
|
1983
|
-
return _ts_generator(this, function(_state) {
|
|
1984
|
-
switch(_state.label){
|
|
1985
|
-
case 0:
|
|
1986
|
-
return [
|
|
1987
|
-
4,
|
|
1988
|
-
userAccessToken(oauthContext)({
|
|
1989
|
-
refreshToken: refreshToken
|
|
1990
|
-
})
|
|
1991
|
-
];
|
|
1992
|
-
case 1:
|
|
1993
|
-
return [
|
|
1994
|
-
2,
|
|
1995
|
-
zoomAccessTokenFromTokenResponse.apply(void 0, [
|
|
1996
|
-
_state.sent()
|
|
1997
|
-
])
|
|
1998
|
-
];
|
|
1999
|
-
}
|
|
2000
|
-
});
|
|
2001
|
-
})();
|
|
2002
|
-
};
|
|
2003
|
-
} else {
|
|
2004
|
-
var accountId = credential.accountId;
|
|
2005
|
-
tokenRefresher = function tokenRefresher() {
|
|
2006
|
-
return _async_to_generator(function() {
|
|
2007
|
-
return _ts_generator(this, function(_state) {
|
|
2008
|
-
switch(_state.label){
|
|
2009
|
-
case 0:
|
|
2010
|
-
return [
|
|
2011
|
-
4,
|
|
2012
|
-
serverAccessToken(oauthContext)({
|
|
2013
|
-
accountId: accountId
|
|
2014
|
-
})
|
|
2015
|
-
];
|
|
2016
|
-
case 1:
|
|
2017
|
-
return [
|
|
2018
|
-
2,
|
|
2019
|
-
zoomAccessTokenFromTokenResponse.apply(void 0, [
|
|
2020
|
-
_state.sent()
|
|
2021
|
-
])
|
|
2022
|
-
];
|
|
2023
|
-
}
|
|
2024
|
-
});
|
|
2025
|
-
})();
|
|
2026
|
-
};
|
|
2027
|
-
}
|
|
2028
|
-
return zoomOAuthZoomAccessTokenFactory({
|
|
2029
|
-
tokenRefresher: tokenRefresher,
|
|
2030
|
-
accessTokenCache: credential.accessTokenCache
|
|
2031
|
-
});
|
|
2032
|
-
};
|
|
2033
|
-
// built once, so the account credential's in-memory tier is shared across the whole context
|
|
2034
|
-
var loadAccessToken = makeAccessTokenFactory(zoomOAuthConfigAccountCredential(config));
|
|
2035
|
-
var oauthContext = {
|
|
2036
|
-
fetch: fetch$1,
|
|
2037
|
-
fetchJson: fetchJson,
|
|
2038
|
-
loadAccessToken: loadAccessToken,
|
|
2039
|
-
makeAccessTokenFactory: makeAccessTokenFactory,
|
|
2040
|
-
config: config
|
|
2041
|
-
};
|
|
2042
|
-
var zoomOAuth = {
|
|
2043
|
-
oauthContext: oauthContext
|
|
2044
|
-
};
|
|
2045
|
-
return zoomOAuth;
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2048
|
-
/**
|
|
2049
|
-
* Creates a ZoomOAuthZoomAccessTokenFactoryConfig.
|
|
2050
|
-
*
|
|
2051
|
-
* @param config
|
|
2052
|
-
* @returns
|
|
2053
|
-
*
|
|
2054
|
-
* @__NO_SIDE_EFFECTS__
|
|
2055
|
-
*/ function zoomOAuthZoomAccessTokenFactory(config) {
|
|
2056
|
-
var tokenRefresher = config.tokenRefresher, accessTokenCache = config.accessTokenCache, inputTokenExpirationBuffer = config.tokenExpirationBuffer;
|
|
2057
|
-
var tokenExpirationBuffer = inputTokenExpirationBuffer !== null && inputTokenExpirationBuffer !== void 0 ? inputTokenExpirationBuffer : util.MS_IN_MINUTE;
|
|
2058
|
-
/**
|
|
2059
|
-
* Caches the token internally here until it expires.
|
|
2060
|
-
*/ var currentToken = null;
|
|
2061
|
-
return function() {
|
|
2062
|
-
return _async_to_generator(function() {
|
|
2063
|
-
var cachedToken, isExpired, e;
|
|
2064
|
-
return _ts_generator(this, function(_state) {
|
|
2065
|
-
switch(_state.label){
|
|
2066
|
-
case 0:
|
|
2067
|
-
if (!!currentToken) return [
|
|
2068
|
-
3,
|
|
2069
|
-
2
|
|
2070
|
-
];
|
|
2071
|
-
return [
|
|
2072
|
-
4,
|
|
2073
|
-
accessTokenCache === null || accessTokenCache === void 0 ? void 0 : accessTokenCache.loadCachedToken()
|
|
2074
|
-
];
|
|
2075
|
-
case 1:
|
|
2076
|
-
cachedToken = _state.sent();
|
|
2077
|
-
if (cachedToken) {
|
|
2078
|
-
currentToken = cachedToken;
|
|
2079
|
-
}
|
|
2080
|
-
_state.label = 2;
|
|
2081
|
-
case 2:
|
|
2082
|
-
// check expiration
|
|
2083
|
-
if (currentToken != null) {
|
|
2084
|
-
isExpired = Date.now() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
|
|
2085
|
-
if (isExpired) {
|
|
2086
|
-
currentToken = null;
|
|
2087
|
-
}
|
|
2088
|
-
}
|
|
2089
|
-
if (!!currentToken) return [
|
|
2090
|
-
3,
|
|
2091
|
-
9
|
|
2092
|
-
];
|
|
2093
|
-
_state.label = 3;
|
|
2094
|
-
case 3:
|
|
2095
|
-
_state.trys.push([
|
|
2096
|
-
3,
|
|
2097
|
-
5,
|
|
2098
|
-
,
|
|
2099
|
-
6
|
|
2100
|
-
]);
|
|
2101
|
-
return [
|
|
2102
|
-
4,
|
|
2103
|
-
tokenRefresher()
|
|
2104
|
-
];
|
|
2105
|
-
case 4:
|
|
2106
|
-
currentToken = _state.sent();
|
|
2107
|
-
return [
|
|
2108
|
-
3,
|
|
2109
|
-
6
|
|
2110
|
-
];
|
|
2111
|
-
case 5:
|
|
2112
|
-
e = _state.sent();
|
|
2113
|
-
console.error("zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: ", e);
|
|
2114
|
-
throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
|
|
2115
|
-
case 6:
|
|
2116
|
-
_state.trys.push([
|
|
2117
|
-
6,
|
|
2118
|
-
8,
|
|
2119
|
-
,
|
|
2120
|
-
9
|
|
2121
|
-
]);
|
|
2122
|
-
return [
|
|
2123
|
-
4,
|
|
2124
|
-
accessTokenCache === null || accessTokenCache === void 0 ? void 0 : accessTokenCache.updateCachedToken(currentToken)
|
|
2125
|
-
];
|
|
2126
|
-
case 7:
|
|
2127
|
-
_state.sent();
|
|
2128
|
-
return [
|
|
2129
|
-
3,
|
|
2130
|
-
9
|
|
2131
|
-
];
|
|
2132
|
-
case 8:
|
|
2133
|
-
_state.sent();
|
|
2134
|
-
return [
|
|
2135
|
-
3,
|
|
2136
|
-
9
|
|
2137
|
-
];
|
|
2138
|
-
case 9:
|
|
2139
|
-
return [
|
|
2140
|
-
2,
|
|
2141
|
-
currentToken
|
|
2142
|
-
];
|
|
2143
|
-
}
|
|
2144
|
-
});
|
|
2145
|
-
})();
|
|
2146
|
-
};
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
exports.DEFAULT_ZOOM_API_RATE_LIMIT = DEFAULT_ZOOM_API_RATE_LIMIT;
|
|
2150
|
-
exports.DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
|
|
2151
|
-
exports.DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
2152
|
-
exports.DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION;
|
|
2153
|
-
exports.DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE;
|
|
2154
|
-
exports.ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE = ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE;
|
|
2155
|
-
exports.ZOOM_API_URL = ZOOM_API_URL;
|
|
2156
|
-
exports.ZOOM_OAUTH_API_URL = ZOOM_OAUTH_API_URL;
|
|
2157
|
-
exports.ZOOM_RATE_LIMIT_CATEGORY_HEADER = ZOOM_RATE_LIMIT_CATEGORY_HEADER;
|
|
2158
|
-
exports.ZOOM_RATE_LIMIT_LIMIT_HEADER = ZOOM_RATE_LIMIT_LIMIT_HEADER;
|
|
2159
|
-
exports.ZOOM_RATE_LIMIT_REMAINING_HEADER = ZOOM_RATE_LIMIT_REMAINING_HEADER;
|
|
2160
|
-
exports.ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER;
|
|
2161
|
-
exports.ZOOM_RATE_LIMIT_TYPE_HEADER = ZOOM_RATE_LIMIT_TYPE_HEADER;
|
|
2162
|
-
exports.ZOOM_SUCCESS_CODE = ZOOM_SUCCESS_CODE;
|
|
2163
|
-
exports.ZOOM_TOO_MANY_REQUESTS_ERROR_CODE = ZOOM_TOO_MANY_REQUESTS_ERROR_CODE;
|
|
2164
|
-
exports.ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE;
|
|
2165
|
-
exports.ZoomOAuthAccessTokenError = ZoomOAuthAccessTokenError;
|
|
2166
|
-
exports.ZoomOAuthAuthFailureError = ZoomOAuthAuthFailureError;
|
|
2167
|
-
exports.ZoomServerError = ZoomServerError;
|
|
2168
|
-
exports.ZoomServerFetchResponseError = ZoomServerFetchResponseError;
|
|
2169
|
-
exports.ZoomTooManyRequestsError = ZoomTooManyRequestsError;
|
|
2170
|
-
exports.createMeetingForUser = createMeetingForUser;
|
|
2171
|
-
exports.deleteMeeting = deleteMeeting;
|
|
2172
|
-
exports.getMeeting = getMeeting;
|
|
2173
|
-
exports.getPastMeeting = getPastMeeting;
|
|
2174
|
-
exports.getPastMeetingParticipants = getPastMeetingParticipants;
|
|
2175
|
-
exports.getPastMeetingParticipantsPageFactory = getPastMeetingParticipantsPageFactory;
|
|
2176
|
-
exports.getUser = getUser;
|
|
2177
|
-
exports.handleZoomErrorFetch = handleZoomErrorFetch;
|
|
2178
|
-
exports.handleZoomErrorFetchFactory = handleZoomErrorFetchFactory;
|
|
2179
|
-
exports.handleZoomOAuthErrorFetch = handleZoomOAuthErrorFetch;
|
|
2180
|
-
exports.isZoomRefreshTokenCredential = isZoomRefreshTokenCredential;
|
|
2181
|
-
exports.listMeetingsForUser = listMeetingsForUser;
|
|
2182
|
-
exports.listMeetingsForUserPageFactory = listMeetingsForUserPageFactory;
|
|
2183
|
-
exports.listUsers = listUsers;
|
|
2184
|
-
exports.listUsersPageFactory = listUsersPageFactory;
|
|
2185
|
-
exports.logZoomErrorToConsole = logZoomErrorToConsole;
|
|
2186
|
-
exports.logZoomOAuthErrorToConsole = logZoomOAuthErrorToConsole;
|
|
2187
|
-
exports.logZoomServerErrorFunction = logZoomServerErrorFunction;
|
|
2188
|
-
exports.mapToZoomPageResult = mapToZoomPageResult;
|
|
2189
|
-
exports.omitSilenceZoomErrorKeys = omitSilenceZoomErrorKeys;
|
|
2190
|
-
exports.parseZoomApiError = parseZoomApiError;
|
|
2191
|
-
exports.parseZoomApiServerErrorResponseData = parseZoomApiServerErrorResponseData;
|
|
2192
|
-
exports.parseZoomOAuthError = parseZoomOAuthError;
|
|
2193
|
-
exports.parseZoomOAuthServerErrorResponseData = parseZoomOAuthServerErrorResponseData;
|
|
2194
|
-
exports.parseZoomServerErrorData = parseZoomServerErrorData;
|
|
2195
|
-
exports.serverAccessToken = serverAccessToken;
|
|
2196
|
-
exports.silenceZoomErrorWithCodesFunction = silenceZoomErrorWithCodesFunction;
|
|
2197
|
-
exports.updateMeeting = updateMeeting;
|
|
2198
|
-
exports.userAccessToken = userAccessToken;
|
|
2199
|
-
exports.zoomAccessTokenFromTokenResponse = zoomAccessTokenFromTokenResponse;
|
|
2200
|
-
exports.zoomAccessTokenStringFactory = zoomAccessTokenStringFactory;
|
|
2201
|
-
exports.zoomFactory = zoomFactory;
|
|
2202
|
-
exports.zoomFetchPageFactory = zoomFetchPageFactory;
|
|
2203
|
-
exports.zoomOAuthApiFetchJsonInput = zoomOAuthApiFetchJsonInput;
|
|
2204
|
-
exports.zoomOAuthConfigAccountCredential = zoomOAuthConfigAccountCredential;
|
|
2205
|
-
exports.zoomOAuthFactory = zoomOAuthFactory;
|
|
2206
|
-
exports.zoomOAuthServerBasicAuthorizationHeaderValue = zoomOAuthServerBasicAuthorizationHeaderValue;
|
|
2207
|
-
exports.zoomOAuthZoomAccessTokenFactory = zoomOAuthZoomAccessTokenFactory;
|
|
2208
|
-
exports.zoomRateLimitHeaderDetails = zoomRateLimitHeaderDetails;
|
|
2209
|
-
exports.zoomRateLimitedFetchHandler = zoomRateLimitedFetchHandler;
|