@dereekb/zoom 12.7.0 → 13.0.1

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.
Files changed (67) hide show
  1. package/LICENSE +1 -1
  2. package/index.cjs.default.js +1 -0
  3. package/index.cjs.js +475 -1937
  4. package/index.cjs.mjs +2 -0
  5. package/index.esm.js +476 -1938
  6. package/nestjs/index.cjs.default.js +1 -0
  7. package/nestjs/index.cjs.js +727 -0
  8. package/nestjs/index.cjs.mjs +2 -0
  9. package/nestjs/index.esm.js +697 -0
  10. package/nestjs/package.json +25 -4
  11. package/nestjs/src/lib/webhook/webhook.zoom.controller.d.ts +1 -1
  12. package/nestjs/src/lib/zoom/zoom.api.d.ts +1 -1
  13. package/package.json +21 -17
  14. package/src/lib/oauth/oauth.error.api.d.ts +2 -2
  15. package/src/lib/zoom/zoom.error.api.d.ts +2 -2
  16. package/src/lib/zoom.error.api.d.ts +2 -2
  17. package/src/lib/zoom.type.d.ts +2 -2
  18. package/nestjs/CHANGELOG.md +0 -463
  19. package/nestjs/README.md +0 -11
  20. package/nestjs/src/index.js +0 -5
  21. package/nestjs/src/index.js.map +0 -1
  22. package/nestjs/src/lib/index.js +0 -7
  23. package/nestjs/src/lib/index.js.map +0 -1
  24. package/nestjs/src/lib/oauth/index.js +0 -8
  25. package/nestjs/src/lib/oauth/index.js.map +0 -1
  26. package/nestjs/src/lib/oauth/oauth.api.js +0 -41
  27. package/nestjs/src/lib/oauth/oauth.api.js.map +0 -1
  28. package/nestjs/src/lib/oauth/oauth.config.js +0 -50
  29. package/nestjs/src/lib/oauth/oauth.config.js.map +0 -1
  30. package/nestjs/src/lib/oauth/oauth.module.js +0 -36
  31. package/nestjs/src/lib/oauth/oauth.module.js.map +0 -1
  32. package/nestjs/src/lib/oauth/oauth.service.js +0 -230
  33. package/nestjs/src/lib/oauth/oauth.service.js.map +0 -1
  34. package/nestjs/src/lib/webhook/index.js +0 -15
  35. package/nestjs/src/lib/webhook/index.js.map +0 -1
  36. package/nestjs/src/lib/webhook/webhook.zoom.config.js +0 -17
  37. package/nestjs/src/lib/webhook/webhook.zoom.config.js.map +0 -1
  38. package/nestjs/src/lib/webhook/webhook.zoom.controller.js +0 -38
  39. package/nestjs/src/lib/webhook/webhook.zoom.controller.js.map +0 -1
  40. package/nestjs/src/lib/webhook/webhook.zoom.js +0 -38
  41. package/nestjs/src/lib/webhook/webhook.zoom.js.map +0 -1
  42. package/nestjs/src/lib/webhook/webhook.zoom.module.js +0 -41
  43. package/nestjs/src/lib/webhook/webhook.zoom.module.js.map +0 -1
  44. package/nestjs/src/lib/webhook/webhook.zoom.service.js +0 -60
  45. package/nestjs/src/lib/webhook/webhook.zoom.service.js.map +0 -1
  46. package/nestjs/src/lib/webhook/webhook.zoom.type.common.js +0 -3
  47. package/nestjs/src/lib/webhook/webhook.zoom.type.common.js.map +0 -1
  48. package/nestjs/src/lib/webhook/webhook.zoom.type.js +0 -3
  49. package/nestjs/src/lib/webhook/webhook.zoom.type.js.map +0 -1
  50. package/nestjs/src/lib/webhook/webhook.zoom.type.meeting.js +0 -18
  51. package/nestjs/src/lib/webhook/webhook.zoom.type.meeting.js.map +0 -1
  52. package/nestjs/src/lib/webhook/webhook.zoom.type.validate.js +0 -5
  53. package/nestjs/src/lib/webhook/webhook.zoom.type.validate.js.map +0 -1
  54. package/nestjs/src/lib/webhook/webhook.zoom.validate.js +0 -25
  55. package/nestjs/src/lib/webhook/webhook.zoom.validate.js.map +0 -1
  56. package/nestjs/src/lib/webhook/webhook.zoom.verify.js +0 -27
  57. package/nestjs/src/lib/webhook/webhook.zoom.verify.js.map +0 -1
  58. package/nestjs/src/lib/zoom/index.js +0 -7
  59. package/nestjs/src/lib/zoom/index.js.map +0 -1
  60. package/nestjs/src/lib/zoom/zoom.api.js +0 -78
  61. package/nestjs/src/lib/zoom/zoom.api.js.map +0 -1
  62. package/nestjs/src/lib/zoom/zoom.config.js +0 -15
  63. package/nestjs/src/lib/zoom/zoom.config.js.map +0 -1
  64. package/nestjs/src/lib/zoom/zoom.module.js +0 -40
  65. package/nestjs/src/lib/zoom/zoom.module.js.map +0 -1
  66. /package/{index.cjs.d.ts → index.d.ts} +0 -0
  67. /package/{index.esm.d.ts → nestjs/index.d.ts} +0 -0
package/index.cjs.js CHANGED
@@ -13,23 +13,17 @@ var makeError = require('make-error');
13
13
  * @returns
14
14
  */
15
15
  function mapToZoomPageResult(dataTypeKey) {
16
- return data => {
17
- const {
18
- next_page_token,
19
- page_count,
20
- page_number,
21
- page_size,
22
- total_records
23
- } = data;
24
- return {
25
- data: data[dataTypeKey],
26
- next_page_token,
27
- page_count,
28
- page_number,
29
- page_size,
30
- total_records
16
+ return (data) => {
17
+ const { next_page_token, page_count, page_number, page_size, total_records } = data;
18
+ return {
19
+ data: data[dataTypeKey],
20
+ next_page_token,
21
+ page_count,
22
+ page_number,
23
+ page_size,
24
+ total_records
25
+ };
31
26
  };
32
- };
33
27
  }
34
28
  /**
35
29
  * Creates a FetchPageFactory using the input ZoomFetchPageFetchFunction.
@@ -39,1441 +33,20 @@ function mapToZoomPageResult(dataTypeKey) {
39
33
  * @returns
40
34
  */
41
35
  function zoomFetchPageFactory(fetch$1, defaults) {
42
- return fetch.fetchPageFactory({
43
- ...defaults,
44
- fetch: fetch$1,
45
- readFetchPageResultInfo: function (result) {
46
- return {
47
- nextPageCursor: result.next_page_token,
48
- hasNext: Boolean(result.next_page_token) // has more when a non-empty next_page_token is returned
49
- };
50
- },
51
- buildInputForNextPage: function (pageResult, input, options) {
52
- return {
53
- ...input,
54
- next_page_token: pageResult.nextPageCursor,
55
- page_size: options.maxItemsPerPage ?? input.page_size
56
- };
57
- }
58
- });
59
- }
60
-
61
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
62
-
63
- var check = function (it) {
64
- return it && it.Math === Math && it;
65
- };
66
-
67
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
68
- var global$a =
69
- // eslint-disable-next-line es/no-global-this -- safe
70
- check(typeof globalThis == 'object' && globalThis) ||
71
- check(typeof window == 'object' && window) ||
72
- // eslint-disable-next-line no-restricted-globals -- safe
73
- check(typeof self == 'object' && self) ||
74
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
75
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
76
- // eslint-disable-next-line no-new-func -- fallback
77
- (function () { return this; })() || Function('return this')();
78
-
79
- var objectGetOwnPropertyDescriptor = {};
80
-
81
- var fails$9 = function (exec) {
82
- try {
83
- return !!exec();
84
- } catch (error) {
85
- return true;
86
- }
87
- };
88
-
89
- var fails$8 = fails$9;
90
-
91
- // Detect IE8's incomplete defineProperty implementation
92
- var descriptors = !fails$8(function () {
93
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
94
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
95
- });
96
-
97
- var fails$7 = fails$9;
98
-
99
- var functionBindNative = !fails$7(function () {
100
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
101
- var test = (function () { /* empty */ }).bind();
102
- // eslint-disable-next-line no-prototype-builtins -- safe
103
- return typeof test != 'function' || test.hasOwnProperty('prototype');
104
- });
105
-
106
- var NATIVE_BIND$1 = functionBindNative;
107
-
108
- var call$7 = Function.prototype.call;
109
-
110
- var functionCall = NATIVE_BIND$1 ? call$7.bind(call$7) : function () {
111
- return call$7.apply(call$7, arguments);
112
- };
113
-
114
- var objectPropertyIsEnumerable = {};
115
-
116
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
117
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
118
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
119
-
120
- // Nashorn ~ JDK8 bug
121
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
122
-
123
- // `Object.prototype.propertyIsEnumerable` method implementation
124
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
125
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
126
- var descriptor = getOwnPropertyDescriptor$1(this, V);
127
- return !!descriptor && descriptor.enumerable;
128
- } : $propertyIsEnumerable;
129
-
130
- var createPropertyDescriptor$2 = function (bitmap, value) {
131
- return {
132
- enumerable: !(bitmap & 1),
133
- configurable: !(bitmap & 2),
134
- writable: !(bitmap & 4),
135
- value: value
136
- };
137
- };
138
-
139
- var NATIVE_BIND = functionBindNative;
140
-
141
- var FunctionPrototype$1 = Function.prototype;
142
- var call$6 = FunctionPrototype$1.call;
143
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$6, call$6);
144
-
145
- var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
146
- return function () {
147
- return call$6.apply(fn, arguments);
148
- };
149
- };
150
-
151
- var uncurryThis$b = functionUncurryThis;
152
-
153
- var toString$1 = uncurryThis$b({}.toString);
154
- var stringSlice$1 = uncurryThis$b(''.slice);
155
-
156
- var classofRaw = function (it) {
157
- return stringSlice$1(toString$1(it), 8, -1);
158
- };
159
-
160
- var uncurryThis$a = functionUncurryThis;
161
- var fails$6 = fails$9;
162
- var classof = classofRaw;
163
-
164
- var $Object$2 = Object;
165
- var split = uncurryThis$a(''.split);
166
-
167
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
168
- var indexedObject = fails$6(function () {
169
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
170
- // eslint-disable-next-line no-prototype-builtins -- safe
171
- return !$Object$2('z').propertyIsEnumerable(0);
172
- }) ? function (it) {
173
- return classof(it) === 'String' ? split(it, '') : $Object$2(it);
174
- } : $Object$2;
175
-
176
- // we can't use just `it == null` since of `document.all` special case
177
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
178
- var isNullOrUndefined$2 = function (it) {
179
- return it === null || it === undefined;
180
- };
181
-
182
- var isNullOrUndefined$1 = isNullOrUndefined$2;
183
-
184
- var $TypeError$6 = TypeError;
185
-
186
- // `RequireObjectCoercible` abstract operation
187
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
188
- var requireObjectCoercible$2 = function (it) {
189
- if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
190
- return it;
191
- };
192
-
193
- // toObject with fallback for non-array-like ES3 strings
194
- var IndexedObject = indexedObject;
195
- var requireObjectCoercible$1 = requireObjectCoercible$2;
196
-
197
- var toIndexedObject$3 = function (it) {
198
- return IndexedObject(requireObjectCoercible$1(it));
199
- };
200
-
201
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
202
- var documentAll = typeof document == 'object' && document.all;
203
-
204
- // `IsCallable` abstract operation
205
- // https://tc39.es/ecma262/#sec-iscallable
206
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
207
- var isCallable$a = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
208
- return typeof argument == 'function' || argument === documentAll;
209
- } : function (argument) {
210
- return typeof argument == 'function';
211
- };
212
-
213
- var isCallable$9 = isCallable$a;
214
-
215
- var isObject$5 = function (it) {
216
- return typeof it == 'object' ? it !== null : isCallable$9(it);
217
- };
218
-
219
- var global$9 = global$a;
220
- var isCallable$8 = isCallable$a;
221
-
222
- var aFunction = function (argument) {
223
- return isCallable$8(argument) ? argument : undefined;
224
- };
225
-
226
- var getBuiltIn$3 = function (namespace, method) {
227
- return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
228
- };
229
-
230
- var uncurryThis$9 = functionUncurryThis;
231
-
232
- var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
233
-
234
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
235
-
236
- var global$8 = global$a;
237
- var userAgent = engineUserAgent;
238
-
239
- var process = global$8.process;
240
- var Deno = global$8.Deno;
241
- var versions = process && process.versions || Deno && Deno.version;
242
- var v8 = versions && versions.v8;
243
- var match, version;
244
-
245
- if (v8) {
246
- match = v8.split('.');
247
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
248
- // but their correct versions are not interesting for us
249
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
250
- }
251
-
252
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
253
- // so check `userAgent` even if `.v8` exists, but 0
254
- if (!version && userAgent) {
255
- match = userAgent.match(/Edge\/(\d+)/);
256
- if (!match || match[1] >= 74) {
257
- match = userAgent.match(/Chrome\/(\d+)/);
258
- if (match) version = +match[1];
259
- }
260
- }
261
-
262
- var engineV8Version = version;
263
-
264
- /* eslint-disable es/no-symbol -- required for testing */
265
- var V8_VERSION = engineV8Version;
266
- var fails$5 = fails$9;
267
- var global$7 = global$a;
268
-
269
- var $String$3 = global$7.String;
270
-
271
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
272
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
273
- var symbol = Symbol('symbol detection');
274
- // Chrome 38 Symbol has incorrect toString conversion
275
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
276
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
277
- // of course, fail.
278
- return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
279
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
280
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
281
- });
282
-
283
- /* eslint-disable es/no-symbol -- required for testing */
284
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
285
-
286
- var useSymbolAsUid = NATIVE_SYMBOL$1
287
- && !Symbol.sham
288
- && typeof Symbol.iterator == 'symbol';
289
-
290
- var getBuiltIn$2 = getBuiltIn$3;
291
- var isCallable$7 = isCallable$a;
292
- var isPrototypeOf = objectIsPrototypeOf;
293
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
294
-
295
- var $Object$1 = Object;
296
-
297
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
298
- return typeof it == 'symbol';
299
- } : function (it) {
300
- var $Symbol = getBuiltIn$2('Symbol');
301
- return isCallable$7($Symbol) && isPrototypeOf($Symbol.prototype, $Object$1(it));
302
- };
303
-
304
- var $String$2 = String;
305
-
306
- var tryToString$1 = function (argument) {
307
- try {
308
- return $String$2(argument);
309
- } catch (error) {
310
- return 'Object';
311
- }
312
- };
313
-
314
- var isCallable$6 = isCallable$a;
315
- var tryToString = tryToString$1;
316
-
317
- var $TypeError$5 = TypeError;
318
-
319
- // `Assert: IsCallable(argument) is true`
320
- var aCallable$3 = function (argument) {
321
- if (isCallable$6(argument)) return argument;
322
- throw new $TypeError$5(tryToString(argument) + ' is not a function');
323
- };
324
-
325
- var aCallable$2 = aCallable$3;
326
- var isNullOrUndefined = isNullOrUndefined$2;
327
-
328
- // `GetMethod` abstract operation
329
- // https://tc39.es/ecma262/#sec-getmethod
330
- var getMethod$2 = function (V, P) {
331
- var func = V[P];
332
- return isNullOrUndefined(func) ? undefined : aCallable$2(func);
333
- };
334
-
335
- var call$5 = functionCall;
336
- var isCallable$5 = isCallable$a;
337
- var isObject$4 = isObject$5;
338
-
339
- var $TypeError$4 = TypeError;
340
-
341
- // `OrdinaryToPrimitive` abstract operation
342
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
343
- var ordinaryToPrimitive$1 = function (input, pref) {
344
- var fn, val;
345
- if (pref === 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$5(fn, input))) return val;
346
- if (isCallable$5(fn = input.valueOf) && !isObject$4(val = call$5(fn, input))) return val;
347
- if (pref !== 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$5(fn, input))) return val;
348
- throw new $TypeError$4("Can't convert object to primitive value");
349
- };
350
-
351
- var sharedStore = {exports: {}};
352
-
353
- var global$6 = global$a;
354
-
355
- // eslint-disable-next-line es/no-object-defineproperty -- safe
356
- var defineProperty$1 = Object.defineProperty;
357
-
358
- var defineGlobalProperty$3 = function (key, value) {
359
- try {
360
- defineProperty$1(global$6, key, { value: value, configurable: true, writable: true });
361
- } catch (error) {
362
- global$6[key] = value;
363
- } return value;
364
- };
365
-
366
- var globalThis$1 = global$a;
367
- var defineGlobalProperty$2 = defineGlobalProperty$3;
368
-
369
- var SHARED = '__core-js_shared__';
370
- var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
371
-
372
- (store$3.versions || (store$3.versions = [])).push({
373
- version: '3.36.1',
374
- mode: 'global',
375
- copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
376
- license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
377
- source: 'https://github.com/zloirock/core-js'
378
- });
379
-
380
- var sharedStoreExports = sharedStore.exports;
381
-
382
- var store$2 = sharedStoreExports;
383
-
384
- var shared$3 = function (key, value) {
385
- return store$2[key] || (store$2[key] = value || {});
386
- };
387
-
388
- var requireObjectCoercible = requireObjectCoercible$2;
389
-
390
- var $Object = Object;
391
-
392
- // `ToObject` abstract operation
393
- // https://tc39.es/ecma262/#sec-toobject
394
- var toObject$1 = function (argument) {
395
- return $Object(requireObjectCoercible(argument));
396
- };
397
-
398
- var uncurryThis$8 = functionUncurryThis;
399
- var toObject = toObject$1;
400
-
401
- var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
402
-
403
- // `HasOwnProperty` abstract operation
404
- // https://tc39.es/ecma262/#sec-hasownproperty
405
- // eslint-disable-next-line es/no-object-hasown -- safe
406
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
407
- return hasOwnProperty(toObject(it), key);
408
- };
409
-
410
- var uncurryThis$7 = functionUncurryThis;
411
-
412
- var id = 0;
413
- var postfix = Math.random();
414
- var toString = uncurryThis$7(1.0.toString);
415
-
416
- var uid$2 = function (key) {
417
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
418
- };
419
-
420
- var global$5 = global$a;
421
- var shared$2 = shared$3;
422
- var hasOwn$6 = hasOwnProperty_1;
423
- var uid$1 = uid$2;
424
- var NATIVE_SYMBOL = symbolConstructorDetection;
425
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
426
-
427
- var Symbol$1 = global$5.Symbol;
428
- var WellKnownSymbolsStore = shared$2('wks');
429
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
430
-
431
- var wellKnownSymbol$1 = function (name) {
432
- if (!hasOwn$6(WellKnownSymbolsStore, name)) {
433
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)
434
- ? Symbol$1[name]
435
- : createWellKnownSymbol('Symbol.' + name);
436
- } return WellKnownSymbolsStore[name];
437
- };
438
-
439
- var call$4 = functionCall;
440
- var isObject$3 = isObject$5;
441
- var isSymbol$1 = isSymbol$2;
442
- var getMethod$1 = getMethod$2;
443
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
444
- var wellKnownSymbol = wellKnownSymbol$1;
445
-
446
- var $TypeError$3 = TypeError;
447
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
448
-
449
- // `ToPrimitive` abstract operation
450
- // https://tc39.es/ecma262/#sec-toprimitive
451
- var toPrimitive$1 = function (input, pref) {
452
- if (!isObject$3(input) || isSymbol$1(input)) return input;
453
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
454
- var result;
455
- if (exoticToPrim) {
456
- if (pref === undefined) pref = 'default';
457
- result = call$4(exoticToPrim, input, pref);
458
- if (!isObject$3(result) || isSymbol$1(result)) return result;
459
- throw new $TypeError$3("Can't convert object to primitive value");
460
- }
461
- if (pref === undefined) pref = 'number';
462
- return ordinaryToPrimitive(input, pref);
463
- };
464
-
465
- var toPrimitive = toPrimitive$1;
466
- var isSymbol = isSymbol$2;
467
-
468
- // `ToPropertyKey` abstract operation
469
- // https://tc39.es/ecma262/#sec-topropertykey
470
- var toPropertyKey$2 = function (argument) {
471
- var key = toPrimitive(argument, 'string');
472
- return isSymbol(key) ? key : key + '';
473
- };
474
-
475
- var global$4 = global$a;
476
- var isObject$2 = isObject$5;
477
-
478
- var document$1 = global$4.document;
479
- // typeof document.createElement is 'object' in old IE
480
- var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
481
-
482
- var documentCreateElement = function (it) {
483
- return EXISTS$1 ? document$1.createElement(it) : {};
484
- };
485
-
486
- var DESCRIPTORS$6 = descriptors;
487
- var fails$4 = fails$9;
488
- var createElement = documentCreateElement;
489
-
490
- // Thanks to IE8 for its funny defineProperty
491
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$4(function () {
492
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
493
- return Object.defineProperty(createElement('div'), 'a', {
494
- get: function () { return 7; }
495
- }).a !== 7;
496
- });
497
-
498
- var DESCRIPTORS$5 = descriptors;
499
- var call$3 = functionCall;
500
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
501
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
502
- var toIndexedObject$2 = toIndexedObject$3;
503
- var toPropertyKey$1 = toPropertyKey$2;
504
- var hasOwn$5 = hasOwnProperty_1;
505
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
506
-
507
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
508
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
509
-
510
- // `Object.getOwnPropertyDescriptor` method
511
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
512
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
513
- O = toIndexedObject$2(O);
514
- P = toPropertyKey$1(P);
515
- if (IE8_DOM_DEFINE$1) try {
516
- return $getOwnPropertyDescriptor$1(O, P);
517
- } catch (error) { /* empty */ }
518
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$3(propertyIsEnumerableModule.f, O, P), O[P]);
519
- };
520
-
521
- var objectDefineProperty = {};
522
-
523
- var DESCRIPTORS$4 = descriptors;
524
- var fails$3 = fails$9;
525
-
526
- // V8 ~ Chrome 36-
527
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
528
- var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$3(function () {
529
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
530
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
531
- value: 42,
532
- writable: false
533
- }).prototype !== 42;
534
- });
535
-
536
- var isObject$1 = isObject$5;
537
-
538
- var $String$1 = String;
539
- var $TypeError$2 = TypeError;
540
-
541
- // `Assert: Type(argument) is Object`
542
- var anObject$4 = function (argument) {
543
- if (isObject$1(argument)) return argument;
544
- throw new $TypeError$2($String$1(argument) + ' is not an object');
545
- };
546
-
547
- var DESCRIPTORS$3 = descriptors;
548
- var IE8_DOM_DEFINE = ie8DomDefine;
549
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
550
- var anObject$3 = anObject$4;
551
- var toPropertyKey = toPropertyKey$2;
552
-
553
- var $TypeError$1 = TypeError;
554
- // eslint-disable-next-line es/no-object-defineproperty -- safe
555
- var $defineProperty = Object.defineProperty;
556
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
557
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
558
- var ENUMERABLE = 'enumerable';
559
- var CONFIGURABLE$1 = 'configurable';
560
- var WRITABLE = 'writable';
561
-
562
- // `Object.defineProperty` method
563
- // https://tc39.es/ecma262/#sec-object.defineproperty
564
- objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
565
- anObject$3(O);
566
- P = toPropertyKey(P);
567
- anObject$3(Attributes);
568
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
569
- var current = $getOwnPropertyDescriptor(O, P);
570
- if (current && current[WRITABLE]) {
571
- O[P] = Attributes.value;
572
- Attributes = {
573
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
574
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
575
- writable: false
576
- };
577
- }
578
- } return $defineProperty(O, P, Attributes);
579
- } : $defineProperty : function defineProperty(O, P, Attributes) {
580
- anObject$3(O);
581
- P = toPropertyKey(P);
582
- anObject$3(Attributes);
583
- if (IE8_DOM_DEFINE) try {
584
- return $defineProperty(O, P, Attributes);
585
- } catch (error) { /* empty */ }
586
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
587
- if ('value' in Attributes) O[P] = Attributes.value;
588
- return O;
589
- };
590
-
591
- var DESCRIPTORS$2 = descriptors;
592
- var definePropertyModule$2 = objectDefineProperty;
593
- var createPropertyDescriptor = createPropertyDescriptor$2;
594
-
595
- var createNonEnumerableProperty$2 = DESCRIPTORS$2 ? function (object, key, value) {
596
- return definePropertyModule$2.f(object, key, createPropertyDescriptor(1, value));
597
- } : function (object, key, value) {
598
- object[key] = value;
599
- return object;
600
- };
601
-
602
- var makeBuiltIn$2 = {exports: {}};
603
-
604
- var DESCRIPTORS$1 = descriptors;
605
- var hasOwn$4 = hasOwnProperty_1;
606
-
607
- var FunctionPrototype = Function.prototype;
608
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
609
- var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
610
-
611
- var EXISTS = hasOwn$4(FunctionPrototype, 'name');
612
- // additional protection from minified / mangled / dropped function names
613
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
614
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
615
-
616
- var functionName = {
617
- EXISTS: EXISTS,
618
- PROPER: PROPER,
619
- CONFIGURABLE: CONFIGURABLE
620
- };
621
-
622
- var uncurryThis$6 = functionUncurryThis;
623
- var isCallable$4 = isCallable$a;
624
- var store$1 = sharedStoreExports;
625
-
626
- var functionToString = uncurryThis$6(Function.toString);
627
-
628
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
629
- if (!isCallable$4(store$1.inspectSource)) {
630
- store$1.inspectSource = function (it) {
631
- return functionToString(it);
632
- };
633
- }
634
-
635
- var inspectSource$1 = store$1.inspectSource;
636
-
637
- var global$3 = global$a;
638
- var isCallable$3 = isCallable$a;
639
-
640
- var WeakMap$1 = global$3.WeakMap;
641
-
642
- var weakMapBasicDetection = isCallable$3(WeakMap$1) && /native code/.test(String(WeakMap$1));
643
-
644
- var shared$1 = shared$3;
645
- var uid = uid$2;
646
-
647
- var keys$1 = shared$1('keys');
648
-
649
- var sharedKey$1 = function (key) {
650
- return keys$1[key] || (keys$1[key] = uid(key));
651
- };
652
-
653
- var hiddenKeys$3 = {};
654
-
655
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
656
- var global$2 = global$a;
657
- var isObject = isObject$5;
658
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
659
- var hasOwn$3 = hasOwnProperty_1;
660
- var shared = sharedStoreExports;
661
- var sharedKey = sharedKey$1;
662
- var hiddenKeys$2 = hiddenKeys$3;
663
-
664
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
665
- var TypeError$1 = global$2.TypeError;
666
- var WeakMap = global$2.WeakMap;
667
- var set, get, has$6;
668
-
669
- var enforce = function (it) {
670
- return has$6(it) ? get(it) : set(it, {});
671
- };
672
-
673
- var getterFor = function (TYPE) {
674
- return function (it) {
675
- var state;
676
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
677
- throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
678
- } return state;
679
- };
680
- };
681
-
682
- if (NATIVE_WEAK_MAP || shared.state) {
683
- var store = shared.state || (shared.state = new WeakMap());
684
- /* eslint-disable no-self-assign -- prototype methods protection */
685
- store.get = store.get;
686
- store.has = store.has;
687
- store.set = store.set;
688
- /* eslint-enable no-self-assign -- prototype methods protection */
689
- set = function (it, metadata) {
690
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
691
- metadata.facade = it;
692
- store.set(it, metadata);
693
- return metadata;
694
- };
695
- get = function (it) {
696
- return store.get(it) || {};
697
- };
698
- has$6 = function (it) {
699
- return store.has(it);
700
- };
701
- } else {
702
- var STATE = sharedKey('state');
703
- hiddenKeys$2[STATE] = true;
704
- set = function (it, metadata) {
705
- if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
706
- metadata.facade = it;
707
- createNonEnumerableProperty$1(it, STATE, metadata);
708
- return metadata;
709
- };
710
- get = function (it) {
711
- return hasOwn$3(it, STATE) ? it[STATE] : {};
712
- };
713
- has$6 = function (it) {
714
- return hasOwn$3(it, STATE);
715
- };
716
- }
717
-
718
- var internalState = {
719
- set: set,
720
- get: get,
721
- has: has$6,
722
- enforce: enforce,
723
- getterFor: getterFor
724
- };
725
-
726
- var uncurryThis$5 = functionUncurryThis;
727
- var fails$2 = fails$9;
728
- var isCallable$2 = isCallable$a;
729
- var hasOwn$2 = hasOwnProperty_1;
730
- var DESCRIPTORS = descriptors;
731
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
732
- var inspectSource = inspectSource$1;
733
- var InternalStateModule = internalState;
734
-
735
- var enforceInternalState = InternalStateModule.enforce;
736
- var getInternalState = InternalStateModule.get;
737
- var $String = String;
738
- // eslint-disable-next-line es/no-object-defineproperty -- safe
739
- var defineProperty = Object.defineProperty;
740
- var stringSlice = uncurryThis$5(''.slice);
741
- var replace = uncurryThis$5(''.replace);
742
- var join = uncurryThis$5([].join);
743
-
744
- var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails$2(function () {
745
- return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
746
- });
747
-
748
- var TEMPLATE = String(String).split('String');
749
-
750
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
751
- if (stringSlice($String(name), 0, 7) === 'Symbol(') {
752
- name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
753
- }
754
- if (options && options.getter) name = 'get ' + name;
755
- if (options && options.setter) name = 'set ' + name;
756
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
757
- if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
758
- else value.name = name;
759
- }
760
- if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
761
- defineProperty(value, 'length', { value: options.arity });
762
- }
763
- try {
764
- if (options && hasOwn$2(options, 'constructor') && options.constructor) {
765
- if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
766
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
767
- } else if (value.prototype) value.prototype = undefined;
768
- } catch (error) { /* empty */ }
769
- var state = enforceInternalState(value);
770
- if (!hasOwn$2(state, 'source')) {
771
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
772
- } return value;
773
- };
774
-
775
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
776
- // eslint-disable-next-line no-extend-native -- required
777
- Function.prototype.toString = makeBuiltIn$1(function toString() {
778
- return isCallable$2(this) && getInternalState(this).source || inspectSource(this);
779
- }, 'toString');
780
-
781
- var makeBuiltInExports = makeBuiltIn$2.exports;
782
-
783
- var isCallable$1 = isCallable$a;
784
- var definePropertyModule$1 = objectDefineProperty;
785
- var makeBuiltIn = makeBuiltInExports;
786
- var defineGlobalProperty$1 = defineGlobalProperty$3;
787
-
788
- var defineBuiltIn$1 = function (O, key, value, options) {
789
- if (!options) options = {};
790
- var simple = options.enumerable;
791
- var name = options.name !== undefined ? options.name : key;
792
- if (isCallable$1(value)) makeBuiltIn(value, name, options);
793
- if (options.global) {
794
- if (simple) O[key] = value;
795
- else defineGlobalProperty$1(key, value);
796
- } else {
797
- try {
798
- if (!options.unsafe) delete O[key];
799
- else if (O[key]) simple = true;
800
- } catch (error) { /* empty */ }
801
- if (simple) O[key] = value;
802
- else definePropertyModule$1.f(O, key, {
803
- value: value,
804
- enumerable: false,
805
- configurable: !options.nonConfigurable,
806
- writable: !options.nonWritable
807
- });
808
- } return O;
809
- };
810
-
811
- var objectGetOwnPropertyNames = {};
812
-
813
- var ceil = Math.ceil;
814
- var floor = Math.floor;
815
-
816
- // `Math.trunc` method
817
- // https://tc39.es/ecma262/#sec-math.trunc
818
- // eslint-disable-next-line es/no-math-trunc -- safe
819
- var mathTrunc = Math.trunc || function trunc(x) {
820
- var n = +x;
821
- return (n > 0 ? floor : ceil)(n);
822
- };
823
-
824
- var trunc = mathTrunc;
825
-
826
- // `ToIntegerOrInfinity` abstract operation
827
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
828
- var toIntegerOrInfinity$3 = function (argument) {
829
- var number = +argument;
830
- // eslint-disable-next-line no-self-compare -- NaN check
831
- return number !== number || number === 0 ? 0 : trunc(number);
832
- };
833
-
834
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
835
-
836
- var max$1 = Math.max;
837
- var min$1 = Math.min;
838
-
839
- // Helper for a popular repeating case of the spec:
840
- // Let integer be ? ToInteger(index).
841
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
842
- var toAbsoluteIndex$1 = function (index, length) {
843
- var integer = toIntegerOrInfinity$2(index);
844
- return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
845
- };
846
-
847
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
848
-
849
- var min = Math.min;
850
-
851
- // `ToLength` abstract operation
852
- // https://tc39.es/ecma262/#sec-tolength
853
- var toLength$1 = function (argument) {
854
- var len = toIntegerOrInfinity$1(argument);
855
- return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
856
- };
857
-
858
- var toLength = toLength$1;
859
-
860
- // `LengthOfArrayLike` abstract operation
861
- // https://tc39.es/ecma262/#sec-lengthofarraylike
862
- var lengthOfArrayLike$1 = function (obj) {
863
- return toLength(obj.length);
864
- };
865
-
866
- var toIndexedObject$1 = toIndexedObject$3;
867
- var toAbsoluteIndex = toAbsoluteIndex$1;
868
- var lengthOfArrayLike = lengthOfArrayLike$1;
869
-
870
- // `Array.prototype.{ indexOf, includes }` methods implementation
871
- var createMethod = function (IS_INCLUDES) {
872
- return function ($this, el, fromIndex) {
873
- var O = toIndexedObject$1($this);
874
- var length = lengthOfArrayLike(O);
875
- if (length === 0) return !IS_INCLUDES && -1;
876
- var index = toAbsoluteIndex(fromIndex, length);
877
- var value;
878
- // Array#includes uses SameValueZero equality algorithm
879
- // eslint-disable-next-line no-self-compare -- NaN check
880
- if (IS_INCLUDES && el !== el) while (length > index) {
881
- value = O[index++];
882
- // eslint-disable-next-line no-self-compare -- NaN check
883
- if (value !== value) return true;
884
- // Array#indexOf ignores holes, Array#includes - not
885
- } else for (;length > index; index++) {
886
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
887
- } return !IS_INCLUDES && -1;
888
- };
889
- };
890
-
891
- var arrayIncludes = {
892
- // `Array.prototype.includes` method
893
- // https://tc39.es/ecma262/#sec-array.prototype.includes
894
- includes: createMethod(true),
895
- // `Array.prototype.indexOf` method
896
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
897
- indexOf: createMethod(false)
898
- };
899
-
900
- var uncurryThis$4 = functionUncurryThis;
901
- var hasOwn$1 = hasOwnProperty_1;
902
- var toIndexedObject = toIndexedObject$3;
903
- var indexOf = arrayIncludes.indexOf;
904
- var hiddenKeys$1 = hiddenKeys$3;
905
-
906
- var push = uncurryThis$4([].push);
907
-
908
- var objectKeysInternal = function (object, names) {
909
- var O = toIndexedObject(object);
910
- var i = 0;
911
- var result = [];
912
- var key;
913
- for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push(result, key);
914
- // Don't enum bug & hidden keys
915
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
916
- ~indexOf(result, key) || push(result, key);
917
- }
918
- return result;
919
- };
920
-
921
- // IE8- don't enum bug keys
922
- var enumBugKeys$1 = [
923
- 'constructor',
924
- 'hasOwnProperty',
925
- 'isPrototypeOf',
926
- 'propertyIsEnumerable',
927
- 'toLocaleString',
928
- 'toString',
929
- 'valueOf'
930
- ];
931
-
932
- var internalObjectKeys = objectKeysInternal;
933
- var enumBugKeys = enumBugKeys$1;
934
-
935
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
936
-
937
- // `Object.getOwnPropertyNames` method
938
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
939
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
940
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
941
- return internalObjectKeys(O, hiddenKeys);
942
- };
943
-
944
- var objectGetOwnPropertySymbols = {};
945
-
946
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
947
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
948
-
949
- var getBuiltIn$1 = getBuiltIn$3;
950
- var uncurryThis$3 = functionUncurryThis;
951
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
952
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
953
- var anObject$2 = anObject$4;
954
-
955
- var concat = uncurryThis$3([].concat);
956
-
957
- // all object keys, includes non-enumerable and symbols
958
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
959
- var keys = getOwnPropertyNamesModule.f(anObject$2(it));
960
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
961
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
962
- };
963
-
964
- var hasOwn = hasOwnProperty_1;
965
- var ownKeys = ownKeys$1;
966
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
967
- var definePropertyModule = objectDefineProperty;
968
-
969
- var copyConstructorProperties$1 = function (target, source, exceptions) {
970
- var keys = ownKeys(source);
971
- var defineProperty = definePropertyModule.f;
972
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
973
- for (var i = 0; i < keys.length; i++) {
974
- var key = keys[i];
975
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
976
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
977
- }
978
- }
979
- };
980
-
981
- var fails$1 = fails$9;
982
- var isCallable = isCallable$a;
983
-
984
- var replacement = /#|\.prototype\./;
985
-
986
- var isForced$1 = function (feature, detection) {
987
- var value = data[normalize(feature)];
988
- return value === POLYFILL ? true
989
- : value === NATIVE ? false
990
- : isCallable(detection) ? fails$1(detection)
991
- : !!detection;
992
- };
993
-
994
- var normalize = isForced$1.normalize = function (string) {
995
- return String(string).replace(replacement, '.').toLowerCase();
996
- };
997
-
998
- var data = isForced$1.data = {};
999
- var NATIVE = isForced$1.NATIVE = 'N';
1000
- var POLYFILL = isForced$1.POLYFILL = 'P';
1001
-
1002
- var isForced_1 = isForced$1;
1003
-
1004
- var global$1 = global$a;
1005
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1006
- var createNonEnumerableProperty = createNonEnumerableProperty$2;
1007
- var defineBuiltIn = defineBuiltIn$1;
1008
- var defineGlobalProperty = defineGlobalProperty$3;
1009
- var copyConstructorProperties = copyConstructorProperties$1;
1010
- var isForced = isForced_1;
1011
-
1012
- /*
1013
- options.target - name of the target object
1014
- options.global - target is the global object
1015
- options.stat - export as static methods of target
1016
- options.proto - export as prototype methods of target
1017
- options.real - real prototype method for the `pure` version
1018
- options.forced - export even if the native feature is available
1019
- options.bind - bind methods to the target, required for the `pure` version
1020
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1021
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1022
- options.sham - add a flag to not completely full polyfills
1023
- options.enumerable - export as enumerable property
1024
- options.dontCallGetSet - prevent calling a getter on target
1025
- options.name - the .name of the function if it does not match the key
1026
- */
1027
- var _export = function (options, source) {
1028
- var TARGET = options.target;
1029
- var GLOBAL = options.global;
1030
- var STATIC = options.stat;
1031
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1032
- if (GLOBAL) {
1033
- target = global$1;
1034
- } else if (STATIC) {
1035
- target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
1036
- } else {
1037
- target = global$1[TARGET] && global$1[TARGET].prototype;
1038
- }
1039
- if (target) for (key in source) {
1040
- sourceProperty = source[key];
1041
- if (options.dontCallGetSet) {
1042
- descriptor = getOwnPropertyDescriptor(target, key);
1043
- targetProperty = descriptor && descriptor.value;
1044
- } else targetProperty = target[key];
1045
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1046
- // contained in target
1047
- if (!FORCED && targetProperty !== undefined) {
1048
- if (typeof sourceProperty == typeof targetProperty) continue;
1049
- copyConstructorProperties(sourceProperty, targetProperty);
1050
- }
1051
- // add a flag to not completely full polyfills
1052
- if (options.sham || (targetProperty && targetProperty.sham)) {
1053
- createNonEnumerableProperty(sourceProperty, 'sham', true);
1054
- }
1055
- defineBuiltIn(target, key, sourceProperty, options);
1056
- }
1057
- };
1058
-
1059
- var uncurryThis$2 = functionUncurryThis;
1060
-
1061
- // eslint-disable-next-line es/no-set -- safe
1062
- var SetPrototype$1 = Set.prototype;
1063
-
1064
- var setHelpers = {
1065
- // eslint-disable-next-line es/no-set -- safe
1066
- Set: Set,
1067
- add: uncurryThis$2(SetPrototype$1.add),
1068
- has: uncurryThis$2(SetPrototype$1.has),
1069
- remove: uncurryThis$2(SetPrototype$1['delete']),
1070
- proto: SetPrototype$1
1071
- };
1072
-
1073
- var has$5 = setHelpers.has;
1074
-
1075
- // Perform ? RequireInternalSlot(M, [[SetData]])
1076
- var aSet$7 = function (it) {
1077
- has$5(it);
1078
- return it;
1079
- };
1080
-
1081
- var call$2 = functionCall;
1082
-
1083
- var iterateSimple$7 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
1084
- var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
1085
- var next = record.next;
1086
- var step, result;
1087
- while (!(step = call$2(next, iterator)).done) {
1088
- result = fn(step.value);
1089
- if (result !== undefined) return result;
1090
- }
1091
- };
1092
-
1093
- var uncurryThis$1 = functionUncurryThis;
1094
- var iterateSimple$6 = iterateSimple$7;
1095
- var SetHelpers$5 = setHelpers;
1096
-
1097
- var Set$3 = SetHelpers$5.Set;
1098
- var SetPrototype = SetHelpers$5.proto;
1099
- var forEach = uncurryThis$1(SetPrototype.forEach);
1100
- var keys = uncurryThis$1(SetPrototype.keys);
1101
- var next = keys(new Set$3()).next;
1102
-
1103
- var setIterate = function (set, fn, interruptible) {
1104
- return interruptible ? iterateSimple$6({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
1105
- };
1106
-
1107
- var SetHelpers$4 = setHelpers;
1108
- var iterate$1 = setIterate;
1109
-
1110
- var Set$2 = SetHelpers$4.Set;
1111
- var add$3 = SetHelpers$4.add;
1112
-
1113
- var setClone = function (set) {
1114
- var result = new Set$2();
1115
- iterate$1(set, function (it) {
1116
- add$3(result, it);
1117
- });
1118
- return result;
1119
- };
1120
-
1121
- var uncurryThis = functionUncurryThis;
1122
- var aCallable$1 = aCallable$3;
1123
-
1124
- var functionUncurryThisAccessor = function (object, key, method) {
1125
- try {
1126
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1127
- return uncurryThis(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1128
- } catch (error) { /* empty */ }
1129
- };
1130
-
1131
- var uncurryThisAccessor = functionUncurryThisAccessor;
1132
- var SetHelpers$3 = setHelpers;
1133
-
1134
- var setSize = uncurryThisAccessor(SetHelpers$3.proto, 'size', 'get') || function (set) {
1135
- return set.size;
1136
- };
1137
-
1138
- // `GetIteratorDirect(obj)` abstract operation
1139
- // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
1140
- var getIteratorDirect$1 = function (obj) {
1141
- return {
1142
- iterator: obj,
1143
- next: obj.next,
1144
- done: false
1145
- };
1146
- };
1147
-
1148
- var aCallable = aCallable$3;
1149
- var anObject$1 = anObject$4;
1150
- var call$1 = functionCall;
1151
- var toIntegerOrInfinity = toIntegerOrInfinity$3;
1152
- var getIteratorDirect = getIteratorDirect$1;
1153
-
1154
- var INVALID_SIZE = 'Invalid size';
1155
- var $RangeError = RangeError;
1156
- var $TypeError = TypeError;
1157
- var max = Math.max;
1158
-
1159
- var SetRecord = function (set, intSize) {
1160
- this.set = set;
1161
- this.size = max(intSize, 0);
1162
- this.has = aCallable(set.has);
1163
- this.keys = aCallable(set.keys);
1164
- };
1165
-
1166
- SetRecord.prototype = {
1167
- getIterator: function () {
1168
- return getIteratorDirect(anObject$1(call$1(this.keys, this.set)));
1169
- },
1170
- includes: function (it) {
1171
- return call$1(this.has, this.set, it);
1172
- }
1173
- };
1174
-
1175
- // `GetSetRecord` abstract operation
1176
- // https://tc39.es/proposal-set-methods/#sec-getsetrecord
1177
- var getSetRecord$7 = function (obj) {
1178
- anObject$1(obj);
1179
- var numSize = +obj.size;
1180
- // NOTE: If size is undefined, then numSize will be NaN
1181
- // eslint-disable-next-line no-self-compare -- NaN check
1182
- if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
1183
- var intSize = toIntegerOrInfinity(numSize);
1184
- if (intSize < 0) throw new $RangeError(INVALID_SIZE);
1185
- return new SetRecord(obj, intSize);
1186
- };
1187
-
1188
- var aSet$6 = aSet$7;
1189
- var SetHelpers$2 = setHelpers;
1190
- var clone$2 = setClone;
1191
- var size$4 = setSize;
1192
- var getSetRecord$6 = getSetRecord$7;
1193
- var iterateSet$2 = setIterate;
1194
- var iterateSimple$5 = iterateSimple$7;
1195
-
1196
- var has$4 = SetHelpers$2.has;
1197
- var remove$1 = SetHelpers$2.remove;
1198
-
1199
- // `Set.prototype.difference` method
1200
- // https://github.com/tc39/proposal-set-methods
1201
- var setDifference = function difference(other) {
1202
- var O = aSet$6(this);
1203
- var otherRec = getSetRecord$6(other);
1204
- var result = clone$2(O);
1205
- if (size$4(O) <= otherRec.size) iterateSet$2(O, function (e) {
1206
- if (otherRec.includes(e)) remove$1(result, e);
1207
- });
1208
- else iterateSimple$5(otherRec.getIterator(), function (e) {
1209
- if (has$4(O, e)) remove$1(result, e);
1210
- });
1211
- return result;
1212
- };
1213
-
1214
- var getBuiltIn = getBuiltIn$3;
1215
-
1216
- var createSetLike = function (size) {
1217
- return {
1218
- size: size,
1219
- has: function () {
1220
- return false;
1221
- },
1222
- keys: function () {
1223
- return {
1224
- next: function () {
1225
- return { done: true };
36
+ return fetch.fetchPageFactory({
37
+ ...defaults,
38
+ fetch: fetch$1,
39
+ readFetchPageResultInfo: function (result) {
40
+ return {
41
+ nextPageCursor: result.next_page_token,
42
+ hasNext: Boolean(result.next_page_token) // has more when a non-empty next_page_token is returned
43
+ };
44
+ },
45
+ buildInputForNextPage: function (pageResult, input, options) {
46
+ return { ...input, next_page_token: pageResult.nextPageCursor, page_size: options.maxItemsPerPage ?? input.page_size };
1226
47
  }
1227
- };
1228
- }
1229
- };
1230
- };
1231
-
1232
- var setMethodAcceptSetLike$7 = function (name) {
1233
- var Set = getBuiltIn('Set');
1234
- try {
1235
- new Set()[name](createSetLike(0));
1236
- try {
1237
- // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
1238
- // https://github.com/tc39/proposal-set-methods/pull/88
1239
- new Set()[name](createSetLike(-1));
1240
- return false;
1241
- } catch (error2) {
1242
- return true;
1243
- }
1244
- } catch (error) {
1245
- return false;
1246
- }
1247
- };
1248
-
1249
- var $$6 = _export;
1250
- var difference = setDifference;
1251
- var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7;
1252
-
1253
- // `Set.prototype.difference` method
1254
- // https://github.com/tc39/proposal-set-methods
1255
- $$6({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
1256
- difference: difference
1257
- });
1258
-
1259
- var aSet$5 = aSet$7;
1260
- var SetHelpers$1 = setHelpers;
1261
- var size$3 = setSize;
1262
- var getSetRecord$5 = getSetRecord$7;
1263
- var iterateSet$1 = setIterate;
1264
- var iterateSimple$4 = iterateSimple$7;
1265
-
1266
- var Set$1 = SetHelpers$1.Set;
1267
- var add$2 = SetHelpers$1.add;
1268
- var has$3 = SetHelpers$1.has;
1269
-
1270
- // `Set.prototype.intersection` method
1271
- // https://github.com/tc39/proposal-set-methods
1272
- var setIntersection = function intersection(other) {
1273
- var O = aSet$5(this);
1274
- var otherRec = getSetRecord$5(other);
1275
- var result = new Set$1();
1276
-
1277
- if (size$3(O) > otherRec.size) {
1278
- iterateSimple$4(otherRec.getIterator(), function (e) {
1279
- if (has$3(O, e)) add$2(result, e);
1280
- });
1281
- } else {
1282
- iterateSet$1(O, function (e) {
1283
- if (otherRec.includes(e)) add$2(result, e);
1284
48
  });
1285
- }
1286
-
1287
- return result;
1288
- };
1289
-
1290
- var $$5 = _export;
1291
- var fails = fails$9;
1292
- var intersection = setIntersection;
1293
- var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7;
1294
-
1295
- var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails(function () {
1296
- // eslint-disable-next-line es/no-array-from, es/no-set -- testing
1297
- return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
1298
- });
1299
-
1300
- // `Set.prototype.intersection` method
1301
- // https://github.com/tc39/proposal-set-methods
1302
- $$5({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
1303
- intersection: intersection
1304
- });
1305
-
1306
- var call = functionCall;
1307
- var anObject = anObject$4;
1308
- var getMethod = getMethod$2;
1309
-
1310
- var iteratorClose$2 = function (iterator, kind, value) {
1311
- var innerResult, innerError;
1312
- anObject(iterator);
1313
- try {
1314
- innerResult = getMethod(iterator, 'return');
1315
- if (!innerResult) {
1316
- if (kind === 'throw') throw value;
1317
- return value;
1318
- }
1319
- innerResult = call(innerResult, iterator);
1320
- } catch (error) {
1321
- innerError = true;
1322
- innerResult = error;
1323
- }
1324
- if (kind === 'throw') throw value;
1325
- if (innerError) throw innerResult;
1326
- anObject(innerResult);
1327
- return value;
1328
- };
1329
-
1330
- var aSet$4 = aSet$7;
1331
- var has$2 = setHelpers.has;
1332
- var size$2 = setSize;
1333
- var getSetRecord$4 = getSetRecord$7;
1334
- var iterateSet = setIterate;
1335
- var iterateSimple$3 = iterateSimple$7;
1336
- var iteratorClose$1 = iteratorClose$2;
1337
-
1338
- // `Set.prototype.isDisjointFrom` method
1339
- // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
1340
- var setIsDisjointFrom = function isDisjointFrom(other) {
1341
- var O = aSet$4(this);
1342
- var otherRec = getSetRecord$4(other);
1343
- if (size$2(O) <= otherRec.size) return iterateSet(O, function (e) {
1344
- if (otherRec.includes(e)) return false;
1345
- }, true) !== false;
1346
- var iterator = otherRec.getIterator();
1347
- return iterateSimple$3(iterator, function (e) {
1348
- if (has$2(O, e)) return iteratorClose$1(iterator, 'normal', false);
1349
- }) !== false;
1350
- };
1351
-
1352
- var $$4 = _export;
1353
- var isDisjointFrom = setIsDisjointFrom;
1354
- var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7;
1355
-
1356
- // `Set.prototype.isDisjointFrom` method
1357
- // https://github.com/tc39/proposal-set-methods
1358
- $$4({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
1359
- isDisjointFrom: isDisjointFrom
1360
- });
1361
-
1362
- var aSet$3 = aSet$7;
1363
- var size$1 = setSize;
1364
- var iterate = setIterate;
1365
- var getSetRecord$3 = getSetRecord$7;
1366
-
1367
- // `Set.prototype.isSubsetOf` method
1368
- // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
1369
- var setIsSubsetOf = function isSubsetOf(other) {
1370
- var O = aSet$3(this);
1371
- var otherRec = getSetRecord$3(other);
1372
- if (size$1(O) > otherRec.size) return false;
1373
- return iterate(O, function (e) {
1374
- if (!otherRec.includes(e)) return false;
1375
- }, true) !== false;
1376
- };
1377
-
1378
- var $$3 = _export;
1379
- var isSubsetOf = setIsSubsetOf;
1380
- var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7;
1381
-
1382
- // `Set.prototype.isSubsetOf` method
1383
- // https://github.com/tc39/proposal-set-methods
1384
- $$3({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
1385
- isSubsetOf: isSubsetOf
1386
- });
1387
-
1388
- var aSet$2 = aSet$7;
1389
- var has$1 = setHelpers.has;
1390
- var size = setSize;
1391
- var getSetRecord$2 = getSetRecord$7;
1392
- var iterateSimple$2 = iterateSimple$7;
1393
- var iteratorClose = iteratorClose$2;
1394
-
1395
- // `Set.prototype.isSupersetOf` method
1396
- // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
1397
- var setIsSupersetOf = function isSupersetOf(other) {
1398
- var O = aSet$2(this);
1399
- var otherRec = getSetRecord$2(other);
1400
- if (size(O) < otherRec.size) return false;
1401
- var iterator = otherRec.getIterator();
1402
- return iterateSimple$2(iterator, function (e) {
1403
- if (!has$1(O, e)) return iteratorClose(iterator, 'normal', false);
1404
- }) !== false;
1405
- };
1406
-
1407
- var $$2 = _export;
1408
- var isSupersetOf = setIsSupersetOf;
1409
- var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7;
1410
-
1411
- // `Set.prototype.isSupersetOf` method
1412
- // https://github.com/tc39/proposal-set-methods
1413
- $$2({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
1414
- isSupersetOf: isSupersetOf
1415
- });
1416
-
1417
- var aSet$1 = aSet$7;
1418
- var SetHelpers = setHelpers;
1419
- var clone$1 = setClone;
1420
- var getSetRecord$1 = getSetRecord$7;
1421
- var iterateSimple$1 = iterateSimple$7;
1422
-
1423
- var add$1 = SetHelpers.add;
1424
- var has = SetHelpers.has;
1425
- var remove = SetHelpers.remove;
1426
-
1427
- // `Set.prototype.symmetricDifference` method
1428
- // https://github.com/tc39/proposal-set-methods
1429
- var setSymmetricDifference = function symmetricDifference(other) {
1430
- var O = aSet$1(this);
1431
- var keysIter = getSetRecord$1(other).getIterator();
1432
- var result = clone$1(O);
1433
- iterateSimple$1(keysIter, function (e) {
1434
- if (has(O, e)) remove(result, e);
1435
- else add$1(result, e);
1436
- });
1437
- return result;
1438
- };
1439
-
1440
- var $$1 = _export;
1441
- var symmetricDifference = setSymmetricDifference;
1442
- var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7;
1443
-
1444
- // `Set.prototype.symmetricDifference` method
1445
- // https://github.com/tc39/proposal-set-methods
1446
- $$1({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
1447
- symmetricDifference: symmetricDifference
1448
- });
1449
-
1450
- var aSet = aSet$7;
1451
- var add = setHelpers.add;
1452
- var clone = setClone;
1453
- var getSetRecord = getSetRecord$7;
1454
- var iterateSimple = iterateSimple$7;
1455
-
1456
- // `Set.prototype.union` method
1457
- // https://github.com/tc39/proposal-set-methods
1458
- var setUnion = function union(other) {
1459
- var O = aSet(this);
1460
- var keysIter = getSetRecord(other).getIterator();
1461
- var result = clone(O);
1462
- iterateSimple(keysIter, function (it) {
1463
- add(result, it);
1464
- });
1465
- return result;
1466
- };
1467
-
1468
- var $ = _export;
1469
- var union = setUnion;
1470
- var setMethodAcceptSetLike = setMethodAcceptSetLike$7;
1471
-
1472
- // `Set.prototype.union` method
1473
- // https://github.com/tc39/proposal-set-methods
1474
- $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
1475
- union: union
1476
- });
49
+ }
1477
50
 
1478
51
  /**
1479
52
  * A code used in some cases to denote success.
@@ -1483,26 +56,26 @@ const ZOOM_SUCCESS_CODE = 'SUCCESS';
1483
56
  * Zoom Server Error
1484
57
  */
1485
58
  class ZoomServerError extends makeError.BaseError {
1486
- get code() {
1487
- return this.error.code;
1488
- }
1489
- constructor(error) {
1490
- super(error.message);
1491
- this.error = void 0;
1492
- this.error = error;
1493
- }
59
+ error;
60
+ get code() {
61
+ return this.error.code;
62
+ }
63
+ constructor(error) {
64
+ super(error.message);
65
+ this.error = error;
66
+ }
1494
67
  }
1495
68
  /**
1496
69
  * Zoom Server Error that includes the FetchResponseError
1497
70
  */
1498
71
  class ZoomServerFetchResponseError extends ZoomServerError {
1499
- constructor(data, responseError) {
1500
- super(data);
1501
- this.data = void 0;
1502
- this.responseError = void 0;
1503
- this.data = data;
1504
- this.responseError = responseError;
1505
- }
72
+ data;
73
+ responseError;
74
+ constructor(data, responseError) {
75
+ super(data);
76
+ this.data = data;
77
+ this.responseError = responseError;
78
+ }
1506
79
  }
1507
80
  /**
1508
81
  * Creates a logZoomServerErrorFunction that logs the error to console.
@@ -1511,22 +84,17 @@ class ZoomServerFetchResponseError extends ZoomServerError {
1511
84
  * @returns
1512
85
  */
1513
86
  function logZoomServerErrorFunction(zoomApiNamePrefix) {
1514
- return error => {
1515
- if (error instanceof ZoomServerFetchResponseError) {
1516
- console.log(`${zoomApiNamePrefix}Error(${error.responseError.response.status}): `, {
1517
- error,
1518
- errorData: error.data
1519
- });
1520
- } else if (error instanceof ZoomServerError) {
1521
- console.log(`${zoomApiNamePrefix}Error(code:${error.code}): `, {
1522
- error
1523
- });
1524
- } else {
1525
- console.log(`${zoomApiNamePrefix}Error(name:${error.name}): `, {
1526
- error
1527
- });
1528
- }
1529
- };
87
+ return (error) => {
88
+ if (error instanceof ZoomServerFetchResponseError) {
89
+ console.log(`${zoomApiNamePrefix}Error(${error.responseError.response.status}): `, { error, errorData: error.data });
90
+ }
91
+ else if (error instanceof ZoomServerError) {
92
+ console.log(`${zoomApiNamePrefix}Error(code:${error.code}): `, { error });
93
+ }
94
+ else {
95
+ console.log(`${zoomApiNamePrefix}Error(name:${error.name}): `, { error });
96
+ }
97
+ };
1530
98
  }
1531
99
  /**
1532
100
  * Wraps a ConfiguredFetch to support handling errors returned by fetch.
@@ -1535,22 +103,23 @@ function logZoomServerErrorFunction(zoomApiNamePrefix) {
1535
103
  * @returns
1536
104
  */
1537
105
  function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
1538
- return (fetch$1, logError = defaultLogError) => {
1539
- return async (x, y) => {
1540
- try {
1541
- return await fetch$1(x, y); // await to catch thrown errors
1542
- } catch (e) {
1543
- if (e instanceof fetch.FetchResponseError) {
1544
- const error = await parseZoomError(e);
1545
- if (error) {
1546
- logError(error); // log before throwing.
1547
- throw error;
1548
- }
1549
- }
1550
- throw e;
1551
- }
106
+ return (fetch$1, logError = defaultLogError) => {
107
+ return async (x, y) => {
108
+ try {
109
+ return await fetch$1(x, y); // await to catch thrown errors
110
+ }
111
+ catch (e) {
112
+ if (e instanceof fetch.FetchResponseError) {
113
+ const error = await parseZoomError(e);
114
+ if (error) {
115
+ logError(error); // log before throwing.
116
+ throw error;
117
+ }
118
+ }
119
+ throw e;
120
+ }
121
+ };
1552
122
  };
1553
- };
1554
123
  }
1555
124
  // MARK: Parsed Errors
1556
125
  /**
@@ -1569,34 +138,27 @@ const ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = 'Retry-After';
1569
138
  const DEFAULT_ZOOM_API_RATE_LIMIT = 2;
1570
139
  const DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = util.MS_IN_SECOND;
1571
140
  function zoomRateLimitHeaderDetails(headers) {
1572
- const limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
1573
- const remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
1574
- const retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
1575
- const categoryHeader = headers.get(ZOOM_RATE_LIMIT_CATEGORY_HEADER);
1576
- const typeHeader = headers.get(ZOOM_RATE_LIMIT_TYPE_HEADER);
1577
- let result = null;
1578
- if (categoryHeader != null && typeHeader != null) {
1579
- const category = categoryHeader;
1580
- const type = typeHeader;
1581
- const limit = limitHeader ? Number(limitHeader) : undefined;
1582
- const remaining = remainingHeader ? Number(remainingHeader) : undefined;
1583
- const retryAfter = retryAfterHeader ? Number(retryAfterHeader) : undefined;
1584
- const retryAfterAt = retryAfterHeader ? new Date(retryAfterHeader) : undefined;
1585
- result = {
1586
- limit,
1587
- remaining,
1588
- retryAfter,
1589
- retryAfterAt,
1590
- category,
1591
- type
1592
- };
1593
- }
1594
- return result;
141
+ const limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
142
+ const remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
143
+ const retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
144
+ const categoryHeader = headers.get(ZOOM_RATE_LIMIT_CATEGORY_HEADER);
145
+ const typeHeader = headers.get(ZOOM_RATE_LIMIT_TYPE_HEADER);
146
+ let result = null;
147
+ if (categoryHeader != null && typeHeader != null) {
148
+ const category = categoryHeader;
149
+ const type = typeHeader;
150
+ const limit = limitHeader ? Number(limitHeader) : undefined;
151
+ const remaining = remainingHeader ? Number(remainingHeader) : undefined;
152
+ const retryAfter = retryAfterHeader ? Number(retryAfterHeader) : undefined;
153
+ const retryAfterAt = retryAfterHeader ? new Date(retryAfterHeader) : undefined;
154
+ result = { limit, remaining, retryAfter, retryAfterAt, category, type };
155
+ }
156
+ return result;
1595
157
  }
1596
158
  class ZoomTooManyRequestsError extends ZoomServerFetchResponseError {
1597
- get headerDetails() {
1598
- return zoomRateLimitHeaderDetails(this.responseError.response.headers);
1599
- }
159
+ get headerDetails() {
160
+ return zoomRateLimitHeaderDetails(this.responseError.response.headers);
161
+ }
1600
162
  }
1601
163
  /**
1602
164
  * Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
@@ -1606,22 +168,23 @@ class ZoomTooManyRequestsError extends ZoomServerFetchResponseError {
1606
168
  * @returns
1607
169
  */
1608
170
  function parseZoomServerErrorData(zoomServerError, responseError) {
1609
- let result;
1610
- if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
1611
- result = new ZoomTooManyRequestsError(zoomServerError, responseError);
1612
- console.warn('ZoomTooManyRequestsError', {
1613
- result,
1614
- responseError,
1615
- headerDetails: result.headerDetails
1616
- });
1617
- } else if (zoomServerError) {
1618
- switch (zoomServerError.code) {
1619
- default:
1620
- result = new ZoomServerFetchResponseError(zoomServerError, responseError);
1621
- break;
171
+ let result;
172
+ if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
173
+ result = new ZoomTooManyRequestsError(zoomServerError, responseError);
174
+ console.warn('ZoomTooManyRequestsError', {
175
+ result,
176
+ responseError,
177
+ headerDetails: result.headerDetails
178
+ });
179
+ }
180
+ else if (zoomServerError) {
181
+ switch (zoomServerError.code) {
182
+ default:
183
+ result = new ZoomServerFetchResponseError(zoomServerError, responseError);
184
+ break;
185
+ }
1622
186
  }
1623
- }
1624
- return result;
187
+ return result;
1625
188
  }
1626
189
  /**
1627
190
  * Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
@@ -1629,84 +192,80 @@ function parseZoomServerErrorData(zoomServerError, responseError) {
1629
192
  * If other options are input, it merges those two options together and adds silenceError to the omitted keys.
1630
193
  */
1631
194
  function omitSilenceZoomErrorKeys(options) {
1632
- const omitKeys = ['silenceError'];
1633
- return fetch.mergeMakeUrlSearchParamsOptions([options, {
1634
- omitKeys
1635
- }]);
195
+ const omitKeys = ['silenceError'];
196
+ return fetch.mergeMakeUrlSearchParamsOptions([options, { omitKeys }]);
1636
197
  }
1637
198
  function silenceZoomErrorWithCodesFunction(codes, returnFn) {
1638
- const codesSet = new Set(util.asArray(codes));
1639
- return silence => {
1640
- return reason => {
1641
- if (silence !== false && reason instanceof ZoomServerFetchResponseError) {
1642
- if (codesSet.has(reason.code)) {
1643
- return returnFn?.(reason);
1644
- }
1645
- }
1646
- throw reason;
199
+ const codesSet = new Set(util.asArray(codes));
200
+ return (silence) => {
201
+ return (reason) => {
202
+ if (silence !== false && reason instanceof ZoomServerFetchResponseError) {
203
+ if (codesSet.has(reason.code)) {
204
+ return returnFn?.(reason);
205
+ }
206
+ }
207
+ throw reason;
208
+ };
1647
209
  };
1648
- };
1649
210
  }
1650
211
 
1651
212
  /**
1652
213
  * https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting
1653
214
  */
1654
215
  function getMeeting(context) {
1655
- return input => context.fetchJson(`/meetings/${input.meetingId}`, 'GET');
216
+ return (input) => context.fetchJson(`/meetings/${input.meetingId}`, 'GET');
1656
217
  }
1657
218
  /**
1658
219
  * https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings
1659
220
  */
1660
221
  function listMeetingsForUser(context) {
1661
- return input => context.fetchJson(`/users/${input.user}/meetings`, 'GET').then(mapToZoomPageResult('meetings'));
222
+ return (input) => context.fetchJson(`/users/${input.user}/meetings`, 'GET').then(mapToZoomPageResult('meetings'));
1662
223
  }
1663
224
  function listMeetingsForUserPageFactory(context) {
1664
- return zoomFetchPageFactory(listMeetingsForUser(context));
225
+ return zoomFetchPageFactory(listMeetingsForUser(context));
1665
226
  }
1666
227
  /**
1667
228
  * https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings
1668
229
  */
1669
230
  function createMeetingForUser(context) {
1670
- return input => {
1671
- return context.fetchJson(`/users/${input.user}/meetings`, {
1672
- method: 'POST',
1673
- body: JSON.stringify(input.template)
1674
- });
1675
- };
231
+ return (input) => {
232
+ return context.fetchJson(`/users/${input.user}/meetings`, {
233
+ method: 'POST',
234
+ body: JSON.stringify(input.template)
235
+ });
236
+ };
1676
237
  }
1677
238
  /**
1678
239
  * https://developers.zoom.us/docs/api/meetings/#tag/meetings/PUT/meetings/{meetingId}
1679
240
  */
1680
241
  function updateMeeting(context) {
1681
- return input => context.fetchJson(`/meetings/${input.meetingId}?${fetch.makeUrlSearchParams({
1682
- occurrence_id: input.occurrence_id
1683
- })}`, {
1684
- method: 'PATCH',
1685
- body: JSON.stringify(input.template)
1686
- });
242
+ return (input) => context.fetchJson(`/meetings/${input.meetingId}?${fetch.makeUrlSearchParams({ occurrence_id: input.occurrence_id })}`, {
243
+ method: 'PATCH',
244
+ body: JSON.stringify(input.template)
245
+ });
1687
246
  }
1688
247
  const DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
1689
248
  /**
1690
249
  * https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
1691
250
  */
1692
251
  function deleteMeeting(context) {
1693
- const silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
1694
- return input => context.fetchJson(`/meetings/${input.meetingId}?${fetch.makeUrlSearchParams(input, omitSilenceZoomErrorKeys())}`, 'DELETE').catch(silenceDoesNotExistError(input.silenceError));
252
+ const silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
253
+ return (input) => context.fetchJson(`/meetings/${input.meetingId}?${fetch.makeUrlSearchParams(input, omitSilenceZoomErrorKeys())}`, 'DELETE').catch(silenceDoesNotExistError(input.silenceError));
1695
254
  }
1696
255
  /**
1697
256
  * https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}
1698
257
  */
1699
258
  function getPastMeeting(context) {
1700
- return input => context.fetchJson(`/past_meetings/${input.meetingId}`, 'GET');
259
+ return (input) => context.fetchJson(`/past_meetings/${input.meetingId}`, 'GET');
1701
260
  }
1702
261
  /**
1703
262
  * https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}/participants
1704
263
  */
1705
264
  function getPastMeetingParticipants(context) {
1706
- return input => context.fetchJson(`/past_meetings/${input.meetingId}/participants`, 'GET').then(mapToZoomPageResult('participants'));
265
+ return (input) => context.fetchJson(`/past_meetings/${input.meetingId}/participants`, 'GET').then(mapToZoomPageResult('participants'));
1707
266
  }
1708
267
  function getPastMeetingParticipantsPageFactory(context) {
1709
- return zoomFetchPageFactory(getPastMeetingParticipants(context));
268
+ return zoomFetchPageFactory(getPastMeetingParticipants(context));
1710
269
  }
1711
270
 
1712
271
  /**
@@ -1720,66 +279,66 @@ function getPastMeetingParticipantsPageFactory(context) {
1720
279
  */
1721
280
  exports.ZoomMeetingType = void 0;
1722
281
  (function (ZoomMeetingType) {
1723
- ZoomMeetingType[ZoomMeetingType["INSTANT"] = 1] = "INSTANT";
1724
- ZoomMeetingType[ZoomMeetingType["SCHEDULED"] = 2] = "SCHEDULED";
1725
- ZoomMeetingType[ZoomMeetingType["RECURRING_NO_FIXED_TIME"] = 3] = "RECURRING_NO_FIXED_TIME";
1726
- ZoomMeetingType[ZoomMeetingType["PMI"] = 4] = "PMI";
1727
- ZoomMeetingType[ZoomMeetingType["RECURRING_FIXED_TIME"] = 8] = "RECURRING_FIXED_TIME";
1728
- ZoomMeetingType[ZoomMeetingType["SCREEN_SHARE_ONLY"] = 10] = "SCREEN_SHARE_ONLY";
282
+ ZoomMeetingType[ZoomMeetingType["INSTANT"] = 1] = "INSTANT";
283
+ ZoomMeetingType[ZoomMeetingType["SCHEDULED"] = 2] = "SCHEDULED";
284
+ ZoomMeetingType[ZoomMeetingType["RECURRING_NO_FIXED_TIME"] = 3] = "RECURRING_NO_FIXED_TIME";
285
+ ZoomMeetingType[ZoomMeetingType["PMI"] = 4] = "PMI";
286
+ ZoomMeetingType[ZoomMeetingType["RECURRING_FIXED_TIME"] = 8] = "RECURRING_FIXED_TIME";
287
+ ZoomMeetingType[ZoomMeetingType["SCREEN_SHARE_ONLY"] = 10] = "SCREEN_SHARE_ONLY";
1729
288
  })(exports.ZoomMeetingType || (exports.ZoomMeetingType = {}));
1730
289
  exports.ZoomRecurrenceType = void 0;
1731
290
  (function (ZoomRecurrenceType) {
1732
- ZoomRecurrenceType[ZoomRecurrenceType["DAILY"] = 1] = "DAILY";
1733
- ZoomRecurrenceType[ZoomRecurrenceType["WEEKLY"] = 2] = "WEEKLY";
1734
- ZoomRecurrenceType[ZoomRecurrenceType["MONTHLY"] = 3] = "MONTHLY";
291
+ ZoomRecurrenceType[ZoomRecurrenceType["DAILY"] = 1] = "DAILY";
292
+ ZoomRecurrenceType[ZoomRecurrenceType["WEEKLY"] = 2] = "WEEKLY";
293
+ ZoomRecurrenceType[ZoomRecurrenceType["MONTHLY"] = 3] = "MONTHLY";
1735
294
  })(exports.ZoomRecurrenceType || (exports.ZoomRecurrenceType = {}));
1736
295
  exports.ZoomMonthlyWeek = void 0;
1737
296
  (function (ZoomMonthlyWeek) {
1738
- ZoomMonthlyWeek[ZoomMonthlyWeek["LAST_WEEK"] = -1] = "LAST_WEEK";
1739
- ZoomMonthlyWeek[ZoomMonthlyWeek["FIRST_WEEK"] = 1] = "FIRST_WEEK";
1740
- ZoomMonthlyWeek[ZoomMonthlyWeek["SECOND_WEEK"] = 2] = "SECOND_WEEK";
1741
- ZoomMonthlyWeek[ZoomMonthlyWeek["THIRD_WEEK"] = 3] = "THIRD_WEEK";
1742
- ZoomMonthlyWeek[ZoomMonthlyWeek["FOURTH_WEEK"] = 4] = "FOURTH_WEEK";
297
+ ZoomMonthlyWeek[ZoomMonthlyWeek["LAST_WEEK"] = -1] = "LAST_WEEK";
298
+ ZoomMonthlyWeek[ZoomMonthlyWeek["FIRST_WEEK"] = 1] = "FIRST_WEEK";
299
+ ZoomMonthlyWeek[ZoomMonthlyWeek["SECOND_WEEK"] = 2] = "SECOND_WEEK";
300
+ ZoomMonthlyWeek[ZoomMonthlyWeek["THIRD_WEEK"] = 3] = "THIRD_WEEK";
301
+ ZoomMonthlyWeek[ZoomMonthlyWeek["FOURTH_WEEK"] = 4] = "FOURTH_WEEK";
1743
302
  })(exports.ZoomMonthlyWeek || (exports.ZoomMonthlyWeek = {}));
1744
303
  exports.ZoomMonthlyWeekDay = void 0;
1745
304
  (function (ZoomMonthlyWeekDay) {
1746
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SUNDAY"] = 1] = "SUNDAY";
1747
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["MONDAY"] = 2] = "MONDAY";
1748
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["TUESDAY"] = 3] = "TUESDAY";
1749
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["WEDNESDAY"] = 4] = "WEDNESDAY";
1750
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["THURSDAY"] = 5] = "THURSDAY";
1751
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["FRIDAY"] = 6] = "FRIDAY";
1752
- ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SATURDAY"] = 7] = "SATURDAY";
305
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SUNDAY"] = 1] = "SUNDAY";
306
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["MONDAY"] = 2] = "MONDAY";
307
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["TUESDAY"] = 3] = "TUESDAY";
308
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["WEDNESDAY"] = 4] = "WEDNESDAY";
309
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["THURSDAY"] = 5] = "THURSDAY";
310
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["FRIDAY"] = 6] = "FRIDAY";
311
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SATURDAY"] = 7] = "SATURDAY";
1753
312
  })(exports.ZoomMonthlyWeekDay || (exports.ZoomMonthlyWeekDay = {}));
1754
313
  exports.ZoomApprovalType = void 0;
1755
314
  (function (ZoomApprovalType) {
1756
- /**
1757
- * Automatically approve.
1758
- */
1759
- ZoomApprovalType[ZoomApprovalType["AUTOMATICALLY_APPROVE"] = 0] = "AUTOMATICALLY_APPROVE";
1760
- /**
1761
- * Manually approve.
1762
- */
1763
- ZoomApprovalType[ZoomApprovalType["MANUALLY_APPROVE"] = 1] = "MANUALLY_APPROVE";
1764
- /**
1765
- * No registration required.
1766
- */
1767
- ZoomApprovalType[ZoomApprovalType["NO_REGISTRATION_REQUIRED"] = 2] = "NO_REGISTRATION_REQUIRED";
315
+ /**
316
+ * Automatically approve.
317
+ */
318
+ ZoomApprovalType[ZoomApprovalType["AUTOMATICALLY_APPROVE"] = 0] = "AUTOMATICALLY_APPROVE";
319
+ /**
320
+ * Manually approve.
321
+ */
322
+ ZoomApprovalType[ZoomApprovalType["MANUALLY_APPROVE"] = 1] = "MANUALLY_APPROVE";
323
+ /**
324
+ * No registration required.
325
+ */
326
+ ZoomApprovalType[ZoomApprovalType["NO_REGISTRATION_REQUIRED"] = 2] = "NO_REGISTRATION_REQUIRED";
1768
327
  })(exports.ZoomApprovalType || (exports.ZoomApprovalType = {}));
1769
328
  exports.ZoomRegistrationType = void 0;
1770
329
  (function (ZoomRegistrationType) {
1771
- /**
1772
- * Attendees register once and can attend any meeting occurrence.
1773
- */
1774
- ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_ATTEND_ANY"] = 1] = "REGISTER_ONCE_ATTEND_ANY";
1775
- /**
1776
- * Attendees must register for each meeting occurrence.
1777
- */
1778
- ZoomRegistrationType[ZoomRegistrationType["REGISTER_FOR_EACH_OCCURRENCE"] = 2] = "REGISTER_FOR_EACH_OCCURRENCE";
1779
- /**
1780
- * Attendees register once and can select one or more meeting occurrences to attend.
1781
- */
1782
- ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_CHOOSE_OCCURRENCES"] = 3] = "REGISTER_ONCE_CHOOSE_OCCURRENCES";
330
+ /**
331
+ * Attendees register once and can attend any meeting occurrence.
332
+ */
333
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_ATTEND_ANY"] = 1] = "REGISTER_ONCE_ATTEND_ANY";
334
+ /**
335
+ * Attendees must register for each meeting occurrence.
336
+ */
337
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_FOR_EACH_OCCURRENCE"] = 2] = "REGISTER_FOR_EACH_OCCURRENCE";
338
+ /**
339
+ * Attendees register once and can select one or more meeting occurrences to attend.
340
+ */
341
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_CHOOSE_OCCURRENCES"] = 3] = "REGISTER_ONCE_CHOOSE_OCCURRENCES";
1783
342
  })(exports.ZoomRegistrationType || (exports.ZoomRegistrationType = {}));
1784
343
 
1785
344
  /**
@@ -1789,7 +348,7 @@ exports.ZoomRegistrationType = void 0;
1789
348
  * @returns
1790
349
  */
1791
350
  function getUser(context) {
1792
- return input => context.fetchJson(`/users/${input.userId}`, 'GET');
351
+ return (input) => context.fetchJson(`/users/${input.userId}`, 'GET');
1793
352
  }
1794
353
  /**
1795
354
  * https://developers.zoom.us/docs/api/users/#tag/users/GET/users
@@ -1798,40 +357,40 @@ function getUser(context) {
1798
357
  * @returns
1799
358
  */
1800
359
  function listUsers(context) {
1801
- return input => context.fetchJson(`/users?${fetch.makeUrlSearchParams(input)}`, 'GET').then(mapToZoomPageResult('users'));
360
+ return (input) => context.fetchJson(`/users?${fetch.makeUrlSearchParams(input)}`, 'GET').then(mapToZoomPageResult('users'));
1802
361
  }
1803
362
  function listUsersPageFactory(context) {
1804
- return zoomFetchPageFactory(listUsers(context));
363
+ return zoomFetchPageFactory(listUsers(context));
1805
364
  }
1806
365
 
1807
366
  exports.ZoomUserType = void 0;
1808
367
  (function (ZoomUserType) {
1809
- ZoomUserType[ZoomUserType["Basic"] = 1] = "Basic";
1810
- ZoomUserType[ZoomUserType["Licensed"] = 2] = "Licensed";
1811
- ZoomUserType[ZoomUserType["Unassigned"] = 4] = "Unassigned";
1812
- ZoomUserType[ZoomUserType["None"] = 99] = "None";
368
+ ZoomUserType[ZoomUserType["Basic"] = 1] = "Basic";
369
+ ZoomUserType[ZoomUserType["Licensed"] = 2] = "Licensed";
370
+ ZoomUserType[ZoomUserType["Unassigned"] = 4] = "Unassigned";
371
+ ZoomUserType[ZoomUserType["None"] = 99] = "None";
1813
372
  })(exports.ZoomUserType || (exports.ZoomUserType = {}));
1814
373
 
1815
374
  // MARK: Parser
1816
375
  const logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
1817
376
  async function parseZoomApiError(responseError) {
1818
- const data = await responseError.response.json().catch(x => undefined);
1819
- let result;
1820
- if (data) {
1821
- result = parseZoomApiServerErrorResponseData(data, responseError);
1822
- }
1823
- return result;
377
+ const data = await responseError.response.json().catch((x) => undefined);
378
+ let result;
379
+ if (data) {
380
+ result = parseZoomApiServerErrorResponseData(data, responseError);
381
+ }
382
+ return result;
1824
383
  }
1825
384
  function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
1826
- let result;
1827
- if (zoomServerError) {
1828
- switch (zoomServerError.code) {
1829
- default:
1830
- result = parseZoomServerErrorData(zoomServerError, responseError);
1831
- break;
385
+ let result;
386
+ if (zoomServerError) {
387
+ switch (zoomServerError.code) {
388
+ default:
389
+ result = parseZoomServerErrorData(zoomServerError, responseError);
390
+ break;
391
+ }
1832
392
  }
1833
- }
1834
- return result;
393
+ return result;
1835
394
  }
1836
395
  const handleZoomErrorFetch = handleZoomErrorFetchFactory(parseZoomApiError, logZoomErrorToConsole);
1837
396
 
@@ -1844,46 +403,46 @@ const ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE = 'invalid_grant';
1844
403
  * Thrown if the call to the Zoom API creating an access token using a refresh token fails.
1845
404
  */
1846
405
  class ZoomOAuthAccessTokenError extends fetch.FetchRequestFactoryError {
1847
- constructor(errorCode) {
1848
- super(`ZoomOAuthAccessTokenError: ${errorCode}`);
1849
- this.errorCode = void 0;
1850
- this.errorCode = errorCode;
1851
- }
406
+ errorCode;
407
+ constructor(errorCode) {
408
+ super(`ZoomOAuthAccessTokenError: ${errorCode}`);
409
+ this.errorCode = errorCode;
410
+ }
1852
411
  }
1853
412
  /**
1854
413
  * Thrown if a valid ZoomAccessToken cannot be retrieved successfully.
1855
414
  */
1856
415
  class ZoomOAuthAuthFailureError extends fetch.FetchRequestFactoryError {
1857
- constructor(reason) {
1858
- super(`Failed to retrieve proper authentication for the API call. Reason: ${reason}`);
1859
- this.reason = void 0;
1860
- this.reason = reason;
1861
- }
416
+ reason;
417
+ constructor(reason) {
418
+ super(`Failed to retrieve proper authentication for the API call. Reason: ${reason}`);
419
+ this.reason = reason;
420
+ }
1862
421
  }
1863
422
  const logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
1864
423
  async function parseZoomOAuthError(responseError) {
1865
- const data = await responseError.response.json().catch(x => undefined);
1866
- let result;
1867
- if (data) {
1868
- result = parseZoomOAuthServerErrorResponseData(data, responseError);
1869
- }
1870
- return result;
424
+ const data = await responseError.response.json().catch((x) => undefined);
425
+ let result;
426
+ if (data) {
427
+ result = parseZoomOAuthServerErrorResponseData(data, responseError);
428
+ }
429
+ return result;
1871
430
  }
1872
431
  function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
1873
- let result;
1874
- if (zoomServerError) {
1875
- const potentialErrorStringCode = zoomServerError.error;
1876
- const errorCode = potentialErrorStringCode ?? zoomServerError.code;
1877
- switch (errorCode) {
1878
- case ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE:
1879
- result = new ZoomOAuthAccessTokenError(errorCode);
1880
- break;
1881
- default:
1882
- result = parseZoomServerErrorData(zoomServerError, responseError);
1883
- break;
432
+ let result;
433
+ if (zoomServerError) {
434
+ const potentialErrorStringCode = zoomServerError.error;
435
+ const errorCode = potentialErrorStringCode ?? zoomServerError.code;
436
+ switch (errorCode) {
437
+ case ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE:
438
+ result = new ZoomOAuthAccessTokenError(errorCode);
439
+ break;
440
+ default:
441
+ result = parseZoomServerErrorData(zoomServerError, responseError);
442
+ break;
443
+ }
1884
444
  }
1885
- }
1886
- return result;
445
+ return result;
1887
446
  }
1888
447
  const handleZoomOAuthErrorFetch = handleZoomErrorFetchFactory(parseZoomOAuthError, logZoomOAuthErrorToConsole);
1889
448
 
@@ -1891,76 +450,72 @@ const handleZoomOAuthErrorFetch = handleZoomErrorFetchFactory(parseZoomOAuthErro
1891
450
  * Generates a new ZoomAccessTokenStringFactory.
1892
451
  */
1893
452
  function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
1894
- return async () => {
1895
- const token = await zoomAccessTokenFactory();
1896
- if (!token?.accessToken) {
1897
- throw new ZoomOAuthAuthFailureError();
1898
- }
1899
- return token.accessToken;
1900
- };
453
+ return async () => {
454
+ const token = await zoomAccessTokenFactory();
455
+ if (!token?.accessToken) {
456
+ throw new ZoomOAuthAuthFailureError();
457
+ }
458
+ return token.accessToken;
459
+ };
1901
460
  }
1902
461
 
1903
- const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = headers => {
1904
- console.warn(`zoomRateLimitedFetchHandler(): Too many requests made. The limit is ${headers.limit} requests per reset period. RetryAt is set for ${headers.retryAfterAt}.`);
462
+ const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = (headers) => {
463
+ console.warn(`zoomRateLimitedFetchHandler(): Too many requests made. The limit is ${headers.limit} requests per reset period. RetryAt is set for ${headers.retryAfterAt}.`);
1905
464
  };
1906
465
  function zoomRateLimitedFetchHandler(config) {
1907
- const onTooManyRequests = config?.onTooManyRequests !== false ? config?.onTooManyRequests ?? DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION : undefined;
1908
- const defaultLimit = config?.maxRateLimit ?? DEFAULT_ZOOM_API_RATE_LIMIT;
1909
- const defaultResetPeriod = config?.resetPeriod ?? DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
1910
- function configForLimit(limit, resetAt) {
1911
- return {
1912
- limit: defaultLimit,
1913
- startLimitAt: 2,
1914
- cooldownRate: 1,
1915
- exponentRate: 1.2,
1916
- maxWaitTime: util.MS_IN_SECOND * 5,
1917
- resetPeriod: defaultResetPeriod,
1918
- resetAt
1919
- };
1920
- }
1921
- const defaultConfig = configForLimit();
1922
- const rateLimiter = util.resetPeriodPromiseRateLimiter(defaultConfig);
1923
- return fetch.rateLimitedFetchHandler({
1924
- rateLimiter,
1925
- updateWithResponse: function (response, fetchResponseError) {
1926
- const hasLimitHeader = response.headers.has(ZOOM_RATE_LIMIT_REMAINING_HEADER);
1927
- let shouldRetry = false;
1928
- // let enabled = false; // rate limiter should not be turned off
1929
- if (hasLimitHeader) {
1930
- const headerDetails = zoomRateLimitHeaderDetails(response.headers);
1931
- if (headerDetails) {
1932
- const {
1933
- type,
1934
- limit,
1935
- retryAfterAt,
1936
- remaining
1937
- } = headerDetails;
1938
- if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
1939
- // For simple query-per-second rate limits, just schedule a retry
1940
- if (type === 'QPS') {
1941
- shouldRetry = true;
1942
- try {
1943
- onTooManyRequests?.(headerDetails, response, fetchResponseError);
1944
- } catch (e) {}
1945
- }
1946
- }
1947
- // NOTE: typically it seems like these headers are not available usually.
1948
- // There is a daily limit for message requests
1949
- if (limit != null && retryAfterAt != null && remaining != null) {
1950
- if (limit !== defaultLimit) {
1951
- const newConfig = configForLimit(limit, retryAfterAt);
1952
- rateLimiter.setConfig(newConfig, false);
466
+ const onTooManyRequests = config?.onTooManyRequests !== false ? (config?.onTooManyRequests ?? DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION) : undefined;
467
+ const defaultLimit = config?.maxRateLimit ?? DEFAULT_ZOOM_API_RATE_LIMIT;
468
+ const defaultResetPeriod = config?.resetPeriod ?? DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
469
+ function configForLimit(limit, resetAt) {
470
+ return {
471
+ limit: defaultLimit,
472
+ startLimitAt: 2,
473
+ cooldownRate: 1,
474
+ exponentRate: 1.2,
475
+ maxWaitTime: util.MS_IN_SECOND * 5,
476
+ resetPeriod: defaultResetPeriod,
477
+ resetAt
478
+ };
479
+ }
480
+ const defaultConfig = configForLimit();
481
+ const rateLimiter = util.resetPeriodPromiseRateLimiter(defaultConfig);
482
+ return fetch.rateLimitedFetchHandler({
483
+ rateLimiter,
484
+ updateWithResponse: function (response, fetchResponseError) {
485
+ const hasLimitHeader = response.headers.has(ZOOM_RATE_LIMIT_REMAINING_HEADER);
486
+ let shouldRetry = false;
487
+ // let enabled = false; // rate limiter should not be turned off
488
+ if (hasLimitHeader) {
489
+ const headerDetails = zoomRateLimitHeaderDetails(response.headers);
490
+ if (headerDetails) {
491
+ const { type, limit, retryAfterAt, remaining } = headerDetails;
492
+ if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
493
+ // For simple query-per-second rate limits, just schedule a retry
494
+ if (type === 'QPS') {
495
+ shouldRetry = true;
496
+ try {
497
+ onTooManyRequests?.(headerDetails, response, fetchResponseError);
498
+ }
499
+ catch (e) { }
500
+ }
501
+ }
502
+ // NOTE: typically it seems like these headers are not available usually.
503
+ // There is a daily limit for message requests
504
+ if (limit != null && retryAfterAt != null && remaining != null) {
505
+ if (limit !== defaultLimit) {
506
+ const newConfig = configForLimit(limit, retryAfterAt);
507
+ rateLimiter.setConfig(newConfig, false);
508
+ }
509
+ rateLimiter.setRemainingLimit(remaining);
510
+ rateLimiter.setNextResetAt(retryAfterAt);
511
+ // enabled = true;
512
+ }
513
+ }
1953
514
  }
1954
- rateLimiter.setRemainingLimit(remaining);
1955
- rateLimiter.setNextResetAt(retryAfterAt);
1956
- // enabled = true;
1957
- }
515
+ // rateLimiter.setEnabled(enabled);
516
+ return shouldRetry;
1958
517
  }
1959
- }
1960
- // rateLimiter.setEnabled(enabled);
1961
- return shouldRetry;
1962
- }
1963
- });
518
+ });
1964
519
  }
1965
520
 
1966
521
  /**
@@ -1969,76 +524,69 @@ function zoomRateLimitedFetchHandler(config) {
1969
524
  const ZOOM_API_URL = 'https://api.zoom.us/v2';
1970
525
 
1971
526
  function zoomFactory(factoryConfig) {
1972
- const {
1973
- oauthContext
1974
- } = factoryConfig;
1975
- const serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
1976
- const fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
1977
- const {
1978
- logZoomServerErrorFunction,
1979
- fetchFactory = input => fetch.fetchApiFetchService.makeFetch({
1980
- baseUrl: ZOOM_API_URL,
1981
- baseRequest: async () => ({
1982
- headers: {
1983
- 'Content-Type': 'application/json',
1984
- Authorization: `Bearer ${await input.zoomAccessTokenStringFactory()}`
1985
- }
1986
- }),
1987
- fetchHandler,
1988
- timeout: 20 * 1000,
1989
- // 20 second timeout
1990
- requireOkResponse: true,
1991
- // enforce ok response
1992
- useTimeout: true // use timeout
1993
- })
1994
- } = factoryConfig;
1995
- return config => {
1996
- const baseFetch = fetchFactory({
1997
- zoomAccessTokenStringFactory: serverAccessTokenStringFactory
1998
- });
1999
- const serverFetch = handleZoomErrorFetch(baseFetch, logZoomServerErrorFunction);
2000
- const serverFetchJson = fetch.fetchJsonFunction(serverFetch, {
2001
- handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
2002
- });
2003
- // MARK: Make User Context
2004
- const makeUserContext = input => {
2005
- const userAccessTokenFactory = oauthContext.makeUserAccessTokenFactory({
2006
- refreshToken: input.refreshToken,
2007
- userAccessTokenCache: input.accessTokenCache
2008
- });
2009
- const userAccessTokenStringFactory = zoomAccessTokenStringFactory(userAccessTokenFactory);
2010
- const userFetch = fetchFactory({
2011
- zoomAccessTokenStringFactory: userAccessTokenStringFactory
2012
- });
2013
- const userFetchJson = fetch.fetchJsonFunction(userFetch, {
2014
- handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
2015
- });
2016
- const result = {
2017
- zoomServerContext: zoomContext,
2018
- type: 'user',
2019
- fetch: userFetch,
2020
- fetchJson: userFetchJson,
2021
- userFetch,
2022
- userFetchJson,
2023
- zoomRateLimiter: fetchHandler._rateLimiter
2024
- };
2025
- return result;
2026
- };
2027
- const zoomContext = {
2028
- type: 'server',
2029
- fetch: serverFetch,
2030
- fetchJson: serverFetchJson,
2031
- serverFetch,
2032
- serverFetchJson,
2033
- makeUserContext,
2034
- config,
2035
- zoomRateLimiter: fetchHandler._rateLimiter
2036
- };
2037
- const zoom = {
2038
- zoomServerContext: zoomContext
527
+ const { oauthContext } = factoryConfig;
528
+ const serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
529
+ const fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
530
+ const { logZoomServerErrorFunction, fetchFactory = (input) => fetch.fetchApiFetchService.makeFetch({
531
+ baseUrl: ZOOM_API_URL,
532
+ baseRequest: async () => ({
533
+ headers: {
534
+ 'Content-Type': 'application/json',
535
+ Authorization: `Bearer ${await input.zoomAccessTokenStringFactory()}`
536
+ }
537
+ }),
538
+ fetchHandler,
539
+ timeout: 20 * 1000, // 20 second timeout
540
+ requireOkResponse: true, // enforce ok response
541
+ useTimeout: true // use timeout
542
+ }) } = factoryConfig;
543
+ return (config) => {
544
+ const baseFetch = fetchFactory({
545
+ zoomAccessTokenStringFactory: serverAccessTokenStringFactory
546
+ });
547
+ const serverFetch = handleZoomErrorFetch(baseFetch, logZoomServerErrorFunction);
548
+ const serverFetchJson = fetch.fetchJsonFunction(serverFetch, {
549
+ handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
550
+ });
551
+ // MARK: Make User Context
552
+ const makeUserContext = (input) => {
553
+ const userAccessTokenFactory = oauthContext.makeUserAccessTokenFactory({
554
+ refreshToken: input.refreshToken,
555
+ userAccessTokenCache: input.accessTokenCache
556
+ });
557
+ const userAccessTokenStringFactory = zoomAccessTokenStringFactory(userAccessTokenFactory);
558
+ const userFetch = fetchFactory({
559
+ zoomAccessTokenStringFactory: userAccessTokenStringFactory
560
+ });
561
+ const userFetchJson = fetch.fetchJsonFunction(userFetch, {
562
+ handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
563
+ });
564
+ const result = {
565
+ zoomServerContext: zoomContext,
566
+ type: 'user',
567
+ fetch: userFetch,
568
+ fetchJson: userFetchJson,
569
+ userFetch,
570
+ userFetchJson,
571
+ zoomRateLimiter: fetchHandler._rateLimiter
572
+ };
573
+ return result;
574
+ };
575
+ const zoomContext = {
576
+ type: 'server',
577
+ fetch: serverFetch,
578
+ fetchJson: serverFetchJson,
579
+ serverFetch,
580
+ serverFetchJson,
581
+ makeUserContext,
582
+ config,
583
+ zoomRateLimiter: fetchHandler._rateLimiter
584
+ };
585
+ const zoom = {
586
+ zoomServerContext: zoomContext
587
+ };
588
+ return zoom;
2039
589
  };
2040
- return zoom;
2041
- };
2042
590
  }
2043
591
 
2044
592
  /**
@@ -2048,9 +596,9 @@ function zoomFactory(factoryConfig) {
2048
596
  * @returns
2049
597
  */
2050
598
  function serverAccessToken(context) {
2051
- return input => {
2052
- return context.fetchJson(`/token?grant_type=account_credentials&account_id=${input?.accountId ?? context.config.accountId}`, zoomOAuthApiFetchJsonInput(context, input));
2053
- };
599
+ return (input) => {
600
+ return context.fetchJson(`/token?grant_type=account_credentials&account_id=${input?.accountId ?? context.config.accountId}`, zoomOAuthApiFetchJsonInput(context, input));
601
+ };
2054
602
  }
2055
603
  /**
2056
604
  * Retrieves a new AccessToken for a user using their refresh token.
@@ -2059,27 +607,27 @@ function serverAccessToken(context) {
2059
607
  * @returns
2060
608
  */
2061
609
  function userAccessToken(context) {
2062
- return input => {
2063
- const refreshToken = input.refreshToken;
2064
- return context.fetchJson(`/token?grant_type=refresh_token&refresh_token=${refreshToken}`, zoomOAuthApiFetchJsonInput(context, input));
2065
- };
610
+ return (input) => {
611
+ const refreshToken = input.refreshToken;
612
+ return context.fetchJson(`/token?grant_type=refresh_token&refresh_token=${refreshToken}`, zoomOAuthApiFetchJsonInput(context, input));
613
+ };
2066
614
  }
2067
615
  function zoomOAuthApiFetchJsonInput(context, input) {
2068
- const clientId = input?.client?.clientId ?? context.config.clientId;
2069
- const clientSecret = input?.client?.clientSecret ?? context.config.clientSecret;
2070
- const fetchJsonInput = {
2071
- headers: {
2072
- Authorization: zoomOAuthServerBasicAuthorizationHeaderValue({
2073
- clientId,
2074
- clientSecret
2075
- })
2076
- },
2077
- method: 'POST'
2078
- };
2079
- return fetchJsonInput;
616
+ const clientId = input?.client?.clientId ?? context.config.clientId;
617
+ const clientSecret = input?.client?.clientSecret ?? context.config.clientSecret;
618
+ const fetchJsonInput = {
619
+ headers: {
620
+ Authorization: zoomOAuthServerBasicAuthorizationHeaderValue({
621
+ clientId,
622
+ clientSecret
623
+ })
624
+ },
625
+ method: 'POST'
626
+ };
627
+ return fetchJsonInput;
2080
628
  }
2081
629
  function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
2082
- return `Basic ${Buffer.from(`${input.clientId}:${input.clientSecret}`).toString('base64')}`;
630
+ return `Basic ${Buffer.from(`${input.clientId}:${input.clientSecret}`).toString('base64')}`;
2083
631
  }
2084
632
 
2085
633
  /**
@@ -2088,85 +636,77 @@ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
2088
636
  const ZOOM_OAUTH_API_URL = 'https://zoom.us/oauth';
2089
637
 
2090
638
  function zoomOAuthFactory(factoryConfig) {
2091
- const fetchHandler = zoomRateLimitedFetchHandler();
2092
- const {
2093
- logZoomServerErrorFunction,
2094
- fetchFactory = _ => fetch.fetchApiFetchService.makeFetch({
2095
- baseUrl: ZOOM_OAUTH_API_URL,
2096
- baseRequest: {
2097
- headers: {
2098
- 'Content-Type': 'application/json'
639
+ const fetchHandler = zoomRateLimitedFetchHandler();
640
+ const { logZoomServerErrorFunction, fetchFactory = (_) => fetch.fetchApiFetchService.makeFetch({
641
+ baseUrl: ZOOM_OAUTH_API_URL,
642
+ baseRequest: {
643
+ headers: {
644
+ 'Content-Type': 'application/json'
645
+ }
646
+ },
647
+ fetchHandler,
648
+ timeout: 20 * 1000, // 20 second timeout
649
+ requireOkResponse: true, // enforce ok response
650
+ useTimeout: true // use timeout
651
+ }) } = factoryConfig;
652
+ return (config) => {
653
+ if (!config.clientId) {
654
+ throw new Error('ZoomOAuthConfig missing clientId.');
2099
655
  }
2100
- },
2101
- fetchHandler,
2102
- timeout: 20 * 1000,
2103
- // 20 second timeout
2104
- requireOkResponse: true,
2105
- // enforce ok response
2106
- useTimeout: true // use timeout
2107
- })
2108
- } = factoryConfig;
2109
- return config => {
2110
- if (!config.clientId) {
2111
- throw new Error('ZoomOAuthConfig missing clientId.');
2112
- } else if (!config.clientSecret) {
2113
- throw new Error('ZoomOAuthConfig missing clientSecret.');
2114
- } else if (!config.accountId) {
2115
- throw new Error('ZoomOAuthConfig missing accountId.');
2116
- }
2117
- const baseFetch = fetchFactory();
2118
- const fetch$1 = handleZoomOAuthErrorFetch(baseFetch, logZoomServerErrorFunction);
2119
- const fetchJson = fetch.fetchJsonFunction(fetch$1, {
2120
- handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
2121
- });
2122
- function accessTokenFromTokenResponse(result) {
2123
- const createdAt = new Date().getTime();
2124
- const {
2125
- access_token,
2126
- api_url,
2127
- scope,
2128
- expires_in
2129
- } = result;
2130
- const accessToken = {
2131
- accessToken: access_token,
2132
- apiDomain: api_url,
2133
- expiresIn: expires_in,
2134
- expiresAt: new Date(createdAt + expires_in * util.MS_IN_SECOND),
2135
- scope
2136
- };
2137
- return accessToken;
2138
- }
2139
- const tokenRefresher = async () => {
2140
- const accessToken = await serverAccessToken(oauthContext)();
2141
- return accessTokenFromTokenResponse(accessToken);
2142
- };
2143
- const loadAccessToken = zoomOAuthZoomAccessTokenFactory({
2144
- tokenRefresher,
2145
- accessTokenCache: config.accessTokenCache
2146
- });
2147
- // User Access Token
2148
- const makeUserAccessTokenFactory = input => {
2149
- const userTokenRefresher = async () => {
2150
- const accessToken = await userAccessToken(oauthContext)(input);
2151
- return accessTokenFromTokenResponse(accessToken);
2152
- };
2153
- return zoomOAuthZoomAccessTokenFactory({
2154
- tokenRefresher: userTokenRefresher,
2155
- accessTokenCache: input.userAccessTokenCache
2156
- });
2157
- };
2158
- const oauthContext = {
2159
- fetch: fetch$1,
2160
- fetchJson,
2161
- loadAccessToken,
2162
- makeUserAccessTokenFactory,
2163
- config
2164
- };
2165
- const zoomOAuth = {
2166
- oauthContext
656
+ else if (!config.clientSecret) {
657
+ throw new Error('ZoomOAuthConfig missing clientSecret.');
658
+ }
659
+ else if (!config.accountId) {
660
+ throw new Error('ZoomOAuthConfig missing accountId.');
661
+ }
662
+ const baseFetch = fetchFactory();
663
+ const fetch$1 = handleZoomOAuthErrorFetch(baseFetch, logZoomServerErrorFunction);
664
+ const fetchJson = fetch.fetchJsonFunction(fetch$1, {
665
+ handleFetchJsonParseErrorFunction: fetch.returnNullHandleFetchJsonParseErrorFunction
666
+ });
667
+ function accessTokenFromTokenResponse(result) {
668
+ const createdAt = new Date().getTime();
669
+ const { access_token, api_url, scope, expires_in } = result;
670
+ const accessToken = {
671
+ accessToken: access_token,
672
+ apiDomain: api_url,
673
+ expiresIn: expires_in,
674
+ expiresAt: new Date(createdAt + expires_in * util.MS_IN_SECOND),
675
+ scope
676
+ };
677
+ return accessToken;
678
+ }
679
+ const tokenRefresher = async () => {
680
+ const accessToken = await serverAccessToken(oauthContext)();
681
+ return accessTokenFromTokenResponse(accessToken);
682
+ };
683
+ const loadAccessToken = zoomOAuthZoomAccessTokenFactory({
684
+ tokenRefresher,
685
+ accessTokenCache: config.accessTokenCache
686
+ });
687
+ // User Access Token
688
+ const makeUserAccessTokenFactory = (input) => {
689
+ const userTokenRefresher = async () => {
690
+ const accessToken = await userAccessToken(oauthContext)(input);
691
+ return accessTokenFromTokenResponse(accessToken);
692
+ };
693
+ return zoomOAuthZoomAccessTokenFactory({
694
+ tokenRefresher: userTokenRefresher,
695
+ accessTokenCache: input.userAccessTokenCache
696
+ });
697
+ };
698
+ const oauthContext = {
699
+ fetch: fetch$1,
700
+ fetchJson,
701
+ loadAccessToken,
702
+ makeUserAccessTokenFactory,
703
+ config
704
+ };
705
+ const zoomOAuth = {
706
+ oauthContext
707
+ };
708
+ return zoomOAuth;
2167
709
  };
2168
- return zoomOAuth;
2169
- };
2170
710
  }
2171
711
  /**
2172
712
  * Creates a ZoomOAuthZoomAccessTokenFactoryConfig
@@ -2175,49 +715,47 @@ function zoomOAuthFactory(factoryConfig) {
2175
715
  * @returns
2176
716
  */
2177
717
  function zoomOAuthZoomAccessTokenFactory(config) {
2178
- const {
2179
- tokenRefresher,
2180
- accessTokenCache,
2181
- tokenExpirationBuffer: inputTokenExpirationBuffer
2182
- } = config;
2183
- const tokenExpirationBuffer = inputTokenExpirationBuffer ?? util.MS_IN_MINUTE;
2184
- /**
2185
- * Caches the token internally here until it expires.
2186
- */
2187
- let currentToken = null;
2188
- return async () => {
2189
- // load from cache
2190
- if (!currentToken) {
2191
- const cachedToken = await accessTokenCache?.loadCachedToken();
2192
- if (cachedToken) {
2193
- currentToken = cachedToken;
2194
- }
2195
- }
2196
- // check expiration
2197
- if (currentToken != null) {
2198
- const isExpired = new Date().getTime() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
2199
- if (isExpired) {
2200
- currentToken = null;
2201
- }
2202
- }
2203
- // load from source
2204
- if (!currentToken) {
2205
- try {
2206
- currentToken = await tokenRefresher();
2207
- } catch (e) {
2208
- console.error(`zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: `, e);
2209
- throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
2210
- }
2211
- if (currentToken) {
2212
- try {
2213
- await accessTokenCache?.updateCachedToken(currentToken);
2214
- } catch (e) {
2215
- // do nothing
718
+ const { tokenRefresher, accessTokenCache, tokenExpirationBuffer: inputTokenExpirationBuffer } = config;
719
+ const tokenExpirationBuffer = inputTokenExpirationBuffer ?? util.MS_IN_MINUTE;
720
+ /**
721
+ * Caches the token internally here until it expires.
722
+ */
723
+ let currentToken = null;
724
+ return async () => {
725
+ // load from cache
726
+ if (!currentToken) {
727
+ const cachedToken = await accessTokenCache?.loadCachedToken();
728
+ if (cachedToken) {
729
+ currentToken = cachedToken;
730
+ }
2216
731
  }
2217
- }
2218
- }
2219
- return currentToken;
2220
- };
732
+ // check expiration
733
+ if (currentToken != null) {
734
+ const isExpired = new Date().getTime() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
735
+ if (isExpired) {
736
+ currentToken = null;
737
+ }
738
+ }
739
+ // load from source
740
+ if (!currentToken) {
741
+ try {
742
+ currentToken = await tokenRefresher();
743
+ }
744
+ catch (e) {
745
+ console.error(`zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: `, e);
746
+ throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
747
+ }
748
+ if (currentToken) {
749
+ try {
750
+ await accessTokenCache?.updateCachedToken(currentToken);
751
+ }
752
+ catch (e) {
753
+ // do nothing
754
+ }
755
+ }
756
+ }
757
+ return currentToken;
758
+ };
2221
759
  }
2222
760
 
2223
761
  exports.DEFAULT_ZOOM_API_RATE_LIMIT = DEFAULT_ZOOM_API_RATE_LIMIT;