@dereekb/firebase-server 13.6.1 → 13.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -7,6 +7,7 @@ import { SERVER_ENV_TOKEN, resolveEncryptionKey, encryptValue, decryptValue, mer
7
7
  import { from } from 'rxjs';
8
8
  import { FieldValue, FieldPath } from '@google-cloud/firestore';
9
9
  import { Injectable, Optional, Inject, Module, Logger, ForbiddenException, createParamDecorator } from '@nestjs/common';
10
+ import { ModuleRef, NestFactory } from '@nestjs/core';
10
11
  import { asAnalyticsEventData } from '@dereekb/analytics';
11
12
  import { SegmentService, SegmentServiceModule } from '@dereekb/analytics/nestjs';
12
13
  import { https, scheduler } from 'firebase-functions/v2';
@@ -15,11 +16,10 @@ import admin from 'firebase-admin';
15
16
  import { ApiError } from '@google-cloud/storage';
16
17
  import { addMilliseconds, addHours } from 'date-fns';
17
18
  import { isUint8Array, isArrayBuffer } from 'util/types';
18
- import { NestFactory } from '@nestjs/core';
19
19
  import { ExpressAdapter } from '@nestjs/platform-express';
20
20
  import express from 'express';
21
21
 
22
- function _define_property$v(obj, key, value) {
22
+ function _define_property$u(obj, key, value) {
23
23
  if (key in obj) {
24
24
  Object.defineProperty(obj, key, {
25
25
  value: value,
@@ -42,7 +42,7 @@ function _object_spread$h(target) {
42
42
  }));
43
43
  }
44
44
  ownKeys.forEach(function(key) {
45
- _define_property$v(target, key, source[key]);
45
+ _define_property$u(target, key, source[key]);
46
46
  });
47
47
  }
48
48
  return target;
@@ -639,12 +639,12 @@ function _call_super$5(_this, derived, args) {
639
639
  derived = _get_prototype_of$5(derived);
640
640
  return _possible_constructor_return$5(_this, _is_native_reflect_construct$5() ? Reflect.construct(derived, args || [], _get_prototype_of$5(_this).constructor) : derived.apply(_this, args));
641
641
  }
642
- function _class_call_check$p(instance, Constructor) {
642
+ function _class_call_check$o(instance, Constructor) {
643
643
  if (!(instance instanceof Constructor)) {
644
644
  throw new TypeError("Cannot call a class as a function");
645
645
  }
646
646
  }
647
- function _define_property$u(obj, key, value) {
647
+ function _define_property$t(obj, key, value) {
648
648
  if (key in obj) {
649
649
  Object.defineProperty(obj, key, {
650
650
  value: value,
@@ -718,11 +718,11 @@ function _is_native_reflect_construct$5() {
718
718
  */ var FirebaseServerAuthUserExistsError = /*#__PURE__*/ function(BaseError) {
719
719
  _inherits$5(FirebaseServerAuthUserExistsError, BaseError);
720
720
  function FirebaseServerAuthUserExistsError(code, identifierType, identifierValue) {
721
- _class_call_check$p(this, FirebaseServerAuthUserExistsError);
721
+ _class_call_check$o(this, FirebaseServerAuthUserExistsError);
722
722
  var _this;
723
723
  _this = _call_super$5(this, FirebaseServerAuthUserExistsError, [
724
724
  "A user with the provided ".concat(identifierType, " already exists.")
725
- ]), _define_property$u(_this, "code", void 0), _define_property$u(_this, "identifierType", void 0), _define_property$u(_this, "identifierValue", void 0);
725
+ ]), _define_property$t(_this, "code", void 0), _define_property$t(_this, "identifierType", void 0), _define_property$t(_this, "identifierValue", void 0);
726
726
  _this.code = code;
727
727
  _this.identifierType = identifierType;
728
728
  _this.identifierValue = identifierValue;
@@ -747,11 +747,11 @@ function _is_native_reflect_construct$5() {
747
747
  */ var FirebaseServerAuthUserBadInputError = /*#__PURE__*/ function(BaseError) {
748
748
  _inherits$5(FirebaseServerAuthUserBadInputError, BaseError);
749
749
  function FirebaseServerAuthUserBadInputError(code, inputValue, message) {
750
- _class_call_check$p(this, FirebaseServerAuthUserBadInputError);
750
+ _class_call_check$o(this, FirebaseServerAuthUserBadInputError);
751
751
  var _this;
752
752
  _this = _call_super$5(this, FirebaseServerAuthUserBadInputError, [
753
753
  message !== null && message !== void 0 ? message : "Invalid input for user creation: ".concat(inputValue)
754
- ]), _define_property$u(_this, "code", void 0), _define_property$u(_this, "inputValue", void 0);
754
+ ]), _define_property$t(_this, "code", void 0), _define_property$t(_this, "inputValue", void 0);
755
755
  _this.code = code;
756
756
  _this.inputValue = inputValue;
757
757
  return _this;
@@ -763,7 +763,7 @@ function _is_native_reflect_construct$5() {
763
763
  */ var FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError = /*#__PURE__*/ function(BaseError) {
764
764
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, BaseError);
765
765
  function FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError() {
766
- _class_call_check$p(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError);
766
+ _class_call_check$o(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError);
767
767
  return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, [
768
768
  "This user has no setup configuration available."
769
769
  ]);
@@ -775,11 +775,11 @@ function _is_native_reflect_construct$5() {
775
775
  */ var FirebaseServerAuthNewUserSendSetupDetailsThrottleError = /*#__PURE__*/ function(BaseError) {
776
776
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsThrottleError, BaseError);
777
777
  function FirebaseServerAuthNewUserSendSetupDetailsThrottleError(lastSentAt) {
778
- _class_call_check$p(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError);
778
+ _class_call_check$o(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError);
779
779
  var _this;
780
780
  _this = _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, [
781
781
  "This user was recently sent details. Try again later."
782
- ]), _define_property$u(_this, "lastSentAt", void 0);
782
+ ]), _define_property$t(_this, "lastSentAt", void 0);
783
783
  _this.lastSentAt = lastSentAt;
784
784
  return _this;
785
785
  }
@@ -791,7 +791,7 @@ function _is_native_reflect_construct$5() {
791
791
  */ var FirebaseServerAuthNewUserSendSetupDetailsSendOnceError = /*#__PURE__*/ function(BaseError) {
792
792
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, BaseError);
793
793
  function FirebaseServerAuthNewUserSendSetupDetailsSendOnceError() {
794
- _class_call_check$p(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError);
794
+ _class_call_check$o(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError);
795
795
  return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, [
796
796
  "The user has been sent details before and the sendSetupDetailsOnce configuration was true."
797
797
  ]);
@@ -850,12 +850,12 @@ function _call_super$4(_this, derived, args) {
850
850
  derived = _get_prototype_of$4(derived);
851
851
  return _possible_constructor_return$4(_this, _is_native_reflect_construct$4() ? Reflect.construct(derived, args || [], _get_prototype_of$4(_this).constructor) : derived.apply(_this, args));
852
852
  }
853
- function _class_call_check$o(instance, Constructor) {
853
+ function _class_call_check$n(instance, Constructor) {
854
854
  if (!(instance instanceof Constructor)) {
855
855
  throw new TypeError("Cannot call a class as a function");
856
856
  }
857
857
  }
858
- function _defineProperties$e(target, props) {
858
+ function _defineProperties$d(target, props) {
859
859
  for(var i = 0; i < props.length; i++){
860
860
  var descriptor = props[i];
861
861
  descriptor.enumerable = descriptor.enumerable || false;
@@ -864,11 +864,11 @@ function _defineProperties$e(target, props) {
864
864
  Object.defineProperty(target, descriptor.key, descriptor);
865
865
  }
866
866
  }
867
- function _create_class$e(Constructor, protoProps, staticProps) {
868
- if (protoProps) _defineProperties$e(Constructor.prototype, protoProps);
867
+ function _create_class$d(Constructor, protoProps, staticProps) {
868
+ if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
869
869
  return Constructor;
870
870
  }
871
- function _define_property$t(obj, key, value) {
871
+ function _define_property$s(obj, key, value) {
872
872
  if (key in obj) {
873
873
  Object.defineProperty(obj, key, {
874
874
  value: value,
@@ -943,7 +943,7 @@ function _object_spread$g(target) {
943
943
  }));
944
944
  }
945
945
  ownKeys.forEach(function(key) {
946
- _define_property$t(target, key, source[key]);
946
+ _define_property$s(target, key, source[key]);
947
947
  });
948
948
  }
949
949
  return target;
@@ -1119,16 +1119,16 @@ function _ts_generator$b(thisArg, body) {
1119
1119
  */ var AbstractFirebaseServerAuthUserContext = /*#__PURE__*/ function() {
1120
1120
  function AbstractFirebaseServerAuthUserContext(service, uid) {
1121
1121
  var _this = this;
1122
- _class_call_check$o(this, AbstractFirebaseServerAuthUserContext);
1123
- _define_property$t(this, "_service", void 0);
1124
- _define_property$t(this, "_uid", void 0);
1125
- _define_property$t(this, "_loadRecord", cachedGetter(function() {
1122
+ _class_call_check$n(this, AbstractFirebaseServerAuthUserContext);
1123
+ _define_property$s(this, "_service", void 0);
1124
+ _define_property$s(this, "_uid", void 0);
1125
+ _define_property$s(this, "_loadRecord", cachedGetter(function() {
1126
1126
  return _this._service.auth.getUser(_this._uid);
1127
1127
  }));
1128
1128
  this._service = service;
1129
1129
  this._uid = uid;
1130
1130
  }
1131
- _create_class$e(AbstractFirebaseServerAuthUserContext, [
1131
+ _create_class$d(AbstractFirebaseServerAuthUserContext, [
1132
1132
  {
1133
1133
  key: "service",
1134
1134
  get: function get() {
@@ -1190,7 +1190,7 @@ function _ts_generator$b(thisArg, body) {
1190
1190
  switch(_state.label){
1191
1191
  case 0:
1192
1192
  password = this._generateResetPasswordKey();
1193
- passwordClaimsData = (_obj = {}, _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(new Date())), _obj);
1193
+ passwordClaimsData = (_obj = {}, _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(new Date())), _obj);
1194
1194
  // set the claims
1195
1195
  return [
1196
1196
  4,
@@ -1259,7 +1259,7 @@ function _ts_generator$b(thisArg, body) {
1259
1259
  // clear password reset claims
1260
1260
  return [
1261
1261
  4,
1262
- this.updateClaims((_obj = {}, _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, null), _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, null), _obj))
1262
+ this.updateClaims((_obj = {}, _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, null), _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, null), _obj))
1263
1263
  ];
1264
1264
  case 2:
1265
1265
  _state.sent();
@@ -1451,25 +1451,25 @@ function _ts_generator$b(thisArg, body) {
1451
1451
  */ var AbstractFirebaseServerAuthContext = /*#__PURE__*/ function() {
1452
1452
  function AbstractFirebaseServerAuthContext(service, context) {
1453
1453
  var _this = this;
1454
- _class_call_check$o(this, AbstractFirebaseServerAuthContext);
1455
- _define_property$t(this, "_service", void 0);
1456
- _define_property$t(this, "_context", void 0);
1457
- _define_property$t(this, "_authRoles", cachedGetter(function() {
1454
+ _class_call_check$n(this, AbstractFirebaseServerAuthContext);
1455
+ _define_property$s(this, "_service", void 0);
1456
+ _define_property$s(this, "_context", void 0);
1457
+ _define_property$s(this, "_authRoles", cachedGetter(function() {
1458
1458
  return _this.service.readRoles(_this.claims);
1459
1459
  }));
1460
- _define_property$t(this, "_isAdmin", cachedGetter(function() {
1460
+ _define_property$s(this, "_isAdmin", cachedGetter(function() {
1461
1461
  return _this.service.isAdminInRoles(_this._authRoles());
1462
1462
  }));
1463
- _define_property$t(this, "_hasSignedTos", cachedGetter(function() {
1463
+ _define_property$s(this, "_hasSignedTos", cachedGetter(function() {
1464
1464
  return _this.service.hasSignedTosInRoles(_this._authRoles());
1465
1465
  }));
1466
- _define_property$t(this, "_userContext", cachedGetter(function() {
1466
+ _define_property$s(this, "_userContext", cachedGetter(function() {
1467
1467
  return _this.service.userContext(_this.context.auth.uid);
1468
1468
  }));
1469
1469
  this._service = service;
1470
1470
  this._context = context;
1471
1471
  }
1472
- _create_class$e(AbstractFirebaseServerAuthContext, [
1472
+ _create_class$d(AbstractFirebaseServerAuthContext, [
1473
1473
  {
1474
1474
  key: "service",
1475
1475
  get: function get() {
@@ -1569,15 +1569,15 @@ function _ts_generator$b(thisArg, body) {
1569
1569
  * ```
1570
1570
  */ var AbstractFirebaseServerNewUserService = /*#__PURE__*/ function() {
1571
1571
  function AbstractFirebaseServerNewUserService(authService) {
1572
- _class_call_check$o(this, AbstractFirebaseServerNewUserService);
1573
- _define_property$t(this, "_authService", void 0);
1572
+ _class_call_check$n(this, AbstractFirebaseServerNewUserService);
1573
+ _define_property$s(this, "_authService", void 0);
1574
1574
  /**
1575
1575
  * Minimum time between setup content sends. Defaults to {@link DEFAULT_SETUP_COM_THROTTLE_TIME} (1 hour).
1576
1576
  * Override in subclasses to customize the throttle window.
1577
- */ _define_property$t(this, "setupThrottleTime", DEFAULT_SETUP_COM_THROTTLE_TIME);
1577
+ */ _define_property$s(this, "setupThrottleTime", DEFAULT_SETUP_COM_THROTTLE_TIME);
1578
1578
  this._authService = authService;
1579
1579
  }
1580
- _create_class$e(AbstractFirebaseServerNewUserService, [
1580
+ _create_class$d(AbstractFirebaseServerNewUserService, [
1581
1581
  {
1582
1582
  key: "authService",
1583
1583
  get: function get() {
@@ -1693,7 +1693,7 @@ function _ts_generator$b(thisArg, body) {
1693
1693
  userContext = userContextFromUid(this.authService, userContextOrUid);
1694
1694
  return [
1695
1695
  4,
1696
- userContext.updateClaims(_define_property$t({}, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, password))
1696
+ userContext.updateClaims(_define_property$s({}, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, password))
1697
1697
  ];
1698
1698
  case 1:
1699
1699
  _state.sent();
@@ -2011,7 +2011,7 @@ function _ts_generator$b(thisArg, body) {
2011
2011
  case 0:
2012
2012
  return [
2013
2013
  4,
2014
- userContext.updateClaims((_obj = {}, _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, null), _define_property$t(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, null), _obj))
2014
+ userContext.updateClaims((_obj = {}, _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, null), _define_property$s(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, null), _obj))
2015
2015
  ];
2016
2016
  case 1:
2017
2017
  _state.sent();
@@ -2033,10 +2033,10 @@ function _ts_generator$b(thisArg, body) {
2033
2033
  */ var NoSetupContentFirebaseServerNewUserService = /*#__PURE__*/ function(AbstractFirebaseServerNewUserService) {
2034
2034
  _inherits$4(NoSetupContentFirebaseServerNewUserService, AbstractFirebaseServerNewUserService);
2035
2035
  function NoSetupContentFirebaseServerNewUserService() {
2036
- _class_call_check$o(this, NoSetupContentFirebaseServerNewUserService);
2036
+ _class_call_check$n(this, NoSetupContentFirebaseServerNewUserService);
2037
2037
  return _call_super$4(this, NoSetupContentFirebaseServerNewUserService, arguments);
2038
2038
  }
2039
- _create_class$e(NoSetupContentFirebaseServerNewUserService, [
2039
+ _create_class$d(NoSetupContentFirebaseServerNewUserService, [
2040
2040
  {
2041
2041
  key: "sendSetupContentToUser",
2042
2042
  value: function sendSetupContentToUser(_details) {
@@ -2073,7 +2073,7 @@ function _ts_generator$b(thisArg, body) {
2073
2073
  * }
2074
2074
  * ```
2075
2075
  */ var FirebaseServerAuthService = function FirebaseServerAuthService() {
2076
- _class_call_check$o(this, FirebaseServerAuthService);
2076
+ _class_call_check$n(this, FirebaseServerAuthService);
2077
2077
  };
2078
2078
  /**
2079
2079
  * Base implementation of {@link FirebaseServerAuthService} providing standard admin/ToS checks,
@@ -2104,11 +2104,11 @@ function _ts_generator$b(thisArg, body) {
2104
2104
  * ```
2105
2105
  */ var AbstractFirebaseServerAuthService = /*#__PURE__*/ function() {
2106
2106
  function AbstractFirebaseServerAuthService(auth) {
2107
- _class_call_check$o(this, AbstractFirebaseServerAuthService);
2108
- _define_property$t(this, "_auth", void 0);
2107
+ _class_call_check$n(this, AbstractFirebaseServerAuthService);
2108
+ _define_property$s(this, "_auth", void 0);
2109
2109
  this._auth = auth;
2110
2110
  }
2111
- _create_class$e(AbstractFirebaseServerAuthService, [
2111
+ _create_class$d(AbstractFirebaseServerAuthService, [
2112
2112
  {
2113
2113
  key: "auth",
2114
2114
  get: function get() {
@@ -2246,7 +2246,7 @@ function _ts_generator$b(thisArg, body) {
2246
2246
  ];
2247
2247
  }
2248
2248
 
2249
- function _class_call_check$n(instance, Constructor) {
2249
+ function _class_call_check$m(instance, Constructor) {
2250
2250
  if (!(instance instanceof Constructor)) {
2251
2251
  throw new TypeError("Cannot call a class as a function");
2252
2252
  }
@@ -2258,7 +2258,7 @@ function _class_call_check$n(instance, Constructor) {
2258
2258
  * Implementations are typically injected via {@link FIREBASE_SERVER_ENV_TOKEN} and
2259
2259
  * backed by a {@link FirebaseServerEnvironmentConfig}.
2260
2260
  */ var FirebaseServerEnvService = function FirebaseServerEnvService() {
2261
- _class_call_check$n(this, FirebaseServerEnvService);
2261
+ _class_call_check$m(this, FirebaseServerEnvService);
2262
2262
  }
2263
2263
  ;
2264
2264
 
@@ -2292,7 +2292,7 @@ function _array_like_to_array$9(arr, len) {
2292
2292
  function _array_without_holes$6(arr) {
2293
2293
  if (Array.isArray(arr)) return _array_like_to_array$9(arr);
2294
2294
  }
2295
- function _define_property$s(obj, key, value) {
2295
+ function _define_property$r(obj, key, value) {
2296
2296
  if (key in obj) {
2297
2297
  Object.defineProperty(obj, key, {
2298
2298
  value: value,
@@ -2321,7 +2321,7 @@ function _object_spread$f(target) {
2321
2321
  }));
2322
2322
  }
2323
2323
  ownKeys.forEach(function(key) {
2324
- _define_property$s(target, key, source[key]);
2324
+ _define_property$r(target, key, source[key]);
2325
2325
  });
2326
2326
  }
2327
2327
  return target;
@@ -2371,12 +2371,12 @@ function _unsupported_iterable_to_array$9(o, minLen) {
2371
2371
  return updateData;
2372
2372
  }
2373
2373
 
2374
- function _class_call_check$m(instance, Constructor) {
2374
+ function _class_call_check$l(instance, Constructor) {
2375
2375
  if (!(instance instanceof Constructor)) {
2376
2376
  throw new TypeError("Cannot call a class as a function");
2377
2377
  }
2378
2378
  }
2379
- function _defineProperties$d(target, props) {
2379
+ function _defineProperties$c(target, props) {
2380
2380
  for(var i = 0; i < props.length; i++){
2381
2381
  var descriptor = props[i];
2382
2382
  descriptor.enumerable = descriptor.enumerable || false;
@@ -2385,11 +2385,11 @@ function _defineProperties$d(target, props) {
2385
2385
  Object.defineProperty(target, descriptor.key, descriptor);
2386
2386
  }
2387
2387
  }
2388
- function _create_class$d(Constructor, protoProps, staticProps) {
2389
- if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
2388
+ function _create_class$c(Constructor, protoProps, staticProps) {
2389
+ if (protoProps) _defineProperties$c(Constructor.prototype, protoProps);
2390
2390
  return Constructor;
2391
2391
  }
2392
- function _define_property$r(obj, key, value) {
2392
+ function _define_property$q(obj, key, value) {
2393
2393
  if (key in obj) {
2394
2394
  Object.defineProperty(obj, key, {
2395
2395
  value: value,
@@ -2411,13 +2411,13 @@ function _define_property$r(obj, key, value) {
2411
2411
  * (get, exists) bypass the batch and read directly from Firestore.
2412
2412
  */ var WriteBatchFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
2413
2413
  function WriteBatchFirestoreDocumentDataAccessor(batch, documentRef) {
2414
- _class_call_check$m(this, WriteBatchFirestoreDocumentDataAccessor);
2415
- _define_property$r(this, "documentRef", void 0);
2416
- _define_property$r(this, "_batch", void 0);
2414
+ _class_call_check$l(this, WriteBatchFirestoreDocumentDataAccessor);
2415
+ _define_property$q(this, "documentRef", void 0);
2416
+ _define_property$q(this, "_batch", void 0);
2417
2417
  this.documentRef = documentRef;
2418
2418
  this._batch = batch;
2419
2419
  }
2420
- _create_class$d(WriteBatchFirestoreDocumentDataAccessor, [
2420
+ _create_class$c(WriteBatchFirestoreDocumentDataAccessor, [
2421
2421
  {
2422
2422
  key: "batch",
2423
2423
  get: function get() {
@@ -2528,14 +2528,14 @@ function _define_property$r(obj, key, value) {
2528
2528
  * All document accessors created from this context queue writes into the same batch.
2529
2529
  */ var WriteBatchFirestoreDocumentContext = /*#__PURE__*/ function() {
2530
2530
  function WriteBatchFirestoreDocumentContext(batch) {
2531
- _class_call_check$m(this, WriteBatchFirestoreDocumentContext);
2532
- _define_property$r(this, "_batch", void 0);
2533
- _define_property$r(this, "contextType", FirestoreDocumentContextType.BATCH);
2534
- _define_property$r(this, "accessorFactory", void 0);
2531
+ _class_call_check$l(this, WriteBatchFirestoreDocumentContext);
2532
+ _define_property$q(this, "_batch", void 0);
2533
+ _define_property$q(this, "contextType", FirestoreDocumentContextType.BATCH);
2534
+ _define_property$q(this, "accessorFactory", void 0);
2535
2535
  this._batch = batch;
2536
2536
  this.accessorFactory = writeBatchAccessorFactory(batch);
2537
2537
  }
2538
- _create_class$d(WriteBatchFirestoreDocumentContext, [
2538
+ _create_class$c(WriteBatchFirestoreDocumentContext, [
2539
2539
  {
2540
2540
  key: "batch",
2541
2541
  get: function get() {
@@ -2554,12 +2554,12 @@ function _define_property$r(obj, key, value) {
2554
2554
  return new WriteBatchFirestoreDocumentContext(batch);
2555
2555
  }
2556
2556
 
2557
- function _class_call_check$l(instance, Constructor) {
2557
+ function _class_call_check$k(instance, Constructor) {
2558
2558
  if (!(instance instanceof Constructor)) {
2559
2559
  throw new TypeError("Cannot call a class as a function");
2560
2560
  }
2561
2561
  }
2562
- function _defineProperties$c(target, props) {
2562
+ function _defineProperties$b(target, props) {
2563
2563
  for(var i = 0; i < props.length; i++){
2564
2564
  var descriptor = props[i];
2565
2565
  descriptor.enumerable = descriptor.enumerable || false;
@@ -2568,11 +2568,11 @@ function _defineProperties$c(target, props) {
2568
2568
  Object.defineProperty(target, descriptor.key, descriptor);
2569
2569
  }
2570
2570
  }
2571
- function _create_class$c(Constructor, protoProps, staticProps) {
2572
- if (protoProps) _defineProperties$c(Constructor.prototype, protoProps);
2571
+ function _create_class$b(Constructor, protoProps, staticProps) {
2572
+ if (protoProps) _defineProperties$b(Constructor.prototype, protoProps);
2573
2573
  return Constructor;
2574
2574
  }
2575
- function _define_property$q(obj, key, value) {
2575
+ function _define_property$p(obj, key, value) {
2576
2576
  if (key in obj) {
2577
2577
  Object.defineProperty(obj, key, {
2578
2578
  value: value,
@@ -2593,11 +2593,11 @@ function _define_property$q(obj, key, value) {
2593
2593
  * batching or transactional context. Supports real-time streaming via `onSnapshot`.
2594
2594
  */ var DefaultFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
2595
2595
  function DefaultFirestoreDocumentDataAccessor(documentRef) {
2596
- _class_call_check$l(this, DefaultFirestoreDocumentDataAccessor);
2597
- _define_property$q(this, "_documentRef", void 0);
2596
+ _class_call_check$k(this, DefaultFirestoreDocumentDataAccessor);
2597
+ _define_property$p(this, "_documentRef", void 0);
2598
2598
  this._documentRef = documentRef;
2599
2599
  }
2600
- _create_class$c(DefaultFirestoreDocumentDataAccessor, [
2600
+ _create_class$b(DefaultFirestoreDocumentDataAccessor, [
2601
2601
  {
2602
2602
  key: "documentRef",
2603
2603
  get: function get() {
@@ -2704,12 +2704,12 @@ function _define_property$q(obj, key, value) {
2704
2704
  };
2705
2705
  }
2706
2706
 
2707
- function _class_call_check$k(instance, Constructor) {
2707
+ function _class_call_check$j(instance, Constructor) {
2708
2708
  if (!(instance instanceof Constructor)) {
2709
2709
  throw new TypeError("Cannot call a class as a function");
2710
2710
  }
2711
2711
  }
2712
- function _defineProperties$b(target, props) {
2712
+ function _defineProperties$a(target, props) {
2713
2713
  for(var i = 0; i < props.length; i++){
2714
2714
  var descriptor = props[i];
2715
2715
  descriptor.enumerable = descriptor.enumerable || false;
@@ -2718,11 +2718,11 @@ function _defineProperties$b(target, props) {
2718
2718
  Object.defineProperty(target, descriptor.key, descriptor);
2719
2719
  }
2720
2720
  }
2721
- function _create_class$b(Constructor, protoProps, staticProps) {
2722
- if (protoProps) _defineProperties$b(Constructor.prototype, protoProps);
2721
+ function _create_class$a(Constructor, protoProps, staticProps) {
2722
+ if (protoProps) _defineProperties$a(Constructor.prototype, protoProps);
2723
2723
  return Constructor;
2724
2724
  }
2725
- function _define_property$p(obj, key, value) {
2725
+ function _define_property$o(obj, key, value) {
2726
2726
  if (key in obj) {
2727
2727
  Object.defineProperty(obj, key, {
2728
2728
  value: value,
@@ -2744,13 +2744,13 @@ function _define_property$p(obj, key, value) {
2744
2744
  * consistency. Writes are committed atomically when the transaction completes.
2745
2745
  */ var TransactionFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
2746
2746
  function TransactionFirestoreDocumentDataAccessor(transaction, documentRef) {
2747
- _class_call_check$k(this, TransactionFirestoreDocumentDataAccessor);
2748
- _define_property$p(this, "_transaction", void 0);
2749
- _define_property$p(this, "_documentRef", void 0);
2747
+ _class_call_check$j(this, TransactionFirestoreDocumentDataAccessor);
2748
+ _define_property$o(this, "_transaction", void 0);
2749
+ _define_property$o(this, "_documentRef", void 0);
2750
2750
  this._transaction = transaction;
2751
2751
  this._documentRef = documentRef;
2752
2752
  }
2753
- _create_class$b(TransactionFirestoreDocumentDataAccessor, [
2753
+ _create_class$a(TransactionFirestoreDocumentDataAccessor, [
2754
2754
  {
2755
2755
  key: "transaction",
2756
2756
  get: function get() {
@@ -2868,14 +2868,14 @@ function _define_property$p(obj, key, value) {
2868
2868
  * All document accessors created from this context operate within the same transaction.
2869
2869
  */ var TransactionFirestoreDocumentContext = /*#__PURE__*/ function() {
2870
2870
  function TransactionFirestoreDocumentContext(transaction) {
2871
- _class_call_check$k(this, TransactionFirestoreDocumentContext);
2872
- _define_property$p(this, "_transaction", void 0);
2873
- _define_property$p(this, "contextType", FirestoreDocumentContextType.TRANSACTION);
2874
- _define_property$p(this, "accessorFactory", void 0);
2871
+ _class_call_check$j(this, TransactionFirestoreDocumentContext);
2872
+ _define_property$o(this, "_transaction", void 0);
2873
+ _define_property$o(this, "contextType", FirestoreDocumentContextType.TRANSACTION);
2874
+ _define_property$o(this, "accessorFactory", void 0);
2875
2875
  this._transaction = transaction;
2876
2876
  this.accessorFactory = transactionAccessorFactory(transaction);
2877
2877
  }
2878
- _create_class$b(TransactionFirestoreDocumentContext, [
2878
+ _create_class$a(TransactionFirestoreDocumentContext, [
2879
2879
  {
2880
2880
  key: "transaction",
2881
2881
  get: function get() {
@@ -3195,7 +3195,7 @@ function _array_like_to_array$7(arr, len) {
3195
3195
  function _array_without_holes$5(arr) {
3196
3196
  if (Array.isArray(arr)) return _array_like_to_array$7(arr);
3197
3197
  }
3198
- function _define_property$o(obj, key, value) {
3198
+ function _define_property$n(obj, key, value) {
3199
3199
  if (key in obj) {
3200
3200
  Object.defineProperty(obj, key, {
3201
3201
  value: value,
@@ -3224,7 +3224,7 @@ function _object_spread$e(target) {
3224
3224
  }));
3225
3225
  }
3226
3226
  ownKeys.forEach(function(key) {
3227
- _define_property$o(target, key, source[key]);
3227
+ _define_property$n(target, key, source[key]);
3228
3228
  });
3229
3229
  }
3230
3230
  return target;
@@ -3265,31 +3265,31 @@ var _obj;
3265
3265
  * Maps each abstract query constraint type to its Google Cloud Firestore implementation.
3266
3266
  *
3267
3267
  * Used by {@link firestoreClientQueryConstraintFunctionsDriver} to build the server-side query driver.
3268
- */ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$o(_obj, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3268
+ */ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$n(_obj, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3269
3269
  return builder.limit(data.limit);
3270
- }), _define_property$o(_obj, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3270
+ }), _define_property$n(_obj, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3271
3271
  return builder.limitToLast(data.limit);
3272
- }), _define_property$o(_obj, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3272
+ }), _define_property$n(_obj, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3273
3273
  return builder.orderBy(data.fieldPath, data.directionStr);
3274
- }), _define_property$o(_obj, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3274
+ }), _define_property$n(_obj, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3275
3275
  return builder.orderBy(FieldPath.documentId(), data.directionStr);
3276
- }), _define_property$o(_obj, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3276
+ }), _define_property$n(_obj, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3277
3277
  return builder.where(data.fieldPath, data.opStr, data.value);
3278
- }), _define_property$o(_obj, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3278
+ }), _define_property$n(_obj, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3279
3279
  return builder.where(FieldPath.documentId(), data.opStr, data.value);
3280
- }), _define_property$o(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3280
+ }), _define_property$n(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3281
3281
  return builder.offset(data.offset);
3282
- }), _define_property$o(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3282
+ }), _define_property$n(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3283
3283
  return builder.startAt(data.snapshot);
3284
- }), _define_property$o(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3284
+ }), _define_property$n(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3285
3285
  return (_builder = builder).startAt.apply(_builder, _to_consumable_array$5(data.fieldValues));
3286
- }), _define_property$o(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3286
+ }), _define_property$n(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3287
3287
  return builder.startAfter(data.snapshot);
3288
- }), _define_property$o(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3288
+ }), _define_property$n(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3289
3289
  return builder.endAt(data.snapshot);
3290
- }), _define_property$o(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3290
+ }), _define_property$n(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3291
3291
  return (_builder1 = builder).endAt.apply(_builder1, _to_consumable_array$5(data.fieldValues));
3292
- }), _define_property$o(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3292
+ }), _define_property$n(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
3293
3293
  return builder.endBefore(data.snapshot);
3294
3294
  }), _obj);
3295
3295
  /**
@@ -3741,7 +3741,7 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
3741
3741
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3742
3742
  };
3743
3743
 
3744
- function _class_call_check$j(instance, Constructor) {
3744
+ function _class_call_check$i(instance, Constructor) {
3745
3745
  if (!(instance instanceof Constructor)) {
3746
3746
  throw new TypeError("Cannot call a class as a function");
3747
3747
  }
@@ -3752,7 +3752,7 @@ function _class_call_check$j(instance, Constructor) {
3752
3752
  * Analogous to {@link DbxAnalyticsService} on the frontend.
3753
3753
  * Apps extend this class and provide it via {@link ON_CALL_MODEL_ANALYTICS_SERVICE}.
3754
3754
  */ var OnCallModelAnalyticsService = function OnCallModelAnalyticsService() {
3755
- _class_call_check$j(this, OnCallModelAnalyticsService);
3755
+ _class_call_check$i(this, OnCallModelAnalyticsService);
3756
3756
  };
3757
3757
  /**
3758
3758
  * Default injection token for the analytics service.
@@ -3774,7 +3774,7 @@ function _class_call_check$j(instance, Constructor) {
3774
3774
  * @deprecated Use {@link ON_CALL_MODEL_ANALYTICS_SERVICE} instead.
3775
3775
  */ var ON_CALL_MODEL_ANALYTICS_HANDLER = ON_CALL_MODEL_ANALYTICS_SERVICE;
3776
3776
 
3777
- function _class_call_check$i(instance, Constructor) {
3777
+ function _class_call_check$h(instance, Constructor) {
3778
3778
  if (!(instance instanceof Constructor)) {
3779
3779
  throw new TypeError("Cannot call a class as a function");
3780
3780
  }
@@ -3784,7 +3784,7 @@ function _class_call_check$i(instance, Constructor) {
3784
3784
  * Events are forwarded from FirebaseServerAnalyticsService to this listener
3785
3785
  * for processing by an analytics provider (e.g., Segment).
3786
3786
  */ var FirebaseServerAnalyticsServiceListener = function FirebaseServerAnalyticsServiceListener() {
3787
- _class_call_check$i(this, FirebaseServerAnalyticsServiceListener);
3787
+ _class_call_check$h(this, FirebaseServerAnalyticsServiceListener);
3788
3788
  };
3789
3789
  /**
3790
3790
  * Creates a default no-op {@link FirebaseServerAnalyticsServiceListener}.
@@ -3814,12 +3814,12 @@ function _call_super$3(_this, derived, args) {
3814
3814
  derived = _get_prototype_of$3(derived);
3815
3815
  return _possible_constructor_return$3(_this, _is_native_reflect_construct$3() ? Reflect.construct(derived, [], _get_prototype_of$3(_this).constructor) : derived.apply(_this, args));
3816
3816
  }
3817
- function _class_call_check$h(instance, Constructor) {
3817
+ function _class_call_check$g(instance, Constructor) {
3818
3818
  if (!(instance instanceof Constructor)) {
3819
3819
  throw new TypeError("Cannot call a class as a function");
3820
3820
  }
3821
3821
  }
3822
- function _defineProperties$a(target, props) {
3822
+ function _defineProperties$9(target, props) {
3823
3823
  for(var i = 0; i < props.length; i++){
3824
3824
  var descriptor = props[i];
3825
3825
  descriptor.enumerable = descriptor.enumerable || false;
@@ -3828,11 +3828,11 @@ function _defineProperties$a(target, props) {
3828
3828
  Object.defineProperty(target, descriptor.key, descriptor);
3829
3829
  }
3830
3830
  }
3831
- function _create_class$a(Constructor, protoProps, staticProps) {
3832
- if (protoProps) _defineProperties$a(Constructor.prototype, protoProps);
3831
+ function _create_class$9(Constructor, protoProps, staticProps) {
3832
+ if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
3833
3833
  return Constructor;
3834
3834
  }
3835
- function _define_property$n(obj, key, value) {
3835
+ function _define_property$m(obj, key, value) {
3836
3836
  if (key in obj) {
3837
3837
  Object.defineProperty(obj, key, {
3838
3838
  value: value,
@@ -3912,9 +3912,9 @@ function _is_native_reflect_construct$3() {
3912
3912
  */ var FirebaseServerAnalyticsService = /*#__PURE__*/ function(OnCallModelAnalyticsService) {
3913
3913
  _inherits$3(FirebaseServerAnalyticsService, OnCallModelAnalyticsService);
3914
3914
  function FirebaseServerAnalyticsService(listener) {
3915
- _class_call_check$h(this, FirebaseServerAnalyticsService);
3915
+ _class_call_check$g(this, FirebaseServerAnalyticsService);
3916
3916
  var _this;
3917
- _this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$n(_this, "_listener", void 0);
3917
+ _this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$m(_this, "_listener", void 0);
3918
3918
  if (listener) {
3919
3919
  _this._listener = listener;
3920
3920
  } else {
@@ -3923,7 +3923,7 @@ function _is_native_reflect_construct$3() {
3923
3923
  }
3924
3924
  return _this;
3925
3925
  }
3926
- _create_class$a(FirebaseServerAnalyticsService, [
3926
+ _create_class$9(FirebaseServerAnalyticsService, [
3927
3927
  {
3928
3928
  key: "handleOnCallAnalyticsEvent",
3929
3929
  value: function handleOnCallAnalyticsEvent(event) {
@@ -4225,95 +4225,6 @@ function _ts_generator$8(thisArg, body) {
4225
4225
  })();
4226
4226
  }
4227
4227
 
4228
- function _class_call_check$g(instance, Constructor) {
4229
- if (!(instance instanceof Constructor)) {
4230
- throw new TypeError("Cannot call a class as a function");
4231
- }
4232
- }
4233
- function _defineProperties$9(target, props) {
4234
- for(var i = 0; i < props.length; i++){
4235
- var descriptor = props[i];
4236
- descriptor.enumerable = descriptor.enumerable || false;
4237
- descriptor.configurable = true;
4238
- if ("value" in descriptor) descriptor.writable = true;
4239
- Object.defineProperty(target, descriptor.key, descriptor);
4240
- }
4241
- }
4242
- function _create_class$9(Constructor, protoProps, staticProps) {
4243
- if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
4244
- return Constructor;
4245
- }
4246
- function _define_property$m(obj, key, value) {
4247
- if (key in obj) {
4248
- Object.defineProperty(obj, key, {
4249
- value: value,
4250
- enumerable: true,
4251
- configurable: true,
4252
- writable: true
4253
- });
4254
- } else {
4255
- obj[key] = value;
4256
- }
4257
- return obj;
4258
- }
4259
- /**
4260
- * Globally-registered resolver for the optional {@link OnCallModelAnalyticsService}.
4261
- *
4262
- * Calling `app.get()` directly for an optional provider through the NestFactory proxy is unsafe:
4263
- * the proxy wraps every method call in `ExceptionsZone`, which invokes `process.exit(1)` when
4264
- * the provider is missing — **before** any surrounding `try/catch` can intercept the error.
4265
- *
4266
- * This resolver sidesteps the issue by using `@Optional() @Inject()` at construction time,
4267
- * which NestJS handles gracefully (injecting `undefined` when the token is absent).
4268
- * When no service is registered, a no-op fallback from {@link noopOnCallModelAnalyticsService}
4269
- * is used instead.
4270
- *
4271
- * For custom analytics tokens, it falls back to `ModuleRef.get()` which is not proxied
4272
- * and throws a normal catchable exception.
4273
- *
4274
- * Register this provider globally via {@link buildNestServerRootModule} so that
4275
- * `app.get(OnCallModelAnalyticsResolver)` always succeeds through the proxy.
4276
- *
4277
- * @example
4278
- * ```typescript
4279
- * // Inside onCallModel dispatch:
4280
- * const resolver = app.get(OnCallModelAnalyticsResolver);
4281
- * const analytics = resolver.getAnalyticsService();
4282
- * ```
4283
- */ var OnCallModelAnalyticsResolver = /*#__PURE__*/ function() {
4284
- function OnCallModelAnalyticsResolver(moduleRef, service) {
4285
- _class_call_check$g(this, OnCallModelAnalyticsResolver);
4286
- _define_property$m(this, "moduleRef", void 0);
4287
- _define_property$m(this, "_service", void 0);
4288
- this.moduleRef = moduleRef;
4289
- this._service = service !== null && service !== void 0 ? service : noopOnCallModelAnalyticsService();
4290
- }
4291
- _create_class$9(OnCallModelAnalyticsResolver, [
4292
- {
4293
- /**
4294
- * Returns the analytics service for the given token, or the default
4295
- * {@link ON_CALL_MODEL_ANALYTICS_SERVICE} if no custom token is specified.
4296
- *
4297
- * @param token - Optional custom injection token override. When omitted or equal to
4298
- * {@link ON_CALL_MODEL_ANALYTICS_SERVICE}, returns the constructor-injected service.
4299
- * @returns The resolved analytics service.
4300
- */ key: "getAnalyticsService",
4301
- value: function getAnalyticsService(token) {
4302
- var result = token != null && token !== ON_CALL_MODEL_ANALYTICS_SERVICE ? this.moduleRef.get(token, {
4303
- strict: false
4304
- }) : this._service;
4305
- return result;
4306
- }
4307
- }
4308
- ]);
4309
- return OnCallModelAnalyticsResolver;
4310
- }();
4311
- OnCallModelAnalyticsResolver = __decorate([
4312
- Injectable(),
4313
- __param(1, Optional()),
4314
- __param(1, Inject(ON_CALL_MODEL_ANALYTICS_SERVICE))
4315
- ], OnCallModelAnalyticsResolver);
4316
-
4317
4228
  function _array_like_to_array$6(arr, len) {
4318
4229
  if (len == null || len > arr.length) len = arr.length;
4319
4230
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -4956,19 +4867,24 @@ function _object_spread_props$b(target, source) {
4956
4867
  // Aggregate _apiDetails from CRUD handlers in the map (built once at setup, not per-request)
4957
4868
  var aggregatedApiDetails = aggregateModelApiDetails(map);
4958
4869
  var modelApiDetails = aggregatedApiDetails !== null && aggregatedApiDetails !== void 0 ? aggregatedApiDetails : {};
4959
- // Resolve analytics service via OnCallModelAnalyticsResolver per-request.
4870
+ // Resolve analytics service per-request via ModuleRef.get().
4960
4871
  // Not cached because the NestJS application instance may differ across test suites
4961
4872
  // when the onCallModel closure is shared as a module-level singleton.
4962
4873
  //
4963
- // Uses OnCallModelAnalyticsResolver (which is always globally registered) instead of
4964
- // resolving ON_CALL_MODEL_ANALYTICS_SERVICE directly. Direct app.get() for an optional
4965
- // provider is unsafe: the NestFactory Proxy wraps method calls in ExceptionsZone, which
4966
- // calls process.exit(1) on missing providers before any try/catch can intercept the error.
4874
+ // Uses ModuleRef.get() instead of app.get() because the NestFactory Proxy wraps
4875
+ // app.get() in ExceptionsZone, which calls process.exit(1) on missing providers
4876
+ // before any try/catch can intercept. ModuleRef.get() is not proxied and throws a
4877
+ // normal catchable exception. Falls back to a no-op service if not registered.
4967
4878
  function getAnalyticsService(request) {
4968
- var resolver = request.nestApplication.get(OnCallModelAnalyticsResolver, {
4969
- strict: false
4970
- });
4971
- return resolver.getAnalyticsService(analyticsToken);
4879
+ var token = analyticsToken !== null && analyticsToken !== void 0 ? analyticsToken : ON_CALL_MODEL_ANALYTICS_SERVICE;
4880
+ var moduleRef = request.nestApplication.get(ModuleRef);
4881
+ try {
4882
+ return moduleRef.get(token, {
4883
+ strict: false
4884
+ });
4885
+ } catch (unused) {
4886
+ return noopOnCallModelAnalyticsService();
4887
+ }
4972
4888
  }
4973
4889
  var fn = function fn(request) {
4974
4890
  var call = request.data.call;
@@ -9452,7 +9368,8 @@ var FirebaseNestServerRootModule = function FirebaseNestServerRootModule() {
9452
9368
  // Respect explicit overrides; only compute defaults when not already set on the config
9453
9369
  var isApiEnabled = (_config_envConfig_isApiEnabled = config.envConfig.isApiEnabled) !== null && _config_envConfig_isApiEnabled !== void 0 ? _config_envConfig_isApiEnabled : appUrl != null && apiPrefix != null;
9454
9370
  var isWebhooksEnabled = (_config_envConfig_isWebhooksEnabled = config.envConfig.isWebhooksEnabled) !== null && _config_envConfig_isWebhooksEnabled !== void 0 ? _config_envConfig_isWebhooksEnabled : appUrl != null && Boolean(config.configureWebhooks);
9455
- var appApiUrl = (_config_envConfig_appApiUrl = config.envConfig.appApiUrl) !== null && _config_envConfig_appApiUrl !== void 0 ? _config_envConfig_appApiUrl : isApiEnabled && appUrl && apiPrefix ? websiteUrlFromPaths(appUrl, "/".concat(apiPrefix)) : undefined;
9371
+ var apiPrefixPath = apiPrefix ? apiPrefix.startsWith('/') ? apiPrefix : "/".concat(apiPrefix) : undefined;
9372
+ var appApiUrl = (_config_envConfig_appApiUrl = config.envConfig.appApiUrl) !== null && _config_envConfig_appApiUrl !== void 0 ? _config_envConfig_appApiUrl : isApiEnabled && appUrl && apiPrefixPath ? websiteUrlFromPaths(appUrl, apiPrefixPath) : undefined;
9456
9373
  var appWebhookUrl = (_config_envConfig_appWebhookUrl = config.envConfig.appWebhookUrl) !== null && _config_envConfig_appWebhookUrl !== void 0 ? _config_envConfig_appWebhookUrl : isWebhooksEnabled && appUrl ? websiteUrlFromPaths(appUrl, DEFAULT_BASE_WEBHOOK_PATH) : undefined;
9457
9374
  var augmentedEnvConfig = _object_spread_props(_object_spread({}, config.envConfig), {
9458
9375
  appApiUrl: appApiUrl,
@@ -9494,10 +9411,6 @@ var FirebaseNestServerRootModule = function FirebaseNestServerRootModule() {
9494
9411
  provide: GlobalRoutePrefixConfig,
9495
9412
  useValue: globalApiRoutePrefixConfig !== null && globalApiRoutePrefixConfig !== void 0 ? globalApiRoutePrefixConfig : {}
9496
9413
  });
9497
- // Analytics resolver — always available so that onCallModel can safely
9498
- // check for the optional ON_CALL_MODEL_ANALYTICS_SERVICE without triggering
9499
- // NestFactory's ExceptionsZone (which calls process.exit(1) on missing providers).
9500
- providers.push(OnCallModelAnalyticsResolver);
9501
9414
  var rootModule = {
9502
9415
  module: FirebaseNestServerRootModule,
9503
9416
  imports: imports,
@@ -10156,4 +10069,4 @@ function _define_property(obj, key, value) {
10156
10069
  }
10157
10070
  ();
10158
10071
 
10159
- export { ALREADY_EXISTS_ERROR_CODE, AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractNestContext, AbstractServerFirebaseNestContext, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, GlobalRoutePrefixConfig, INTERNAL_SERVER_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, NOT_FOUND_ERROR_CODE, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsResolver, OnCallModelAnalyticsService, PERMISSION_DENIED_ERROR_CODE, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SkipAppCheck, UNAUTHENTICATED_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, notFoundError, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, readApiDetails, readModelUnknownModelTypeError, resolveAnalyticsFromApiDetails, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
10072
+ export { ALREADY_EXISTS_ERROR_CODE, AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractNestContext, AbstractServerFirebaseNestContext, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, GlobalRoutePrefixConfig, INTERNAL_SERVER_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, NOT_FOUND_ERROR_CODE, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PERMISSION_DENIED_ERROR_CODE, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SkipAppCheck, UNAUTHENTICATED_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, notFoundError, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, readApiDetails, readModelUnknownModelTypeError, resolveAnalyticsFromApiDetails, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };