@dereekb/zoom 13.4.0 → 13.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +152 -58
- package/index.esm.js +152 -59
- package/nestjs/index.cjs.js +60 -35
- package/nestjs/index.esm.js +60 -35
- package/nestjs/package.json +4 -4
- package/nestjs/src/lib/oauth/oauth.config.d.ts +7 -0
- package/nestjs/src/lib/oauth/oauth.module.d.ts +8 -3
- package/nestjs/src/lib/oauth/oauth.service.d.ts +14 -3
- package/nestjs/src/lib/webhook/webhook.zoom.module.d.ts +6 -0
- package/nestjs/src/lib/webhook/webhook.zoom.type.common.d.ts +1 -1
- package/nestjs/src/lib/webhook/webhook.zoom.verify.d.ts +1 -1
- package/nestjs/src/lib/zoom/zoom.api.d.ts +1 -1
- package/nestjs/src/lib/zoom/zoom.config.d.ts +1 -1
- package/nestjs/src/lib/zoom/zoom.module.d.ts +9 -4
- package/package.json +3 -3
- package/src/lib/oauth/oauth.api.d.ts +13 -0
- package/src/lib/oauth/oauth.config.d.ts +12 -4
- package/src/lib/oauth/oauth.d.ts +7 -4
- package/src/lib/oauth/oauth.error.api.d.ts +14 -1
- package/src/lib/oauth/oauth.factory.d.ts +8 -2
- package/src/lib/zoom/zoom.api.meeting.d.ts +41 -2
- package/src/lib/zoom/zoom.api.meeting.type.d.ts +53 -18
- package/src/lib/zoom/zoom.api.user.d.ts +6 -0
- package/src/lib/zoom/zoom.api.user.type.d.ts +9 -4
- package/src/lib/zoom/zoom.config.d.ts +12 -4
- package/src/lib/zoom/zoom.error.api.d.ts +14 -1
- package/src/lib/zoom/zoom.factory.d.ts +6 -0
- package/src/lib/zoom.api.page.d.ts +3 -3
- package/src/lib/zoom.error.api.d.ts +22 -6
- package/src/lib/zoom.limit.d.ts +15 -1
package/index.cjs.js
CHANGED
|
@@ -74,9 +74,9 @@ function _object_spread_props(target, source) {
|
|
|
74
74
|
/**
|
|
75
75
|
* Creates a FetchPageFactory using the input ZoomFetchPageFetchFunction.
|
|
76
76
|
*
|
|
77
|
-
* @param fetch
|
|
78
|
-
* @param defaults
|
|
79
|
-
* @returns
|
|
77
|
+
* @param fetch - function that fetches a single page of results from the Zoom API
|
|
78
|
+
* @param defaults - optional default pagination configuration
|
|
79
|
+
* @returns a configured FetchPageFactory that handles Zoom's cursor-based pagination using `next_page_token`
|
|
80
80
|
*/ function zoomFetchPageFactory(fetch$1, defaults) {
|
|
81
81
|
return fetch.fetchPageFactory(_object_spread_props(_object_spread({}, defaults), {
|
|
82
82
|
fetch: fetch$1,
|
|
@@ -384,8 +384,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
384
384
|
/**
|
|
385
385
|
* Wraps a ConfiguredFetch to support handling errors returned by fetch.
|
|
386
386
|
*
|
|
387
|
-
* @param fetch
|
|
388
|
-
* @
|
|
387
|
+
* @param parseZoomError Function to parse fetch response errors into typed Zoom errors
|
|
388
|
+
* @param defaultLogError Default error logging function
|
|
389
|
+
* @returns A factory that wraps ConfiguredFetch with error handling
|
|
389
390
|
*/ function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
|
|
390
391
|
return function(fetch$1) {
|
|
391
392
|
var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError;
|
|
@@ -453,7 +454,12 @@ var ZOOM_RATE_LIMIT_REMAINING_HEADER = 'X-RateLimit-Remaining';
|
|
|
453
454
|
var ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = 'Retry-After';
|
|
454
455
|
var DEFAULT_ZOOM_API_RATE_LIMIT = 2;
|
|
455
456
|
var DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = util.MS_IN_SECOND;
|
|
456
|
-
|
|
457
|
+
/**
|
|
458
|
+
* Parses rate limit header details from a Zoom API response.
|
|
459
|
+
*
|
|
460
|
+
* @param headers The response headers to parse
|
|
461
|
+
* @returns Parsed rate limit details, or null if required headers are missing
|
|
462
|
+
*/ function zoomRateLimitHeaderDetails(headers) {
|
|
457
463
|
var limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
|
|
458
464
|
var remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
|
|
459
465
|
var retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
|
|
@@ -497,9 +503,9 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
497
503
|
/**
|
|
498
504
|
* Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
|
|
499
505
|
*
|
|
500
|
-
* @param
|
|
501
|
-
* @param responseError
|
|
502
|
-
* @returns
|
|
506
|
+
* @param zoomServerError The error data from the Zoom API
|
|
507
|
+
* @param responseError The original fetch response error
|
|
508
|
+
* @returns A typed ZoomServerFetchResponseError, or undefined
|
|
503
509
|
*/ function parseZoomServerErrorData(zoomServerError, responseError) {
|
|
504
510
|
var result;
|
|
505
511
|
if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
|
|
@@ -509,7 +515,7 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
509
515
|
responseError: responseError,
|
|
510
516
|
headerDetails: result.headerDetails
|
|
511
517
|
});
|
|
512
|
-
} else
|
|
518
|
+
} else {
|
|
513
519
|
switch(zoomServerError.code){
|
|
514
520
|
default:
|
|
515
521
|
result = new ZoomServerFetchResponseError(zoomServerError, responseError);
|
|
@@ -522,6 +528,9 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
522
528
|
* Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
|
|
523
529
|
*
|
|
524
530
|
* If other options are input, it merges those two options together and adds silenceError to the omitted keys.
|
|
531
|
+
*
|
|
532
|
+
* @param options Optional additional MakeUrlSearchParamsOptions to merge
|
|
533
|
+
* @returns A MakeUrlSearchParamsOptions that omits silenceError
|
|
525
534
|
*/ function omitSilenceZoomErrorKeys(options) {
|
|
526
535
|
var omitKeys = [
|
|
527
536
|
'silenceError'
|
|
@@ -537,10 +546,8 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
537
546
|
var codesSet = new Set(util.asArray(codes));
|
|
538
547
|
return function(silence) {
|
|
539
548
|
return function(reason) {
|
|
540
|
-
if (silence !== false && _instanceof(reason, ZoomServerFetchResponseError)) {
|
|
541
|
-
|
|
542
|
-
return returnFn === null || returnFn === void 0 ? void 0 : returnFn(reason);
|
|
543
|
-
}
|
|
549
|
+
if (silence !== false && _instanceof(reason, ZoomServerFetchResponseError) && codesSet.has(reason.code)) {
|
|
550
|
+
return returnFn === null || returnFn === void 0 ? void 0 : returnFn(reason);
|
|
544
551
|
}
|
|
545
552
|
throw reason;
|
|
546
553
|
};
|
|
@@ -549,6 +556,9 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
549
556
|
|
|
550
557
|
/**
|
|
551
558
|
* https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting
|
|
559
|
+
*
|
|
560
|
+
* @param context The Zoom API context
|
|
561
|
+
* @returns A function that retrieves a meeting by ID
|
|
552
562
|
*/ function getMeeting(context) {
|
|
553
563
|
return function(input) {
|
|
554
564
|
return context.fetchJson("/meetings/".concat(input.meetingId), 'GET');
|
|
@@ -556,16 +566,27 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
556
566
|
}
|
|
557
567
|
/**
|
|
558
568
|
* https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings
|
|
569
|
+
*
|
|
570
|
+
* @param context The Zoom API context
|
|
571
|
+
* @returns A function that lists meetings for a user
|
|
559
572
|
*/ function listMeetingsForUser(context) {
|
|
560
573
|
return function(input) {
|
|
561
574
|
return context.fetchJson("/users/".concat(input.user, "/meetings"), 'GET').then(mapToZoomPageResult('meetings'));
|
|
562
575
|
};
|
|
563
576
|
}
|
|
564
|
-
|
|
577
|
+
/**
|
|
578
|
+
* Creates a page factory for listing meetings for a user.
|
|
579
|
+
*
|
|
580
|
+
* @param context The Zoom API context
|
|
581
|
+
* @returns A page factory for paginated meeting listing
|
|
582
|
+
*/ function listMeetingsForUserPageFactory(context) {
|
|
565
583
|
return zoomFetchPageFactory(listMeetingsForUser(context));
|
|
566
584
|
}
|
|
567
585
|
/**
|
|
568
586
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings
|
|
587
|
+
*
|
|
588
|
+
* @param context The Zoom API context
|
|
589
|
+
* @returns A function that creates a meeting for a user
|
|
569
590
|
*/ function createMeetingForUser(context) {
|
|
570
591
|
return function(input) {
|
|
571
592
|
return context.fetchJson("/users/".concat(input.user, "/meetings"), {
|
|
@@ -576,6 +597,9 @@ function listMeetingsForUserPageFactory(context) {
|
|
|
576
597
|
}
|
|
577
598
|
/**
|
|
578
599
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/PUT/meetings/{meetingId}
|
|
600
|
+
*
|
|
601
|
+
* @param context The Zoom API context
|
|
602
|
+
* @returns A function that updates a meeting
|
|
579
603
|
*/ function updateMeeting(context) {
|
|
580
604
|
return function(input) {
|
|
581
605
|
return context.fetchJson("/meetings/".concat(input.meetingId, "?").concat(fetch.makeUrlSearchParams({
|
|
@@ -589,6 +613,9 @@ function listMeetingsForUserPageFactory(context) {
|
|
|
589
613
|
var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
590
614
|
/**
|
|
591
615
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
|
|
616
|
+
*
|
|
617
|
+
* @param context The Zoom API context
|
|
618
|
+
* @returns A function that deletes a meeting (silences 3001 "not found" errors by default)
|
|
592
619
|
*/ function deleteMeeting(context) {
|
|
593
620
|
var silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
|
|
594
621
|
return function(input) {
|
|
@@ -597,6 +624,9 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
597
624
|
}
|
|
598
625
|
/**
|
|
599
626
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}
|
|
627
|
+
*
|
|
628
|
+
* @param context The Zoom API context
|
|
629
|
+
* @returns A function that retrieves a past meeting
|
|
600
630
|
*/ function getPastMeeting(context) {
|
|
601
631
|
return function(input) {
|
|
602
632
|
return context.fetchJson("/past_meetings/".concat(input.meetingId), 'GET');
|
|
@@ -604,12 +634,20 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
604
634
|
}
|
|
605
635
|
/**
|
|
606
636
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}/participants
|
|
637
|
+
*
|
|
638
|
+
* @param context The Zoom API context
|
|
639
|
+
* @returns A function that retrieves participants from a past meeting
|
|
607
640
|
*/ function getPastMeetingParticipants(context) {
|
|
608
641
|
return function(input) {
|
|
609
642
|
return context.fetchJson("/past_meetings/".concat(input.meetingId, "/participants"), 'GET').then(mapToZoomPageResult('participants'));
|
|
610
643
|
};
|
|
611
644
|
}
|
|
612
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Creates a page factory for listing past meeting participants.
|
|
647
|
+
*
|
|
648
|
+
* @param context The Zoom API context
|
|
649
|
+
* @returns A page factory for paginated participant listing
|
|
650
|
+
*/ function getPastMeetingParticipantsPageFactory(context) {
|
|
613
651
|
return zoomFetchPageFactory(getPastMeetingParticipants(context));
|
|
614
652
|
}
|
|
615
653
|
|
|
@@ -699,7 +737,12 @@ exports.ZoomRegistrationType = void 0;
|
|
|
699
737
|
return context.fetchJson("/users?".concat(fetch.makeUrlSearchParams(input)), 'GET').then(mapToZoomPageResult('users'));
|
|
700
738
|
};
|
|
701
739
|
}
|
|
702
|
-
|
|
740
|
+
/**
|
|
741
|
+
* Creates a page factory for listing users.
|
|
742
|
+
*
|
|
743
|
+
* @param context The Zoom API context
|
|
744
|
+
* @returns A page factory for paginated user listing
|
|
745
|
+
*/ function listUsersPageFactory(context) {
|
|
703
746
|
return zoomFetchPageFactory(listUsers(context));
|
|
704
747
|
}
|
|
705
748
|
|
|
@@ -841,7 +884,12 @@ function _ts_generator$4(thisArg, body) {
|
|
|
841
884
|
}
|
|
842
885
|
// MARK: Parser
|
|
843
886
|
var logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
|
|
844
|
-
|
|
887
|
+
/**
|
|
888
|
+
* Parses a FetchResponseError into a typed Zoom API error.
|
|
889
|
+
*
|
|
890
|
+
* @param responseError The fetch response error to parse
|
|
891
|
+
* @returns The parsed error, or undefined if parsing fails
|
|
892
|
+
*/ function parseZoomApiError(responseError) {
|
|
845
893
|
return _async_to_generator$4(function() {
|
|
846
894
|
var data, result;
|
|
847
895
|
return _ts_generator$4(this, function(_state) {
|
|
@@ -849,7 +897,7 @@ function parseZoomApiError(responseError) {
|
|
|
849
897
|
case 0:
|
|
850
898
|
return [
|
|
851
899
|
4,
|
|
852
|
-
responseError.response.json().catch(function(
|
|
900
|
+
responseError.response.json().catch(function() {
|
|
853
901
|
return undefined;
|
|
854
902
|
})
|
|
855
903
|
];
|
|
@@ -866,9 +914,15 @@ function parseZoomApiError(responseError) {
|
|
|
866
914
|
});
|
|
867
915
|
})();
|
|
868
916
|
}
|
|
869
|
-
|
|
917
|
+
/**
|
|
918
|
+
* Parses a ZoomServerErrorData into a Zoom API-specific error.
|
|
919
|
+
*
|
|
920
|
+
* @param zoomServerError The raw error data from the Zoom API
|
|
921
|
+
* @param responseError The original fetch response error
|
|
922
|
+
* @returns A parsed error, or undefined if the error is unrecognized
|
|
923
|
+
*/ function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
|
|
870
924
|
var result;
|
|
871
|
-
|
|
925
|
+
{
|
|
872
926
|
switch(zoomServerError.code){
|
|
873
927
|
default:
|
|
874
928
|
result = parseZoomServerErrorData(zoomServerError, responseError);
|
|
@@ -1114,7 +1168,12 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1114
1168
|
return ZoomOAuthAuthFailureError;
|
|
1115
1169
|
}(fetch.FetchRequestFactoryError);
|
|
1116
1170
|
var logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
|
|
1117
|
-
|
|
1171
|
+
/**
|
|
1172
|
+
* Parses a FetchResponseError into a typed Zoom OAuth error.
|
|
1173
|
+
*
|
|
1174
|
+
* @param responseError The fetch response error to parse
|
|
1175
|
+
* @returns The parsed error, or undefined if parsing fails
|
|
1176
|
+
*/ function parseZoomOAuthError(responseError) {
|
|
1118
1177
|
return _async_to_generator$3(function() {
|
|
1119
1178
|
var data, result;
|
|
1120
1179
|
return _ts_generator$3(this, function(_state) {
|
|
@@ -1122,7 +1181,7 @@ function parseZoomOAuthError(responseError) {
|
|
|
1122
1181
|
case 0:
|
|
1123
1182
|
return [
|
|
1124
1183
|
4,
|
|
1125
|
-
responseError.response.json().catch(function(
|
|
1184
|
+
responseError.response.json().catch(function() {
|
|
1126
1185
|
return undefined;
|
|
1127
1186
|
})
|
|
1128
1187
|
];
|
|
@@ -1139,9 +1198,15 @@ function parseZoomOAuthError(responseError) {
|
|
|
1139
1198
|
});
|
|
1140
1199
|
})();
|
|
1141
1200
|
}
|
|
1142
|
-
|
|
1201
|
+
/**
|
|
1202
|
+
* Parses a ZoomServerErrorData into a Zoom OAuth-specific error.
|
|
1203
|
+
*
|
|
1204
|
+
* @param zoomServerError The raw error data from the Zoom API
|
|
1205
|
+
* @param responseError The original fetch response error
|
|
1206
|
+
* @returns A parsed error, or undefined if the error is unrecognized
|
|
1207
|
+
*/ function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
|
|
1143
1208
|
var result;
|
|
1144
|
-
|
|
1209
|
+
{
|
|
1145
1210
|
var potentialErrorStringCode = zoomServerError.error;
|
|
1146
1211
|
var errorCode = potentialErrorStringCode !== null && potentialErrorStringCode !== void 0 ? potentialErrorStringCode : zoomServerError.code;
|
|
1147
1212
|
switch(errorCode){
|
|
@@ -1286,7 +1351,10 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1286
1351
|
}
|
|
1287
1352
|
}
|
|
1288
1353
|
/**
|
|
1289
|
-
* Generates a new ZoomAccessTokenStringFactory.
|
|
1354
|
+
* Generates a new ZoomAccessTokenStringFactory from a ZoomAccessTokenFactory.
|
|
1355
|
+
*
|
|
1356
|
+
* @param zoomAccessTokenFactory The factory to extract the token string from
|
|
1357
|
+
* @returns A factory that returns the access token string
|
|
1290
1358
|
*/ function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
|
|
1291
1359
|
return function() {
|
|
1292
1360
|
return _async_to_generator$2(function() {
|
|
@@ -1300,7 +1368,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1300
1368
|
];
|
|
1301
1369
|
case 1:
|
|
1302
1370
|
token = _state.sent();
|
|
1303
|
-
if (!
|
|
1371
|
+
if (!token.accessToken) {
|
|
1304
1372
|
throw new ZoomOAuthAuthFailureError();
|
|
1305
1373
|
}
|
|
1306
1374
|
return [
|
|
@@ -1313,12 +1381,17 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1313
1381
|
};
|
|
1314
1382
|
}
|
|
1315
1383
|
|
|
1316
|
-
var
|
|
1384
|
+
var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION(headers) {
|
|
1317
1385
|
console.warn("zoomRateLimitedFetchHandler(): Too many requests made. The limit is ".concat(headers.limit, " requests per reset period. RetryAt is set for ").concat(headers.retryAfterAt, "."));
|
|
1318
1386
|
};
|
|
1319
|
-
|
|
1387
|
+
/**
|
|
1388
|
+
* Creates a rate-limited fetch handler configured for the Zoom API.
|
|
1389
|
+
*
|
|
1390
|
+
* @param config Optional configuration for rate limiting behavior
|
|
1391
|
+
* @returns A configured rate-limited fetch handler
|
|
1392
|
+
*/ function zoomRateLimitedFetchHandler(config) {
|
|
1320
1393
|
var _ref, _ref1, _ref2;
|
|
1321
|
-
var onTooManyRequests = (config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== false ? (_ref = config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== null && _ref !== void 0 ? _ref :
|
|
1394
|
+
var onTooManyRequests = (config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== false ? (_ref = config === null || config === void 0 ? void 0 : config.onTooManyRequests) !== null && _ref !== void 0 ? _ref : DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION : undefined;
|
|
1322
1395
|
var defaultLimit = (_ref1 = config === null || config === void 0 ? void 0 : config.maxRateLimit) !== null && _ref1 !== void 0 ? _ref1 : DEFAULT_ZOOM_API_RATE_LIMIT;
|
|
1323
1396
|
var defaultResetPeriod = (_ref2 = config === null || config === void 0 ? void 0 : config.resetPeriod) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
|
|
1324
1397
|
function configForLimit(limit, resetAt) {
|
|
@@ -1344,13 +1417,13 @@ function zoomRateLimitedFetchHandler(config) {
|
|
|
1344
1417
|
var headerDetails = zoomRateLimitHeaderDetails(response.headers);
|
|
1345
1418
|
if (headerDetails) {
|
|
1346
1419
|
var type = headerDetails.type, limit = headerDetails.limit, retryAfterAt = headerDetails.retryAfterAt, remaining = headerDetails.remaining;
|
|
1347
|
-
if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1420
|
+
if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE && // For simple query-per-second rate limits, just schedule a retry
|
|
1421
|
+
type === 'QPS') {
|
|
1422
|
+
shouldRetry = true;
|
|
1423
|
+
try {
|
|
1424
|
+
void (onTooManyRequests === null || onTooManyRequests === void 0 ? void 0 : onTooManyRequests(headerDetails, response, fetchResponseError));
|
|
1425
|
+
} catch (unused) {
|
|
1426
|
+
// ignored: onTooManyRequests is for logging only
|
|
1354
1427
|
}
|
|
1355
1428
|
}
|
|
1356
1429
|
// NOTE: typically it seems like these headers are not available usually.
|
|
@@ -1371,6 +1444,10 @@ function zoomRateLimitedFetchHandler(config) {
|
|
|
1371
1444
|
}
|
|
1372
1445
|
});
|
|
1373
1446
|
}
|
|
1447
|
+
// MARK: Compat
|
|
1448
|
+
/**
|
|
1449
|
+
* @deprecated use DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
|
|
1450
|
+
*/ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
1374
1451
|
|
|
1375
1452
|
/**
|
|
1376
1453
|
* The Zoom API URL for the US datacenter.
|
|
@@ -1504,7 +1581,12 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1504
1581
|
};
|
|
1505
1582
|
}
|
|
1506
1583
|
}
|
|
1507
|
-
|
|
1584
|
+
/**
|
|
1585
|
+
* Creates a Zoom API factory from the given configuration.
|
|
1586
|
+
*
|
|
1587
|
+
* @param factoryConfig Configuration including OAuth context, rate limiting, and fetch settings
|
|
1588
|
+
* @returns A factory function that creates a configured Zoom API instance
|
|
1589
|
+
*/ function zoomFactory(factoryConfig) {
|
|
1508
1590
|
var oauthContext = factoryConfig.oauthContext;
|
|
1509
1591
|
var serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
|
|
1510
1592
|
var fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
|
|
@@ -1614,7 +1696,13 @@ function zoomFactory(factoryConfig) {
|
|
|
1614
1696
|
return context.fetchJson("/token?grant_type=refresh_token&refresh_token=".concat(refreshToken), zoomOAuthApiFetchJsonInput(context, input));
|
|
1615
1697
|
};
|
|
1616
1698
|
}
|
|
1617
|
-
|
|
1699
|
+
/**
|
|
1700
|
+
* Builds a FetchJsonInput for Zoom OAuth API calls with Basic auth.
|
|
1701
|
+
*
|
|
1702
|
+
* @param context The Zoom OAuth context
|
|
1703
|
+
* @param input Optional override for client credentials
|
|
1704
|
+
* @returns A configured FetchJsonInput for the OAuth API call
|
|
1705
|
+
*/ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
1618
1706
|
var _ref, _ref1;
|
|
1619
1707
|
var _input_client, _input_client1;
|
|
1620
1708
|
var clientId = (_ref = input === null || input === void 0 ? void 0 : (_input_client = input.client) === null || _input_client === void 0 ? void 0 : _input_client.clientId) !== null && _ref !== void 0 ? _ref : context.config.clientId;
|
|
@@ -1630,8 +1718,14 @@ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
|
1630
1718
|
};
|
|
1631
1719
|
return fetchJsonInput;
|
|
1632
1720
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1721
|
+
/**
|
|
1722
|
+
* Generates a Basic Authorization header value for Zoom OAuth.
|
|
1723
|
+
*
|
|
1724
|
+
* @param input The client ID and secret pair
|
|
1725
|
+
* @returns The Base64-encoded Basic auth header value
|
|
1726
|
+
*/ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
|
|
1727
|
+
var credentials = input.clientId + ':' + input.clientSecret;
|
|
1728
|
+
return "Basic ".concat(Buffer.from(credentials).toString('base64'));
|
|
1635
1729
|
}
|
|
1636
1730
|
|
|
1637
1731
|
/**
|
|
@@ -1766,9 +1860,14 @@ function _ts_generator(thisArg, body) {
|
|
|
1766
1860
|
};
|
|
1767
1861
|
}
|
|
1768
1862
|
}
|
|
1769
|
-
|
|
1863
|
+
/**
|
|
1864
|
+
* Creates a ZoomOAuth instance factory from the given configuration.
|
|
1865
|
+
*
|
|
1866
|
+
* @param factoryConfig Configuration for the OAuth factory
|
|
1867
|
+
* @returns A factory that creates configured ZoomOAuth instances
|
|
1868
|
+
*/ function zoomOAuthFactory(factoryConfig) {
|
|
1770
1869
|
var fetchHandler = zoomRateLimitedFetchHandler();
|
|
1771
|
-
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(
|
|
1870
|
+
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function() {
|
|
1772
1871
|
return fetch.fetchApiFetchService.makeFetch({
|
|
1773
1872
|
baseUrl: ZOOM_OAUTH_API_URL,
|
|
1774
1873
|
baseRequest: {
|
|
@@ -1912,7 +2011,7 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1912
2011
|
}
|
|
1913
2012
|
if (!!currentToken) return [
|
|
1914
2013
|
3,
|
|
1915
|
-
|
|
2014
|
+
9
|
|
1916
2015
|
];
|
|
1917
2016
|
_state.label = 3;
|
|
1918
2017
|
case 3:
|
|
@@ -1937,35 +2036,29 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1937
2036
|
console.error("zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: ", e);
|
|
1938
2037
|
throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
|
|
1939
2038
|
case 6:
|
|
1940
|
-
if (!currentToken) return [
|
|
1941
|
-
3,
|
|
1942
|
-
10
|
|
1943
|
-
];
|
|
1944
|
-
_state.label = 7;
|
|
1945
|
-
case 7:
|
|
1946
2039
|
_state.trys.push([
|
|
1947
|
-
|
|
1948
|
-
|
|
2040
|
+
6,
|
|
2041
|
+
8,
|
|
1949
2042
|
,
|
|
1950
|
-
|
|
2043
|
+
9
|
|
1951
2044
|
]);
|
|
1952
2045
|
return [
|
|
1953
2046
|
4,
|
|
1954
2047
|
accessTokenCache === null || accessTokenCache === void 0 ? void 0 : accessTokenCache.updateCachedToken(currentToken)
|
|
1955
2048
|
];
|
|
1956
|
-
case
|
|
2049
|
+
case 7:
|
|
1957
2050
|
_state.sent();
|
|
1958
2051
|
return [
|
|
1959
2052
|
3,
|
|
1960
|
-
|
|
2053
|
+
9
|
|
1961
2054
|
];
|
|
1962
|
-
case
|
|
2055
|
+
case 8:
|
|
1963
2056
|
_state.sent();
|
|
1964
2057
|
return [
|
|
1965
2058
|
3,
|
|
1966
|
-
|
|
2059
|
+
9
|
|
1967
2060
|
];
|
|
1968
|
-
case
|
|
2061
|
+
case 9:
|
|
1969
2062
|
return [
|
|
1970
2063
|
2,
|
|
1971
2064
|
currentToken
|
|
@@ -1978,6 +2071,7 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1978
2071
|
|
|
1979
2072
|
exports.DEFAULT_ZOOM_API_RATE_LIMIT = DEFAULT_ZOOM_API_RATE_LIMIT;
|
|
1980
2073
|
exports.DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
|
|
2074
|
+
exports.DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
1981
2075
|
exports.DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION;
|
|
1982
2076
|
exports.DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE;
|
|
1983
2077
|
exports.ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE = ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE;
|