@dereekb/calcom 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.
Files changed (31) hide show
  1. package/index.cjs.js +98 -89
  2. package/index.esm.js +98 -89
  3. package/nestjs/index.cjs.js +79 -74
  4. package/nestjs/index.esm.js +79 -74
  5. package/nestjs/package.json +5 -5
  6. package/nestjs/src/lib/calcom/calcom.api.d.ts +24 -24
  7. package/nestjs/src/lib/calcom/calcom.module.d.ts +4 -4
  8. package/nestjs/src/lib/oauth/oauth.api.d.ts +7 -7
  9. package/nestjs/src/lib/oauth/oauth.config.d.ts +2 -2
  10. package/nestjs/src/lib/oauth/oauth.module.d.ts +2 -2
  11. package/nestjs/src/lib/oauth/oauth.service.d.ts +12 -11
  12. package/nestjs/src/lib/webhook/webhook.calcom.d.ts +2 -2
  13. package/nestjs/src/lib/webhook/webhook.calcom.module.d.ts +4 -4
  14. package/nestjs/src/lib/webhook/webhook.calcom.verify.d.ts +2 -2
  15. package/package.json +4 -4
  16. package/src/lib/calcom/calcom.api.booking.d.ts +10 -9
  17. package/src/lib/calcom/calcom.api.calendar.d.ts +6 -6
  18. package/src/lib/calcom/calcom.api.eventtype.d.ts +15 -14
  19. package/src/lib/calcom/calcom.api.schedule.d.ts +3 -3
  20. package/src/lib/calcom/calcom.api.slot.d.ts +3 -3
  21. package/src/lib/calcom/calcom.api.user.d.ts +6 -6
  22. package/src/lib/calcom/calcom.api.webhook.d.ts +19 -18
  23. package/src/lib/calcom/calcom.error.api.d.ts +5 -5
  24. package/src/lib/calcom/calcom.factory.d.ts +3 -2
  25. package/src/lib/calcom.error.api.d.ts +12 -10
  26. package/src/lib/calcom.limit.d.ts +2 -2
  27. package/src/lib/oauth/oauth.api.d.ts +6 -6
  28. package/src/lib/oauth/oauth.d.ts +3 -2
  29. package/src/lib/oauth/oauth.error.api.d.ts +5 -5
  30. package/src/lib/oauth/oauth.factory.d.ts +8 -6
  31. package/src/lib/shared/calcom.api-version.d.ts +2 -2
@@ -91,8 +91,8 @@ var CALCOM_API_KEY_CONFIG_KEY = 'CALCOM_API_KEY';
91
91
  /**
92
92
  * Factory function that creates a {@link CalcomOAuthServiceConfig} from NestJS ConfigService environment variables.
93
93
  *
94
- * @param configService - the NestJS ConfigService instance
95
- * @returns a validated CalcomOAuthServiceConfig
94
+ * @param configService - The NestJS ConfigService instance.
95
+ * @returns A validated CalcomOAuthServiceConfig.
96
96
  */ function calcomOAuthServiceConfigFactory(configService) {
97
97
  var clientId = configService.get(CALCOM_CLIENT_ID_CONFIG_KEY);
98
98
  var clientSecret = configService.get(CALCOM_CLIENT_SECRET_CONFIG_KEY);
@@ -377,8 +377,8 @@ CalcomOAuthAccessTokenCacheService = __decorate([
377
377
  *
378
378
  * Uses SHA-256 truncated to 16 hex chars; the goal is fingerprinting, not security.
379
379
  *
380
- * @param refreshToken - the OAuth refresh token to hash
381
- * @returns a 16-character hex string suitable for use as a cache key
380
+ * @param refreshToken - The OAuth refresh token to hash.
381
+ * @returns A 16-character hex string suitable for use as a cache key.
382
382
  */ function calcomRefreshTokenCacheKey(refreshToken) {
383
383
  return createHash('sha256').update(refreshToken).digest('hex').substring(0, 16);
384
384
  }
@@ -436,7 +436,7 @@ function updateCalcomCacheCapturingError(cache, accessToken) {
436
436
  * Default error logging function for {@link mergeCalcomOAuthAccessTokenCacheServices}.
437
437
  * Logs a warning for each cache that failed to update.
438
438
  *
439
- * @param failedUpdates - array of tuples containing the failed cache and its error
439
+ * @param failedUpdates - Array of tuples containing the failed cache and its error.
440
440
  */ function logMergeCalcomOAuthAccessTokenCacheServiceErrorFunction(failedUpdates) {
441
441
  console.warn("mergeCalcomOAuthAccessTokenCacheServices(): failed updating ".concat(failedUpdates.length, " caches."));
442
442
  failedUpdates.forEach(function(param, i) {
@@ -455,9 +455,10 @@ function updateCalcomCacheCapturingError(cache, accessToken) {
455
455
  * never short-circuits the lookup. Updates run across all services in parallel via
456
456
  * `Promise.allSettled`, mirroring the previous behavior, with optional error logging.
457
457
  *
458
- * @param inputServicesToMerge Must include at least one service. Empty arrays will throw an error.
459
- * @param logError - optional error logging configuration; pass a function, true for default logging, or false to disable
460
- * @returns a merged CalcomOAuthAccessTokenCacheService that delegates across all input services
458
+ * @param inputServicesToMerge - Must include at least one service. Empty arrays will throw an error.
459
+ * @param logError - Optional error logging configuration; pass a function, true for default logging, or false to disable.
460
+ * @returns A merged CalcomOAuthAccessTokenCacheService that delegates across all input services.
461
+ * @throws {Error} When `inputServicesToMerge` is empty.
461
462
  */ function mergeCalcomOAuthAccessTokenCacheServices(inputServicesToMerge, logError) {
462
463
  var allServices = _to_consumable_array$3(inputServicesToMerge);
463
464
  var logErrorFunction = typeof logError === 'function' ? logError : logError !== false ? logMergeCalcomOAuthAccessTokenCacheServiceErrorFunction : undefined;
@@ -526,9 +527,9 @@ function updateCalcomCacheCapturingError(cache, accessToken) {
526
527
  /**
527
528
  * Adapts an {@link AsyncValueCache} to a {@link CalcomAccessTokenCache}, optionally logging cache reads/writes to the console.
528
529
  *
529
- * @param cache - underlying single-value cache for the access token
530
- * @param logAccessToConsole - when true, logs reads and writes to the console
531
- * @returns the CalcomAccessTokenCache backed by the given async cache
530
+ * @param cache - Underlying single-value cache for the access token.
531
+ * @param logAccessToConsole - When true, logs reads and writes to the console.
532
+ * @returns The CalcomAccessTokenCache backed by the given async cache.
532
533
  */ function calcomAccessTokenCacheFromAsyncValueCache(cache, logAccessToConsole) {
533
534
  return {
534
535
  loadCachedToken: function loadCachedToken() {
@@ -589,9 +590,9 @@ function updateCalcomCacheCapturingError(cache, accessToken) {
589
590
  * per-user tokens are held in an {@link inMemoryAsyncKeyedValueCache} keyed by the
590
591
  * sha256-truncated refresh token hash.
591
592
  *
592
- * @param existingToken - optional pre-existing server-level access token to seed the cache
593
- * @param logAccessToConsole - when true, logs all cache reads and writes to console
594
- * @returns a CalcomOAuthAccessTokenCacheService backed by in-memory caches
593
+ * @param existingToken - Optional pre-existing server-level access token to seed the cache.
594
+ * @param logAccessToConsole - When true, logs all cache reads and writes to console.
595
+ * @returns A CalcomOAuthAccessTokenCacheService backed by in-memory caches.
595
596
  */ function memoryCalcomOAuthAccessTokenCacheService(existingToken, logAccessToConsole) {
596
597
  var serverCache = inMemoryAsyncValueCache(existingToken);
597
598
  var userCache = inMemoryAsyncKeyedValueCache();
@@ -625,22 +626,26 @@ var CALCOM_SERVER_TOKEN_FILE_KEY = 'server';
625
626
  * Reviver applied to the cached file payload on load so `expiresAt` is always a `Date`
626
627
  * regardless of how it was serialized.
627
628
  *
628
- * @param raw - the raw JSON-parsed file payload
629
- * @returns the revived CalcomAccessToken, or undefined when the payload is empty/invalid
629
+ * @param raw - The raw JSON-parsed file payload.
630
+ * @returns The revived CalcomAccessToken, or undefined when the payload is empty/invalid.
630
631
  */ function reviveCalcomAccessTokenFile(raw) {
632
+ var result;
631
633
  if (raw == null || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== 'object') {
632
- return undefined;
633
- }
634
- var wrapper = raw;
635
- var token = wrapper.token;
636
- if (token == null) {
637
- return undefined;
634
+ result = undefined;
635
+ } else {
636
+ var wrapper = raw;
637
+ var token = wrapper.token;
638
+ if (token == null) {
639
+ result = undefined;
640
+ } else {
641
+ var rawExpiresAt = token.expiresAt;
642
+ var expiresAt = rawExpiresAt != null && !_instanceof(rawExpiresAt, Date) ? new Date(rawExpiresAt) : rawExpiresAt;
643
+ result = _object_spread_props$2(_object_spread$2({}, token), {
644
+ expiresAt: expiresAt
645
+ });
646
+ }
638
647
  }
639
- var rawExpiresAt = token.expiresAt;
640
- var expiresAt = rawExpiresAt != null && !_instanceof(rawExpiresAt, Date) ? new Date(rawExpiresAt) : rawExpiresAt;
641
- return _object_spread_props$2(_object_spread$2({}, token), {
642
- expiresAt: expiresAt
643
- });
648
+ return result;
644
649
  }
645
650
  /**
646
651
  * Creates a CalcomOAuthAccessTokenCacheService that reads and writes access tokens
@@ -656,8 +661,8 @@ var CALCOM_SERVER_TOKEN_FILE_KEY = 'server';
656
661
  * user-<sha256hash>.json — per-user tokens (hash of initial refresh token)
657
662
  * ```
658
663
  *
659
- * @param cacheDir Directory to store token files. Defaults to `.tmp/calcom-tokens`.
660
- * @returns a CalcomOAuthAccessTokenCacheService backed by the file system
664
+ * @param cacheDir - Directory to store token files. Defaults to `.tmp/calcom-tokens`.
665
+ * @returns A CalcomOAuthAccessTokenCacheService backed by the file system.
661
666
  */ function fileCalcomOAuthAccessTokenCacheService() {
662
667
  var cacheDir = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_FILE_CALCOM_ACCESS_TOKEN_CACHE_DIR;
663
668
  var cachesByKey = new Map();
@@ -793,7 +798,7 @@ var CalcomOAuthApi = /*#__PURE__*/ function() {
793
798
  /**
794
799
  * Configured pass-through for {@link exchangeAuthorizationCode}.
795
800
  *
796
- * @returns function to exchange an OAuth authorization code for tokens
801
+ * @returns Function to exchange an OAuth authorization code for tokens.
797
802
  */ function get() {
798
803
  return exchangeAuthorizationCode(this.oauthContext);
799
804
  }
@@ -802,10 +807,10 @@ var CalcomOAuthApi = /*#__PURE__*/ function() {
802
807
  /**
803
808
  * Retrieves an access token for a specific user using their refresh token.
804
809
  *
805
- * @param input - contains the user's refresh token and optional access token cache
806
- * @param input.refreshToken - the user's OAuth refresh token
807
- * @param input.userAccessTokenCache - optional cache to store/retrieve the user's access token
808
- * @returns a promise resolving to the user's CalcomAccessToken
810
+ * @param input - Contains the user's refresh token and optional access token cache.
811
+ * @param input.refreshToken - The user's OAuth refresh token.
812
+ * @param input.userAccessTokenCache - Optional cache to store/retrieve the user's access token.
813
+ * @returns Promise resolving to the user's CalcomAccessToken.
809
814
  */ key: "userAccessToken",
810
815
  value: function userAccessToken(input) {
811
816
  var factory = this.oauthContext.makeUserAccessTokenFactory(input);
@@ -817,8 +822,8 @@ var CalcomOAuthApi = /*#__PURE__*/ function() {
817
822
  * Returns a per-user CalcomAccessTokenCache derived from the refresh token (md5 hashed as the file key).
818
823
  * Returns undefined if the cache service does not support per-user caching.
819
824
  *
820
- * @param refreshToken - the user's OAuth refresh token used to derive the cache key
821
- * @returns a per-user access token cache, or undefined if not supported
825
+ * @param refreshToken - The user's OAuth refresh token used to derive the cache key.
826
+ * @returns A per-user access token cache, or undefined if not supported.
822
827
  */ key: "cacheForRefreshToken",
823
828
  value: function cacheForRefreshToken(refreshToken) {
824
829
  var _this_cacheService_cacheForRefreshToken, _this_cacheService;
@@ -862,8 +867,8 @@ function _unsupported_iterable_to_array$2(o, minLen) {
862
867
  /**
863
868
  * Convenience function used to generate ModuleMetadata for an app's CalcomOAuthModule.
864
869
  *
865
- * @param config - the module metadata configuration including optional dependency module and config factory
866
- * @returns NestJS ModuleMetadata for registering the CalcomOAuthModule
870
+ * @param config - The module metadata configuration including optional dependency module and config factory.
871
+ * @returns NestJS ModuleMetadata for registering the CalcomOAuthModule.
867
872
  */ function appCalcomOAuthModuleMetadata(config) {
868
873
  var _config_calcomOAuthServiceConfigFactory;
869
874
  var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers;
@@ -1057,7 +1062,7 @@ function _object_spread_props$1(target, source) {
1057
1062
  * Returns the cached {@link CalcomApiContextInstance} for the server context.
1058
1063
  * All API functions are available through this instance.
1059
1064
  *
1060
- * @returns the server context instance
1065
+ * @returns The server context instance.
1061
1066
  */ function get() {
1062
1067
  return this._serverInstance();
1063
1068
  }
@@ -1068,7 +1073,7 @@ function _object_spread_props$1(target, source) {
1068
1073
  /**
1069
1074
  * Configured pass-through for {@link getAvailableSlots} using the public (unauthenticated) context.
1070
1075
  *
1071
- * @returns function to query available slots without authentication
1076
+ * @returns Function to query available slots without authentication.
1072
1077
  */ function get() {
1073
1078
  return getAvailableSlots(this._publicContext());
1074
1079
  }
@@ -1083,8 +1088,8 @@ function _object_spread_props$1(target, source) {
1083
1088
  * resolved from the cache service using an md5 hash of the refresh token as the key.
1084
1089
  * This ensures tokens persist across requests and server restarts without collisions.
1085
1090
  *
1086
- * @param input - the user context factory input containing the refresh token and optional cache
1087
- * @returns a new CalcomApiContextInstance scoped to the user
1091
+ * @param input - The user context factory input containing the refresh token and optional cache.
1092
+ * @returns A new CalcomApiContextInstance scoped to the user.
1088
1093
  *
1089
1094
  * @example
1090
1095
  * ```ts
@@ -1117,8 +1122,8 @@ function _object_spread_props$1(target, source) {
1117
1122
  /**
1118
1123
  * Creates a {@link CalcomApiContextInstance} from any {@link CalcomContext}.
1119
1124
  *
1120
- * @param context - the CalcomContext (server or user) to wrap
1121
- * @returns a new CalcomApiContextInstance bound to the given context
1125
+ * @param context - The CalcomContext (server or user) to wrap.
1126
+ * @returns A new CalcomApiContextInstance bound to the given context.
1122
1127
  */ key: "makeContextInstance",
1123
1128
  value: function makeContextInstance(context) {
1124
1129
  return new CalcomApiContextInstance(this, context);
@@ -1129,8 +1134,8 @@ function _object_spread_props$1(target, source) {
1129
1134
  * Creates a raw {@link CalcomUserContext} from a refresh token, without wrapping in a {@link CalcomApiContextInstance}.
1130
1135
  * Prefer {@link makeUserContextInstance} unless you need direct context access.
1131
1136
  *
1132
- * @param input - the user context factory input containing the refresh token and optional cache
1133
- * @returns a CalcomUserContext for the given user
1137
+ * @param input - The user context factory input containing the refresh token and optional cache.
1138
+ * @returns A CalcomUserContext for the given user.
1134
1139
  */ key: "makeUserContext",
1135
1140
  value: function makeUserContext(input) {
1136
1141
  return this.calcom.calcomServerContext.makeUserContext(input);
@@ -1178,7 +1183,7 @@ CalcomApi = __decorate([
1178
1183
  /**
1179
1184
  * Configured pass-through for {@link getMe}.
1180
1185
  *
1181
- * @returns function to retrieve the authenticated user's profile
1186
+ * @returns Function to retrieve the authenticated user's profile.
1182
1187
  */ function get() {
1183
1188
  return getMe(this.context);
1184
1189
  }
@@ -1189,7 +1194,7 @@ CalcomApi = __decorate([
1189
1194
  /**
1190
1195
  * Configured pass-through for {@link getSchedules}.
1191
1196
  *
1192
- * @returns function to retrieve all schedules for the authenticated user
1197
+ * @returns Function to retrieve all schedules for the authenticated user.
1193
1198
  */ function get() {
1194
1199
  return getSchedules(this.context);
1195
1200
  }
@@ -1200,7 +1205,7 @@ CalcomApi = __decorate([
1200
1205
  /**
1201
1206
  * Configured pass-through for {@link createBooking}.
1202
1207
  *
1203
- * @returns function to create a new booking
1208
+ * @returns Function to create a new booking.
1204
1209
  */ function get() {
1205
1210
  return createBooking(this.context);
1206
1211
  }
@@ -1210,7 +1215,7 @@ CalcomApi = __decorate([
1210
1215
  get: /**
1211
1216
  * Configured pass-through for {@link getBooking}.
1212
1217
  *
1213
- * @returns function to retrieve a booking by UID
1218
+ * @returns Function to retrieve a booking by UID.
1214
1219
  */ function get() {
1215
1220
  return getBooking(this.context);
1216
1221
  }
@@ -1220,7 +1225,7 @@ CalcomApi = __decorate([
1220
1225
  get: /**
1221
1226
  * Configured pass-through for {@link cancelBooking}.
1222
1227
  *
1223
- * @returns function to cancel a booking by UID
1228
+ * @returns Function to cancel a booking by UID.
1224
1229
  */ function get() {
1225
1230
  return cancelBooking(this.context);
1226
1231
  }
@@ -1231,7 +1236,7 @@ CalcomApi = __decorate([
1231
1236
  /**
1232
1237
  * Configured pass-through for {@link getEventTypes}.
1233
1238
  *
1234
- * @returns function to retrieve all event types for the authenticated user
1239
+ * @returns Function to retrieve all event types for the authenticated user.
1235
1240
  */ function get() {
1236
1241
  return getEventTypes(this.context);
1237
1242
  }
@@ -1241,7 +1246,7 @@ CalcomApi = __decorate([
1241
1246
  get: /**
1242
1247
  * Configured pass-through for {@link createEventType}.
1243
1248
  *
1244
- * @returns function to create a new event type
1249
+ * @returns Function to create a new event type.
1245
1250
  */ function get() {
1246
1251
  return createEventType(this.context);
1247
1252
  }
@@ -1251,7 +1256,7 @@ CalcomApi = __decorate([
1251
1256
  get: /**
1252
1257
  * Configured pass-through for {@link updateEventType}.
1253
1258
  *
1254
- * @returns function to update an existing event type by ID
1259
+ * @returns Function to update an existing event type by ID.
1255
1260
  */ function get() {
1256
1261
  return updateEventType(this.context);
1257
1262
  }
@@ -1261,7 +1266,7 @@ CalcomApi = __decorate([
1261
1266
  get: /**
1262
1267
  * Configured pass-through for {@link deleteEventType}.
1263
1268
  *
1264
- * @returns function to delete an event type by ID
1269
+ * @returns Function to delete an event type by ID.
1265
1270
  */ function get() {
1266
1271
  return deleteEventType(this.context);
1267
1272
  }
@@ -1272,7 +1277,7 @@ CalcomApi = __decorate([
1272
1277
  /**
1273
1278
  * Configured pass-through for {@link getCalendars}.
1274
1279
  *
1275
- * @returns function to retrieve all connected calendars
1280
+ * @returns Function to retrieve all connected calendars.
1276
1281
  */ function get() {
1277
1282
  return getCalendars(this.context);
1278
1283
  }
@@ -1282,7 +1287,7 @@ CalcomApi = __decorate([
1282
1287
  get: /**
1283
1288
  * Configured pass-through for {@link getBusyTimes}.
1284
1289
  *
1285
- * @returns function to retrieve busy time ranges across connected calendars
1290
+ * @returns Function to retrieve busy time ranges across connected calendars.
1286
1291
  */ function get() {
1287
1292
  return getBusyTimes(this.context);
1288
1293
  }
@@ -1293,7 +1298,7 @@ CalcomApi = __decorate([
1293
1298
  /**
1294
1299
  * Configured pass-through for {@link createWebhook}.
1295
1300
  *
1296
- * @returns function to create a webhook subscription
1301
+ * @returns Function to create a webhook subscription.
1297
1302
  */ function get() {
1298
1303
  return createWebhook(this.context);
1299
1304
  }
@@ -1303,7 +1308,7 @@ CalcomApi = __decorate([
1303
1308
  get: /**
1304
1309
  * Configured pass-through for {@link getWebhooks}.
1305
1310
  *
1306
- * @returns function to retrieve all webhooks
1311
+ * @returns Function to retrieve all webhooks.
1307
1312
  */ function get() {
1308
1313
  return getWebhooks(this.context);
1309
1314
  }
@@ -1313,7 +1318,7 @@ CalcomApi = __decorate([
1313
1318
  get: /**
1314
1319
  * Configured pass-through for {@link getWebhook}.
1315
1320
  *
1316
- * @returns function to retrieve a specific webhook by ID
1321
+ * @returns Function to retrieve a specific webhook by ID.
1317
1322
  */ function get() {
1318
1323
  return getWebhook(this.context);
1319
1324
  }
@@ -1323,7 +1328,7 @@ CalcomApi = __decorate([
1323
1328
  get: /**
1324
1329
  * Configured pass-through for {@link updateWebhook}.
1325
1330
  *
1326
- * @returns function to update an existing webhook by ID
1331
+ * @returns Function to update an existing webhook by ID.
1327
1332
  */ function get() {
1328
1333
  return updateWebhook(this.context);
1329
1334
  }
@@ -1333,7 +1338,7 @@ CalcomApi = __decorate([
1333
1338
  get: /**
1334
1339
  * Configured pass-through for {@link deleteWebhook}.
1335
1340
  *
1336
- * @returns function to delete a webhook by ID
1341
+ * @returns Function to delete a webhook by ID.
1337
1342
  */ function get() {
1338
1343
  return deleteWebhook(this.context);
1339
1344
  }
@@ -1372,8 +1377,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
1372
1377
  /**
1373
1378
  * Factory function that creates a {@link CalcomServiceConfig} from NestJS ConfigService values.
1374
1379
  *
1375
- * @param _configService - the NestJS ConfigService instance
1376
- * @returns a validated CalcomServiceConfig
1380
+ * @param _configService - The NestJS ConfigService instance.
1381
+ * @returns A validated CalcomServiceConfig.
1377
1382
  */ function calcomServiceConfigFactory(_configService) {
1378
1383
  var config = {
1379
1384
  calcom: {}
@@ -1384,8 +1389,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
1384
1389
  /**
1385
1390
  * Convenience function used to generate ModuleMetadata for an app's CalcomModule.
1386
1391
  *
1387
- * @param config - the module metadata configuration including optional dependency module
1388
- * @returns NestJS ModuleMetadata for registering the CalcomModule
1392
+ * @param config - The module metadata configuration including optional dependency module.
1393
+ * @returns NestJS ModuleMetadata for registering the CalcomModule.
1389
1394
  */ function appCalcomModuleMetadata(config) {
1390
1395
  var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers;
1391
1396
  var dependencyModuleImport = dependencyModule ? [
@@ -1467,8 +1472,8 @@ function _object_spread_props(target, source) {
1467
1472
  /**
1468
1473
  * Creates a CalcomWebhookEvent and treats the data as the input type.
1469
1474
  *
1470
- * @param event - the untyped webhook event to convert
1471
- * @returns a typed CalcomWebhookEvent with the payload cast to type T
1475
+ * @param event - The untyped webhook event to convert.
1476
+ * @returns A typed CalcomWebhookEvent with the payload cast to type T.
1472
1477
  */ function calcomWebhookEvent(event) {
1473
1478
  return {
1474
1479
  triggerEvent: event.triggerEvent,
@@ -1548,8 +1553,8 @@ var CALCOM_WEBHOOK_SECRET_CONFIG_KEY = 'CALCOM_WEBHOOK_SECRET';
1548
1553
  /**
1549
1554
  * Verifies a Cal.com webhook event using HMAC-SHA256 signature.
1550
1555
  *
1551
- * @param secret The webhook signing secret.
1552
- * @returns A function that verifies a Cal.com webhook event.
1556
+ * @param secret - The webhook signing secret.
1557
+ * @returns Verifies a Cal.com webhook event.
1553
1558
  */ function calcomWebhookEventVerifier(secret) {
1554
1559
  return function(rawBody, headers) {
1555
1560
  var _headers_xcalsignature256;
@@ -2060,8 +2065,8 @@ function _unsupported_iterable_to_array(o, minLen) {
2060
2065
  /**
2061
2066
  * Factory function that creates a {@link CalcomWebhookServiceConfig} from NestJS ConfigService environment variables.
2062
2067
  *
2063
- * @param configService - the NestJS ConfigService instance
2064
- * @returns a validated CalcomWebhookServiceConfig
2068
+ * @param configService - The NestJS ConfigService instance.
2069
+ * @returns A validated CalcomWebhookServiceConfig.
2065
2070
  */ function calcomWebhookServiceConfigFactory(configService) {
2066
2071
  var config = {
2067
2072
  webhookConfig: {
@@ -2102,8 +2107,8 @@ CalcomWebhookModule = __decorate([
2102
2107
  /**
2103
2108
  * Convenience function used to generate ModuleMetadata for an app's CalcomWebhookModule.
2104
2109
  *
2105
- * @param config - the module metadata configuration including optional dependency module
2106
- * @returns NestJS ModuleMetadata for registering the CalcomWebhookModule
2110
+ * @param config - The module metadata configuration including optional dependency module.
2111
+ * @returns NestJS ModuleMetadata for registering the CalcomWebhookModule.
2107
2112
  */ function appCalcomWebhookModuleMetadata(config) {
2108
2113
  var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers;
2109
2114
  var dependencyModuleImport = dependencyModule ? [
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/calcom/nestjs",
3
- "version": "13.11.13",
3
+ "version": "13.11.15",
4
4
  "peerDependencies": {
5
- "@dereekb/nestjs": "13.11.13",
6
- "@dereekb/rxjs": "13.11.13",
7
- "@dereekb/util": "13.11.13",
8
- "@dereekb/calcom": "13.11.13",
5
+ "@dereekb/nestjs": "13.11.15",
6
+ "@dereekb/rxjs": "13.11.15",
7
+ "@dereekb/util": "13.11.15",
8
+ "@dereekb/calcom": "13.11.15",
9
9
  "@nestjs/common": "^11.1.19",
10
10
  "@nestjs/config": "^4.0.4",
11
11
  "express": "^5.2.1"
@@ -33,13 +33,13 @@ export declare class CalcomApi {
33
33
  * Returns the cached {@link CalcomApiContextInstance} for the server context.
34
34
  * All API functions are available through this instance.
35
35
  *
36
- * @returns the server context instance
36
+ * @returns The server context instance.
37
37
  */
38
38
  get serverContextInstance(): CalcomApiContextInstance;
39
39
  /**
40
40
  * Configured pass-through for {@link getAvailableSlots} using the public (unauthenticated) context.
41
41
  *
42
- * @returns function to query available slots without authentication
42
+ * @returns Function to query available slots without authentication.
43
43
  */
44
44
  get getAvailableSlots(): (input: import("@dereekb/calcom").CalcomGetAvailableSlotsInput) => Promise<import("@dereekb/calcom").CalcomGetAvailableSlotsResponse>;
45
45
  /**
@@ -50,8 +50,8 @@ export declare class CalcomApi {
50
50
  * resolved from the cache service using an md5 hash of the refresh token as the key.
51
51
  * This ensures tokens persist across requests and server restarts without collisions.
52
52
  *
53
- * @param input - the user context factory input containing the refresh token and optional cache
54
- * @returns a new CalcomApiContextInstance scoped to the user
53
+ * @param input - The user context factory input containing the refresh token and optional cache.
54
+ * @returns A new CalcomApiContextInstance scoped to the user.
55
55
  *
56
56
  * @example
57
57
  * ```ts
@@ -71,16 +71,16 @@ export declare class CalcomApi {
71
71
  /**
72
72
  * Creates a {@link CalcomApiContextInstance} from any {@link CalcomContext}.
73
73
  *
74
- * @param context - the CalcomContext (server or user) to wrap
75
- * @returns a new CalcomApiContextInstance bound to the given context
74
+ * @param context - The CalcomContext (server or user) to wrap.
75
+ * @returns A new CalcomApiContextInstance bound to the given context.
76
76
  */
77
77
  makeContextInstance(context: CalcomContext): CalcomApiContextInstance;
78
78
  /**
79
79
  * Creates a raw {@link CalcomUserContext} from a refresh token, without wrapping in a {@link CalcomApiContextInstance}.
80
80
  * Prefer {@link makeUserContextInstance} unless you need direct context access.
81
81
  *
82
- * @param input - the user context factory input containing the refresh token and optional cache
83
- * @returns a CalcomUserContext for the given user
82
+ * @param input - The user context factory input containing the refresh token and optional cache.
83
+ * @returns A CalcomUserContext for the given user.
84
84
  */
85
85
  makeUserContext(input: CalcomUserContextFactoryInput): CalcomUserContext;
86
86
  }
@@ -111,97 +111,97 @@ export declare class CalcomApiContextInstance {
111
111
  /**
112
112
  * Configured pass-through for {@link getMe}.
113
113
  *
114
- * @returns function to retrieve the authenticated user's profile
114
+ * @returns Function to retrieve the authenticated user's profile.
115
115
  */
116
116
  get getMe(): () => Promise<import("@dereekb/calcom").CalcomGetMeResponse>;
117
117
  /**
118
118
  * Configured pass-through for {@link getSchedules}.
119
119
  *
120
- * @returns function to retrieve all schedules for the authenticated user
120
+ * @returns Function to retrieve all schedules for the authenticated user.
121
121
  */
122
122
  get getSchedules(): () => Promise<import("@dereekb/calcom").CalcomGetSchedulesResponse>;
123
123
  /**
124
124
  * Configured pass-through for {@link createBooking}.
125
125
  *
126
- * @returns function to create a new booking
126
+ * @returns Function to create a new booking.
127
127
  */
128
128
  get createBooking(): (input: import("@dereekb/calcom").CalcomCreateBookingInput) => Promise<import("@dereekb/calcom").CalcomCreateBookingResponse>;
129
129
  /**
130
130
  * Configured pass-through for {@link getBooking}.
131
131
  *
132
- * @returns function to retrieve a booking by UID
132
+ * @returns Function to retrieve a booking by UID.
133
133
  */
134
134
  get getBooking(): (uid: import("@dereekb/calcom").CalcomBookingUid) => Promise<import("@dereekb/calcom").CalcomGetBookingResponse>;
135
135
  /**
136
136
  * Configured pass-through for {@link cancelBooking}.
137
137
  *
138
- * @returns function to cancel a booking by UID
138
+ * @returns Function to cancel a booking by UID.
139
139
  */
140
140
  get cancelBooking(): (input: import("@dereekb/calcom").CalcomCancelBookingInput) => Promise<import("@dereekb/calcom").CalcomCancelBookingResponse>;
141
141
  /**
142
142
  * Configured pass-through for {@link getEventTypes}.
143
143
  *
144
- * @returns function to retrieve all event types for the authenticated user
144
+ * @returns Function to retrieve all event types for the authenticated user.
145
145
  */
146
146
  get getEventTypes(): () => Promise<import("@dereekb/calcom").CalcomGetEventTypesResponse>;
147
147
  /**
148
148
  * Configured pass-through for {@link createEventType}.
149
149
  *
150
- * @returns function to create a new event type
150
+ * @returns Function to create a new event type.
151
151
  */
152
152
  get createEventType(): (input: import("@dereekb/calcom").CalcomCreateEventTypeInput) => Promise<import("@dereekb/calcom").CalcomEventTypeResponse>;
153
153
  /**
154
154
  * Configured pass-through for {@link updateEventType}.
155
155
  *
156
- * @returns function to update an existing event type by ID
156
+ * @returns Function to update an existing event type by ID.
157
157
  */
158
158
  get updateEventType(): (eventTypeId: import("@dereekb/calcom").CalcomEventTypeId, input: import("@dereekb/calcom").CalcomUpdateEventTypeInput) => Promise<import("@dereekb/calcom").CalcomEventTypeResponse>;
159
159
  /**
160
160
  * Configured pass-through for {@link deleteEventType}.
161
161
  *
162
- * @returns function to delete an event type by ID
162
+ * @returns Function to delete an event type by ID.
163
163
  */
164
164
  get deleteEventType(): (eventTypeId: import("@dereekb/calcom").CalcomEventTypeId) => Promise<import("@dereekb/calcom").CalcomEventTypeResponse>;
165
165
  /**
166
166
  * Configured pass-through for {@link getCalendars}.
167
167
  *
168
- * @returns function to retrieve all connected calendars
168
+ * @returns Function to retrieve all connected calendars.
169
169
  */
170
170
  get getCalendars(): () => Promise<import("@dereekb/calcom").CalcomGetCalendarsResponse>;
171
171
  /**
172
172
  * Configured pass-through for {@link getBusyTimes}.
173
173
  *
174
- * @returns function to retrieve busy time ranges across connected calendars
174
+ * @returns Function to retrieve busy time ranges across connected calendars.
175
175
  */
176
176
  get getBusyTimes(): (input: import("@dereekb/calcom").CalcomGetBusyTimesInput) => Promise<import("@dereekb/calcom").CalcomGetBusyTimesResponse>;
177
177
  /**
178
178
  * Configured pass-through for {@link createWebhook}.
179
179
  *
180
- * @returns function to create a webhook subscription
180
+ * @returns Function to create a webhook subscription.
181
181
  */
182
182
  get createWebhook(): (input: import("@dereekb/calcom").CalcomCreateWebhookInput) => Promise<import("@dereekb/calcom").CalcomWebhookResponse>;
183
183
  /**
184
184
  * Configured pass-through for {@link getWebhooks}.
185
185
  *
186
- * @returns function to retrieve all webhooks
186
+ * @returns Function to retrieve all webhooks.
187
187
  */
188
188
  get getWebhooks(): () => Promise<import("@dereekb/calcom").CalcomGetWebhooksResponse>;
189
189
  /**
190
190
  * Configured pass-through for {@link getWebhook}.
191
191
  *
192
- * @returns function to retrieve a specific webhook by ID
192
+ * @returns Function to retrieve a specific webhook by ID.
193
193
  */
194
194
  get getWebhook(): (webhookId: import("@dereekb/calcom").CalcomWebhookId) => Promise<import("@dereekb/calcom").CalcomWebhookResponse>;
195
195
  /**
196
196
  * Configured pass-through for {@link updateWebhook}.
197
197
  *
198
- * @returns function to update an existing webhook by ID
198
+ * @returns Function to update an existing webhook by ID.
199
199
  */
200
200
  get updateWebhook(): (webhookId: import("@dereekb/calcom").CalcomWebhookId, input: import("@dereekb/calcom").CalcomUpdateWebhookInput) => Promise<import("@dereekb/calcom").CalcomWebhookResponse>;
201
201
  /**
202
202
  * Configured pass-through for {@link deleteWebhook}.
203
203
  *
204
- * @returns function to delete a webhook by ID
204
+ * @returns Function to delete a webhook by ID.
205
205
  */
206
206
  get deleteWebhook(): (webhookId: import("@dereekb/calcom").CalcomWebhookId) => Promise<import("@dereekb/calcom").CalcomWebhookResponse>;
207
207
  }
@@ -5,8 +5,8 @@ import { type Maybe } from '@dereekb/util';
5
5
  /**
6
6
  * Factory function that creates a {@link CalcomServiceConfig} from NestJS ConfigService values.
7
7
  *
8
- * @param _configService - the NestJS ConfigService instance
9
- * @returns a validated CalcomServiceConfig
8
+ * @param _configService - The NestJS ConfigService instance.
9
+ * @returns A validated CalcomServiceConfig.
10
10
  */
11
11
  export declare function calcomServiceConfigFactory(_configService: ConfigService): CalcomServiceConfig;
12
12
  export interface ProvideAppCalcomMetadataConfig extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> {
@@ -21,7 +21,7 @@ export interface ProvideAppCalcomMetadataConfig extends Pick<ModuleMetadata, 'im
21
21
  /**
22
22
  * Convenience function used to generate ModuleMetadata for an app's CalcomModule.
23
23
  *
24
- * @param config - the module metadata configuration including optional dependency module
25
- * @returns NestJS ModuleMetadata for registering the CalcomModule
24
+ * @param config - The module metadata configuration including optional dependency module.
25
+ * @returns NestJS ModuleMetadata for registering the CalcomModule.
26
26
  */
27
27
  export declare function appCalcomModuleMetadata(config: ProvideAppCalcomMetadataConfig): ModuleMetadata;
@@ -11,16 +11,16 @@ export declare class CalcomOAuthApi {
11
11
  /**
12
12
  * Configured pass-through for {@link exchangeAuthorizationCode}.
13
13
  *
14
- * @returns function to exchange an OAuth authorization code for tokens
14
+ * @returns Function to exchange an OAuth authorization code for tokens.
15
15
  */
16
16
  get exchangeAuthorizationCode(): (input: import("@dereekb/calcom").CalcomOAuthExchangeAuthorizationCodeInput) => Promise<import("@dereekb/calcom").CalcomOAuthTokenResponse>;
17
17
  /**
18
18
  * Retrieves an access token for a specific user using their refresh token.
19
19
  *
20
- * @param input - contains the user's refresh token and optional access token cache
21
- * @param input.refreshToken - the user's OAuth refresh token
22
- * @param input.userAccessTokenCache - optional cache to store/retrieve the user's access token
23
- * @returns a promise resolving to the user's CalcomAccessToken
20
+ * @param input - Contains the user's refresh token and optional access token cache.
21
+ * @param input.refreshToken - The user's OAuth refresh token.
22
+ * @param input.userAccessTokenCache - Optional cache to store/retrieve the user's access token.
23
+ * @returns Promise resolving to the user's CalcomAccessToken.
24
24
  */
25
25
  userAccessToken(input: {
26
26
  refreshToken: string;
@@ -30,8 +30,8 @@ export declare class CalcomOAuthApi {
30
30
  * Returns a per-user CalcomAccessTokenCache derived from the refresh token (md5 hashed as the file key).
31
31
  * Returns undefined if the cache service does not support per-user caching.
32
32
  *
33
- * @param refreshToken - the user's OAuth refresh token used to derive the cache key
34
- * @returns a per-user access token cache, or undefined if not supported
33
+ * @param refreshToken - The user's OAuth refresh token used to derive the cache key.
34
+ * @returns A per-user access token cache, or undefined if not supported.
35
35
  */
36
36
  cacheForRefreshToken(refreshToken: CalcomRefreshToken): Maybe<CalcomAccessTokenCache>;
37
37
  }