@dereekb/firebase-server 13.6.10 → 13.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -803,16 +803,16 @@ function _is_native_reflect_construct$5() {
803
803
  }
804
804
  (makeError.BaseError);
805
805
 
806
- function _array_like_to_array$a(arr, len) {
806
+ function _array_like_to_array$b(arr, len) {
807
807
  if (len == null || len > arr.length) len = arr.length;
808
808
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
809
809
  return arr2;
810
810
  }
811
- function _array_with_holes$3(arr) {
811
+ function _array_with_holes$4(arr) {
812
812
  if (Array.isArray(arr)) return arr;
813
813
  }
814
814
  function _array_without_holes$7(arr) {
815
- if (Array.isArray(arr)) return _array_like_to_array$a(arr);
815
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
816
816
  }
817
817
  function _assert_this_initialized$4(self) {
818
818
  if (self === void 0) {
@@ -906,7 +906,7 @@ function _inherits$4(subClass, superClass) {
906
906
  function _iterable_to_array$7(iter) {
907
907
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
908
908
  }
909
- function _iterable_to_array_limit$3(arr, i) {
909
+ function _iterable_to_array_limit$4(arr, i) {
910
910
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
911
911
  if (_i == null) return;
912
912
  var _arr = [];
@@ -930,7 +930,7 @@ function _iterable_to_array_limit$3(arr, i) {
930
930
  }
931
931
  return _arr;
932
932
  }
933
- function _non_iterable_rest$3() {
933
+ function _non_iterable_rest$4() {
934
934
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
935
935
  }
936
936
  function _non_iterable_spread$7() {
@@ -964,23 +964,23 @@ function _set_prototype_of$4(o, p) {
964
964
  };
965
965
  return _set_prototype_of$4(o, p);
966
966
  }
967
- function _sliced_to_array$3(arr, i) {
968
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$3();
967
+ function _sliced_to_array$4(arr, i) {
968
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$4();
969
969
  }
970
970
  function _to_consumable_array$7(arr) {
971
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$7();
971
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$7();
972
972
  }
973
973
  function _type_of$5(obj) {
974
974
  "@swc/helpers - typeof";
975
975
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
976
976
  }
977
- function _unsupported_iterable_to_array$a(o, minLen) {
977
+ function _unsupported_iterable_to_array$b(o, minLen) {
978
978
  if (!o) return;
979
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
979
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
980
980
  var n = Object.prototype.toString.call(o).slice(8, -1);
981
981
  if (n === "Object" && o.constructor) n = o.constructor.name;
982
982
  if (n === "Map" || n === "Set") return Array.from(n);
983
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
983
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
984
984
  }
985
985
  function _is_native_reflect_construct$4() {
986
986
  try {
@@ -1336,7 +1336,7 @@ function _ts_generator$b(thisArg, body) {
1336
1336
  claims = {};
1337
1337
  util.forEachKeyValue(baseClaims, {
1338
1338
  forEach: function forEach(param) {
1339
- var _param = _sliced_to_array$3(param, 1), key = _param[0];
1339
+ var _param = _sliced_to_array$4(param, 1), key = _param[0];
1340
1340
  claims[key] = null; // set null on every key
1341
1341
  },
1342
1342
  filter: util.KeyValueTypleValueFilter.NONE // don't skip any key/value
@@ -2287,13 +2287,13 @@ function _class_call_check$m(instance, Constructor) {
2287
2287
  });
2288
2288
  }
2289
2289
 
2290
- function _array_like_to_array$9(arr, len) {
2290
+ function _array_like_to_array$a(arr, len) {
2291
2291
  if (len == null || len > arr.length) len = arr.length;
2292
2292
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2293
2293
  return arr2;
2294
2294
  }
2295
2295
  function _array_without_holes$6(arr) {
2296
- if (Array.isArray(arr)) return _array_like_to_array$9(arr);
2296
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
2297
2297
  }
2298
2298
  function _define_property$r(obj, key, value) {
2299
2299
  if (key in obj) {
@@ -2330,15 +2330,15 @@ function _object_spread$f(target) {
2330
2330
  return target;
2331
2331
  }
2332
2332
  function _to_consumable_array$6(arr) {
2333
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$6();
2333
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$6();
2334
2334
  }
2335
- function _unsupported_iterable_to_array$9(o, minLen) {
2335
+ function _unsupported_iterable_to_array$a(o, minLen) {
2336
2336
  if (!o) return;
2337
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
2337
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
2338
2338
  var n = Object.prototype.toString.call(o).slice(8, -1);
2339
2339
  if (n === "Object" && o.constructor) n = o.constructor.name;
2340
2340
  if (n === "Map" || n === "Set") return Array.from(n);
2341
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
2341
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
2342
2342
  }
2343
2343
  /**
2344
2344
  * Converts a {@link FirestoreAccessorArrayUpdate} into Firestore {@link UpdateData} using
@@ -2897,12 +2897,12 @@ function _define_property$o(obj, key, value) {
2897
2897
  return new TransactionFirestoreDocumentContext(transaction);
2898
2898
  }
2899
2899
 
2900
- function _array_like_to_array$8(arr, len) {
2900
+ function _array_like_to_array$9(arr, len) {
2901
2901
  if (len == null || len > arr.length) len = arr.length;
2902
2902
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2903
2903
  return arr2;
2904
2904
  }
2905
- function _array_with_holes$2(arr) {
2905
+ function _array_with_holes$3(arr) {
2906
2906
  if (Array.isArray(arr)) return arr;
2907
2907
  }
2908
2908
  function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
@@ -2934,7 +2934,7 @@ function _async_to_generator$a(fn) {
2934
2934
  });
2935
2935
  };
2936
2936
  }
2937
- function _iterable_to_array_limit$2(arr, i) {
2937
+ function _iterable_to_array_limit$3(arr, i) {
2938
2938
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2939
2939
  if (_i == null) return;
2940
2940
  var _arr = [];
@@ -2958,19 +2958,19 @@ function _iterable_to_array_limit$2(arr, i) {
2958
2958
  }
2959
2959
  return _arr;
2960
2960
  }
2961
- function _non_iterable_rest$2() {
2961
+ function _non_iterable_rest$3() {
2962
2962
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2963
2963
  }
2964
- function _sliced_to_array$2(arr, i) {
2965
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$2();
2964
+ function _sliced_to_array$3(arr, i) {
2965
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$3();
2966
2966
  }
2967
- function _unsupported_iterable_to_array$8(o, minLen) {
2967
+ function _unsupported_iterable_to_array$9(o, minLen) {
2968
2968
  if (!o) return;
2969
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
2969
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
2970
2970
  var n = Object.prototype.toString.call(o).slice(8, -1);
2971
2971
  if (n === "Object" && o.constructor) n = o.constructor.name;
2972
2972
  if (n === "Map" || n === "Set") return Array.from(n);
2973
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
2973
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
2974
2974
  }
2975
2975
  function _ts_generator$a(thisArg, body) {
2976
2976
  var f, y, t, _ = {
@@ -3095,7 +3095,7 @@ function _ts_generator$a(thisArg, body) {
3095
3095
  }
3096
3096
  var batches = util.batch(pathSegments, 2); // batch to tuple [string, string]
3097
3097
  batches.forEach(function(x) {
3098
- var _x = _sliced_to_array$2(x, 2), first = _x[0], second = _x[1];
3098
+ var _x = _sliced_to_array$3(x, 2), first = _x[0], second = _x[1];
3099
3099
  ref = ref.doc(first).collection(second);
3100
3100
  });
3101
3101
  }
@@ -3122,7 +3122,7 @@ function _ts_generator$a(thisArg, body) {
3122
3122
  if (pathSegments === null || pathSegments === void 0 ? void 0 : pathSegments.length) {
3123
3123
  var batches = util.batch(pathSegments, 2); // batch to tuple [string, string]
3124
3124
  batches.forEach(function(x) {
3125
- var _x = _sliced_to_array$2(x, 2), first = _x[0], second = _x[1];
3125
+ var _x = _sliced_to_array$3(x, 2), first = _x[0], second = _x[1];
3126
3126
  var collection = doc.collection(first);
3127
3127
  doc = second ? collection.doc(second) : collection.doc();
3128
3128
  });
@@ -3190,13 +3190,13 @@ function _ts_generator$a(thisArg, body) {
3190
3190
  };
3191
3191
  }
3192
3192
 
3193
- function _array_like_to_array$7(arr, len) {
3193
+ function _array_like_to_array$8(arr, len) {
3194
3194
  if (len == null || len > arr.length) len = arr.length;
3195
3195
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3196
3196
  return arr2;
3197
3197
  }
3198
3198
  function _array_without_holes$5(arr) {
3199
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
3199
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
3200
3200
  }
3201
3201
  function _define_property$n(obj, key, value) {
3202
3202
  if (key in obj) {
@@ -3252,15 +3252,15 @@ function _object_spread_props$c(target, source) {
3252
3252
  return target;
3253
3253
  }
3254
3254
  function _to_consumable_array$5(arr) {
3255
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
3255
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$5();
3256
3256
  }
3257
- function _unsupported_iterable_to_array$7(o, minLen) {
3257
+ function _unsupported_iterable_to_array$8(o, minLen) {
3258
3258
  if (!o) return;
3259
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
3259
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
3260
3260
  var n = Object.prototype.toString.call(o).slice(8, -1);
3261
3261
  if (n === "Object" && o.constructor) n = o.constructor.name;
3262
3262
  if (n === "Map" || n === "Set") return Array.from(n);
3263
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
3263
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
3264
3264
  }
3265
3265
  var _builder, _builder1;
3266
3266
  var _obj;
@@ -4236,15 +4236,15 @@ function _ts_generator$8(thisArg, body) {
4236
4236
  })();
4237
4237
  }
4238
4238
 
4239
- function _array_like_to_array$6(arr, len) {
4239
+ function _array_like_to_array$7(arr, len) {
4240
4240
  if (len == null || len > arr.length) len = arr.length;
4241
4241
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4242
4242
  return arr2;
4243
4243
  }
4244
- function _array_with_holes$1(arr) {
4244
+ function _array_with_holes$2(arr) {
4245
4245
  if (Array.isArray(arr)) return arr;
4246
4246
  }
4247
- function _iterable_to_array_limit$1(arr, i) {
4247
+ function _iterable_to_array_limit$2(arr, i) {
4248
4248
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
4249
4249
  if (_i == null) return;
4250
4250
  var _arr = [];
@@ -4268,7 +4268,7 @@ function _iterable_to_array_limit$1(arr, i) {
4268
4268
  }
4269
4269
  return _arr;
4270
4270
  }
4271
- function _non_iterable_rest$1() {
4271
+ function _non_iterable_rest$2() {
4272
4272
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4273
4273
  }
4274
4274
  function _object_without_properties(source, excluded) {
@@ -4307,16 +4307,16 @@ function _object_without_properties_loose(source, excluded) {
4307
4307
  }
4308
4308
  return target;
4309
4309
  }
4310
- function _sliced_to_array$1(arr, i) {
4311
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$1();
4310
+ function _sliced_to_array$2(arr, i) {
4311
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$2();
4312
4312
  }
4313
- function _unsupported_iterable_to_array$6(o, minLen) {
4313
+ function _unsupported_iterable_to_array$7(o, minLen) {
4314
4314
  if (!o) return;
4315
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
4315
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
4316
4316
  var n = Object.prototype.toString.call(o).slice(8, -1);
4317
4317
  if (n === "Object" && o.constructor) n = o.constructor.name;
4318
4318
  if (n === "Map" || n === "Set") return Array.from(n);
4319
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
4319
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
4320
4320
  }
4321
4321
  // MARK: Type Guards
4322
4322
  /**
@@ -4417,7 +4417,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4417
4417
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4418
4418
  try {
4419
4419
  for(var _iterator = Object.entries(config)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4420
- var _step_value = _sliced_to_array$1(_step.value, 2), key = _step_value[0], handler = _step_value[1];
4420
+ var _step_value = _sliced_to_array$2(_step.value, 2), key = _step_value[0], handler = _step_value[1];
4421
4421
  var details = readApiDetails(handler);
4422
4422
  if (details != null) {
4423
4423
  // At the specifier level, details should be handler-level (OnCallModelFunctionApiDetails)
@@ -4457,7 +4457,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4457
4457
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4458
4458
  try {
4459
4459
  for(var _iterator = Object.entries(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4460
- var _step_value = _sliced_to_array$1(_step.value, 2), key = _step_value[0], handler = _step_value[1];
4460
+ var _step_value = _sliced_to_array$2(_step.value, 2), key = _step_value[0], handler = _step_value[1];
4461
4461
  var details = readApiDetails(handler);
4462
4462
  if (details != null) {
4463
4463
  if (isOnCallModelTypeApiDetails(details)) {
@@ -4506,7 +4506,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4506
4506
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4507
4507
  try {
4508
4508
  for(var _iterator = Object.entries(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4509
- var _step_value = _sliced_to_array$1(_step.value, 2), call = _step_value[0], handler = _step_value[1];
4509
+ var _step_value = _sliced_to_array$2(_step.value, 2), call = _step_value[0], handler = _step_value[1];
4510
4510
  var details = readApiDetails(handler);
4511
4511
  if (details != null) {
4512
4512
  result[call] = details;
@@ -4555,14 +4555,14 @@ function _unsupported_iterable_to_array$6(o, minLen) {
4555
4555
  try {
4556
4556
  // Pivot: iterate CRUD types, then model types within each
4557
4557
  for(var _iterator = Object.entries(topDetails)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4558
- var _step_value = _sliced_to_array$1(_step.value, 2), callType = _step_value[0], crudDetails = _step_value[1];
4558
+ var _step_value = _sliced_to_array$2(_step.value, 2), callType = _step_value[0], crudDetails = _step_value[1];
4559
4559
  if (crudDetails == null) {
4560
4560
  continue;
4561
4561
  }
4562
4562
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
4563
4563
  try {
4564
4564
  for(var _iterator1 = Object.entries(crudDetails.modelTypes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
4565
- var _step_value1 = _sliced_to_array$1(_step1.value, 2), modelType = _step_value1[0], modelDetails = _step_value1[1];
4565
+ var _step_value1 = _sliced_to_array$2(_step1.value, 2), modelType = _step_value1[0], modelDetails = _step_value1[1];
4566
4566
  if (modelDetails == null) {
4567
4567
  continue;
4568
4568
  }
@@ -5180,13 +5180,13 @@ function _object_spread_props$b(target, source) {
5180
5180
  }));
5181
5181
  }
5182
5182
 
5183
- function _array_like_to_array$5(arr, len) {
5183
+ function _array_like_to_array$6(arr, len) {
5184
5184
  if (len == null || len > arr.length) len = arr.length;
5185
5185
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5186
5186
  return arr2;
5187
5187
  }
5188
5188
  function _array_without_holes$4(arr) {
5189
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
5189
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
5190
5190
  }
5191
5191
  function _iterable_to_array$4(iter) {
5192
5192
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
@@ -5195,15 +5195,15 @@ function _non_iterable_spread$4() {
5195
5195
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5196
5196
  }
5197
5197
  function _to_consumable_array$4(arr) {
5198
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$4();
5198
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
5199
5199
  }
5200
- function _unsupported_iterable_to_array$5(o, minLen) {
5200
+ function _unsupported_iterable_to_array$6(o, minLen) {
5201
5201
  if (!o) return;
5202
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
5202
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
5203
5203
  var n = Object.prototype.toString.call(o).slice(8, -1);
5204
5204
  if (n === "Object" && o.constructor) n = o.constructor.name;
5205
5205
  if (n === "Map" || n === "Set") return Array.from(n);
5206
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
5206
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
5207
5207
  }
5208
5208
  /**
5209
5209
  * Generates NestJS {@link ModuleMetadata} for an app's analytics module.
@@ -5893,12 +5893,12 @@ function _object_spread_props$8(target, source) {
5893
5893
  });
5894
5894
  }
5895
5895
 
5896
- function _array_like_to_array$4(arr, len) {
5896
+ function _array_like_to_array$5(arr, len) {
5897
5897
  if (len == null || len > arr.length) len = arr.length;
5898
5898
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5899
5899
  return arr2;
5900
5900
  }
5901
- function _array_with_holes(arr) {
5901
+ function _array_with_holes$1(arr) {
5902
5902
  if (Array.isArray(arr)) return arr;
5903
5903
  }
5904
5904
  function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
@@ -5930,7 +5930,7 @@ function _async_to_generator$7(fn) {
5930
5930
  });
5931
5931
  };
5932
5932
  }
5933
- function _iterable_to_array_limit(arr, i) {
5933
+ function _iterable_to_array_limit$1(arr, i) {
5934
5934
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
5935
5935
  if (_i == null) return;
5936
5936
  var _arr = [];
@@ -5954,19 +5954,19 @@ function _iterable_to_array_limit(arr, i) {
5954
5954
  }
5955
5955
  return _arr;
5956
5956
  }
5957
- function _non_iterable_rest() {
5957
+ function _non_iterable_rest$1() {
5958
5958
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5959
5959
  }
5960
- function _sliced_to_array(arr, i) {
5961
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest();
5960
+ function _sliced_to_array$1(arr, i) {
5961
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$1();
5962
5962
  }
5963
- function _unsupported_iterable_to_array$4(o, minLen) {
5963
+ function _unsupported_iterable_to_array$5(o, minLen) {
5964
5964
  if (!o) return;
5965
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
5965
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
5966
5966
  var n = Object.prototype.toString.call(o).slice(8, -1);
5967
5967
  if (n === "Object" && o.constructor) n = o.constructor.name;
5968
5968
  if (n === "Map" || n === "Set") return Array.from(n);
5969
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
5969
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
5970
5970
  }
5971
5971
  function _ts_generator$7(thisArg, body) {
5972
5972
  var f, y, t, _ = {
@@ -6097,7 +6097,7 @@ function _ts_generator$7(thisArg, body) {
6097
6097
  var result = [];
6098
6098
  util.forEachKeyValue(allScheduledFunctions, {
6099
6099
  forEach: function forEach(x) {
6100
- var _x = _sliced_to_array(x, 1), functionName = _x[0];
6100
+ var _x = _sliced_to_array$1(x, 1), functionName = _x[0];
6101
6101
  result.push({
6102
6102
  name: functionName.toString()
6103
6103
  });
@@ -6573,13 +6573,13 @@ exports.DefaultFirebaseServerEnvService = __decorate([
6573
6573
  };
6574
6574
  }
6575
6575
 
6576
- function _array_like_to_array$3(arr, len) {
6576
+ function _array_like_to_array$4(arr, len) {
6577
6577
  if (len == null || len > arr.length) len = arr.length;
6578
6578
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6579
6579
  return arr2;
6580
6580
  }
6581
6581
  function _array_without_holes$3(arr) {
6582
- if (Array.isArray(arr)) return _array_like_to_array$3(arr);
6582
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
6583
6583
  }
6584
6584
  function _class_call_check$b(instance, Constructor) {
6585
6585
  if (!(instance instanceof Constructor)) {
@@ -6593,15 +6593,15 @@ function _non_iterable_spread$3() {
6593
6593
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6594
6594
  }
6595
6595
  function _to_consumable_array$3(arr) {
6596
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$3();
6596
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$3();
6597
6597
  }
6598
- function _unsupported_iterable_to_array$3(o, minLen) {
6598
+ function _unsupported_iterable_to_array$4(o, minLen) {
6599
6599
  if (!o) return;
6600
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
6600
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
6601
6601
  var n = Object.prototype.toString.call(o).slice(8, -1);
6602
6602
  if (n === "Object" && o.constructor) n = o.constructor.name;
6603
6603
  if (n === "Map" || n === "Set") return Array.from(n);
6604
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
6604
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
6605
6605
  }
6606
6606
  // MARK: Tokens
6607
6607
  /**
@@ -7931,13 +7931,13 @@ exports.FirebaseAppCheckMiddleware = __decorate([
7931
7931
  })();
7932
7932
  }
7933
7933
 
7934
- function _array_like_to_array$2(arr, len) {
7934
+ function _array_like_to_array$3(arr, len) {
7935
7935
  if (len == null || len > arr.length) len = arr.length;
7936
7936
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7937
7937
  return arr2;
7938
7938
  }
7939
7939
  function _array_without_holes$2(arr) {
7940
- if (Array.isArray(arr)) return _array_like_to_array$2(arr);
7940
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
7941
7941
  }
7942
7942
  function _class_call_check$7(instance, Constructor) {
7943
7943
  if (!(instance instanceof Constructor)) {
@@ -7977,15 +7977,15 @@ function _non_iterable_spread$2() {
7977
7977
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7978
7978
  }
7979
7979
  function _to_consumable_array$2(arr) {
7980
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
7980
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$2();
7981
7981
  }
7982
- function _unsupported_iterable_to_array$2(o, minLen) {
7982
+ function _unsupported_iterable_to_array$3(o, minLen) {
7983
7983
  if (!o) return;
7984
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
7984
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
7985
7985
  var n = Object.prototype.toString.call(o).slice(8, -1);
7986
7986
  if (n === "Object" && o.constructor) n = o.constructor.name;
7987
7987
  if (n === "Map" || n === "Set") return Array.from(n);
7988
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
7988
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
7989
7989
  }
7990
7990
  /**
7991
7991
  * Middleware module that configures `FirebaseAppCheckMiddleware` route coverage
@@ -9105,13 +9105,13 @@ function _define_property$4(obj, key, value) {
9105
9105
  return storage.storageClient;
9106
9106
  }
9107
9107
 
9108
- function _array_like_to_array$1(arr, len) {
9108
+ function _array_like_to_array$2(arr, len) {
9109
9109
  if (len == null || len > arr.length) len = arr.length;
9110
9110
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9111
9111
  return arr2;
9112
9112
  }
9113
9113
  function _array_without_holes$1(arr) {
9114
- if (Array.isArray(arr)) return _array_like_to_array$1(arr);
9114
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
9115
9115
  }
9116
9116
  function _class_call_check$3(instance, Constructor) {
9117
9117
  if (!(instance instanceof Constructor)) {
@@ -9172,15 +9172,15 @@ function _object_spread_props$1(target, source) {
9172
9172
  return target;
9173
9173
  }
9174
9174
  function _to_consumable_array$1(arr) {
9175
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
9175
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$1();
9176
9176
  }
9177
- function _unsupported_iterable_to_array$1(o, minLen) {
9177
+ function _unsupported_iterable_to_array$2(o, minLen) {
9178
9178
  if (!o) return;
9179
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
9179
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
9180
9180
  var n = Object.prototype.toString.call(o).slice(8, -1);
9181
9181
  if (n === "Object" && o.constructor) n = o.constructor.name;
9182
9182
  if (n === "Map" || n === "Set") return Array.from(n);
9183
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
9183
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
9184
9184
  }
9185
9185
  // MARK: Tokens
9186
9186
  /**
@@ -9330,13 +9330,13 @@ exports.FirebaseServerStorageContextModule = __decorate([
9330
9330
  }, config);
9331
9331
  }
9332
9332
 
9333
- function _array_like_to_array(arr, len) {
9333
+ function _array_like_to_array$1(arr, len) {
9334
9334
  if (len == null || len > arr.length) len = arr.length;
9335
9335
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9336
9336
  return arr2;
9337
9337
  }
9338
9338
  function _array_without_holes(arr) {
9339
- if (Array.isArray(arr)) return _array_like_to_array(arr);
9339
+ if (Array.isArray(arr)) return _array_like_to_array$1(arr);
9340
9340
  }
9341
9341
  function _class_call_check$2(instance, Constructor) {
9342
9342
  if (!(instance instanceof Constructor)) {
@@ -9397,15 +9397,15 @@ function _object_spread_props(target, source) {
9397
9397
  return target;
9398
9398
  }
9399
9399
  function _to_consumable_array(arr) {
9400
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
9400
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread();
9401
9401
  }
9402
- function _unsupported_iterable_to_array(o, minLen) {
9402
+ function _unsupported_iterable_to_array$1(o, minLen) {
9403
9403
  if (!o) return;
9404
- if (typeof o === "string") return _array_like_to_array(o, minLen);
9404
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
9405
9405
  var n = Object.prototype.toString.call(o).slice(8, -1);
9406
9406
  if (n === "Object" && o.constructor) n = o.constructor.name;
9407
9407
  if (n === "Map" || n === "Set") return Array.from(n);
9408
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
9408
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
9409
9409
  }
9410
9410
  // MARK: Assets
9411
9411
  /**
@@ -9765,6 +9765,14 @@ function _ts_generator$1(thisArg, body) {
9765
9765
  };
9766
9766
  }
9767
9767
 
9768
+ function _array_like_to_array(arr, len) {
9769
+ if (len == null || len > arr.length) len = arr.length;
9770
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9771
+ return arr2;
9772
+ }
9773
+ function _array_with_holes(arr) {
9774
+ if (Array.isArray(arr)) return arr;
9775
+ }
9768
9776
  function _assert_this_initialized(self) {
9769
9777
  if (self === void 0) {
9770
9778
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -9854,6 +9862,33 @@ function _inherits(subClass, superClass) {
9854
9862
  });
9855
9863
  if (superClass) _set_prototype_of(subClass, superClass);
9856
9864
  }
9865
+ function _iterable_to_array_limit(arr, i) {
9866
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
9867
+ if (_i == null) return;
9868
+ var _arr = [];
9869
+ var _n = true;
9870
+ var _d = false;
9871
+ var _s, _e;
9872
+ try {
9873
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
9874
+ _arr.push(_s.value);
9875
+ if (i && _arr.length === i) break;
9876
+ }
9877
+ } catch (err) {
9878
+ _d = true;
9879
+ _e = err;
9880
+ } finally{
9881
+ try {
9882
+ if (!_n && _i["return"] != null) _i["return"]();
9883
+ } finally{
9884
+ if (_d) throw _e;
9885
+ }
9886
+ }
9887
+ return _arr;
9888
+ }
9889
+ function _non_iterable_rest() {
9890
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9891
+ }
9857
9892
  function _possible_constructor_return(self, call) {
9858
9893
  if (call && (_type_of(call) === "object" || typeof call === "function")) {
9859
9894
  return call;
@@ -9867,10 +9902,21 @@ function _set_prototype_of(o, p) {
9867
9902
  };
9868
9903
  return _set_prototype_of(o, p);
9869
9904
  }
9905
+ function _sliced_to_array(arr, i) {
9906
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
9907
+ }
9870
9908
  function _type_of(obj) {
9871
9909
  "@swc/helpers - typeof";
9872
9910
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9873
9911
  }
9912
+ function _unsupported_iterable_to_array(o, minLen) {
9913
+ if (!o) return;
9914
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
9915
+ var n = Object.prototype.toString.call(o).slice(8, -1);
9916
+ if (n === "Object" && o.constructor) n = o.constructor.name;
9917
+ if (n === "Map" || n === "Set") return Array.from(n);
9918
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
9919
+ }
9874
9920
  function _is_native_reflect_construct() {
9875
9921
  try {
9876
9922
  var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
@@ -10107,6 +10153,104 @@ function _ts_generator(thisArg, body) {
10107
10153
  });
10108
10154
  }).call(this);
10109
10155
  }
10156
+ },
10157
+ {
10158
+ key: "useMultipleModels",
10159
+ value: /**
10160
+ * Loads and checks permissions for multiple models of the same type in parallel.
10161
+ *
10162
+ * Uses {@link performAsyncTasks} internally. The `use` function receives the array of
10163
+ * successful {@link ContextGrantedModelRolesReader} values and an array of failed items.
10164
+ *
10165
+ * @param type - the model type to load
10166
+ * @param select - selection params including keys array, roles, and use function
10167
+ * @returns the result of the use function
10168
+ *
10169
+ * @example
10170
+ * ```ts
10171
+ * const result = await nest.useMultipleModels('storageFile', {
10172
+ * request,
10173
+ * keys: ['storageFile/abc', 'storageFile/def'],
10174
+ * roles: 'download',
10175
+ * throwOnFirstError: false,
10176
+ * use: (successful, failed) => ({
10177
+ * documents: successful.map((r) => r.document),
10178
+ * errors: failed
10179
+ * })
10180
+ * });
10181
+ * ```
10182
+ */ function useMultipleModels(type, select) {
10183
+ return _async_to_generator(function() {
10184
+ var _this, context, keys, use, throwOnFirstError, useOnFirstError, taskResult, successful, errors, hasErrors;
10185
+ return _ts_generator(this, function(_state) {
10186
+ switch(_state.label){
10187
+ case 0:
10188
+ _this = this;
10189
+ context = this.makeModelContext(select.request, select.buildFn);
10190
+ keys = select.keys, use = select.use, throwOnFirstError = select.throwOnFirstError, useOnFirstError = select.useOnFirstError;
10191
+ return [
10192
+ 4,
10193
+ util.performAsyncTasks(keys, function(key) {
10194
+ return _async_to_generator(function() {
10195
+ var usePromise;
10196
+ return _ts_generator(this, function(_state) {
10197
+ usePromise = firebase.useFirebaseModelsService(this.firebaseModelsService, type, {
10198
+ context: context,
10199
+ key: key,
10200
+ roles: select.roles,
10201
+ rolesSetIncludes: select.rolesSetIncludes
10202
+ });
10203
+ return [
10204
+ 2,
10205
+ usePromise(function(x) {
10206
+ return x;
10207
+ })
10208
+ ];
10209
+ });
10210
+ }).call(_this);
10211
+ }, {
10212
+ throwError: false
10213
+ })
10214
+ ];
10215
+ case 1:
10216
+ taskResult = _state.sent();
10217
+ successful = taskResult.results.map(function(param) {
10218
+ var _param = _sliced_to_array(param, 2), reader = _param[1];
10219
+ return reader;
10220
+ });
10221
+ errors = taskResult.errors.map(function(param) {
10222
+ var _param = _sliced_to_array(param, 2), key = _param[0], error = _param[1];
10223
+ return {
10224
+ key: key,
10225
+ error: error
10226
+ };
10227
+ });
10228
+ hasErrors = errors.length > 0;
10229
+ // throwOnFirstError (default when useOnFirstError is not set): throw the first error directly
10230
+ if (hasErrors && (throwOnFirstError !== null && throwOnFirstError !== void 0 ? throwOnFirstError : !useOnFirstError)) {
10231
+ throw errors[0].error;
10232
+ }
10233
+ // useOnFirstError: call use() with empty successes and abortedEarly: true on first error
10234
+ if (hasErrors && useOnFirstError) {
10235
+ return [
10236
+ 2,
10237
+ use([], {
10238
+ errors: errors,
10239
+ abortedEarly: true
10240
+ })
10241
+ ];
10242
+ }
10243
+ return [
10244
+ 2,
10245
+ use(successful, {
10246
+ errors: errors,
10247
+ abortedEarly: false
10248
+ })
10249
+ ];
10250
+ }
10251
+ });
10252
+ }).call(this);
10253
+ }
10110
10254
  }
10111
10255
  ]);
10112
10256
  return AbstractFirebaseNestContext;