@dereekb/firebase-server 13.11.14 → 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 (102) hide show
  1. package/index.cjs.js +229 -199
  2. package/index.esm.js +230 -200
  3. package/mailgun/package.json +9 -9
  4. package/model/index.cjs.js +259 -270
  5. package/model/index.esm.js +259 -270
  6. package/model/package.json +9 -9
  7. package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +3 -3
  8. package/model/src/lib/notification/notification.action.server.d.ts +34 -34
  9. package/model/src/lib/notification/notification.action.server.init.d.ts +17 -17
  10. package/model/src/lib/notification/notification.config.service.d.ts +7 -7
  11. package/model/src/lib/notification/notification.create.run.d.ts +3 -3
  12. package/model/src/lib/notification/notification.error.d.ts +14 -14
  13. package/model/src/lib/notification/notification.expedite.service.d.ts +7 -7
  14. package/model/src/lib/notification/notification.module.d.ts +13 -13
  15. package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +2 -2
  16. package/model/src/lib/notification/notification.send.service.text.d.ts +1 -1
  17. package/model/src/lib/notification/notification.task.service.handler.d.ts +2 -2
  18. package/model/src/lib/notification/notification.task.service.util.d.ts +3 -3
  19. package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -3
  20. package/model/src/lib/notification/notification.util.d.ts +8 -8
  21. package/model/src/lib/storagefile/storagefile.action.server.d.ts +43 -44
  22. package/model/src/lib/storagefile/storagefile.action.server.init.d.ts +11 -11
  23. package/model/src/lib/storagefile/storagefile.error.d.ts +15 -15
  24. package/model/src/lib/storagefile/storagefile.module.d.ts +10 -10
  25. package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +6 -6
  26. package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +5 -5
  27. package/model/src/lib/storagefile/storagefile.util.d.ts +2 -2
  28. package/oidc/index.cjs.js +219 -219
  29. package/oidc/index.esm.js +219 -219
  30. package/oidc/package.json +10 -10
  31. package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +44 -25
  32. package/oidc/src/lib/controller/oidc.provider.controller.d.ts +1 -1
  33. package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +3 -3
  34. package/oidc/src/lib/middleware/oauth-cors.module.d.ts +1 -1
  35. package/oidc/src/lib/model/jwks/jwks.d.ts +6 -6
  36. package/oidc/src/lib/model/jwks/jwks.query.d.ts +5 -5
  37. package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +12 -12
  38. package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -5
  39. package/oidc/src/lib/oidc.config.d.ts +1 -1
  40. package/oidc/src/lib/oidc.module.d.ts +8 -8
  41. package/oidc/src/lib/service/oidc.account.service.d.ts +4 -4
  42. package/oidc/src/lib/service/oidc.adapter.service.d.ts +4 -4
  43. package/oidc/src/lib/service/oidc.client.service.d.ts +3 -3
  44. package/oidc/src/lib/service/oidc.config.service.d.ts +1 -1
  45. package/oidc/src/lib/service/oidc.encryption.service.d.ts +4 -4
  46. package/oidc/src/lib/service/oidc.interaction.service.d.ts +14 -14
  47. package/oidc/src/lib/service/oidc.jwks.service.d.ts +6 -6
  48. package/oidc/src/lib/service/oidc.service.d.ts +5 -5
  49. package/package.json +10 -10
  50. package/src/lib/auth/auth.service.d.ts +8 -8
  51. package/src/lib/auth/auth.util.d.ts +1 -1
  52. package/src/lib/env/env.config.d.ts +5 -4
  53. package/src/lib/firestore/driver.accessor.batch.d.ts +2 -1
  54. package/src/lib/firestore/driver.accessor.d.ts +1 -1
  55. package/src/lib/firestore/driver.accessor.default.d.ts +2 -1
  56. package/src/lib/firestore/driver.accessor.transaction.d.ts +2 -1
  57. package/src/lib/firestore/snapshot/snapshot.field.encrypt.d.ts +10 -6
  58. package/src/lib/function/type.d.ts +4 -4
  59. package/src/lib/nest/analytics/analytics.module.d.ts +6 -5
  60. package/src/lib/nest/app.d.ts +4 -4
  61. package/src/lib/nest/app.module.d.ts +3 -2
  62. package/src/lib/nest/auth/auth.module.d.ts +4 -3
  63. package/src/lib/nest/controller/model/model.api.controller.d.ts +1 -0
  64. package/src/lib/nest/controller/model/model.api.get.service.d.ts +1 -1
  65. package/src/lib/nest/controller/model/model.api.module.d.ts +4 -3
  66. package/src/lib/nest/development/development.function.d.ts +1 -1
  67. package/src/lib/nest/development/development.schedule.function.error.d.ts +2 -2
  68. package/src/lib/nest/env/env.util.d.ts +2 -2
  69. package/src/lib/nest/firestore/firestore.module.d.ts +16 -15
  70. package/src/lib/nest/function/call.d.ts +6 -6
  71. package/src/lib/nest/function/context.d.ts +7 -6
  72. package/src/lib/nest/function/v2/blocking.d.ts +8 -6
  73. package/src/lib/nest/function/v2/call.d.ts +7 -5
  74. package/src/lib/nest/function/v2/event.d.ts +3 -2
  75. package/src/lib/nest/function/v2/schedule.d.ts +3 -2
  76. package/src/lib/nest/function/v2/taskqueue.d.ts +2 -1
  77. package/src/lib/nest/model/analytics.emit.d.ts +5 -5
  78. package/src/lib/nest/model/api.details.d.ts +4 -4
  79. package/src/lib/nest/model/query.model.function.d.ts +3 -3
  80. package/src/lib/nest/nest.provider.d.ts +7 -7
  81. package/src/lib/nest/storage/storage.module.d.ts +6 -5
  82. package/src/lib/storage/driver.accessor.d.ts +10 -10
  83. package/test/index.cjs.js +48 -57
  84. package/test/index.esm.js +48 -57
  85. package/test/package.json +11 -11
  86. package/test/src/lib/firebase/firebase.admin.auth.d.ts +18 -18
  87. package/test/src/lib/firebase/firebase.admin.collection.d.ts +7 -7
  88. package/test/src/lib/firebase/firebase.admin.d.ts +2 -2
  89. package/test/src/lib/firebase/firebase.admin.function.d.ts +2 -2
  90. package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +1 -1
  91. package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +3 -3
  92. package/test/src/lib/firebase/firebase.d.ts +6 -5
  93. package/test/src/lib/firebase/firebase.function.d.ts +31 -31
  94. package/test/src/lib/firestore/firestore.d.ts +2 -2
  95. package/test/src/lib/oidc/oidc.test.fixture.d.ts +1 -1
  96. package/test/src/lib/oidc/oidc.test.flow.d.ts +1 -1
  97. package/test/src/lib/storage/storage.d.ts +2 -2
  98. package/zoho/index.cjs.js +2 -2
  99. package/zoho/index.esm.js +2 -2
  100. package/zoho/package.json +9 -9
  101. package/zoho/src/lib/zoho.accounts.firebase.d.ts +1 -1
  102. package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +1 -1
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, UNAUTHENTICATED_ERROR_CODE, FORBIDDEN_ERROR_CODE, PERMISSION_DENIED_ERROR_CODE, NOT_FOUND_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ALREADY_EXISTS_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, INTERNAL_SERVER_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, setIdAndKeyFromKeyIdRefOnDocumentData, DBX_FIREBASE_SERVER_PASSWORD_RESET_INVALID_CODE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_NO_CONFIG_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_SEND_ONCE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_THROTTLE_ERROR_CODE, FirestoreDocumentContextType, streamFromOnSnapshot, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, makeFirestoreQueryConstraintFunctionsDriver, firestoreContextFactory, firestoreField, optionalFirestoreField, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT, UNKNOWN_MODEL_TYPE_ERROR_CODE, BAD_DOCUMENT_QUERY_CURSOR_ERROR_CODE, limit, startAfter, DEFAULT_ON_CALL_QUERY_MODEL_LIMIT, MAX_ON_CALL_QUERY_MODEL_LIMIT, ScheduledFunctionDevelopmentFunctionTypeEnum, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
1
+ import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, UNAUTHENTICATED_ERROR_CODE, FORBIDDEN_ERROR_CODE, PERMISSION_DENIED_ERROR_CODE, NOT_FOUND_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ALREADY_EXISTS_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, INTERNAL_SERVER_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, setIdAndKeyFromKeyIdRefOnDocumentData, DBX_FIREBASE_SERVER_PASSWORD_RESET_INVALID_CODE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_NO_CONFIG_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_SEND_ONCE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_THROTTLE_ERROR_CODE, FirestoreDocumentContextType, streamFromOnSnapshot, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, makeFirestoreQueryConstraintFunctionsDriver, firestoreContextFactory, firestoreField, optionalFirestoreField, DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER, UNKNOWN_MODEL_TYPE_ERROR_CODE, BAD_DOCUMENT_QUERY_CURSOR_ERROR_CODE, limit, startAfter, DEFAULT_ON_CALL_QUERY_MODEL_LIMIT, MAX_ON_CALL_QUERY_MODEL_LIMIT, ScheduledFunctionDevelopmentFunctionTypeEnum, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
2
2
  import { partialServerError, isServerError, randomNumberFactory, cachedGetter, filterNullAndUndefinedValues, asSet, AUTH_ADMIN_ROLE, AUTH_TOS_SIGNED_ROLE, forEachKeyValue, KeyValueTypleValueFilter, filterUndefinedValues, isThrottled, mapObjectMap, batch, objectToMap, serverError, asArray, containsAllValues, websiteUrlDetails, mergeObjects, cronExpressionRepeatingEveryNMinutes, mapIdentityFunction, slashPathName, toRelativeSlashPathStartType, fixMultiSlashesInSlashPath, SLASH_PATH_SEPARATOR, objectHasNoKeys, websiteUrlFromPaths, pushItemOrArrayItemsIntoArray, makeGetter, asGetter, build, performAsyncTasks } from '@dereekb/util';
3
3
  import { HttpsError } from 'firebase-functions/https';
4
4
  import { hoursToMs, toISODateString } from '@dereekb/date';
@@ -578,7 +578,7 @@ function _ts_generator$h(thisArg, body) {
578
578
  *
579
579
  * Any error other than {@link FIREBASE_AUTH_USER_NOT_FOUND_ERROR} is re-thrown.
580
580
  *
581
- * @param promise - A promise resolving to a UserRecord (e.g., from `auth.getUser(uid)`).
581
+ * @param promise - Promise resolving to a UserRecord (e.g., from `auth.getUser(uid)`).
582
582
  * @returns The user record, or `undefined` if the user does not exist.
583
583
  *
584
584
  * @example
@@ -590,7 +590,7 @@ function _ts_generator$h(thisArg, body) {
590
590
  * ```
591
591
  */ function getAuthUserOrUndefined(promise) {
592
592
  return _async_to_generator$h(function() {
593
- var error;
593
+ var result, error;
594
594
  return _ts_generator$h(this, function(_state) {
595
595
  switch(_state.label){
596
596
  case 0:
@@ -605,22 +605,24 @@ function _ts_generator$h(thisArg, body) {
605
605
  promise
606
606
  ];
607
607
  case 1:
608
+ result = _state.sent();
608
609
  return [
609
- 2,
610
- _state.sent()
610
+ 3,
611
+ 3
611
612
  ];
612
613
  case 2:
613
614
  error = _state.sent();
614
- if (error.code === FIREBASE_AUTH_USER_NOT_FOUND_ERROR) {
615
- return [
616
- 2,
617
- undefined
618
- ];
615
+ if (error.code !== FIREBASE_AUTH_USER_NOT_FOUND_ERROR) {
616
+ throw error;
619
617
  }
620
- throw error;
618
+ return [
619
+ 3,
620
+ 3
621
+ ];
621
622
  case 3:
622
623
  return [
623
- 2
624
+ 2,
625
+ result
624
626
  ];
625
627
  }
626
628
  });
@@ -1484,7 +1486,7 @@ function _ts_generator$g(thisArg, body) {
1484
1486
  key: "setClaims",
1485
1487
  value: function setClaims(claims) {
1486
1488
  var _this = this;
1487
- return this.service.auth.setCustomUserClaims(this.uid, claims).then(function() {
1489
+ return this.service.auth.setCustomUserClaims(this.uid, claims !== null && claims !== void 0 ? claims : null).then(function() {
1488
1490
  _this._loadRecord.reset(); // reset the cache
1489
1491
  });
1490
1492
  }
@@ -1985,7 +1987,7 @@ function _ts_generator$g(thisArg, body) {
1985
1987
  *
1986
1988
  * @param input - The initialization configuration for the new user.
1987
1989
  * @returns The created user record and the setup password used.
1988
- * @throws Throws if the Firebase Admin SDK rejects the user creation.
1990
+ * @throws {Error} Throws if the Firebase Admin SDK rejects the user creation.
1989
1991
  */ function createNewUser(input) {
1990
1992
  return _async_to_generator$g(function() {
1991
1993
  var uid, displayName, email, phoneNumber, inputPassword, password, user, e, firebaseError, errorCode;
@@ -3147,15 +3149,16 @@ function _ts_generator$e(thisArg, body) {
3147
3149
  * Use this when the NestJS app needs the config accessible via either token.
3148
3150
  *
3149
3151
  * @param env - The Firebase server environment configuration.
3150
- * @returns An array of providers binding the config to both Firebase and base server env tokens.
3152
+ * @returns The providers binding the config to both Firebase and base server env tokens.
3151
3153
  *
3152
- * @example
3153
- * ```typescript
3154
- * @Module({
3154
+ * @Module ({
3155
3155
  * providers: [...firebaseServerEnvTokenProviders(myEnvConfig)]
3156
3156
  * })
3157
3157
  * export class AppModule {}
3158
3158
  * ```
3159
+ *
3160
+ * @example
3161
+ * ```typescript
3159
3162
  */ function firebaseServerEnvTokenProviders(env) {
3160
3163
  return [
3161
3164
  firebaseServerEnvTokenProvider(env),
@@ -4002,7 +4005,7 @@ function _ts_generator$d(thisArg, body) {
4002
4005
  * @param path - The initial collection path.
4003
4006
  * @param pathSegments - Optional pairs of [docId, collectionName] for subcollection traversal.
4004
4007
  * @returns The resolved {@link CollectionReference} at the given path.
4005
- * @throws Error if pathSegments length is odd (segments must come in pairs).
4008
+ * @throws {Error} If pathSegments length is odd (segments must come in pairs).
4006
4009
  *
4007
4010
  * @example
4008
4011
  * ```typescript
@@ -4317,6 +4320,11 @@ var _obj;
4317
4320
  * The encryption key is resolved from the configured secret source on each read/write,
4318
4321
  * allowing for key rotation via environment variable changes.
4319
4322
  *
4323
+ * @param config - Encryption field configuration.
4324
+ * @returns A field mapping configuration for encrypted values.
4325
+ *
4326
+ * @template T - The JSON-serializable value type.
4327
+ *
4320
4328
  * @example
4321
4329
  * ```typescript
4322
4330
  * const jwksField = firestoreEncryptedField<JWKSet>({
@@ -4325,9 +4333,6 @@ var _obj;
4325
4333
  * });
4326
4334
  * ```
4327
4335
  *
4328
- * @template T - The JSON-serializable value type.
4329
- * @param config - Encryption field configuration.
4330
- * @returns A field mapping configuration for encrypted values.
4331
4336
  * @__NO_SIDE_EFFECTS__
4332
4337
  */ function firestoreEncryptedField(config) {
4333
4338
  var secret = config.secret, defaultValue = config.default;
@@ -4348,6 +4353,11 @@ var _obj;
4348
4353
  * When the value is null/undefined, it is stored/read as null. When present, it is
4349
4354
  * encrypted/decrypted using AES-256-GCM.
4350
4355
  *
4356
+ * @param config - Encryption field configuration.
4357
+ * @returns A field mapping configuration for optional encrypted values.
4358
+ *
4359
+ * @template T - The JSON-serializable value type.
4360
+ *
4351
4361
  * @example
4352
4362
  * ```typescript
4353
4363
  * const optionalSecretField = optionalFirestoreEncryptedField<OAuthClientSecret>({
@@ -4355,9 +4365,6 @@ var _obj;
4355
4365
  * });
4356
4366
  * ```
4357
4367
  *
4358
- * @template T - The JSON-serializable value type.
4359
- * @param config - Encryption field configuration.
4360
- * @returns A field mapping configuration for optional encrypted values.
4361
4368
  * @__NO_SIDE_EFFECTS__
4362
4369
  */ function optionalFirestoreEncryptedField(config) {
4363
4370
  var secret = config.secret;
@@ -4749,15 +4756,15 @@ function _ts_generator$c(thisArg, body) {
4749
4756
  * Creates an {@link OnCallAnalyticsEmitterInstance} that produces {@link OnCallAnalyticsEmitter} instances
4750
4757
  * for each lifecycle stage, pre-bound to the given service and context.
4751
4758
  *
4759
+ * @param config - The service and context to bind to the emitter factory.
4760
+ * @returns A factory function that creates lifecycle-stage-specific emitters.
4761
+ *
4752
4762
  * @example
4753
4763
  * ```typescript
4754
4764
  * const emitter = onCallAnalyticsEmitterInstance({ service, context });
4755
4765
  * emitter('triggered').sendEventType('Handler Starting');
4756
4766
  * emitter('success').sendEvent('Widget Created', { id: result.id });
4757
4767
  * ```
4758
- *
4759
- * @param config - The service and context to bind to the emitter factory.
4760
- * @returns A factory function that creates lifecycle-stage-specific emitters.
4761
4768
  */ function onCallAnalyticsEmitterInstance(config) {
4762
4769
  var service = config.service, context = config.context;
4763
4770
  return function(lifecycle) {
@@ -4794,8 +4801,8 @@ function _ts_generator$c(thisArg, body) {
4794
4801
  * Analytics callback errors are caught and logged but never propagate — the handler result
4795
4802
  * or error is always returned/thrown unmodified.
4796
4803
  *
4797
- * @param config - the handler, analytics details, service, and context
4798
- * @returns the handler's return value
4804
+ * @param config - The handler, analytics details, service, and context.
4805
+ * @returns The handler's return value.
4799
4806
  *
4800
4807
  * @example
4801
4808
  * ```ts
@@ -5006,6 +5013,9 @@ function _unsupported_iterable_to_array$a(o, minLen) {
5006
5013
  * (same effect as optionalAuthContext). This avoids the composition issue where
5007
5014
  * optionalAuthContext(withApiDetails(...)) would lose the _apiDetails.
5008
5015
  *
5016
+ * @param config - The API details configuration including the handler function.
5017
+ * @returns The handler function with _apiDetails attached.
5018
+ *
5009
5019
  * @example
5010
5020
  * ```typescript
5011
5021
  * // Handler with api details (auth required by default)
@@ -5024,9 +5034,6 @@ function _unsupported_iterable_to_array$a(o, minLen) {
5024
5034
  * fn: async (request) => { ... }
5025
5035
  * });
5026
5036
  * ```
5027
- *
5028
- * @param config - The API details configuration including the handler function.
5029
- * @returns The handler function with _apiDetails attached.
5030
5037
  */ function withApiDetails(config) {
5031
5038
  var optionalAuth = config.optionalAuth, fn = config.fn, apiDetails = _object_without_properties(config, [
5032
5039
  "optionalAuth",
@@ -5179,7 +5186,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
5179
5186
  * pivots it to modelType → CRUD, which is the natural shape for MCP tool generation
5180
5187
  * and schema introspection.
5181
5188
  *
5182
- * @param callModelFn The function returned by onCallModel(), or any object with _apiDetails.
5189
+ * @param callModelFn - The function returned by onCallModel(), or any object with _apiDetails.
5183
5190
  * @returns Model-first API details, or undefined if no _apiDetails are present.
5184
5191
  *
5185
5192
  * @example
@@ -5190,64 +5197,67 @@ function _unsupported_iterable_to_array$a(o, minLen) {
5190
5197
  * ```
5191
5198
  */ function getModelApiDetails(callModelFn) {
5192
5199
  var topDetails = readApiDetails(callModelFn);
5193
- if (topDetails == null) {
5194
- return undefined;
5195
- }
5196
- var models = {};
5197
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5198
- try {
5199
- // Pivot: iterate CRUD types, then model types within each
5200
- for(var _iterator = Object.entries(topDetails)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5201
- var _step_value = _sliced_to_array$2(_step.value, 2), callType = _step_value[0], crudDetails = _step_value[1];
5202
- if (crudDetails == null) {
5203
- continue;
5204
- }
5205
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
5206
- try {
5207
- for(var _iterator1 = Object.entries(crudDetails.modelTypes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
5208
- var _step_value1 = _sliced_to_array$2(_step1.value, 2), modelType = _step_value1[0], modelDetails = _step_value1[1];
5209
- if (modelDetails == null) {
5210
- continue;
5211
- }
5212
- if (!(modelType in models)) {
5213
- models[modelType] = {
5214
- calls: {}
5215
- };
5216
- }
5217
- models[modelType].calls[callType] = modelDetails;
5200
+ var result;
5201
+ if (topDetails != null) {
5202
+ var models = {};
5203
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5204
+ try {
5205
+ // Pivot: iterate CRUD types, then model types within each
5206
+ for(var _iterator = Object.entries(topDetails)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5207
+ var _step_value = _sliced_to_array$2(_step.value, 2), callType = _step_value[0], crudDetails = _step_value[1];
5208
+ if (crudDetails == null) {
5209
+ continue;
5218
5210
  }
5219
- } catch (err) {
5220
- _didIteratorError1 = true;
5221
- _iteratorError1 = err;
5222
- } finally{
5211
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
5223
5212
  try {
5224
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
5225
- _iterator1.return();
5213
+ for(var _iterator1 = Object.entries(crudDetails.modelTypes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
5214
+ var _step_value1 = _sliced_to_array$2(_step1.value, 2), modelType = _step_value1[0], modelDetails = _step_value1[1];
5215
+ if (modelDetails == null) {
5216
+ continue;
5217
+ }
5218
+ if (!(modelType in models)) {
5219
+ models[modelType] = {
5220
+ calls: {}
5221
+ };
5222
+ }
5223
+ models[modelType].calls[callType] = modelDetails;
5226
5224
  }
5225
+ } catch (err) {
5226
+ _didIteratorError1 = true;
5227
+ _iteratorError1 = err;
5227
5228
  } finally{
5228
- if (_didIteratorError1) {
5229
- throw _iteratorError1;
5229
+ try {
5230
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
5231
+ _iterator1.return();
5232
+ }
5233
+ } finally{
5234
+ if (_didIteratorError1) {
5235
+ throw _iteratorError1;
5236
+ }
5230
5237
  }
5231
5238
  }
5232
5239
  }
5233
- }
5234
- } catch (err) {
5235
- _didIteratorError = true;
5236
- _iteratorError = err;
5237
- } finally{
5238
- try {
5239
- if (!_iteratorNormalCompletion && _iterator.return != null) {
5240
- _iterator.return();
5241
- }
5240
+ } catch (err) {
5241
+ _didIteratorError = true;
5242
+ _iteratorError = err;
5242
5243
  } finally{
5243
- if (_didIteratorError) {
5244
- throw _iteratorError;
5244
+ try {
5245
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5246
+ _iterator.return();
5247
+ }
5248
+ } finally{
5249
+ if (_didIteratorError) {
5250
+ throw _iteratorError;
5251
+ }
5245
5252
  }
5246
5253
  }
5254
+ if (Object.keys(models).length > 0) {
5255
+ result = {
5256
+ models: models
5257
+ };
5258
+ }
5247
5259
  }
5248
- return Object.keys(models).length > 0 ? {
5249
- models: models
5250
- } : undefined;
5260
+ return result;
5251
5261
  }
5252
5262
  // MARK: Analytics Resolution
5253
5263
  /**
@@ -5265,14 +5275,15 @@ function _unsupported_iterable_to_array$a(o, minLen) {
5265
5275
  function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier) {
5266
5276
  var _apiDetails_call;
5267
5277
  var modelDetails = (_apiDetails_call = apiDetails[call]) === null || _apiDetails_call === void 0 ? void 0 : _apiDetails_call.modelTypes[modelType];
5278
+ var result;
5268
5279
  if (modelDetails) {
5269
5280
  var _modelDetails_specifiers_key;
5270
5281
  // All entries are now OnCallModelTypeApiDetails. For non-specifier handlers,
5271
5282
  // the details are under the `_` key.
5272
5283
  var key = specifier !== null && specifier !== void 0 ? specifier : '_';
5273
- return (_modelDetails_specifiers_key = modelDetails.specifiers[key]) === null || _modelDetails_specifiers_key === void 0 ? void 0 : _modelDetails_specifiers_key.analytics;
5284
+ result = (_modelDetails_specifiers_key = modelDetails.specifiers[key]) === null || _modelDetails_specifiers_key === void 0 ? void 0 : _modelDetails_specifiers_key.analytics;
5274
5285
  }
5275
- return undefined;
5286
+ return result;
5276
5287
  }
5277
5288
  /**
5278
5289
  * @deprecated Use {@link isOnCallModelTypeApiDetails} instead.
@@ -5337,6 +5348,9 @@ function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier)
5337
5348
  * By default, callable functions with auth-aware nest context require auth. Use this wrapper to
5338
5349
  * explicitly opt out of that requirement for endpoints that should be publicly accessible.
5339
5350
  *
5351
+ * @param fn - The callable function handler to wrap.
5352
+ * @returns A new handler flagged with `_requireAuth: false`.
5353
+ *
5340
5354
  * @example
5341
5355
  * ```ts
5342
5356
  * const handler = optionalAuthContext<MyContext, Input, Output>((request) => {
@@ -5344,9 +5358,6 @@ function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier)
5344
5358
  * return doSomething(request);
5345
5359
  * });
5346
5360
  * ```
5347
- *
5348
- * @param fn - The callable function handler to wrap.
5349
- * @returns A new handler flagged with `_requireAuth: false`.
5350
5361
  */ function optionalAuthContext(fn) {
5351
5362
  var fnWithOptionalAuth = function fnWithOptionalAuth(request) {
5352
5363
  return fn(request);
@@ -5371,6 +5382,9 @@ function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier)
5371
5382
  * The wrapper calls {@link assertIsContextWithAuthData} before invoking the handler, ensuring that
5372
5383
  * unauthenticated requests are rejected with an appropriate error before reaching handler logic.
5373
5384
  *
5385
+ * @param fn - The authorized handler to wrap with auth assertion.
5386
+ * @returns A general {@link OnCallWithNestContext} handler that asserts auth before delegating.
5387
+ *
5374
5388
  * @example
5375
5389
  * ```ts
5376
5390
  * const secureHandler = inAuthContext<MyContext, Input, Output>((request) => {
@@ -5378,9 +5392,6 @@ function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier)
5378
5392
  * return processAuthenticatedRequest(request);
5379
5393
  * });
5380
5394
  * ```
5381
- *
5382
- * @param fn - The authorized handler to wrap with auth assertion.
5383
- * @returns A general {@link OnCallWithNestContext} handler that asserts auth before delegating.
5384
5395
  */ function inAuthContext(fn) {
5385
5396
  return function(request) {
5386
5397
  assertIsContextWithAuthData(request);
@@ -5413,7 +5424,7 @@ function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier)
5413
5424
  */ function onCallSpecifierHandler(config) {
5414
5425
  var map = objectToMap(config);
5415
5426
  var fn = function fn(request) {
5416
- var _request_specifier = request.specifier, specifier = _request_specifier === void 0 ? MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT : _request_specifier;
5427
+ var _request_specifier = request.specifier, specifier = _request_specifier === void 0 ? DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER : _request_specifier;
5417
5428
  var handler = map.get(specifier);
5418
5429
  if (handler != null) {
5419
5430
  return handler(request);
@@ -5532,13 +5543,15 @@ function _object_spread_props$c(target, source) {
5532
5543
  function getAnalyticsService(request) {
5533
5544
  var token = analyticsToken !== null && analyticsToken !== void 0 ? analyticsToken : ON_CALL_MODEL_ANALYTICS_SERVICE;
5534
5545
  var moduleRef = request.nestApplication.get(ModuleRef);
5546
+ var result;
5535
5547
  try {
5536
- return moduleRef.get(token, {
5548
+ result = moduleRef.get(token, {
5537
5549
  strict: false
5538
5550
  });
5539
5551
  } catch (unused) {
5540
- return noopOnCallModelAnalyticsService();
5552
+ result = noopOnCallModelAnalyticsService();
5541
5553
  }
5554
+ return result;
5542
5555
  }
5543
5556
  var fn = function fn(request) {
5544
5557
  var call = request.data.call;
@@ -6054,6 +6067,9 @@ function _ts_generator$b(thisArg, body) {
6054
6067
  * - Fetching one extra document to detect whether more results exist
6055
6068
  * - Building the {@link OnCallQueryModelResult} with cursorDocumentKey and hasMore
6056
6069
  *
6070
+ * @param config - Query configuration including collection, constraints, and pagination params.
6071
+ * @returns Paginated query result with cursor for the next page.
6072
+ *
6057
6073
  * @example
6058
6074
  * ```typescript
6059
6075
  * export const queryGuestbooks: DemoQueryModelFunction<QueryGuestbooksParams, OnCallQueryModelResult<Guestbook>> = async (request) => {
@@ -6076,9 +6092,6 @@ function _ts_generator$b(thisArg, body) {
6076
6092
  * });
6077
6093
  * };
6078
6094
  * ```
6079
- *
6080
- * @param config - Query configuration including collection, constraints, and pagination params.
6081
- * @returns Paginated query result with cursor for the next page.
6082
6095
  */ function executeOnCallQuery(config) {
6083
6096
  return _async_to_generator$b(function() {
6084
6097
  var _collection, _params_limit, _resultDocs_at, params, collection, loadCursorDocument, buildConstraints, _config_maxLimit, maxLimit, mapResult, requestedLimit, effectiveLimit, constraints, cursorSnapshot, e, errorInfo, executableQuery, querySnapshot, docs, hasMore, resultDocs, results, keys, cursorDocumentKey;
@@ -6199,16 +6212,17 @@ function _unsupported_iterable_to_array$8(o, minLen) {
6199
6212
  * Provides {@link FirebaseServerAnalyticsService} and registers it as the
6200
6213
  * {@link ON_CALL_MODEL_ANALYTICS_SERVICE} token for the onCall dispatch chain.
6201
6214
  *
6202
- * @param config - the configuration including an optional dependency module and additional providers
6203
- * @returns module metadata ready for use with `@Module()`
6215
+ * @param config - The configuration including an optional dependency module and additional providers.
6216
+ * @returns Module metadata ready for use with `@Module()`
6204
6217
  *
6205
- * @example
6206
- * ```ts
6207
- * @Module(appAnalyticsModuleMetadata({
6218
+ * @Module (appAnalyticsModuleMetadata({
6208
6219
  * dependencyModule: FirebaseServerAnalyticsSegmentModule
6209
6220
  * }))
6210
6221
  * export class AppAnalyticsModule {}
6211
6222
  * ```
6223
+ *
6224
+ * @example
6225
+ * ```ts
6212
6226
  */ function appAnalyticsModuleMetadata(config) {
6213
6227
  var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers;
6214
6228
  var dependencyModuleImport = dependencyModule ? [
@@ -6600,13 +6614,14 @@ FirebaseServerAuthModule = __decorate([
6600
6614
  * @param config - The module metadata configuration including the service provider.
6601
6615
  * @returns The merged NestJS module metadata.
6602
6616
  *
6603
- * @example
6604
- * ```typescript
6605
- * @Module(firebaseServerAuthModuleMetadata({
6617
+ * @Module (firebaseServerAuthModuleMetadata({
6606
6618
  * serviceProvider: { provide: MyAuthService, useFactory: (auth) => new MyAuthService(auth) }
6607
6619
  * }))
6608
6620
  * export class AppAuthModule {}
6609
6621
  * ```
6622
+ *
6623
+ * @example
6624
+ * ```typescript
6610
6625
  */ function firebaseServerAuthModuleMetadata(config) {
6611
6626
  return mergeModuleMetadata({
6612
6627
  imports: [
@@ -7327,7 +7342,7 @@ function _ts_generator$9(thisArg, body) {
7327
7342
  * @param key - The full Firestore model key (e.g., 'pr/abc123').
7328
7343
  * @param auth - The authenticated user's auth data from the request.
7329
7344
  * @returns The document key and data.
7330
- * @throws Permission or not-found errors from useModel.
7345
+ * @throws {Error} Permission or not-found errors from useModel.
7331
7346
  */ function readDocument(modelType, key, auth) {
7332
7347
  return _async_to_generator$9(function() {
7333
7348
  var authRef, doc, snapshot;
@@ -7887,6 +7902,7 @@ function _ts_generator$8(thisArg, body) {
7887
7902
  *
7888
7903
  * @param req - The Express request containing wildcard path params.
7889
7904
  * @returns Parsed path components with modelType, call, and specifier (defaults to '_').
7905
+ * @throws {HttpException} `400 BAD_REQUEST` when `modelType` or `call` is missing from the path.
7890
7906
  */ key: "_parsePath",
7891
7907
  value: function _parsePath(req) {
7892
7908
  var _ref, _req_params_path, _pathSegments_;
@@ -7958,18 +7974,21 @@ function _ts_generator$8(thisArg, body) {
7958
7974
  {
7959
7975
  key: "_toHttpException",
7960
7976
  value: function _toHttpException(error) {
7961
- var _ref, _ref1, _ref2;
7962
- var _error_httpErrorCode;
7977
+ var result;
7963
7978
  if (_instanceof$1(error, HttpException)) {
7964
- return error;
7979
+ result = error;
7980
+ } else {
7981
+ var _ref, _ref1, _ref2;
7982
+ var _error_httpErrorCode;
7983
+ var status = (_ref = (_ref1 = error === null || error === void 0 ? void 0 : error.status) !== null && _ref1 !== void 0 ? _ref1 : error === null || error === void 0 ? void 0 : (_error_httpErrorCode = error.httpErrorCode) === null || _error_httpErrorCode === void 0 ? void 0 : _error_httpErrorCode.status) !== null && _ref !== void 0 ? _ref : HttpStatus.INTERNAL_SERVER_ERROR;
7984
+ var message = (_ref2 = error === null || error === void 0 ? void 0 : error.message) !== null && _ref2 !== void 0 ? _ref2 : 'Internal server error';
7985
+ result = new HttpException({
7986
+ statusCode: status,
7987
+ message: message,
7988
+ code: error === null || error === void 0 ? void 0 : error.code
7989
+ }, status);
7965
7990
  }
7966
- var status = (_ref = (_ref1 = error === null || error === void 0 ? void 0 : error.status) !== null && _ref1 !== void 0 ? _ref1 : error === null || error === void 0 ? void 0 : (_error_httpErrorCode = error.httpErrorCode) === null || _error_httpErrorCode === void 0 ? void 0 : _error_httpErrorCode.status) !== null && _ref !== void 0 ? _ref : HttpStatus.INTERNAL_SERVER_ERROR;
7967
- var message = (_ref2 = error === null || error === void 0 ? void 0 : error.message) !== null && _ref2 !== void 0 ? _ref2 : 'Internal server error';
7968
- return new HttpException({
7969
- statusCode: status,
7970
- message: message,
7971
- code: error === null || error === void 0 ? void 0 : error.code
7972
- }, status);
7991
+ return result;
7973
7992
  }
7974
7993
  }
7975
7994
  ]);
@@ -8065,13 +8084,14 @@ function _unsupported_iterable_to_array$7(o, minLen) {
8065
8084
  * @param metadataConfig - Configuration including the dependency module.
8066
8085
  * @returns NestJS module metadata with the Model API controller, dispatch service, and app context provider.
8067
8086
  *
8068
- * @example
8069
- * ```typescript
8070
- * @Module(modelApiModuleMetadata({
8087
+ * @Module (modelApiModuleMetadata({
8071
8088
  * dependencyModule: DemoModelApiDependencyModule
8072
8089
  * }))
8073
8090
  * export class DemoModelApiModule {}
8074
8091
  * ```
8092
+ *
8093
+ * @example
8094
+ * ```typescript
8075
8095
  */ function modelApiModuleMetadata(metadataConfig) {
8076
8096
  var dependencyModule = metadataConfig.dependencyModule, imports = metadataConfig.imports, exports = metadataConfig.exports, providers = metadataConfig.providers;
8077
8097
  return {
@@ -8199,7 +8219,7 @@ function _object_spread_props$8(target, source) {
8199
8219
  /**
8200
8220
  * Creates a bad-request error indicating the provided development function specifier is not recognized.
8201
8221
  *
8202
- * @param specifier - the unrecognized specifier string from the client request.
8222
+ * @param specifier - The unrecognized specifier string from the client request.
8203
8223
  * @returns A bad-request error with the unknown specifier details.
8204
8224
  */ function developmentUnknownSpecifierError(specifier) {
8205
8225
  return badRequestError(serverError({
@@ -8234,7 +8254,7 @@ function _object_spread_props$8(target, source) {
8234
8254
  * Creates a bad-request error for when the requested scheduled function name
8235
8255
  * is not found in the registered function map.
8236
8256
  *
8237
- * @param name - the unrecognized function name from the client request.
8257
+ * @param name - The unrecognized function name from the client request.
8238
8258
  * @returns A bad-request error with the unknown function name details.
8239
8259
  */ function unknownScheduledFunctionDevelopmentFunctionName(name) {
8240
8260
  return badRequestError({
@@ -8252,7 +8272,7 @@ function _object_spread_props$8(target, source) {
8252
8272
  * Creates a bad-request error for when the request `type` field does not match
8253
8273
  * any supported operation ('run' or 'list').
8254
8274
  *
8255
- * @param type - the unrecognized type value from the client request.
8275
+ * @param type - The unrecognized type value from the client request.
8256
8276
  * @returns A bad-request error with the unknown type details.
8257
8277
  */ function unknownScheduledFunctionDevelopmentFunctionType(type) {
8258
8278
  return badRequestError({
@@ -8479,7 +8499,7 @@ function _ts_generator$7(thisArg, body) {
8479
8499
  });
8480
8500
  return function(request) {
8481
8501
  return _async_to_generator$7(function() {
8482
- var data, type, targetRunName, targetFunction, e;
8502
+ var data, type, result, targetRunName, targetFunction, e;
8483
8503
  return _ts_generator$7(this, function(_state) {
8484
8504
  switch(_state.label){
8485
8505
  case 0:
@@ -8533,24 +8553,27 @@ function _ts_generator$7(thisArg, body) {
8533
8553
  console.error('Failed manually running task "'.concat(targetRunName, '".'), e);
8534
8554
  throw e;
8535
8555
  case 5:
8556
+ result = {
8557
+ type: 'run',
8558
+ success: true
8559
+ };
8536
8560
  return [
8537
- 2,
8538
- {
8539
- type: 'run',
8540
- success: true
8541
- }
8561
+ 3,
8562
+ 7
8542
8563
  ];
8543
8564
  case 6:
8565
+ result = {
8566
+ type: 'list',
8567
+ list: getListValues()
8568
+ };
8544
8569
  return [
8545
- 2,
8546
- {
8547
- type: 'list',
8548
- list: getListValues()
8549
- }
8570
+ 3,
8571
+ 7
8550
8572
  ];
8551
8573
  case 7:
8552
8574
  return [
8553
- 2
8575
+ 2,
8576
+ result
8554
8577
  ];
8555
8578
  }
8556
8579
  });
@@ -8916,7 +8939,7 @@ DefaultFirebaseServerEnvService = __decorate([
8916
8939
  *
8917
8940
  * Useful for conditionally enabling production-only Cloud Functions (e.g., scheduled tasks).
8918
8941
  *
8919
- * @param nest - getter for the NestJS application context promise.
8942
+ * @param nest - Getter for the NestJS application context promise.
8920
8943
  * @returns An async decision function that resolves to `true` in production.
8921
8944
  *
8922
8945
  * @example
@@ -8936,7 +8959,7 @@ DefaultFirebaseServerEnvService = __decorate([
8936
8959
  *
8937
8960
  * The development scheduler is enabled in non-production, non-testing environments.
8938
8961
  *
8939
- * @param nest - getter for the NestJS application context promise.
8962
+ * @param nest - Getter for the NestJS application context promise.
8940
8963
  * @returns An async decision function that resolves to `true` when the development scheduler is enabled.
8941
8964
  */ function nestAppHasDevelopmentSchedulerEnabled(nest) {
8942
8965
  return function() {
@@ -9039,16 +9062,17 @@ FirebaseServerFirestoreContextModule = __decorate([
9039
9062
  *
9040
9063
  * If caching is not needed, use {@link FirebaseServerFirestoreContextModule} directly instead.
9041
9064
  *
9042
- * @param config - Configuration including the cache factory
9043
- * @returns Module metadata ready for the `@Module()` decorator
9065
+ * @param config - Configuration including the cache factory.
9066
+ * @returns Module metadata ready for the `@Module()` decorator.
9044
9067
  *
9045
- * @example
9046
- * ```typescript
9047
- * @Module(firebaseServerFirestoreContextModuleMetadata({
9068
+ * @Module (firebaseServerFirestoreContextModuleMetadata({
9048
9069
  * firestoreContextCacheFactory: inMemoryFirestoreContextCacheFactory()
9049
9070
  * }))
9050
9071
  * export class AppFirestoreContextModule {}
9051
9072
  * ```
9073
+ *
9074
+ * @example
9075
+ * ```typescript
9052
9076
  */ function firebaseServerFirestoreContextModuleMetadata(config) {
9053
9077
  var params = {
9054
9078
  firestoreContextCacheFactory: config.firestoreContextCacheFactory
@@ -9113,25 +9137,25 @@ FirebaseServerFirestoreContextModule = __decorate([
9113
9137
  * @param config - The Firestore collections config plus optional additional module metadata.
9114
9138
  * @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
9115
9139
  *
9116
- * @example
9117
- * ```typescript
9118
- * @Module(appFirestoreModuleMetadata({
9140
+ * @Module (appFirestoreModuleMetadata({
9119
9141
  * provide: DemoFirestoreCollections,
9120
9142
  * useFactory: (context) => new DemoFirestoreCollections(context)
9121
9143
  * }))
9122
9144
  * export class AppFirestoreModule {}
9123
9145
  * ```
9124
- *
9125
- * @example
9126
- * ```typescript
9127
- * // With caching
9128
- * @Module(appFirestoreModuleMetadata({
9146
+ * @Module (appFirestoreModuleMetadata({
9129
9147
  * provide: DemoFirestoreCollections,
9130
9148
  * useFactory: (context) => new DemoFirestoreCollections(context),
9131
9149
  * firestoreContextCacheFactory: inMemoryFirestoreContextCacheFactory()
9132
9150
  * }))
9133
9151
  * export class AppFirestoreModule {}
9134
9152
  * ```
9153
+ *
9154
+ * @example
9155
+ * ```typescript
9156
+ * @example
9157
+ * ```typescript
9158
+ * // With caching
9135
9159
  */ function appFirestoreModuleMetadata(config) {
9136
9160
  var _contextModuleMetadata_imports, _config_imports, _contextModuleMetadata_exports, _config_exports, _contextModuleMetadata_providers, _config_providers;
9137
9161
  var contextModuleMetadata = config.firestoreContextCacheFactory ? firebaseServerFirestoreContextModuleMetadata({
@@ -9206,6 +9230,11 @@ function _object_spread_props$7(target, source) {
9206
9230
  * The attached `__handler` enables direct handler invocation in tests without triggering
9207
9231
  * the full Firebase blocking function infrastructure.
9208
9232
  *
9233
+ * @param blockingFunctionBuilder - The Firebase blocking function constructor (e.g., `beforeUserCreated`).
9234
+ * @param handler - The handler logic to execute on each event.
9235
+ * @param opts - Optional {@link BlockingOptions} passed to the builder.
9236
+ * @returns A {@link BlockingFunctionWithHandler} with the handler accessible via `__handler`.
9237
+ *
9209
9238
  * @example
9210
9239
  * ```ts
9211
9240
  * const fn = makeBlockingFunctionWithHandler(
@@ -9216,10 +9245,6 @@ function _object_spread_props$7(target, source) {
9216
9245
  * // In tests: fn.__handler(mockEvent)
9217
9246
  * ```
9218
9247
  *
9219
- * @param blockingFunctionBuilder - The Firebase blocking function constructor (e.g., `beforeUserCreated`).
9220
- * @param handler - The handler logic to execute on each event.
9221
- * @param opts - Optional {@link BlockingOptions} passed to the builder.
9222
- * @returns A {@link BlockingFunctionWithHandler} with the handler accessible via `__handler`.
9223
9248
  * @__NO_SIDE_EFFECTS__
9224
9249
  */ function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
9225
9250
  var blockingFn = opts != null ? blockingFunctionBuilder(opts, handler) : blockingFunctionBuilder(handler);
@@ -9233,6 +9258,9 @@ function _object_spread_props$7(target, source) {
9233
9258
  * The returned factory lazily resolves the NestJS application on each invocation, injects the
9234
9259
  * typed context into the event, and delegates to the handler.
9235
9260
  *
9261
+ * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
9262
+ * @returns A factory for creating nest-context-aware blocking function handlers.
9263
+ *
9236
9264
  * @example
9237
9265
  * ```ts
9238
9266
  * const factory = blockingFunctionHandlerWithNestContextFactory(makeMyContext);
@@ -9244,8 +9272,6 @@ function _object_spread_props$7(target, source) {
9244
9272
  * );
9245
9273
  * ```
9246
9274
  *
9247
- * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
9248
- * @returns A factory for creating nest-context-aware blocking function handlers.
9249
9275
  * @__NO_SIDE_EFFECTS__
9250
9276
  */ function blockingFunctionHandlerWithNestContextFactory(makeNestContext) {
9251
9277
  return function(fn) {
@@ -9320,6 +9346,9 @@ function _object_spread_props$6(target, source) {
9320
9346
  * The `defaultOpts` are merged with per-function options, allowing shared configuration (e.g., CORS settings,
9321
9347
  * memory allocation) to be set once at the factory level.
9322
9348
  *
9349
+ * @param defaultOpts - Default {@link https.CallableOptions} applied to all functions created by this factory.
9350
+ * @returns A factory that creates nest-application-aware callable functions.
9351
+ *
9323
9352
  * @example
9324
9353
  * ```ts
9325
9354
  * const callFactory = onCallHandlerWithNestApplicationFactory({ cors: true });
@@ -9329,8 +9358,6 @@ function _object_spread_props$6(target, source) {
9329
9358
  * );
9330
9359
  * ```
9331
9360
  *
9332
- * @param defaultOpts - Default {@link https.CallableOptions} applied to all functions created by this factory.
9333
- * @returns A factory that creates nest-application-aware callable functions.
9334
9361
  * @__NO_SIDE_EFFECTS__
9335
9362
  */ function onCallHandlerWithNestApplicationFactory() {
9336
9363
  var defaultOpts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -9353,6 +9380,10 @@ function _object_spread_props$6(target, source) {
9353
9380
  * This is the standard way to create callable functions that receive a domain-specific context
9354
9381
  * (e.g., `MyApiNestContext`) rather than the raw NestJS application context.
9355
9382
  *
9383
+ * @param appFactory - The base application-level callable factory.
9384
+ * @param makeNestContext - Factory that creates the typed context from the application context.
9385
+ * @returns A factory that creates typed-context-aware callable functions.
9386
+ *
9356
9387
  * @example
9357
9388
  * ```ts
9358
9389
  * const appFactory = onCallHandlerWithNestApplicationFactory();
@@ -9363,9 +9394,6 @@ function _object_spread_props$6(target, source) {
9363
9394
  * });
9364
9395
  * ```
9365
9396
  *
9366
- * @param appFactory - The base application-level callable factory.
9367
- * @param makeNestContext - Factory that creates the typed context from the application context.
9368
- * @returns A factory that creates typed-context-aware callable functions.
9369
9397
  * @__NO_SIDE_EFFECTS__
9370
9398
  */ function onCallHandlerWithNestContextFactory(appFactory, makeNestContext) {
9371
9399
  return function(fn, opts) {
@@ -9430,6 +9458,9 @@ function _object_spread_props$5(target, source) {
9430
9458
  * context, and delegates to the handler. This is the event-triggered equivalent of
9431
9459
  * {@link onCallHandlerWithNestContextFactory} for callable functions.
9432
9460
  *
9461
+ * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
9462
+ * @returns A factory for creating nest-context-aware event function handlers.
9463
+ *
9433
9464
  * @example
9434
9465
  * ```ts
9435
9466
  * const factory = cloudEventHandlerWithNestContextFactory(makeMyContext);
@@ -9441,8 +9472,6 @@ function _object_spread_props$5(target, source) {
9441
9472
  * );
9442
9473
  * ```
9443
9474
  *
9444
- * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
9445
- * @returns A factory for creating nest-context-aware event function handlers.
9446
9475
  * @__NO_SIDE_EFFECTS__
9447
9476
  */ function cloudEventHandlerWithNestContextFactory(makeNestContext) {
9448
9477
  return function(fn) {
@@ -9498,6 +9527,9 @@ function _object_spread_props$5(target, source) {
9498
9527
  * merges base and per-function schedule options, and attaches `_runNow` and `_schedule` metadata
9499
9528
  * to the resulting function for testing and introspection.
9500
9529
  *
9530
+ * @param baseScheduleConfig - Optional default schedule options merged into every function created by this factory.
9531
+ * @returns A factory for creating nest-application-aware scheduled functions.
9532
+ *
9501
9533
  * @example
9502
9534
  * ```ts
9503
9535
  * const scheduleFactory = onScheduleHandlerWithNestApplicationFactory({ timeoutSeconds: 60 });
@@ -9507,8 +9539,6 @@ function _object_spread_props$5(target, source) {
9507
9539
  * );
9508
9540
  * ```
9509
9541
  *
9510
- * @param baseScheduleConfig - Optional default schedule options merged into every function created by this factory.
9511
- * @returns A factory for creating nest-application-aware scheduled functions.
9512
9542
  * @__NO_SIDE_EFFECTS__
9513
9543
  */ function onScheduleHandlerWithNestApplicationFactory(baseScheduleConfig) {
9514
9544
  return function(inputSchedule, fn) {
@@ -9605,9 +9635,10 @@ function _object_spread_props$4(target, source) {
9605
9635
  /**
9606
9636
  * Creates a TaskQueueFunctionHandlerWithNestContextFactory.
9607
9637
  *
9608
- * @param appFactory
9609
9638
  * @param makeNestContext
9639
+ * @param appFactory
9610
9640
  * @returns
9641
+ *
9611
9642
  * @__NO_SIDE_EFFECTS__
9612
9643
  */ function taskQueueFunctionHandlerWithNestContextFactory(makeNestContext) {
9613
9644
  return function(fn) {
@@ -9800,13 +9831,13 @@ function _ts_generator$5(thisArg, body) {
9800
9831
  /**
9801
9832
  * Creates a {@link FirebaseServerActionsContext} with the default transform and validation factories.
9802
9833
  *
9834
+ * @param options - Optional configuration for error logging behavior.
9835
+ * @returns A fully configured actions context.
9836
+ *
9803
9837
  * @example
9804
9838
  * ```ts
9805
9839
  * const context = firebaseServerActionsContext({ logError: true });
9806
9840
  * ```
9807
- *
9808
- * @param options - Optional configuration for error logging behavior.
9809
- * @returns A fully configured actions context.
9810
9841
  */ function firebaseServerActionsContext(options) {
9811
9842
  return _object_spread$4({}, firebaseServerActionsTransformContext(options));
9812
9843
  }
@@ -9814,7 +9845,7 @@ function _ts_generator$5(thisArg, body) {
9814
9845
  * Default error logger that writes validation error details to the console.
9815
9846
  * Used when `logError` is `true` or omitted in the factory options.
9816
9847
  *
9817
- * @param details - the validation error details to log.
9848
+ * @param details - The validation error details to log.
9818
9849
  */ var defaultFirebaseServerActionsTransformFactoryLogErrorFunction = function defaultFirebaseServerActionsTransformFactoryLogErrorFunction(details) {
9819
9850
  console.log('firebaseServerActionsTransformFactory() encountered validation error: ', details);
9820
9851
  };
@@ -9870,6 +9901,9 @@ function _ts_generator$5(thisArg, body) {
9870
9901
  *
9871
9902
  * Validation errors are optionally logged before the error is thrown, controlled by the `logError` option.
9872
9903
  *
9904
+ * @param options - Optional configuration for error logging behavior.
9905
+ * @returns A factory that creates type-safe transform functions from ArkType schemas.
9906
+ *
9873
9907
  * @example
9874
9908
  * ```ts
9875
9909
  * const transformFactory = firebaseServerActionsTransformFactory({ logError: true });
@@ -9877,8 +9911,6 @@ function _ts_generator$5(thisArg, body) {
9877
9911
  * const validated = await transform(rawInput);
9878
9912
  * ```
9879
9913
  *
9880
- * @param options - Optional configuration for error logging behavior.
9881
- * @returns A factory that creates type-safe transform functions from ArkType schemas.
9882
9914
  * @__NO_SIDE_EFFECTS__
9883
9915
  */ function firebaseServerActionsTransformFactory(options) {
9884
9916
  var logError = (options !== null && options !== void 0 ? options : {}).logError;
@@ -10805,8 +10837,8 @@ function _ts_generator$2(thisArg, body) {
10805
10837
  /**
10806
10838
  * Resolves a Google Cloud Storage {@link Bucket} from a {@link StoragePath}.
10807
10839
  *
10808
- * @param storage - the Google Cloud Storage client instance.
10809
- * @param path - the storage path containing the bucket ID.
10840
+ * @param storage - The Google Cloud Storage client instance.
10841
+ * @param path - The storage path containing the bucket ID.
10810
10842
  * @returns The resolved Google Cloud Storage bucket.
10811
10843
  */ function googleCloudStorageBucketForStorageFilePath(storage, path) {
10812
10844
  return storage.bucket(path.bucketId);
@@ -10814,8 +10846,8 @@ function _ts_generator$2(thisArg, body) {
10814
10846
  /**
10815
10847
  * Resolves a Google Cloud Storage {@link GoogleCloudFile} from a {@link StoragePath}.
10816
10848
  *
10817
- * @param storage - the Google Cloud Storage client instance.
10818
- * @param path - the storage path containing bucket ID and file path.
10849
+ * @param storage - The Google Cloud Storage client instance.
10850
+ * @param path - The storage path containing bucket ID and file path.
10819
10851
  * @returns The resolved Google Cloud Storage file reference.
10820
10852
  */ function googleCloudStorageFileForStorageFilePath(storage, path) {
10821
10853
  return googleCloudStorageBucketForStorageFilePath(storage, path).file(path.pathString);
@@ -10823,8 +10855,8 @@ function _ts_generator$2(thisArg, body) {
10823
10855
  /**
10824
10856
  * Converts Google Cloud Storage {@link FileMetadata} into the normalized {@link StorageMetadata} format.
10825
10857
  *
10826
- * @param file - the Google Cloud Storage file reference.
10827
- * @param metadata - the raw file metadata from the Google Cloud SDK.
10858
+ * @param file - The Google Cloud Storage file reference.
10859
+ * @param metadata - The raw file metadata from the Google Cloud SDK.
10828
10860
  * @returns Normalized storage metadata.
10829
10861
  */ function googleCloudFileMetadataToStorageMetadata(file, metadata) {
10830
10862
  var _metadata_generation;
@@ -10857,8 +10889,8 @@ function _ts_generator$2(thisArg, body) {
10857
10889
  *
10858
10890
  * Handles emulator-specific edge cases (e.g., signing errors, atomic move fallback).
10859
10891
  *
10860
- * @param storage - the Google Cloud Storage client instance.
10861
- * @param storagePath - the storage path identifying the file's bucket and path.
10892
+ * @param storage - The Google Cloud Storage client instance.
10893
+ * @param storagePath - The storage path identifying the file's bucket and path.
10862
10894
  * @returns A file accessor with CRUD, streaming, and ACL operations.
10863
10895
  */ function googleCloudStorageAccessorFile(storage, storagePath) {
10864
10896
  var file = googleCloudStorageFileForStorageFilePath(storage, storagePath);
@@ -11217,8 +11249,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
11217
11249
  * Creates a {@link GoogleCloudStorageAccessorFolder} that supports checking folder existence
11218
11250
  * and listing files/subfolders with pagination.
11219
11251
  *
11220
- * @param storage - the Google Cloud Storage client instance.
11221
- * @param storagePath - the storage path identifying the folder's bucket and prefix.
11252
+ * @param storage - The Google Cloud Storage client instance.
11253
+ * @param storagePath - The storage path identifying the folder's bucket and prefix.
11222
11254
  * @returns A folder accessor with existence checking and listing operations.
11223
11255
  */ function googleCloudStorageAccessorFolder(storage, storagePath) {
11224
11256
  var bucket = googleCloudStorageBucketForStorageFilePath(storage, storagePath);
@@ -11554,7 +11586,7 @@ FirebaseServerStorageContextModule = __decorate([
11554
11586
  *
11555
11587
  * @param input - A bucket ID string or full factory config object.
11556
11588
  * @returns A NestJS provider for the storage context factory config token.
11557
- * @throws Error if `defaultBucketId` is empty.
11589
+ * @throws {Error} If `defaultBucketId` is empty.
11558
11590
  *
11559
11591
  * @example
11560
11592
  * ```typescript
@@ -11591,7 +11623,7 @@ FirebaseServerStorageContextModule = __decorate([
11591
11623
  * so the service can also be injected by the abstract type.
11592
11624
  *
11593
11625
  * @param provider - The storage service provider configuration.
11594
- * @returns An array of NestJS providers for the storage service.
11626
+ * @returns Array of NestJS providers for the storage service.
11595
11627
  * @__NO_SIDE_EFFECTS__
11596
11628
  */ function provideFirebaseServerStorageService(provider) {
11597
11629
  var _provider_inject;
@@ -11617,11 +11649,12 @@ FirebaseServerStorageContextModule = __decorate([
11617
11649
  * @param config - Optional configuration including a custom service provider and additional module metadata.
11618
11650
  * @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
11619
11651
  *
11620
- * @example
11621
- * ```typescript
11622
- * @Module(firebaseServerStorageModuleMetadata())
11652
+ * @Module (firebaseServerStorageModuleMetadata())
11623
11653
  * export class AppStorageModule {}
11624
11654
  * ```
11655
+ *
11656
+ * @example
11657
+ * ```typescript
11625
11658
  */ function firebaseServerStorageModuleMetadata(config) {
11626
11659
  var _ref;
11627
11660
  var serviceProvider = (_ref = config === null || config === void 0 ? void 0 : config.serviceProvider) !== null && _ref !== void 0 ? _ref : defaultProvideFirebaseServerStorageServiceSimple();
@@ -11735,8 +11768,9 @@ var FirebaseNestServerRootModule = function FirebaseNestServerRootModule() {
11735
11768
  * - `GlobalRoutePrefixConfig` token
11736
11769
  * - Optional webhook and AppCheck middleware modules
11737
11770
  *
11738
- * @param config - Shared configuration
11739
- * @returns The root module and resolved prefix config
11771
+ * @param config - Shared configuration.
11772
+ * @returns The root module and resolved prefix config.
11773
+ *
11740
11774
  * @__NO_SIDE_EFFECTS__
11741
11775
  */ function buildNestServerRootModule(config) {
11742
11776
  var _ref, _ref1;
@@ -12038,6 +12072,7 @@ function _ts_generator$1(thisArg, body) {
12038
12072
  };
12039
12073
  }
12040
12074
  }
12075
+ // COMPAT: Deprecated alias for NestFirebaseServerEnvironmentConfig.
12041
12076
  /**
12042
12077
  * Creates a {@link NestServerInstance} that manages NestJS server lifecycle within Firebase Cloud Functions.
12043
12078
  *
@@ -12418,8 +12453,9 @@ function _ts_generator(thisArg, body) {
12418
12453
  get: /**
12419
12454
  * Returns the NestJS application context.
12420
12455
  *
12421
- * @deprecated use nestApplication instead.
12422
12456
  * @returns The NestJS application context.
12457
+ *
12458
+ * @deprecated use nestApplication instead.
12423
12459
  */ function get() {
12424
12460
  return this._nestApplication;
12425
12461
  }
@@ -12547,9 +12583,9 @@ function _ts_generator(thisArg, body) {
12547
12583
  * {@link nestFirebaseForbiddenPermissionError}. These errors are captured per-key
12548
12584
  * and passed to the `use` function via the failure array (unless `throwOnFirstError` is true).
12549
12585
  *
12550
- * @param type - the model type to load
12551
- * @param select - selection params including keys array, roles, and use function
12552
- * @returns the result of the use function
12586
+ * @param type - The model type to load.
12587
+ * @param select - Selection params including keys array, roles, and use function.
12588
+ * @returns The result of the use function.
12553
12589
  *
12554
12590
  * @example
12555
12591
  * ```ts
@@ -12616,18 +12652,12 @@ function _ts_generator(thisArg, body) {
12616
12652
  throw errors[0].error;
12617
12653
  }
12618
12654
  // useOnFirstError: call use() with empty successes and abortedEarly: true on first error
12619
- if (hasErrors && useOnFirstError) {
12620
- return [
12621
- 2,
12622
- use([], {
12623
- errors: errors,
12624
- abortedEarly: true
12625
- })
12626
- ];
12627
- }
12628
12655
  return [
12629
12656
  2,
12630
- use(successful, {
12657
+ hasErrors && useOnFirstError ? use([], {
12658
+ errors: errors,
12659
+ abortedEarly: true
12660
+ }) : use(successful, {
12631
12661
  errors: errors,
12632
12662
  abortedEarly: false
12633
12663
  })