@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.esm.js
CHANGED
|
@@ -72,9 +72,9 @@ function _object_spread_props(target, source) {
|
|
|
72
72
|
/**
|
|
73
73
|
* Creates a FetchPageFactory using the input ZoomFetchPageFetchFunction.
|
|
74
74
|
*
|
|
75
|
-
* @param fetch
|
|
76
|
-
* @param defaults
|
|
77
|
-
* @returns
|
|
75
|
+
* @param fetch - function that fetches a single page of results from the Zoom API
|
|
76
|
+
* @param defaults - optional default pagination configuration
|
|
77
|
+
* @returns a configured FetchPageFactory that handles Zoom's cursor-based pagination using `next_page_token`
|
|
78
78
|
*/ function zoomFetchPageFactory(fetch, defaults) {
|
|
79
79
|
return fetchPageFactory(_object_spread_props(_object_spread({}, defaults), {
|
|
80
80
|
fetch: fetch,
|
|
@@ -382,8 +382,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
382
382
|
/**
|
|
383
383
|
* Wraps a ConfiguredFetch to support handling errors returned by fetch.
|
|
384
384
|
*
|
|
385
|
-
* @param fetch
|
|
386
|
-
* @
|
|
385
|
+
* @param parseZoomError Function to parse fetch response errors into typed Zoom errors
|
|
386
|
+
* @param defaultLogError Default error logging function
|
|
387
|
+
* @returns A factory that wraps ConfiguredFetch with error handling
|
|
387
388
|
*/ function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
|
|
388
389
|
return function(fetch) {
|
|
389
390
|
var logError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultLogError;
|
|
@@ -451,7 +452,12 @@ var ZOOM_RATE_LIMIT_REMAINING_HEADER = 'X-RateLimit-Remaining';
|
|
|
451
452
|
var ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = 'Retry-After';
|
|
452
453
|
var DEFAULT_ZOOM_API_RATE_LIMIT = 2;
|
|
453
454
|
var DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = MS_IN_SECOND;
|
|
454
|
-
|
|
455
|
+
/**
|
|
456
|
+
* Parses rate limit header details from a Zoom API response.
|
|
457
|
+
*
|
|
458
|
+
* @param headers The response headers to parse
|
|
459
|
+
* @returns Parsed rate limit details, or null if required headers are missing
|
|
460
|
+
*/ function zoomRateLimitHeaderDetails(headers) {
|
|
455
461
|
var limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
|
|
456
462
|
var remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
|
|
457
463
|
var retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
|
|
@@ -495,9 +501,9 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
495
501
|
/**
|
|
496
502
|
* Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
|
|
497
503
|
*
|
|
498
|
-
* @param
|
|
499
|
-
* @param responseError
|
|
500
|
-
* @returns
|
|
504
|
+
* @param zoomServerError The error data from the Zoom API
|
|
505
|
+
* @param responseError The original fetch response error
|
|
506
|
+
* @returns A typed ZoomServerFetchResponseError, or undefined
|
|
501
507
|
*/ function parseZoomServerErrorData(zoomServerError, responseError) {
|
|
502
508
|
var result;
|
|
503
509
|
if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
|
|
@@ -507,7 +513,7 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
507
513
|
responseError: responseError,
|
|
508
514
|
headerDetails: result.headerDetails
|
|
509
515
|
});
|
|
510
|
-
} else
|
|
516
|
+
} else {
|
|
511
517
|
switch(zoomServerError.code){
|
|
512
518
|
default:
|
|
513
519
|
result = new ZoomServerFetchResponseError(zoomServerError, responseError);
|
|
@@ -520,6 +526,9 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
520
526
|
* Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
|
|
521
527
|
*
|
|
522
528
|
* If other options are input, it merges those two options together and adds silenceError to the omitted keys.
|
|
529
|
+
*
|
|
530
|
+
* @param options Optional additional MakeUrlSearchParamsOptions to merge
|
|
531
|
+
* @returns A MakeUrlSearchParamsOptions that omits silenceError
|
|
523
532
|
*/ function omitSilenceZoomErrorKeys(options) {
|
|
524
533
|
var omitKeys = [
|
|
525
534
|
'silenceError'
|
|
@@ -535,10 +544,8 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
535
544
|
var codesSet = new Set(asArray(codes));
|
|
536
545
|
return function(silence) {
|
|
537
546
|
return function(reason) {
|
|
538
|
-
if (silence !== false && _instanceof(reason, ZoomServerFetchResponseError)) {
|
|
539
|
-
|
|
540
|
-
return returnFn === null || returnFn === void 0 ? void 0 : returnFn(reason);
|
|
541
|
-
}
|
|
547
|
+
if (silence !== false && _instanceof(reason, ZoomServerFetchResponseError) && codesSet.has(reason.code)) {
|
|
548
|
+
return returnFn === null || returnFn === void 0 ? void 0 : returnFn(reason);
|
|
542
549
|
}
|
|
543
550
|
throw reason;
|
|
544
551
|
};
|
|
@@ -547,6 +554,9 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
547
554
|
|
|
548
555
|
/**
|
|
549
556
|
* https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting
|
|
557
|
+
*
|
|
558
|
+
* @param context The Zoom API context
|
|
559
|
+
* @returns A function that retrieves a meeting by ID
|
|
550
560
|
*/ function getMeeting(context) {
|
|
551
561
|
return function(input) {
|
|
552
562
|
return context.fetchJson("/meetings/".concat(input.meetingId), 'GET');
|
|
@@ -554,16 +564,27 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
554
564
|
}
|
|
555
565
|
/**
|
|
556
566
|
* https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings
|
|
567
|
+
*
|
|
568
|
+
* @param context The Zoom API context
|
|
569
|
+
* @returns A function that lists meetings for a user
|
|
557
570
|
*/ function listMeetingsForUser(context) {
|
|
558
571
|
return function(input) {
|
|
559
572
|
return context.fetchJson("/users/".concat(input.user, "/meetings"), 'GET').then(mapToZoomPageResult('meetings'));
|
|
560
573
|
};
|
|
561
574
|
}
|
|
562
|
-
|
|
575
|
+
/**
|
|
576
|
+
* Creates a page factory for listing meetings for a user.
|
|
577
|
+
*
|
|
578
|
+
* @param context The Zoom API context
|
|
579
|
+
* @returns A page factory for paginated meeting listing
|
|
580
|
+
*/ function listMeetingsForUserPageFactory(context) {
|
|
563
581
|
return zoomFetchPageFactory(listMeetingsForUser(context));
|
|
564
582
|
}
|
|
565
583
|
/**
|
|
566
584
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings
|
|
585
|
+
*
|
|
586
|
+
* @param context The Zoom API context
|
|
587
|
+
* @returns A function that creates a meeting for a user
|
|
567
588
|
*/ function createMeetingForUser(context) {
|
|
568
589
|
return function(input) {
|
|
569
590
|
return context.fetchJson("/users/".concat(input.user, "/meetings"), {
|
|
@@ -574,6 +595,9 @@ function listMeetingsForUserPageFactory(context) {
|
|
|
574
595
|
}
|
|
575
596
|
/**
|
|
576
597
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/PUT/meetings/{meetingId}
|
|
598
|
+
*
|
|
599
|
+
* @param context The Zoom API context
|
|
600
|
+
* @returns A function that updates a meeting
|
|
577
601
|
*/ function updateMeeting(context) {
|
|
578
602
|
return function(input) {
|
|
579
603
|
return context.fetchJson("/meetings/".concat(input.meetingId, "?").concat(makeUrlSearchParams({
|
|
@@ -587,6 +611,9 @@ function listMeetingsForUserPageFactory(context) {
|
|
|
587
611
|
var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
588
612
|
/**
|
|
589
613
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
|
|
614
|
+
*
|
|
615
|
+
* @param context The Zoom API context
|
|
616
|
+
* @returns A function that deletes a meeting (silences 3001 "not found" errors by default)
|
|
590
617
|
*/ function deleteMeeting(context) {
|
|
591
618
|
var silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
|
|
592
619
|
return function(input) {
|
|
@@ -595,6 +622,9 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
595
622
|
}
|
|
596
623
|
/**
|
|
597
624
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}
|
|
625
|
+
*
|
|
626
|
+
* @param context The Zoom API context
|
|
627
|
+
* @returns A function that retrieves a past meeting
|
|
598
628
|
*/ function getPastMeeting(context) {
|
|
599
629
|
return function(input) {
|
|
600
630
|
return context.fetchJson("/past_meetings/".concat(input.meetingId), 'GET');
|
|
@@ -602,12 +632,20 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
602
632
|
}
|
|
603
633
|
/**
|
|
604
634
|
* https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}/participants
|
|
635
|
+
*
|
|
636
|
+
* @param context The Zoom API context
|
|
637
|
+
* @returns A function that retrieves participants from a past meeting
|
|
605
638
|
*/ function getPastMeetingParticipants(context) {
|
|
606
639
|
return function(input) {
|
|
607
640
|
return context.fetchJson("/past_meetings/".concat(input.meetingId, "/participants"), 'GET').then(mapToZoomPageResult('participants'));
|
|
608
641
|
};
|
|
609
642
|
}
|
|
610
|
-
|
|
643
|
+
/**
|
|
644
|
+
* Creates a page factory for listing past meeting participants.
|
|
645
|
+
*
|
|
646
|
+
* @param context The Zoom API context
|
|
647
|
+
* @returns A page factory for paginated participant listing
|
|
648
|
+
*/ function getPastMeetingParticipantsPageFactory(context) {
|
|
611
649
|
return zoomFetchPageFactory(getPastMeetingParticipants(context));
|
|
612
650
|
}
|
|
613
651
|
|
|
@@ -697,7 +735,12 @@ var ZoomRegistrationType;
|
|
|
697
735
|
return context.fetchJson("/users?".concat(makeUrlSearchParams(input)), 'GET').then(mapToZoomPageResult('users'));
|
|
698
736
|
};
|
|
699
737
|
}
|
|
700
|
-
|
|
738
|
+
/**
|
|
739
|
+
* Creates a page factory for listing users.
|
|
740
|
+
*
|
|
741
|
+
* @param context The Zoom API context
|
|
742
|
+
* @returns A page factory for paginated user listing
|
|
743
|
+
*/ function listUsersPageFactory(context) {
|
|
701
744
|
return zoomFetchPageFactory(listUsers(context));
|
|
702
745
|
}
|
|
703
746
|
|
|
@@ -839,7 +882,12 @@ function _ts_generator$4(thisArg, body) {
|
|
|
839
882
|
}
|
|
840
883
|
// MARK: Parser
|
|
841
884
|
var logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
|
|
842
|
-
|
|
885
|
+
/**
|
|
886
|
+
* Parses a FetchResponseError into a typed Zoom API error.
|
|
887
|
+
*
|
|
888
|
+
* @param responseError The fetch response error to parse
|
|
889
|
+
* @returns The parsed error, or undefined if parsing fails
|
|
890
|
+
*/ function parseZoomApiError(responseError) {
|
|
843
891
|
return _async_to_generator$4(function() {
|
|
844
892
|
var data, result;
|
|
845
893
|
return _ts_generator$4(this, function(_state) {
|
|
@@ -847,7 +895,7 @@ function parseZoomApiError(responseError) {
|
|
|
847
895
|
case 0:
|
|
848
896
|
return [
|
|
849
897
|
4,
|
|
850
|
-
responseError.response.json().catch(function(
|
|
898
|
+
responseError.response.json().catch(function() {
|
|
851
899
|
return undefined;
|
|
852
900
|
})
|
|
853
901
|
];
|
|
@@ -864,9 +912,15 @@ function parseZoomApiError(responseError) {
|
|
|
864
912
|
});
|
|
865
913
|
})();
|
|
866
914
|
}
|
|
867
|
-
|
|
915
|
+
/**
|
|
916
|
+
* Parses a ZoomServerErrorData into a Zoom API-specific error.
|
|
917
|
+
*
|
|
918
|
+
* @param zoomServerError The raw error data from the Zoom API
|
|
919
|
+
* @param responseError The original fetch response error
|
|
920
|
+
* @returns A parsed error, or undefined if the error is unrecognized
|
|
921
|
+
*/ function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
|
|
868
922
|
var result;
|
|
869
|
-
|
|
923
|
+
{
|
|
870
924
|
switch(zoomServerError.code){
|
|
871
925
|
default:
|
|
872
926
|
result = parseZoomServerErrorData(zoomServerError, responseError);
|
|
@@ -1112,7 +1166,12 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1112
1166
|
return ZoomOAuthAuthFailureError;
|
|
1113
1167
|
}(FetchRequestFactoryError);
|
|
1114
1168
|
var logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
|
|
1115
|
-
|
|
1169
|
+
/**
|
|
1170
|
+
* Parses a FetchResponseError into a typed Zoom OAuth error.
|
|
1171
|
+
*
|
|
1172
|
+
* @param responseError The fetch response error to parse
|
|
1173
|
+
* @returns The parsed error, or undefined if parsing fails
|
|
1174
|
+
*/ function parseZoomOAuthError(responseError) {
|
|
1116
1175
|
return _async_to_generator$3(function() {
|
|
1117
1176
|
var data, result;
|
|
1118
1177
|
return _ts_generator$3(this, function(_state) {
|
|
@@ -1120,7 +1179,7 @@ function parseZoomOAuthError(responseError) {
|
|
|
1120
1179
|
case 0:
|
|
1121
1180
|
return [
|
|
1122
1181
|
4,
|
|
1123
|
-
responseError.response.json().catch(function(
|
|
1182
|
+
responseError.response.json().catch(function() {
|
|
1124
1183
|
return undefined;
|
|
1125
1184
|
})
|
|
1126
1185
|
];
|
|
@@ -1137,9 +1196,15 @@ function parseZoomOAuthError(responseError) {
|
|
|
1137
1196
|
});
|
|
1138
1197
|
})();
|
|
1139
1198
|
}
|
|
1140
|
-
|
|
1199
|
+
/**
|
|
1200
|
+
* Parses a ZoomServerErrorData into a Zoom OAuth-specific error.
|
|
1201
|
+
*
|
|
1202
|
+
* @param zoomServerError The raw error data from the Zoom API
|
|
1203
|
+
* @param responseError The original fetch response error
|
|
1204
|
+
* @returns A parsed error, or undefined if the error is unrecognized
|
|
1205
|
+
*/ function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
|
|
1141
1206
|
var result;
|
|
1142
|
-
|
|
1207
|
+
{
|
|
1143
1208
|
var potentialErrorStringCode = zoomServerError.error;
|
|
1144
1209
|
var errorCode = potentialErrorStringCode !== null && potentialErrorStringCode !== void 0 ? potentialErrorStringCode : zoomServerError.code;
|
|
1145
1210
|
switch(errorCode){
|
|
@@ -1284,7 +1349,10 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1284
1349
|
}
|
|
1285
1350
|
}
|
|
1286
1351
|
/**
|
|
1287
|
-
* Generates a new ZoomAccessTokenStringFactory.
|
|
1352
|
+
* Generates a new ZoomAccessTokenStringFactory from a ZoomAccessTokenFactory.
|
|
1353
|
+
*
|
|
1354
|
+
* @param zoomAccessTokenFactory The factory to extract the token string from
|
|
1355
|
+
* @returns A factory that returns the access token string
|
|
1288
1356
|
*/ function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
|
|
1289
1357
|
return function() {
|
|
1290
1358
|
return _async_to_generator$2(function() {
|
|
@@ -1298,7 +1366,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1298
1366
|
];
|
|
1299
1367
|
case 1:
|
|
1300
1368
|
token = _state.sent();
|
|
1301
|
-
if (!
|
|
1369
|
+
if (!token.accessToken) {
|
|
1302
1370
|
throw new ZoomOAuthAuthFailureError();
|
|
1303
1371
|
}
|
|
1304
1372
|
return [
|
|
@@ -1311,12 +1379,17 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1311
1379
|
};
|
|
1312
1380
|
}
|
|
1313
1381
|
|
|
1314
|
-
var
|
|
1382
|
+
var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION(headers) {
|
|
1315
1383
|
console.warn("zoomRateLimitedFetchHandler(): Too many requests made. The limit is ".concat(headers.limit, " requests per reset period. RetryAt is set for ").concat(headers.retryAfterAt, "."));
|
|
1316
1384
|
};
|
|
1317
|
-
|
|
1385
|
+
/**
|
|
1386
|
+
* Creates a rate-limited fetch handler configured for the Zoom API.
|
|
1387
|
+
*
|
|
1388
|
+
* @param config Optional configuration for rate limiting behavior
|
|
1389
|
+
* @returns A configured rate-limited fetch handler
|
|
1390
|
+
*/ function zoomRateLimitedFetchHandler(config) {
|
|
1318
1391
|
var _ref, _ref1, _ref2;
|
|
1319
|
-
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 :
|
|
1392
|
+
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;
|
|
1320
1393
|
var defaultLimit = (_ref1 = config === null || config === void 0 ? void 0 : config.maxRateLimit) !== null && _ref1 !== void 0 ? _ref1 : DEFAULT_ZOOM_API_RATE_LIMIT;
|
|
1321
1394
|
var defaultResetPeriod = (_ref2 = config === null || config === void 0 ? void 0 : config.resetPeriod) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
|
|
1322
1395
|
function configForLimit(limit, resetAt) {
|
|
@@ -1342,13 +1415,13 @@ function zoomRateLimitedFetchHandler(config) {
|
|
|
1342
1415
|
var headerDetails = zoomRateLimitHeaderDetails(response.headers);
|
|
1343
1416
|
if (headerDetails) {
|
|
1344
1417
|
var type = headerDetails.type, limit = headerDetails.limit, retryAfterAt = headerDetails.retryAfterAt, remaining = headerDetails.remaining;
|
|
1345
|
-
if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1418
|
+
if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE && // For simple query-per-second rate limits, just schedule a retry
|
|
1419
|
+
type === 'QPS') {
|
|
1420
|
+
shouldRetry = true;
|
|
1421
|
+
try {
|
|
1422
|
+
void (onTooManyRequests === null || onTooManyRequests === void 0 ? void 0 : onTooManyRequests(headerDetails, response, fetchResponseError));
|
|
1423
|
+
} catch (unused) {
|
|
1424
|
+
// ignored: onTooManyRequests is for logging only
|
|
1352
1425
|
}
|
|
1353
1426
|
}
|
|
1354
1427
|
// NOTE: typically it seems like these headers are not available usually.
|
|
@@ -1369,6 +1442,10 @@ function zoomRateLimitedFetchHandler(config) {
|
|
|
1369
1442
|
}
|
|
1370
1443
|
});
|
|
1371
1444
|
}
|
|
1445
|
+
// MARK: Compat
|
|
1446
|
+
/**
|
|
1447
|
+
* @deprecated use DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
|
|
1448
|
+
*/ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
1372
1449
|
|
|
1373
1450
|
/**
|
|
1374
1451
|
* The Zoom API URL for the US datacenter.
|
|
@@ -1502,7 +1579,12 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1502
1579
|
};
|
|
1503
1580
|
}
|
|
1504
1581
|
}
|
|
1505
|
-
|
|
1582
|
+
/**
|
|
1583
|
+
* Creates a Zoom API factory from the given configuration.
|
|
1584
|
+
*
|
|
1585
|
+
* @param factoryConfig Configuration including OAuth context, rate limiting, and fetch settings
|
|
1586
|
+
* @returns A factory function that creates a configured Zoom API instance
|
|
1587
|
+
*/ function zoomFactory(factoryConfig) {
|
|
1506
1588
|
var oauthContext = factoryConfig.oauthContext;
|
|
1507
1589
|
var serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
|
|
1508
1590
|
var fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
|
|
@@ -1612,7 +1694,13 @@ function zoomFactory(factoryConfig) {
|
|
|
1612
1694
|
return context.fetchJson("/token?grant_type=refresh_token&refresh_token=".concat(refreshToken), zoomOAuthApiFetchJsonInput(context, input));
|
|
1613
1695
|
};
|
|
1614
1696
|
}
|
|
1615
|
-
|
|
1697
|
+
/**
|
|
1698
|
+
* Builds a FetchJsonInput for Zoom OAuth API calls with Basic auth.
|
|
1699
|
+
*
|
|
1700
|
+
* @param context The Zoom OAuth context
|
|
1701
|
+
* @param input Optional override for client credentials
|
|
1702
|
+
* @returns A configured FetchJsonInput for the OAuth API call
|
|
1703
|
+
*/ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
1616
1704
|
var _ref, _ref1;
|
|
1617
1705
|
var _input_client, _input_client1;
|
|
1618
1706
|
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;
|
|
@@ -1628,8 +1716,14 @@ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
|
1628
1716
|
};
|
|
1629
1717
|
return fetchJsonInput;
|
|
1630
1718
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1719
|
+
/**
|
|
1720
|
+
* Generates a Basic Authorization header value for Zoom OAuth.
|
|
1721
|
+
*
|
|
1722
|
+
* @param input The client ID and secret pair
|
|
1723
|
+
* @returns The Base64-encoded Basic auth header value
|
|
1724
|
+
*/ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
|
|
1725
|
+
var credentials = input.clientId + ':' + input.clientSecret;
|
|
1726
|
+
return "Basic ".concat(Buffer.from(credentials).toString('base64'));
|
|
1633
1727
|
}
|
|
1634
1728
|
|
|
1635
1729
|
/**
|
|
@@ -1764,9 +1858,14 @@ function _ts_generator(thisArg, body) {
|
|
|
1764
1858
|
};
|
|
1765
1859
|
}
|
|
1766
1860
|
}
|
|
1767
|
-
|
|
1861
|
+
/**
|
|
1862
|
+
* Creates a ZoomOAuth instance factory from the given configuration.
|
|
1863
|
+
*
|
|
1864
|
+
* @param factoryConfig Configuration for the OAuth factory
|
|
1865
|
+
* @returns A factory that creates configured ZoomOAuth instances
|
|
1866
|
+
*/ function zoomOAuthFactory(factoryConfig) {
|
|
1768
1867
|
var fetchHandler = zoomRateLimitedFetchHandler();
|
|
1769
|
-
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function(
|
|
1868
|
+
var logZoomServerErrorFunction = factoryConfig.logZoomServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? function() {
|
|
1770
1869
|
return fetchApiFetchService.makeFetch({
|
|
1771
1870
|
baseUrl: ZOOM_OAUTH_API_URL,
|
|
1772
1871
|
baseRequest: {
|
|
@@ -1910,7 +2009,7 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1910
2009
|
}
|
|
1911
2010
|
if (!!currentToken) return [
|
|
1912
2011
|
3,
|
|
1913
|
-
|
|
2012
|
+
9
|
|
1914
2013
|
];
|
|
1915
2014
|
_state.label = 3;
|
|
1916
2015
|
case 3:
|
|
@@ -1935,35 +2034,29 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1935
2034
|
console.error("zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: ", e);
|
|
1936
2035
|
throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
|
|
1937
2036
|
case 6:
|
|
1938
|
-
if (!currentToken) return [
|
|
1939
|
-
3,
|
|
1940
|
-
10
|
|
1941
|
-
];
|
|
1942
|
-
_state.label = 7;
|
|
1943
|
-
case 7:
|
|
1944
2037
|
_state.trys.push([
|
|
1945
|
-
|
|
1946
|
-
|
|
2038
|
+
6,
|
|
2039
|
+
8,
|
|
1947
2040
|
,
|
|
1948
|
-
|
|
2041
|
+
9
|
|
1949
2042
|
]);
|
|
1950
2043
|
return [
|
|
1951
2044
|
4,
|
|
1952
2045
|
accessTokenCache === null || accessTokenCache === void 0 ? void 0 : accessTokenCache.updateCachedToken(currentToken)
|
|
1953
2046
|
];
|
|
1954
|
-
case
|
|
2047
|
+
case 7:
|
|
1955
2048
|
_state.sent();
|
|
1956
2049
|
return [
|
|
1957
2050
|
3,
|
|
1958
|
-
|
|
2051
|
+
9
|
|
1959
2052
|
];
|
|
1960
|
-
case
|
|
2053
|
+
case 8:
|
|
1961
2054
|
_state.sent();
|
|
1962
2055
|
return [
|
|
1963
2056
|
3,
|
|
1964
|
-
|
|
2057
|
+
9
|
|
1965
2058
|
];
|
|
1966
|
-
case
|
|
2059
|
+
case 9:
|
|
1967
2060
|
return [
|
|
1968
2061
|
2,
|
|
1969
2062
|
currentToken
|
|
@@ -1974,4 +2067,4 @@ function zoomOAuthFactory(factoryConfig) {
|
|
|
1974
2067
|
};
|
|
1975
2068
|
}
|
|
1976
2069
|
|
|
1977
|
-
export { DEFAULT_ZOOM_API_RATE_LIMIT, DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE, ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE, ZOOM_API_URL, ZOOM_OAUTH_API_URL, ZOOM_RATE_LIMIT_CATEGORY_HEADER, ZOOM_RATE_LIMIT_LIMIT_HEADER, ZOOM_RATE_LIMIT_REMAINING_HEADER, ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER, ZOOM_RATE_LIMIT_TYPE_HEADER, ZOOM_SUCCESS_CODE, ZOOM_TOO_MANY_REQUESTS_ERROR_CODE, ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZoomApprovalType, ZoomMeetingType, ZoomMonthlyWeek, ZoomMonthlyWeekDay, ZoomOAuthAccessTokenError, ZoomOAuthAuthFailureError, ZoomRecurrenceType, ZoomRegistrationType, ZoomServerError, ZoomServerFetchResponseError, ZoomTooManyRequestsError, ZoomUserType, createMeetingForUser, deleteMeeting, getMeeting, getPastMeeting, getPastMeetingParticipants, getPastMeetingParticipantsPageFactory, getUser, handleZoomErrorFetch, handleZoomErrorFetchFactory, handleZoomOAuthErrorFetch, listMeetingsForUser, listMeetingsForUserPageFactory, listUsers, listUsersPageFactory, logZoomErrorToConsole, logZoomOAuthErrorToConsole, logZoomServerErrorFunction, mapToZoomPageResult, omitSilenceZoomErrorKeys, parseZoomApiError, parseZoomApiServerErrorResponseData, parseZoomOAuthError, parseZoomOAuthServerErrorResponseData, parseZoomServerErrorData, serverAccessToken, silenceZoomErrorWithCodesFunction, updateMeeting, userAccessToken, zoomAccessTokenStringFactory, zoomFactory, zoomFetchPageFactory, zoomOAuthApiFetchJsonInput, zoomOAuthFactory, zoomOAuthServerBasicAuthorizationHeaderValue, zoomOAuthZoomAccessTokenFactory, zoomRateLimitHeaderDetails, zoomRateLimitedFetchHandler };
|
|
2070
|
+
export { DEFAULT_ZOOM_API_RATE_LIMIT, DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION, DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE, ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE, ZOOM_API_URL, ZOOM_OAUTH_API_URL, ZOOM_RATE_LIMIT_CATEGORY_HEADER, ZOOM_RATE_LIMIT_LIMIT_HEADER, ZOOM_RATE_LIMIT_REMAINING_HEADER, ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER, ZOOM_RATE_LIMIT_TYPE_HEADER, ZOOM_SUCCESS_CODE, ZOOM_TOO_MANY_REQUESTS_ERROR_CODE, ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZoomApprovalType, ZoomMeetingType, ZoomMonthlyWeek, ZoomMonthlyWeekDay, ZoomOAuthAccessTokenError, ZoomOAuthAuthFailureError, ZoomRecurrenceType, ZoomRegistrationType, ZoomServerError, ZoomServerFetchResponseError, ZoomTooManyRequestsError, ZoomUserType, createMeetingForUser, deleteMeeting, getMeeting, getPastMeeting, getPastMeetingParticipants, getPastMeetingParticipantsPageFactory, getUser, handleZoomErrorFetch, handleZoomErrorFetchFactory, handleZoomOAuthErrorFetch, listMeetingsForUser, listMeetingsForUserPageFactory, listUsers, listUsersPageFactory, logZoomErrorToConsole, logZoomOAuthErrorToConsole, logZoomServerErrorFunction, mapToZoomPageResult, omitSilenceZoomErrorKeys, parseZoomApiError, parseZoomApiServerErrorResponseData, parseZoomOAuthError, parseZoomOAuthServerErrorResponseData, parseZoomServerErrorData, serverAccessToken, silenceZoomErrorWithCodesFunction, updateMeeting, userAccessToken, zoomAccessTokenStringFactory, zoomFactory, zoomFetchPageFactory, zoomOAuthApiFetchJsonInput, zoomOAuthFactory, zoomOAuthServerBasicAuthorizationHeaderValue, zoomOAuthZoomAccessTokenFactory, zoomRateLimitHeaderDetails, zoomRateLimitedFetchHandler };
|