@dereekb/firebase-server 14.4.0 → 14.5.1

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 (39) hide show
  1. package/calcom/package.json +11 -10
  2. package/discord/package.json +14 -10
  3. package/index.esm.js +1295 -317
  4. package/mailgun/package.json +9 -9
  5. package/mcp/index.esm.js +483 -83
  6. package/mcp/package.json +12 -12
  7. package/mcp/src/lib/mcp.config.d.ts +73 -3
  8. package/mcp/src/lib/service/index.d.ts +1 -0
  9. package/mcp/src/lib/service/mcp.server.factory.d.ts +3 -2
  10. package/mcp/src/lib/service/mcp.tool-generator.d.ts +9 -0
  11. package/mcp/src/lib/service/tools/mcp.tool.cli-token.d.ts +62 -0
  12. package/model/package.json +13 -10
  13. package/oidc/index.esm.js +3186 -1456
  14. package/oidc/package.json +11 -11
  15. package/oidc/src/lib/controller/index.d.ts +3 -0
  16. package/oidc/src/lib/controller/oidc.cli-token.config.d.ts +323 -0
  17. package/oidc/src/lib/controller/oidc.cli-token.controller.d.ts +45 -0
  18. package/oidc/src/lib/controller/oidc.cli-token.service.d.ts +138 -0
  19. package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +38 -0
  20. package/oidc/src/lib/middleware/oauth-auth.module.d.ts +8 -0
  21. package/oidc/src/lib/oidc.config.d.ts +9 -0
  22. package/oidc/src/lib/oidc.module.d.ts +1 -1
  23. package/oidc/src/lib/service/index.d.ts +1 -0
  24. package/oidc/src/lib/service/oidc.config.service.d.ts +8 -3
  25. package/oidc/src/lib/service/oidc.download-signer.d.ts +17 -0
  26. package/oidc/src/lib/service/oidc.jwt-signing.service.d.ts +35 -0
  27. package/package.json +13 -13
  28. package/src/lib/nest/controller/download/download.api.config.d.ts +203 -0
  29. package/src/lib/nest/controller/download/download.api.controller.d.ts +25 -0
  30. package/src/lib/nest/controller/download/download.api.module.d.ts +47 -0
  31. package/src/lib/nest/controller/download/download.api.service.d.ts +111 -0
  32. package/src/lib/nest/controller/download/index.d.ts +4 -0
  33. package/src/lib/nest/controller/index.d.ts +2 -0
  34. package/src/lib/nest/controller/request.ip.d.ts +60 -0
  35. package/test/index.esm.js +1 -0
  36. package/test/package.json +12 -12
  37. package/test/src/lib/oidc/oidc.test.flow.d.ts +10 -0
  38. package/twilio/package.json +8 -8
  39. package/zoho/package.json +14 -10
package/index.esm.js CHANGED
@@ -1,16 +1,18 @@
1
- import { timingSafeEqual } from 'node:crypto';
1
+ import { timingSafeEqual, createHash } from 'node:crypto';
2
2
  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_RESET_EXPIRES_AT_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_PASSWORD_KEY, 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, oidcScopeTermSatisfied, oidcScopesFromScopeClaim, resolveEffectiveOidcScopeTerms, callModelOidcScopeForCallType, oidcScopeTermsSatisfied, CALL_MODEL_MISSING_OIDC_SCOPE_ERROR_CODE, FIRESTORE_SESSION_OIDC_SCOPE, ScheduledFunctionDevelopmentFunctionTypeEnum, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
3
- import { partialServerError, isServerError, randomNumberFactory, cachedGetter, filterNullAndUndefinedValues, asSet, filterUndefinedValues, AUTH_ADMIN_ROLE, AUTH_TOS_SIGNED_ROLE, forEachKeyValue, KeyValueTypleValueFilter, 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
+ import { partialServerError, isServerError, randomNumberFactory, cachedGetter, filterNullAndUndefinedValues, asSet, filterUndefinedValues, AUTH_ADMIN_ROLE, AUTH_TOS_SIGNED_ROLE, forEachKeyValue, KeyValueTypleValueFilter, isThrottled, mapObjectMap, batch, objectToMap, serverError, asArray, containsAllValues, SECONDS_IN_HOUR, SECONDS_IN_MINUTE, websiteUrlDetails, mergeObjects, cronExpressionRepeatingEveryNMinutes, mapIdentityFunction, slashPathName, toRelativeSlashPathStartType, fixMultiSlashesInSlashPath, SLASH_PATH_SEPARATOR, objectHasNoKeys, websiteUrlFromPaths, pushItemOrArrayItemsIntoArray, makeGetter, asGetter, build, performAsyncTasks } from '@dereekb/util';
4
4
  import { HttpsError } from 'firebase-functions/https';
5
5
  import { hoursToMs, minutesToMs, toISODateString } from '@dereekb/date';
6
6
  import { BaseError } from 'make-error';
7
7
  import { SERVER_ENV_TOKEN, resolveEncryptionKey, encryptValue, decryptValue, mergeModuleMetadata, ServerEnvironmentService, DEFAULT_BASE_WEBHOOK_PATH, DEFAULT_WEBHOOK_MIDDLEWARE_ROUTE_INFO, isTestNodeEnv, injectionTokensFromProviders, nodeJsLocalAssetLoader } from '@dereekb/nestjs';
8
8
  import { from } from 'rxjs';
9
9
  import { FieldValue, FieldPath } from '@google-cloud/firestore';
10
- import { Injectable, Optional, Inject, Module, Post, Body, Req, Get, Param, Query, All, Controller, HttpException, HttpStatus, Logger, ForbiddenException, createParamDecorator } from '@nestjs/common';
10
+ import { Injectable, Optional, Inject, Module, Logger, Get, Query, Res, Controller, HttpStatus, HttpException, Post, Body, Req, Param, All, ForbiddenException, createParamDecorator } from '@nestjs/common';
11
11
  import { ModuleRef, NestFactory } from '@nestjs/core';
12
12
  import { asAnalyticsEventData } from '@dereekb/analytics';
13
13
  import { SegmentService, SegmentServiceModule } from '@dereekb/analytics/nestjs';
14
+ import { realpathSync, existsSync, statSync, readFileSync, createReadStream } from 'node:fs';
15
+ import * as path from 'node:path';
14
16
  import { isFullAccessRoleMap, FULL_ACCESS_ROLE_KEY, NO_ACCESS_ROLE_KEY, toTransformAndValidateFunctionResultFactory, transformAndValidateObjectFactory } from '@dereekb/model';
15
17
  import { https, scheduler } from 'firebase-functions/v2';
16
18
  import admin from 'firebase-admin';
@@ -21,7 +23,7 @@ import { fetchAssetLoader, delegatedAssetLoader, AssetLoader } from '@dereekb/rx
21
23
  import { ExpressAdapter } from '@nestjs/platform-express';
22
24
  import express from 'express';
23
25
 
24
- function _define_property$C(obj, key, value) {
26
+ function _define_property$F(obj, key, value) {
25
27
  if (key in obj) {
26
28
  Object.defineProperty(obj, key, {
27
29
  value: value,
@@ -42,7 +44,7 @@ function _object_spread$m(target) {
42
44
  }));
43
45
  }
44
46
  ownKeys.forEach(function(key) {
45
- _define_property$C(target, key, source[key]);
47
+ _define_property$F(target, key, source[key]);
46
48
  });
47
49
  }
48
50
  return target;
@@ -484,7 +486,7 @@ function toIsoStringFromUnixSeconds(value) {
484
486
  return result;
485
487
  }
486
488
 
487
- function asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, key, arg) {
489
+ function asyncGeneratorStep$l(gen, resolve, reject, _next, _throw, key, arg) {
488
490
  try {
489
491
  var info = gen[key](arg);
490
492
  var value = info.value;
@@ -495,22 +497,22 @@ function asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, key, arg) {
495
497
  if (info.done) resolve(value);
496
498
  else Promise.resolve(value).then(_next, _throw);
497
499
  }
498
- function _async_to_generator$j(fn) {
500
+ function _async_to_generator$l(fn) {
499
501
  return function() {
500
502
  var self = this, args = arguments;
501
503
  return new Promise(function(resolve, reject) {
502
504
  var gen = fn.apply(self, args);
503
505
  function _next(value) {
504
- asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "next", value);
506
+ asyncGeneratorStep$l(gen, resolve, reject, _next, _throw, "next", value);
505
507
  }
506
508
  function _throw(err) {
507
- asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "throw", err);
509
+ asyncGeneratorStep$l(gen, resolve, reject, _next, _throw, "throw", err);
508
510
  }
509
511
  _next(undefined);
510
512
  });
511
513
  };
512
514
  }
513
- function _ts_generator$j(thisArg, body) {
515
+ function _ts_generator$l(thisArg, body) {
514
516
  var f, y, t, _ = {
515
517
  label: 0,
516
518
  sent: function() {
@@ -626,9 +628,9 @@ function _ts_generator$j(thisArg, body) {
626
628
  * }
627
629
  * ```
628
630
  */ function getAuthUserOrUndefined(promise) {
629
- return _async_to_generator$j(function() {
631
+ return _async_to_generator$l(function() {
630
632
  var result, error;
631
- return _ts_generator$j(this, function(_state) {
633
+ return _ts_generator$l(this, function(_state) {
632
634
  switch(_state.label){
633
635
  case 0:
634
636
  _state.trys.push([
@@ -674,10 +676,10 @@ function _call_super$5(_this, derived, args) {
674
676
  derived = _get_prototype_of$5(derived);
675
677
  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));
676
678
  }
677
- function _class_call_check$u(instance, Constructor) {
679
+ function _class_call_check$x(instance, Constructor) {
678
680
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
679
681
  }
680
- function _define_property$B(obj, key, value) {
682
+ function _define_property$E(obj, key, value) {
681
683
  if (key in obj) {
682
684
  Object.defineProperty(obj, key, {
683
685
  value: value,
@@ -747,11 +749,11 @@ function _type_of$6(obj) {
747
749
  */ var FirebaseServerAuthUserExistsError = /*#__PURE__*/ function(BaseError) {
748
750
  _inherits$5(FirebaseServerAuthUserExistsError, BaseError);
749
751
  function FirebaseServerAuthUserExistsError(code, identifierType, identifierValue) {
750
- _class_call_check$u(this, FirebaseServerAuthUserExistsError);
752
+ _class_call_check$x(this, FirebaseServerAuthUserExistsError);
751
753
  var _this;
752
754
  _this = _call_super$5(this, FirebaseServerAuthUserExistsError, [
753
755
  "A user with the provided ".concat(identifierType, " already exists.")
754
- ]), _define_property$B(_this, "code", void 0), _define_property$B(_this, "identifierType", void 0), _define_property$B(_this, "identifierValue", void 0);
756
+ ]), _define_property$E(_this, "code", void 0), _define_property$E(_this, "identifierType", void 0), _define_property$E(_this, "identifierValue", void 0);
755
757
  _this.code = code;
756
758
  _this.identifierType = identifierType;
757
759
  _this.identifierValue = identifierValue;
@@ -776,11 +778,11 @@ function _type_of$6(obj) {
776
778
  */ var FirebaseServerAuthUserBadInputError = /*#__PURE__*/ function(BaseError) {
777
779
  _inherits$5(FirebaseServerAuthUserBadInputError, BaseError);
778
780
  function FirebaseServerAuthUserBadInputError(code, inputValue, message) {
779
- _class_call_check$u(this, FirebaseServerAuthUserBadInputError);
781
+ _class_call_check$x(this, FirebaseServerAuthUserBadInputError);
780
782
  var _this;
781
783
  _this = _call_super$5(this, FirebaseServerAuthUserBadInputError, [
782
784
  message !== null && message !== void 0 ? message : "Invalid input for user creation: ".concat(inputValue)
783
- ]), _define_property$B(_this, "code", void 0), _define_property$B(_this, "inputValue", void 0);
785
+ ]), _define_property$E(_this, "code", void 0), _define_property$E(_this, "inputValue", void 0);
784
786
  _this.code = code;
785
787
  _this.inputValue = inputValue;
786
788
  return _this;
@@ -792,7 +794,7 @@ function _type_of$6(obj) {
792
794
  */ var FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError = /*#__PURE__*/ function(BaseError) {
793
795
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, BaseError);
794
796
  function FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError() {
795
- _class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError);
797
+ _class_call_check$x(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError);
796
798
  return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, [
797
799
  "This user has no setup configuration available."
798
800
  ]);
@@ -804,11 +806,11 @@ function _type_of$6(obj) {
804
806
  */ var FirebaseServerAuthNewUserSendSetupDetailsThrottleError = /*#__PURE__*/ function(BaseError) {
805
807
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsThrottleError, BaseError);
806
808
  function FirebaseServerAuthNewUserSendSetupDetailsThrottleError(lastSentAt) {
807
- _class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError);
809
+ _class_call_check$x(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError);
808
810
  var _this;
809
811
  _this = _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, [
810
812
  "This user was recently sent details. Try again later."
811
- ]), _define_property$B(_this, "lastSentAt", void 0);
813
+ ]), _define_property$E(_this, "lastSentAt", void 0);
812
814
  _this.lastSentAt = lastSentAt;
813
815
  return _this;
814
816
  }
@@ -820,7 +822,7 @@ function _type_of$6(obj) {
820
822
  */ var FirebaseServerAuthNewUserSendSetupDetailsSendOnceError = /*#__PURE__*/ function(BaseError) {
821
823
  _inherits$5(FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, BaseError);
822
824
  function FirebaseServerAuthNewUserSendSetupDetailsSendOnceError() {
823
- _class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError);
825
+ _class_call_check$x(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError);
824
826
  return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, [
825
827
  "The user has been sent details before and the sendSetupDetailsOnce configuration was true."
826
828
  ]);
@@ -834,7 +836,7 @@ function _type_of$6(obj) {
834
836
  */ var FirebaseServerAuthPasswordResetNoResetConfigError = /*#__PURE__*/ function(BaseError) {
835
837
  _inherits$5(FirebaseServerAuthPasswordResetNoResetConfigError, BaseError);
836
838
  function FirebaseServerAuthPasswordResetNoResetConfigError() {
837
- _class_call_check$u(this, FirebaseServerAuthPasswordResetNoResetConfigError);
839
+ _class_call_check$x(this, FirebaseServerAuthPasswordResetNoResetConfigError);
838
840
  return _call_super$5(this, FirebaseServerAuthPasswordResetNoResetConfigError, [
839
841
  "This user has no active password reset configuration."
840
842
  ]);
@@ -847,11 +849,11 @@ function _type_of$6(obj) {
847
849
  */ var FirebaseServerAuthPasswordResetThrottleError = /*#__PURE__*/ function(BaseError) {
848
850
  _inherits$5(FirebaseServerAuthPasswordResetThrottleError, BaseError);
849
851
  function FirebaseServerAuthPasswordResetThrottleError(lastSentAt) {
850
- _class_call_check$u(this, FirebaseServerAuthPasswordResetThrottleError);
852
+ _class_call_check$x(this, FirebaseServerAuthPasswordResetThrottleError);
851
853
  var _this;
852
854
  _this = _call_super$5(this, FirebaseServerAuthPasswordResetThrottleError, [
853
855
  "This user was recently sent password reset details. Try again later."
854
- ]), _define_property$B(_this, "lastSentAt", void 0);
856
+ ]), _define_property$E(_this, "lastSentAt", void 0);
855
857
  _this.lastSentAt = lastSentAt;
856
858
  return _this;
857
859
  }
@@ -863,7 +865,7 @@ function _type_of$6(obj) {
863
865
  */ var FirebaseServerAuthPasswordResetSendOnceError = /*#__PURE__*/ function(BaseError) {
864
866
  _inherits$5(FirebaseServerAuthPasswordResetSendOnceError, BaseError);
865
867
  function FirebaseServerAuthPasswordResetSendOnceError() {
866
- _class_call_check$u(this, FirebaseServerAuthPasswordResetSendOnceError);
868
+ _class_call_check$x(this, FirebaseServerAuthPasswordResetSendOnceError);
867
869
  return _call_super$5(this, FirebaseServerAuthPasswordResetSendOnceError, [
868
870
  "The user has been sent password reset details before and the sendResetDetailsOnce configuration was true."
869
871
  ]);
@@ -876,7 +878,7 @@ function _type_of$6(obj) {
876
878
  */ var FirebaseServerAuthPasswordResetInvalidCodeError = /*#__PURE__*/ function(BaseError) {
877
879
  _inherits$5(FirebaseServerAuthPasswordResetInvalidCodeError, BaseError);
878
880
  function FirebaseServerAuthPasswordResetInvalidCodeError() {
879
- _class_call_check$u(this, FirebaseServerAuthPasswordResetInvalidCodeError);
881
+ _class_call_check$x(this, FirebaseServerAuthPasswordResetInvalidCodeError);
880
882
  return _call_super$5(this, FirebaseServerAuthPasswordResetInvalidCodeError, [
881
883
  "The provided reset password code is invalid or expired."
882
884
  ]);
@@ -885,7 +887,7 @@ function _type_of$6(obj) {
885
887
  }
886
888
  (BaseError);
887
889
 
888
- function _array_like_to_array$h(arr, len) {
890
+ function _array_like_to_array$i(arr, len) {
889
891
  if (len == null || len > arr.length) len = arr.length;
890
892
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
891
893
  return arr2;
@@ -897,7 +899,7 @@ function _assert_this_initialized$4(self) {
897
899
  if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
898
900
  return self;
899
901
  }
900
- function asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, key, arg) {
902
+ function asyncGeneratorStep$k(gen, resolve, reject, _next, _throw, key, arg) {
901
903
  try {
902
904
  var info = gen[key](arg);
903
905
  var value = info.value;
@@ -908,16 +910,16 @@ function asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, key, arg) {
908
910
  if (info.done) resolve(value);
909
911
  else Promise.resolve(value).then(_next, _throw);
910
912
  }
911
- function _async_to_generator$i(fn) {
913
+ function _async_to_generator$k(fn) {
912
914
  return function() {
913
915
  var self = this, args = arguments;
914
916
  return new Promise(function(resolve, reject) {
915
917
  var gen = fn.apply(self, args);
916
918
  function _next(value) {
917
- asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "next", value);
919
+ asyncGeneratorStep$k(gen, resolve, reject, _next, _throw, "next", value);
918
920
  }
919
921
  function _throw(err) {
920
- asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "throw", err);
922
+ asyncGeneratorStep$k(gen, resolve, reject, _next, _throw, "throw", err);
921
923
  }
922
924
  _next(undefined);
923
925
  });
@@ -927,10 +929,10 @@ function _call_super$4(_this, derived, args) {
927
929
  derived = _get_prototype_of$4(derived);
928
930
  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));
929
931
  }
930
- function _class_call_check$t(instance, Constructor) {
932
+ function _class_call_check$w(instance, Constructor) {
931
933
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
932
934
  }
933
- function _defineProperties$i(target, props) {
935
+ function _defineProperties$k(target, props) {
934
936
  for(var i = 0; i < props.length; i++){
935
937
  var descriptor = props[i];
936
938
  descriptor.enumerable = descriptor.enumerable || false;
@@ -939,11 +941,11 @@ function _defineProperties$i(target, props) {
939
941
  Object.defineProperty(target, descriptor.key, descriptor);
940
942
  }
941
943
  }
942
- function _create_class$i(Constructor, protoProps, staticProps) {
943
- if (protoProps) _defineProperties$i(Constructor.prototype, protoProps);
944
+ function _create_class$k(Constructor, protoProps, staticProps) {
945
+ if (protoProps) _defineProperties$k(Constructor.prototype, protoProps);
944
946
  return Constructor;
945
947
  }
946
- function _define_property$A(obj, key, value) {
948
+ function _define_property$D(obj, key, value) {
947
949
  if (key in obj) {
948
950
  Object.defineProperty(obj, key, {
949
951
  value: value,
@@ -1018,7 +1020,7 @@ function _object_spread$l(target) {
1018
1020
  }));
1019
1021
  }
1020
1022
  ownKeys.forEach(function(key) {
1021
- _define_property$A(target, key, source[key]);
1023
+ _define_property$D(target, key, source[key]);
1022
1024
  });
1023
1025
  }
1024
1026
  return target;
@@ -1035,9 +1037,9 @@ function _set_prototype_of$4(o, p) {
1035
1037
  return _set_prototype_of$4(o, p);
1036
1038
  }
1037
1039
  function _sliced_to_array$5(arr, i) {
1038
- return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$5();
1040
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$i(arr, i) || _non_iterable_rest$5();
1039
1041
  }
1040
- function _ts_generator$i(thisArg, body) {
1042
+ function _ts_generator$k(thisArg, body) {
1041
1043
  var f, y, t, _ = {
1042
1044
  label: 0,
1043
1045
  sent: function() {
@@ -1140,13 +1142,13 @@ function _type_of$5(obj) {
1140
1142
  "@swc/helpers - typeof";
1141
1143
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1142
1144
  }
1143
- function _unsupported_iterable_to_array$h(o, minLen) {
1145
+ function _unsupported_iterable_to_array$i(o, minLen) {
1144
1146
  if (!o) return;
1145
- if (typeof o === "string") return _array_like_to_array$h(o, minLen);
1147
+ if (typeof o === "string") return _array_like_to_array$i(o, minLen);
1146
1148
  var n = Object.prototype.toString.call(o).slice(8, -1);
1147
1149
  if (n === "Object" && o.constructor) n = o.constructor.name;
1148
1150
  if (n === "Map" || n === "Set") return Array.from(n);
1149
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
1151
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$i(o, minLen);
1150
1152
  }
1151
1153
  /**
1152
1154
  * Generates a random 6-digit number for use as a temporary password or reset token.
@@ -1181,16 +1183,16 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1181
1183
  */ var AbstractFirebaseServerAuthUserContext = /*#__PURE__*/ function() {
1182
1184
  function AbstractFirebaseServerAuthUserContext(service, uid) {
1183
1185
  var _this = this;
1184
- _class_call_check$t(this, AbstractFirebaseServerAuthUserContext);
1185
- _define_property$A(this, "_service", void 0);
1186
- _define_property$A(this, "_uid", void 0);
1187
- _define_property$A(this, "_loadRecord", cachedGetter(function() {
1186
+ _class_call_check$w(this, AbstractFirebaseServerAuthUserContext);
1187
+ _define_property$D(this, "_service", void 0);
1188
+ _define_property$D(this, "_uid", void 0);
1189
+ _define_property$D(this, "_loadRecord", cachedGetter(function() {
1188
1190
  return _this._service.auth.getUser(_this._uid);
1189
1191
  }));
1190
1192
  this._service = service;
1191
1193
  this._uid = uid;
1192
1194
  }
1193
- _create_class$i(AbstractFirebaseServerAuthUserContext, [
1195
+ _create_class$k(AbstractFirebaseServerAuthUserContext, [
1194
1196
  {
1195
1197
  key: "service",
1196
1198
  get: function get() {
@@ -1206,8 +1208,8 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1206
1208
  {
1207
1209
  key: "exists",
1208
1210
  value: function exists() {
1209
- return _async_to_generator$i(function() {
1210
- return _ts_generator$i(this, function(_state) {
1211
+ return _async_to_generator$k(function() {
1212
+ return _ts_generator$k(this, function(_state) {
1211
1213
  return [
1212
1214
  2,
1213
1215
  getAuthUserOrUndefined(this._loadRecord()).then(Boolean)
@@ -1244,9 +1246,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1244
1246
  {
1245
1247
  key: "beginResetPassword",
1246
1248
  value: function beginResetPassword(options) {
1247
- return _async_to_generator$i(function() {
1249
+ return _async_to_generator$k(function() {
1248
1250
  var _ref, password, now, expiresInMs, expiresAt, _obj, passwordClaimsData;
1249
- return _ts_generator$i(this, function(_state) {
1251
+ return _ts_generator$k(this, function(_state) {
1250
1252
  switch(_state.label){
1251
1253
  case 0:
1252
1254
  password = this._generateResetPasswordKey();
@@ -1254,7 +1256,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1254
1256
  // An explicit per-call lifetime wins over the context default; otherwise fall back to _resetCodeExpiresInMs().
1255
1257
  expiresInMs = (_ref = options === null || options === void 0 ? void 0 : options.resetCodeExpiresIn) !== null && _ref !== void 0 ? _ref : this._resetCodeExpiresInMs();
1256
1258
  expiresAt = new Date(now.getTime() + expiresInMs);
1257
- passwordClaimsData = (_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(now)), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, toISODateString(expiresAt)), _obj);
1259
+ passwordClaimsData = (_obj = {}, _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(now)), _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, toISODateString(expiresAt)), _obj);
1258
1260
  // set the claims
1259
1261
  return [
1260
1262
  4,
@@ -1285,9 +1287,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1285
1287
  {
1286
1288
  key: "loadResetPasswordClaims",
1287
1289
  value: function loadResetPasswordClaims() {
1288
- return _async_to_generator$i(function() {
1290
+ return _async_to_generator$k(function() {
1289
1291
  var claims, result;
1290
- return _ts_generator$i(this, function(_state) {
1292
+ return _ts_generator$k(this, function(_state) {
1291
1293
  switch(_state.label){
1292
1294
  case 0:
1293
1295
  return [
@@ -1309,9 +1311,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1309
1311
  {
1310
1312
  key: "setPassword",
1311
1313
  value: function setPassword(password) {
1312
- return _async_to_generator$i(function() {
1314
+ return _async_to_generator$k(function() {
1313
1315
  var record, _obj;
1314
- return _ts_generator$i(this, function(_state) {
1316
+ return _ts_generator$k(this, function(_state) {
1315
1317
  switch(_state.label){
1316
1318
  case 0:
1317
1319
  return [
@@ -1325,7 +1327,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1325
1327
  // clear password reset claims
1326
1328
  return [
1327
1329
  4,
1328
- this.updateClaims((_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, null), _obj))
1330
+ this.updateClaims((_obj = {}, _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, null), _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, null), _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, null), _obj))
1329
1331
  ];
1330
1332
  case 2:
1331
1333
  _state.sent();
@@ -1341,9 +1343,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1341
1343
  {
1342
1344
  key: "updateUser",
1343
1345
  value: function updateUser(template) {
1344
- return _async_to_generator$i(function() {
1346
+ return _async_to_generator$k(function() {
1345
1347
  var e, firebaseError, errorCode, email, phoneNumber;
1346
- return _ts_generator$i(this, function(_state) {
1348
+ return _ts_generator$k(this, function(_state) {
1347
1349
  switch(_state.label){
1348
1350
  case 0:
1349
1351
  _state.trys.push([
@@ -1386,9 +1388,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1386
1388
  {
1387
1389
  key: "loadRoles",
1388
1390
  value: function loadRoles() {
1389
- return _async_to_generator$i(function() {
1391
+ return _async_to_generator$k(function() {
1390
1392
  var claims;
1391
- return _ts_generator$i(this, function(_state) {
1393
+ return _ts_generator$k(this, function(_state) {
1392
1394
  switch(_state.label){
1393
1395
  case 0:
1394
1396
  return [
@@ -1409,9 +1411,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1409
1411
  {
1410
1412
  key: "addRoles",
1411
1413
  value: function addRoles(roles) {
1412
- return _async_to_generator$i(function() {
1414
+ return _async_to_generator$k(function() {
1413
1415
  var claims;
1414
- return _ts_generator$i(this, function(_state) {
1416
+ return _ts_generator$k(this, function(_state) {
1415
1417
  claims = this._claimsForRolesChange(roles);
1416
1418
  return [
1417
1419
  2,
@@ -1424,9 +1426,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1424
1426
  {
1425
1427
  key: "removeRoles",
1426
1428
  value: function removeRoles(roles) {
1427
- return _async_to_generator$i(function() {
1429
+ return _async_to_generator$k(function() {
1428
1430
  var baseClaims, claims;
1429
- return _ts_generator$i(this, function(_state) {
1431
+ return _ts_generator$k(this, function(_state) {
1430
1432
  baseClaims = this._claimsForRolesChange(roles);
1431
1433
  claims = {};
1432
1434
  forEachKeyValue(baseClaims, {
@@ -1462,9 +1464,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1462
1464
  * await userCtx.setRoles([AUTH_ADMIN_ROLE], { customFlag: 1 });
1463
1465
  * ```
1464
1466
  */ function setRoles(roles, claimsToRetain) {
1465
- return _async_to_generator$i(function() {
1467
+ return _async_to_generator$k(function() {
1466
1468
  var claims;
1467
- return _ts_generator$i(this, function(_state) {
1469
+ return _ts_generator$k(this, function(_state) {
1468
1470
  claims = _object_spread$l({}, claimsToRetain, this._claimsForRolesChange(Array.from(roles)));
1469
1471
  return [
1470
1472
  2,
@@ -1498,9 +1500,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1498
1500
  {
1499
1501
  key: "updateClaims",
1500
1502
  value: function updateClaims(claims) {
1501
- return _async_to_generator$i(function() {
1503
+ return _async_to_generator$k(function() {
1502
1504
  var currentClaims, newClaims;
1503
- return _ts_generator$i(this, function(_state) {
1505
+ return _ts_generator$k(this, function(_state) {
1504
1506
  switch(_state.label){
1505
1507
  case 0:
1506
1508
  return [
@@ -1557,25 +1559,25 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1557
1559
  */ var AbstractFirebaseServerAuthContext = /*#__PURE__*/ function() {
1558
1560
  function AbstractFirebaseServerAuthContext(service, context) {
1559
1561
  var _this = this;
1560
- _class_call_check$t(this, AbstractFirebaseServerAuthContext);
1561
- _define_property$A(this, "_service", void 0);
1562
- _define_property$A(this, "_context", void 0);
1563
- _define_property$A(this, "_authRoles", cachedGetter(function() {
1562
+ _class_call_check$w(this, AbstractFirebaseServerAuthContext);
1563
+ _define_property$D(this, "_service", void 0);
1564
+ _define_property$D(this, "_context", void 0);
1565
+ _define_property$D(this, "_authRoles", cachedGetter(function() {
1564
1566
  return _this.service.readRoles(_this.claims);
1565
1567
  }));
1566
- _define_property$A(this, "_isAdmin", cachedGetter(function() {
1568
+ _define_property$D(this, "_isAdmin", cachedGetter(function() {
1567
1569
  return _this.service.isAdminInRoles(_this._authRoles());
1568
1570
  }));
1569
- _define_property$A(this, "_hasSignedTos", cachedGetter(function() {
1571
+ _define_property$D(this, "_hasSignedTos", cachedGetter(function() {
1570
1572
  return _this.service.hasSignedTosInRoles(_this._authRoles());
1571
1573
  }));
1572
- _define_property$A(this, "_userContext", cachedGetter(function() {
1574
+ _define_property$D(this, "_userContext", cachedGetter(function() {
1573
1575
  return _this.service.userContext(_this.context.auth.uid);
1574
1576
  }));
1575
1577
  this._service = service;
1576
1578
  this._context = context;
1577
1579
  }
1578
- _create_class$i(AbstractFirebaseServerAuthContext, [
1580
+ _create_class$k(AbstractFirebaseServerAuthContext, [
1579
1581
  {
1580
1582
  key: "service",
1581
1583
  get: function get() {
@@ -1675,15 +1677,15 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1675
1677
  * ```
1676
1678
  */ var AbstractFirebaseServerNewUserService = /*#__PURE__*/ function() {
1677
1679
  function AbstractFirebaseServerNewUserService(authService) {
1678
- _class_call_check$t(this, AbstractFirebaseServerNewUserService);
1679
- _define_property$A(this, "_authService", void 0);
1680
+ _class_call_check$w(this, AbstractFirebaseServerNewUserService);
1681
+ _define_property$D(this, "_authService", void 0);
1680
1682
  /**
1681
1683
  * Minimum time between setup content sends. Defaults to {@link DEFAULT_SETUP_COM_THROTTLE_TIME} (1 hour).
1682
1684
  * Override in subclasses to customize the throttle window.
1683
- */ _define_property$A(this, "setupThrottleTime", DEFAULT_SETUP_COM_THROTTLE_TIME);
1685
+ */ _define_property$D(this, "setupThrottleTime", DEFAULT_SETUP_COM_THROTTLE_TIME);
1684
1686
  this._authService = authService;
1685
1687
  }
1686
- _create_class$i(AbstractFirebaseServerNewUserService, [
1688
+ _create_class$k(AbstractFirebaseServerNewUserService, [
1687
1689
  {
1688
1690
  key: "authService",
1689
1691
  get: function get() {
@@ -1693,9 +1695,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1693
1695
  {
1694
1696
  key: "initializeNewUser",
1695
1697
  value: function initializeNewUser(input) {
1696
- return _async_to_generator$i(function() {
1698
+ return _async_to_generator$k(function() {
1697
1699
  var uid, email, phone, sendSetupContent, sendSetupContentIfUserExists, sendSetupDetailsOnce, sendSetupIgnoreThrottle, sendSetupThrowErrors, data, sendDetailsInTestEnvironment, userRecordPromise, userRecord, userRecordId, createdUser, createResult, userContext, sentEmail, userContext1;
1698
- return _ts_generator$i(this, function(_state) {
1700
+ return _ts_generator$k(this, function(_state) {
1699
1701
  switch(_state.label){
1700
1702
  case 0:
1701
1703
  uid = input.uid, email = input.email, phone = input.phone, sendSetupContent = input.sendSetupContent, sendSetupContentIfUserExists = input.sendSetupContentIfUserExists, sendSetupDetailsOnce = input.sendSetupDetailsOnce, sendSetupIgnoreThrottle = input.sendSetupIgnoreThrottle, sendSetupThrowErrors = input.sendSetupThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment;
@@ -1790,16 +1792,16 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1790
1792
  {
1791
1793
  key: "addNewUserSetupClaims",
1792
1794
  value: function addNewUserSetupClaims(userContextOrUid, setupPassword) {
1793
- return _async_to_generator$i(function() {
1795
+ return _async_to_generator$k(function() {
1794
1796
  var password, userContext;
1795
- return _ts_generator$i(this, function(_state) {
1797
+ return _ts_generator$k(this, function(_state) {
1796
1798
  switch(_state.label){
1797
1799
  case 0:
1798
1800
  password = setupPassword !== null && setupPassword !== void 0 ? setupPassword : this.generateRandomSetupPassword();
1799
1801
  userContext = userContextFromUid(this.authService, userContextOrUid);
1800
1802
  return [
1801
1803
  4,
1802
- userContext.updateClaims(_define_property$A({}, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, password))
1804
+ userContext.updateClaims(_define_property$D({}, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, password))
1803
1805
  ];
1804
1806
  case 1:
1805
1807
  _state.sent();
@@ -1815,9 +1817,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1815
1817
  {
1816
1818
  key: "sendSetupContent",
1817
1819
  value: function sendSetupContent(userContextOrUid, config) {
1818
- return _async_to_generator$i(function() {
1820
+ return _async_to_generator$k(function() {
1819
1821
  var setupDetails, sentContent, setupCommunicationAt, hasSentCommunication, lastSentAt, sendIsThrottled;
1820
- return _ts_generator$i(this, function(_state) {
1822
+ return _ts_generator$k(this, function(_state) {
1821
1823
  switch(_state.label){
1822
1824
  case 0:
1823
1825
  return [
@@ -1898,9 +1900,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1898
1900
  {
1899
1901
  key: "loadSetupDetails",
1900
1902
  value: function loadSetupDetails(userContextOrUid, config) {
1901
- return _async_to_generator$i(function() {
1903
+ return _async_to_generator$k(function() {
1902
1904
  var userContext, userExists, details;
1903
- return _ts_generator$i(this, function(_state) {
1905
+ return _ts_generator$k(this, function(_state) {
1904
1906
  switch(_state.label){
1905
1907
  case 0:
1906
1908
  userContext = userContextFromUid(this.authService, userContextOrUid);
@@ -1934,9 +1936,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1934
1936
  {
1935
1937
  key: "loadSetupDetailsForUserContext",
1936
1938
  value: function loadSetupDetailsForUserContext(userContext, config) {
1937
- return _async_to_generator$i(function() {
1939
+ return _async_to_generator$k(function() {
1938
1940
  var details, _ref, setupPassword, setupCommunicationAt;
1939
- return _ts_generator$i(this, function(_state) {
1941
+ return _ts_generator$k(this, function(_state) {
1940
1942
  switch(_state.label){
1941
1943
  case 0:
1942
1944
  return [
@@ -1972,9 +1974,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1972
1974
  *
1973
1975
  * @param details - The user's setup details containing the user context.
1974
1976
  */ function updateSetupContentSentTime(details) {
1975
- return _async_to_generator$i(function() {
1977
+ return _async_to_generator$k(function() {
1976
1978
  var setupCommunicationAt;
1977
- return _ts_generator$i(this, function(_state) {
1979
+ return _ts_generator$k(this, function(_state) {
1978
1980
  switch(_state.label){
1979
1981
  case 0:
1980
1982
  setupCommunicationAt = toISODateString(new Date());
@@ -1997,9 +1999,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
1997
1999
  {
1998
2000
  key: "markUserSetupAsComplete",
1999
2001
  value: function markUserSetupAsComplete(uid) {
2000
- return _async_to_generator$i(function() {
2002
+ return _async_to_generator$k(function() {
2001
2003
  var userContext, userExists;
2002
- return _ts_generator$i(this, function(_state) {
2004
+ return _ts_generator$k(this, function(_state) {
2003
2005
  switch(_state.label){
2004
2006
  case 0:
2005
2007
  userContext = this.authService.userContext(uid);
@@ -2041,9 +2043,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2041
2043
  * @returns The created user record and the setup password used.
2042
2044
  * @throws {Error} Throws if the Firebase Admin SDK rejects the user creation.
2043
2045
  */ function createNewUser(input) {
2044
- return _async_to_generator$i(function() {
2046
+ return _async_to_generator$k(function() {
2045
2047
  var uid, displayName, email, phoneNumber, inputPassword, password, user, e, firebaseError, errorCode;
2046
- return _ts_generator$i(this, function(_state) {
2048
+ return _ts_generator$k(this, function(_state) {
2047
2049
  switch(_state.label){
2048
2050
  case 0:
2049
2051
  uid = input.uid, displayName = input.displayName, email = input.email, phoneNumber = input.phone, inputPassword = input.setupPassword;
@@ -2110,14 +2112,14 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2110
2112
  *
2111
2113
  * @param userContext - The user context to clear setup claims from.
2112
2114
  */ function updateClaimsToClearUser(userContext) {
2113
- return _async_to_generator$i(function() {
2115
+ return _async_to_generator$k(function() {
2114
2116
  var _obj;
2115
- return _ts_generator$i(this, function(_state) {
2117
+ return _ts_generator$k(this, function(_state) {
2116
2118
  switch(_state.label){
2117
2119
  case 0:
2118
2120
  return [
2119
2121
  4,
2120
- userContext.updateClaims((_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, null), _obj))
2122
+ userContext.updateClaims((_obj = {}, _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, null), _define_property$D(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, null), _obj))
2121
2123
  ];
2122
2124
  case 1:
2123
2125
  _state.sent();
@@ -2139,15 +2141,15 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2139
2141
  */ var NoSetupContentFirebaseServerNewUserService = /*#__PURE__*/ function(AbstractFirebaseServerNewUserService) {
2140
2142
  _inherits$4(NoSetupContentFirebaseServerNewUserService, AbstractFirebaseServerNewUserService);
2141
2143
  function NoSetupContentFirebaseServerNewUserService() {
2142
- _class_call_check$t(this, NoSetupContentFirebaseServerNewUserService);
2144
+ _class_call_check$w(this, NoSetupContentFirebaseServerNewUserService);
2143
2145
  return _call_super$4(this, NoSetupContentFirebaseServerNewUserService, arguments);
2144
2146
  }
2145
- _create_class$i(NoSetupContentFirebaseServerNewUserService, [
2147
+ _create_class$k(NoSetupContentFirebaseServerNewUserService, [
2146
2148
  {
2147
2149
  key: "sendSetupContentToUser",
2148
2150
  value: function sendSetupContentToUser(_details) {
2149
- return _async_to_generator$i(function() {
2150
- return _ts_generator$i(this, function(_state) {
2151
+ return _async_to_generator$k(function() {
2152
+ return _ts_generator$k(this, function(_state) {
2151
2153
  return [
2152
2154
  2
2153
2155
  ];
@@ -2232,15 +2234,15 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2232
2234
  * ```
2233
2235
  */ var AbstractFirebaseServerUserPasswordResetService = /*#__PURE__*/ function() {
2234
2236
  function AbstractFirebaseServerUserPasswordResetService(authService) {
2235
- _class_call_check$t(this, AbstractFirebaseServerUserPasswordResetService);
2236
- _define_property$A(this, "_authService", void 0);
2237
+ _class_call_check$w(this, AbstractFirebaseServerUserPasswordResetService);
2238
+ _define_property$D(this, "_authService", void 0);
2237
2239
  /**
2238
2240
  * Minimum time between reset content sends. Defaults to {@link DEFAULT_RESET_COM_THROTTLE_TIME} (1 hour).
2239
2241
  * Override in subclasses to customize the throttle window.
2240
- */ _define_property$A(this, "resetThrottleTime", DEFAULT_RESET_COM_THROTTLE_TIME);
2242
+ */ _define_property$D(this, "resetThrottleTime", DEFAULT_RESET_COM_THROTTLE_TIME);
2241
2243
  this._authService = authService;
2242
2244
  }
2243
- _create_class$i(AbstractFirebaseServerUserPasswordResetService, [
2245
+ _create_class$k(AbstractFirebaseServerUserPasswordResetService, [
2244
2246
  {
2245
2247
  key: "authService",
2246
2248
  get: function get() {
@@ -2250,9 +2252,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2250
2252
  {
2251
2253
  key: "beginPasswordReset",
2252
2254
  value: function beginPasswordReset(input) {
2253
- return _async_to_generator$i(function() {
2255
+ return _async_to_generator$k(function() {
2254
2256
  var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resetCodeExpiresIn, resolvedUid, userRecord, userContext, claims, oobCode;
2255
- return _ts_generator$i(this, function(_state) {
2257
+ return _ts_generator$k(this, function(_state) {
2256
2258
  switch(_state.label){
2257
2259
  case 0:
2258
2260
  uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment, resetCodeExpiresIn = input.resetCodeExpiresIn;
@@ -2330,9 +2332,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2330
2332
  {
2331
2333
  key: "sendResetContent",
2332
2334
  value: function sendResetContent(uid, config) {
2333
- return _async_to_generator$i(function() {
2335
+ return _async_to_generator$k(function() {
2334
2336
  var resetDetails, sentContent, resetCommunicationAt, hasSentCommunication, lastSentAt, sendIsThrottled;
2335
- return _ts_generator$i(this, function(_state) {
2337
+ return _ts_generator$k(this, function(_state) {
2336
2338
  switch(_state.label){
2337
2339
  case 0:
2338
2340
  return [
@@ -2411,9 +2413,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2411
2413
  {
2412
2414
  key: "loadResetDetails",
2413
2415
  value: function loadResetDetails(uid, config) {
2414
- return _async_to_generator$i(function() {
2416
+ return _async_to_generator$k(function() {
2415
2417
  var userContext, userExists, details;
2416
- return _ts_generator$i(this, function(_state) {
2418
+ return _ts_generator$k(this, function(_state) {
2417
2419
  switch(_state.label){
2418
2420
  case 0:
2419
2421
  userContext = this.authService.userContext(uid);
@@ -2447,9 +2449,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2447
2449
  {
2448
2450
  key: "loadResetDetailsForUserContext",
2449
2451
  value: function loadResetDetailsForUserContext(userContext, config) {
2450
- return _async_to_generator$i(function() {
2452
+ return _async_to_generator$k(function() {
2451
2453
  var details, claims;
2452
- return _ts_generator$i(this, function(_state) {
2454
+ return _ts_generator$k(this, function(_state) {
2453
2455
  switch(_state.label){
2454
2456
  case 0:
2455
2457
  return [
@@ -2487,15 +2489,15 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2487
2489
  *
2488
2490
  * @param details - The user's reset details containing the user context.
2489
2491
  */ function updateResetContentSentTime(details) {
2490
- return _async_to_generator$i(function() {
2492
+ return _async_to_generator$k(function() {
2491
2493
  var resetCommunicationAt;
2492
- return _ts_generator$i(this, function(_state) {
2494
+ return _ts_generator$k(this, function(_state) {
2493
2495
  switch(_state.label){
2494
2496
  case 0:
2495
2497
  resetCommunicationAt = toISODateString(new Date());
2496
2498
  return [
2497
2499
  4,
2498
- details.userContext.updateClaims(_define_property$A({}, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, resetCommunicationAt))
2500
+ details.userContext.updateClaims(_define_property$D({}, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, resetCommunicationAt))
2499
2501
  ];
2500
2502
  case 1:
2501
2503
  _state.sent();
@@ -2510,9 +2512,9 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2510
2512
  {
2511
2513
  key: "completePasswordReset",
2512
2514
  value: function completePasswordReset(input) {
2513
- return _async_to_generator$i(function() {
2515
+ return _async_to_generator$k(function() {
2514
2516
  var decoded, userContext, claims, storedCode, expiresAt, storedBuf, inputBuf;
2515
- return _ts_generator$i(this, function(_state) {
2517
+ return _ts_generator$k(this, function(_state) {
2516
2518
  switch(_state.label){
2517
2519
  case 0:
2518
2520
  // Decode the composite token. A malformed token is treated identically to every other
@@ -2581,15 +2583,15 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2581
2583
  */ var NoContentFirebaseServerUserPasswordResetService = /*#__PURE__*/ function(AbstractFirebaseServerUserPasswordResetService) {
2582
2584
  _inherits$4(NoContentFirebaseServerUserPasswordResetService, AbstractFirebaseServerUserPasswordResetService);
2583
2585
  function NoContentFirebaseServerUserPasswordResetService() {
2584
- _class_call_check$t(this, NoContentFirebaseServerUserPasswordResetService);
2586
+ _class_call_check$w(this, NoContentFirebaseServerUserPasswordResetService);
2585
2587
  return _call_super$4(this, NoContentFirebaseServerUserPasswordResetService, arguments);
2586
2588
  }
2587
- _create_class$i(NoContentFirebaseServerUserPasswordResetService, [
2589
+ _create_class$k(NoContentFirebaseServerUserPasswordResetService, [
2588
2590
  {
2589
2591
  key: "sendPasswordResetContentToUser",
2590
2592
  value: function sendPasswordResetContentToUser(_details) {
2591
- return _async_to_generator$i(function() {
2592
- return _ts_generator$i(this, function(_state) {
2593
+ return _async_to_generator$k(function() {
2594
+ return _ts_generator$k(this, function(_state) {
2593
2595
  return [
2594
2596
  2
2595
2597
  ];
@@ -2621,7 +2623,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2621
2623
  * }
2622
2624
  * ```
2623
2625
  */ var FirebaseServerAuthService = function FirebaseServerAuthService() {
2624
- _class_call_check$t(this, FirebaseServerAuthService);
2626
+ _class_call_check$w(this, FirebaseServerAuthService);
2625
2627
  };
2626
2628
  /**
2627
2629
  * Base implementation of {@link FirebaseServerAuthService} providing standard admin/ToS checks,
@@ -2652,11 +2654,11 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2652
2654
  * ```
2653
2655
  */ var AbstractFirebaseServerAuthService = /*#__PURE__*/ function() {
2654
2656
  function AbstractFirebaseServerAuthService(auth) {
2655
- _class_call_check$t(this, AbstractFirebaseServerAuthService);
2656
- _define_property$A(this, "_auth", void 0);
2657
+ _class_call_check$w(this, AbstractFirebaseServerAuthService);
2658
+ _define_property$D(this, "_auth", void 0);
2657
2659
  this._auth = auth;
2658
2660
  }
2659
- _create_class$i(AbstractFirebaseServerAuthService, [
2661
+ _create_class$k(AbstractFirebaseServerAuthService, [
2660
2662
  {
2661
2663
  key: "auth",
2662
2664
  get: function get() {
@@ -2754,7 +2756,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
2754
2756
  }
2755
2757
  ();
2756
2758
 
2757
- function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
2759
+ function asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, key, arg) {
2758
2760
  try {
2759
2761
  var info = gen[key](arg);
2760
2762
  var value = info.value;
@@ -2765,22 +2767,22 @@ function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
2765
2767
  if (info.done) resolve(value);
2766
2768
  else Promise.resolve(value).then(_next, _throw);
2767
2769
  }
2768
- function _async_to_generator$h(fn) {
2770
+ function _async_to_generator$j(fn) {
2769
2771
  return function() {
2770
2772
  var self = this, args = arguments;
2771
2773
  return new Promise(function(resolve, reject) {
2772
2774
  var gen = fn.apply(self, args);
2773
2775
  function _next(value) {
2774
- asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "next", value);
2776
+ asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "next", value);
2775
2777
  }
2776
2778
  function _throw(err) {
2777
- asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "throw", err);
2779
+ asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "throw", err);
2778
2780
  }
2779
2781
  _next(undefined);
2780
2782
  });
2781
2783
  };
2782
2784
  }
2783
- function _ts_generator$h(thisArg, body) {
2785
+ function _ts_generator$j(thisArg, body) {
2784
2786
  var f, y, t, _ = {
2785
2787
  label: 0,
2786
2788
  sent: function() {
@@ -2908,9 +2910,9 @@ function _ts_generator$h(thisArg, body) {
2908
2910
  * const userData = await assertSnapshotData(userDocument);
2909
2911
  * ```
2910
2912
  */ function assertSnapshotData(document, message) {
2911
- return _async_to_generator$h(function() {
2913
+ return _async_to_generator$j(function() {
2912
2914
  var data;
2913
- return _ts_generator$h(this, function(_state) {
2915
+ return _ts_generator$j(this, function(_state) {
2914
2916
  switch(_state.label){
2915
2917
  case 0:
2916
2918
  return [
@@ -2942,9 +2944,9 @@ function _ts_generator$h(thisArg, body) {
2942
2944
  * @returns The document's snapshot data with `id` and `key` attached.
2943
2945
  * @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
2944
2946
  */ function assertSnapshotDataWithKey(document, message) {
2945
- return _async_to_generator$h(function() {
2947
+ return _async_to_generator$j(function() {
2946
2948
  var data;
2947
- return _ts_generator$h(this, function(_state) {
2949
+ return _ts_generator$j(this, function(_state) {
2948
2950
  switch(_state.label){
2949
2951
  case 0:
2950
2952
  return [
@@ -2968,9 +2970,9 @@ function _ts_generator$h(thisArg, body) {
2968
2970
  * @param message - Optional custom error message.
2969
2971
  * @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document does not exist.
2970
2972
  */ function assertDocumentExists(document, message) {
2971
- return _async_to_generator$h(function() {
2973
+ return _async_to_generator$j(function() {
2972
2974
  var exists;
2973
- return _ts_generator$h(this, function(_state) {
2975
+ return _ts_generator$j(this, function(_state) {
2974
2976
  switch(_state.label){
2975
2977
  case 0:
2976
2978
  return [
@@ -3036,7 +3038,7 @@ function _ts_generator$h(thisArg, body) {
3036
3038
  });
3037
3039
  }
3038
3040
 
3039
- function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
3041
+ function asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, key, arg) {
3040
3042
  try {
3041
3043
  var info = gen[key](arg);
3042
3044
  var value = info.value;
@@ -3047,28 +3049,28 @@ function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
3047
3049
  if (info.done) resolve(value);
3048
3050
  else Promise.resolve(value).then(_next, _throw);
3049
3051
  }
3050
- function _async_to_generator$g(fn) {
3052
+ function _async_to_generator$i(fn) {
3051
3053
  return function() {
3052
3054
  var self = this, args = arguments;
3053
3055
  return new Promise(function(resolve, reject) {
3054
3056
  var gen = fn.apply(self, args);
3055
3057
  function _next(value) {
3056
- asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "next", value);
3058
+ asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "next", value);
3057
3059
  }
3058
3060
  function _throw(err) {
3059
- asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "throw", err);
3061
+ asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "throw", err);
3060
3062
  }
3061
3063
  _next(undefined);
3062
3064
  });
3063
3065
  };
3064
3066
  }
3065
- function _instanceof$4(left, right) {
3067
+ function _instanceof$5(left, right) {
3066
3068
  "@swc/helpers - instanceof";
3067
3069
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3068
3070
  return !!right[Symbol.hasInstance](left);
3069
3071
  } else return left instanceof right;
3070
3072
  }
3071
- function _ts_generator$g(thisArg, body) {
3073
+ function _ts_generator$i(thisArg, body) {
3072
3074
  var f, y, t, _ = {
3073
3075
  label: 0,
3074
3076
  sent: function() {
@@ -3194,9 +3196,9 @@ function _ts_generator$g(thisArg, body) {
3194
3196
  * enumeration-safe opaque response. Pass the caller's admin status here.
3195
3197
  * @returns The result of the function.
3196
3198
  */ function catchAndThrowPasswordResetServerErrors(fn, isAdmin) {
3197
- return _async_to_generator$g(function() {
3199
+ return _async_to_generator$i(function() {
3198
3200
  var result, error;
3199
- return _ts_generator$g(this, function(_state) {
3201
+ return _ts_generator$i(this, function(_state) {
3200
3202
  switch(_state.label){
3201
3203
  case 0:
3202
3204
  _state.trys.push([
@@ -3217,13 +3219,13 @@ function _ts_generator$g(thisArg, body) {
3217
3219
  ];
3218
3220
  case 2:
3219
3221
  error = _state.sent();
3220
- if (_instanceof$4(error, FirebaseServerAuthPasswordResetInvalidCodeError)) {
3222
+ if (_instanceof$5(error, FirebaseServerAuthPasswordResetInvalidCodeError)) {
3221
3223
  throw authServicePasswordResetInvalidCodeError();
3222
- } else if (_instanceof$4(error, FirebaseServerAuthPasswordResetNoResetConfigError)) {
3224
+ } else if (_instanceof$5(error, FirebaseServerAuthPasswordResetNoResetConfigError)) {
3223
3225
  throw isAdmin ? authServicePasswordResetNoConfigError() : authServicePasswordResetInvalidCodeError();
3224
- } else if (_instanceof$4(error, FirebaseServerAuthPasswordResetSendOnceError)) {
3226
+ } else if (_instanceof$5(error, FirebaseServerAuthPasswordResetSendOnceError)) {
3225
3227
  throw isAdmin ? authServicePasswordResetSendOnceError() : authServicePasswordResetInvalidCodeError();
3226
- } else if (_instanceof$4(error, FirebaseServerAuthPasswordResetThrottleError)) {
3228
+ } else if (_instanceof$5(error, FirebaseServerAuthPasswordResetThrottleError)) {
3227
3229
  throw authServicePasswordResetThrottleError();
3228
3230
  }
3229
3231
  throw error;
@@ -3330,7 +3332,7 @@ function _ts_generator$g(thisArg, body) {
3330
3332
  ];
3331
3333
  }
3332
3334
 
3333
- function _class_call_check$s(instance, Constructor) {
3335
+ function _class_call_check$v(instance, Constructor) {
3334
3336
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3335
3337
  }
3336
3338
  /**
@@ -3340,7 +3342,7 @@ function _class_call_check$s(instance, Constructor) {
3340
3342
  * Implementations are typically injected via {@link FIREBASE_SERVER_ENV_TOKEN} and
3341
3343
  * backed by a {@link FirebaseServerEnvironmentConfig}.
3342
3344
  */ var FirebaseServerEnvService = function FirebaseServerEnvService() {
3343
- _class_call_check$s(this, FirebaseServerEnvService);
3345
+ _class_call_check$v(this, FirebaseServerEnvService);
3344
3346
  }
3345
3347
  ;
3346
3348
 
@@ -3367,15 +3369,15 @@ function _class_call_check$s(instance, Constructor) {
3367
3369
  });
3368
3370
  }
3369
3371
 
3370
- function _array_like_to_array$g(arr, len) {
3372
+ function _array_like_to_array$h(arr, len) {
3371
3373
  if (len == null || len > arr.length) len = arr.length;
3372
3374
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3373
3375
  return arr2;
3374
3376
  }
3375
- function _array_without_holes$b(arr) {
3376
- if (Array.isArray(arr)) return _array_like_to_array$g(arr);
3377
+ function _array_without_holes$c(arr) {
3378
+ if (Array.isArray(arr)) return _array_like_to_array$h(arr);
3377
3379
  }
3378
- function _define_property$z(obj, key, value) {
3380
+ function _define_property$C(obj, key, value) {
3379
3381
  if (key in obj) {
3380
3382
  Object.defineProperty(obj, key, {
3381
3383
  value: value,
@@ -3386,12 +3388,12 @@ function _define_property$z(obj, key, value) {
3386
3388
  } else obj[key] = value;
3387
3389
  return obj;
3388
3390
  }
3389
- function _iterable_to_array$b(iter) {
3391
+ function _iterable_to_array$c(iter) {
3390
3392
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3391
3393
  return Array.from(iter);
3392
3394
  }
3393
3395
  }
3394
- function _non_iterable_spread$b() {
3396
+ function _non_iterable_spread$c() {
3395
3397
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3396
3398
  }
3397
3399
  function _object_spread$k(target) {
@@ -3404,21 +3406,21 @@ function _object_spread$k(target) {
3404
3406
  }));
3405
3407
  }
3406
3408
  ownKeys.forEach(function(key) {
3407
- _define_property$z(target, key, source[key]);
3409
+ _define_property$C(target, key, source[key]);
3408
3410
  });
3409
3411
  }
3410
3412
  return target;
3411
3413
  }
3412
- function _to_consumable_array$b(arr) {
3413
- return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$b();
3414
+ function _to_consumable_array$c(arr) {
3415
+ return _array_without_holes$c(arr) || _iterable_to_array$c(arr) || _unsupported_iterable_to_array$h(arr) || _non_iterable_spread$c();
3414
3416
  }
3415
- function _unsupported_iterable_to_array$g(o, minLen) {
3417
+ function _unsupported_iterable_to_array$h(o, minLen) {
3416
3418
  if (!o) return;
3417
- if (typeof o === "string") return _array_like_to_array$g(o, minLen);
3419
+ if (typeof o === "string") return _array_like_to_array$h(o, minLen);
3418
3420
  var n = Object.prototype.toString.call(o).slice(8, -1);
3419
3421
  if (n === "Object" && o.constructor) n = o.constructor.name;
3420
3422
  if (n === "Map" || n === "Set") return Array.from(n);
3421
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
3423
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
3422
3424
  }
3423
3425
  /**
3424
3426
  * Converts a {@link FirestoreAccessorArrayUpdate} into Firestore {@link UpdateData} using
@@ -3444,7 +3446,7 @@ function _unsupported_iterable_to_array$g(o, minLen) {
3444
3446
  result = mapObjectMap(fieldUpdate, function(arrayUpdate) {
3445
3447
  var result;
3446
3448
  if (arrayUpdate) {
3447
- result = arrayUpdateFunction.apply(void 0, _to_consumable_array$b(arrayUpdate)); // use spread operator to insert each value as an argument, as "nested arrays" are not allowed in the Firestore
3449
+ result = arrayUpdateFunction.apply(void 0, _to_consumable_array$c(arrayUpdate)); // use spread operator to insert each value as an argument, as "nested arrays" are not allowed in the Firestore
3448
3450
  }
3449
3451
  return result;
3450
3452
  });
@@ -3455,10 +3457,10 @@ function _unsupported_iterable_to_array$g(o, minLen) {
3455
3457
  return updateData;
3456
3458
  }
3457
3459
 
3458
- function _class_call_check$r(instance, Constructor) {
3460
+ function _class_call_check$u(instance, Constructor) {
3459
3461
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3460
3462
  }
3461
- function _defineProperties$h(target, props) {
3463
+ function _defineProperties$j(target, props) {
3462
3464
  for(var i = 0; i < props.length; i++){
3463
3465
  var descriptor = props[i];
3464
3466
  descriptor.enumerable = descriptor.enumerable || false;
@@ -3467,11 +3469,11 @@ function _defineProperties$h(target, props) {
3467
3469
  Object.defineProperty(target, descriptor.key, descriptor);
3468
3470
  }
3469
3471
  }
3470
- function _create_class$h(Constructor, protoProps, staticProps) {
3471
- if (protoProps) _defineProperties$h(Constructor.prototype, protoProps);
3472
+ function _create_class$j(Constructor, protoProps, staticProps) {
3473
+ if (protoProps) _defineProperties$j(Constructor.prototype, protoProps);
3472
3474
  return Constructor;
3473
3475
  }
3474
- function _define_property$y(obj, key, value) {
3476
+ function _define_property$B(obj, key, value) {
3475
3477
  if (key in obj) {
3476
3478
  Object.defineProperty(obj, key, {
3477
3479
  value: value,
@@ -3491,13 +3493,13 @@ function _define_property$y(obj, key, value) {
3491
3493
  * (get, exists) bypass the batch and read directly from Firestore.
3492
3494
  */ var WriteBatchFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
3493
3495
  function WriteBatchFirestoreDocumentDataAccessor(batch, documentRef) {
3494
- _class_call_check$r(this, WriteBatchFirestoreDocumentDataAccessor);
3495
- _define_property$y(this, "documentRef", void 0);
3496
- _define_property$y(this, "_batch", void 0);
3496
+ _class_call_check$u(this, WriteBatchFirestoreDocumentDataAccessor);
3497
+ _define_property$B(this, "documentRef", void 0);
3498
+ _define_property$B(this, "_batch", void 0);
3497
3499
  this.documentRef = documentRef;
3498
3500
  this._batch = batch;
3499
3501
  }
3500
- _create_class$h(WriteBatchFirestoreDocumentDataAccessor, [
3502
+ _create_class$j(WriteBatchFirestoreDocumentDataAccessor, [
3501
3503
  {
3502
3504
  key: "batch",
3503
3505
  get: function get() {
@@ -3609,14 +3611,14 @@ function _define_property$y(obj, key, value) {
3609
3611
  * All document accessors created from this context queue writes into the same batch.
3610
3612
  */ var WriteBatchFirestoreDocumentContext = /*#__PURE__*/ function() {
3611
3613
  function WriteBatchFirestoreDocumentContext(batch) {
3612
- _class_call_check$r(this, WriteBatchFirestoreDocumentContext);
3613
- _define_property$y(this, "_batch", void 0);
3614
- _define_property$y(this, "contextType", FirestoreDocumentContextType.BATCH);
3615
- _define_property$y(this, "accessorFactory", void 0);
3614
+ _class_call_check$u(this, WriteBatchFirestoreDocumentContext);
3615
+ _define_property$B(this, "_batch", void 0);
3616
+ _define_property$B(this, "contextType", FirestoreDocumentContextType.BATCH);
3617
+ _define_property$B(this, "accessorFactory", void 0);
3616
3618
  this._batch = batch;
3617
3619
  this.accessorFactory = writeBatchAccessorFactory(batch);
3618
3620
  }
3619
- _create_class$h(WriteBatchFirestoreDocumentContext, [
3621
+ _create_class$j(WriteBatchFirestoreDocumentContext, [
3620
3622
  {
3621
3623
  key: "batch",
3622
3624
  get: function get() {
@@ -3635,10 +3637,10 @@ function _define_property$y(obj, key, value) {
3635
3637
  return new WriteBatchFirestoreDocumentContext(batch);
3636
3638
  }
3637
3639
 
3638
- function _class_call_check$q(instance, Constructor) {
3640
+ function _class_call_check$t(instance, Constructor) {
3639
3641
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3640
3642
  }
3641
- function _defineProperties$g(target, props) {
3643
+ function _defineProperties$i(target, props) {
3642
3644
  for(var i = 0; i < props.length; i++){
3643
3645
  var descriptor = props[i];
3644
3646
  descriptor.enumerable = descriptor.enumerable || false;
@@ -3647,11 +3649,11 @@ function _defineProperties$g(target, props) {
3647
3649
  Object.defineProperty(target, descriptor.key, descriptor);
3648
3650
  }
3649
3651
  }
3650
- function _create_class$g(Constructor, protoProps, staticProps) {
3651
- if (protoProps) _defineProperties$g(Constructor.prototype, protoProps);
3652
+ function _create_class$i(Constructor, protoProps, staticProps) {
3653
+ if (protoProps) _defineProperties$i(Constructor.prototype, protoProps);
3652
3654
  return Constructor;
3653
3655
  }
3654
- function _define_property$x(obj, key, value) {
3656
+ function _define_property$A(obj, key, value) {
3655
3657
  if (key in obj) {
3656
3658
  Object.defineProperty(obj, key, {
3657
3659
  value: value,
@@ -3670,11 +3672,11 @@ function _define_property$x(obj, key, value) {
3670
3672
  * batching or transactional context. Supports real-time streaming via `onSnapshot`.
3671
3673
  */ var DefaultFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
3672
3674
  function DefaultFirestoreDocumentDataAccessor(documentRef) {
3673
- _class_call_check$q(this, DefaultFirestoreDocumentDataAccessor);
3674
- _define_property$x(this, "_documentRef", void 0);
3675
+ _class_call_check$t(this, DefaultFirestoreDocumentDataAccessor);
3676
+ _define_property$A(this, "_documentRef", void 0);
3675
3677
  this._documentRef = documentRef;
3676
3678
  }
3677
- _create_class$g(DefaultFirestoreDocumentDataAccessor, [
3679
+ _create_class$i(DefaultFirestoreDocumentDataAccessor, [
3678
3680
  {
3679
3681
  key: "documentRef",
3680
3682
  get: function get() {
@@ -3782,10 +3784,10 @@ function _define_property$x(obj, key, value) {
3782
3784
  };
3783
3785
  }
3784
3786
 
3785
- function _class_call_check$p(instance, Constructor) {
3787
+ function _class_call_check$s(instance, Constructor) {
3786
3788
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3787
3789
  }
3788
- function _defineProperties$f(target, props) {
3790
+ function _defineProperties$h(target, props) {
3789
3791
  for(var i = 0; i < props.length; i++){
3790
3792
  var descriptor = props[i];
3791
3793
  descriptor.enumerable = descriptor.enumerable || false;
@@ -3794,11 +3796,11 @@ function _defineProperties$f(target, props) {
3794
3796
  Object.defineProperty(target, descriptor.key, descriptor);
3795
3797
  }
3796
3798
  }
3797
- function _create_class$f(Constructor, protoProps, staticProps) {
3798
- if (protoProps) _defineProperties$f(Constructor.prototype, protoProps);
3799
+ function _create_class$h(Constructor, protoProps, staticProps) {
3800
+ if (protoProps) _defineProperties$h(Constructor.prototype, protoProps);
3799
3801
  return Constructor;
3800
3802
  }
3801
- function _define_property$w(obj, key, value) {
3803
+ function _define_property$z(obj, key, value) {
3802
3804
  if (key in obj) {
3803
3805
  Object.defineProperty(obj, key, {
3804
3806
  value: value,
@@ -3818,13 +3820,13 @@ function _define_property$w(obj, key, value) {
3818
3820
  * consistency. Writes are committed atomically when the transaction completes.
3819
3821
  */ var TransactionFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
3820
3822
  function TransactionFirestoreDocumentDataAccessor(transaction, documentRef) {
3821
- _class_call_check$p(this, TransactionFirestoreDocumentDataAccessor);
3822
- _define_property$w(this, "_transaction", void 0);
3823
- _define_property$w(this, "_documentRef", void 0);
3823
+ _class_call_check$s(this, TransactionFirestoreDocumentDataAccessor);
3824
+ _define_property$z(this, "_transaction", void 0);
3825
+ _define_property$z(this, "_documentRef", void 0);
3824
3826
  this._transaction = transaction;
3825
3827
  this._documentRef = documentRef;
3826
3828
  }
3827
- _create_class$f(TransactionFirestoreDocumentDataAccessor, [
3829
+ _create_class$h(TransactionFirestoreDocumentDataAccessor, [
3828
3830
  {
3829
3831
  key: "transaction",
3830
3832
  get: function get() {
@@ -3943,14 +3945,14 @@ function _define_property$w(obj, key, value) {
3943
3945
  * All document accessors created from this context operate within the same transaction.
3944
3946
  */ var TransactionFirestoreDocumentContext = /*#__PURE__*/ function() {
3945
3947
  function TransactionFirestoreDocumentContext(transaction) {
3946
- _class_call_check$p(this, TransactionFirestoreDocumentContext);
3947
- _define_property$w(this, "_transaction", void 0);
3948
- _define_property$w(this, "contextType", FirestoreDocumentContextType.TRANSACTION);
3949
- _define_property$w(this, "accessorFactory", void 0);
3948
+ _class_call_check$s(this, TransactionFirestoreDocumentContext);
3949
+ _define_property$z(this, "_transaction", void 0);
3950
+ _define_property$z(this, "contextType", FirestoreDocumentContextType.TRANSACTION);
3951
+ _define_property$z(this, "accessorFactory", void 0);
3950
3952
  this._transaction = transaction;
3951
3953
  this.accessorFactory = transactionAccessorFactory(transaction);
3952
3954
  }
3953
- _create_class$f(TransactionFirestoreDocumentContext, [
3955
+ _create_class$h(TransactionFirestoreDocumentContext, [
3954
3956
  {
3955
3957
  key: "transaction",
3956
3958
  get: function get() {
@@ -3969,7 +3971,7 @@ function _define_property$w(obj, key, value) {
3969
3971
  return new TransactionFirestoreDocumentContext(transaction);
3970
3972
  }
3971
3973
 
3972
- function _array_like_to_array$f(arr, len) {
3974
+ function _array_like_to_array$g(arr, len) {
3973
3975
  if (len == null || len > arr.length) len = arr.length;
3974
3976
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3975
3977
  return arr2;
@@ -3977,7 +3979,7 @@ function _array_like_to_array$f(arr, len) {
3977
3979
  function _array_with_holes$4(arr) {
3978
3980
  if (Array.isArray(arr)) return arr;
3979
3981
  }
3980
- function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
3982
+ function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
3981
3983
  try {
3982
3984
  var info = gen[key](arg);
3983
3985
  var value = info.value;
@@ -3988,16 +3990,16 @@ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
3988
3990
  if (info.done) resolve(value);
3989
3991
  else Promise.resolve(value).then(_next, _throw);
3990
3992
  }
3991
- function _async_to_generator$f(fn) {
3993
+ function _async_to_generator$h(fn) {
3992
3994
  return function() {
3993
3995
  var self = this, args = arguments;
3994
3996
  return new Promise(function(resolve, reject) {
3995
3997
  var gen = fn.apply(self, args);
3996
3998
  function _next(value) {
3997
- asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
3999
+ asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "next", value);
3998
4000
  }
3999
4001
  function _throw(err) {
4000
- asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
4002
+ asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "throw", err);
4001
4003
  }
4002
4004
  _next(undefined);
4003
4005
  });
@@ -4031,9 +4033,9 @@ function _non_iterable_rest$4() {
4031
4033
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4032
4034
  }
4033
4035
  function _sliced_to_array$4(arr, i) {
4034
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$4();
4036
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$4();
4035
4037
  }
4036
- function _ts_generator$f(thisArg, body) {
4038
+ function _ts_generator$h(thisArg, body) {
4037
4039
  var f, y, t, _ = {
4038
4040
  label: 0,
4039
4041
  sent: function() {
@@ -4132,13 +4134,13 @@ function _ts_generator$f(thisArg, body) {
4132
4134
  };
4133
4135
  }
4134
4136
  }
4135
- function _unsupported_iterable_to_array$f(o, minLen) {
4137
+ function _unsupported_iterable_to_array$g(o, minLen) {
4136
4138
  if (!o) return;
4137
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
4139
+ if (typeof o === "string") return _array_like_to_array$g(o, minLen);
4138
4140
  var n = Object.prototype.toString.call(o).slice(8, -1);
4139
4141
  if (n === "Object" && o.constructor) n = o.constructor.name;
4140
4142
  if (n === "Map" || n === "Set") return Array.from(n);
4141
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
4143
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
4142
4144
  }
4143
4145
  /**
4144
4146
  * Resolves a Firestore {@link CollectionReference} from a starting point and optional additional path segments.
@@ -4238,8 +4240,8 @@ function _unsupported_iterable_to_array$f(o, minLen) {
4238
4240
  },
4239
4241
  transactionFactoryForFirestore: function transactionFactoryForFirestore(firestore) {
4240
4242
  return function(fn) {
4241
- return _async_to_generator$f(function() {
4242
- return _ts_generator$f(this, function(_state) {
4243
+ return _async_to_generator$h(function() {
4244
+ return _ts_generator$h(this, function(_state) {
4243
4245
  return [
4244
4246
  2,
4245
4247
  firestore.runTransaction(fn)
@@ -4259,15 +4261,15 @@ function _unsupported_iterable_to_array$f(o, minLen) {
4259
4261
  };
4260
4262
  }
4261
4263
 
4262
- function _array_like_to_array$e(arr, len) {
4264
+ function _array_like_to_array$f(arr, len) {
4263
4265
  if (len == null || len > arr.length) len = arr.length;
4264
4266
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4265
4267
  return arr2;
4266
4268
  }
4267
- function _array_without_holes$a(arr) {
4268
- if (Array.isArray(arr)) return _array_like_to_array$e(arr);
4269
+ function _array_without_holes$b(arr) {
4270
+ if (Array.isArray(arr)) return _array_like_to_array$f(arr);
4269
4271
  }
4270
- function _define_property$v(obj, key, value) {
4272
+ function _define_property$y(obj, key, value) {
4271
4273
  if (key in obj) {
4272
4274
  Object.defineProperty(obj, key, {
4273
4275
  value: value,
@@ -4278,12 +4280,12 @@ function _define_property$v(obj, key, value) {
4278
4280
  } else obj[key] = value;
4279
4281
  return obj;
4280
4282
  }
4281
- function _iterable_to_array$a(iter) {
4283
+ function _iterable_to_array$b(iter) {
4282
4284
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
4283
4285
  return Array.from(iter);
4284
4286
  }
4285
4287
  }
4286
- function _non_iterable_spread$a() {
4288
+ function _non_iterable_spread$b() {
4287
4289
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4288
4290
  }
4289
4291
  function _object_spread$j(target) {
@@ -4296,7 +4298,7 @@ function _object_spread$j(target) {
4296
4298
  }));
4297
4299
  }
4298
4300
  ownKeys.forEach(function(key) {
4299
- _define_property$v(target, key, source[key]);
4301
+ _define_property$y(target, key, source[key]);
4300
4302
  });
4301
4303
  }
4302
4304
  return target;
@@ -4319,16 +4321,16 @@ function _object_spread_props$f(target, source) {
4319
4321
  }
4320
4322
  return target;
4321
4323
  }
4322
- function _to_consumable_array$a(arr) {
4323
- return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$a();
4324
+ function _to_consumable_array$b(arr) {
4325
+ return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$b();
4324
4326
  }
4325
- function _unsupported_iterable_to_array$e(o, minLen) {
4327
+ function _unsupported_iterable_to_array$f(o, minLen) {
4326
4328
  if (!o) return;
4327
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
4329
+ if (typeof o === "string") return _array_like_to_array$f(o, minLen);
4328
4330
  var n = Object.prototype.toString.call(o).slice(8, -1);
4329
4331
  if (n === "Object" && o.constructor) n = o.constructor.name;
4330
4332
  if (n === "Map" || n === "Set") return Array.from(n);
4331
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
4333
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
4332
4334
  }
4333
4335
  var _builder, _builder1;
4334
4336
  var _obj;
@@ -4336,31 +4338,31 @@ var _obj;
4336
4338
  * Maps each abstract query constraint type to its Google Cloud Firestore implementation.
4337
4339
  *
4338
4340
  * Used by {@link firestoreClientQueryConstraintFunctionsDriver} to build the server-side query driver.
4339
- */ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$v(_obj, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4341
+ */ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$y(_obj, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4340
4342
  return builder.limit(data.limit);
4341
- }), _define_property$v(_obj, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4343
+ }), _define_property$y(_obj, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4342
4344
  return builder.limitToLast(data.limit);
4343
- }), _define_property$v(_obj, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4345
+ }), _define_property$y(_obj, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4344
4346
  return builder.orderBy(data.fieldPath, data.directionStr);
4345
- }), _define_property$v(_obj, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4347
+ }), _define_property$y(_obj, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4346
4348
  return builder.orderBy(FieldPath.documentId(), data.directionStr);
4347
- }), _define_property$v(_obj, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4349
+ }), _define_property$y(_obj, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4348
4350
  return builder.where(data.fieldPath, data.opStr, data.value);
4349
- }), _define_property$v(_obj, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4351
+ }), _define_property$y(_obj, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4350
4352
  return builder.where(FieldPath.documentId(), data.opStr, data.value);
4351
- }), _define_property$v(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4353
+ }), _define_property$y(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4352
4354
  return builder.offset(data.offset);
4353
- }), _define_property$v(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4355
+ }), _define_property$y(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4354
4356
  return builder.startAt(data.snapshot);
4355
- }), _define_property$v(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4356
- return (_builder = builder).startAt.apply(_builder, _to_consumable_array$a(data.fieldValues));
4357
- }), _define_property$v(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4357
+ }), _define_property$y(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4358
+ return (_builder = builder).startAt.apply(_builder, _to_consumable_array$b(data.fieldValues));
4359
+ }), _define_property$y(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4358
4360
  return builder.startAfter(data.snapshot);
4359
- }), _define_property$v(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4361
+ }), _define_property$y(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4360
4362
  return builder.endAt(data.snapshot);
4361
- }), _define_property$v(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4362
- return (_builder1 = builder).endAt.apply(_builder1, _to_consumable_array$a(data.fieldValues));
4363
- }), _define_property$v(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4363
+ }), _define_property$y(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4364
+ return (_builder1 = builder).endAt.apply(_builder1, _to_consumable_array$b(data.fieldValues));
4365
+ }), _define_property$y(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
4364
4366
  return builder.endBefore(data.snapshot);
4365
4367
  }), _obj);
4366
4368
  /**
@@ -4564,7 +4566,7 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
4564
4566
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4565
4567
  };
4566
4568
 
4567
- function _class_call_check$o(instance, Constructor) {
4569
+ function _class_call_check$r(instance, Constructor) {
4568
4570
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4569
4571
  }
4570
4572
  /**
@@ -4573,7 +4575,7 @@ function _class_call_check$o(instance, Constructor) {
4573
4575
  * Analogous to {@link DbxAnalyticsService} on the frontend.
4574
4576
  * Apps extend this class and provide it via {@link ON_CALL_MODEL_ANALYTICS_SERVICE}.
4575
4577
  */ var OnCallModelAnalyticsService = function OnCallModelAnalyticsService() {
4576
- _class_call_check$o(this, OnCallModelAnalyticsService);
4578
+ _class_call_check$r(this, OnCallModelAnalyticsService);
4577
4579
  };
4578
4580
  /**
4579
4581
  * Default injection token for the analytics service.
@@ -4595,7 +4597,7 @@ function _class_call_check$o(instance, Constructor) {
4595
4597
  };
4596
4598
  }
4597
4599
 
4598
- function _class_call_check$n(instance, Constructor) {
4600
+ function _class_call_check$q(instance, Constructor) {
4599
4601
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4600
4602
  }
4601
4603
  /**
@@ -4603,7 +4605,7 @@ function _class_call_check$n(instance, Constructor) {
4603
4605
  * Events are forwarded from FirebaseServerAnalyticsService to this listener
4604
4606
  * for processing by an analytics provider (e.g., Segment).
4605
4607
  */ var FirebaseServerAnalyticsServiceListener = function FirebaseServerAnalyticsServiceListener() {
4606
- _class_call_check$n(this, FirebaseServerAnalyticsServiceListener);
4608
+ _class_call_check$q(this, FirebaseServerAnalyticsServiceListener);
4607
4609
  };
4608
4610
  /**
4609
4611
  * Creates a default no-op {@link FirebaseServerAnalyticsServiceListener}.
@@ -4631,10 +4633,10 @@ function _call_super$3(_this, derived, args) {
4631
4633
  derived = _get_prototype_of$3(derived);
4632
4634
  return _possible_constructor_return$3(_this, _is_native_reflect_construct$3() ? Reflect.construct(derived, [], _get_prototype_of$3(_this).constructor) : derived.apply(_this, args));
4633
4635
  }
4634
- function _class_call_check$m(instance, Constructor) {
4636
+ function _class_call_check$p(instance, Constructor) {
4635
4637
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4636
4638
  }
4637
- function _defineProperties$e(target, props) {
4639
+ function _defineProperties$g(target, props) {
4638
4640
  for(var i = 0; i < props.length; i++){
4639
4641
  var descriptor = props[i];
4640
4642
  descriptor.enumerable = descriptor.enumerable || false;
@@ -4643,11 +4645,11 @@ function _defineProperties$e(target, props) {
4643
4645
  Object.defineProperty(target, descriptor.key, descriptor);
4644
4646
  }
4645
4647
  }
4646
- function _create_class$e(Constructor, protoProps, staticProps) {
4647
- if (protoProps) _defineProperties$e(Constructor.prototype, protoProps);
4648
+ function _create_class$g(Constructor, protoProps, staticProps) {
4649
+ if (protoProps) _defineProperties$g(Constructor.prototype, protoProps);
4648
4650
  return Constructor;
4649
4651
  }
4650
- function _define_property$u(obj, key, value) {
4652
+ function _define_property$x(obj, key, value) {
4651
4653
  if (key in obj) {
4652
4654
  Object.defineProperty(obj, key, {
4653
4655
  value: value,
@@ -4723,9 +4725,9 @@ function _type_of$3(obj) {
4723
4725
  */ var FirebaseServerAnalyticsService = /*#__PURE__*/ function(OnCallModelAnalyticsService) {
4724
4726
  _inherits$3(FirebaseServerAnalyticsService, OnCallModelAnalyticsService);
4725
4727
  function FirebaseServerAnalyticsService(listener) {
4726
- _class_call_check$m(this, FirebaseServerAnalyticsService);
4728
+ _class_call_check$p(this, FirebaseServerAnalyticsService);
4727
4729
  var _this;
4728
- _this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$u(_this, "_listener", void 0);
4730
+ _this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$x(_this, "_listener", void 0);
4729
4731
  if (listener) {
4730
4732
  _this._listener = listener;
4731
4733
  } else {
@@ -4734,7 +4736,7 @@ function _type_of$3(obj) {
4734
4736
  }
4735
4737
  return _this;
4736
4738
  }
4737
- _create_class$e(FirebaseServerAnalyticsService, [
4739
+ _create_class$g(FirebaseServerAnalyticsService, [
4738
4740
  {
4739
4741
  key: "handleOnCallAnalyticsEvent",
4740
4742
  value: function handleOnCallAnalyticsEvent(event) {
@@ -4774,7 +4776,7 @@ FirebaseServerAnalyticsService = __decorate([
4774
4776
  __param(0, Inject(FirebaseServerAnalyticsServiceListener))
4775
4777
  ], FirebaseServerAnalyticsService);
4776
4778
 
4777
- function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
4779
+ function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
4778
4780
  try {
4779
4781
  var info = gen[key](arg);
4780
4782
  var value = info.value;
@@ -4785,22 +4787,22 @@ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
4785
4787
  if (info.done) resolve(value);
4786
4788
  else Promise.resolve(value).then(_next, _throw);
4787
4789
  }
4788
- function _async_to_generator$e(fn) {
4790
+ function _async_to_generator$g(fn) {
4789
4791
  return function() {
4790
4792
  var self = this, args = arguments;
4791
4793
  return new Promise(function(resolve, reject) {
4792
4794
  var gen = fn.apply(self, args);
4793
4795
  function _next(value) {
4794
- asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
4796
+ asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "next", value);
4795
4797
  }
4796
4798
  function _throw(err) {
4797
- asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
4799
+ asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "throw", err);
4798
4800
  }
4799
4801
  _next(undefined);
4800
4802
  });
4801
4803
  };
4802
4804
  }
4803
- function _ts_generator$e(thisArg, body) {
4805
+ function _ts_generator$g(thisArg, body) {
4804
4806
  var f, y, t, _ = {
4805
4807
  label: 0,
4806
4808
  sent: function() {
@@ -4964,7 +4966,7 @@ function _ts_generator$e(thisArg, body) {
4964
4966
  * });
4965
4967
  * ```
4966
4968
  */ function callWithAnalytics(config) {
4967
- return _async_to_generator$e(function() {
4969
+ return _async_to_generator$g(function() {
4968
4970
  var service, details, context, execute, result, emitter, error;
4969
4971
  function _safeCall(fn) {
4970
4972
  try {
@@ -4974,7 +4976,7 @@ function _ts_generator$e(thisArg, body) {
4974
4976
  console.error("callWithAnalytics: Failed to emit analytics event:", error);
4975
4977
  }
4976
4978
  }
4977
- return _ts_generator$e(this, function(_state) {
4979
+ return _ts_generator$g(this, function(_state) {
4978
4980
  switch(_state.label){
4979
4981
  case 0:
4980
4982
  service = config.service, details = config.details, context = config.context, execute = config.execute;
@@ -5033,7 +5035,7 @@ function _ts_generator$e(thisArg, body) {
5033
5035
  })();
5034
5036
  }
5035
5037
 
5036
- function _array_like_to_array$d(arr, len) {
5038
+ function _array_like_to_array$e(arr, len) {
5037
5039
  if (len == null || len > arr.length) len = arr.length;
5038
5040
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5039
5041
  return arr2;
@@ -5105,15 +5107,15 @@ function _object_without_properties_loose(source, excluded) {
5105
5107
  return target;
5106
5108
  }
5107
5109
  function _sliced_to_array$3(arr, i) {
5108
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$3();
5110
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$3();
5109
5111
  }
5110
- function _unsupported_iterable_to_array$d(o, minLen) {
5112
+ function _unsupported_iterable_to_array$e(o, minLen) {
5111
5113
  if (!o) return;
5112
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
5114
+ if (typeof o === "string") return _array_like_to_array$e(o, minLen);
5113
5115
  var n = Object.prototype.toString.call(o).slice(8, -1);
5114
5116
  if (n === "Object" && o.constructor) n = o.constructor.name;
5115
5117
  if (n === "Map" || n === "Set") return Array.from(n);
5116
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
5118
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
5117
5119
  }
5118
5120
  // MARK: Type Guards
5119
5121
  /**
@@ -5626,7 +5628,7 @@ function resolveRequiredScopeFromApiDetails(apiDetails, call, modelType, specifi
5626
5628
  }));
5627
5629
  }
5628
5630
 
5629
- function _define_property$t(obj, key, value) {
5631
+ function _define_property$w(obj, key, value) {
5630
5632
  if (key in obj) {
5631
5633
  Object.defineProperty(obj, key, {
5632
5634
  value: value,
@@ -5647,7 +5649,7 @@ function _object_spread$i(target) {
5647
5649
  }));
5648
5650
  }
5649
5651
  ownKeys.forEach(function(key) {
5650
- _define_property$t(target, key, source[key]);
5652
+ _define_property$w(target, key, source[key]);
5651
5653
  });
5652
5654
  }
5653
5655
  return target;
@@ -6008,15 +6010,15 @@ function _object_spread_props$e(target, source) {
6008
6010
  }));
6009
6011
  }
6010
6012
 
6011
- function _array_like_to_array$c(arr, len) {
6013
+ function _array_like_to_array$d(arr, len) {
6012
6014
  if (len == null || len > arr.length) len = arr.length;
6013
6015
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6014
6016
  return arr2;
6015
6017
  }
6016
- function _array_without_holes$9(arr) {
6017
- if (Array.isArray(arr)) return _array_like_to_array$c(arr);
6018
+ function _array_without_holes$a(arr) {
6019
+ if (Array.isArray(arr)) return _array_like_to_array$d(arr);
6018
6020
  }
6019
- function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
6021
+ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
6020
6022
  try {
6021
6023
  var info = gen[key](arg);
6022
6024
  var value = info.value;
@@ -6027,33 +6029,33 @@ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
6027
6029
  if (info.done) resolve(value);
6028
6030
  else Promise.resolve(value).then(_next, _throw);
6029
6031
  }
6030
- function _async_to_generator$d(fn) {
6032
+ function _async_to_generator$f(fn) {
6031
6033
  return function() {
6032
6034
  var self = this, args = arguments;
6033
6035
  return new Promise(function(resolve, reject) {
6034
6036
  var gen = fn.apply(self, args);
6035
6037
  function _next(value) {
6036
- asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
6038
+ asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
6037
6039
  }
6038
6040
  function _throw(err) {
6039
- asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
6041
+ asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
6040
6042
  }
6041
6043
  _next(undefined);
6042
6044
  });
6043
6045
  };
6044
6046
  }
6045
- function _iterable_to_array$9(iter) {
6047
+ function _iterable_to_array$a(iter) {
6046
6048
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
6047
6049
  return Array.from(iter);
6048
6050
  }
6049
6051
  }
6050
- function _non_iterable_spread$9() {
6052
+ function _non_iterable_spread$a() {
6051
6053
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6052
6054
  }
6053
- function _to_consumable_array$9(arr) {
6054
- return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$9();
6055
+ function _to_consumable_array$a(arr) {
6056
+ return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$a();
6055
6057
  }
6056
- function _ts_generator$d(thisArg, body) {
6058
+ function _ts_generator$f(thisArg, body) {
6057
6059
  var f, y, t, _ = {
6058
6060
  label: 0,
6059
6061
  sent: function() {
@@ -6152,13 +6154,13 @@ function _ts_generator$d(thisArg, body) {
6152
6154
  };
6153
6155
  }
6154
6156
  }
6155
- function _unsupported_iterable_to_array$c(o, minLen) {
6157
+ function _unsupported_iterable_to_array$d(o, minLen) {
6156
6158
  if (!o) return;
6157
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
6159
+ if (typeof o === "string") return _array_like_to_array$d(o, minLen);
6158
6160
  var n = Object.prototype.toString.call(o).slice(8, -1);
6159
6161
  if (n === "Object" && o.constructor) n = o.constructor.name;
6160
6162
  if (n === "Map" || n === "Set") return Array.from(n);
6161
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
6163
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
6162
6164
  }
6163
6165
  /**
6164
6166
  * Factory that creates a callable function handling model queries for multiple model types.
@@ -6264,9 +6266,9 @@ function _unsupported_iterable_to_array$c(o, minLen) {
6264
6266
  * };
6265
6267
  * ```
6266
6268
  */ function executeOnCallQuery(config) {
6267
- return _async_to_generator$d(function() {
6269
+ return _async_to_generator$f(function() {
6268
6270
  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;
6269
- return _ts_generator$d(this, function(_state) {
6271
+ return _ts_generator$f(this, function(_state) {
6270
6272
  switch(_state.label){
6271
6273
  case 0:
6272
6274
  params = config.params, collection = config.collection, loadCursorDocument = config.loadCursorDocument, buildConstraints = config.buildConstraints, _config_maxLimit = config.maxLimit, maxLimit = _config_maxLimit === void 0 ? MAX_ON_CALL_QUERY_MODEL_LIMIT : _config_maxLimit, mapResult = config.mapResult;
@@ -6318,7 +6320,7 @@ function _unsupported_iterable_to_array$c(o, minLen) {
6318
6320
  // Fetch one extra to detect hasMore
6319
6321
  constraints.push(limit(effectiveLimit + 1));
6320
6322
  // Execute via the collection's query factory
6321
- executableQuery = (_collection = collection).query.apply(_collection, _to_consumable_array$9(constraints));
6323
+ executableQuery = (_collection = collection).query.apply(_collection, _to_consumable_array$a(constraints));
6322
6324
  return [
6323
6325
  4,
6324
6326
  executableQuery.getDocs()
@@ -6395,32 +6397,32 @@ function _unsupported_iterable_to_array$c(o, minLen) {
6395
6397
  }));
6396
6398
  }
6397
6399
 
6398
- function _array_like_to_array$b(arr, len) {
6400
+ function _array_like_to_array$c(arr, len) {
6399
6401
  if (len == null || len > arr.length) len = arr.length;
6400
6402
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6401
6403
  return arr2;
6402
6404
  }
6403
- function _array_without_holes$8(arr) {
6404
- if (Array.isArray(arr)) return _array_like_to_array$b(arr);
6405
+ function _array_without_holes$9(arr) {
6406
+ if (Array.isArray(arr)) return _array_like_to_array$c(arr);
6405
6407
  }
6406
- function _iterable_to_array$8(iter) {
6408
+ function _iterable_to_array$9(iter) {
6407
6409
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
6408
6410
  return Array.from(iter);
6409
6411
  }
6410
6412
  }
6411
- function _non_iterable_spread$8() {
6413
+ function _non_iterable_spread$9() {
6412
6414
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6413
6415
  }
6414
- function _to_consumable_array$8(arr) {
6415
- return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$8();
6416
+ function _to_consumable_array$9(arr) {
6417
+ return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$9();
6416
6418
  }
6417
- function _unsupported_iterable_to_array$b(o, minLen) {
6419
+ function _unsupported_iterable_to_array$c(o, minLen) {
6418
6420
  if (!o) return;
6419
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
6421
+ if (typeof o === "string") return _array_like_to_array$c(o, minLen);
6420
6422
  var n = Object.prototype.toString.call(o).slice(8, -1);
6421
6423
  if (n === "Object" && o.constructor) n = o.constructor.name;
6422
6424
  if (n === "Map" || n === "Set") return Array.from(n);
6423
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
6425
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
6424
6426
  }
6425
6427
  /**
6426
6428
  * Generates NestJS {@link ModuleMetadata} for an app's analytics module.
@@ -6445,18 +6447,18 @@ function _unsupported_iterable_to_array$b(o, minLen) {
6445
6447
  dependencyModule
6446
6448
  ] : [];
6447
6449
  return {
6448
- imports: _to_consumable_array$8(dependencyModuleImport).concat(_to_consumable_array$8(imports !== null && imports !== void 0 ? imports : [])),
6450
+ imports: _to_consumable_array$9(dependencyModuleImport).concat(_to_consumable_array$9(imports !== null && imports !== void 0 ? imports : [])),
6449
6451
  exports: [
6450
6452
  FirebaseServerAnalyticsService,
6451
6453
  ON_CALL_MODEL_ANALYTICS_SERVICE
6452
- ].concat(_to_consumable_array$8(exports !== null && exports !== void 0 ? exports : [])),
6454
+ ].concat(_to_consumable_array$9(exports !== null && exports !== void 0 ? exports : [])),
6453
6455
  providers: [
6454
6456
  FirebaseServerAnalyticsService,
6455
6457
  {
6456
6458
  provide: ON_CALL_MODEL_ANALYTICS_SERVICE,
6457
6459
  useExisting: FirebaseServerAnalyticsService
6458
6460
  }
6459
- ].concat(_to_consumable_array$8(providers !== null && providers !== void 0 ? providers : []))
6461
+ ].concat(_to_consumable_array$9(providers !== null && providers !== void 0 ? providers : []))
6460
6462
  };
6461
6463
  }
6462
6464
 
@@ -6468,10 +6470,10 @@ function _call_super$2(_this, derived, args) {
6468
6470
  derived = _get_prototype_of$2(derived);
6469
6471
  return _possible_constructor_return$2(_this, _is_native_reflect_construct$2() ? Reflect.construct(derived, [], _get_prototype_of$2(_this).constructor) : derived.apply(_this, args));
6470
6472
  }
6471
- function _class_call_check$l(instance, Constructor) {
6473
+ function _class_call_check$o(instance, Constructor) {
6472
6474
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
6473
6475
  }
6474
- function _defineProperties$d(target, props) {
6476
+ function _defineProperties$f(target, props) {
6475
6477
  for(var i = 0; i < props.length; i++){
6476
6478
  var descriptor = props[i];
6477
6479
  descriptor.enumerable = descriptor.enumerable || false;
@@ -6480,11 +6482,11 @@ function _defineProperties$d(target, props) {
6480
6482
  Object.defineProperty(target, descriptor.key, descriptor);
6481
6483
  }
6482
6484
  }
6483
- function _create_class$d(Constructor, protoProps, staticProps) {
6484
- if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
6485
+ function _create_class$f(Constructor, protoProps, staticProps) {
6486
+ if (protoProps) _defineProperties$f(Constructor.prototype, protoProps);
6485
6487
  return Constructor;
6486
6488
  }
6487
- function _define_property$s(obj, key, value) {
6489
+ function _define_property$v(obj, key, value) {
6488
6490
  if (key in obj) {
6489
6491
  Object.defineProperty(obj, key, {
6490
6492
  value: value,
@@ -6532,7 +6534,7 @@ function _object_spread$h(target) {
6532
6534
  }));
6533
6535
  }
6534
6536
  ownKeys.forEach(function(key) {
6535
- _define_property$s(target, key, source[key]);
6537
+ _define_property$v(target, key, source[key]);
6536
6538
  });
6537
6539
  }
6538
6540
  return target;
@@ -6582,13 +6584,13 @@ function _type_of$2(obj) {
6582
6584
  */ var FirebaseServerAnalyticsSegmentListenerService = /*#__PURE__*/ function(FirebaseServerAnalyticsServiceListener) {
6583
6585
  _inherits$2(FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsServiceListener);
6584
6586
  function FirebaseServerAnalyticsSegmentListenerService(_segmentService) {
6585
- _class_call_check$l(this, FirebaseServerAnalyticsSegmentListenerService);
6587
+ _class_call_check$o(this, FirebaseServerAnalyticsSegmentListenerService);
6586
6588
  var _this;
6587
- _this = _call_super$2(this, FirebaseServerAnalyticsSegmentListenerService), _define_property$s(_this, "_segmentService", void 0);
6589
+ _this = _call_super$2(this, FirebaseServerAnalyticsSegmentListenerService), _define_property$v(_this, "_segmentService", void 0);
6588
6590
  _this._segmentService = _segmentService;
6589
6591
  return _this;
6590
6592
  }
6591
- _create_class$d(FirebaseServerAnalyticsSegmentListenerService, [
6593
+ _create_class$f(FirebaseServerAnalyticsSegmentListenerService, [
6592
6594
  {
6593
6595
  key: "handleOnCallAnalyticsEvent",
6594
6596
  value: function handleOnCallAnalyticsEvent(event) {
@@ -6649,7 +6651,7 @@ FirebaseServerAnalyticsSegmentListenerService = __decorate([
6649
6651
  __param(0, Inject(SegmentService))
6650
6652
  ], FirebaseServerAnalyticsSegmentListenerService);
6651
6653
 
6652
- function _class_call_check$k(instance, Constructor) {
6654
+ function _class_call_check$n(instance, Constructor) {
6653
6655
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
6654
6656
  }
6655
6657
  /**
@@ -6657,7 +6659,7 @@ function _class_call_check$k(instance, Constructor) {
6657
6659
  *
6658
6660
  * This module provides the {@link FirebaseServerAnalyticsSegmentListenerService} as the {@link FirebaseServerAnalyticsServiceListener} implementation and exports {@link SegmentServiceModule} for use in the app.
6659
6661
  */ var FirebaseServerAnalyticsSegmentModule = function FirebaseServerAnalyticsSegmentModule() {
6660
- _class_call_check$k(this, FirebaseServerAnalyticsSegmentModule);
6662
+ _class_call_check$n(this, FirebaseServerAnalyticsSegmentModule);
6661
6663
  };
6662
6664
  FirebaseServerAnalyticsSegmentModule = __decorate([
6663
6665
  Module({
@@ -6702,10 +6704,10 @@ FirebaseServerAnalyticsSegmentModule = __decorate([
6702
6704
  };
6703
6705
  }
6704
6706
 
6705
- function _class_call_check$j(instance, Constructor) {
6707
+ function _class_call_check$m(instance, Constructor) {
6706
6708
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
6707
6709
  }
6708
- function _define_property$r(obj, key, value) {
6710
+ function _define_property$u(obj, key, value) {
6709
6711
  if (key in obj) {
6710
6712
  Object.defineProperty(obj, key, {
6711
6713
  value: value,
@@ -6726,7 +6728,7 @@ function _object_spread$g(target) {
6726
6728
  }));
6727
6729
  }
6728
6730
  ownKeys.forEach(function(key) {
6729
- _define_property$r(target, key, source[key]);
6731
+ _define_property$u(target, key, source[key]);
6730
6732
  });
6731
6733
  }
6732
6734
  return target;
@@ -6756,7 +6758,7 @@ function _object_spread_props$c(target, source) {
6756
6758
  /**
6757
6759
  * Nest provider module for Firebase that provides a firestore, etc. from the firestore token.
6758
6760
  */ var FirebaseServerAuthModule = function FirebaseServerAuthModule() {
6759
- _class_call_check$j(this, FirebaseServerAuthModule);
6761
+ _class_call_check$m(this, FirebaseServerAuthModule);
6760
6762
  };
6761
6763
  FirebaseServerAuthModule = __decorate([
6762
6764
  Module({
@@ -7047,6 +7049,982 @@ FirebaseServerAuthModule = __decorate([
7047
7049
  }
7048
7050
  }
7049
7051
 
7052
+ /**
7053
+ * Header carrying the originating client address through a proxy chain, as a comma-delimited list
7054
+ * whose FIRST entry is the original caller.
7055
+ *
7056
+ * Cloud Run / Cloud Functions sit behind Google's front end, which always rewrites this header, so
7057
+ * the leftmost value is trustworthy there. Behind an arbitrary reverse proxy it is caller-controlled
7058
+ * — see {@link requestClientIp}'s note on what this address may and may not be used for.
7059
+ */ var FORWARDED_FOR_REQUEST_HEADER = 'x-forwarded-for';
7060
+ /**
7061
+ * Resolves the calling client's IP address from a request, preferring the leftmost
7062
+ * {@link FORWARDED_FOR_REQUEST_HEADER} entry and falling back to Express' own `req.ip` and then the
7063
+ * raw socket address.
7064
+ *
7065
+ * IPv4-mapped IPv6 addresses (`::ffff:127.0.0.1`) are normalized to their dotted-quad form, so the
7066
+ * same caller reaching a dual-stack listener and a v4-only one compares equal.
7067
+ *
7068
+ * **This is an advisory address, not an authentication factor.** Behind a proxy that does not
7069
+ * rewrite the header it is caller-controlled, and a NAT/mobile caller's address changes on its own.
7070
+ * Use it for binding a capability to the network path that minted it (an opt-in defence in depth
7071
+ * alongside a real gate) or for logging — never as the sole check.
7072
+ *
7073
+ * @param request - The incoming request.
7074
+ * @returns The resolved client address, or `undefined` when none could be determined.
7075
+ * @__NO_SIDE_EFFECTS__
7076
+ */ function requestClientIp(request) {
7077
+ var _ref, _normalizeClientIp;
7078
+ var _request_headers, _request_socket;
7079
+ var forwardedFor = request === null || request === void 0 ? void 0 : (_request_headers = request.headers) === null || _request_headers === void 0 ? void 0 : _request_headers[FORWARDED_FOR_REQUEST_HEADER];
7080
+ var forwardedValue = Array.isArray(forwardedFor) ? forwardedFor[0] : forwardedFor;
7081
+ var forwardedFirst = forwardedValue === null || forwardedValue === void 0 ? void 0 : forwardedValue.split(',')[0];
7082
+ return (_ref = (_normalizeClientIp = normalizeClientIp(forwardedFirst)) !== null && _normalizeClientIp !== void 0 ? _normalizeClientIp : normalizeClientIp(request === null || request === void 0 ? void 0 : request.ip)) !== null && _ref !== void 0 ? _ref : normalizeClientIp(request === null || request === void 0 ? void 0 : (_request_socket = request.socket) === null || _request_socket === void 0 ? void 0 : _request_socket.remoteAddress);
7083
+ }
7084
+ /**
7085
+ * Trims an address and unwraps the IPv4-mapped IPv6 form, returning `undefined` for an empty value.
7086
+ *
7087
+ * @param value - The raw address.
7088
+ * @returns The normalized address, or `undefined` when there is nothing usable.
7089
+ * @__NO_SIDE_EFFECTS__
7090
+ */ function normalizeClientIp(value) {
7091
+ var trimmed = value === null || value === void 0 ? void 0 : value.trim();
7092
+ var result;
7093
+ if (trimmed) {
7094
+ result = trimmed.startsWith('::ffff:') ? trimmed.slice('::ffff:'.length) : trimmed;
7095
+ }
7096
+ return result;
7097
+ }
7098
+ /**
7099
+ * Compares two client addresses for the purposes of a mint/redeem binding.
7100
+ *
7101
+ * Both sides are normalized first, and an ABSENT address on either side is treated as a MISMATCH:
7102
+ * a binding that silently passes when the address could not be resolved would be no binding at all.
7103
+ *
7104
+ * @param a - The first address.
7105
+ * @param b - The second address.
7106
+ * @returns True when both addresses resolved and are equal.
7107
+ * @__NO_SIDE_EFFECTS__
7108
+ */ function clientIpsMatch(a, b) {
7109
+ var first = normalizeClientIp(a);
7110
+ var second = normalizeClientIp(b);
7111
+ return first != null && second != null && first === second;
7112
+ }
7113
+
7114
+ function _class_call_check$l(instance, Constructor) {
7115
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
7116
+ }
7117
+ function _define_property$t(obj, key, value) {
7118
+ if (key in obj) {
7119
+ Object.defineProperty(obj, key, {
7120
+ value: value,
7121
+ enumerable: true,
7122
+ configurable: true,
7123
+ writable: true
7124
+ });
7125
+ } else obj[key] = value;
7126
+ return obj;
7127
+ }
7128
+ // MARK: Paths
7129
+ /**
7130
+ * Route prefix the download controller is mounted at. Under the `/api` global route prefix the route
7131
+ * becomes `GET /api/download`.
7132
+ */ var DOWNLOAD_API_ROUTE_PREFIX = 'download';
7133
+ /**
7134
+ * Path (relative to the API base URL) of the signed asset-download endpoint.
7135
+ */ var DOWNLOAD_API_PATH = '/download';
7136
+ /**
7137
+ * Query parameter carrying the signed capability token.
7138
+ */ var DOWNLOAD_API_ASSET_QUERY_PARAM = 'asset';
7139
+ /**
7140
+ * Folder, relative to the app's dist output, that holds every mintable asset.
7141
+ *
7142
+ * The downloadable set is exactly this ONE folder — nothing outside it is ever mintable, and the
7143
+ * containment check in {@link resolveSecureAssetPath} is what enforces that.
7144
+ */ var DEFAULT_SECURE_ASSETS_DIRECTORY = 'assets/secure';
7145
+ // MARK: Token
7146
+ /**
7147
+ * `aud` claim of a download capability token.
7148
+ *
7149
+ * Distinct from every OAuth audience so a download token can never be presented as a bearer access
7150
+ * token — `oidcProviderIssuerProfiles` only accepts the registered resource-server audiences and the
7151
+ * issuer itself.
7152
+ */ var DOWNLOAD_TOKEN_AUDIENCE = 'dbx:asset-download';
7153
+ /**
7154
+ * Header `typ` of a download capability token.
7155
+ *
7156
+ * **Load-bearing.** The same JWKS signs the provider's `at+jwt` access tokens, so this is the second
7157
+ * half of the mutual rejection: the download verifier accepts ONLY this `typ` (plus
7158
+ * {@link DOWNLOAD_TOKEN_AUDIENCE}), and the bearer path rejects a download token on its audience.
7159
+ */ var DOWNLOAD_TOKEN_TYP = 'dbx-dl+jwt';
7160
+ /**
7161
+ * `sub` claim of a download capability token. The token carries NO user identifier — the caller is
7162
+ * authorized at MINT time and the uid goes to the audit log there, so it never lands in a URL that
7163
+ * ends up in shell history and proxy logs.
7164
+ */ var DOWNLOAD_TOKEN_SUBJECT = 'dbx:asset';
7165
+ /**
7166
+ * Claim carrying the asset path, RELATIVE to the secure root. Never absolute.
7167
+ */ var DOWNLOAD_TOKEN_PATH_CLAIM = 'p';
7168
+ /**
7169
+ * Default lifetime of a minted download URL.
7170
+ */ var DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS = 10 * SECONDS_IN_MINUTE;
7171
+ /**
7172
+ * Ceiling on a minted download URL's lifetime.
7173
+ *
7174
+ * A download URL is deliberately NOT one-time — a network blip partway through a multi-megabyte
7175
+ * download would otherwise burn it — so the TTL is the whole control, with the token's `jti` logged
7176
+ * so a replay is at least visible.
7177
+ */ var MAX_DOWNLOAD_TOKEN_TTL_SECONDS = SECONDS_IN_HOUR;
7178
+ /**
7179
+ * NestJS injection token for the {@link DownloadTokenSigner} provider.
7180
+ */ var DOWNLOAD_TOKEN_SIGNER = 'DOWNLOAD_TOKEN_SIGNER';
7181
+ // MARK: Config
7182
+ /**
7183
+ * Configuration for the signed asset-download endpoint, supplied by the app via its dependency module.
7184
+ *
7185
+ * Without a resolvable {@link secureAssetsRoot} the endpoint fails closed for every request.
7186
+ */ var DownloadApiModuleConfig = function DownloadApiModuleConfig() {
7187
+ _class_call_check$l(this, DownloadApiModuleConfig);
7188
+ /**
7189
+ * Absolute path to the ONLY folder assets may be served from.
7190
+ *
7191
+ * Resolve it with the same three-cwd probe the dist manifests use — the Functions runtime, a
7192
+ * workspace-root run, and vitest all set different `process.cwd()` values.
7193
+ */ _define_property$t(this, "secureAssetsRoot", void 0);
7194
+ /**
7195
+ * The app's API base URL, used to build the absolute minted URL.
7196
+ */ _define_property$t(this, "apiBaseUrl", void 0);
7197
+ /**
7198
+ * Default lifetime for a minted URL. Clamped to {@link MAX_DOWNLOAD_TOKEN_TTL_SECONDS}. Defaults to
7199
+ * {@link DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS}.
7200
+ */ _define_property$t(this, "defaultTtlSeconds", void 0);
7201
+ };
7202
+ // MARK: Containment
7203
+ /**
7204
+ * Resolves an asset path, relative to the secure root, to the absolute file it names — or
7205
+ * `undefined` when it escapes containment.
7206
+ *
7207
+ * **This function IS the security model for Part C.** With a folder root rather than a key registry,
7208
+ * a mistake here is an arbitrary-file-read primitive on the function's filesystem, so it is enforced
7209
+ * in BOTH places (at mint, so a URL for an outside file can never be obtained; and at download, so a
7210
+ * bug in the minting path cannot become a read primitive) and both call sites share this one
7211
+ * function so they cannot drift.
7212
+ *
7213
+ * Rejected up front: an absolute path, any `..` segment, a null byte, and an empty path. Then
7214
+ * `realpath` is applied to BOTH sides — that is what stops a symlink inside `secure/` from pointing
7215
+ * at `/etc` or at the function's `.env`. The final containment compare appends `path.sep` so a
7216
+ * sibling directory sharing a name prefix (`secure-other/x`) cannot pass a naive `startsWith`.
7217
+ *
7218
+ * @param secureRoot - Absolute path to the secure root folder, or `undefined` when unconfigured (⇒ always fails).
7219
+ * @param relativePath - The asset path relative to the secure root.
7220
+ * @returns The absolute, real path of the file, or `undefined` when it is not a contained regular file.
7221
+ * @__NO_SIDE_EFFECTS__
7222
+ */ function resolveSecureAssetPath(secureRoot, relativePath) {
7223
+ var result;
7224
+ if (secureRoot && relativePath && isSafeRelativeAssetPath(relativePath)) {
7225
+ try {
7226
+ var realRoot = realpathSync(secureRoot);
7227
+ var candidate = path.resolve(realRoot, relativePath);
7228
+ if (existsSync(candidate)) {
7229
+ var realCandidate = realpathSync(candidate);
7230
+ if (realCandidate.startsWith(realRoot + path.sep) && statSync(realCandidate).isFile()) {
7231
+ result = realCandidate;
7232
+ }
7233
+ }
7234
+ } catch (unused) {
7235
+ // a missing root, a broken symlink, or a permission error are all "not downloadable"
7236
+ result = undefined;
7237
+ }
7238
+ }
7239
+ return result;
7240
+ }
7241
+ /**
7242
+ * Returns true when a relative asset path is structurally safe to resolve — non-empty, relative, free
7243
+ * of `..` segments, and free of null bytes.
7244
+ *
7245
+ * Split out from {@link resolveSecureAssetPath} so the structural rejection is testable without a
7246
+ * filesystem, and so the reason a path is refused is one check rather than a compound condition.
7247
+ *
7248
+ * @param relativePath - The candidate path.
7249
+ * @returns True when the path may be resolved against the secure root.
7250
+ * @__NO_SIDE_EFFECTS__
7251
+ */ function isSafeRelativeAssetPath(relativePath) {
7252
+ var normalized = relativePath.trim();
7253
+ var result = false;
7254
+ if (normalized.length > 0 && !normalized.includes('\0') && !path.isAbsolute(normalized)) {
7255
+ // check the SEGMENTS rather than the raw string: a filename legitimately containing '..'
7256
+ // (`v1..2.tar`) is fine, while `a/../../etc` is not. Both separators are checked because a
7257
+ // Windows-style path reaching a POSIX host would otherwise slip through `path.posix` splitting.
7258
+ var segments = new Set(normalized.split(/[/\\]/));
7259
+ result = !segments.has('..') && !segments.has('');
7260
+ }
7261
+ return result;
7262
+ }
7263
+ /**
7264
+ * Clamps a requested download-URL lifetime to {@link MAX_DOWNLOAD_TOKEN_TTL_SECONDS}.
7265
+ *
7266
+ * @param requestedTtlSeconds - The requested lifetime, if any.
7267
+ * @param defaultTtlSeconds - The app-configured default, used when none is requested.
7268
+ * @returns The lifetime to sign with, in seconds.
7269
+ * @__NO_SIDE_EFFECTS__
7270
+ */ function downloadTokenTtlSeconds(requestedTtlSeconds, defaultTtlSeconds) {
7271
+ var requested = requestedTtlSeconds != null && requestedTtlSeconds > 0 ? requestedTtlSeconds : defaultTtlSeconds !== null && defaultTtlSeconds !== void 0 ? defaultTtlSeconds : DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS;
7272
+ return Math.max(1, Math.floor(Math.min(requested, MAX_DOWNLOAD_TOKEN_TTL_SECONDS)));
7273
+ }
7274
+ // MARK: Content Type
7275
+ /**
7276
+ * File-extension to `Content-Type` table for served assets.
7277
+ *
7278
+ * Intentionally tiny: the secure root holds build artifacts, and anything unrecognized is served as
7279
+ * {@link DEFAULT_DOWNLOAD_CONTENT_TYPE} rather than being guessed at.
7280
+ */ var DOWNLOAD_CONTENT_TYPES = {
7281
+ '.js': 'text/javascript; charset=utf-8',
7282
+ '.mjs': 'text/javascript; charset=utf-8',
7283
+ '.cjs': 'text/javascript; charset=utf-8',
7284
+ '.json': 'application/json; charset=utf-8',
7285
+ '.txt': 'text/plain; charset=utf-8',
7286
+ '.md': 'text/markdown; charset=utf-8',
7287
+ '.sha256': 'text/plain; charset=utf-8',
7288
+ '.sh': 'text/x-shellscript; charset=utf-8',
7289
+ '.tgz': 'application/gzip',
7290
+ '.gz': 'application/gzip',
7291
+ '.zip': 'application/zip'
7292
+ };
7293
+ /**
7294
+ * `Content-Type` used for any asset whose extension is not in {@link DOWNLOAD_CONTENT_TYPES}.
7295
+ */ var DEFAULT_DOWNLOAD_CONTENT_TYPE = 'application/octet-stream';
7296
+ /**
7297
+ * Resolves the `Content-Type` for a file path from its extension.
7298
+ *
7299
+ * @param filePath - The resolved file path.
7300
+ * @returns The content type, defaulting to {@link DEFAULT_DOWNLOAD_CONTENT_TYPE}.
7301
+ * @__NO_SIDE_EFFECTS__
7302
+ */ function downloadContentTypeForPath(filePath) {
7303
+ var _DOWNLOAD_CONTENT_TYPES_path_extname_toLowerCase;
7304
+ return (_DOWNLOAD_CONTENT_TYPES_path_extname_toLowerCase = DOWNLOAD_CONTENT_TYPES[path.extname(filePath).toLowerCase()]) !== null && _DOWNLOAD_CONTENT_TYPES_path_extname_toLowerCase !== void 0 ? _DOWNLOAD_CONTENT_TYPES_path_extname_toLowerCase : DEFAULT_DOWNLOAD_CONTENT_TYPE;
7305
+ }
7306
+
7307
+ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
7308
+ try {
7309
+ var info = gen[key](arg);
7310
+ var value = info.value;
7311
+ } catch (error) {
7312
+ reject(error);
7313
+ return;
7314
+ }
7315
+ if (info.done) resolve(value);
7316
+ else Promise.resolve(value).then(_next, _throw);
7317
+ }
7318
+ function _async_to_generator$e(fn) {
7319
+ return function() {
7320
+ var self = this, args = arguments;
7321
+ return new Promise(function(resolve, reject) {
7322
+ var gen = fn.apply(self, args);
7323
+ function _next(value) {
7324
+ asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
7325
+ }
7326
+ function _throw(err) {
7327
+ asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
7328
+ }
7329
+ _next(undefined);
7330
+ });
7331
+ };
7332
+ }
7333
+ function _class_call_check$k(instance, Constructor) {
7334
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
7335
+ }
7336
+ function _defineProperties$e(target, props) {
7337
+ for(var i = 0; i < props.length; i++){
7338
+ var descriptor = props[i];
7339
+ descriptor.enumerable = descriptor.enumerable || false;
7340
+ descriptor.configurable = true;
7341
+ if ("value" in descriptor) descriptor.writable = true;
7342
+ Object.defineProperty(target, descriptor.key, descriptor);
7343
+ }
7344
+ }
7345
+ function _create_class$e(Constructor, protoProps, staticProps) {
7346
+ if (protoProps) _defineProperties$e(Constructor.prototype, protoProps);
7347
+ return Constructor;
7348
+ }
7349
+ function _define_property$s(obj, key, value) {
7350
+ if (key in obj) {
7351
+ Object.defineProperty(obj, key, {
7352
+ value: value,
7353
+ enumerable: true,
7354
+ configurable: true,
7355
+ writable: true
7356
+ });
7357
+ } else obj[key] = value;
7358
+ return obj;
7359
+ }
7360
+ function _ts_generator$e(thisArg, body) {
7361
+ var f, y, t, _ = {
7362
+ label: 0,
7363
+ sent: function() {
7364
+ if (t[0] & 1) throw t[1];
7365
+ return t[1];
7366
+ },
7367
+ trys: [],
7368
+ ops: []
7369
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
7370
+ return d(g, "next", {
7371
+ value: verb(0)
7372
+ }), d(g, "throw", {
7373
+ value: verb(1)
7374
+ }), d(g, "return", {
7375
+ value: verb(2)
7376
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
7377
+ value: function() {
7378
+ return this;
7379
+ }
7380
+ }), g;
7381
+ function verb(n) {
7382
+ return function(v) {
7383
+ return step([
7384
+ n,
7385
+ v
7386
+ ]);
7387
+ };
7388
+ }
7389
+ function step(op) {
7390
+ if (f) throw new TypeError("Generator is already executing.");
7391
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
7392
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7393
+ if (y = 0, t) op = [
7394
+ op[0] & 2,
7395
+ t.value
7396
+ ];
7397
+ switch(op[0]){
7398
+ case 0:
7399
+ case 1:
7400
+ t = op;
7401
+ break;
7402
+ case 4:
7403
+ _.label++;
7404
+ return {
7405
+ value: op[1],
7406
+ done: false
7407
+ };
7408
+ case 5:
7409
+ _.label++;
7410
+ y = op[1];
7411
+ op = [
7412
+ 0
7413
+ ];
7414
+ continue;
7415
+ case 7:
7416
+ op = _.ops.pop();
7417
+ _.trys.pop();
7418
+ continue;
7419
+ default:
7420
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
7421
+ _ = 0;
7422
+ continue;
7423
+ }
7424
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
7425
+ _.label = op[1];
7426
+ break;
7427
+ }
7428
+ if (op[0] === 6 && _.label < t[1]) {
7429
+ _.label = t[1];
7430
+ t = op;
7431
+ break;
7432
+ }
7433
+ if (t && _.label < t[2]) {
7434
+ _.label = t[2];
7435
+ _.ops.push(op);
7436
+ break;
7437
+ }
7438
+ if (t[2]) _.ops.pop();
7439
+ _.trys.pop();
7440
+ continue;
7441
+ }
7442
+ op = body.call(thisArg, _);
7443
+ } catch (e) {
7444
+ op = [
7445
+ 6,
7446
+ e
7447
+ ];
7448
+ y = 0;
7449
+ } finally{
7450
+ f = t = 0;
7451
+ }
7452
+ if (op[0] & 5) throw op[1];
7453
+ return {
7454
+ value: op[0] ? op[1] : void 0,
7455
+ done: true
7456
+ };
7457
+ }
7458
+ }
7459
+ var DownloadApiService_1;
7460
+ // MARK: Errors
7461
+ /**
7462
+ * Error code returned when the `asset` token is missing, malformed, or not a valid download token.
7463
+ */ var DOWNLOAD_INVALID_TOKEN_ERROR_CODE = 'DOWNLOAD_INVALID_TOKEN_ERROR';
7464
+ /**
7465
+ * Error code returned when the token verifies but names nothing servable — a missing file, a
7466
+ * directory, or anything that fails containment. Deliberately one code for all three so the endpoint
7467
+ * does not report whether a given path exists outside the secure root.
7468
+ */ var DOWNLOAD_ASSET_NOT_FOUND_ERROR_CODE = 'DOWNLOAD_ASSET_NOT_FOUND_ERROR';
7469
+ /**
7470
+ * Error code returned when minting is asked for an asset that is not inside the secure root.
7471
+ */ var DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE = 'DOWNLOAD_ASSET_NOT_MINTABLE_ERROR';
7472
+ // MARK: Service
7473
+ /**
7474
+ * Mints and resolves signed, self-authenticating asset-download URLs.
7475
+ *
7476
+ * A minted URL is a capability: anything holding it can fetch exactly one file until it expires. The
7477
+ * downloadable set is ONE folder (the app's configured secure root) and the containment check in
7478
+ * `resolveSecureAssetPath` runs on BOTH sides — refusing to sign a token for anything outside the
7479
+ * root, and refusing to serve one even if a signed token somehow names an outside path.
7480
+ *
7481
+ * The token is signed with the OIDC provider's own JWKS through an app-supplied
7482
+ * {@link DownloadTokenSigner}, so it needs no new secret and rotates with the provider's keys. Its
7483
+ * `typ` (`dbx-dl+jwt`) and `aud` (`dbx:asset-download`) are load-bearing discriminators: the bearer
7484
+ * middleware must never accept a download token, and this verifier must never accept an access token.
7485
+ */ var DownloadApiService = DownloadApiService_1 = /*#__PURE__*/ function() {
7486
+ function DownloadApiService(config, signer) {
7487
+ _class_call_check$k(this, DownloadApiService);
7488
+ _define_property$s(this, "config", void 0);
7489
+ _define_property$s(this, "signer", void 0);
7490
+ _define_property$s(this, "_logger", new Logger(DownloadApiService_1.name));
7491
+ this.config = config;
7492
+ this.signer = signer;
7493
+ if (!(config === null || config === void 0 ? void 0 : config.secureAssetsRoot)) {
7494
+ this._logger.warn("No DownloadApiModuleConfig.secureAssetsRoot configured — ".concat(DOWNLOAD_API_PATH, " will refuse every request."));
7495
+ }
7496
+ if (!signer) {
7497
+ this._logger.warn("No ".concat(DOWNLOAD_TOKEN_SIGNER, " provided — ").concat(DOWNLOAD_API_PATH, " will refuse every request."));
7498
+ }
7499
+ }
7500
+ _create_class$e(DownloadApiService, [
7501
+ {
7502
+ key: "enabled",
7503
+ get: /**
7504
+ * Whether the download path is usable at all (a signer AND a secure root are configured).
7505
+ */ function get() {
7506
+ var _this_config;
7507
+ return this.signer != null && ((_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.secureAssetsRoot) != null;
7508
+ }
7509
+ },
7510
+ {
7511
+ key: "downloadUrlForAsset",
7512
+ value: /**
7513
+ * Mints a signed, self-authenticating URL for one asset inside the secure root.
7514
+ *
7515
+ * @param input - The asset path, optional TTL, and the minting caller's uid (for the audit log only).
7516
+ * @returns The absolute URL, its expiry, and the artifact's SHA-256 + size.
7517
+ * @throws {HttpsError} A `400` when the path is not a servable file inside the secure root, or when the endpoint is not configured.
7518
+ */ function downloadUrlForAsset(input) {
7519
+ return _async_to_generator$e(function() {
7520
+ var _input_forUid, _this_config, _this_config1, _this_config2, signer, secureRoot, apiBaseUrl, absolutePath, ttlSeconds, signed, url, stats, sha256;
7521
+ return _ts_generator$e(this, function(_state) {
7522
+ switch(_state.label){
7523
+ case 0:
7524
+ signer = this.signer;
7525
+ secureRoot = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.secureAssetsRoot;
7526
+ apiBaseUrl = (_this_config1 = this.config) === null || _this_config1 === void 0 ? void 0 : _this_config1.apiBaseUrl;
7527
+ if (signer == null || secureRoot == null || !apiBaseUrl) {
7528
+ throw badRequestError({
7529
+ status: 400,
7530
+ code: DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE,
7531
+ message: 'Signed asset downloads are not configured for this app.'
7532
+ });
7533
+ }
7534
+ // refuse to SIGN for anything outside the root: a leaked minting call must not become a leak of
7535
+ // the filesystem
7536
+ absolutePath = resolveSecureAssetPath(secureRoot, input.path);
7537
+ if (absolutePath == null) {
7538
+ throw badRequestError({
7539
+ status: 400,
7540
+ code: DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE,
7541
+ message: 'No downloadable asset named "'.concat(input.path, '".')
7542
+ });
7543
+ }
7544
+ ttlSeconds = downloadTokenTtlSeconds(input.ttlSeconds, (_this_config2 = this.config) === null || _this_config2 === void 0 ? void 0 : _this_config2.defaultTtlSeconds);
7545
+ return [
7546
+ 4,
7547
+ signer.signToken({
7548
+ claims: _define_property$s({}, DOWNLOAD_TOKEN_PATH_CLAIM, input.path),
7549
+ audience: DOWNLOAD_TOKEN_AUDIENCE,
7550
+ subject: DOWNLOAD_TOKEN_SUBJECT,
7551
+ typ: DOWNLOAD_TOKEN_TYP,
7552
+ expiresIn: ttlSeconds
7553
+ })
7554
+ ];
7555
+ case 1:
7556
+ signed = _state.sent();
7557
+ url = "".concat(apiBaseUrl.replace(/\/+$/, '')).concat(DOWNLOAD_API_PATH, "?").concat(DOWNLOAD_API_ASSET_QUERY_PARAM, "=").concat(encodeURIComponent(signed.token));
7558
+ stats = statSync(absolutePath);
7559
+ sha256 = sha256ForFile(absolutePath);
7560
+ this._logger.log('Minted asset download URL: asset="'.concat(input.path, '" uid=').concat((_input_forUid = input.forUid) !== null && _input_forUid !== void 0 ? _input_forUid : 'unknown', " ttl=").concat(ttlSeconds, "s sha256=").concat(sha256));
7561
+ return [
7562
+ 2,
7563
+ {
7564
+ url: url,
7565
+ expiresAt: signed.expiresAt.toISOString(),
7566
+ sha256: sha256,
7567
+ size: stats.size
7568
+ }
7569
+ ];
7570
+ }
7571
+ });
7572
+ }).call(this);
7573
+ }
7574
+ },
7575
+ {
7576
+ key: "resolveDownloadRequest",
7577
+ value: /**
7578
+ * Verifies a download token and resolves the asset it names, re-running containment.
7579
+ *
7580
+ * @param rawToken - The raw `asset` query parameter.
7581
+ * @returns The resolved asset, ready to stream.
7582
+ * @throws {HttpsError} A `401` for a missing/invalid/expired token, or a `404` for anything not servable.
7583
+ */ function resolveDownloadRequest(rawToken) {
7584
+ return _async_to_generator$e(function() {
7585
+ var _claims_jti, _this_config, signer, secureRoot, claims, relativePath, absolutePath, _claims_jti1, stats;
7586
+ return _ts_generator$e(this, function(_state) {
7587
+ switch(_state.label){
7588
+ case 0:
7589
+ signer = this.signer;
7590
+ secureRoot = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.secureAssetsRoot;
7591
+ if (signer == null || secureRoot == null) {
7592
+ // fail CLOSED when unconfigured — a 404, not a 500, so an unconfigured deploy is indistinguishable
7593
+ // from a deploy that simply has no such asset
7594
+ throw this._notFoundError();
7595
+ }
7596
+ if (!rawToken) {
7597
+ throw this._invalidTokenError();
7598
+ }
7599
+ return [
7600
+ 4,
7601
+ signer.verifyToken({
7602
+ token: rawToken,
7603
+ audience: DOWNLOAD_TOKEN_AUDIENCE,
7604
+ typ: DOWNLOAD_TOKEN_TYP
7605
+ })
7606
+ ];
7607
+ case 1:
7608
+ claims = _state.sent();
7609
+ if (claims == null) {
7610
+ throw this._invalidTokenError();
7611
+ }
7612
+ relativePath = claims[DOWNLOAD_TOKEN_PATH_CLAIM];
7613
+ // NEVER trust the token's path just because the signature verified — the same containment check
7614
+ // the mint ran, run again, so a bug on the minting side cannot become an arbitrary read
7615
+ absolutePath = typeof relativePath === 'string' ? resolveSecureAssetPath(secureRoot, relativePath) : undefined;
7616
+ if (absolutePath == null) {
7617
+ this._logger.warn("Rejected asset download for a non-contained path: jti=".concat(String((_claims_jti1 = claims['jti']) !== null && _claims_jti1 !== void 0 ? _claims_jti1 : 'unknown')));
7618
+ throw this._notFoundError();
7619
+ }
7620
+ stats = statSync(absolutePath);
7621
+ this._logger.log('Serving asset download: asset="'.concat(relativePath, '" jti=').concat(String((_claims_jti = claims['jti']) !== null && _claims_jti !== void 0 ? _claims_jti : 'unknown'), " bytes=").concat(stats.size));
7622
+ return [
7623
+ 2,
7624
+ {
7625
+ absolutePath: absolutePath,
7626
+ fileName: path.basename(absolutePath),
7627
+ contentType: downloadContentTypeForPath(absolutePath),
7628
+ size: stats.size,
7629
+ stream: function stream() {
7630
+ return createReadStream(absolutePath);
7631
+ }
7632
+ }
7633
+ ];
7634
+ }
7635
+ });
7636
+ }).call(this);
7637
+ }
7638
+ },
7639
+ {
7640
+ // never echo the token back in an error body
7641
+ key: "_invalidTokenError",
7642
+ value: function _invalidTokenError() {
7643
+ return unauthenticatedError({
7644
+ status: 401,
7645
+ code: DOWNLOAD_INVALID_TOKEN_ERROR_CODE,
7646
+ message: 'The download link is invalid or has expired.'
7647
+ });
7648
+ }
7649
+ },
7650
+ {
7651
+ key: "_notFoundError",
7652
+ value: function _notFoundError() {
7653
+ return notFoundError({
7654
+ status: 404,
7655
+ code: DOWNLOAD_ASSET_NOT_FOUND_ERROR_CODE,
7656
+ message: 'The requested asset is not available.'
7657
+ });
7658
+ }
7659
+ }
7660
+ ]);
7661
+ return DownloadApiService;
7662
+ }();
7663
+ DownloadApiService = DownloadApiService_1 = __decorate([
7664
+ Injectable(),
7665
+ __param(0, Optional()),
7666
+ __param(0, Inject(DownloadApiModuleConfig)),
7667
+ __param(1, Optional()),
7668
+ __param(1, Inject(DOWNLOAD_TOKEN_SIGNER))
7669
+ ], DownloadApiService);
7670
+ /**
7671
+ * Computes the SHA-256 of a file, hex-encoded.
7672
+ *
7673
+ * Read fully into memory rather than streamed: the secure root holds build artifacts in the tens of
7674
+ * megabytes at most, and the hash is only computed at mint time (not per download).
7675
+ *
7676
+ * @param absolutePath - The absolute path to hash.
7677
+ * @returns The lowercase hex digest.
7678
+ */ function sha256ForFile(absolutePath) {
7679
+ return createHash('sha256').update(readFileSync(absolutePath)).digest('hex');
7680
+ }
7681
+
7682
+ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
7683
+ try {
7684
+ var info = gen[key](arg);
7685
+ var value = info.value;
7686
+ } catch (error) {
7687
+ reject(error);
7688
+ return;
7689
+ }
7690
+ if (info.done) resolve(value);
7691
+ else Promise.resolve(value).then(_next, _throw);
7692
+ }
7693
+ function _async_to_generator$d(fn) {
7694
+ return function() {
7695
+ var self = this, args = arguments;
7696
+ return new Promise(function(resolve, reject) {
7697
+ var gen = fn.apply(self, args);
7698
+ function _next(value) {
7699
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
7700
+ }
7701
+ function _throw(err) {
7702
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
7703
+ }
7704
+ _next(undefined);
7705
+ });
7706
+ };
7707
+ }
7708
+ function _class_call_check$j(instance, Constructor) {
7709
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
7710
+ }
7711
+ function _defineProperties$d(target, props) {
7712
+ for(var i = 0; i < props.length; i++){
7713
+ var descriptor = props[i];
7714
+ descriptor.enumerable = descriptor.enumerable || false;
7715
+ descriptor.configurable = true;
7716
+ if ("value" in descriptor) descriptor.writable = true;
7717
+ Object.defineProperty(target, descriptor.key, descriptor);
7718
+ }
7719
+ }
7720
+ function _create_class$d(Constructor, protoProps, staticProps) {
7721
+ if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
7722
+ return Constructor;
7723
+ }
7724
+ function _define_property$r(obj, key, value) {
7725
+ if (key in obj) {
7726
+ Object.defineProperty(obj, key, {
7727
+ value: value,
7728
+ enumerable: true,
7729
+ configurable: true,
7730
+ writable: true
7731
+ });
7732
+ } else obj[key] = value;
7733
+ return obj;
7734
+ }
7735
+ function _instanceof$4(left, right) {
7736
+ "@swc/helpers - instanceof";
7737
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
7738
+ return !!right[Symbol.hasInstance](left);
7739
+ } else return left instanceof right;
7740
+ }
7741
+ function _ts_generator$d(thisArg, body) {
7742
+ var f, y, t, _ = {
7743
+ label: 0,
7744
+ sent: function() {
7745
+ if (t[0] & 1) throw t[1];
7746
+ return t[1];
7747
+ },
7748
+ trys: [],
7749
+ ops: []
7750
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
7751
+ return d(g, "next", {
7752
+ value: verb(0)
7753
+ }), d(g, "throw", {
7754
+ value: verb(1)
7755
+ }), d(g, "return", {
7756
+ value: verb(2)
7757
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
7758
+ value: function() {
7759
+ return this;
7760
+ }
7761
+ }), g;
7762
+ function verb(n) {
7763
+ return function(v) {
7764
+ return step([
7765
+ n,
7766
+ v
7767
+ ]);
7768
+ };
7769
+ }
7770
+ function step(op) {
7771
+ if (f) throw new TypeError("Generator is already executing.");
7772
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
7773
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7774
+ if (y = 0, t) op = [
7775
+ op[0] & 2,
7776
+ t.value
7777
+ ];
7778
+ switch(op[0]){
7779
+ case 0:
7780
+ case 1:
7781
+ t = op;
7782
+ break;
7783
+ case 4:
7784
+ _.label++;
7785
+ return {
7786
+ value: op[1],
7787
+ done: false
7788
+ };
7789
+ case 5:
7790
+ _.label++;
7791
+ y = op[1];
7792
+ op = [
7793
+ 0
7794
+ ];
7795
+ continue;
7796
+ case 7:
7797
+ op = _.ops.pop();
7798
+ _.trys.pop();
7799
+ continue;
7800
+ default:
7801
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
7802
+ _ = 0;
7803
+ continue;
7804
+ }
7805
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
7806
+ _.label = op[1];
7807
+ break;
7808
+ }
7809
+ if (op[0] === 6 && _.label < t[1]) {
7810
+ _.label = t[1];
7811
+ t = op;
7812
+ break;
7813
+ }
7814
+ if (t && _.label < t[2]) {
7815
+ _.label = t[2];
7816
+ _.ops.push(op);
7817
+ break;
7818
+ }
7819
+ if (t[2]) _.ops.pop();
7820
+ _.trys.pop();
7821
+ continue;
7822
+ }
7823
+ op = body.call(thisArg, _);
7824
+ } catch (e) {
7825
+ op = [
7826
+ 6,
7827
+ e
7828
+ ];
7829
+ y = 0;
7830
+ } finally{
7831
+ f = t = 0;
7832
+ }
7833
+ if (op[0] & 5) throw op[1];
7834
+ return {
7835
+ value: op[0] ? op[1] : void 0,
7836
+ done: true
7837
+ };
7838
+ }
7839
+ }
7840
+ /**
7841
+ * REST controller that streams one registered asset to whoever holds a valid signed URL.
7842
+ *
7843
+ * Mounted at `download` — under the `/api` global prefix the route becomes `GET /api/download`.
7844
+ *
7845
+ * `/api/download` must **NOT** be listed in the OIDC module's `protectedPaths`: it authenticates via
7846
+ * the signed `asset` query parameter, and a bearer middleware in front of it would 401 exactly the
7847
+ * callers the feature exists for (a bare machine that has no credential yet — obtaining one is the
7848
+ * whole point). Do not "fix" that by adding it.
7849
+ *
7850
+ * Follows `McpController`'s `@Res()` style; there is no `StreamableFile` precedent in this repo.
7851
+ */ var DownloadApiController = /*#__PURE__*/ function() {
7852
+ function DownloadApiController(downloadService) {
7853
+ _class_call_check$j(this, DownloadApiController);
7854
+ _define_property$r(this, "downloadService", void 0);
7855
+ this.downloadService = downloadService;
7856
+ }
7857
+ _create_class$d(DownloadApiController, [
7858
+ {
7859
+ key: "downloadAsset",
7860
+ value: /**
7861
+ * Streams the asset named by a signed capability token.
7862
+ *
7863
+ * @param asset - The signed token from the `asset` query parameter.
7864
+ * @param res - The Express response the file is streamed to.
7865
+ */ function downloadAsset(asset, res) {
7866
+ return _async_to_generator$d(function() {
7867
+ var resolved, error, stream;
7868
+ return _ts_generator$d(this, function(_state) {
7869
+ switch(_state.label){
7870
+ case 0:
7871
+ _state.trys.push([
7872
+ 0,
7873
+ 2,
7874
+ ,
7875
+ 3
7876
+ ]);
7877
+ return [
7878
+ 4,
7879
+ this.downloadService.resolveDownloadRequest(asset)
7880
+ ];
7881
+ case 1:
7882
+ resolved = _state.sent();
7883
+ return [
7884
+ 3,
7885
+ 3
7886
+ ];
7887
+ case 2:
7888
+ error = _state.sent();
7889
+ throw toDownloadHttpException(error);
7890
+ case 3:
7891
+ res.setHeader('Content-Type', resolved.contentType);
7892
+ res.setHeader('Content-Length', String(resolved.size));
7893
+ res.setHeader('Content-Disposition', 'attachment; filename="'.concat(resolved.fileName.replaceAll('"', ''), '"'));
7894
+ // a capability URL's response is nobody's to cache
7895
+ res.setHeader('Cache-Control', 'private, no-store');
7896
+ stream = resolved.stream();
7897
+ return [
7898
+ 4,
7899
+ new Promise(function(resolve, reject) {
7900
+ stream.on('error', reject);
7901
+ stream.on('end', resolve);
7902
+ stream.pipe(res);
7903
+ })
7904
+ ];
7905
+ case 4:
7906
+ _state.sent();
7907
+ return [
7908
+ 2
7909
+ ];
7910
+ }
7911
+ });
7912
+ }).call(this);
7913
+ }
7914
+ }
7915
+ ]);
7916
+ return DownloadApiController;
7917
+ }();
7918
+ __decorate([
7919
+ Get(),
7920
+ __param(0, Query(DOWNLOAD_API_ASSET_QUERY_PARAM)),
7921
+ __param(1, Res())
7922
+ ], DownloadApiController.prototype, "downloadAsset", null);
7923
+ DownloadApiController = __decorate([
7924
+ Controller(DOWNLOAD_API_ROUTE_PREFIX),
7925
+ __param(0, Inject(DownloadApiService))
7926
+ ], DownloadApiController);
7927
+ /**
7928
+ * Converts a thrown `HttpsError` into the `{ statusCode, message, code }` envelope the other API
7929
+ * controllers emit, preserving the specific code that `HttpsError` buries under `details`.
7930
+ *
7931
+ * The token is never echoed back — an error body carrying it would put a live capability into logs.
7932
+ *
7933
+ * @param error - The thrown value.
7934
+ * @returns The Nest exception to throw.
7935
+ */ function toDownloadHttpException(error) {
7936
+ var result;
7937
+ if (_instanceof$4(error, HttpException)) {
7938
+ result = error;
7939
+ } else {
7940
+ var _ref, _ref1, _ref2, _ref3;
7941
+ var _error_httpErrorCode, _error_details;
7942
+ 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;
7943
+ var message = (_ref2 = error === null || error === void 0 ? void 0 : error.message) !== null && _ref2 !== void 0 ? _ref2 : 'Internal server error';
7944
+ var code = (_ref3 = error === null || error === void 0 ? void 0 : (_error_details = error.details) === null || _error_details === void 0 ? void 0 : _error_details.code) !== null && _ref3 !== void 0 ? _ref3 : error === null || error === void 0 ? void 0 : error.code;
7945
+ result = new HttpException({
7946
+ statusCode: status,
7947
+ message: message,
7948
+ code: code
7949
+ }, status);
7950
+ }
7951
+ return result;
7952
+ }
7953
+
7954
+ function _array_like_to_array$b(arr, len) {
7955
+ if (len == null || len > arr.length) len = arr.length;
7956
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7957
+ return arr2;
7958
+ }
7959
+ function _array_without_holes$8(arr) {
7960
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
7961
+ }
7962
+ function _iterable_to_array$8(iter) {
7963
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
7964
+ return Array.from(iter);
7965
+ }
7966
+ }
7967
+ function _non_iterable_spread$8() {
7968
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7969
+ }
7970
+ function _to_consumable_array$8(arr) {
7971
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$8();
7972
+ }
7973
+ function _unsupported_iterable_to_array$b(o, minLen) {
7974
+ if (!o) return;
7975
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
7976
+ var n = Object.prototype.toString.call(o).slice(8, -1);
7977
+ if (n === "Object" && o.constructor) n = o.constructor.name;
7978
+ if (n === "Map" || n === "Set") return Array.from(n);
7979
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
7980
+ }
7981
+ // MARK: Module Metadata
7982
+ /**
7983
+ * Generates NestJS module metadata for the signed asset-download API.
7984
+ *
7985
+ * Mirrors `sessionApiModuleMetadata`: the consumer provides a dependency module exposing the
7986
+ * required tokens and this factory wires the controller + service.
7987
+ *
7988
+ * Do NOT add `'/api/download'` to the OIDC module's `protectedPaths` — the route authenticates via
7989
+ * its signed `asset` query parameter, and a bearer middleware would 401 the very callers it exists
7990
+ * for.
7991
+ *
7992
+ * @param metadataConfig - Configuration including the dependency module.
7993
+ * @returns NestJS module metadata exposing the download controller + service.
7994
+ *
7995
+ * @example
7996
+ * ```typescript
7997
+ * @Module({
7998
+ * imports: [MyOidcModule],
7999
+ * providers: [
8000
+ * { provide: DownloadApiModuleConfig, useValue: { secureAssetsRoot, apiBaseUrl } },
8001
+ * { provide: DOWNLOAD_TOKEN_SIGNER, useFactory: oidcDownloadTokenSignerFactory, inject: [OidcJwtSigningService] }
8002
+ * ],
8003
+ * exports: [DownloadApiModuleConfig, DOWNLOAD_TOKEN_SIGNER]
8004
+ * })
8005
+ * export class MyDownloadDependencyModule {}
8006
+ *
8007
+ * @Module(downloadApiModuleMetadata({ dependencyModule: MyDownloadDependencyModule }))
8008
+ * export class MyDownloadApiModule {}
8009
+ * ```
8010
+ */ function downloadApiModuleMetadata(metadataConfig) {
8011
+ var dependencyModule = metadataConfig.dependencyModule, imports = metadataConfig.imports, exports = metadataConfig.exports, providers = metadataConfig.providers;
8012
+ return {
8013
+ imports: [
8014
+ dependencyModule
8015
+ ].concat(_to_consumable_array$8(imports !== null && imports !== void 0 ? imports : [])),
8016
+ controllers: [
8017
+ DownloadApiController
8018
+ ],
8019
+ exports: [
8020
+ DownloadApiService
8021
+ ].concat(_to_consumable_array$8(exports !== null && exports !== void 0 ? exports : [])),
8022
+ providers: [
8023
+ DownloadApiService
8024
+ ].concat(_to_consumable_array$8(providers !== null && providers !== void 0 ? providers : []))
8025
+ };
8026
+ }
8027
+
7050
8028
  // MARK: Scope Reading
7051
8029
  /**
7052
8030
  * Reads the set of OIDC scopes carried by a model-api request's auth, or `undefined` for a non-OIDC
@@ -14231,4 +15209,4 @@ function _define_property(obj, key, value) {
14231
15209
  }
14232
15210
  ();
14233
15211
 
14234
- export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE, DEFAULT_RESET_CODE_EXPIRES_IN, DEFAULT_RESET_COM_THROTTLE_TIME, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_SESSION_API_PROTECTED_PATH, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FIRESTORE_SESSION_ADMIN_PREDICATE, FIRESTORE_SESSION_API_PATH, FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthPasswordResetInvalidCodeError, FirebaseServerAuthPasswordResetNoResetConfigError, FirebaseServerAuthPasswordResetSendOnceError, FirebaseServerAuthPasswordResetThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, FirestoreSessionApiService, GlobalRoutePrefixConfig, MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE, MODEL_API_NEST_APPLICATION_CONTEXT, MODEL_IS_SERVER_ONLY_ERROR_CODE, ModelApiCallModelDispatchService, ModelApiController, ModelApiDispatchConfig, ModelApiGetService, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoContentFirebaseServerUserPasswordResetService, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SESSION_API_ROUTE_PREFIX, SessionApiController, SessionApiModuleConfig, SkipAppCheck, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertEndpointOidcScope, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertModelApiOidcScope, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, authServicePasswordResetInvalidCodeError, authServicePasswordResetNoConfigError, authServicePasswordResetSendOnceError, authServicePasswordResetThrottleError, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, catchAndThrowPasswordResetServerErrors, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, encodeFirebaseServerUserPasswordResetOobCode, executeOnCallQuery, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerFirestoreContextModuleMetadata, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, firestoreSessionAppCheckTtlMillis, 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, invokeModelUnknownModelTypeError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelAccessRoleMapResultFromGrantedRoles, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, notFoundError, oidcScopesFromModelApiAuth, oidcScopesFromRequestAuth, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallInvokeModel, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallQueryModel, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, queryModelBadCursorError, queryModelUnknownModelTypeError, readApiDetails, readModelUnknownModelTypeError, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, sessionApiModuleMetadata, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
15212
+ export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_DOWNLOAD_CONTENT_TYPE, DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE, DEFAULT_RESET_CODE_EXPIRES_IN, DEFAULT_RESET_COM_THROTTLE_TIME, DEFAULT_SECURE_ASSETS_DIRECTORY, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DOWNLOAD_API_ASSET_QUERY_PARAM, DOWNLOAD_API_PATH, DOWNLOAD_API_ROUTE_PREFIX, DOWNLOAD_ASSET_NOT_FOUND_ERROR_CODE, DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE, DOWNLOAD_CONTENT_TYPES, DOWNLOAD_INVALID_TOKEN_ERROR_CODE, DOWNLOAD_TOKEN_AUDIENCE, DOWNLOAD_TOKEN_PATH_CLAIM, DOWNLOAD_TOKEN_SIGNER, DOWNLOAD_TOKEN_SUBJECT, DOWNLOAD_TOKEN_TYP, DefaultFirebaseServerEnvService, DownloadApiController, DownloadApiModuleConfig, DownloadApiService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_SESSION_API_PROTECTED_PATH, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FIRESTORE_SESSION_ADMIN_PREDICATE, FIRESTORE_SESSION_API_PATH, FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE, FORWARDED_FOR_REQUEST_HEADER, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthPasswordResetInvalidCodeError, FirebaseServerAuthPasswordResetNoResetConfigError, FirebaseServerAuthPasswordResetSendOnceError, FirebaseServerAuthPasswordResetThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, FirestoreSessionApiService, GlobalRoutePrefixConfig, MAX_DOWNLOAD_TOKEN_TTL_SECONDS, MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE, MODEL_API_NEST_APPLICATION_CONTEXT, MODEL_IS_SERVER_ONLY_ERROR_CODE, ModelApiCallModelDispatchService, ModelApiController, ModelApiDispatchConfig, ModelApiGetService, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoContentFirebaseServerUserPasswordResetService, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SESSION_API_ROUTE_PREFIX, SessionApiController, SessionApiModuleConfig, SkipAppCheck, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertEndpointOidcScope, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertModelApiOidcScope, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, authServicePasswordResetInvalidCodeError, authServicePasswordResetNoConfigError, authServicePasswordResetSendOnceError, authServicePasswordResetThrottleError, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, catchAndThrowPasswordResetServerErrors, clientIpsMatch, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, downloadApiModuleMetadata, downloadContentTypeForPath, downloadTokenTtlSeconds, encodeFirebaseServerUserPasswordResetOobCode, executeOnCallQuery, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerFirestoreContextModuleMetadata, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, firestoreSessionAppCheckTtlMillis, 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, invokeModelUnknownModelTypeError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isSafeRelativeAssetPath, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelAccessRoleMapResultFromGrantedRoles, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, normalizeClientIp, notFoundError, oidcScopesFromModelApiAuth, oidcScopesFromRequestAuth, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallInvokeModel, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallQueryModel, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, queryModelBadCursorError, queryModelUnknownModelTypeError, readApiDetails, readModelUnknownModelTypeError, requestClientIp, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, resolveSecureAssetPath, sessionApiModuleMetadata, setNestContextOnRequest, setNestContextOnScheduleRequest, sha256ForFile, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };