@dereekb/zoom 13.11.13 → 13.11.15
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 +79 -67
- package/index.esm.js +79 -67
- package/nestjs/index.cjs.js +53 -49
- package/nestjs/index.esm.js +53 -49
- package/nestjs/package.json +5 -5
- package/nestjs/src/lib/oauth/oauth.config.d.ts +3 -3
- package/nestjs/src/lib/oauth/oauth.module.d.ts +4 -4
- package/nestjs/src/lib/oauth/oauth.service.d.ts +11 -10
- package/nestjs/src/lib/webhook/webhook.zoom.module.d.ts +2 -2
- package/nestjs/src/lib/webhook/webhook.zoom.validate.d.ts +1 -1
- package/nestjs/src/lib/webhook/webhook.zoom.verify.d.ts +3 -3
- package/nestjs/src/lib/zoom/zoom.module.d.ts +4 -4
- package/package.json +4 -4
- package/src/lib/oauth/oauth.api.d.ts +5 -5
- package/src/lib/oauth/oauth.d.ts +3 -2
- package/src/lib/oauth/oauth.error.api.d.ts +5 -5
- package/src/lib/oauth/oauth.factory.d.ts +5 -3
- package/src/lib/zoom/zoom.api.meeting.d.ts +28 -25
- package/src/lib/zoom/zoom.api.user.d.ts +5 -4
- package/src/lib/zoom/zoom.api.user.type.d.ts +2 -2
- package/src/lib/zoom/zoom.error.api.d.ts +5 -5
- package/src/lib/zoom/zoom.factory.d.ts +3 -2
- package/src/lib/zoom.api.page.d.ts +4 -3
- package/src/lib/zoom.error.api.d.ts +13 -11
- package/src/lib/zoom.limit.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -72,9 +72,10 @@ 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
79
|
* @__NO_SIDE_EFFECTS__
|
|
79
80
|
*/ function zoomFetchPageFactory(fetch, defaults) {
|
|
80
81
|
return fetchPageFactory(_object_spread_props(_object_spread({}, defaults), {
|
|
@@ -361,8 +362,9 @@ function _ts_generator$5(thisArg, body) {
|
|
|
361
362
|
/**
|
|
362
363
|
* Creates a logZoomServerErrorFunction that logs the error to console.
|
|
363
364
|
*
|
|
364
|
-
* @param zoomApiNamePrefix Prefix to use when logging. I.E. ZoomError, etc.
|
|
365
|
+
* @param zoomApiNamePrefix - Prefix to use when logging. I.E. ZoomError, etc.
|
|
365
366
|
* @returns
|
|
367
|
+
*
|
|
366
368
|
* @__NO_SIDE_EFFECTS__
|
|
367
369
|
*/ function logZoomServerErrorFunction(zoomApiNamePrefix) {
|
|
368
370
|
return function(error) {
|
|
@@ -385,9 +387,10 @@ function _ts_generator$5(thisArg, body) {
|
|
|
385
387
|
/**
|
|
386
388
|
* Wraps a ConfiguredFetch to support handling errors returned by fetch.
|
|
387
389
|
*
|
|
388
|
-
* @param parseZoomError Function to parse fetch response errors into typed Zoom errors
|
|
389
|
-
* @param defaultLogError Default error logging function
|
|
390
|
-
* @returns A factory that wraps ConfiguredFetch with error handling
|
|
390
|
+
* @param parseZoomError - Function to parse fetch response errors into typed Zoom errors.
|
|
391
|
+
* @param defaultLogError - Default error logging function.
|
|
392
|
+
* @returns A factory that wraps ConfiguredFetch with error handling.
|
|
393
|
+
*
|
|
391
394
|
* @__NO_SIDE_EFFECTS__
|
|
392
395
|
*/ function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
|
|
393
396
|
return function(fetch) {
|
|
@@ -459,8 +462,8 @@ var DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = MS_IN_SECOND;
|
|
|
459
462
|
/**
|
|
460
463
|
* Parses rate limit header details from a Zoom API response.
|
|
461
464
|
*
|
|
462
|
-
* @param headers The response headers to parse
|
|
463
|
-
* @returns Parsed rate limit details, or null if required headers are missing
|
|
465
|
+
* @param headers - The response headers to parse.
|
|
466
|
+
* @returns Parsed rate limit details, or null if required headers are missing.
|
|
464
467
|
*/ function zoomRateLimitHeaderDetails(headers) {
|
|
465
468
|
var limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
|
|
466
469
|
var remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
|
|
@@ -505,9 +508,9 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
505
508
|
/**
|
|
506
509
|
* Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
|
|
507
510
|
*
|
|
508
|
-
* @param zoomServerError The error data from the Zoom API
|
|
509
|
-
* @param responseError The original fetch response error
|
|
510
|
-
* @returns A typed ZoomServerFetchResponseError, or undefined
|
|
511
|
+
* @param zoomServerError - The error data from the Zoom API.
|
|
512
|
+
* @param responseError - The original fetch response error.
|
|
513
|
+
* @returns A typed ZoomServerFetchResponseError, or undefined.
|
|
511
514
|
*/ function parseZoomServerErrorData(zoomServerError, responseError) {
|
|
512
515
|
var result;
|
|
513
516
|
if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
|
|
@@ -531,8 +534,8 @@ var ZoomTooManyRequestsError = /*#__PURE__*/ function(ZoomServerFetchResponseErr
|
|
|
531
534
|
*
|
|
532
535
|
* If other options are input, it merges those two options together and adds silenceError to the omitted keys.
|
|
533
536
|
*
|
|
534
|
-
* @param options Optional additional MakeUrlSearchParamsOptions to merge
|
|
535
|
-
* @returns A MakeUrlSearchParamsOptions that omits silenceError
|
|
537
|
+
* @param options - Optional additional MakeUrlSearchParamsOptions to merge.
|
|
538
|
+
* @returns A MakeUrlSearchParamsOptions that omits silenceError.
|
|
536
539
|
*/ function omitSilenceZoomErrorKeys(options) {
|
|
537
540
|
var omitKeys = [
|
|
538
541
|
'silenceError'
|
|
@@ -558,20 +561,20 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
558
561
|
}
|
|
559
562
|
|
|
560
563
|
/**
|
|
561
|
-
*
|
|
564
|
+
* Https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting.
|
|
562
565
|
*
|
|
563
|
-
* @param context The Zoom API context
|
|
564
|
-
* @returns
|
|
566
|
+
* @param context - The Zoom API context.
|
|
567
|
+
* @returns Retrieves a meeting by ID.
|
|
565
568
|
*/ function getMeeting(context) {
|
|
566
569
|
return function(input) {
|
|
567
570
|
return context.fetchJson("/meetings/".concat(input.meetingId), 'GET');
|
|
568
571
|
};
|
|
569
572
|
}
|
|
570
573
|
/**
|
|
571
|
-
*
|
|
574
|
+
* Https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings.
|
|
572
575
|
*
|
|
573
|
-
* @param context The Zoom API context
|
|
574
|
-
* @returns
|
|
576
|
+
* @param context - The Zoom API context.
|
|
577
|
+
* @returns Lists meetings for a user.
|
|
575
578
|
*/ function listMeetingsForUser(context) {
|
|
576
579
|
return function(input) {
|
|
577
580
|
return context.fetchJson("/users/".concat(input.user, "/meetings"), 'GET').then(mapToZoomPageResult('meetings'));
|
|
@@ -580,17 +583,19 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
580
583
|
/**
|
|
581
584
|
* Creates a page factory for listing meetings for a user.
|
|
582
585
|
*
|
|
583
|
-
* @param context The Zoom API context
|
|
584
|
-
* @returns A page factory for paginated meeting listing
|
|
586
|
+
* @param context - The Zoom API context.
|
|
587
|
+
* @returns A page factory for paginated meeting listing.
|
|
588
|
+
*
|
|
585
589
|
* @__NO_SIDE_EFFECTS__
|
|
586
590
|
*/ function listMeetingsForUserPageFactory(context) {
|
|
587
591
|
return zoomFetchPageFactory(listMeetingsForUser(context));
|
|
588
592
|
}
|
|
589
593
|
/**
|
|
590
|
-
*
|
|
594
|
+
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings.
|
|
595
|
+
*
|
|
596
|
+
* @param context - The Zoom API context.
|
|
597
|
+
* @returns Creates a meeting for a user.
|
|
591
598
|
*
|
|
592
|
-
* @param context The Zoom API context
|
|
593
|
-
* @returns A function that creates a meeting for a user
|
|
594
599
|
* @__NO_SIDE_EFFECTS__
|
|
595
600
|
*/ function createMeetingForUser(context) {
|
|
596
601
|
return function(input) {
|
|
@@ -601,10 +606,10 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
601
606
|
};
|
|
602
607
|
}
|
|
603
608
|
/**
|
|
604
|
-
*
|
|
609
|
+
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/PUT/meetings/{meetingId}
|
|
605
610
|
*
|
|
606
|
-
* @param context The Zoom API context
|
|
607
|
-
* @returns
|
|
611
|
+
* @param context - The Zoom API context.
|
|
612
|
+
* @returns Updates a meeting.
|
|
608
613
|
*/ function updateMeeting(context) {
|
|
609
614
|
return function(input) {
|
|
610
615
|
return context.fetchJson("/meetings/".concat(input.meetingId, "?").concat(makeUrlSearchParams({
|
|
@@ -617,10 +622,10 @@ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
|
|
|
617
622
|
}
|
|
618
623
|
var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
619
624
|
/**
|
|
620
|
-
*
|
|
625
|
+
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
|
|
621
626
|
*
|
|
622
|
-
* @param context The Zoom API context
|
|
623
|
-
* @returns
|
|
627
|
+
* @param context - The Zoom API context.
|
|
628
|
+
* @returns Deletes a meeting (silences 3001 "not found" errors by default)
|
|
624
629
|
*/ function deleteMeeting(context) {
|
|
625
630
|
var silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
|
|
626
631
|
return function(input) {
|
|
@@ -628,20 +633,20 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
628
633
|
};
|
|
629
634
|
}
|
|
630
635
|
/**
|
|
631
|
-
*
|
|
636
|
+
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}
|
|
632
637
|
*
|
|
633
|
-
* @param context The Zoom API context
|
|
634
|
-
* @returns
|
|
638
|
+
* @param context - The Zoom API context.
|
|
639
|
+
* @returns Retrieves a past meeting.
|
|
635
640
|
*/ function getPastMeeting(context) {
|
|
636
641
|
return function(input) {
|
|
637
642
|
return context.fetchJson("/past_meetings/".concat(input.meetingId), 'GET');
|
|
638
643
|
};
|
|
639
644
|
}
|
|
640
645
|
/**
|
|
641
|
-
*
|
|
646
|
+
* Https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/past_meetings/{meetingId}/participants.
|
|
642
647
|
*
|
|
643
|
-
* @param context The Zoom API context
|
|
644
|
-
* @returns
|
|
648
|
+
* @param context - The Zoom API context.
|
|
649
|
+
* @returns Retrieves participants from a past meeting.
|
|
645
650
|
*/ function getPastMeetingParticipants(context) {
|
|
646
651
|
return function(input) {
|
|
647
652
|
return context.fetchJson("/past_meetings/".concat(input.meetingId, "/participants"), 'GET').then(mapToZoomPageResult('participants'));
|
|
@@ -650,8 +655,9 @@ var DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
|
|
|
650
655
|
/**
|
|
651
656
|
* Creates a page factory for listing past meeting participants.
|
|
652
657
|
*
|
|
653
|
-
* @param context The Zoom API context
|
|
654
|
-
* @returns A page factory for paginated participant listing
|
|
658
|
+
* @param context - The Zoom API context.
|
|
659
|
+
* @returns A page factory for paginated participant listing.
|
|
660
|
+
*
|
|
655
661
|
* @__NO_SIDE_EFFECTS__
|
|
656
662
|
*/ function getPastMeetingParticipantsPageFactory(context) {
|
|
657
663
|
return zoomFetchPageFactory(getPastMeetingParticipants(context));
|
|
@@ -724,7 +730,7 @@ var ZoomRegistrationType;
|
|
|
724
730
|
})(ZoomRegistrationType || (ZoomRegistrationType = {}));
|
|
725
731
|
|
|
726
732
|
/**
|
|
727
|
-
*
|
|
733
|
+
* Https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}
|
|
728
734
|
*
|
|
729
735
|
* @param context
|
|
730
736
|
* @returns
|
|
@@ -734,7 +740,7 @@ var ZoomRegistrationType;
|
|
|
734
740
|
};
|
|
735
741
|
}
|
|
736
742
|
/**
|
|
737
|
-
*
|
|
743
|
+
* Https://developers.zoom.us/docs/api/users/#tag/users/GET/users.
|
|
738
744
|
*
|
|
739
745
|
* @param context
|
|
740
746
|
* @returns
|
|
@@ -746,8 +752,9 @@ var ZoomRegistrationType;
|
|
|
746
752
|
/**
|
|
747
753
|
* Creates a page factory for listing users.
|
|
748
754
|
*
|
|
749
|
-
* @param context The Zoom API context
|
|
750
|
-
* @returns A page factory for paginated user listing
|
|
755
|
+
* @param context - The Zoom API context.
|
|
756
|
+
* @returns A page factory for paginated user listing.
|
|
757
|
+
*
|
|
751
758
|
* @__NO_SIDE_EFFECTS__
|
|
752
759
|
*/ function listUsersPageFactory(context) {
|
|
753
760
|
return zoomFetchPageFactory(listUsers(context));
|
|
@@ -894,8 +901,8 @@ var logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
|
|
|
894
901
|
/**
|
|
895
902
|
* Parses a FetchResponseError into a typed Zoom API error.
|
|
896
903
|
*
|
|
897
|
-
* @param responseError The fetch response error to parse
|
|
898
|
-
* @returns The parsed error, or undefined if parsing fails
|
|
904
|
+
* @param responseError - The fetch response error to parse.
|
|
905
|
+
* @returns The parsed error, or undefined if parsing fails.
|
|
899
906
|
*/ function parseZoomApiError(responseError) {
|
|
900
907
|
return _async_to_generator$4(function() {
|
|
901
908
|
var data, result;
|
|
@@ -924,9 +931,9 @@ var logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
|
|
|
924
931
|
/**
|
|
925
932
|
* Parses a ZoomServerErrorData into a Zoom API-specific error.
|
|
926
933
|
*
|
|
927
|
-
* @param zoomServerError The raw error data from the Zoom API
|
|
928
|
-
* @param responseError The original fetch response error
|
|
929
|
-
* @returns A parsed error, or undefined if the error is unrecognized
|
|
934
|
+
* @param zoomServerError - The raw error data from the Zoom API.
|
|
935
|
+
* @param responseError - The original fetch response error.
|
|
936
|
+
* @returns A parsed error, or undefined if the error is unrecognized.
|
|
930
937
|
*/ function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
|
|
931
938
|
var result;
|
|
932
939
|
{
|
|
@@ -1178,8 +1185,8 @@ var logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
|
|
|
1178
1185
|
/**
|
|
1179
1186
|
* Parses a FetchResponseError into a typed Zoom OAuth error.
|
|
1180
1187
|
*
|
|
1181
|
-
* @param responseError The fetch response error to parse
|
|
1182
|
-
* @returns The parsed error, or undefined if parsing fails
|
|
1188
|
+
* @param responseError - The fetch response error to parse.
|
|
1189
|
+
* @returns The parsed error, or undefined if parsing fails.
|
|
1183
1190
|
*/ function parseZoomOAuthError(responseError) {
|
|
1184
1191
|
return _async_to_generator$3(function() {
|
|
1185
1192
|
var data, result;
|
|
@@ -1208,9 +1215,9 @@ var logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
|
|
|
1208
1215
|
/**
|
|
1209
1216
|
* Parses a ZoomServerErrorData into a Zoom OAuth-specific error.
|
|
1210
1217
|
*
|
|
1211
|
-
* @param zoomServerError The raw error data from the Zoom API
|
|
1212
|
-
* @param responseError The original fetch response error
|
|
1213
|
-
* @returns A parsed error, or undefined if the error is unrecognized
|
|
1218
|
+
* @param zoomServerError - The raw error data from the Zoom API.
|
|
1219
|
+
* @param responseError - The original fetch response error.
|
|
1220
|
+
* @returns A parsed error, or undefined if the error is unrecognized.
|
|
1214
1221
|
*/ function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
|
|
1215
1222
|
var result;
|
|
1216
1223
|
{
|
|
@@ -1360,8 +1367,9 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1360
1367
|
/**
|
|
1361
1368
|
* Generates a new ZoomAccessTokenStringFactory from a ZoomAccessTokenFactory.
|
|
1362
1369
|
*
|
|
1363
|
-
* @param zoomAccessTokenFactory The factory to extract the token string from
|
|
1364
|
-
* @returns A factory that returns the access token string
|
|
1370
|
+
* @param zoomAccessTokenFactory - The factory to extract the token string from.
|
|
1371
|
+
* @returns A factory that returns the access token string.
|
|
1372
|
+
*
|
|
1365
1373
|
* @__NO_SIDE_EFFECTS__
|
|
1366
1374
|
*/ function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
|
|
1367
1375
|
return function() {
|
|
@@ -1395,8 +1403,8 @@ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_
|
|
|
1395
1403
|
/**
|
|
1396
1404
|
* Creates a rate-limited fetch handler configured for the Zoom API.
|
|
1397
1405
|
*
|
|
1398
|
-
* @param config Optional configuration for rate limiting behavior
|
|
1399
|
-
* @returns A configured rate-limited fetch handler
|
|
1406
|
+
* @param config - Optional configuration for rate limiting behavior.
|
|
1407
|
+
* @returns A configured rate-limited fetch handler.
|
|
1400
1408
|
*/ function zoomRateLimitedFetchHandler(config) {
|
|
1401
1409
|
var _ref, _ref1, _ref2;
|
|
1402
1410
|
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;
|
|
@@ -1453,6 +1461,7 @@ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION = function DEFAULT_
|
|
|
1453
1461
|
});
|
|
1454
1462
|
}
|
|
1455
1463
|
// MARK: Compat
|
|
1464
|
+
// COMPAT: Deprecated aliases
|
|
1456
1465
|
/**
|
|
1457
1466
|
* @deprecated use DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION instead.
|
|
1458
1467
|
*/ var DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION;
|
|
@@ -1592,8 +1601,9 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1592
1601
|
/**
|
|
1593
1602
|
* Creates a Zoom API factory from the given configuration.
|
|
1594
1603
|
*
|
|
1595
|
-
* @param factoryConfig Configuration including OAuth context, rate limiting, and fetch settings
|
|
1596
|
-
* @returns A factory function that creates a configured Zoom API instance
|
|
1604
|
+
* @param factoryConfig - Configuration including OAuth context, rate limiting, and fetch settings.
|
|
1605
|
+
* @returns A factory function that creates a configured Zoom API instance.
|
|
1606
|
+
*
|
|
1597
1607
|
* @__NO_SIDE_EFFECTS__
|
|
1598
1608
|
*/ function zoomFactory(factoryConfig) {
|
|
1599
1609
|
var oauthContext = factoryConfig.oauthContext;
|
|
@@ -1708,9 +1718,9 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1708
1718
|
/**
|
|
1709
1719
|
* Builds a FetchJsonInput for Zoom OAuth API calls with Basic auth.
|
|
1710
1720
|
*
|
|
1711
|
-
* @param context The Zoom OAuth context
|
|
1712
|
-
* @param input Optional override for client credentials
|
|
1713
|
-
* @returns A configured FetchJsonInput for the OAuth API call
|
|
1721
|
+
* @param context - The Zoom OAuth context.
|
|
1722
|
+
* @param input - Optional override for client credentials.
|
|
1723
|
+
* @returns A configured FetchJsonInput for the OAuth API call.
|
|
1714
1724
|
*/ function zoomOAuthApiFetchJsonInput(context, input) {
|
|
1715
1725
|
var _ref, _ref1;
|
|
1716
1726
|
var _input_client, _input_client1;
|
|
@@ -1730,8 +1740,8 @@ function _ts_generator$1(thisArg, body) {
|
|
|
1730
1740
|
/**
|
|
1731
1741
|
* Generates a Basic Authorization header value for Zoom OAuth.
|
|
1732
1742
|
*
|
|
1733
|
-
* @param input The client ID and secret pair
|
|
1734
|
-
* @returns The Base64-encoded Basic auth header value
|
|
1743
|
+
* @param input - The client ID and secret pair.
|
|
1744
|
+
* @returns The Base64-encoded Basic auth header value.
|
|
1735
1745
|
*/ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
|
|
1736
1746
|
var credentials = input.clientId + ':' + input.clientSecret;
|
|
1737
1747
|
return "Basic ".concat(Buffer.from(credentials).toString('base64'));
|
|
@@ -1872,8 +1882,9 @@ function _ts_generator(thisArg, body) {
|
|
|
1872
1882
|
/**
|
|
1873
1883
|
* Creates a ZoomOAuth instance factory from the given configuration.
|
|
1874
1884
|
*
|
|
1875
|
-
* @param factoryConfig Configuration for the OAuth factory
|
|
1876
|
-
* @returns A factory that creates configured ZoomOAuth instances
|
|
1885
|
+
* @param factoryConfig - Configuration for the OAuth factory.
|
|
1886
|
+
* @returns A factory that creates configured ZoomOAuth instances.
|
|
1887
|
+
*
|
|
1877
1888
|
* @__NO_SIDE_EFFECTS__
|
|
1878
1889
|
*/ function zoomOAuthFactory(factoryConfig) {
|
|
1879
1890
|
var fetchHandler = zoomRateLimitedFetchHandler();
|
|
@@ -1981,10 +1992,11 @@ function _ts_generator(thisArg, body) {
|
|
|
1981
1992
|
};
|
|
1982
1993
|
}
|
|
1983
1994
|
/**
|
|
1984
|
-
* Creates a ZoomOAuthZoomAccessTokenFactoryConfig
|
|
1995
|
+
* Creates a ZoomOAuthZoomAccessTokenFactoryConfig.
|
|
1985
1996
|
*
|
|
1986
1997
|
* @param config
|
|
1987
1998
|
* @returns
|
|
1999
|
+
*
|
|
1988
2000
|
* @__NO_SIDE_EFFECTS__
|
|
1989
2001
|
*/ function zoomOAuthZoomAccessTokenFactory(config) {
|
|
1990
2002
|
var tokenRefresher = config.tokenRefresher, accessTokenCache = config.accessTokenCache, inputTokenExpirationBuffer = config.tokenExpirationBuffer;
|
package/nestjs/index.cjs.js
CHANGED
|
@@ -91,9 +91,9 @@ function _define_property$8(obj, key, value) {
|
|
|
91
91
|
/**
|
|
92
92
|
* Reads a ZoomOAuthServiceConfig from the NestJS ConfigService using environment variables.
|
|
93
93
|
*
|
|
94
|
-
* @param configService The NestJS ConfigService to read from
|
|
95
|
-
* @param prefix Optional prefix for environment variable names
|
|
96
|
-
* @returns A validated ZoomOAuthServiceConfig
|
|
94
|
+
* @param configService - The NestJS ConfigService to read from.
|
|
95
|
+
* @param prefix - Optional prefix for environment variable names.
|
|
96
|
+
* @returns A validated ZoomOAuthServiceConfig.
|
|
97
97
|
*/ function readZoomOAuthServiceConfigFromConfigService(configService, prefix) {
|
|
98
98
|
var prefixString = util.characterPrefixSuffixInstance({
|
|
99
99
|
suffix: '_',
|
|
@@ -428,7 +428,7 @@ function updateZoomCacheCapturingError(cache, accessToken) {
|
|
|
428
428
|
/**
|
|
429
429
|
* Default error logging function for merged cache service update failures.
|
|
430
430
|
*
|
|
431
|
-
* @param failedUpdates Array of failed cache update results with their errors
|
|
431
|
+
* @param failedUpdates - Array of failed cache update results with their errors.
|
|
432
432
|
*/ function logMergeZoomOAuthAccessTokenCacheServiceErrorFunction(failedUpdates) {
|
|
433
433
|
console.warn("mergeZoomOAuthAccessTokenCacheServices(): failed updating ".concat(failedUpdates.length, " caches."));
|
|
434
434
|
failedUpdates.forEach(function(param, i) {
|
|
@@ -448,9 +448,10 @@ function updateZoomCacheCapturingError(cache, accessToken) {
|
|
|
448
448
|
* never short-circuits the lookup. Updates run across all services in parallel via
|
|
449
449
|
* `Promise.allSettled`, mirroring the previous behavior, with optional error logging.
|
|
450
450
|
*
|
|
451
|
-
* @param inputServicesToMerge Must include at least one service. Empty arrays will throw an error.
|
|
452
|
-
* @param logError Optional error logging configuration. Pass a function, true for default logging, or false to disable.
|
|
453
|
-
* @returns A merged ZoomOAuthAccessTokenCacheService
|
|
451
|
+
* @param inputServicesToMerge - Must include at least one service. Empty arrays will throw an error.
|
|
452
|
+
* @param logError - Optional error logging configuration. Pass a function, true for default logging, or false to disable.
|
|
453
|
+
* @returns A merged ZoomOAuthAccessTokenCacheService.
|
|
454
|
+
* @throws {Error} When `inputServicesToMerge` is empty.
|
|
454
455
|
*/ function mergeZoomOAuthAccessTokenCacheServices(inputServicesToMerge, logError) {
|
|
455
456
|
var allServices = _to_consumable_array$2(inputServicesToMerge);
|
|
456
457
|
var logErrorFunction = typeof logError === 'function' ? logError : logError !== false ? logMergeZoomOAuthAccessTokenCacheServiceErrorFunction : undefined;
|
|
@@ -522,9 +523,9 @@ function updateZoomCacheCapturingError(cache, accessToken) {
|
|
|
522
523
|
*
|
|
523
524
|
* Backed by {@link inMemoryAsyncValueCache} so all consumers share the same single token slot.
|
|
524
525
|
*
|
|
525
|
-
* @param existingToken Optional initial token to seed the cache with
|
|
526
|
-
* @param logAccessToConsole Whether to log token access to console
|
|
527
|
-
* @returns A memory-backed ZoomOAuthAccessTokenCacheService
|
|
526
|
+
* @param existingToken - Optional initial token to seed the cache with.
|
|
527
|
+
* @param logAccessToConsole - Whether to log token access to console.
|
|
528
|
+
* @returns A memory-backed ZoomOAuthAccessTokenCacheService.
|
|
528
529
|
*/ function memoryZoomOAuthAccessTokenCacheService(existingToken, logAccessToConsole) {
|
|
529
530
|
var cache = util.inMemoryAsyncValueCache(existingToken);
|
|
530
531
|
function loadZoomAccessTokenCache() {
|
|
@@ -593,22 +594,26 @@ var DEFAULT_FILE_ZOOM_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoom-acce
|
|
|
593
594
|
* Reviver applied to the cached file payload on load so `expiresAt` is always a `Date`
|
|
594
595
|
* regardless of how it was serialized.
|
|
595
596
|
*
|
|
596
|
-
* @param raw -
|
|
597
|
-
* @returns
|
|
597
|
+
* @param raw - The raw JSON-parsed file payload.
|
|
598
|
+
* @returns The revived ZoomAccessToken, or undefined when the payload is empty/invalid.
|
|
598
599
|
*/ function reviveZoomAccessTokenFile(raw) {
|
|
600
|
+
var result;
|
|
599
601
|
if (raw == null || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== 'object') {
|
|
600
|
-
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
602
|
+
result = undefined;
|
|
603
|
+
} else {
|
|
604
|
+
var wrapper = raw;
|
|
605
|
+
var token = wrapper.token;
|
|
606
|
+
if (token == null) {
|
|
607
|
+
result = undefined;
|
|
608
|
+
} else {
|
|
609
|
+
var rawExpiresAt = token.expiresAt;
|
|
610
|
+
var expiresAt = rawExpiresAt != null && !_instanceof(rawExpiresAt, Date) ? new Date(rawExpiresAt) : rawExpiresAt;
|
|
611
|
+
result = _object_spread_props$2(_object_spread$3({}, token), {
|
|
612
|
+
expiresAt: expiresAt
|
|
613
|
+
});
|
|
614
|
+
}
|
|
606
615
|
}
|
|
607
|
-
|
|
608
|
-
var expiresAt = rawExpiresAt != null && !_instanceof(rawExpiresAt, Date) ? new Date(rawExpiresAt) : rawExpiresAt;
|
|
609
|
-
return _object_spread_props$2(_object_spread$3({}, token), {
|
|
610
|
-
expiresAt: expiresAt
|
|
611
|
-
});
|
|
616
|
+
return result;
|
|
612
617
|
}
|
|
613
618
|
/**
|
|
614
619
|
* Creates a ZoomOAuthAccessTokenCacheService that reads and writes the access token to the file system.
|
|
@@ -618,9 +623,9 @@ var DEFAULT_FILE_ZOOM_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoom-acce
|
|
|
618
623
|
*
|
|
619
624
|
* Useful for testing.
|
|
620
625
|
*
|
|
621
|
-
* @param filename Path to the token cache file
|
|
622
|
-
* @param useMemoryCache Whether to also cache tokens in memory for faster access
|
|
623
|
-
* @returns A file-system-backed ZoomOAuthAccessTokenCacheService
|
|
626
|
+
* @param filename - Path to the token cache file.
|
|
627
|
+
* @param useMemoryCache - Whether to also cache tokens in memory for faster access.
|
|
628
|
+
* @returns A file-system-backed ZoomOAuthAccessTokenCacheService.
|
|
624
629
|
*/ function fileZoomOAuthAccessTokenCacheService() {
|
|
625
630
|
var filename = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_FILE_ZOOM_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH, useMemoryCache = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
626
631
|
var innerCacheInput = {
|
|
@@ -679,7 +684,7 @@ var DEFAULT_FILE_ZOOM_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoom-acce
|
|
|
679
684
|
}
|
|
680
685
|
function readTokenFile() {
|
|
681
686
|
return _async_to_generator$2(function() {
|
|
682
|
-
var raw, token;
|
|
687
|
+
var raw, result, token;
|
|
683
688
|
return _ts_generator$2(this, function(_state) {
|
|
684
689
|
switch(_state.label){
|
|
685
690
|
case 0:
|
|
@@ -690,17 +695,16 @@ var DEFAULT_FILE_ZOOM_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoom-acce
|
|
|
690
695
|
case 1:
|
|
691
696
|
raw = _state.sent();
|
|
692
697
|
if (raw == null) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
698
|
+
result = undefined;
|
|
699
|
+
} else {
|
|
700
|
+
token = reviveZoomAccessTokenFile(raw);
|
|
701
|
+
result = {
|
|
702
|
+
token: token
|
|
703
|
+
};
|
|
697
704
|
}
|
|
698
|
-
token = reviveZoomAccessTokenFile(raw);
|
|
699
705
|
return [
|
|
700
706
|
2,
|
|
701
|
-
|
|
702
|
-
token: token
|
|
703
|
-
}
|
|
707
|
+
result
|
|
704
708
|
];
|
|
705
709
|
}
|
|
706
710
|
});
|
|
@@ -888,16 +892,16 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
888
892
|
/**
|
|
889
893
|
* Default factory function for creating ZoomOAuthServiceConfig from ConfigService.
|
|
890
894
|
*
|
|
891
|
-
* @param configService The NestJS ConfigService
|
|
892
|
-
* @returns A validated ZoomOAuthServiceConfig
|
|
895
|
+
* @param configService - The NestJS ConfigService.
|
|
896
|
+
* @returns A validated ZoomOAuthServiceConfig.
|
|
893
897
|
*/ function zoomOAuthServiceConfigFactory(configService) {
|
|
894
898
|
return readZoomOAuthServiceConfigFromConfigService(configService);
|
|
895
899
|
}
|
|
896
900
|
/**
|
|
897
901
|
* Convenience function used to generate ModuleMetadata for an app's ZoomOAuthModule.
|
|
898
902
|
*
|
|
899
|
-
* @param config The configuration for the module metadata
|
|
900
|
-
* @returns Module metadata for the Zoom OAuth module
|
|
903
|
+
* @param config - The configuration for the module metadata.
|
|
904
|
+
* @returns Module metadata for the Zoom OAuth module.
|
|
901
905
|
*/ function appZoomOAuthModuleMetadata(config$1) {
|
|
902
906
|
var _config_zoomOAuthServiceConfigFactory;
|
|
903
907
|
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
@@ -1073,10 +1077,10 @@ var zoomEventHandlerConfigurerFactory = util.handlerConfigurerFactory({
|
|
|
1073
1077
|
/**
|
|
1074
1078
|
* Verifies a Zoom webhook event header.
|
|
1075
1079
|
*
|
|
1076
|
-
* @
|
|
1080
|
+
* @param zoomSecretToken - The Zoom secret token.
|
|
1081
|
+
* @returns Verifies a Zoom webhook event.
|
|
1077
1082
|
*
|
|
1078
|
-
* @
|
|
1079
|
-
* @returns A function that verifies a Zoom webhook event.
|
|
1083
|
+
* @see https://developers.zoom.us/docs/api/webhooks/#verify-with-zooms-header
|
|
1080
1084
|
*/ function zoomWebhookEventVerifier(zoomSecretToken) {
|
|
1081
1085
|
return function(request, _rawBody) {
|
|
1082
1086
|
var requestBodyString = String(request.body);
|
|
@@ -1097,7 +1101,7 @@ var ZOOM_WEBHOOK_URL_VALIDATION_EVENT_TYPE = 'endpoint.url_validation';
|
|
|
1097
1101
|
/**
|
|
1098
1102
|
* Creates a ZoomWebhookEventValidationFunction.
|
|
1099
1103
|
*
|
|
1100
|
-
* @param zoomSecretToken The secret token used to validate the event.
|
|
1104
|
+
* @param zoomSecretToken - The secret token used to validate the event.
|
|
1101
1105
|
* @returns A ZoomWebhookEventValidationFunction.
|
|
1102
1106
|
*/ function zoomWebhookEventValidationFunction(zoomSecretToken) {
|
|
1103
1107
|
return function(event) {
|
|
@@ -1591,8 +1595,8 @@ function _class_call_check$2(instance, Constructor) {
|
|
|
1591
1595
|
/**
|
|
1592
1596
|
* Factory function that creates ZoomWebhookServiceConfig from NestJS ConfigService.
|
|
1593
1597
|
*
|
|
1594
|
-
* @param configService The NestJS ConfigService
|
|
1595
|
-
* @returns A validated ZoomWebhookServiceConfig
|
|
1598
|
+
* @param configService - The NestJS ConfigService.
|
|
1599
|
+
* @returns A validated ZoomWebhookServiceConfig.
|
|
1596
1600
|
*/ function zoomWebhookServiceConfigFactory(configService) {
|
|
1597
1601
|
var config = {
|
|
1598
1602
|
webhookConfig: {
|
|
@@ -1883,8 +1887,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
1883
1887
|
/**
|
|
1884
1888
|
* Default factory function for creating ZoomServiceConfig from ConfigService.
|
|
1885
1889
|
*
|
|
1886
|
-
* @param _configService The NestJS ConfigService (unused currently)
|
|
1887
|
-
* @returns A validated ZoomServiceConfig
|
|
1890
|
+
* @param _configService - The NestJS ConfigService (unused currently)
|
|
1891
|
+
* @returns A validated ZoomServiceConfig.
|
|
1888
1892
|
*/ function zoomServiceConfigFactory(_configService) {
|
|
1889
1893
|
var config = {
|
|
1890
1894
|
zoom: {}
|
|
@@ -1895,8 +1899,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
1895
1899
|
/**
|
|
1896
1900
|
* Convenience function used to generate ModuleMetadata for an app's ZoomModule.
|
|
1897
1901
|
*
|
|
1898
|
-
* @param config The configuration for the module metadata
|
|
1899
|
-
* @returns Module metadata for the Zoom module
|
|
1902
|
+
* @param config - The configuration for the module metadata.
|
|
1903
|
+
* @returns Module metadata for the Zoom module.
|
|
1900
1904
|
*/ function appZoomModuleMetadata(config$1) {
|
|
1901
1905
|
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
1902
1906
|
var dependencyModuleImport = dependencyModule ? [
|