@dereekb/firebase 13.4.0 → 13.4.2

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 (72) hide show
  1. package/index.cjs.js +895 -382
  2. package/index.esm.js +893 -383
  3. package/package.json +5 -5
  4. package/src/lib/client/error/error.d.ts +1 -1
  5. package/src/lib/client/firestore/driver.accessor.batch.d.ts +2 -0
  6. package/src/lib/client/firestore/driver.accessor.create.d.ts +1 -0
  7. package/src/lib/client/firestore/driver.accessor.d.ts +2 -0
  8. package/src/lib/client/firestore/driver.accessor.default.d.ts +4 -0
  9. package/src/lib/client/firestore/driver.accessor.transaction.d.ts +2 -0
  10. package/src/lib/client/firestore/driver.d.ts +2 -0
  11. package/src/lib/client/firestore/driver.query.d.ts +5 -0
  12. package/src/lib/client/function/development.function.factory.d.ts +1 -0
  13. package/src/lib/client/function/error.d.ts +1 -0
  14. package/src/lib/client/function/function.callable.d.ts +9 -2
  15. package/src/lib/client/function/function.factory.d.ts +2 -0
  16. package/src/lib/client/function/model.function.factory.d.ts +11 -4
  17. package/src/lib/client/storage/driver.accessor.d.ts +7 -0
  18. package/src/lib/client/storage/driver.d.ts +2 -0
  19. package/src/lib/common/auth/auth.error.d.ts +25 -4
  20. package/src/lib/common/development/function.d.ts +1 -0
  21. package/src/lib/common/development/function.schedule.d.ts +3 -1
  22. package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +9 -0
  23. package/src/lib/common/firestore/accessor/context.d.ts +9 -3
  24. package/src/lib/common/firestore/accessor/document.d.ts +49 -7
  25. package/src/lib/common/firestore/accessor/document.utility.d.ts +18 -6
  26. package/src/lib/common/firestore/collection/collection.d.ts +76 -11
  27. package/src/lib/common/firestore/driver/query.handler.d.ts +9 -3
  28. package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +32 -1
  29. package/src/lib/common/model/function.d.ts +8 -3
  30. package/src/lib/common/model/model/model.loader.d.ts +1 -0
  31. package/src/lib/common/model/model.service.d.ts +9 -2
  32. package/src/lib/common/model/permission/permission.d.ts +12 -4
  33. package/src/lib/common/model/permission/permission.service.d.ts +1 -0
  34. package/src/lib/common/model/permission/permission.service.grant.d.ts +10 -0
  35. package/src/lib/common/model/permission/permission.service.role.d.ts +9 -7
  36. package/src/lib/common/storage/accessor/path.model.d.ts +1 -0
  37. package/src/lib/common/storage/context.d.ts +1 -0
  38. package/src/lib/common/storage/driver/accessor.iterate.d.ts +7 -0
  39. package/src/lib/common/storage/driver/accessor.util.d.ts +1 -0
  40. package/src/lib/common/storage/driver/error.d.ts +3 -0
  41. package/src/lib/common/storage/driver/list.d.ts +18 -3
  42. package/src/lib/common/storage/storage.d.ts +4 -0
  43. package/src/lib/common/storage/types.d.ts +3 -0
  44. package/src/lib/model/notification/notification.api.error.d.ts +27 -9
  45. package/src/lib/model/notification/notification.api.util.d.ts +12 -0
  46. package/src/lib/model/notification/notification.config.d.ts +28 -0
  47. package/src/lib/model/notification/notification.create.d.ts +24 -0
  48. package/src/lib/model/notification/notification.create.task.d.ts +2 -0
  49. package/src/lib/model/notification/notification.d.ts +42 -0
  50. package/src/lib/model/notification/notification.details.d.ts +3 -0
  51. package/src/lib/model/notification/notification.id.d.ts +4 -3
  52. package/src/lib/model/notification/notification.item.d.ts +2 -1
  53. package/src/lib/model/notification/notification.message.d.ts +6 -3
  54. package/src/lib/model/notification/notification.query.d.ts +12 -0
  55. package/src/lib/model/notification/notification.send.d.ts +4 -0
  56. package/src/lib/model/notification/notification.task.d.ts +7 -0
  57. package/src/lib/model/notification/notification.task.subtask.d.ts +5 -0
  58. package/src/lib/model/notification/notification.util.d.ts +38 -0
  59. package/src/lib/model/oidcmodel/oidcmodel.d.ts +6 -0
  60. package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -0
  61. package/src/lib/model/storagefile/storagefile.create.d.ts +4 -0
  62. package/src/lib/model/storagefile/storagefile.d.ts +16 -0
  63. package/src/lib/model/storagefile/storagefile.file.d.ts +2 -0
  64. package/src/lib/model/storagefile/storagefile.group.d.ts +4 -0
  65. package/src/lib/model/storagefile/storagefile.permission.d.ts +1 -0
  66. package/src/lib/model/storagefile/storagefile.query.d.ts +19 -0
  67. package/src/lib/model/storagefile/storagefile.task.d.ts +1 -0
  68. package/src/lib/model/storagefile/storagefile.upload.d.ts +6 -0
  69. package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +9 -0
  70. package/src/lib/model/storagefile/storagefile.util.d.ts +4 -0
  71. package/src/lib/model/system/system.d.ts +4 -0
  72. package/test/package.json +6 -6
package/index.cjs.js CHANGED
@@ -441,13 +441,15 @@ function _is_native_reflect_construct$9() {
441
441
  */ function copyDocumentIdToFieldModifierFunction(fieldName) {
442
442
  return function(param) {
443
443
  var data = param.data, documentRef = param.documentRef;
444
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
445
444
  data[fieldName] = documentRef.id; // copy the id to the target field
446
445
  };
447
446
  }
448
447
  /**
449
448
  * Creates an {@link InterceptAccessorFactoryFunction} that wraps all created accessors with
450
449
  * {@link ModifyBeforeSetFirestoreDocumentDataAccessorWrapper} using the provided config.
450
+ *
451
+ * @param config - The ModifyBeforeSetConfig defining when and how to modify documents
452
+ * @returns An InterceptAccessorFactoryFunction that wraps accessors with the modify-before-set behavior
451
453
  */ function modifyBeforeSetInterceptAccessorFactoryFunction(config) {
452
454
  return interceptAccessorFactoryFunction(function(accessor) {
453
455
  return new ModifyBeforeSetFirestoreDocumentDataAccessorWrapper(accessor, config);
@@ -456,12 +458,16 @@ function _is_native_reflect_construct$9() {
456
458
  // MARK: Templates
457
459
  /**
458
460
  * Creates a modifier that copies the document ID to the `uid` field for {@link UserRelated} models.
461
+ *
462
+ * @returns A ModifyBeforeSetModifierFunction that sets the `uid` field to the document's ID
459
463
  */ function copyDocumentIdForUserRelatedModifierFunction() {
460
464
  return copyDocumentIdToFieldModifierFunction('uid');
461
465
  }
462
466
  /**
463
467
  * Returns a pre-configured {@link ModifyBeforeSetConfig} for {@link UserRelated} models
464
468
  * that copies the document ID to the `uid` field on set operations (new document creation).
469
+ *
470
+ * @returns A ModifyBeforeSetConfig configured to copy the document ID to the `uid` field on set
465
471
  */ function copyUserRelatedDataModifierConfig() {
466
472
  return {
467
473
  when: 'set',
@@ -476,6 +482,8 @@ function _is_native_reflect_construct$9() {
476
482
  /**
477
483
  * Returns a typed {@link InterceptAccessorFactoryFunction} that applies the UserRelated
478
484
  * document ID copy modifier to all accessors created by the factory.
485
+ *
486
+ * @returns A typed InterceptAccessorFactoryFunction with the UserRelated document ID copy modifier applied
479
487
  */ function copyUserRelatedDataAccessorFactoryFunction() {
480
488
  return COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION();
481
489
  }
@@ -713,9 +721,15 @@ function _ts_generator$k(thisArg, body) {
713
721
  * - BATCH: Operations within a Firestore write batch (atomic writes only, no reads)
714
722
  */ exports.FirestoreDocumentContextType = void 0;
715
723
  (function(FirestoreDocumentContextType) {
716
- /** Standard context with no special transactional semantics */ FirestoreDocumentContextType["NONE"] = "none";
717
- /** Operations within a Firestore transaction (atomic reads and writes) */ FirestoreDocumentContextType["TRANSACTION"] = "transaction";
718
- /** Operations within a Firestore write batch (atomic writes only) */ FirestoreDocumentContextType["BATCH"] = "batch";
724
+ /**
725
+ * Standard context with no special transactional semantics
726
+ */ FirestoreDocumentContextType["NONE"] = "none";
727
+ /**
728
+ * Operations within a Firestore transaction (atomic reads and writes)
729
+ */ FirestoreDocumentContextType["TRANSACTION"] = "transaction";
730
+ /**
731
+ * Operations within a Firestore write batch (atomic writes only)
732
+ */ FirestoreDocumentContextType["BATCH"] = "batch";
719
733
  })(exports.FirestoreDocumentContextType || (exports.FirestoreDocumentContextType = {}));
720
734
 
721
735
  function asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, key, arg) {
@@ -1212,7 +1226,8 @@ function _is_native_reflect_construct$8() {
1212
1226
  /**
1213
1227
  * Retrieves a DocumentSnapshot of the document as an Observable. Streams based on the input mode.
1214
1228
  *
1215
- * @returns
1229
+ * @param mode - The stream mode controlling how the Observable emits snapshot updates
1230
+ * @returns An Observable that emits DocumentSnapshot values based on the given mode
1216
1231
  */ key: "snapshotStream",
1217
1232
  value: function snapshotStream(mode) {
1218
1233
  return snapshotStreamForAccessor(this.accessor, mode);
@@ -1222,8 +1237,9 @@ function _is_native_reflect_construct$8() {
1222
1237
  /**
1223
1238
  * Retrieves the data of the DocumentSnapshot of the document as an Observable. Streams based on the input mode.
1224
1239
  *
1225
- * @param options
1226
- * @returns
1240
+ * @param mode - The stream mode controlling how the Observable emits snapshot data updates
1241
+ * @param options - Optional SnapshotOptions for reading the document data
1242
+ * @returns An Observable that emits the document data or undefined based on the given mode
1227
1243
  */ key: "snapshotDataStream",
1228
1244
  value: function snapshotDataStream(mode, options) {
1229
1245
  return snapshotStreamDataForAccessor(this.accessor, mode, options);
@@ -1232,6 +1248,7 @@ function _is_native_reflect_construct$8() {
1232
1248
  {
1233
1249
  /**
1234
1250
  * Retrieves a DocumentSnapshot of the document.
1251
+ *
1235
1252
  * @returns
1236
1253
  */ key: "snapshot",
1237
1254
  value: function snapshot() {
@@ -1241,6 +1258,7 @@ function _is_native_reflect_construct$8() {
1241
1258
  {
1242
1259
  /**
1243
1260
  * Retrieves the data of the DocumentSnapshot of the document.
1261
+ *
1244
1262
  * @param options
1245
1263
  * @returns
1246
1264
  */ key: "snapshotData",
@@ -1280,8 +1298,9 @@ function _is_native_reflect_construct$8() {
1280
1298
  *
1281
1299
  * Throws an exception when it does not exist.
1282
1300
  *
1283
- * @param data
1284
- * @returns
1301
+ * @param data - Partial document data to update
1302
+ * @param params - Optional update parameters
1303
+ * @returns A Promise that resolves when the update completes
1285
1304
  */ key: "update",
1286
1305
  value: function update(data, params) {
1287
1306
  return updateWithAccessorUpdateAndConverterFunction(this.accessor, this.converter)(data, params);
@@ -1291,7 +1310,8 @@ function _is_native_reflect_construct$8() {
1291
1310
  /**
1292
1311
  * Updates the document using the accessor's increment functionality.
1293
1312
  *
1294
- * @param data
1313
+ * @param data - The increment update to apply to numeric fields
1314
+ * @returns A Promise that resolves when the increment update completes
1295
1315
  */ key: "increment",
1296
1316
  value: function increment(data) {
1297
1317
  return incrementUpdateWithAccessorFunction(this.accessor)(data);
@@ -1301,7 +1321,8 @@ function _is_native_reflect_construct$8() {
1301
1321
  /**
1302
1322
  * Updates the document using the accessor's array field update functionality.
1303
1323
  *
1304
- * @param data
1324
+ * @param data - The array field update to apply (union or remove elements)
1325
+ * @returns A Promise that resolves when the array update completes
1305
1326
  */ key: "arrayUpdate",
1306
1327
  value: function arrayUpdate(data) {
1307
1328
  return arrayUpdateWithAccessorFunction(this.accessor)(data);
@@ -1310,7 +1331,12 @@ function _is_native_reflect_construct$8() {
1310
1331
  ]);
1311
1332
  return AbstractFirestoreDocument;
1312
1333
  }();
1313
- function limitedFirestoreDocumentAccessorFactory(config) {
1334
+ /**
1335
+ * Creates a {@link LimitedFirestoreDocumentAccessorFactoryFunction} from the provided configuration.
1336
+ *
1337
+ * @param config - Configuration including converter, accessor factory, and document factory
1338
+ * @returns A factory function for creating LimitedFirestoreDocumentAccessor instances
1339
+ */ function limitedFirestoreDocumentAccessorFactory(config) {
1314
1340
  var firestoreContext = config.firestoreContext, firestoreAccessorDriver = config.firestoreAccessorDriver, makeDocument = config.makeDocument, interceptAccessorFactory = config.accessorFactory, inputDefaultConverter = config.converter, inputConverterFactory = config.converterFactory, modelIdentity = config.modelIdentity;
1315
1341
  var expectedCollectionName = firestoreAccessorDriver.fuzzedPathForPath ? firestoreAccessorDriver.fuzzedPathForPath(modelIdentity.collectionName) : modelIdentity.collectionName;
1316
1342
  var converterFactory = inputConverterFactory ? function(ref) {
@@ -1321,9 +1347,6 @@ function limitedFirestoreDocumentAccessorFactory(config) {
1321
1347
  };
1322
1348
  var result = function result(context) {
1323
1349
  var loadDocument = function loadDocument(ref) {
1324
- if (!ref) {
1325
- throw new Error('ref must be defined.');
1326
- }
1327
1350
  var converter = converterFactory(ref);
1328
1351
  var accessor = dataAccessorFactory.accessorFor(ref.withConverter(converter));
1329
1352
  return makeDocument(accessor, documentAccessor);
@@ -1361,7 +1384,15 @@ function limitedFirestoreDocumentAccessorFactory(config) {
1361
1384
  result.converterFactory = converterFactory;
1362
1385
  return result;
1363
1386
  }
1364
- function firestoreDocumentAccessorFactory(config) {
1387
+ /**
1388
+ * Creates a {@link FirestoreDocumentAccessorFactoryFunction} from the provided configuration.
1389
+ *
1390
+ * Extends the limited accessor factory with collection-level operations such as creating new documents
1391
+ * and loading documents by ID.
1392
+ *
1393
+ * @param config - Configuration including the collection reference and document factory
1394
+ * @returns A factory function for creating FirestoreDocumentAccessor instances
1395
+ */ function firestoreDocumentAccessorFactory(config) {
1365
1396
  var firestoreAccessorDriver = config.firestoreAccessorDriver, collection = config.collection;
1366
1397
  var limitedFirestoreDocumentAccessor = limitedFirestoreDocumentAccessorFactory(config);
1367
1398
  function documentRefForId(path) {
@@ -1425,7 +1456,12 @@ var AbstractFirestoreDocumentWithParent = /*#__PURE__*/ function(AbstractFiresto
1425
1456
  ]);
1426
1457
  return AbstractFirestoreDocumentWithParent;
1427
1458
  }(AbstractFirestoreDocument);
1428
- function firestoreSingleDocumentAccessor(config) {
1459
+ /**
1460
+ * Creates a {@link FirestoreSingleDocumentAccessor} for a collection that contains a single known document.
1461
+ *
1462
+ * @param config - Configuration specifying the single item identifier and the document accessor context extension
1463
+ * @returns A FirestoreSingleDocumentAccessor providing convenient access to the single document
1464
+ */ function firestoreSingleDocumentAccessor(config) {
1429
1465
  var singleItemIdentifier = config.singleItemIdentifier, accessors = config.accessors;
1430
1466
  var defaultAccessor = accessors.documentAccessor();
1431
1467
  return {
@@ -1447,10 +1483,15 @@ function firestoreSingleDocumentAccessor(config) {
1447
1483
  /**
1448
1484
  * Default document ID used for single-document collections. The document is stored at path `<collection>/0`.
1449
1485
  */ var DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER = '0';
1450
- function extendFirestoreCollectionWithSingleDocumentAccessor(x, singleItemIdentifier) {
1486
+ /**
1487
+ * Extends a Firestore collection object in-place with single-document accessor methods.
1488
+ *
1489
+ * @param x - The collection object to extend with single-document accessor methods
1490
+ * @param singleItemIdentifier - Optional identifier for the single document; defaults to {@link DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER}
1491
+ */ function extendFirestoreCollectionWithSingleDocumentAccessor(x, singleItemIdentifier) {
1451
1492
  var singleAccessor = firestoreSingleDocumentAccessor({
1452
1493
  accessors: x,
1453
- singleItemIdentifier: singleItemIdentifier || DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER
1494
+ singleItemIdentifier: singleItemIdentifier !== null && singleItemIdentifier !== void 0 ? singleItemIdentifier : DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER
1454
1495
  });
1455
1496
  x.singleItemIdentifier = singleAccessor.singleItemIdentifier;
1456
1497
  x.documentRef = singleAccessor.documentRef;
@@ -1929,8 +1970,7 @@ function getDataFromDocumentSnapshots(snapshots) {
1929
1970
  */ var firestoreQueryDocumentSnapshotPairsLoader = firestoreDocumentSnapshotPairsLoader;
1930
1971
  function documentData(snapshot) {
1931
1972
  var withId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
1932
- var result = withId ? documentDataWithIdAndKey(snapshot) : snapshot.data();
1933
- return result;
1973
+ return withId ? documentDataWithIdAndKey(snapshot) : snapshot.data();
1934
1974
  }
1935
1975
  function documentDataFunction(withId) {
1936
1976
  return withId ? documentDataWithIdAndKey : function(snapshot) {
@@ -2447,12 +2487,20 @@ function _object_spread_props$j(target, source) {
2447
2487
  /**
2448
2488
  * Implementation of FirestoreDataConverter.fromFirestore
2449
2489
  * Converts Firestore data to the application model type
2490
+ *
2491
+ * @param snapshot - The DocumentSnapshot containing raw Firestore data
2492
+ * @param options - Optional SnapshotOptions for reading data
2493
+ * @returns The converted application model instance
2450
2494
  */ fromFirestore: function fromFirestore(snapshot, options) {
2451
2495
  return from(snapshot, undefined);
2452
2496
  },
2453
2497
  /**
2454
2498
  * Implementation of FirestoreDataConverter.toFirestore
2455
2499
  * Converts the application model to Firestore data format
2500
+ *
2501
+ * @param modelObject - The model object to convert to Firestore data
2502
+ * @param options - Optional SetOptions controlling how data is written
2503
+ * @returns The converted Firestore data object
2456
2504
  */ toFirestore: function toFirestore(modelObject, options) {
2457
2505
  return to(modelObject, undefined, options);
2458
2506
  }
@@ -2578,7 +2626,7 @@ function _object_spread_props$i(target, source) {
2578
2626
  function optionalFirestoreField(config) {
2579
2627
  // NOTE: Typings for this function internally is weird due to the support for both the one and two type transforms.
2580
2628
  if (config) {
2581
- var inputConfig = config !== null && config !== void 0 ? config : {};
2629
+ var inputConfig = config;
2582
2630
  var dontStoreDefaultReadValue = inputConfig.dontStoreDefaultReadValue, inputDontStoreValueIf = inputConfig.dontStoreValueIf, inputTransformData = inputConfig.transformData; // might be defined.
2583
2631
  var inputDefaultReadValue = inputConfig.defaultReadValue, inputDontStoreIf = inputConfig.dontStoreIf, transformFromData = inputConfig.transformFromData, transformToData = inputConfig.transformToData;
2584
2632
  var transformData = inputTransformData !== null && inputTransformData !== void 0 ? inputTransformData : util.passThrough;
@@ -2626,8 +2674,7 @@ function optionalFirestoreField(config) {
2626
2674
  toData = function toData(x) {
2627
2675
  if (x != null) {
2628
2676
  var transformedValue = transformTo(x);
2629
- var finalValue = transformedValue != null && !dontStoreValue(transformedValue) ? transformedValue : null;
2630
- return finalValue;
2677
+ return transformedValue != null && !dontStoreValue(transformedValue) ? transformedValue : null;
2631
2678
  } else {
2632
2679
  return x;
2633
2680
  }
@@ -2959,8 +3006,7 @@ function optionalFirestoreField(config) {
2959
3006
  }
2960
3007
  var inputFilterUnique = (config === null || config === void 0 ? void 0 : config.filterUnique) === true ? util.unique : config === null || config === void 0 ? void 0 : config.filterUnique;
2961
3008
  var filterUniqueValuesFn = inputFilterUnique != null ? function(x) {
2962
- var result = inputFilterUnique(x);
2963
- return result;
3009
+ return inputFilterUnique(x);
2964
3010
  } : undefined;
2965
3011
  var inputTransformData = config === null || config === void 0 ? void 0 : config.transformData;
2966
3012
  var sortArrayFn = util.isMapIdentityFunction(sortFn) ? undefined : function(x) {
@@ -3050,7 +3096,8 @@ function optionalFirestoreField(config) {
3050
3096
  * @template S - Number type (defaults to number)
3051
3097
  * @param config - Configuration for the unique number array field
3052
3098
  * @returns A field mapping configuration for unique number array values
3053
- */ function firestoreUniqueNumberArray(config) {
3099
+ */ // eslint-disable-next-line sonarjs/no-identical-functions -- intentionally separate for distinct type constraints (number vs string|number)
3100
+ function firestoreUniqueNumberArray(config) {
3054
3101
  return firestoreUniqueArray(_object_spread_props$i(_object_spread$m({}, config), {
3055
3102
  filterUnique: util.unique
3056
3103
  }));
@@ -3168,6 +3215,8 @@ function optionalFirestoreField(config) {
3168
3215
  * FirestoreField configuration for a map of granted roles, keyed by model keys.
3169
3216
  *
3170
3217
  * Filters out models with no/null roles by default.
3218
+ *
3219
+ * @returns A field mapping configuration for a map of granted roles keyed by FirestoreModelKey
3171
3220
  */ function firestoreModelKeyGrantedRoleMap() {
3172
3221
  return firestoreMap({
3173
3222
  mapFilter: util.KeyValueTypleValueFilter.EMPTY
@@ -3202,13 +3251,11 @@ function optionalFirestoreField(config) {
3202
3251
  },
3203
3252
  fromData: function fromData(input) {
3204
3253
  var copy = util.copyObject(input);
3205
- var result = util.mapObjectMap(copy, decoder);
3206
- return result;
3254
+ return util.mapObjectMap(copy, decoder);
3207
3255
  },
3208
3256
  toData: function toData(input) {
3209
3257
  var encodedMap = util.mapObjectMap(input, encoder);
3210
- var result = filterFinalMapValuesFn(encodedMap);
3211
- return result;
3258
+ return filterFinalMapValuesFn(encodedMap);
3212
3259
  }
3213
3260
  });
3214
3261
  }
@@ -3234,6 +3281,9 @@ function optionalFirestoreField(config) {
3234
3281
  * FirestoreField configuration for a map of encoded granted roles, keyed by model keys.
3235
3282
  *
3236
3283
  * Filters out models with empty/no roles by default.
3284
+ *
3285
+ * @param dencoder - The dencoder function used to encode and decode the role values
3286
+ * @returns A field mapping configuration for an encoded granted role map keyed by FirestoreModelKey
3237
3287
  */ function firestoreModelKeyEncodedGrantedRoleMap(dencoder) {
3238
3288
  return firestoreDencoderMap({
3239
3289
  dencoder: dencoder
@@ -3259,6 +3309,8 @@ function optionalFirestoreField(config) {
3259
3309
  * FirestoreField configuration for a map of granted roles, keyed by models keys.
3260
3310
  *
3261
3311
  * Filters empty roles/arrays by default.
3312
+ *
3313
+ * @returns A field mapping configuration for a map of granted role arrays keyed by FirestoreModelKey
3262
3314
  */ function firestoreModelKeyGrantedRoleArrayMap() {
3263
3315
  return firestoreArrayMap({
3264
3316
  mapFieldValues: util.filterEmptyArrayValues
@@ -3274,6 +3326,9 @@ function optionalFirestoreField(config) {
3274
3326
  *
3275
3327
  * Used internally by {@link firestoreObjectArray} to adapt field configs into the map functions
3276
3328
  * format needed for array element conversion.
3329
+ *
3330
+ * @param config - The FirestoreModelFieldMapFunctionsConfig to convert
3331
+ * @returns A ModelMapFunctionsRef wrapping the derived map functions
3277
3332
  */ function firestoreFieldConfigToModelMapFunctionsRef(config) {
3278
3333
  var mapFunctions = util.modelFieldMapFunctions(config);
3279
3334
  return {
@@ -3324,8 +3379,7 @@ function optionalFirestoreField(config) {
3324
3379
  var to = function to(x) {
3325
3380
  // remove null/undefined values from each field when converting to in order to mirror firestore usage (undefined is treated like null)
3326
3381
  var base = baseTo(x);
3327
- var nullishfilteredOut = util.filterNullAndUndefinedValues(base);
3328
- return nullishfilteredOut;
3382
+ return util.filterNullAndUndefinedValues(base);
3329
3383
  };
3330
3384
  return firestoreField({
3331
3385
  default: (_config_default = config.default) !== null && _config_default !== void 0 ? _config_default : function() {
@@ -3378,7 +3432,7 @@ function optionalFirestoreField(config) {
3378
3432
  var defaultBeforeSave = (_config_defaultBeforeSave = config.defaultBeforeSave) !== null && _config_defaultBeforeSave !== void 0 ? _config_defaultBeforeSave : config.saveDefaultObject ? function() {
3379
3433
  return toData({});
3380
3434
  } : null;
3381
- var mapFunctionsConfig = util.build({
3435
+ return util.build({
3382
3436
  base: firestoreField({
3383
3437
  default: (_config_default = config.default) !== null && _config_default !== void 0 ? _config_default : defaultWithFields,
3384
3438
  defaultBeforeSave: defaultBeforeSave,
@@ -3389,7 +3443,6 @@ function optionalFirestoreField(config) {
3389
3443
  x.mapFunctions = mapFunctions;
3390
3444
  }
3391
3445
  });
3392
- return mapFunctionsConfig;
3393
3446
  }
3394
3447
  /**
3395
3448
  * Creates a field mapping configuration for Firestore latitude/longitude string fields.
@@ -3419,7 +3472,10 @@ function optionalFirestoreField(config) {
3419
3472
  /**
3420
3473
  * Default configuration for a TimezoneString.
3421
3474
  *
3422
- * The value defaults to UTC
3475
+ * The value defaults to UTC.
3476
+ *
3477
+ * @param config - Optional configuration for the timezone string field, including default value and pre-save default.
3478
+ * @returns A configured Firestore field that stores a TimezoneString value.
3423
3479
  */ function firestoreTimezoneString(config) {
3424
3480
  var _ref = config !== null && config !== void 0 ? config : {}, defaultValue = _ref.default, defaultBeforeSave = _ref.defaultBeforeSave;
3425
3481
  return firestoreString({
@@ -3440,8 +3496,7 @@ var assignWebsiteLinkFunction = util.assignValuesToPOJOFunction({
3440
3496
  valueFilter: util.KeyValueTypleValueFilter.EMPTY
3441
3497
  });
3442
3498
  var firestoreWebsiteLinkAssignFn = function firestoreWebsiteLinkAssignFn(input) {
3443
- var behavior = assignWebsiteLinkFunction(DEFAULT_WEBSITE_LINK, input);
3444
- return behavior;
3499
+ return assignWebsiteLinkFunction(DEFAULT_WEBSITE_LINK, input);
3445
3500
  };
3446
3501
  /**
3447
3502
  * Creates a field mapping configuration for Firestore website link fields.
@@ -3457,7 +3512,11 @@ var firestoreWebsiteLinkAssignFn = function firestoreWebsiteLinkAssignFn(input)
3457
3512
  });
3458
3513
  }
3459
3514
  // MARK: WebsiteLink Array
3460
- function firestoreWebsiteLinkArray() {
3515
+ /**
3516
+ * Creates a field mapping configuration for Firestore arrays of WebsiteLink values.
3517
+ *
3518
+ * @returns A field mapping configuration for WebsiteLink array values
3519
+ */ function firestoreWebsiteLinkArray() {
3461
3520
  return firestoreObjectArray({
3462
3521
  firestoreField: firestoreWebsiteLink()
3463
3522
  });
@@ -3475,8 +3534,7 @@ var assignWebsiteFileLinkFunction = util.assignValuesToPOJOFunction({
3475
3534
  valueFilter: util.KeyValueTypleValueFilter.EMPTY
3476
3535
  });
3477
3536
  var firestoreWebsiteFileLinkAssignFn = function firestoreWebsiteFileLinkAssignFn(input) {
3478
- var behavior = assignWebsiteFileLinkFunction(DEFAULT_FIRESTORE_WEBSITE_FILE_LINK_VALUE, input);
3479
- return behavior;
3537
+ return assignWebsiteFileLinkFunction(DEFAULT_FIRESTORE_WEBSITE_FILE_LINK_VALUE, input);
3480
3538
  };
3481
3539
  /**
3482
3540
  * Creates a field mapping configuration for Firestore website file link fields.
@@ -3494,6 +3552,8 @@ var firestoreWebsiteFileLinkAssignFn = function firestoreWebsiteFileLinkAssignFn
3494
3552
  // MARK: WebsiteFileLink Array
3495
3553
  /**
3496
3554
  * Stores the array of WebsiteFileLink values as an array of objects.
3555
+ *
3556
+ * @returns A field mapping configuration for WebsiteFileLink array values stored as objects
3497
3557
  */ function firestoreWebsiteFileLinkObjectArray() {
3498
3558
  return firestoreObjectArray({
3499
3559
  firestoreField: firestoreWebsiteFileLink()
@@ -3501,6 +3561,8 @@ var firestoreWebsiteFileLinkAssignFn = function firestoreWebsiteFileLinkAssignFn
3501
3561
  }
3502
3562
  /**
3503
3563
  * Stores the array of WebsiteFileLink values as an array of EncodedWebsiteFileLink values.
3564
+ *
3565
+ * @returns A field mapping configuration for WebsiteFileLink array values stored in encoded form
3504
3566
  */ function firestoreWebsiteFileLinkEncodedArray() {
3505
3567
  return firestoreEncodedArray({
3506
3568
  convert: {
@@ -3539,7 +3601,12 @@ var firestoreDateCellRangeAssignFn = function firestoreDateCellRangeAssignFn(inp
3539
3601
  });
3540
3602
  }
3541
3603
  // MARK: DateCellRange Array
3542
- function firestoreDateCellRangeArray() {
3604
+ /**
3605
+ * Creates a field mapping configuration for Firestore arrays of DateCellRange values.
3606
+ *
3607
+ * @param sort - Whether to sort the array by index number; defaults to true
3608
+ * @returns A field mapping configuration for DateCellRange array values
3609
+ */ function firestoreDateCellRangeArray() {
3543
3610
  var sort = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
3544
3611
  return firestoreObjectArray({
3545
3612
  sortWith: sort ? util.sortAscendingIndexNumberRefFunction() : undefined,
@@ -3559,8 +3626,7 @@ var assignDateCellScheduleFunction = util.assignValuesToPOJOFunction({
3559
3626
  valueFilter: util.KeyValueTypleValueFilter.NULL
3560
3627
  });
3561
3628
  var firestoreDateCellScheduleAssignFn = function firestoreDateCellScheduleAssignFn(input) {
3562
- var block = assignDateCellScheduleFunction(DEFAULT_FIRESTORE_DATE_CELL_SCHEDULE_VALUE, input);
3563
- return block;
3629
+ return assignDateCellScheduleFunction(DEFAULT_FIRESTORE_DATE_CELL_SCHEDULE_VALUE, input);
3564
3630
  };
3565
3631
  /**
3566
3632
  * Creates a field mapping configuration for Firestore date cell schedule fields.
@@ -3594,6 +3660,9 @@ var DEFAULT_FIRESTORE_UNITED_STATES_ADDRESS_VALUE = {
3594
3660
  });
3595
3661
  /**
3596
3662
  * Function to assign values from an input UnitedStatesAddress to a default UnitedStatesAddress.
3663
+ *
3664
+ * @param input - The source UnitedStatesAddress to copy values from
3665
+ * @returns A new UnitedStatesAddress with values assigned from the input
3597
3666
  */ var firestoreUnitedStatesAddressAssignFn = function firestoreUnitedStatesAddressAssignFn(input) {
3598
3667
  return assignUnitedStatesAddressFunction(DEFAULT_FIRESTORE_UNITED_STATES_ADDRESS_VALUE, input);
3599
3668
  };
@@ -3731,37 +3800,37 @@ function firebaseQueryItemAccumulator(iteration, mapItem) {
3731
3800
  var mapFn = function mapFn(x) {
3732
3801
  var result = util.filterMaybeArrayValues(x.map(function(y) {
3733
3802
  var data = snapshotData(y);
3734
- return data ? mapItem(data) : undefined;
3803
+ return mapItem(data);
3735
3804
  }));
3736
3805
  return result;
3737
3806
  };
3738
3807
  return firebaseQuerySnapshotAccumulator(iteration, mapFn);
3739
3808
  }
3740
3809
 
3741
- function _array_like_to_array$f(arr, len) {
3810
+ function _array_like_to_array$g(arr, len) {
3742
3811
  if (len == null || len > arr.length) len = arr.length;
3743
3812
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3744
3813
  return arr2;
3745
3814
  }
3746
- function _array_without_holes$b(arr) {
3747
- if (Array.isArray(arr)) return _array_like_to_array$f(arr);
3815
+ function _array_without_holes$d(arr) {
3816
+ if (Array.isArray(arr)) return _array_like_to_array$g(arr);
3748
3817
  }
3749
- function _iterable_to_array$b(iter) {
3818
+ function _iterable_to_array$d(iter) {
3750
3819
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3751
3820
  }
3752
- function _non_iterable_spread$b() {
3821
+ function _non_iterable_spread$d() {
3753
3822
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3754
3823
  }
3755
- function _to_consumable_array$b(arr) {
3756
- return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$b();
3824
+ function _to_consumable_array$d(arr) {
3825
+ return _array_without_holes$d(arr) || _iterable_to_array$d(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$d();
3757
3826
  }
3758
- function _unsupported_iterable_to_array$f(o, minLen) {
3827
+ function _unsupported_iterable_to_array$g(o, minLen) {
3759
3828
  if (!o) return;
3760
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
3829
+ if (typeof o === "string") return _array_like_to_array$g(o, minLen);
3761
3830
  var n = Object.prototype.toString.call(o).slice(8, -1);
3762
3831
  if (n === "Object" && o.constructor) n = o.constructor.name;
3763
3832
  if (n === "Map" || n === "Set") return Array.from(n);
3764
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
3833
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
3765
3834
  }
3766
3835
  /**
3767
3836
  * Creates a {@link FirestoreQueryConstraint} with the given type identifier and data.
@@ -4060,7 +4129,7 @@ function orderBy(fieldPath, directionStr) {
4060
4129
  * const newConstraints = withLastLimit10(existingConstraints);
4061
4130
  */ function addOrReplaceLimitInConstraints(limit) {
4062
4131
  var addedLimitType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE;
4063
- var replace = replaceConstraints(function(constraints) {
4132
+ return replaceConstraints(function(constraints) {
4064
4133
  var type;
4065
4134
  if (constraints.length) {
4066
4135
  type = constraints[0].type;
@@ -4077,7 +4146,6 @@ function orderBy(fieldPath, directionStr) {
4077
4146
  FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE,
4078
4147
  FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE
4079
4148
  ]);
4080
- return replace;
4081
4149
  }
4082
4150
  /**
4083
4151
  * Creates a function that filters out constraints of specific types.
@@ -4122,11 +4190,11 @@ function orderBy(fieldPath, directionStr) {
4122
4190
  * );
4123
4191
  * const newConstraints = replaceLimit(existingConstraints);
4124
4192
  */ function replaceConstraints(replaceFn, types) {
4125
- var separateFn = separateConstraints.apply(void 0, _to_consumable_array$b(types));
4193
+ var separateFn = separateConstraints.apply(void 0, _to_consumable_array$d(types));
4126
4194
  return function(constraints) {
4127
4195
  var separated = separateFn(constraints);
4128
4196
  var replacements = util.asArray(replaceFn(separated.excluded));
4129
- return replacements ? util.pushItemOrArrayItemsIntoArray(separated.included, replacements) : separated.included;
4197
+ return util.pushItemOrArrayItemsIntoArray(separated.included, replacements);
4130
4198
  };
4131
4199
  }
4132
4200
  /**
@@ -4151,10 +4219,9 @@ function orderBy(fieldPath, directionStr) {
4151
4219
  }
4152
4220
  return function(constraints) {
4153
4221
  var typesToFilterOut = new Set(types);
4154
- var separated = util.separateValues(constraints, function(x) {
4222
+ return util.separateValues(constraints, function(x) {
4155
4223
  return !typesToFilterOut.has(x.type);
4156
4224
  });
4157
- return separated;
4158
4225
  };
4159
4226
  }
4160
4227
 
@@ -4309,13 +4376,13 @@ function whereDateIsBeforeWithSort(fieldPath) {
4309
4376
  ];
4310
4377
  }
4311
4378
 
4312
- function _array_like_to_array$e(arr, len) {
4379
+ function _array_like_to_array$f(arr, len) {
4313
4380
  if (len == null || len > arr.length) len = arr.length;
4314
4381
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4315
4382
  return arr2;
4316
4383
  }
4317
- function _array_without_holes$a(arr) {
4318
- if (Array.isArray(arr)) return _array_like_to_array$e(arr);
4384
+ function _array_without_holes$c(arr) {
4385
+ if (Array.isArray(arr)) return _array_like_to_array$f(arr);
4319
4386
  }
4320
4387
  function _define_property$r(obj, key, value) {
4321
4388
  if (key in obj) {
@@ -4330,10 +4397,10 @@ function _define_property$r(obj, key, value) {
4330
4397
  }
4331
4398
  return obj;
4332
4399
  }
4333
- function _iterable_to_array$a(iter) {
4400
+ function _iterable_to_array$c(iter) {
4334
4401
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4335
4402
  }
4336
- function _non_iterable_spread$a() {
4403
+ function _non_iterable_spread$c() {
4337
4404
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4338
4405
  }
4339
4406
  function _object_spread$l(target) {
@@ -4370,16 +4437,16 @@ function _object_spread_props$h(target, source) {
4370
4437
  }
4371
4438
  return target;
4372
4439
  }
4373
- function _to_consumable_array$a(arr) {
4374
- return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$a();
4440
+ function _to_consumable_array$c(arr) {
4441
+ return _array_without_holes$c(arr) || _iterable_to_array$c(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$c();
4375
4442
  }
4376
- function _unsupported_iterable_to_array$e(o, minLen) {
4443
+ function _unsupported_iterable_to_array$f(o, minLen) {
4377
4444
  if (!o) return;
4378
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
4445
+ if (typeof o === "string") return _array_like_to_array$f(o, minLen);
4379
4446
  var n = Object.prototype.toString.call(o).slice(8, -1);
4380
4447
  if (n === "Object" && o.constructor) n = o.constructor.name;
4381
4448
  if (n === "Map" || n === "Set") return Array.from(n);
4382
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
4449
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
4383
4450
  }
4384
4451
  /**
4385
4452
  * Filters out constraints that should not be directly specified in pagination queries.
@@ -4442,13 +4509,13 @@ function _unsupported_iterable_to_array$e(o, minLen) {
4442
4509
  // Add Limit
4443
4510
  var limitCount = filterLimit !== null && filterLimit !== void 0 ? filterLimit : itemsPerPage + (startAfterFilter ? 1 : 0); // todo: may not be needed.
4444
4511
  var limitConstraint = limit(limitCount);
4445
- var constraintsWithLimit = _to_consumable_array$a(constraints).concat([
4512
+ var constraintsWithLimit = _to_consumable_array$c(constraints).concat([
4446
4513
  limitConstraint
4447
4514
  ]);
4448
4515
  // make query
4449
4516
  var batchQuery = (_driver = driver).query.apply(_driver, [
4450
4517
  queryLike
4451
- ].concat(_to_consumable_array$a(constraintsWithLimit)));
4518
+ ].concat(_to_consumable_array$c(constraintsWithLimit)));
4452
4519
  var resultPromise = driver.getDocs(batchQuery).then(function(snapshot) {
4453
4520
  var time = new Date();
4454
4521
  var docs = snapshot.docs;
@@ -4677,7 +4744,7 @@ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
4677
4744
  return snapshot;
4678
4745
  });
4679
4746
  };
4680
- var resultPromise = _loadFakeQuerySnapshot().then(function(snapshot) {
4747
+ return _loadFakeQuerySnapshot().then(function(snapshot) {
4681
4748
  var result = {
4682
4749
  value: {
4683
4750
  time: time,
@@ -4686,7 +4753,7 @@ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
4686
4753
  reload: function reload() {
4687
4754
  return _loadFakeQuerySnapshot();
4688
4755
  },
4689
- stream: function stream(options) {
4756
+ stream: function stream(_options) {
4690
4757
  // TODO: Count potentially stream to fully implement, but might not be used anyways.
4691
4758
  return rxjs$1.of(snapshot);
4692
4759
  }
@@ -4695,7 +4762,6 @@ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
4695
4762
  };
4696
4763
  return result;
4697
4764
  });
4698
- return resultPromise;
4699
4765
  }
4700
4766
  }));
4701
4767
  }
@@ -4705,13 +4771,13 @@ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
4705
4771
  return _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration);
4706
4772
  }
4707
4773
 
4708
- function _array_like_to_array$d(arr, len) {
4774
+ function _array_like_to_array$e(arr, len) {
4709
4775
  if (len == null || len > arr.length) len = arr.length;
4710
4776
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4711
4777
  return arr2;
4712
4778
  }
4713
- function _array_without_holes$9(arr) {
4714
- if (Array.isArray(arr)) return _array_like_to_array$d(arr);
4779
+ function _array_without_holes$b(arr) {
4780
+ if (Array.isArray(arr)) return _array_like_to_array$e(arr);
4715
4781
  }
4716
4782
  function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
4717
4783
  try {
@@ -4742,22 +4808,22 @@ function _async_to_generator$g(fn) {
4742
4808
  });
4743
4809
  };
4744
4810
  }
4745
- function _iterable_to_array$9(iter) {
4811
+ function _iterable_to_array$b(iter) {
4746
4812
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4747
4813
  }
4748
- function _non_iterable_spread$9() {
4814
+ function _non_iterable_spread$b() {
4749
4815
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4750
4816
  }
4751
- function _to_consumable_array$9(arr) {
4752
- return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$9();
4817
+ function _to_consumable_array$b(arr) {
4818
+ return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$b();
4753
4819
  }
4754
- function _unsupported_iterable_to_array$d(o, minLen) {
4820
+ function _unsupported_iterable_to_array$e(o, minLen) {
4755
4821
  if (!o) return;
4756
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
4822
+ if (typeof o === "string") return _array_like_to_array$e(o, minLen);
4757
4823
  var n = Object.prototype.toString.call(o).slice(8, -1);
4758
4824
  if (n === "Object" && o.constructor) n = o.constructor.name;
4759
4825
  if (n === "Map" || n === "Set") return Array.from(n);
4760
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
4826
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
4761
4827
  }
4762
4828
  function _ts_generator$g(thisArg, body) {
4763
4829
  var f, y, t, _ = {
@@ -4895,7 +4961,7 @@ function _ts_generator$g(thisArg, body) {
4895
4961
  var allConstraints = util.flattenArrayOrValueArray(queryConstraints);
4896
4962
  var query = makeQuery.apply(void 0, [
4897
4963
  inputQuery
4898
- ].concat(_to_consumable_array$9(allConstraints)));
4964
+ ].concat(_to_consumable_array$b(allConstraints)));
4899
4965
  var result = {
4900
4966
  query: query,
4901
4967
  countDocs: function countDocs1() {
@@ -4917,7 +4983,7 @@ function _ts_generator$g(thisArg, body) {
4917
4983
  constraintsForOneDoc = addOrReplaceLimitInConstraints(1)(allConstraints);
4918
4984
  query = makeQuery.apply(void 0, [
4919
4985
  inputQuery
4920
- ].concat(_to_consumable_array$9(constraintsForOneDoc)));
4986
+ ].concat(_to_consumable_array$b(constraintsForOneDoc)));
4921
4987
  return [
4922
4988
  4,
4923
4989
  getDocs(query, transaction)
@@ -5021,7 +5087,7 @@ function _ts_generator$g(thisArg, body) {
5021
5087
  return snapshot.ref.path;
5022
5088
  }
5023
5089
 
5024
- function _array_like_to_array$c(arr, len) {
5090
+ function _array_like_to_array$d(arr, len) {
5025
5091
  if (len == null || len > arr.length) len = arr.length;
5026
5092
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5027
5093
  return arr2;
@@ -5133,15 +5199,15 @@ function _object_spread_props$g(target, source) {
5133
5199
  return target;
5134
5200
  }
5135
5201
  function _sliced_to_array$3(arr, i) {
5136
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$3();
5202
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$3();
5137
5203
  }
5138
- function _unsupported_iterable_to_array$c(o, minLen) {
5204
+ function _unsupported_iterable_to_array$d(o, minLen) {
5139
5205
  if (!o) return;
5140
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
5206
+ if (typeof o === "string") return _array_like_to_array$d(o, minLen);
5141
5207
  var n = Object.prototype.toString.call(o).slice(8, -1);
5142
5208
  if (n === "Object" && o.constructor) n = o.constructor.name;
5143
5209
  if (n === "Map" || n === "Set") return Array.from(n);
5144
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
5210
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
5145
5211
  }
5146
5212
  function _ts_generator$f(thisArg, body) {
5147
5213
  var f, y, t, _ = {
@@ -5331,27 +5397,17 @@ function _ts_generator$f(thisArg, body) {
5331
5397
  maxParallelCheckpoints: 1,
5332
5398
  iterateSnapshotBatch: function iterateSnapshotBatch(docSnapshots) {
5333
5399
  return _async_to_generator$f(function() {
5334
- var performTasksResult;
5335
5400
  return _ts_generator$f(this, function(_state) {
5336
- switch(_state.label){
5337
- case 0:
5338
- return [
5339
- 4,
5340
- util.performAsyncTasks(docSnapshots, iterateSnapshot, _object_spread$k({
5341
- sequential: true
5342
- }, snapshotsPerformTasksConfig !== null && snapshotsPerformTasksConfig !== void 0 ? snapshotsPerformTasksConfig : _object_spread_props$g(_object_spread$k({}, performTasksConfig), {
5343
- nonConcurrentTaskKeyFactory: undefined,
5344
- beforeRetry: undefined
5345
- }) // don't pass the nonConcurrentTaskKeyFactory
5346
- ))
5347
- ];
5348
- case 1:
5349
- performTasksResult = _state.sent();
5350
- return [
5351
- 2,
5352
- performTasksResult
5353
- ];
5354
- }
5401
+ return [
5402
+ 2,
5403
+ util.performAsyncTasks(docSnapshots, iterateSnapshot, _object_spread$k({
5404
+ sequential: true
5405
+ }, snapshotsPerformTasksConfig !== null && snapshotsPerformTasksConfig !== void 0 ? snapshotsPerformTasksConfig : _object_spread_props$g(_object_spread$k({}, performTasksConfig), {
5406
+ nonConcurrentTaskKeyFactory: undefined,
5407
+ beforeRetry: undefined
5408
+ }) // don't pass the nonConcurrentTaskKeyFactory
5409
+ ))
5410
+ ];
5355
5411
  });
5356
5412
  })();
5357
5413
  }
@@ -5466,14 +5522,9 @@ function _ts_generator$f(thisArg, body) {
5466
5522
  case 0:
5467
5523
  if (!(docSnapshots.length > 0)) return [
5468
5524
  3,
5469
- 3
5470
- ];
5471
- return [
5472
- 4,
5473
- batchSizeForSnapshots(docSnapshots)
5525
+ 2
5474
5526
  ];
5475
- case 1:
5476
- batchSizeForSnapshotsResult = _state.sent();
5527
+ batchSizeForSnapshotsResult = batchSizeForSnapshots(docSnapshots);
5477
5528
  batches = batchSizeForSnapshotsResult === null ? [
5478
5529
  docSnapshots
5479
5530
  ] : util.batch(docSnapshots, batchSizeForSnapshotsResult);
@@ -5486,7 +5537,7 @@ function _ts_generator$f(thisArg, body) {
5486
5537
  sequential: true
5487
5538
  }, performTasksConfig))
5488
5539
  ];
5489
- case 2:
5540
+ case 1:
5490
5541
  performTasksResult = _state.sent();
5491
5542
  return [
5492
5543
  2,
@@ -5499,12 +5550,12 @@ function _ts_generator$f(thisArg, body) {
5499
5550
  };
5500
5551
  })
5501
5552
  ];
5502
- case 3:
5553
+ case 2:
5503
5554
  return [
5504
5555
  2,
5505
5556
  []
5506
5557
  ];
5507
- case 4:
5558
+ case 3:
5508
5559
  return [
5509
5560
  2
5510
5561
  ];
@@ -5601,6 +5652,7 @@ function _ts_generator$f(thisArg, body) {
5601
5652
  */ function iterateFirestoreDocumentSnapshotCheckpoints(config) {
5602
5653
  return _async_to_generator$f(function() {
5603
5654
  var iterateCheckpoint, inputFilterCheckpointSnapshot, inputHandleRepeatCursor, waitBetweenCheckpoints, useCheckpointResult, inputConstraintsFactory, inputDynamicConstraints, queryFactory, _config_maxParallelCheckpoints, maxParallelCheckpoints, inputLimitPerCheckpoint, inputTotalSnapshotsLimit, constraintsInputIsFactory, constraintsFactory, limitPerCheckpoint, totalSnapshotsLimit, currentIndex, hasReachedEnd, totalSnapshotsLimitReached, totalSnapshotsVisited, cursorDocument, visitedCursorPaths, handleRepeatCursor, filterCheckpointSnapshot, performTaskFn, result;
5655
+ // eslint-disable-next-line sonarjs/cognitive-complexity -- cursor-based pagination logic with repeat detection is inherently complex
5604
5656
  function taskInputFactory() {
5605
5657
  return _async_to_generator$f(function() {
5606
5658
  var result, constraints, startAfterFilter, shouldContinue, totalPossibleNumberOfItemsLeftToLoad, nextLimit, query, docQuerySnapshot, docSnapshots, nextCursorDocument, cursorPath, repeatResult, newSnapshotsVisited, i;
@@ -6166,7 +6218,7 @@ function _ts_generator$e(thisArg, body) {
6166
6218
  }), rxjs$1.shareReplay(1));
6167
6219
  var event$ = stream$.pipe(rxjs$1.map(function(event) {
6168
6220
  var changes = event.docChanges();
6169
- var results = util.build({
6221
+ return util.build({
6170
6222
  base: util.groupValues(changes, function(x) {
6171
6223
  return x.type;
6172
6224
  }),
@@ -6180,7 +6232,6 @@ function _ts_generator$e(thisArg, body) {
6180
6232
  x.type = iterationQueryDocChangeWatcherChangeTypeForGroup(x);
6181
6233
  }
6182
6234
  });
6183
- return results;
6184
6235
  }), rxjs$1.shareReplay(1));
6185
6236
  return {
6186
6237
  stream$: stream$,
@@ -6219,13 +6270,13 @@ function _ts_generator$e(thisArg, body) {
6219
6270
  return type;
6220
6271
  }
6221
6272
 
6222
- function _array_like_to_array$b(arr, len) {
6273
+ function _array_like_to_array$c(arr, len) {
6223
6274
  if (len == null || len > arr.length) len = arr.length;
6224
6275
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6225
6276
  return arr2;
6226
6277
  }
6227
- function _array_without_holes$8(arr) {
6228
- if (Array.isArray(arr)) return _array_like_to_array$b(arr);
6278
+ function _array_without_holes$a(arr) {
6279
+ if (Array.isArray(arr)) return _array_like_to_array$c(arr);
6229
6280
  }
6230
6281
  function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
6231
6282
  try {
@@ -6256,22 +6307,22 @@ function _async_to_generator$d(fn) {
6256
6307
  });
6257
6308
  };
6258
6309
  }
6259
- function _iterable_to_array$8(iter) {
6310
+ function _iterable_to_array$a(iter) {
6260
6311
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6261
6312
  }
6262
- function _non_iterable_spread$8() {
6313
+ function _non_iterable_spread$a() {
6263
6314
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6264
6315
  }
6265
- function _to_consumable_array$8(arr) {
6266
- return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$8();
6316
+ function _to_consumable_array$a(arr) {
6317
+ return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$a();
6267
6318
  }
6268
- function _unsupported_iterable_to_array$b(o, minLen) {
6319
+ function _unsupported_iterable_to_array$c(o, minLen) {
6269
6320
  if (!o) return;
6270
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
6321
+ if (typeof o === "string") return _array_like_to_array$c(o, minLen);
6271
6322
  var n = Object.prototype.toString.call(o).slice(8, -1);
6272
6323
  if (n === "Object" && o.constructor) n = o.constructor.name;
6273
6324
  if (n === "Map" || n === "Set") return Array.from(n);
6274
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
6325
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
6275
6326
  }
6276
6327
  function _ts_generator$d(thisArg, body) {
6277
6328
  var f, y, t, _ = {
@@ -6489,7 +6540,7 @@ function _ts_generator$d(thisArg, body) {
6489
6540
  for(var _len = arguments.length, queryConstraints = new Array(_len), _key = 0; _key < _len; _key++){
6490
6541
  queryConstraints[_key] = arguments[_key];
6491
6542
  }
6492
- return wrapQuery((_baseQuery = baseQuery).filter.apply(_baseQuery, _to_consumable_array$8(queryConstraints)));
6543
+ return wrapQuery((_baseQuery = baseQuery).filter.apply(_baseQuery, _to_consumable_array$a(queryConstraints)));
6493
6544
  }
6494
6545
  };
6495
6546
  };
@@ -6499,18 +6550,18 @@ function _ts_generator$d(thisArg, body) {
6499
6550
  for(var _len = arguments.length, queryConstraints = new Array(_len), _key = 0; _key < _len; _key++){
6500
6551
  queryConstraints[_key] = arguments[_key];
6501
6552
  }
6502
- return wrapQuery((_queryFactory = queryFactory).query.apply(_queryFactory, _to_consumable_array$8(queryConstraints)));
6553
+ return wrapQuery((_queryFactory = queryFactory).query.apply(_queryFactory, _to_consumable_array$a(queryConstraints)));
6503
6554
  }
6504
6555
  };
6505
6556
  }
6506
6557
 
6507
- function _array_like_to_array$a(arr, len) {
6558
+ function _array_like_to_array$b(arr, len) {
6508
6559
  if (len == null || len > arr.length) len = arr.length;
6509
6560
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6510
6561
  return arr2;
6511
6562
  }
6512
- function _array_without_holes$7(arr) {
6513
- if (Array.isArray(arr)) return _array_like_to_array$a(arr);
6563
+ function _array_without_holes$9(arr) {
6564
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
6514
6565
  }
6515
6566
  function _define_property$p(obj, key, value) {
6516
6567
  if (key in obj) {
@@ -6525,10 +6576,10 @@ function _define_property$p(obj, key, value) {
6525
6576
  }
6526
6577
  return obj;
6527
6578
  }
6528
- function _iterable_to_array$7(iter) {
6579
+ function _iterable_to_array$9(iter) {
6529
6580
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6530
6581
  }
6531
- function _non_iterable_spread$7() {
6582
+ function _non_iterable_spread$9() {
6532
6583
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6533
6584
  }
6534
6585
  function _object_spread$j(target) {
@@ -6565,20 +6616,20 @@ function _object_spread_props$f(target, source) {
6565
6616
  }
6566
6617
  return target;
6567
6618
  }
6568
- function _to_consumable_array$7(arr) {
6569
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$7();
6619
+ function _to_consumable_array$9(arr) {
6620
+ return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$9();
6570
6621
  }
6571
6622
  function _type_of$9(obj) {
6572
6623
  "@swc/helpers - typeof";
6573
6624
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
6574
6625
  }
6575
- function _unsupported_iterable_to_array$a(o, minLen) {
6626
+ function _unsupported_iterable_to_array$b(o, minLen) {
6576
6627
  if (!o) return;
6577
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
6628
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
6578
6629
  var n = Object.prototype.toString.call(o).slice(8, -1);
6579
6630
  if (n === "Object" && o.constructor) n = o.constructor.name;
6580
6631
  if (n === "Map" || n === "Set") return Array.from(n);
6581
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
6632
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
6582
6633
  }
6583
6634
  /**
6584
6635
  * Separator used in Firestore paths to separate collection and document IDs.
@@ -6608,6 +6659,7 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6608
6659
  }
6609
6660
  /**
6610
6661
  * Creates a FirestoreModelIdentityTypeMap from the input identities.
6662
+ *
6611
6663
  * @param identities
6612
6664
  * @returns
6613
6665
  */ function firestoreModelIdentityTypeMap(identities) {
@@ -6651,8 +6703,7 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6651
6703
  } else {
6652
6704
  key = input;
6653
6705
  }
6654
- var result = id ? id : util.lastValue(key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR));
6655
- return result;
6706
+ return id !== null && id !== void 0 ? id : util.lastValue(key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR));
6656
6707
  }
6657
6708
  /**
6658
6709
  * Returns the array of ids within a FirestoreModelKey.
@@ -6688,7 +6739,7 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6688
6739
  * @param key
6689
6740
  * @returns
6690
6741
  */ function inferKeyFromTwoWayFlatFirestoreModelKey(key) {
6691
- return key.replace(/\_/g, FIRESTORE_COLLECTION_NAME_SEPARATOR);
6742
+ return key.replace(/_/g, FIRESTORE_COLLECTION_NAME_SEPARATOR);
6692
6743
  }
6693
6744
  /**
6694
6745
  * Firestore Model Id Regex
@@ -6698,7 +6749,8 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6698
6749
  /**
6699
6750
  * Returns true if the input string is a FirestoreModelId.
6700
6751
  *
6701
- * @param input
6752
+ * @param input - The string to test
6753
+ * @returns True if the input is a valid FirestoreModelId
6702
6754
  */ function isFirestoreModelId(input) {
6703
6755
  return FIRESTORE_MODEL_ID_REGEX.test(input);
6704
6756
  }
@@ -6722,14 +6774,16 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6722
6774
  /**
6723
6775
  * Returns true if the input string is a FirestoreModelKey.
6724
6776
  *
6725
- * @param input
6777
+ * @param input - The string to test
6778
+ * @returns True if the input is a valid FirestoreModelKey
6726
6779
  */ function isFirestoreModelKey(input) {
6727
6780
  return FIRESTORE_MODEL_KEY_REGEX.test(input);
6728
6781
  }
6729
6782
  /**
6730
- * Returns true if the input string is a FirestoreModelId.
6783
+ * Returns true if the input string is a FirestoreModelId or a FirestoreModelKey.
6731
6784
  *
6732
- * @param input
6785
+ * @param input - The string to test
6786
+ * @returns True if the input is a valid FirestoreModelId or FirestoreModelKey
6733
6787
  */ function isFirestoreModelIdOrKey(input) {
6734
6788
  return util.stringContains(input, '/') ? FIRESTORE_MODEL_KEY_REGEX.test(input) : FIRESTORE_MODEL_ID_REGEX.test(input);
6735
6789
  }
@@ -6751,6 +6805,9 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6751
6805
  */ var firestoreModelKey = firestoreModelKeyPart;
6752
6806
  /**
6753
6807
  * Creates a FirestoreModelKeyFactory for the input root identity.
6808
+ *
6809
+ * @param identity - The root FirestoreModelIdentity to bind the factory to
6810
+ * @returns A factory function that creates FirestoreModelKey values for the given identity and a provided id
6754
6811
  */ function firestoreModelKeyFactory(identity) {
6755
6812
  return function(id) {
6756
6813
  return firestoreModelKey(identity, id);
@@ -6814,7 +6871,12 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
6814
6871
  return "".concat(parent).concat(FIRESTORE_COLLECTION_NAME_SEPARATOR).concat(childPath);
6815
6872
  });
6816
6873
  }
6817
- function firestoreModelKeyPairObject(input) {
6874
+ /**
6875
+ * Converts a FirestoreModelKey or reference into a record mapping each collection name to its document id.
6876
+ *
6877
+ * @param input - The FirestoreModelKey, DocumentReferenceRef, or FirestoreModelKeyRef to convert
6878
+ * @returns An object mapping collection names to document ids, or undefined if the key is unavailable
6879
+ */ function firestoreModelKeyPairObject(input) {
6818
6880
  var pairs = firestoreModelKeyPartPairs(input);
6819
6881
  var object;
6820
6882
  if (pairs) {
@@ -6826,22 +6888,44 @@ function firestoreModelKeyPairObject(input) {
6826
6888
  }
6827
6889
  return object;
6828
6890
  }
6829
- function firestoreModelKeyCollectionType(input) {
6891
+ /**
6892
+ * Returns the FirestoreCollectionType derived from the input FirestoreModelKey.
6893
+ *
6894
+ * @param input - The key or reference to extract the collection type from
6895
+ * @returns The FirestoreCollectionType string, or undefined if the key is unavailable
6896
+ */ function firestoreModelKeyCollectionType(input) {
6830
6897
  return firestoreModelKeyCollectionTypeArrayName(input, FIRESTORE_COLLECTION_NAME_SEPARATOR);
6831
6898
  }
6832
- function firestoreModelKeyCollectionTypeArrayName(input) {
6899
+ /**
6900
+ * Returns the collection type array name string derived from the input key, joined by the given separator.
6901
+ *
6902
+ * @param input - The key or reference to extract collection names from
6903
+ * @param separator - The separator to join collection names with; defaults to the Firestore collection name separator
6904
+ * @returns The joined collection type array name string, or undefined if the key is unavailable
6905
+ */ function firestoreModelKeyCollectionTypeArrayName(input) {
6833
6906
  var separator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : FIRESTORE_COLLECTION_NAME_SEPARATOR;
6834
6907
  var _firestoreModelKeyCollectionTypeArray;
6835
6908
  return (_firestoreModelKeyCollectionTypeArray = firestoreModelKeyCollectionTypeArray(input)) === null || _firestoreModelKeyCollectionTypeArray === void 0 ? void 0 : _firestoreModelKeyCollectionTypeArray.join(separator);
6836
6909
  }
6837
- function firestoreIdentityTypeArrayName(input) {
6910
+ /**
6911
+ * Returns the collection type array name string derived from a FirestoreModelIdentity, joined by the given separator.
6912
+ *
6913
+ * @param input - The FirestoreModelIdentity to derive collection names from
6914
+ * @param separator - The separator to join collection names with; defaults to the Firestore collection name separator
6915
+ * @returns The joined collection type array name string
6916
+ */ function firestoreIdentityTypeArrayName(input) {
6838
6917
  var separator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : FIRESTORE_COLLECTION_NAME_SEPARATOR;
6839
6918
  return firestoreIdentityTypeArray(input).join(separator);
6840
6919
  }
6841
- function firestoreIdentityTypeArray(input) {
6920
+ /**
6921
+ * Returns an ordered array of collection names derived from a FirestoreModelIdentity, from root to leaf.
6922
+ *
6923
+ * @param input - The FirestoreModelIdentity to traverse
6924
+ * @returns An array of FirestoreCollectionName values ordered from root to leaf
6925
+ */ function firestoreIdentityTypeArray(input) {
6842
6926
  var array = [];
6843
6927
  var current = input;
6844
- while(true){
6928
+ for(;;){
6845
6929
  array.push(current.collectionName);
6846
6930
  if (current.type === 'nested') {
6847
6931
  current = current.parent;
@@ -6851,11 +6935,16 @@ function firestoreIdentityTypeArray(input) {
6851
6935
  }
6852
6936
  return array.reverse();
6853
6937
  }
6854
- function firestoreModelKeyCollectionTypeArray(input) {
6938
+ /**
6939
+ * Returns an ordered array of collection names derived from the input FirestoreModelKey.
6940
+ *
6941
+ * @param input - The key or reference to extract collection names from
6942
+ * @returns An array of FirestoreCollectionName values, or undefined if the key is unavailable
6943
+ */ function firestoreModelKeyCollectionTypeArray(input) {
6855
6944
  var key = readFirestoreModelKey(input);
6856
6945
  var array;
6857
6946
  if (key) {
6858
- var pieces = key === null || key === void 0 ? void 0 : key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR);
6947
+ var pieces = key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR);
6859
6948
  if (util.isOddNumber(pieces.length)) {
6860
6949
  throw new Error('input key source was a collection ref or unavailable.');
6861
6950
  }
@@ -6870,8 +6959,8 @@ function firestoreModelKeyCollectionTypeArray(input) {
6870
6959
  /**
6871
6960
  * Returns the collection name of the input key.
6872
6961
  *
6873
- * @param input
6874
- * @returns
6962
+ * @param input - The key or reference to extract the collection name from
6963
+ * @returns The FirestoreCollectionName from the deepest key pair, or undefined if unavailable
6875
6964
  */ function firestoreModelKeyCollectionName(input) {
6876
6965
  var _firestoreModelKeyTypePair;
6877
6966
  return (_firestoreModelKeyTypePair = firestoreModelKeyTypePair(input)) === null || _firestoreModelKeyTypePair === void 0 ? void 0 : _firestoreModelKeyTypePair.collectionName;
@@ -6879,8 +6968,9 @@ function firestoreModelKeyCollectionTypeArray(input) {
6879
6968
  /**
6880
6969
  * Returns the parent model key from up the specified amount of levels.
6881
6970
  *
6882
- * @param input
6883
- * @param maxLevelsUp
6971
+ * @param input - The key or reference to extract the parent key from
6972
+ * @param maxLevelsUp - The number of levels to traverse up the key hierarchy; defaults to 1
6973
+ * @returns The parent FirestoreModelKey, or undefined if no parent exists
6884
6974
  */ function firestoreModelKeyParentKey(input) {
6885
6975
  var maxLevelsUp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
6886
6976
  var keyParts = firestoreModelKeyParentKeyPartPairs(input, maxLevelsUp);
@@ -6890,7 +6980,13 @@ function firestoreModelKeyCollectionTypeArray(input) {
6890
6980
  }
6891
6981
  return result;
6892
6982
  }
6893
- function firestoreModelKeyParentKeyPartPairs(input) {
6983
+ /**
6984
+ * Returns the collection/id pair array truncated by the specified number of levels from the end.
6985
+ *
6986
+ * @param input - The key or reference to extract pairs from
6987
+ * @param maxLevelsUp - The number of levels to remove from the end; defaults to 1
6988
+ * @returns An array of FirestoreModelCollectionAndIdPair values up to the parent level, or undefined if unavailable
6989
+ */ function firestoreModelKeyParentKeyPartPairs(input) {
6894
6990
  var maxLevelsUp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
6895
6991
  var allParts = firestoreModelKeyPartPairs(input);
6896
6992
  var parentParts = undefined;
@@ -6908,11 +7004,16 @@ function firestoreModelKeyParentKeyPartPairs(input) {
6908
7004
  */ function firestoreModelKeyTypePair(input) {
6909
7005
  return util.lastValue(firestoreModelKeyPartPairs(input));
6910
7006
  }
6911
- function firestoreModelKeyPartPairs(input) {
7007
+ /**
7008
+ * Parses a FirestoreModelKey into an ordered array of collection/id pair objects.
7009
+ *
7010
+ * @param input - The key or reference to parse
7011
+ * @returns An array of FirestoreModelCollectionAndIdPair values, or undefined if the key is unavailable
7012
+ */ function firestoreModelKeyPartPairs(input) {
6912
7013
  var key = readFirestoreModelKey(input);
6913
7014
  var pairs;
6914
7015
  if (key) {
6915
- var pieces = key === null || key === void 0 ? void 0 : key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR);
7016
+ var pieces = key.split(FIRESTORE_COLLECTION_NAME_SEPARATOR);
6916
7017
  if (util.isOddNumber(pieces.length)) {
6917
7018
  throw new Error('input key source was a collection ref or unavailable.');
6918
7019
  }
@@ -6934,7 +7035,7 @@ function firestoreModelKeyPartPairs(input) {
6934
7035
  * @param input
6935
7036
  * @returns
6936
7037
  */ function firestoreModelKeyPartPairsKeyPath(input) {
6937
- return firestoreModelKeyPath.apply(void 0, _to_consumable_array$7(firestoreModelKeyPartPairsPaths(input)));
7038
+ return firestoreModelKeyPath.apply(void 0, _to_consumable_array$9(firestoreModelKeyPartPairsPaths(input)));
6938
7039
  }
6939
7040
  /**
6940
7041
  * Maps the input FirestoreModelCollectionAndIdPair[] values to FirestoreModelKeyPart[] values.
@@ -6989,7 +7090,7 @@ var FIRESTORE_DUMMY_MODEL_KEY = 'dummymodel/dummykey';
6989
7090
  *
6990
7091
  * @template T - The data type of documents in the collection
6991
7092
  * @template D - The FirestoreDocument type that wraps the data
6992
- * @param config - Configuration for the collection
7093
+ * @param inputConfig - Configuration for the collection
6993
7094
  * @returns A fully configured FirestoreCollection instance
6994
7095
  */ function makeFirestoreCollection(inputConfig) {
6995
7096
  var config = inputConfig;
@@ -7032,13 +7133,12 @@ var FIRESTORE_DUMMY_MODEL_KEY = 'dummymodel/dummykey';
7032
7133
  * @param config - Configuration for the single document collection
7033
7134
  * @returns A RootSingleItemFirestoreCollection instance configured for the specified document
7034
7135
  */ function makeRootSingleItemFirestoreCollection(config) {
7035
- var collection = util.build({
7136
+ return util.build({
7036
7137
  base: makeFirestoreCollection(config),
7037
7138
  build: function build(x) {
7038
7139
  extendFirestoreCollectionWithSingleDocumentAccessor(x, config.singleItemIdentifier);
7039
7140
  }
7040
7141
  });
7041
- return collection;
7042
7142
  }
7043
7143
 
7044
7144
  function _define_property$o(obj, key, value) {
@@ -7189,23 +7289,22 @@ function _object_spread_props$e(target, source) {
7189
7289
  * @param config - Configuration for the single document subcollection
7190
7290
  * @returns A subcollection instance with specialized accessors for the single document
7191
7291
  */ function makeSingleItemFirestoreCollection(config) {
7192
- var collection = util.build({
7292
+ return util.build({
7193
7293
  base: makeFirestoreCollectionWithParent(config),
7194
7294
  build: function build(x) {
7195
7295
  // Extend the collection with single document accessor capabilities
7196
7296
  extendFirestoreCollectionWithSingleDocumentAccessor(x, config.singleItemIdentifier);
7197
7297
  }
7198
7298
  });
7199
- return collection;
7200
7299
  }
7201
7300
 
7202
- function _array_like_to_array$9(arr, len) {
7301
+ function _array_like_to_array$a(arr, len) {
7203
7302
  if (len == null || len > arr.length) len = arr.length;
7204
7303
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7205
7304
  return arr2;
7206
7305
  }
7207
- function _array_without_holes$6(arr) {
7208
- if (Array.isArray(arr)) return _array_like_to_array$9(arr);
7306
+ function _array_without_holes$8(arr) {
7307
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
7209
7308
  }
7210
7309
  function _define_property$n(obj, key, value) {
7211
7310
  if (key in obj) {
@@ -7220,10 +7319,10 @@ function _define_property$n(obj, key, value) {
7220
7319
  }
7221
7320
  return obj;
7222
7321
  }
7223
- function _iterable_to_array$6(iter) {
7322
+ function _iterable_to_array$8(iter) {
7224
7323
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7225
7324
  }
7226
- function _non_iterable_spread$6() {
7325
+ function _non_iterable_spread$8() {
7227
7326
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7228
7327
  }
7229
7328
  function _object_spread$h(target) {
@@ -7260,16 +7359,16 @@ function _object_spread_props$d(target, source) {
7260
7359
  }
7261
7360
  return target;
7262
7361
  }
7263
- function _to_consumable_array$6(arr) {
7264
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$6();
7362
+ function _to_consumable_array$8(arr) {
7363
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$8();
7265
7364
  }
7266
- function _unsupported_iterable_to_array$9(o, minLen) {
7365
+ function _unsupported_iterable_to_array$a(o, minLen) {
7267
7366
  if (!o) return;
7268
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
7367
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
7269
7368
  var n = Object.prototype.toString.call(o).slice(8, -1);
7270
7369
  if (n === "Object" && o.constructor) n = o.constructor.name;
7271
7370
  if (n === "Map" || n === "Set") return Array.from(n);
7272
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
7371
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
7273
7372
  }
7274
7373
  /**
7275
7374
  * Creates a factory function for generating FirestoreContext instances.
@@ -7285,11 +7384,10 @@ function _unsupported_iterable_to_array$9(o, minLen) {
7285
7384
  return function(firestore) {
7286
7385
  var _drivers_firestoreAccessorDriver;
7287
7386
  var makeFirestoreCollectionConfig = function makeFirestoreCollectionConfig(config) {
7288
- var _config_collection;
7289
- var _config_collection1;
7290
- var queryLike = (_config_collection = config.collection) !== null && _config_collection !== void 0 ? _config_collection : config.queryLike;
7387
+ var collection = config.collection;
7388
+ var queryLike = collection !== null && collection !== void 0 ? collection : config.queryLike;
7291
7389
  return _object_spread_props$d(_object_spread$h({}, config), {
7292
- collection: config.converter ? (_config_collection1 = config.collection) === null || _config_collection1 === void 0 ? void 0 : _config_collection1.withConverter(config.converter) : config.collection,
7390
+ collection: config.converter ? collection === null || collection === void 0 ? void 0 : collection.withConverter(config.converter) : collection,
7293
7391
  queryLike: config.converter ? queryLike.withConverter(config.converter) : queryLike,
7294
7392
  firestoreContext: context,
7295
7393
  firestoreDriverIdentifier: drivers.firestoreDriverIdentifier,
@@ -7317,7 +7415,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
7317
7415
  return (_drivers_firestoreAccessorDriver = drivers.firestoreAccessorDriver).collection.apply(_drivers_firestoreAccessorDriver, [
7318
7416
  firestore,
7319
7417
  path
7320
- ].concat(_to_consumable_array$6(pathSegments)));
7418
+ ].concat(_to_consumable_array$8(pathSegments)));
7321
7419
  },
7322
7420
  subcollection: drivers.firestoreAccessorDriver.subcollection,
7323
7421
  runTransaction: drivers.firestoreAccessorDriver.transactionFactoryForFirestore(firestore),
@@ -7529,9 +7627,10 @@ function _ts_generator$c(thisArg, body) {
7529
7627
  * // verifier can now check batches of IDs for uniqueness
7530
7628
  * ```
7531
7629
  */ function firestoreIdBatchVerifierFactory(config) {
7630
+ var _config_makeQueryConstraints;
7532
7631
  var readKeys = config.readKeys;
7533
7632
  var fieldToQuery = config.fieldToQuery;
7534
- var makeQueryConstraints = config.makeQueryConstraints ? config.makeQueryConstraints : fieldToQuery === '_id' ? function(ids) {
7633
+ var makeQueryConstraints = (_config_makeQueryConstraints = config.makeQueryConstraints) !== null && _config_makeQueryConstraints !== void 0 ? _config_makeQueryConstraints : fieldToQuery === '_id' ? function(ids) {
7535
7634
  return whereDocumentId('in', ids);
7536
7635
  } : function(ids) {
7537
7636
  return where(fieldToQuery, 'in', ids);
@@ -7539,7 +7638,7 @@ function _ts_generator$c(thisArg, body) {
7539
7638
  return function(collection) {
7540
7639
  var verify = function verify(keys) {
7541
7640
  return _async_to_generator$c(function() {
7542
- var constraints, results, keysInResults, unusedKeys;
7641
+ var constraints, results, keysInResults;
7543
7642
  return _ts_generator$c(this, function(_state) {
7544
7643
  switch(_state.label){
7545
7644
  case 0:
@@ -7550,13 +7649,12 @@ function _ts_generator$c(thisArg, body) {
7550
7649
  ];
7551
7650
  case 1:
7552
7651
  results = _state.sent();
7553
- keysInResults = results.docs.map(function(x) {
7652
+ keysInResults = results.docs.flatMap(function(x) {
7554
7653
  return readKeys(x);
7555
- }).flat();
7556
- unusedKeys = util.unique(keys, keysInResults);
7654
+ });
7557
7655
  return [
7558
7656
  2,
7559
- unusedKeys
7657
+ util.unique(keys, keysInResults)
7560
7658
  ];
7561
7659
  }
7562
7660
  });
@@ -7578,6 +7676,7 @@ function _ts_generator$c(thisArg, body) {
7578
7676
  * Checks for document existence first, then calls `set()` if the document is absent.
7579
7677
  *
7580
7678
  * @param accessor - the accessor to perform the existence check and set operation on
7679
+ * @returns a function that creates the document if it does not exist, or throws if it does
7581
7680
  * @throws {Error} When the document already exists at the reference path
7582
7681
  *
7583
7682
  * @example
@@ -7617,13 +7716,13 @@ function _ts_generator$c(thisArg, body) {
7617
7716
  });
7618
7717
  }
7619
7718
 
7620
- function _array_like_to_array$8(arr, len) {
7719
+ function _array_like_to_array$9(arr, len) {
7621
7720
  if (len == null || len > arr.length) len = arr.length;
7622
7721
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7623
7722
  return arr2;
7624
7723
  }
7625
- function _array_without_holes$5(arr) {
7626
- if (Array.isArray(arr)) return _array_like_to_array$8(arr);
7724
+ function _array_without_holes$7(arr) {
7725
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
7627
7726
  }
7628
7727
  function _define_property$m(obj, key, value) {
7629
7728
  if (key in obj) {
@@ -7638,10 +7737,10 @@ function _define_property$m(obj, key, value) {
7638
7737
  }
7639
7738
  return obj;
7640
7739
  }
7641
- function _iterable_to_array$5(iter) {
7740
+ function _iterable_to_array$7(iter) {
7642
7741
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7643
7742
  }
7644
- function _non_iterable_spread$5() {
7743
+ function _non_iterable_spread$7() {
7645
7744
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7646
7745
  }
7647
7746
  function _object_spread$g(target) {
@@ -7659,16 +7758,16 @@ function _object_spread$g(target) {
7659
7758
  }
7660
7759
  return target;
7661
7760
  }
7662
- function _to_consumable_array$5(arr) {
7663
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$5();
7761
+ function _to_consumable_array$7(arr) {
7762
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$7();
7664
7763
  }
7665
- function _unsupported_iterable_to_array$8(o, minLen) {
7764
+ function _unsupported_iterable_to_array$9(o, minLen) {
7666
7765
  if (!o) return;
7667
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
7766
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
7668
7767
  var n = Object.prototype.toString.call(o).slice(8, -1);
7669
7768
  if (n === "Object" && o.constructor) n = o.constructor.name;
7670
7769
  if (n === "Map" || n === "Set") return Array.from(n);
7671
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
7770
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
7672
7771
  }
7673
7772
  /**
7674
7773
  * Converts a {@link FirestoreAccessorArrayUpdate} into Firestore `UpdateData` using the
@@ -7689,15 +7788,15 @@ function _unsupported_iterable_to_array$8(o, minLen) {
7689
7788
  * await updateDoc(docRef, updateData);
7690
7789
  * ```
7691
7790
  */ function firestoreClientArrayUpdateToUpdateData(input) {
7692
- var union = input === null || input === void 0 ? void 0 : input.union;
7693
- var remove = input === null || input === void 0 ? void 0 : input.remove;
7791
+ var union = input.union;
7792
+ var remove = input.remove;
7694
7793
  function createUpdatesWithArrayFunction(fieldUpdate, arrayUpdateFunction) {
7695
7794
  var result;
7696
7795
  if (fieldUpdate) {
7697
7796
  result = util.mapObjectMap(fieldUpdate, function(arrayUpdate) {
7698
7797
  var result;
7699
7798
  if (arrayUpdate) {
7700
- result = arrayUpdateFunction.apply(void 0, _to_consumable_array$5(arrayUpdate)); // use spread operator to insert each value as an argument, as "nested arrays" are not allowed in the Firestore
7799
+ result = arrayUpdateFunction.apply(void 0, _to_consumable_array$7(arrayUpdate)); // use spread operator to insert each value as an argument, as "nested arrays" are not allowed in the Firestore
7701
7800
  }
7702
7801
  return result;
7703
7802
  });
@@ -7836,6 +7935,8 @@ function _define_property$l(obj, key, value) {
7836
7935
  * Creates a {@link FirestoreDocumentDataAccessorFactory} that produces {@link DefaultFirestoreDocumentDataAccessor} instances
7837
7936
  * for direct (non-batched, non-transactional) Firestore operations.
7838
7937
  *
7938
+ * @returns a factory that creates default (non-transactional) document data accessors
7939
+ *
7839
7940
  * @example
7840
7941
  * ```ts
7841
7942
  * const factory = defaultFirestoreAccessorFactory<MyModel>();
@@ -7856,6 +7957,8 @@ function _define_property$l(obj, key, value) {
7856
7957
  * The context type is {@link FirestoreDocumentContextType.NONE}, meaning operations execute immediately
7857
7958
  * against Firestore without transaction or batch grouping.
7858
7959
  *
7960
+ * @returns a default {@link FirestoreDocumentContext} with no transaction or batch semantics
7961
+ *
7859
7962
  * @example
7860
7963
  * ```ts
7861
7964
  * const context = defaultFirestoreDocumentContext<MyModel>();
@@ -8009,6 +8112,7 @@ function _is_native_reflect_construct$7() {
8009
8112
  * into the same batch.
8010
8113
  *
8011
8114
  * @param writeBatch - the Firestore `WriteBatch` to queue operations into
8115
+ * @returns a factory that creates write-batch-backed document data accessors for any document reference
8012
8116
  *
8013
8117
  * @example
8014
8118
  * ```ts
@@ -8054,6 +8158,7 @@ function _is_native_reflect_construct$7() {
8054
8158
  * Factory function that creates a {@link WriteBatchFirestoreDocumentContext} for the given batch.
8055
8159
  *
8056
8160
  * @param batch - the Firestore `WriteBatch` to use for all document operations
8161
+ * @returns a new {@link WriteBatchFirestoreDocumentContext} bound to the given batch
8057
8162
  *
8058
8163
  * @example
8059
8164
  * ```ts
@@ -8198,6 +8303,7 @@ function _define_property$j(obj, key, value) {
8198
8303
  * instances bound to the given transaction. All operations from these accessors participate in the same transaction.
8199
8304
  *
8200
8305
  * @param transaction - the Firestore `Transaction` to bind operations to
8306
+ * @returns a factory that creates transaction-backed document data accessors for any document reference
8201
8307
  *
8202
8308
  * @example
8203
8309
  * ```ts
@@ -8244,6 +8350,7 @@ function _define_property$j(obj, key, value) {
8244
8350
  * Factory function that creates a {@link TransactionFirestoreDocumentContext} for the given transaction.
8245
8351
  *
8246
8352
  * @param transaction - the Firestore `Transaction` to use for all document operations
8353
+ * @returns a new {@link TransactionFirestoreDocumentContext} bound to the given transaction
8247
8354
  *
8248
8355
  * @example
8249
8356
  * ```ts
@@ -8391,6 +8498,8 @@ function _ts_generator$b(thisArg, body) {
8391
8498
  * - Transaction and write batch context factories for atomic operations
8392
8499
  * - A default (non-transactional) document context
8393
8500
  *
8501
+ * @returns a {@link FirestoreAccessorDriver} backed by the `firebase/firestore` client SDK
8502
+ *
8394
8503
  * @example
8395
8504
  * ```ts
8396
8505
  * const driver = firestoreClientAccessorDriver();
@@ -8407,18 +8516,10 @@ function _ts_generator$b(thisArg, body) {
8407
8516
  return function(fn) {
8408
8517
  return _async_to_generator$b(function() {
8409
8518
  return _ts_generator$b(this, function(_state) {
8410
- switch(_state.label){
8411
- case 0:
8412
- return [
8413
- 4,
8414
- firestore.runTransaction(firestore$1, fn)
8415
- ];
8416
- case 1:
8417
- return [
8418
- 2,
8419
- _state.sent()
8420
- ];
8421
- }
8519
+ return [
8520
+ 2,
8521
+ firestore.runTransaction(firestore$1, fn)
8522
+ ];
8422
8523
  });
8423
8524
  })();
8424
8525
  };
@@ -8434,13 +8535,13 @@ function _ts_generator$b(thisArg, body) {
8434
8535
  };
8435
8536
  }
8436
8537
 
8437
- function _array_like_to_array$7(arr, len) {
8538
+ function _array_like_to_array$8(arr, len) {
8438
8539
  if (len == null || len > arr.length) len = arr.length;
8439
8540
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8440
8541
  return arr2;
8441
8542
  }
8442
- function _array_without_holes$4(arr) {
8443
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
8543
+ function _array_without_holes$6(arr) {
8544
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
8444
8545
  }
8445
8546
  function _define_property$i(obj, key, value) {
8446
8547
  if (key in obj) {
@@ -8455,10 +8556,10 @@ function _define_property$i(obj, key, value) {
8455
8556
  }
8456
8557
  return obj;
8457
8558
  }
8458
- function _iterable_to_array$4(iter) {
8559
+ function _iterable_to_array$6(iter) {
8459
8560
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
8460
8561
  }
8461
- function _non_iterable_spread$4() {
8562
+ function _non_iterable_spread$6() {
8462
8563
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8463
8564
  }
8464
8565
  function _object_spread$f(target) {
@@ -8495,26 +8596,29 @@ function _object_spread_props$c(target, source) {
8495
8596
  }
8496
8597
  return target;
8497
8598
  }
8498
- function _to_consumable_array$4(arr) {
8499
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$4();
8599
+ function _to_consumable_array$6(arr) {
8600
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$6();
8500
8601
  }
8501
- function _unsupported_iterable_to_array$7(o, minLen) {
8602
+ function _unsupported_iterable_to_array$8(o, minLen) {
8502
8603
  if (!o) return;
8503
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
8604
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
8504
8605
  var n = Object.prototype.toString.call(o).slice(8, -1);
8505
8606
  if (n === "Object" && o.constructor) n = o.constructor.name;
8506
8607
  if (n === "Map" || n === "Set") return Array.from(n);
8507
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
8608
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
8508
8609
  }
8509
8610
  /**
8510
8611
  * Appends one or more `QueryConstraint` values to the builder, returning a new builder instance.
8511
8612
  *
8512
8613
  * @param builder - current query builder state
8513
8614
  * @param constraint - constraint(s) to append
8615
+ * @returns a new {@link FirebaseFirestoreQueryBuilder} with the added constraint(s)
8514
8616
  */ function addConstraintToBuilder(builder, constraint) {
8515
8617
  return {
8516
8618
  query: builder.query,
8517
- constraints: builder.constraints.concat(constraint)
8619
+ constraints: _to_consumable_array$6(builder.constraints).concat(_to_consumable_array$6(Array.isArray(constraint) ? constraint : [
8620
+ constraint
8621
+ ]))
8518
8622
  };
8519
8623
  }
8520
8624
  var _obj;
@@ -8537,13 +8641,13 @@ var _obj;
8537
8641
  }), _define_property$i(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, undefined), _define_property$i(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8538
8642
  return addConstraintToBuilder(builder, firestore.startAt(data.snapshot));
8539
8643
  }), _define_property$i(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8540
- return addConstraintToBuilder(builder, firestore.startAt.apply(void 0, _to_consumable_array$4(data.fieldValues)));
8644
+ return addConstraintToBuilder(builder, firestore.startAt.apply(void 0, _to_consumable_array$6(data.fieldValues)));
8541
8645
  }), _define_property$i(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8542
8646
  return addConstraintToBuilder(builder, firestore.startAfter(data.snapshot));
8543
8647
  }), _define_property$i(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8544
8648
  return addConstraintToBuilder(builder, firestore.endAt(data.snapshot));
8545
8649
  }), _define_property$i(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8546
- return addConstraintToBuilder(builder, firestore.endAt.apply(void 0, _to_consumable_array$4(data.fieldValues)));
8650
+ return addConstraintToBuilder(builder, firestore.endAt.apply(void 0, _to_consumable_array$6(data.fieldValues)));
8547
8651
  }), _define_property$i(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
8548
8652
  return addConstraintToBuilder(builder, firestore.endBefore(data.snapshot));
8549
8653
  }), _obj);
@@ -8552,6 +8656,8 @@ var _obj;
8552
8656
  *
8553
8657
  * Converts abstract query constraints into `firebase/firestore` `QueryConstraint` objects
8554
8658
  * and composes them into an executable `Query`.
8659
+ *
8660
+ * @returns a {@link FirestoreQueryConstraintFunctionsDriver} backed by the `firebase/firestore` client SDK
8555
8661
  */ function firebaseFirestoreQueryConstraintFunctionsDriver() {
8556
8662
  return makeFirestoreQueryConstraintFunctionsDriver({
8557
8663
  mapping: FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING,
@@ -8565,7 +8671,7 @@ var _obj;
8565
8671
  var initialQuery = param.query, constraints = param.constraints;
8566
8672
  return firestore.query.apply(void 0, [
8567
8673
  initialQuery
8568
- ].concat(_to_consumable_array$4(constraints)));
8674
+ ].concat(_to_consumable_array$6(constraints)));
8569
8675
  },
8570
8676
  documentIdFieldPath: function documentIdFieldPath() {
8571
8677
  return firestore.documentId();
@@ -8579,6 +8685,8 @@ var _obj;
8579
8685
  * Note: Transactions are not supported for queries on the client; passing a `transaction` to `getDocs`
8580
8686
  * will throw an error.
8581
8687
  *
8688
+ * @returns a {@link FirestoreQueryDriver} backed by the `firebase/firestore` client SDK
8689
+ *
8582
8690
  * @example
8583
8691
  * ```ts
8584
8692
  * const queryDriver = firebaseFirestoreQueryDriver();
@@ -8613,6 +8721,8 @@ var _obj;
8613
8721
  * Provides accessor drivers (default, batch, transaction) and query drivers for use
8614
8722
  * with {@link clientFirebaseFirestoreContextFactory}.
8615
8723
  *
8724
+ * @returns the client-side {@link FirebaseFirestoreClientDrivers} for the `firebase/firestore` SDK
8725
+ *
8616
8726
  * @example
8617
8727
  * ```ts
8618
8728
  * const drivers = firebaseFirestoreClientDrivers();
@@ -8792,6 +8902,7 @@ function _is_native_reflect_construct$6() {
8792
8902
  * structured error details from the error's `details` property if available.
8793
8903
  *
8794
8904
  * @param error - the Firebase error from an `HttpsCallable` failure
8905
+ * @returns a new {@link FirebaseServerError} wrapping the given Firebase error with structured server error details
8795
8906
  */ function fromFirebaseError(error) {
8796
8907
  var details = error.details;
8797
8908
  details = _object_spread$e({
@@ -9057,6 +9168,7 @@ function mapHttpsCallable(callable, wrap) {
9057
9168
  * Errors are converted to readable errors via {@link convertHttpsCallableErrorToReadableError}.
9058
9169
  *
9059
9170
  * @param callable - the `HttpsCallable` to wrap
9171
+ * @returns a {@link DirectDataHttpsCallable} that resolves to the response data directly
9060
9172
  *
9061
9173
  * @example
9062
9174
  * ```ts
@@ -9079,6 +9191,7 @@ function mapHttpsCallable(callable, wrap) {
9079
9191
  * to preserve server-side error context. Otherwise, converts it to a generic readable error via `toReadableError`.
9080
9192
  *
9081
9193
  * @param error - the caught error from an `HttpsCallable` invocation
9194
+ * @returns a {@link FirebaseServerError} if the error has structured details, or a generic readable error otherwise
9082
9195
  */ function convertHttpsCallableErrorToReadableError(error) {
9083
9196
  var result;
9084
9197
  if ((typeof error === "undefined" ? "undefined" : _type_of$6(error)) === 'object') {
@@ -9093,7 +9206,7 @@ function mapHttpsCallable(callable, wrap) {
9093
9206
  return result;
9094
9207
  }
9095
9208
 
9096
- /* eslint-disable @typescript-eslint/no-explicit-any */ // The use of any here does not degrade the type-safety. The correct type is inferred in most cases.
9209
+ // The use of any here does not degrade the type-safety. The correct type is inferred in most cases.
9097
9210
  /**
9098
9211
  * Creates a {@link FirebaseFunctionMapFactory} from a configuration map.
9099
9212
  *
@@ -9101,6 +9214,7 @@ function mapHttpsCallable(callable, wrap) {
9101
9214
  * for direct data access. Per-key options (e.g., timeout) are applied if provided.
9102
9215
  *
9103
9216
  * @param configMap - maps function keys to their optional configuration
9217
+ * @returns a {@link FirebaseFunctionMapFactory} that creates a typed callable function map for a given `Functions` instance
9104
9218
  *
9105
9219
  * @example
9106
9220
  * ```ts
@@ -9121,8 +9235,7 @@ function mapHttpsCallable(callable, wrap) {
9121
9235
  var fn = directDataHttpsCallable(functions.httpsCallable(functionsInstance, key, httpCallableOptions));
9122
9236
  return fn;
9123
9237
  };
9124
- var result = util.mapObjectMap(configMap, mapFn);
9125
- return result;
9238
+ return util.mapObjectMap(configMap, mapFn);
9126
9239
  };
9127
9240
  }
9128
9241
  /**
@@ -9132,6 +9245,7 @@ function mapHttpsCallable(callable, wrap) {
9132
9245
  * so `httpsCallable` instances are only created when actually needed.
9133
9246
  *
9134
9247
  * @param configMap - maps each function group key to its `[ClassType, Factory]` tuple
9248
+ * @returns a {@link LazyFirebaseFunctionsFactory} that creates a lazy-loaded function map for a given `Functions` instance
9135
9249
  *
9136
9250
  * @example
9137
9251
  * ```ts
@@ -9166,6 +9280,7 @@ function mapHttpsCallable(callable, wrap) {
9166
9280
  * The returned function builds {@link OnCallTypedModelParams} for any model type.
9167
9281
  *
9168
9282
  * @param call - the CRUD call type to embed in generated params
9283
+ * @returns an {@link OnCallTypeModelParamsFunction} pre-configured with the given call type
9169
9284
  * @throws {Error} When `modelType` is not provided or empty.
9170
9285
  *
9171
9286
  * @example
@@ -9198,10 +9313,13 @@ function mapHttpsCallable(callable, wrap) {
9198
9313
  *
9199
9314
  * @deprecated Move towards using onCallTypedModelParamsFunction directly with the call type instead of using this function. Will not be removed in the future.
9200
9315
  *
9201
- * @param modelType
9202
- * @param data
9203
- * @returns
9204
- */ function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
9316
+ * @param modelTypeInput - the model type string or ref
9317
+ * @param data - the call payload
9318
+ * @param specifier - optional sub-function specifier
9319
+ * @param call - the CRUD call type
9320
+ * @returns the constructed {@link OnCallTypedModelParams}
9321
+ */ // eslint-disable-next-line @typescript-eslint/max-params -- deprecated function, not worth refactoring
9322
+ function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
9205
9323
  return onCallTypedModelParamsFunction(call)(modelTypeInput, data, specifier);
9206
9324
  }
9207
9325
  /**
@@ -9223,6 +9341,7 @@ function mapHttpsCallable(callable, wrap) {
9223
9341
  * Creates an {@link OnCallCreateModelResult} from document references by extracting their paths as model keys.
9224
9342
  *
9225
9343
  * @param result - document reference(s) from a create operation
9344
+ * @returns an {@link OnCallCreateModelResult} with model keys extracted from document paths
9226
9345
  *
9227
9346
  * @example
9228
9347
  * ```ts
@@ -9238,13 +9357,14 @@ function mapHttpsCallable(callable, wrap) {
9238
9357
  * Creates an {@link OnCallCreateModelResult} from model key(s), normalizing to an array.
9239
9358
  *
9240
9359
  * @param modelKeys - the model key(s) of the created document(s)
9360
+ * @returns an {@link OnCallCreateModelResult} containing the keys as an array
9241
9361
  */ function onCallCreateModelResult(modelKeys) {
9242
9362
  return {
9243
9363
  modelKeys: util.asArray(modelKeys)
9244
9364
  };
9245
9365
  }
9246
9366
 
9247
- function _array_like_to_array$6(arr, len) {
9367
+ function _array_like_to_array$7(arr, len) {
9248
9368
  if (len == null || len > arr.length) len = arr.length;
9249
9369
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9250
9370
  return arr2;
@@ -9280,15 +9400,15 @@ function _non_iterable_rest$2() {
9280
9400
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9281
9401
  }
9282
9402
  function _sliced_to_array$2(arr, i) {
9283
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$2();
9403
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$2();
9284
9404
  }
9285
- function _unsupported_iterable_to_array$6(o, minLen) {
9405
+ function _unsupported_iterable_to_array$7(o, minLen) {
9286
9406
  if (!o) return;
9287
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
9407
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
9288
9408
  var n = Object.prototype.toString.call(o).slice(8, -1);
9289
9409
  if (n === "Object" && o.constructor) n = o.constructor.name;
9290
9410
  if (n === "Map" || n === "Set") return Array.from(n);
9291
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
9411
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
9292
9412
  }
9293
9413
  /**
9294
9414
  * Default specifier string (`'_'`) used when a CRUD operation has specifiers but one
@@ -9311,6 +9431,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9311
9431
  *
9312
9432
  * @param configMap - configuration for custom (non-CRUD) functions
9313
9433
  * @param crudConfigMap - configuration for model CRUD functions with optional specifiers
9434
+ * @returns a {@link ModelFirebaseFunctionMapFactory} that creates a combined custom and CRUD function map for a given `Functions` instance
9314
9435
  *
9315
9436
  * @example
9316
9437
  * ```ts
@@ -9325,22 +9446,22 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9325
9446
  */ function callModelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
9326
9447
  var functionFactory = firebaseFunctionMapFactory(configMap);
9327
9448
  return function(functionsInstance) {
9328
- var makeCallFunction = function makeCallFunction(call, fn, modelType, specifier) {
9329
- return mapHttpsCallable(fn(), {
9449
+ var makeCallFunction = function makeCallFunction(callFn, modelType, specifier) {
9450
+ return mapHttpsCallable(callFn.fn(), {
9330
9451
  mapInput: function mapInput(data) {
9331
- return onCallTypedModelParamsFunction(call)(modelType, data, specifier);
9452
+ return onCallTypedModelParamsFunction(callFn.call)(modelType, data, specifier);
9332
9453
  }
9333
9454
  }, true);
9334
9455
  };
9335
- var makeCallSpecifiers = function makeCallSpecifiers(call, fn, modelType, specifierKeys) {
9456
+ var makeCallSpecifiers = function makeCallSpecifiers(callFn, modelType, specifierKeys) {
9336
9457
  var modelTypeSuffix = util.capitalizeFirstLetter(modelType);
9337
9458
  var specifiers = {};
9338
9459
  specifierKeys.forEach(function(inputSpecifier) {
9339
9460
  var specifier = inputSpecifier === MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT ? '' : inputSpecifier;
9340
- var specifierFn = makeCallFunction(call, fn, modelType, inputSpecifier);
9341
- var fullSpecifierName = "".concat(call).concat(modelTypeSuffix).concat(util.capitalizeFirstLetter(specifier));
9461
+ var specifierFn = makeCallFunction(callFn, modelType, inputSpecifier);
9462
+ var fullSpecifierName = "".concat(callFn.call).concat(modelTypeSuffix).concat(util.capitalizeFirstLetter(specifier));
9342
9463
  specifiers[fullSpecifierName] = specifierFn;
9343
- var shortSpecifierName = util.lowercaseFirstLetter(specifier) || call;
9464
+ var shortSpecifierName = util.lowercaseFirstLetter(specifier) || callFn.call;
9344
9465
  specifiers[shortSpecifierName] = specifierFn;
9345
9466
  });
9346
9467
  return specifiers;
@@ -9349,7 +9470,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9349
9470
  var _callFn = util.cachedGetter(function() {
9350
9471
  return functions.httpsCallable(functionsInstance, CALL_MODEL_APP_FUNCTION_KEY);
9351
9472
  });
9352
- var result = util.build({
9473
+ return util.build({
9353
9474
  base: functionMap,
9354
9475
  build: function build(x) {
9355
9476
  Object.entries(crudConfigMap).forEach(function(param) {
@@ -9363,10 +9484,14 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9363
9484
  };
9364
9485
  var addCallFunctions = function addCallFunctions(crud, fn, modelType) {
9365
9486
  var crudFns;
9487
+ var callFn = {
9488
+ call: crud,
9489
+ fn: fn
9490
+ };
9366
9491
  if (crudFunctions.has(crud)) {
9367
- crudFns = makeCallFunction(crud, fn, modelType);
9492
+ crudFns = makeCallFunction(callFn, modelType);
9368
9493
  } else if (specifierFunctions.has(crud)) {
9369
- crudFns = makeCallSpecifiers(crud, fn, modelType, specifierFunctions.get(crud));
9494
+ crudFns = makeCallSpecifiers(callFn, modelType, specifierFunctions.get(crud));
9370
9495
  }
9371
9496
  if (crudFns) {
9372
9497
  modelTypeCalls["".concat(crud).concat(modelTypeSuffix)] = crudFns;
@@ -9374,7 +9499,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9374
9499
  };
9375
9500
  var modelTypeSuffix = util.capitalizeFirstLetter(modelType);
9376
9501
  var _separateValues = util.separateValues(config, function(x) {
9377
- return x.indexOf(':') === -1;
9502
+ return !x.includes(':');
9378
9503
  }), crudFunctionKeys = _separateValues.included, specifiedCallFunctionKeys = _separateValues.excluded;
9379
9504
  var crudFunctions = new Set(crudFunctionKeys);
9380
9505
  var specifiedCallFunctionTuples = specifiedCallFunctionKeys.map(function(x) {
@@ -9405,7 +9530,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9405
9530
  });
9406
9531
  }
9407
9532
  });
9408
- return result;
9409
9533
  };
9410
9534
  }
9411
9535
 
@@ -9414,6 +9538,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9414
9538
  *
9415
9539
  * @param specifier - the development function to invoke
9416
9540
  * @param data - the call payload
9541
+ * @returns an {@link OnCallDevelopmentParams} envelope ready to send to the dev endpoint
9417
9542
  *
9418
9543
  * @example
9419
9544
  * ```ts
@@ -9439,6 +9564,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
9439
9564
  * through a single endpoint. The function specifier and data are wrapped via {@link onCallDevelopmentParams}.
9440
9565
  *
9441
9566
  * @param configMap - maps each development function key to optional configuration
9567
+ * @returns a factory that creates a {@link DevelopmentFirebaseFunctionMap} for a given `Functions` instance
9442
9568
  *
9443
9569
  * @example
9444
9570
  * ```ts
@@ -9491,6 +9617,7 @@ function _class_call_check$c(instance, Constructor) {
9491
9617
  * Useful when you need an independent reference that won't be affected by mutations to the original.
9492
9618
  *
9493
9619
  * @param path - the storage path to copy
9620
+ * @returns a new {@link StoragePath} with the same `bucketId` and `pathString`
9494
9621
  *
9495
9622
  * @example
9496
9623
  * ```ts
@@ -9507,6 +9634,7 @@ function _class_call_check$c(instance, Constructor) {
9507
9634
  * with a consistent bucket assignment.
9508
9635
  *
9509
9636
  * @param config - bucket and replacement behavior
9637
+ * @returns a {@link StoragePathFactory} that normalizes path inputs with the configured bucket
9510
9638
  *
9511
9639
  * @example
9512
9640
  * ```ts
@@ -9529,7 +9657,7 @@ function _class_call_check$c(instance, Constructor) {
9529
9657
  } else {
9530
9658
  return {
9531
9659
  pathString: pathString,
9532
- bucketId: inputBucketId || bucketId
9660
+ bucketId: inputBucketId !== null && inputBucketId !== void 0 ? inputBucketId : bucketId
9533
9661
  };
9534
9662
  }
9535
9663
  };
@@ -9541,6 +9669,7 @@ function _class_call_check$c(instance, Constructor) {
9541
9669
  * (implying the default bucket).
9542
9670
  *
9543
9671
  * @param path - the storage path to convert
9672
+ * @returns a {@link GoogleCloudStorageFilePath} string (`gs://bucket/path` or a relative path)
9544
9673
  *
9545
9674
  * @example
9546
9675
  * ```ts
@@ -9563,6 +9692,7 @@ function _class_call_check$c(instance, Constructor) {
9563
9692
  * Returns the `gs://` bucket prefix URI for the given bucket identifier or ref.
9564
9693
  *
9565
9694
  * @param storage - bucket ID string or a {@link StorageBucketIdRef}
9695
+ * @returns the `gs://bucket` prefix URI as a {@link GoogleCloudStorageBucketPrefix}
9566
9696
  *
9567
9697
  * @example
9568
9698
  * ```ts
@@ -9606,10 +9736,27 @@ var FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY = 'resetCommunicationAt'
9606
9736
  return (_x_auth = x.auth) === null || _x_auth === void 0 ? void 0 : _x_auth.uid;
9607
9737
  });
9608
9738
 
9609
- /** Error code when the user account is not found. */ var FIREBASE_AUTH_USER_NOT_FOUND_ERROR = 'auth/user-not-found';
9610
- /** Error code when the password is incorrect. */ var FIREBASE_AUTH_WRONG_PASSWORD = 'auth/wrong-password';
9611
- /** Error code for a network request error (client SDK). */ var FIREBASE_AUTH_NETWORK_REQUEST_ERROR = 'auth/network-request-error';
9612
- /** Error code for a failed network request (client SDK). */ var FIREBASE_AUTH_NETWORK_REQUEST_FAILED = 'auth/network-request-failed';
9739
+ /**
9740
+ * Error code when the user account is not found.
9741
+ */ var FIREBASE_AUTH_USER_NOT_FOUND_ERROR = 'auth/user-not-found';
9742
+ /**
9743
+ * Error code when the password is incorrect.
9744
+ */ var FIREBASE_AUTH_WRONG_PASSWORD = 'auth/wrong-password';
9745
+ /**
9746
+ * Error code for a network request error (client SDK).
9747
+ */ var FIREBASE_AUTH_NETWORK_REQUEST_ERROR = 'auth/network-request-error';
9748
+ /**
9749
+ * Error code for a failed network request (client SDK).
9750
+ */ var FIREBASE_AUTH_NETWORK_REQUEST_FAILED = 'auth/network-request-failed';
9751
+ /**
9752
+ * Error code when a phone number is already associated with another account.
9753
+ */ var FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR = 'auth/phone-number-already-exists';
9754
+ /**
9755
+ * Error code when an email is already associated with another account.
9756
+ */ var FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR = 'auth/email-already-exists';
9757
+ /**
9758
+ * Error code when the provided phone number is not a valid E.164 string.
9759
+ */ var FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR = 'auth/invalid-phone-number';
9613
9760
  /**
9614
9761
  * Converts a {@link FirebaseAuthError} into a user-friendly {@link ReadableError} with a human-readable message.
9615
9762
  *
@@ -9617,6 +9764,7 @@ var FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY = 'resetCommunicationAt'
9617
9764
  * suitable for display in the UI.
9618
9765
  *
9619
9766
  * @param inputError - the Firebase Auth error to convert
9767
+ * @returns a {@link ReadableError} with a human-readable message suitable for display
9620
9768
  *
9621
9769
  * @example
9622
9770
  * ```ts
@@ -9720,6 +9868,7 @@ function _define_property$f(obj, key, value) {
9720
9868
  * Automatically uses a transaction accessor when the context has an active transaction.
9721
9869
  *
9722
9870
  * @param getFirestoreCollection - function to retrieve the Firestore collection from context
9871
+ * @returns a {@link FirebaseModelLoader} that loads document wrappers for given keys
9723
9872
  *
9724
9873
  * @example
9725
9874
  * ```ts
@@ -9736,8 +9885,7 @@ function _define_property$f(obj, key, value) {
9736
9885
  } else {
9737
9886
  documentAccessor = firestoreCollection.documentAccessor();
9738
9887
  }
9739
- var document = documentAccessor.loadDocumentForKey(key);
9740
- return document;
9888
+ return documentAccessor.loadDocumentForKey(key);
9741
9889
  }
9742
9890
  };
9743
9891
  }
@@ -9745,17 +9893,17 @@ function _define_property$f(obj, key, value) {
9745
9893
  /**
9746
9894
  * ArkType schema for a FirestoreModelKey (full path like "collection/12345").
9747
9895
  */ var firestoreModelKeyType = arktype.type('string > 0').narrow(function(val, ctx) {
9748
- return val != null && isFirestoreModelKey(val) || ctx.mustBe('a valid FirestoreModelKey');
9896
+ return isFirestoreModelKey(val) || ctx.mustBe('a valid FirestoreModelKey');
9749
9897
  });
9750
9898
  /**
9751
9899
  * ArkType schema for a FirestoreModelId (document ID like "12345").
9752
9900
  */ var firestoreModelIdType = arktype.type('string > 0').narrow(function(val, ctx) {
9753
- return val != null && isFirestoreModelId(val) || ctx.mustBe('a valid FirestoreModelId');
9901
+ return isFirestoreModelId(val) || ctx.mustBe('a valid FirestoreModelId');
9754
9902
  });
9755
9903
  /**
9756
9904
  * ArkType schema for a FirestoreModelId or FirestoreModelKey.
9757
9905
  */ var firestoreModelIdOrKeyType = arktype.type('string > 0').narrow(function(val, ctx) {
9758
- return val != null && isFirestoreModelIdOrKey(val) || ctx.mustBe('a valid FirestoreModelId or FirestoreModelKey');
9906
+ return isFirestoreModelIdOrKey(val) || ctx.mustBe('a valid FirestoreModelId or FirestoreModelKey');
9759
9907
  });
9760
9908
 
9761
9909
  /**
@@ -10064,6 +10212,7 @@ function _ts_generator$9(thisArg, body) {
10064
10212
  * Creates a {@link FirebaseModelPermissionServiceInstance} from a delegate.
10065
10213
  *
10066
10214
  * @param delegate - provides model loading and role computation
10215
+ * @returns a {@link FirebaseModelPermissionServiceInstance} configured with the given delegate
10067
10216
  */ function firebaseModelPermissionService(delegate) {
10068
10217
  return new FirebaseModelPermissionServiceInstance(delegate);
10069
10218
  }
@@ -10226,8 +10375,7 @@ function _define_property$d(obj, key, value) {
10226
10375
  value: function throwDoesNotExistError() {
10227
10376
  var _ref;
10228
10377
  var _this_contextGrantedModelRoles_context_makeDoesNotExistError, _this_contextGrantedModelRoles_context;
10229
- var error = (_ref = (_this_contextGrantedModelRoles_context_makeDoesNotExistError = (_this_contextGrantedModelRoles_context = this.contextGrantedModelRoles.context).makeDoesNotExistError) === null || _this_contextGrantedModelRoles_context_makeDoesNotExistError === void 0 ? void 0 : _this_contextGrantedModelRoles_context_makeDoesNotExistError.call(_this_contextGrantedModelRoles_context, this.contextGrantedModelRoles)) !== null && _ref !== void 0 ? _ref : new Error(contextGrantedModelRolesReaderDoesNotExistErrorMessage(this.contextGrantedModelRoles));
10230
- throw error;
10378
+ throw (_ref = (_this_contextGrantedModelRoles_context_makeDoesNotExistError = (_this_contextGrantedModelRoles_context = this.contextGrantedModelRoles.context).makeDoesNotExistError) === null || _this_contextGrantedModelRoles_context_makeDoesNotExistError === void 0 ? void 0 : _this_contextGrantedModelRoles_context_makeDoesNotExistError.call(_this_contextGrantedModelRoles_context, this.contextGrantedModelRoles)) !== null && _ref !== void 0 ? _ref : new Error(contextGrantedModelRolesReaderDoesNotExistErrorMessage(this.contextGrantedModelRoles));
10231
10379
  }
10232
10380
  },
10233
10381
  {
@@ -10235,8 +10383,7 @@ function _define_property$d(obj, key, value) {
10235
10383
  value: function throwPermissionError(role) {
10236
10384
  var _ref;
10237
10385
  var _this_contextGrantedModelRoles_context_makePermissionError, _this_contextGrantedModelRoles_context;
10238
- var error = (_ref = (_this_contextGrantedModelRoles_context_makePermissionError = (_this_contextGrantedModelRoles_context = this.contextGrantedModelRoles.context).makePermissionError) === null || _this_contextGrantedModelRoles_context_makePermissionError === void 0 ? void 0 : _this_contextGrantedModelRoles_context_makePermissionError.call(_this_contextGrantedModelRoles_context, this.contextGrantedModelRoles, role)) !== null && _ref !== void 0 ? _ref : new Error(contextGrantedModelRolesReaderPermissionErrorMessage(this.contextGrantedModelRoles, role));
10239
- throw error;
10386
+ throw (_ref = (_this_contextGrantedModelRoles_context_makePermissionError = (_this_contextGrantedModelRoles_context = this.contextGrantedModelRoles.context).makePermissionError) === null || _this_contextGrantedModelRoles_context_makePermissionError === void 0 ? void 0 : _this_contextGrantedModelRoles_context_makePermissionError.call(_this_contextGrantedModelRoles_context, this.contextGrantedModelRoles, role)) !== null && _ref !== void 0 ? _ref : new Error(contextGrantedModelRolesReaderPermissionErrorMessage(this.contextGrantedModelRoles, role));
10240
10387
  }
10241
10388
  }
10242
10389
  ]);
@@ -10244,6 +10391,9 @@ function _define_property$d(obj, key, value) {
10244
10391
  }();
10245
10392
  /**
10246
10393
  * Creates a new ContextGrantedModelRolesReader for the input model.
10394
+ *
10395
+ * @param service - the in-model-context permission service to read roles from
10396
+ * @returns a promise resolving to a {@link ContextGrantedModelRolesReader} for the model
10247
10397
  */ function contextGrantedModelRolesReader(service) {
10248
10398
  return service.roleMap().then(function(x) {
10249
10399
  return new ContextGrantedModelRolesReaderInstance(x);
@@ -10252,13 +10402,13 @@ function _define_property$d(obj, key, value) {
10252
10402
  /**
10253
10403
  * Creates the default permission error message.
10254
10404
  *
10255
- * @param contextGrantedModelRoles
10256
- * @param role
10257
- * @returns
10405
+ * @param contextGrantedModelRoles - the granted model roles context to generate the message from
10406
+ * @param roles - the required role(s) that were not satisfied
10407
+ * @returns a human-readable permission error message string
10258
10408
  */ function contextGrantedModelRolesReaderPermissionErrorMessage(contextGrantedModelRoles, roles) {
10259
10409
  var _contextGrantedModelRoles_data, _contextGrantedModelRoles_data1;
10260
10410
  var message = 'Permissions Error ("'.concat((_contextGrantedModelRoles_data = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data === void 0 ? void 0 : _contextGrantedModelRoles_data.document.modelType, '":"').concat((_contextGrantedModelRoles_data1 = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data1 === void 0 ? void 0 : _contextGrantedModelRoles_data1.document.id, '")');
10261
- if (roles && (roles === null || roles === void 0 ? void 0 : roles.length)) {
10411
+ if (roles === null || roles === void 0 ? void 0 : roles.length) {
10262
10412
  message = "".concat(message, ': required role(s) "').concat(roles, '"');
10263
10413
  }
10264
10414
  return message;
@@ -10266,13 +10416,11 @@ function _define_property$d(obj, key, value) {
10266
10416
  /**
10267
10417
  * Creates the default does not exist error message.
10268
10418
  *
10269
- * @param contextGrantedModelRoles
10270
- * @param role
10271
- * @returns
10419
+ * @param contextGrantedModelRoles - the granted model roles context to generate the message from
10420
+ * @returns a human-readable does-not-exist error message string
10272
10421
  */ function contextGrantedModelRolesReaderDoesNotExistErrorMessage(contextGrantedModelRoles) {
10273
10422
  var _contextGrantedModelRoles_data, _contextGrantedModelRoles_data1;
10274
- var message = 'Does Not Exist ("'.concat((_contextGrantedModelRoles_data = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data === void 0 ? void 0 : _contextGrantedModelRoles_data.document.modelType, '":"').concat((_contextGrantedModelRoles_data1 = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data1 === void 0 ? void 0 : _contextGrantedModelRoles_data1.document.id, '")');
10275
- return message;
10423
+ return 'Does Not Exist ("'.concat((_contextGrantedModelRoles_data = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data === void 0 ? void 0 : _contextGrantedModelRoles_data.document.modelType, '":"').concat((_contextGrantedModelRoles_data1 = contextGrantedModelRoles.data) === null || _contextGrantedModelRoles_data1 === void 0 ? void 0 : _contextGrantedModelRoles_data1.document.id, '")');
10276
10424
  }
10277
10425
 
10278
10426
  function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
@@ -10408,6 +10556,9 @@ function _ts_generator$8(thisArg, body) {
10408
10556
  * Decision function that checks if the current user is an admin in the given context.
10409
10557
  *
10410
10558
  * Returns `false` if no auth is present.
10559
+ *
10560
+ * @param context - the Firebase model context to evaluate
10561
+ * @returns a promise resolving to `true` if the user is an admin, `false` otherwise
10411
10562
  */ var isAdminInFirebaseModelContext = function isAdminInFirebaseModelContext(context) {
10412
10563
  var _ref;
10413
10564
  var _context_auth;
@@ -10417,6 +10568,7 @@ function _ts_generator$8(thisArg, body) {
10417
10568
  * Creates a {@link GrantRolesIfFunction} that grants the specified roles when the user is an admin.
10418
10569
  *
10419
10570
  * @param rolesToGrantToAdmin - roles to grant if the user is an admin
10571
+ * @returns a {@link GrantRolesIfFunction} that grants the given roles when the user is an admin
10420
10572
  *
10421
10573
  * @example
10422
10574
  * ```ts
@@ -10435,6 +10587,7 @@ function _ts_generator$8(thisArg, body) {
10435
10587
  * @param context - the model context to check
10436
10588
  * @param rolesToGrantToAdmin - roles to grant if admin
10437
10589
  * @param otherwise - fallback role computation when not admin
10590
+ * @returns a promise or value resolving to the granted role map
10438
10591
  */ function grantModelRolesIfAdmin(context, rolesToGrantToAdmin, otherwise) {
10439
10592
  return grantModelRolesIfAdminFunction(rolesToGrantToAdmin)(context, otherwise);
10440
10593
  }
@@ -10444,6 +10597,7 @@ function _ts_generator$8(thisArg, body) {
10444
10597
  *
10445
10598
  * @param authRoles - the auth roles the user must have
10446
10599
  * @param rolesToGrantToAdmin - the model roles to grant if the auth roles are present
10600
+ * @returns a {@link GrantRolesIfFunction} that grants the given roles when the user has the required auth roles
10447
10601
  */ function grantModelRolesIfHasAuthRolesFunction(authRoles, rolesToGrantToAdmin) {
10448
10602
  return grantModelRolesIfFunction(function(context) {
10449
10603
  var _context_auth;
@@ -10459,6 +10613,7 @@ function _ts_generator$8(thisArg, body) {
10459
10613
  * Creates a reusable factory pre-configured with specific auth roles to check for.
10460
10614
  *
10461
10615
  * @param authRoles - the auth roles the user must have
10616
+ * @returns a {@link GrantModelRolesIfHasAuthRolesFactory} pre-configured to check the given auth roles
10462
10617
  */ function grantModelRolesIfHasAuthRolesFactory(authRoles) {
10463
10618
  var authRolesToHave = util.iterableToArray(authRoles);
10464
10619
  return function(context, rolesToGrantToMatch, otherwise) {
@@ -10517,6 +10672,7 @@ function _ts_generator$8(thisArg, body) {
10517
10672
  * Creates a {@link GrantRolesIfFunction} that grants roles when the authenticated user's UID matches the model's `uid` field.
10518
10673
  *
10519
10674
  * @param rolesToGrant - the roles to grant if the user owns the model
10675
+ * @returns a {@link GrantRolesIfFunction} that grants roles when the authenticated user is the model owner
10520
10676
  *
10521
10677
  * @example
10522
10678
  * ```ts
@@ -10534,6 +10690,7 @@ function _ts_generator$8(thisArg, body) {
10534
10690
  *
10535
10691
  * @param grantIf - decision function to evaluate
10536
10692
  * @param grantedRoles - roles to grant if the decision is `true`
10693
+ * @returns a {@link GrantRolesOnlyIfFunction} that grants roles or returns no-access with no fallback
10537
10694
  */ function grantModelRolesOnlyIfFunction(grantIf, grantedRoles) {
10538
10695
  var fn = grantModelRolesIfFunction(grantIf, grantedRoles);
10539
10696
  return function(context) {
@@ -10548,6 +10705,7 @@ function _ts_generator$8(thisArg, body) {
10548
10705
  *
10549
10706
  * @param grantIf - async decision function to evaluate
10550
10707
  * @param grantedRoles - roles to grant if the decision is `true`
10708
+ * @returns a {@link GrantRolesIfFunction} that evaluates the condition and grants roles or falls back
10551
10709
  * @throws {Error} When `grantIf` is not provided.
10552
10710
  *
10553
10711
  * @example
@@ -10559,9 +10717,6 @@ function _ts_generator$8(thisArg, body) {
10559
10717
  * const roles = await grantIfOwner(context, () => noAccessRoleMap());
10560
10718
  * ```
10561
10719
  */ function grantModelRolesIfFunction(grantIf, grantedRoles) {
10562
- if (!grantIf) {
10563
- throw new Error('missing grant if');
10564
- }
10565
10720
  return function(context) {
10566
10721
  var otherwise = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : model.noAccessRoleMap;
10567
10722
  return _async_to_generator$8(function() {
@@ -10660,6 +10815,7 @@ function _object_spread_props$a(target, source) {
10660
10815
  * Creates a {@link FirebaseModelService} that wires together model loading and permission evaluation.
10661
10816
  *
10662
10817
  * @param config - collection loader and role mapping functions
10818
+ * @returns a {@link FirebaseModelService} combining model loading and permission evaluation
10663
10819
  *
10664
10820
  * @example
10665
10821
  * ```ts
@@ -10692,6 +10848,7 @@ function _object_spread_props$a(target, source) {
10692
10848
  * Creates a {@link FirebaseModelServiceFactory} that lazily instantiates and caches the service.
10693
10849
  *
10694
10850
  * @param config - the service configuration
10851
+ * @returns a {@link FirebaseModelServiceFactory} that lazily creates and caches the service
10695
10852
  */ function firebaseModelServiceFactory(config) {
10696
10853
  return util.cachedGetter(function() {
10697
10854
  return firebaseModelService(config);
@@ -10704,6 +10861,7 @@ function _object_spread_props$a(target, source) {
10704
10861
  * with a model or key to perform permission-checked operations.
10705
10862
  *
10706
10863
  * @param factory - lazy getter for the underlying model service
10864
+ * @returns an {@link InContextFirebaseModelServiceFactory} that binds contexts to the service
10707
10865
  */ function inContextFirebaseModelServiceFactory(factory) {
10708
10866
  return function(context) {
10709
10867
  var firebaseModelService = factory();
@@ -10773,8 +10931,8 @@ function _object_spread_props$a(target, source) {
10773
10931
  * export const demoFirebaseModelServices = firebaseModelsService<typeof DEMO_FIREBASE_MODEL_SERVICE_FACTORIES, DemoFirebaseBaseContext, DemoFirebaseModelTypes>(DEMO_FIREBASE_MODEL_SERVICE_FACTORIES);
10774
10932
  * export type DemoFirebaseContext = DemoFirebaseBaseContext & { service: typeof demoFirebaseModelServices };
10775
10933
  *
10776
- * @param services
10777
- * @returns
10934
+ * @param services - the map of model service getter factories
10935
+ * @returns a {@link FirebaseModelsService} that dispatches to the appropriate model service by type
10778
10936
  */ function firebaseModelsService(services) {
10779
10937
  var firebaseModelsServiceFunction = function firebaseModelsServiceFunction1(type, context) {
10780
10938
  var firebaseModelService = services[type];
@@ -10795,6 +10953,7 @@ function _object_spread_props$a(target, source) {
10795
10953
  * The returned factory binds a context, so callers can then select individual model services by type.
10796
10954
  *
10797
10955
  * @param service - the multi-model service to wrap
10956
+ * @returns an {@link InContextFirebaseModelsServiceFactory} that binds a context to the service
10798
10957
  */ function inContextFirebaseModelsServiceFactory(service) {
10799
10958
  var newInContextFirebaseModelsServiceFactory = function newInContextFirebaseModelsServiceFactory(context) {
10800
10959
  var result = function result(type) {
@@ -10812,6 +10971,7 @@ function _object_spread_props$a(target, source) {
10812
10971
  * @param service - the multi-model service
10813
10972
  * @param type - the model type to select
10814
10973
  * @param select - selection params including context and key
10974
+ * @returns the {@link FirebaseModelsServiceSelectionResult} bound to the specified model
10815
10975
  */ function selectFromFirebaseModelsService(service, type, select) {
10816
10976
  var key = readFirestoreModelKey(select.key, true);
10817
10977
  return service(type, select.context).forKey(key);
@@ -10824,10 +10984,12 @@ function _object_spread_props$a(target, source) {
10824
10984
  * @param service - the multi-model service
10825
10985
  * @param type - the model type to select
10826
10986
  * @param select - selection params including context, key, and optional role requirements
10987
+ * @returns a {@link UsePromiseFunction} for the resolved roles reader
10827
10988
  */ function useFirebaseModelsService(service, type, select) {
10989
+ var _select_roles;
10828
10990
  var inContextModelService = selectFromFirebaseModelsService(service, type, select);
10829
10991
  var result;
10830
- if (select.roles && select.roles.length) {
10992
+ if ((_select_roles = select.roles) === null || _select_roles === void 0 ? void 0 : _select_roles.length) {
10831
10993
  result = inContextModelService.requireUse(select.roles, select.rolesSetIncludes);
10832
10994
  } else {
10833
10995
  result = inContextModelService.use;
@@ -10841,6 +11003,7 @@ function _object_spread_props$a(target, source) {
10841
11003
  * Useful for routing incoming requests to the correct model service by collection path.
10842
11004
  *
10843
11005
  * @param inContextFirebaseModelsService - context-bound multi-model service
11006
+ * @returns a map of collection type strings to their {@link FirestoreModelIdentity} objects
10844
11007
  */ function buildFirebaseCollectionTypeModelTypeMap(inContextFirebaseModelsService) {
10845
11008
  var allTypes = inContextFirebaseModelsService.allTypes();
10846
11009
  var modelIdentities = allTypes.map(function(type) {
@@ -10867,6 +11030,7 @@ function _object_spread_props$a(target, source) {
10867
11030
  * The generated paths follow the convention `/model/[basePath/]<modelKey>/[path]`.
10868
11031
  *
10869
11032
  * @param config - optional base path to nest under
11033
+ * @returns a {@link ModelStorageSlashPathFactory} that maps Firestore model keys to storage paths
10870
11034
  *
10871
11035
  * @example
10872
11036
  * ```ts
@@ -11067,6 +11231,7 @@ function _ts_generator$7(thisArg, body) {
11067
11231
  * Wraps the folder's `list()` API with cursor-based pagination via {@link fetchPageFactory}.
11068
11232
  *
11069
11233
  * @param config - default listing options (e.g., maxResults)
11234
+ * @returns an {@link IterateStorageListFilesFactory} for paginated file listing
11070
11235
  *
11071
11236
  * @example
11072
11237
  * ```ts
@@ -11077,25 +11242,16 @@ function _ts_generator$7(thisArg, body) {
11077
11242
  return fetch.fetchPageFactory({
11078
11243
  fetch: function fetch(input) {
11079
11244
  return _async_to_generator$7(function() {
11080
- var _input_maxResults, _input_pageToken, list;
11245
+ var _input_maxResults, _input_pageToken;
11081
11246
  return _ts_generator$7(this, function(_state) {
11082
- switch(_state.label){
11083
- case 0:
11084
- return [
11085
- 4,
11086
- input.folder.list({
11087
- includeNestedResults: input.includeNestedResults,
11088
- maxResults: (_input_maxResults = input.maxResults) !== null && _input_maxResults !== void 0 ? _input_maxResults : factoryDefaultMaxResults,
11089
- pageToken: (_input_pageToken = input.pageToken) !== null && _input_pageToken !== void 0 ? _input_pageToken : undefined
11090
- })
11091
- ];
11092
- case 1:
11093
- list = _state.sent();
11094
- return [
11095
- 2,
11096
- list
11097
- ];
11098
- }
11247
+ return [
11248
+ 2,
11249
+ input.folder.list({
11250
+ includeNestedResults: input.includeNestedResults,
11251
+ maxResults: (_input_maxResults = input.maxResults) !== null && _input_maxResults !== void 0 ? _input_maxResults : factoryDefaultMaxResults,
11252
+ pageToken: (_input_pageToken = input.pageToken) !== null && _input_pageToken !== void 0 ? _input_pageToken : undefined
11253
+ })
11254
+ ];
11099
11255
  });
11100
11256
  })();
11101
11257
  },
@@ -11109,7 +11265,7 @@ function _ts_generator$7(thisArg, body) {
11109
11265
  };
11110
11266
  return info;
11111
11267
  },
11112
- buildInputForNextPage: function buildInputForNextPage(pageResult, input, options) {
11268
+ buildInputForNextPage: function buildInputForNextPage(pageResult, input, _options) {
11113
11269
  var _pageResult_nextPageCursor;
11114
11270
  return _object_spread_props$9(_object_spread$b({}, input), {
11115
11271
  pageToken: (_pageResult_nextPageCursor = pageResult.nextPageCursor) !== null && _pageResult_nextPageCursor !== void 0 ? _pageResult_nextPageCursor : undefined
@@ -11121,6 +11277,9 @@ function _ts_generator$7(thisArg, body) {
11121
11277
  * Iterates through every file in a storage folder, invoking a callback for each individual file result.
11122
11278
  *
11123
11279
  * Convenience wrapper around {@link iterateFetchPagesByEachItem} pre-configured for storage listing.
11280
+ *
11281
+ * @param input - iteration configuration including folder, listing options, and per-item callback
11282
+ * @returns the result of the paginated per-item iteration
11124
11283
  */ function iterateStorageListFilesByEachFile(input) {
11125
11284
  var folder = input.folder, includeNestedResults = input.includeNestedResults, pageToken = input.pageToken;
11126
11285
  return fetch.iterateFetchPagesByEachItem(_object_spread_props$9(_object_spread$b({}, input), {
@@ -11136,6 +11295,9 @@ function _ts_generator$7(thisArg, body) {
11136
11295
  * Iterates through pages of file results in a storage folder, invoking a callback for each page.
11137
11296
  *
11138
11297
  * Convenience wrapper around {@link iterateFetchPages} pre-configured for storage listing.
11298
+ *
11299
+ * @param input - iteration configuration including folder, listing options, and per-page callback
11300
+ * @returns the result of the paginated page-level iteration
11139
11301
  */ function iterateStorageListFiles(input) {
11140
11302
  var folder = input.folder, includeNestedResults = input.includeNestedResults, pageToken = input.pageToken;
11141
11303
  return fetch.iterateFetchPages(_object_spread_props$9(_object_spread$b({}, input), {
@@ -11214,6 +11376,7 @@ function _is_native_reflect_construct$4() {
11214
11376
  * Required when the upload input is a string, since the format (raw, base64, etc.) must be explicit.
11215
11377
  *
11216
11378
  * @param options - the upload options to extract from
11379
+ * @returns the {@link StorageDataStringType} extracted from the options
11217
11380
  * @throws {Error} When `stringFormat` is not set in the options.
11218
11381
  */ function assertStorageUploadOptionsStringFormat(options) {
11219
11382
  var stringFormat = options === null || options === void 0 ? void 0 : options.stringFormat;
@@ -11224,6 +11387,8 @@ function _is_native_reflect_construct$4() {
11224
11387
  }
11225
11388
  /**
11226
11389
  * Creates an error indicating that `stringFormat` was missing from upload options.
11390
+ *
11391
+ * @returns an {@link Error} describing the missing `stringFormat` in upload options
11227
11392
  */ function noStringFormatInStorageUploadOptionsError() {
11228
11393
  return new Error('stringFormat was missing a value in the StorageUploadOptions.');
11229
11394
  }
@@ -11380,6 +11545,7 @@ function _ts_generator$6(thisArg, body) {
11380
11545
  * @param file - the target file accessor to upload to
11381
11546
  * @param readableStream - the source stream to pipe
11382
11547
  * @param options - optional upload configuration (content type, metadata, etc.)
11548
+ * @returns a promise that resolves when the upload stream has finished
11383
11549
  * @throws {StorageFileUploadStreamUnsupportedError} When the file accessor does not support stream uploads.
11384
11550
  *
11385
11551
  * @example
@@ -11417,15 +11583,16 @@ function _ts_generator$6(thisArg, body) {
11417
11583
  * provides cursor-based pagination through the `next()` method.
11418
11584
  *
11419
11585
  * @param delegate - platform-specific implementation for extracting results
11586
+ * @returns a {@link StorageListFilesResultFactory} that normalizes raw SDK list results
11420
11587
  *
11421
11588
  * @example
11422
11589
  * ```ts
11423
11590
  * const factory = storageListFilesResultFactory(myDelegate);
11424
- * const result = factory(storage, folder, { maxResults: 50 }, rawSdkResult);
11591
+ * const result = factory({ storage, folder, options: { maxResults: 50 } }, rawSdkResult);
11425
11592
  * const files = result.files();
11426
11593
  * ```
11427
11594
  */ function storageListFilesResultFactory(delegate) {
11428
- return function(storage, folder, options, result) {
11595
+ return function(input, result) {
11429
11596
  var fileResult = function fileResult(item) {
11430
11597
  item.file = function() {
11431
11598
  return delegate.file(storage, item);
@@ -11438,12 +11605,13 @@ function _ts_generator$6(thisArg, body) {
11438
11605
  };
11439
11606
  return item;
11440
11607
  };
11608
+ var storage = input.storage, folder = input.folder, options = input.options;
11441
11609
  var hasNext = delegate.hasNext(result);
11442
11610
  var next = util.cachedGetter(function() {
11443
11611
  if (!hasNext) {
11444
11612
  throw storageListFilesResultHasNoNextError();
11445
11613
  }
11446
- return delegate.next(storage, options, folder, result);
11614
+ return delegate.next(input, result);
11447
11615
  });
11448
11616
  var files = util.cachedGetter(function() {
11449
11617
  return delegate.filesFromResult(result, folder).map(fileResult);
@@ -11471,6 +11639,8 @@ function _ts_generator$6(thisArg, body) {
11471
11639
  }
11472
11640
  /**
11473
11641
  * Creates an error thrown when `next()` is called on a list result that has no more pages.
11642
+ *
11643
+ * @returns an {@link Error} indicating there are no more pages to fetch
11474
11644
  */ function storageListFilesResultHasNoNextError() {
11475
11645
  return new Error('hasNext is false, there are no more results available.');
11476
11646
  }
@@ -11482,6 +11652,7 @@ function _ts_generator$6(thisArg, body) {
11482
11652
  * a {@link StoragePathFactory} to normalize all path inputs.
11483
11653
  *
11484
11654
  * @param drivers - the storage driver implementations to use
11655
+ * @returns a {@link FirebaseStorageContextFactory} that creates storage contexts for a given storage instance
11485
11656
  * @throws {Error} When a default bucket ID cannot be resolved from the driver or config.
11486
11657
  *
11487
11658
  * @example
@@ -11492,9 +11663,10 @@ function _ts_generator$6(thisArg, body) {
11492
11663
  * ```
11493
11664
  */ function firebaseStorageContextFactory(drivers) {
11494
11665
  return function(firebaseStorage, config) {
11666
+ var _ref;
11495
11667
  var _drivers_storageAccessorDriver_getDefaultBucket, _drivers_storageAccessorDriver;
11496
- var _ref = config !== null && config !== void 0 ? config : {}, inputDefaultBucketId = _ref.defaultBucketId, _ref_forceBucket = _ref.forceBucket, forceBucket = _ref_forceBucket === void 0 ? false : _ref_forceBucket;
11497
- var defaultBucketId = inputDefaultBucketId || ((_drivers_storageAccessorDriver_getDefaultBucket = (_drivers_storageAccessorDriver = drivers.storageAccessorDriver).getDefaultBucket) === null || _drivers_storageAccessorDriver_getDefaultBucket === void 0 ? void 0 : _drivers_storageAccessorDriver_getDefaultBucket.call(_drivers_storageAccessorDriver, firebaseStorage)) || '';
11668
+ var _ref1 = config !== null && config !== void 0 ? config : {}, inputDefaultBucketId = _ref1.defaultBucketId, _ref_forceBucket = _ref1.forceBucket, forceBucket = _ref_forceBucket === void 0 ? false : _ref_forceBucket;
11669
+ var defaultBucketId = (_ref = inputDefaultBucketId !== null && inputDefaultBucketId !== void 0 ? inputDefaultBucketId : (_drivers_storageAccessorDriver_getDefaultBucket = (_drivers_storageAccessorDriver = drivers.storageAccessorDriver).getDefaultBucket) === null || _drivers_storageAccessorDriver_getDefaultBucket === void 0 ? void 0 : _drivers_storageAccessorDriver_getDefaultBucket.call(_drivers_storageAccessorDriver, firebaseStorage)) !== null && _ref !== void 0 ? _ref : '';
11498
11670
  if (!defaultBucketId) {
11499
11671
  throw new Error('Could not resolve a default bucket id for the firebaseStorageContextFactory(). Supply a defaultBucketId.');
11500
11672
  }
@@ -11519,13 +11691,13 @@ function _ts_generator$6(thisArg, body) {
11519
11691
  };
11520
11692
  }
11521
11693
 
11522
- function _array_like_to_array$5(arr, len) {
11694
+ function _array_like_to_array$6(arr, len) {
11523
11695
  if (len == null || len > arr.length) len = arr.length;
11524
11696
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
11525
11697
  return arr2;
11526
11698
  }
11527
- function _array_without_holes$3(arr) {
11528
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
11699
+ function _array_without_holes$5(arr) {
11700
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
11529
11701
  }
11530
11702
  function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
11531
11703
  try {
@@ -11569,10 +11741,10 @@ function _define_property$a(obj, key, value) {
11569
11741
  }
11570
11742
  return obj;
11571
11743
  }
11572
- function _iterable_to_array$3(iter) {
11744
+ function _iterable_to_array$5(iter) {
11573
11745
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11574
11746
  }
11575
- function _non_iterable_spread$3() {
11747
+ function _non_iterable_spread$5() {
11576
11748
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11577
11749
  }
11578
11750
  function _object_spread$a(target) {
@@ -11609,16 +11781,16 @@ function _object_spread_props$8(target, source) {
11609
11781
  }
11610
11782
  return target;
11611
11783
  }
11612
- function _to_consumable_array$3(arr) {
11613
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
11784
+ function _to_consumable_array$5(arr) {
11785
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$5();
11614
11786
  }
11615
- function _unsupported_iterable_to_array$5(o, minLen) {
11787
+ function _unsupported_iterable_to_array$6(o, minLen) {
11616
11788
  if (!o) return;
11617
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
11789
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
11618
11790
  var n = Object.prototype.toString.call(o).slice(8, -1);
11619
11791
  if (n === "Object" && o.constructor) n = o.constructor.name;
11620
11792
  if (n === "Map" || n === "Set") return Array.from(n);
11621
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
11793
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
11622
11794
  }
11623
11795
  function _ts_generator$5(thisArg, body) {
11624
11796
  var f, y, t, _ = {
@@ -11726,6 +11898,7 @@ function _ts_generator$5(thisArg, body) {
11726
11898
  * e.g., to silently handle deletion of already-deleted files.
11727
11899
  *
11728
11900
  * @param input - the error or error message to check
11901
+ * @returns `true` if the error message contains `'storage/object-not-found'`, `false` otherwise
11729
11902
  *
11730
11903
  * @example
11731
11904
  * ```ts
@@ -11745,6 +11918,7 @@ function _ts_generator$5(thisArg, body) {
11745
11918
  *
11746
11919
  * @param storage - the client Firebase Storage instance
11747
11920
  * @param path - abstract storage path to resolve
11921
+ * @returns a `StorageReference` pointing to the resolved storage path
11748
11922
  */ function firebaseStorageRefForStorageFilePath(storage$1, path) {
11749
11923
  return storage.ref(storage$1, firebaseStorageFilePathFromStorageFilePath(path));
11750
11924
  }
@@ -11754,6 +11928,7 @@ function _ts_generator$5(thisArg, body) {
11754
11928
  * Returns `true` if metadata is successfully retrieved, `false` for any error (including permission errors).
11755
11929
  *
11756
11930
  * @param ref - the storage reference to check
11931
+ * @returns a promise that resolves to `true` if the file exists, `false` otherwise
11757
11932
  */ function firebaseStorageFileExists(ref) {
11758
11933
  return storage.getMetadata(ref).then(function(_) {
11759
11934
  return true;
@@ -11769,6 +11944,7 @@ function _ts_generator$5(thisArg, body) {
11769
11944
  *
11770
11945
  * @param storage - the client Firebase Storage instance
11771
11946
  * @param storagePath - the abstract storage path for the file
11947
+ * @returns a {@link FirebaseStorageClientAccessorFile} providing CRUD and upload operations for the given path
11772
11948
  *
11773
11949
  * @example
11774
11950
  * ```ts
@@ -11785,7 +11961,7 @@ function _ts_generator$5(thisArg, body) {
11785
11961
  contentEncoding: (_options_metadata2 = options.metadata) === null || _options_metadata2 === void 0 ? void 0 : _options_metadata2.contentEncoding,
11786
11962
  contentLanguage: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentLanguage,
11787
11963
  contentType: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentType,
11788
- customMetadata: util.filterUndefinedValues(_object_spread$a({}, (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.customMetadata, options === null || options === void 0 ? void 0 : options.customMetadata))
11964
+ customMetadata: util.filterUndefinedValues(_object_spread$a({}, (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.customMetadata, options.customMetadata))
11789
11965
  });
11790
11966
  }
11791
11967
  function uploadMetadataFromStorageUploadOptions(options) {
@@ -11914,7 +12090,8 @@ function _ts_generator$5(thisArg, body) {
11914
12090
  nextPageTokenFromResult: function nextPageTokenFromResult(result) {
11915
12091
  return result.listResult.nextPageToken;
11916
12092
  },
11917
- next: function next(storage, options, folder, result) {
12093
+ next: function next(param, result) {
12094
+ var options = param.options, folder = param.folder;
11918
12095
  return folder.list(_object_spread_props$8(_object_spread$a({}, options, result.options), {
11919
12096
  pageToken: result.listResult.nextPageToken
11920
12097
  }));
@@ -11956,6 +12133,7 @@ function _ts_generator$5(thisArg, body) {
11956
12133
  *
11957
12134
  * @param storage - the client Firebase Storage instance
11958
12135
  * @param storagePath - the abstract storage path for the folder
12136
+ * @returns a {@link FirebaseStorageClientAccessorFolder} providing listing and existence operations for the given path
11959
12137
  *
11960
12138
  * @example
11961
12139
  * ```ts
@@ -11984,7 +12162,11 @@ function _ts_generator$5(thisArg, body) {
11984
12162
  return [
11985
12163
  4,
11986
12164
  storage.list(ref, options).then(function(listResult) {
11987
- return firebaseStorageClientListFilesResultFactory(storage$1, folder, options, {
12165
+ return firebaseStorageClientListFilesResultFactory({
12166
+ storage: storage$1,
12167
+ folder: folder,
12168
+ options: options
12169
+ }, {
11988
12170
  options: options,
11989
12171
  listResult: listResult
11990
12172
  });
@@ -12011,7 +12193,7 @@ function _ts_generator$5(thisArg, body) {
12011
12193
  case 2:
12012
12194
  allNestedFolderFileResults = _state.sent();
12013
12195
  allNestedFiles = allNestedFolderFileResults.flat();
12014
- allFiles = _to_consumable_array$3(allImmediateFiles).concat(_to_consumable_array$3(allNestedFiles));
12196
+ allFiles = _to_consumable_array$5(allImmediateFiles).concat(_to_consumable_array$5(allNestedFiles));
12015
12197
  result = _object_spread_props$8(_object_spread$a({}, rootResults), {
12016
12198
  files: function files() {
12017
12199
  return allFiles;
@@ -12047,6 +12229,8 @@ function _ts_generator$5(thisArg, body) {
12047
12229
  * Provides file and folder accessor factories and default bucket resolution.
12048
12230
  * Used internally by {@link firebaseStorageClientDrivers}.
12049
12231
  *
12232
+ * @returns a {@link FirebaseStorageAccessorDriver} backed by the `firebase/storage` client SDK
12233
+ *
12050
12234
  * @example
12051
12235
  * ```ts
12052
12236
  * const driver = firebaseStorageClientAccessorDriver();
@@ -12074,6 +12258,8 @@ function _ts_generator$5(thisArg, body) {
12074
12258
  *
12075
12259
  * Provides file and folder accessor operations for use with {@link clientFirebaseStorageContextFactory}.
12076
12260
  *
12261
+ * @returns the client-side {@link FirebaseStorageClientDrivers} for the `firebase/storage` SDK
12262
+ *
12077
12263
  * @example
12078
12264
  * ```ts
12079
12265
  * const drivers = firebaseStorageClientDrivers();
@@ -12132,6 +12318,7 @@ function _ts_generator$5(thisArg, body) {
12132
12318
  * by combining the given user model identity with the provided UID.
12133
12319
  *
12134
12320
  * @param userModelIdentity - the root identity for user models (e.g., `profileIdentity`)
12321
+ * @returns a function that generates a {@link NotificationSummaryId} for a given user UID
12135
12322
  *
12136
12323
  * @example
12137
12324
  * ```ts
@@ -12155,9 +12342,9 @@ function _ts_generator$5(thisArg, body) {
12155
12342
  /**
12156
12343
  * Creates a NotificationTaskUniqueId from the input model id and task type.
12157
12344
  *
12158
- * @param input model id input
12159
- * @param taskType task type
12160
- * @returns NotificationTaskUniqueId
12345
+ * @param input - model id input
12346
+ * @param taskType - task type
12347
+ * @returns the unique notification task id combining the model id and task type
12161
12348
  */ function notificationTaskUniqueId(input, taskType) {
12162
12349
  return "".concat(firestoreModelId(input), "_").concat(taskType); // combineation of model id and template type
12163
12350
  }
@@ -12212,6 +12399,10 @@ function _object_spread_props$7(target, source) {
12212
12399
  /**
12213
12400
  * Merges two {@link NotificationBoxRecipientTemplateConfig} objects, preferring values from `a` over `b`.
12214
12401
  *
12402
+ * @param a - primary config whose defined values take precedence
12403
+ * @param b - fallback config supplying values when `a` fields are undefined
12404
+ * @returns the merged template config with values from `a` preferred over `b`
12405
+ *
12215
12406
  * @example
12216
12407
  * ```ts
12217
12408
  * const merged = mergeNotificationBoxRecipientTemplateConfigs(
@@ -12236,6 +12427,9 @@ function _object_spread_props$7(target, source) {
12236
12427
  *
12237
12428
  * This produces the "effective" configuration used at send time, where each channel has a definite boolean.
12238
12429
  *
12430
+ * @param a - the template config to resolve
12431
+ * @returns the effective config with each channel flag filled in using the send-default fallback
12432
+ *
12239
12433
  * @example
12240
12434
  * ```ts
12241
12435
  * const effective = effectiveNotificationBoxRecipientTemplateConfig({ sd: true, se: false });
@@ -12255,6 +12449,10 @@ function _object_spread_props$7(target, source) {
12255
12449
  * Updates a {@link NotificationRecipient} with partial values, preserving existing fields where the update is undefined.
12256
12450
  *
12257
12451
  * Automatically clears the summary ID (`s`) when a `uid` is present.
12452
+ *
12453
+ * @param a - existing recipient to update
12454
+ * @param b - partial values to apply on top of the existing recipient
12455
+ * @returns the updated recipient with merged values
12258
12456
  */ function updateNotificationRecipient(a, b) {
12259
12457
  var inputUid = b.uid, inputN = b.n, inputE = b.e, inputT = b.t, inputS = b.s;
12260
12458
  var uid = util.updateMaybeValue(a.uid, inputUid);
@@ -12306,6 +12504,7 @@ function _object_spread_props$7(target, source) {
12306
12504
  *
12307
12505
  * @param uid - the user's Firebase auth UID
12308
12506
  * @param i - the recipient's index position in the box's recipient array
12507
+ * @returns a new recipient entry with the given uid and index and an empty template config record
12309
12508
  */ function newNotificationBoxRecipientForUid(uid, i) {
12310
12509
  return {
12311
12510
  c: {},
@@ -12315,6 +12514,10 @@ function _object_spread_props$7(target, source) {
12315
12514
  }
12316
12515
  /**
12317
12516
  * Merges two {@link NotificationUserDefaultNotificationBoxRecipientConfig} objects, preferring defined values from `a` over `b`.
12517
+ *
12518
+ * @param a - primary config whose defined values take precedence
12519
+ * @param b - fallback config supplying values when `a` fields are undefined
12520
+ * @returns the merged config
12318
12521
  */ function mergeNotificationUserDefaultNotificationBoxRecipientConfig(a, b) {
12319
12522
  var c = mergeNotificationBoxRecipientTemplateConfigRecords(a.c, b.c);
12320
12523
  var result = _object_spread_props$7(_object_spread$9({}, util.mergeObjects([
@@ -12345,6 +12548,10 @@ function _object_spread_props$7(target, source) {
12345
12548
  })(exports.NotificationBoxRecipientTemplateConfigBoolean || (exports.NotificationBoxRecipientTemplateConfigBoolean = {}));
12346
12549
  /**
12347
12550
  * Merges two {@link NotificationBoxRecipientTemplateConfigRecord} objects, preferring defined values from `a`.
12551
+ *
12552
+ * @param a - primary record whose defined values take precedence
12553
+ * @param b - fallback record supplying values when `a` entries are undefined
12554
+ * @returns the merged template config record
12348
12555
  */ function mergeNotificationBoxRecipientTemplateConfigRecords(a, b) {
12349
12556
  var mergeConfigs = util.mergeObjectsFunction(util.KeyValueTypleValueFilter.UNDEFINED);
12350
12557
  return mergeConfigs([
@@ -12406,6 +12613,8 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12406
12613
  /**
12407
12614
  * Creates a Firestore field converter for {@link NotificationBoxRecipientTemplateConfigRecord},
12408
12615
  * using bitwise encoding for compact storage.
12616
+ *
12617
+ * @returns a Firestore field converter that encodes and decodes template config records using bitwise encoding
12409
12618
  */ function firestoreNotificationBoxRecipientTemplateConfigRecord() {
12410
12619
  return firestoreBitwiseObjectMap({
12411
12620
  dencoder: notificationBoxRecipientTemplateConfigDencoder
@@ -12495,6 +12704,9 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12495
12704
  /**
12496
12705
  * Converts a {@link NotificationBoxRecipientTemplateConfigRecord} to an array of entries with their type keys.
12497
12706
  *
12707
+ * @param input - the template config record to convert
12708
+ * @returns an array of entries each containing a type key and the corresponding channel config
12709
+ *
12498
12710
  * @example
12499
12711
  * ```ts
12500
12712
  * const array = notificationBoxRecipientTemplateConfigRecordToArray({ 'comment': { se: true } });
@@ -12513,6 +12725,9 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12513
12725
  }
12514
12726
  /**
12515
12727
  * Converts a {@link NotificationBoxRecipientTemplateConfigArray} back to a {@link NotificationBoxRecipientTemplateConfigRecord}.
12728
+ *
12729
+ * @param input - the array of typed config entries to convert
12730
+ * @returns a record keyed by template type
12516
12731
  */ function notificationBoxRecipientTemplateConfigArrayToRecord(input) {
12517
12732
  var map = {};
12518
12733
  input.forEach(function(x) {
@@ -12555,6 +12770,7 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12555
12770
  *
12556
12771
  * @param items - notification items to classify
12557
12772
  * @param considerReadIfCreatedBefore - optional cutoff date; items created at or before this date are treated as read
12773
+ * @returns an object containing both the read and unread item arrays along with the input cutoff date
12558
12774
  *
12559
12775
  * @example
12560
12776
  * ```ts
@@ -12698,11 +12914,17 @@ var NotificationUserDocument = /*#__PURE__*/ function(AbstractFirestoreDocument)
12698
12914
  });
12699
12915
  /**
12700
12916
  * Creates a Firestore collection reference for {@link NotificationUser} documents.
12917
+ *
12918
+ * @param context - Firestore context to create the collection reference from
12919
+ * @returns a typed collection reference for NotificationUser documents
12701
12920
  */ function notificationUserCollectionReference(context) {
12702
12921
  return context.collection(notificationUserIdentity.collectionName);
12703
12922
  }
12704
12923
  /**
12705
12924
  * Creates a typed {@link NotificationUserFirestoreCollection} bound to the given Firestore context.
12925
+ *
12926
+ * @param firestoreContext - Firestore context to bind the collection to
12927
+ * @returns a typed Firestore collection for NotificationUser documents
12706
12928
  */ function notificationUserFirestoreCollection(firestoreContext) {
12707
12929
  return firestoreContext.firestoreCollection({
12708
12930
  modelIdentity: notificationUserIdentity,
@@ -12765,11 +12987,17 @@ var NotificationSummaryDocument = /*#__PURE__*/ function(AbstractFirestoreDocume
12765
12987
  });
12766
12988
  /**
12767
12989
  * Creates a Firestore collection reference for {@link NotificationSummary} documents.
12990
+ *
12991
+ * @param context - Firestore context to create the collection reference from
12992
+ * @returns a typed collection reference for NotificationSummary documents
12768
12993
  */ function notificationSummaryCollectionReference(context) {
12769
12994
  return context.collection(notificationSummaryIdentity.collectionName);
12770
12995
  }
12771
12996
  /**
12772
12997
  * Creates a typed {@link NotificationSummaryFirestoreCollection} bound to the given Firestore context.
12998
+ *
12999
+ * @param firestoreContext - Firestore context to bind the collection to
13000
+ * @returns a typed Firestore collection for NotificationSummary documents
12773
13001
  */ function notificationSummaryFirestoreCollection(firestoreContext) {
12774
13002
  return firestoreContext.firestoreCollection({
12775
13003
  modelIdentity: notificationSummaryIdentity,
@@ -12832,11 +13060,17 @@ var NotificationBoxDocument = /*#__PURE__*/ function(AbstractFirestoreDocument)
12832
13060
  });
12833
13061
  /**
12834
13062
  * Creates a Firestore collection reference for {@link NotificationBox} documents.
13063
+ *
13064
+ * @param context - Firestore context to create the collection reference from
13065
+ * @returns a typed collection reference for NotificationBox documents
12835
13066
  */ function notificationBoxCollectionReference(context) {
12836
13067
  return context.collection(notificationBoxIdentity.collectionName);
12837
13068
  }
12838
13069
  /**
12839
13070
  * Creates a typed {@link NotificationBoxFirestoreCollection} bound to the given Firestore context.
13071
+ *
13072
+ * @param firestoreContext - Firestore context to bind the collection to
13073
+ * @returns a typed Firestore collection for NotificationBox documents
12840
13074
  */ function notificationBoxFirestoreCollection(firestoreContext) {
12841
13075
  return firestoreContext.firestoreCollection({
12842
13076
  modelIdentity: notificationBoxIdentity,
@@ -13004,6 +13238,9 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13004
13238
  });
13005
13239
  /**
13006
13240
  * Creates a factory that produces {@link Notification} subcollection references for a given {@link NotificationBoxDocument} parent.
13241
+ *
13242
+ * @param context - Firestore context to create subcollection references from
13243
+ * @returns a factory function that creates collection references for a given NotificationBox parent
13007
13244
  */ function notificationCollectionReferenceFactory(context) {
13008
13245
  return function(notificationBox) {
13009
13246
  return context.subcollection(notificationBox.documentRef, notificationIdentity.collectionName);
@@ -13011,6 +13248,9 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13011
13248
  }
13012
13249
  /**
13013
13250
  * Creates a {@link NotificationFirestoreCollectionFactory} bound to the given Firestore context.
13251
+ *
13252
+ * @param firestoreContext - Firestore context to bind the collection factory to
13253
+ * @returns a factory that creates typed Firestore subcollections for Notification documents
13014
13254
  */ function notificationFirestoreCollectionFactory(firestoreContext) {
13015
13255
  var factory = notificationCollectionReferenceFactory(firestoreContext);
13016
13256
  return function(parent) {
@@ -13028,11 +13268,17 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13028
13268
  }
13029
13269
  /**
13030
13270
  * Creates a collection group reference for querying all {@link Notification} documents across all {@link NotificationBox} parents.
13271
+ *
13272
+ * @param context - Firestore context to create the collection group reference from
13273
+ * @returns a typed collection group for querying Notification documents across all parents
13031
13274
  */ function notificationCollectionReference(context) {
13032
13275
  return context.collectionGroup(notificationIdentity.collectionName);
13033
13276
  }
13034
13277
  /**
13035
13278
  * Creates a typed {@link NotificationFirestoreCollectionGroup} bound to the given Firestore context.
13279
+ *
13280
+ * @param firestoreContext - Firestore context to bind the collection group to
13281
+ * @returns a typed Firestore collection group for querying Notification documents across all parents
13036
13282
  */ function notificationFirestoreCollectionGroup(firestoreContext) {
13037
13283
  return firestoreContext.firestoreCollectionGroup({
13038
13284
  modelIdentity: notificationIdentity,
@@ -13081,6 +13327,9 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13081
13327
  });
13082
13328
  /**
13083
13329
  * Creates a factory that produces {@link NotificationWeek} subcollection references for a given {@link NotificationBoxDocument} parent.
13330
+ *
13331
+ * @param context - Firestore context to create subcollection references from
13332
+ * @returns a factory function that creates collection references for a given NotificationBox parent
13084
13333
  */ function notificationWeekCollectionReferenceFactory(context) {
13085
13334
  return function(notificationBox) {
13086
13335
  return context.subcollection(notificationBox.documentRef, notificationWeekIdentity.collectionName);
@@ -13088,6 +13337,9 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13088
13337
  }
13089
13338
  /**
13090
13339
  * Creates a {@link NotificationWeekFirestoreCollectionFactory} bound to the given Firestore context.
13340
+ *
13341
+ * @param firestoreContext - Firestore context to bind the collection factory to
13342
+ * @returns a factory that creates typed Firestore subcollections for NotificationWeek documents
13091
13343
  */ function notificationWeekFirestoreCollectionFactory(firestoreContext) {
13092
13344
  var factory = notificationWeekCollectionReferenceFactory(firestoreContext);
13093
13345
  return function(parent) {
@@ -13105,11 +13357,17 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13105
13357
  }
13106
13358
  /**
13107
13359
  * Creates a collection group reference for querying all {@link NotificationWeek} documents across all {@link NotificationBox} parents.
13360
+ *
13361
+ * @param context - Firestore context to create the collection group reference from
13362
+ * @returns a typed collection group for querying NotificationWeek documents across all parents
13108
13363
  */ function notificationWeekCollectionReference(context) {
13109
13364
  return context.collectionGroup(notificationWeekIdentity.collectionName);
13110
13365
  }
13111
13366
  /**
13112
13367
  * Creates a typed {@link NotificationWeekFirestoreCollectionGroup} bound to the given Firestore context.
13368
+ *
13369
+ * @param firestoreContext - Firestore context to bind the collection group to
13370
+ * @returns a typed Firestore collection group for querying NotificationWeek documents across all parents
13113
13371
  */ function notificationWeekFirestoreCollectionGroup(firestoreContext) {
13114
13372
  return firestoreContext.firestoreCollectionGroup({
13115
13373
  modelIdentity: notificationWeekIdentity,
@@ -13254,16 +13512,42 @@ var notificationBoxModelCrudFunctionsConfig = {
13254
13512
  *
13255
13513
  * Error code constants thrown by the notification server action service.
13256
13514
  * These codes are returned in Firebase function error responses for client-side handling.
13257
- */ /** Thrown when a notification creation request is missing a required ID. */ var CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE = 'CREATE_NOTIFICATION_ID_REQUIRED';
13258
- /** Thrown when attempting to initialize a NotificationBox or NotificationSummary that is already initialized. */ var NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE = 'NOTIFICATION_MODEL_ALREADY_INITIALIZED';
13259
- /** Thrown when the target NotificationBox does not exist. */ var NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE = 'NOTIFICATION_BOX_DOES_NOT_EXIST';
13260
- /** Thrown when attempting to create a NotificationBox for a model that already has one. */ var NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE = 'NOTIFICATION_BOX_EXISTS_FOR_MODEL';
13261
- /** Thrown when the target recipient does not exist in the NotificationBox. */ var NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE = 'NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST';
13262
- /** Thrown when an exclusion target is invalid (e.g., user not associated with the box). */ var NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE = 'NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID';
13263
- /** Thrown when the UID provided for NotificationUser creation is invalid. */ var NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE = 'NOTIFICATION_USER_INVALID_UID_FOR_CREATE';
13264
- /** Thrown when attempting to add a user who has blocked themselves from being added as a recipient. */ var NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE = 'NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS';
13265
- /** Thrown when attempting to update a recipient config that is locked by the user. */ var NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE = 'NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED';
13515
+ */ /**
13516
+ * Thrown when a notification creation request is missing a required ID.
13517
+ */ var CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE = 'CREATE_NOTIFICATION_ID_REQUIRED';
13518
+ /**
13519
+ * Thrown when attempting to initialize a NotificationBox or NotificationSummary that is already initialized.
13520
+ */ var NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE = 'NOTIFICATION_MODEL_ALREADY_INITIALIZED';
13521
+ /**
13522
+ * Thrown when the target NotificationBox does not exist.
13523
+ */ var NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE = 'NOTIFICATION_BOX_DOES_NOT_EXIST';
13524
+ /**
13525
+ * Thrown when attempting to create a NotificationBox for a model that already has one.
13526
+ */ var NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE = 'NOTIFICATION_BOX_EXISTS_FOR_MODEL';
13527
+ /**
13528
+ * Thrown when the target recipient does not exist in the NotificationBox.
13529
+ */ var NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE = 'NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST';
13530
+ /**
13531
+ * Thrown when an exclusion target is invalid (e.g., user not associated with the box).
13532
+ */ var NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE = 'NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID';
13533
+ /**
13534
+ * Thrown when the UID provided for NotificationUser creation is invalid.
13535
+ */ var NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE = 'NOTIFICATION_USER_INVALID_UID_FOR_CREATE';
13536
+ /**
13537
+ * Thrown when attempting to add a user who has blocked themselves from being added as a recipient.
13538
+ */ var NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE = 'NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS';
13539
+ /**
13540
+ * Thrown when attempting to update a recipient config that is locked by the user.
13541
+ */ var NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE = 'NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED';
13266
13542
 
13543
+ function _array_like_to_array$5(arr, len) {
13544
+ if (len == null || len > arr.length) len = arr.length;
13545
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
13546
+ return arr2;
13547
+ }
13548
+ function _array_without_holes$4(arr) {
13549
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
13550
+ }
13267
13551
  function _define_property$8(obj, key, value) {
13268
13552
  if (key in obj) {
13269
13553
  Object.defineProperty(obj, key, {
@@ -13277,6 +13561,12 @@ function _define_property$8(obj, key, value) {
13277
13561
  }
13278
13562
  return obj;
13279
13563
  }
13564
+ function _iterable_to_array$4(iter) {
13565
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
13566
+ }
13567
+ function _non_iterable_spread$4() {
13568
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
13569
+ }
13280
13570
  function _object_spread$8(target) {
13281
13571
  for(var i = 1; i < arguments.length; i++){
13282
13572
  var source = arguments[i] != null ? arguments[i] : {};
@@ -13311,6 +13601,17 @@ function _object_spread_props$6(target, source) {
13311
13601
  }
13312
13602
  return target;
13313
13603
  }
13604
+ function _to_consumable_array$4(arr) {
13605
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$4();
13606
+ }
13607
+ function _unsupported_iterable_to_array$5(o, minLen) {
13608
+ if (!o) return;
13609
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
13610
+ var n = Object.prototype.toString.call(o).slice(8, -1);
13611
+ if (n === "Object" && o.constructor) n = o.constructor.name;
13612
+ if (n === "Map" || n === "Set") return Array.from(n);
13613
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
13614
+ }
13314
13615
  /**
13315
13616
  * Applies an array of config entry params to a {@link NotificationBoxRecipientTemplateConfigRecord},
13316
13617
  * inserting new entries, merging updates, and removing entries marked with `remove: true`.
@@ -13318,31 +13619,29 @@ function _object_spread_props$6(target, source) {
13318
13619
  * @param a - existing config record
13319
13620
  * @param b - array of update params to apply
13320
13621
  * @param limitToAllowedConfigTypes - when provided, filters the result to only include these template types
13622
+ * @returns the updated config record, or undefined if no changes were made
13321
13623
  */ function updateNotificationBoxRecipientTemplateConfigRecord(a, b, limitToAllowedConfigTypes) {
13322
- var c;
13323
- if (b != null) {
13324
- var cArray = notificationBoxRecipientTemplateConfigRecordToArray(a);
13325
- var updatedC = util.ModelRelationUtility.insertCollection(cArray, b, {
13326
- readKey: function readKey(x) {
13327
- return x.type;
13328
- },
13329
- merge: function merge(x, y) {
13330
- return _object_spread$8({}, x, y);
13331
- }
13332
- });
13333
- // remove types marked as remove
13334
- updatedC = util.ModelRelationUtility.removeKeysFromCollection(updatedC, b.filter(function(x) {
13335
- return x.remove;
13336
- }).map(function(x) {
13337
- return x.type;
13338
- }), function(x) {
13624
+ var cArray = notificationBoxRecipientTemplateConfigRecordToArray(a);
13625
+ var updatedC = util.ModelRelationUtility.insertCollection(cArray, b, {
13626
+ readKey: function readKey(x) {
13339
13627
  return x.type;
13340
- });
13341
- c = notificationBoxRecipientTemplateConfigArrayToRecord(updatedC);
13342
- // if the config types are limited to specific types, then filter those only
13343
- if (limitToAllowedConfigTypes) {
13344
- c = util.filterKeysOnPOJOFunction(limitToAllowedConfigTypes)(c);
13628
+ },
13629
+ merge: function merge(x, y) {
13630
+ return _object_spread$8({}, x, y);
13345
13631
  }
13632
+ });
13633
+ // remove types marked as remove
13634
+ updatedC = util.ModelRelationUtility.removeKeysFromCollection(updatedC, b.filter(function(x) {
13635
+ return x.remove;
13636
+ }).map(function(x) {
13637
+ return x.type;
13638
+ }), function(x) {
13639
+ return x.type;
13640
+ });
13641
+ var c = notificationBoxRecipientTemplateConfigArrayToRecord(updatedC);
13642
+ // if the config types are limited to specific types, then filter those only
13643
+ if (limitToAllowedConfigTypes) {
13644
+ c = util.filterKeysOnPOJOFunction(limitToAllowedConfigTypes)(c);
13346
13645
  }
13347
13646
  return c;
13348
13647
  }
@@ -13353,6 +13652,7 @@ function _object_spread_props$6(target, source) {
13353
13652
  * @param a - existing config
13354
13653
  * @param b - update params to apply
13355
13654
  * @param limitToAllowedConfigTypes - when provided, filters config types to only allowed template types
13655
+ * @returns the updated default recipient config
13356
13656
  */ function updateNotificationUserDefaultNotificationBoxRecipientConfig(a, b, limitToAllowedConfigTypes) {
13357
13657
  var _ref;
13358
13658
  var inputC = b.configs, inputF = b.f, inputBk = b.bk, inputLk = b.lk;
@@ -13369,6 +13669,11 @@ function _object_spread_props$6(target, source) {
13369
13669
  * only if it actually changed. Returns `undefined` if no changes were detected.
13370
13670
  *
13371
13671
  * Automatically sets `ns = true` (needs sync) when changes are detected and the recipient has been indexed.
13672
+ *
13673
+ * @param a - existing per-box recipient config
13674
+ * @param b - update params to apply
13675
+ * @param limitToAllowedConfigTypes - when provided, filters template config types to only allowed types
13676
+ * @returns the updated config if changes were detected, or undefined if no changes occurred
13372
13677
  */ function updateNotificationUserNotificationBoxRecipientConfigIfChanged(a, b, limitToAllowedConfigTypes) {
13373
13678
  var _ref;
13374
13679
  var inputC = b.configs, inputRm = b.rm, inputLk = b.lk, inputBk = b.bk;
@@ -13399,6 +13704,11 @@ function _object_spread_props$6(target, source) {
13399
13704
  * through the optional {@link AppNotificationTemplateTypeInfoRecordService}.
13400
13705
  *
13401
13706
  * Returns `undefined` if no changes were made.
13707
+ *
13708
+ * @param a - existing per-box recipient config array
13709
+ * @param b - array of update params to apply to matching boxes
13710
+ * @param filterWithService - optional service used to filter template types to only those valid for each box's model
13711
+ * @returns the updated config array if any changes occurred, or undefined if nothing changed
13402
13712
  */ function updateNotificationUserNotificationBoxRecipientConfigs(a, b, filterWithService) {
13403
13713
  var boxesMap = util.makeModelMap(a, function(x) {
13404
13714
  return x.nb;
@@ -13428,7 +13738,7 @@ function _object_spread_props$6(target, source) {
13428
13738
  });
13429
13739
  var result;
13430
13740
  if (hasChanges) {
13431
- result = Array.from(boxesMap.values());
13741
+ result = _to_consumable_array$4(boxesMap.values());
13432
13742
  }
13433
13743
  return result;
13434
13744
  }
@@ -13567,6 +13877,9 @@ function _ts_generator$4(thisArg, body) {
13567
13877
  *
13568
13878
  * Maps friendly field names (`subject`, `message`, `createdBy`, etc.) to their Firestore abbreviations
13569
13879
  * and filters out null/undefined metadata values.
13880
+ *
13881
+ * @param input - friendly input with readable field names
13882
+ * @returns the low-level template using Firestore field abbreviations
13570
13883
  */ function createNotificationTemplate(input) {
13571
13884
  var _ref, _ref1;
13572
13885
  var inputNotificationModel = input.notificationModel, type = input.type, unique = input.unique, overrideExistingTask = input.overrideExistingTask, // notification
@@ -13613,6 +13926,9 @@ function _ts_generator$4(thisArg, body) {
13613
13926
  * Determines whether a notification should be created based on the explicit toggle and throttle settings.
13614
13927
  *
13615
13928
  * Returns false if `sendNotification` is explicitly false, or if the throttle window hasn't elapsed.
13929
+ *
13930
+ * @param input - the send control parameters including the toggle and throttle configuration
13931
+ * @returns true if the notification should be created and sent
13616
13932
  */ function shouldSendCreatedNotificationInput(input) {
13617
13933
  var sendNotification = input.sendNotification, sendNotificationThrottleDate = input.sendNotificationThrottleDate, inputSendNotificationThrottleTime = input.sendNotificationThrottleTime;
13618
13934
  var sendNotificationThrottleTime = inputSendNotificationThrottleTime !== null && inputSendNotificationThrottleTime !== void 0 ? inputSendNotificationThrottleTime : util.MS_IN_HOUR;
@@ -13626,6 +13942,8 @@ function _ts_generator$4(thisArg, body) {
13626
13942
  *
13627
13943
  * For unique task notifications, generates a deterministic document ID from the target model and task type.
13628
13944
  *
13945
+ * @param input - the creation parameters including template, context, and accessor
13946
+ * @returns the document reference and notification data pair, with `notificationCreated` set to false
13629
13947
  * @throws {Error} When neither an accessor nor sufficient context is provided
13630
13948
  * @throws {Error} When `unique=true` but no target model is specified
13631
13949
  */ function createNotificationDocumentPair(input) {
@@ -13634,15 +13952,13 @@ function _ts_generator$4(thisArg, body) {
13634
13952
  var notificationModel = template.notificationModel, inputCat = template.cat, st = template.st, sat = template.sat, r = template.r, rf = template.rf, n = template.n, ts = template.ts, es = template.es, ps = template.ps, ns = template.ns, ois = template.ois, ots = template.ots, tpr = template.tpr, inputUnique = template.unique, inputOverrideExistingTask = template.overrideExistingTask;
13635
13953
  /**
13636
13954
  * Use the input, or default to true if inputUnique is true.
13637
- */ var overrideExistingTask = inputOverrideExistingTask != null ? inputOverrideExistingTask : inputUnique ? true : undefined;
13955
+ */ var overrideExistingTask = inputOverrideExistingTask !== null && inputOverrideExistingTask !== void 0 ? inputOverrideExistingTask : inputUnique ? true : undefined;
13638
13956
  var accessor = inputAccessor;
13639
13957
  var notificationBoxId = notificationBoxIdForModel(notificationModel);
13640
- if (!accessor && notificationBoxId) {
13641
- if (context) {
13642
- var notificationCollectionFactory = context.notificationCollectionFactory, notificationBoxCollection = context.notificationBoxCollection;
13643
- var notificationBoxDocument = notificationBoxCollection.documentAccessorForTransaction(transaction).loadDocumentForId(notificationBoxId);
13644
- accessor = notificationCollectionFactory(notificationBoxDocument).documentAccessorForTransaction(transaction);
13645
- }
13958
+ if (!accessor && notificationBoxId && context) {
13959
+ var notificationCollectionFactory = context.notificationCollectionFactory, notificationBoxCollection = context.notificationBoxCollection;
13960
+ var notificationBoxDocument = notificationBoxCollection.documentAccessorForTransaction(transaction).loadDocumentForId(notificationBoxId);
13961
+ accessor = notificationCollectionFactory(notificationBoxDocument).documentAccessorForTransaction(transaction);
13646
13962
  }
13647
13963
  if (!accessor) {
13648
13964
  throw new Error('createNotificationDocument() failed as neither an accessor nor sufficient information was provided about the target.');
@@ -13723,6 +14039,10 @@ function _ts_generator$4(thisArg, body) {
13723
14039
  }
13724
14040
  /**
13725
14041
  * Internal function used by createNotificationDocument().
14042
+ *
14043
+ * @param input - send control parameters (throttle settings, shouldCreateNotification flag)
14044
+ * @param pair - the document pair created by {@link createNotificationDocumentPair}
14045
+ * @returns the pair with `notificationCreated` updated to reflect whether the document was saved
13726
14046
  */ function _createNotificationDocumentFromPair(input, pair) {
13727
14047
  return _async_to_generator$4(function() {
13728
14048
  var notification, notificationDocument, isNotificationTask, overrideExistingTask;
@@ -13773,6 +14093,9 @@ function _ts_generator$4(thisArg, body) {
13773
14093
  *
13774
14094
  * For unique tasks with `overrideExistingTask`, uses `set()` to replace existing documents.
13775
14095
  * Otherwise uses `create()` which fails if the document already exists.
14096
+ *
14097
+ * @param input - the creation parameters including template, context, send control settings
14098
+ * @returns the document pair with `notificationCreated` reflecting whether the document was saved
13776
14099
  */ function createNotificationDocument(input) {
13777
14100
  return _async_to_generator$4(function() {
13778
14101
  var pair;
@@ -13789,6 +14112,9 @@ function _ts_generator$4(thisArg, body) {
13789
14112
  * Creates and saves a notification only if sending conditions are met (not throttled, not explicitly disabled).
13790
14113
  *
13791
14114
  * Returns `undefined` if the notification was not created.
14115
+ *
14116
+ * @param input - the creation parameters including template, context, and send control settings
14117
+ * @returns the document pair if the notification was created, or undefined if it was skipped
13792
14118
  */ function createNotificationDocumentIfSending(input) {
13793
14119
  return _async_to_generator$4(function() {
13794
14120
  var pair;
@@ -13867,6 +14193,8 @@ function _object_spread_props$5(target, source) {
13867
14193
  /**
13868
14194
  * Creates a {@link CreateNotificationTaskTemplate} with `TASK_NOTIFICATION` send type and no recipients.
13869
14195
  *
14196
+ * @param input - task template input parameters
14197
+ * @returns the configured task notification template
13870
14198
  * @throws {Error} When `unique=true` but no `notificationModel` or target model is specified.
13871
14199
  *
13872
14200
  * @example
@@ -13904,11 +14232,17 @@ function _array_like_to_array$4(arr, len) {
13904
14232
  function _array_with_holes$1(arr) {
13905
14233
  if (Array.isArray(arr)) return arr;
13906
14234
  }
14235
+ function _array_without_holes$3(arr) {
14236
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
14237
+ }
13907
14238
  function _class_call_check$5(instance, Constructor) {
13908
14239
  if (!(instance instanceof Constructor)) {
13909
14240
  throw new TypeError("Cannot call a class as a function");
13910
14241
  }
13911
14242
  }
14243
+ function _iterable_to_array$3(iter) {
14244
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
14245
+ }
13912
14246
  function _iterable_to_array_limit$1(arr, i) {
13913
14247
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
13914
14248
  if (_i == null) return;
@@ -13936,9 +14270,15 @@ function _iterable_to_array_limit$1(arr, i) {
13936
14270
  function _non_iterable_rest$1() {
13937
14271
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
13938
14272
  }
14273
+ function _non_iterable_spread$3() {
14274
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14275
+ }
13939
14276
  function _sliced_to_array$1(arr, i) {
13940
14277
  return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$1();
13941
14278
  }
14279
+ function _to_consumable_array$3(arr) {
14280
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$3();
14281
+ }
13942
14282
  function _unsupported_iterable_to_array$4(o, minLen) {
13943
14283
  if (!o) return;
13944
14284
  if (typeof o === "string") return _array_like_to_array$4(o, minLen);
@@ -13950,6 +14290,8 @@ function _unsupported_iterable_to_array$4(o, minLen) {
13950
14290
  /**
13951
14291
  * Creates a {@link NotificationTemplateTypeInfoRecord} from an array of template type info entries.
13952
14292
  *
14293
+ * @param infoArray - array of template type info entries to index
14294
+ * @returns a record keyed by template type
13953
14295
  * @throws {Error} When duplicate template types are found in the input array.
13954
14296
  *
13955
14297
  * @example
@@ -13986,6 +14328,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
13986
14328
  * Handles alternative model identities defined in {@link NotificationTemplateTypeInfoIdentityInfoAlternativeModelIdentityPair}.
13987
14329
  *
13988
14330
  * @param appNotificationTemplateTypeInfoRecord - the complete template type registry for the application
14331
+ * @returns a fully initialized service with indexed lookups for fast template type discovery
13989
14332
  *
13990
14333
  * @example
13991
14334
  * ```ts
@@ -14020,10 +14363,10 @@ function _unsupported_iterable_to_array$4(o, minLen) {
14020
14363
  allKnownTemplateTypeInfo.push(info);
14021
14364
  allKnownTemplateTypes.push(info.type);
14022
14365
  });
14023
- var allNotificationModelIdentityValues = Array.from(allNotificationModelIdentityValuesSet);
14366
+ var allNotificationModelIdentityValues = _to_consumable_array$3(allNotificationModelIdentityValuesSet);
14024
14367
  var notificationModelTemplateInfoMap = notificationModelTypeInfoMapBuilder.map();
14025
14368
  var targetModelTemplateInfoMap = targetModelTypeInfoMapBuilder.map();
14026
- var notificationModelTemplateTypesMap = new Map(Array.from(notificationModelTemplateInfoMap.entries()).map(function(param) {
14369
+ var notificationModelTemplateTypesMap = new Map(_to_consumable_array$3(notificationModelTemplateInfoMap.entries()).map(function(param) {
14027
14370
  var _param = _sliced_to_array$1(param, 2), k = _param[0], x = _param[1];
14028
14371
  return [
14029
14372
  k,
@@ -14032,7 +14375,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
14032
14375
  })
14033
14376
  ];
14034
14377
  }));
14035
- var targetModelTemplateTypesMap = new Map(Array.from(targetModelTemplateInfoMap.entries()).map(function(param) {
14378
+ var targetModelTemplateTypesMap = new Map(_to_consumable_array$3(targetModelTemplateInfoMap.entries()).map(function(param) {
14036
14379
  var _param = _sliced_to_array$1(param, 2), k = _param[0], x = _param[1];
14037
14380
  return [
14038
14381
  k,
@@ -14236,6 +14579,7 @@ function _ts_generator$3(thisArg, body) {
14236
14579
  *
14237
14580
  * @param fn - base function that generates message content per recipient
14238
14581
  * @param extras - optional delivery customization (global recipients, send callbacks)
14582
+ * @returns a {@link NotificationMessageFunction} with the extras attached
14239
14583
  *
14240
14584
  * @example
14241
14585
  * ```ts
@@ -14263,6 +14607,8 @@ function _ts_generator$3(thisArg, body) {
14263
14607
  *
14264
14608
  * Useful as a placeholder factory for template types that should not produce deliverable content.
14265
14609
  *
14610
+ * @returns a factory that produces no-content message functions
14611
+ *
14266
14612
  * @example
14267
14613
  * ```ts
14268
14614
  * const factory = noContentNotificationMessageFunctionFactory();
@@ -14271,7 +14617,7 @@ function _ts_generator$3(thisArg, body) {
14271
14617
  * // msg.flag === NotificationMessageFlag.NO_CONTENT
14272
14618
  * ```
14273
14619
  */ function noContentNotificationMessageFunctionFactory() {
14274
- return function(config) {
14620
+ return function(_config) {
14275
14621
  return _async_to_generator$3(function() {
14276
14622
  return _ts_generator$3(this, function(_state) {
14277
14623
  // const { item } = config;
@@ -14306,6 +14652,8 @@ function _ts_generator$3(thisArg, body) {
14306
14652
  * Query constraints for finding {@link NotificationUser} documents that have pending config syncs (`ns == true`).
14307
14653
  *
14308
14654
  * Used by the server to discover users whose configs need to be synced to their NotificationBox recipients.
14655
+ *
14656
+ * @returns array of Firestore query constraints filtering for users needing sync
14309
14657
  */ function notificationUsersFlaggedForNeedsSyncQuery() {
14310
14658
  return [
14311
14659
  where('ns', '==', true)
@@ -14315,6 +14663,7 @@ function _ts_generator$3(thisArg, body) {
14315
14663
  * Query constraints for finding {@link NotificationUser} documents that have any of the given exclusion IDs in their `x` array.
14316
14664
  *
14317
14665
  * @param exclusionId - one or more box IDs or collection name prefixes to match against
14666
+ * @returns array of Firestore query constraints filtering for users with matching exclusions
14318
14667
  */ function notificationUserHasExclusionQuery(exclusionId) {
14319
14668
  return [
14320
14669
  where('x', 'array-contains-any', exclusionId)
@@ -14323,6 +14672,8 @@ function _ts_generator$3(thisArg, body) {
14323
14672
  // MARK: NotificationSummary
14324
14673
  /**
14325
14674
  * Query constraints for finding {@link NotificationSummary} documents that need server-side initialization (`s == true`).
14675
+ *
14676
+ * @returns array of Firestore query constraints filtering for summaries needing initialization
14326
14677
  */ function notificationSummariesFlaggedForNeedsInitializationQuery() {
14327
14678
  return [
14328
14679
  where('s', '==', true)
@@ -14332,6 +14683,8 @@ function _ts_generator$3(thisArg, body) {
14332
14683
  // MARK: NotificationBox
14333
14684
  /**
14334
14685
  * Query constraints for finding {@link NotificationBox} documents that need server-side initialization (`s == true`).
14686
+ *
14687
+ * @returns array of Firestore query constraints filtering for boxes needing initialization
14335
14688
  */ function notificationBoxesFlaggedForNeedsInitializationQuery() {
14336
14689
  return [
14337
14690
  where('s', '==', true)
@@ -14341,6 +14694,8 @@ function _ts_generator$3(thisArg, body) {
14341
14694
  * Query constraints for finding {@link NotificationBox} documents flagged as invalid (`fi == true`).
14342
14695
  *
14343
14696
  * Used by the server to clean up boxes that could not be initialized.
14697
+ *
14698
+ * @returns array of Firestore query constraints filtering for boxes flagged as invalid
14344
14699
  */ function notificationBoxesFlaggedInvalidQuery() {
14345
14700
  return [
14346
14701
  where('fi', '==', true)
@@ -14354,6 +14709,7 @@ function _ts_generator$3(thisArg, body) {
14354
14709
  * This is the primary query used by the send queue processor.
14355
14710
  *
14356
14711
  * @param now - reference time for the `sat` comparison (defaults to current time)
14712
+ * @returns array of Firestore query constraints filtering for notifications past their scheduled send time
14357
14713
  */ function notificationsPastSendAtTimeQuery() {
14358
14714
  var now = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
14359
14715
  return [
@@ -14364,6 +14720,8 @@ function _ts_generator$3(thisArg, body) {
14364
14720
  /**
14365
14721
  * Query constraints for finding {@link Notification} documents marked as done (`d == true`)
14366
14722
  * and ready to be archived to {@link NotificationWeek} and then deleted.
14723
+ *
14724
+ * @returns array of Firestore query constraints filtering for completed notifications ready to archive
14367
14725
  */ function notificationsReadyForCleanupQuery() {
14368
14726
  return [
14369
14727
  where('d', '==', true)
@@ -14400,6 +14758,10 @@ function _unsupported_iterable_to_array$3(o, minLen) {
14400
14758
  *
14401
14759
  * Used when combining results from multiple send batches within the same channel.
14402
14760
  *
14761
+ * @param a - first result to merge
14762
+ * @param b - second result to merge
14763
+ * @returns a new result with all recipient lists concatenated from both inputs
14764
+ *
14403
14765
  * @example
14404
14766
  * ```ts
14405
14767
  * const combined = mergeNotificationSendMessagesResult(firstBatchResult, secondBatchResult);
@@ -14466,6 +14828,8 @@ function _object_spread_props$4(target, source) {
14466
14828
  * Use this when the handler needs more time but doesn't want to increment the failure counter.
14467
14829
  * The task will be re-queued without counting as an error attempt.
14468
14830
  *
14831
+ * @returns an empty checkpoint array signaling in-progress without failure
14832
+ *
14469
14833
  * @example
14470
14834
  * ```ts
14471
14835
  * // Waiting for an external process — delay without failing
@@ -14481,6 +14845,7 @@ function _object_spread_props$4(target, source) {
14481
14845
  *
14482
14846
  * @param delayUntil - absolute date or relative milliseconds from the task's run start time
14483
14847
  * @param updateMetadata - optional metadata updates to merge into the notification item
14848
+ * @returns a task result that re-queues the task after the specified delay without marking it failed
14484
14849
  *
14485
14850
  * @example
14486
14851
  * ```ts
@@ -14502,6 +14867,7 @@ function _object_spread_props$4(target, source) {
14502
14867
  *
14503
14868
  * @param completedParts - checkpoint string(s) that were just completed
14504
14869
  * @param updateMetadata - optional metadata updates to merge into the notification item
14870
+ * @returns a task result marking the given checkpoints complete while keeping the task running
14505
14871
  *
14506
14872
  * @example
14507
14873
  * ```ts
@@ -14518,6 +14884,7 @@ function _object_spread_props$4(target, source) {
14518
14884
  * Returns a result indicating the task completed successfully. The notification document will be deleted.
14519
14885
  *
14520
14886
  * @param updateMetadata - optional final metadata update (applied before deletion if subtasks need it)
14887
+ * @returns a task result signaling successful completion; the notification document will be deleted
14521
14888
  *
14522
14889
  * @example
14523
14890
  * ```ts
@@ -14537,6 +14904,7 @@ function _object_spread_props$4(target, source) {
14537
14904
  *
14538
14905
  * @param updateMetadata - optional metadata updates
14539
14906
  * @param removeFromCompletedCheckpoints - checkpoint(s) to remove from the completed set (e.g., to retry a checkpoint)
14907
+ * @returns a task result signaling failure; the error attempt counter is incremented
14540
14908
  *
14541
14909
  * @example
14542
14910
  * ```ts
@@ -14558,6 +14926,7 @@ function _object_spread_props$4(target, source) {
14558
14926
  *
14559
14927
  * @param result - the task result to wrap
14560
14928
  * @param force - when true, overrides any existing `canRunNextCheckpoint` value
14929
+ * @returns a copy of the result with `canRunNextCheckpoint` set to true
14561
14930
  */ function notificationTaskCanRunNextCheckpoint(result, force) {
14562
14931
  if (force || result.canRunNextCheckpoint == null) {
14563
14932
  result = _object_spread_props$4(_object_spread$6({}, result), {
@@ -14631,6 +15000,8 @@ function _object_spread_props$3(target, source) {
14631
15000
  * Internal helper that marks the `'processing'` checkpoint complete and schedules the `'cleanup'` phase.
14632
15001
  *
14633
15002
  * Prefer using {@link notificationSubtaskComplete} in subtask handlers instead of calling this directly.
15003
+ *
15004
+ * @returns a partially-complete task result with the processing checkpoint marked done
14634
15005
  */ function completeSubtaskProcessingAndScheduleCleanupTaskResult() {
14635
15006
  return notificationTaskPartiallyComplete([
14636
15007
  'processing'
@@ -14642,6 +15013,9 @@ function _object_spread_props$3(target, source) {
14642
15013
  * Unlike {@link notificationTaskComplete}, this signals that the cleanup checkpoint should still run.
14643
15014
  * Use `canRunNextCheckpoint: true` in options to run cleanup immediately in the same execution.
14644
15015
  *
15016
+ * @param options - optional metadata updates and flag to run cleanup immediately in the same execution
15017
+ * @returns a task result marking the subtask as complete while allowing cleanup to proceed
15018
+ *
14645
15019
  * @example
14646
15020
  * ```ts
14647
15021
  * // Processing done, schedule cleanup for next run
@@ -14734,6 +15108,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14734
15108
  *
14735
15109
  * Filters template configs to only include types applicable to the notification box's model.
14736
15110
  * Used during the server-side sync process to update box recipient entries from user configs.
15111
+ *
15112
+ * @param input - the merged config inputs including uid, global config, box config, and optional existing recipient
15113
+ * @returns the computed effective box recipient with merged config, contact info, and flags
14737
15114
  */ function effectiveNotificationBoxRecipientConfig(input) {
14738
15115
  var _ref, _ref1, _gc_f, _gc_lk, _gc_e, _gc_t;
14739
15116
  var uid = input.uid, inputM = input.m, appNotificationTemplateTypeInfoRecordService = input.appNotificationTemplateTypeInfoRecordService, gc = input.gc, notificationUserNotificationBoxConfig = input.boxConfig, recipient = input.recipient;
@@ -14765,6 +15142,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14765
15142
  * and propagates exclusion flags to the per-box configs.
14766
15143
  *
14767
15144
  * Exclusions not matching any associated notification box are automatically filtered out.
15145
+ *
15146
+ * @param input - the user, exclusions to add, and exclusions to remove
15147
+ * @returns the updated exclusion list and the partial user update to apply
14768
15148
  */ function updateNotificationUserNotificationSendExclusions(input) {
14769
15149
  var notificationUser = input.notificationUser, inputAddExclusions = input.addExclusions, inputRemoveExclusions = input.removeExclusions;
14770
15150
  var associatedNotificationBoxes = notificationUser.b, currentExclusions = notificationUser.x, notificationBoxConfigs = notificationUser.bc;
@@ -14802,6 +15182,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14802
15182
  /**
14803
15183
  * Applies the current exclusion list to per-box configs, setting/clearing the `x` flag and marking
14804
15184
  * changed configs as needing sync (`ns = true`).
15185
+ *
15186
+ * @param params - the exclusion list, per-box configs, and optional flag to recalculate the global ns flag
15187
+ * @returns the updated per-box configs and the recalculated needs-sync flag
14805
15188
  */ function applyExclusionsToNotificationUserNotificationBoxRecipientConfigs(params) {
14806
15189
  var _ref, _ref1;
14807
15190
  var inputX = params.x, inputBc = params.bc, notificationUser = params.notificationUser, recalculateNs = params.recalculateNs;
@@ -14829,6 +15212,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14829
15212
  }
14830
15213
  /**
14831
15214
  * Returns true if any of the per-box configs need syncing (`ns == true`).
15215
+ *
15216
+ * @param configs - array of per-box recipient configs to check
15217
+ * @returns true if at least one config has its needs-sync flag set
14832
15218
  */ function calculateNsForNotificationUserNotificationBoxRecipientConfigs(configs) {
14833
15219
  return configs.some(function(x) {
14834
15220
  return x.ns;
@@ -14837,11 +15223,14 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14837
15223
  /**
14838
15224
  * Creates a {@link NotificationSendExclusionCanSendFunction} from the given exclusion list.
14839
15225
  * Returns true for IDs that don't match any exclusion prefix.
15226
+ *
15227
+ * @param exclusions - the list of box IDs or prefixes that should be excluded from delivery
15228
+ * @returns a predicate function that returns true if the given notification/box ID is not excluded
14840
15229
  */ var notificationSendExclusionCanSendFunction = function notificationSendExclusionCanSendFunction(exclusions) {
14841
15230
  var fn = function fn(notification) {
14842
- return exclusions.findIndex(function(x) {
15231
+ return !exclusions.some(function(x) {
14843
15232
  return notification.startsWith(x);
14844
- }) === -1;
15233
+ });
14845
15234
  };
14846
15235
  fn._exclusions = exclusions;
14847
15236
  return fn;
@@ -14850,12 +15239,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14850
15239
  /**
14851
15240
  * Returns true if all channels on the notification have reached a terminal state
14852
15241
  * (NONE, NO_TRY, SENT, or SKIPPED). Used to determine if the notification can be marked done.
15242
+ *
15243
+ * @param input - the per-channel send flags to evaluate
15244
+ * @returns true if all channels are in a terminal send state
14853
15245
  */ function notificationSendFlagsImplyIsComplete(input) {
14854
15246
  return isCompleteNotificationSendState(input.es) && isCompleteNotificationSendState(input.ps) && isCompleteNotificationSendState(input.ts) && isCompleteNotificationSendState(input.ns);
14855
15247
  }
14856
15248
  /**
14857
15249
  * Returns true if the given send state is terminal — no further send attempts will be made.
14858
15250
  * Terminal states: NONE, NO_TRY, SENT, SKIPPED.
15251
+ *
15252
+ * @param input - the send state to evaluate
15253
+ * @returns true if the state is terminal and no further delivery will be attempted
14859
15254
  */ function isCompleteNotificationSendState(input) {
14860
15255
  var isComplete = false;
14861
15256
  switch(input){
@@ -14865,7 +15260,11 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14865
15260
  case exports.NotificationSendState.SKIPPED:
14866
15261
  isComplete = true;
14867
15262
  break;
14868
- default:
15263
+ case exports.NotificationSendState.QUEUED:
15264
+ case exports.NotificationSendState.SENT_PARTIAL:
15265
+ case exports.NotificationSendState.SEND_ERROR:
15266
+ case exports.NotificationSendState.BUILD_ERROR:
15267
+ case exports.NotificationSendState.CONFIG_ERROR:
14869
15268
  isComplete = false;
14870
15269
  break;
14871
15270
  }
@@ -14873,6 +15272,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14873
15272
  }
14874
15273
  /**
14875
15274
  * Resolves which recipient groups (global, box, explicit) are allowed based on the {@link NotificationRecipientSendFlag}.
15275
+ *
15276
+ * @param flag - the recipient send flag controlling which groups are included
15277
+ * @returns an object indicating which recipient groups are permitted for this notification
14876
15278
  */ function allowedNotificationRecipients(flag) {
14877
15279
  var canSendToGlobalRecipients = true;
14878
15280
  var canSendToBoxRecipients = true;
@@ -14906,6 +15308,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14906
15308
  *
14907
15309
  * Only notifications that can be sent to box recipients are archived (notifications restricted
14908
15310
  * to only explicit or only global recipients are not saved to the weekly archive).
15311
+ *
15312
+ * @param notification - the notification to check
15313
+ * @returns true if the notification should be saved to the weekly archive after delivery
14909
15314
  */ function shouldSaveNotificationToNotificationWeek(notification) {
14910
15315
  return allowedNotificationRecipients(notification.rf).canSendToBoxRecipients;
14911
15316
  }
@@ -14913,6 +15318,10 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14913
15318
  /**
14914
15319
  * Merges a partial update into a {@link NotificationUserNotificationBoxRecipientConfig},
14915
15320
  * preserving user-controlled fields (`nb`, `rm`, `ns`, `lk`, `bk`) and respecting OPT_OUT state.
15321
+ *
15322
+ * @param a - base user box recipient config to merge into
15323
+ * @param b - partial update to apply on top of the base
15324
+ * @returns the merged config with protected fields retained from `a`
14916
15325
  */ function mergeNotificationUserNotificationBoxRecipientConfigs(a, b) {
14917
15326
  var _b_f;
14918
15327
  return _object_spread_props$2(_object_spread$4({}, mergeNotificationBoxRecipients(a, b)), {
@@ -14927,6 +15336,10 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14927
15336
  }
14928
15337
  /**
14929
15338
  * Merges a partial update into a {@link NotificationBoxRecipient}, deeply merging the `c` (config record) field.
15339
+ *
15340
+ * @param a - base recipient to merge into
15341
+ * @param b - partial recipient update to apply on top of the base
15342
+ * @returns the merged recipient with deeply merged template config records
14930
15343
  */ function mergeNotificationBoxRecipients(a, b) {
14931
15344
  return _object_spread_props$2(_object_spread$4({}, a, b), {
14932
15345
  // configs should be merged/ovewritten
@@ -14936,6 +15349,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14936
15349
  /**
14937
15350
  * Resolves a {@link NotificationBoxDocument} from a reference pair, loading by model key if no document is provided directly.
14938
15351
  *
15352
+ * @param input - reference pair containing either a direct document or a model key to load from
15353
+ * @param accessor - Firestore document accessor used to load the document by ID when needed
15354
+ * @returns the resolved NotificationBoxDocument
14939
15355
  * @throws {Error} When neither a document nor a model key is provided.
14940
15356
  */ function loadNotificationBoxDocumentForReferencePair(input, accessor) {
14941
15357
  var inputNotificationBoxDocument = input.notificationBoxDocument, inputNotificationBoxRelatedModelKey = input.notificationBoxRelatedModelKey;
@@ -15079,11 +15495,17 @@ function _is_native_reflect_construct$2() {
15079
15495
  });
15080
15496
  /**
15081
15497
  * Returns the Firestore {@link CollectionReference} for {@link OidcEntry} documents.
15498
+ *
15499
+ * @param context - the Firestore context to use
15500
+ * @returns the CollectionReference for OidcEntry documents
15082
15501
  */ function oidcEntryCollectionReference(context) {
15083
15502
  return context.collection(oidcEntryIdentity.collectionName);
15084
15503
  }
15085
15504
  /**
15086
15505
  * Creates an {@link OidcEntryFirestoreCollection} from the given configuration.
15506
+ *
15507
+ * @param config - the Firestore context and collection configuration
15508
+ * @returns a configured OidcEntryFirestoreCollection
15087
15509
  */ function oidcEntryFirestoreCollection(config) {
15088
15510
  var firestoreContext = config.firestoreContext;
15089
15511
  return firestoreContext.firestoreCollection({
@@ -15099,6 +15521,9 @@ function _is_native_reflect_construct$2() {
15099
15521
 
15100
15522
  /**
15101
15523
  * Query for OidcEntry documents with a specific type.
15524
+ *
15525
+ * @param type - the OIDC entry type to filter by
15526
+ * @returns Firestore query constraints for the given type
15102
15527
  */ function oidcEntriesWithTypeQuery(type) {
15103
15528
  return [
15104
15529
  where('type', '==', type)
@@ -15106,6 +15531,10 @@ function _is_native_reflect_construct$2() {
15106
15531
  }
15107
15532
  /**
15108
15533
  * Query for OidcEntry documents with a specific type and userCode.
15534
+ *
15535
+ * @param type - the OIDC entry type to filter by
15536
+ * @param userCode - the user code to match
15537
+ * @returns Firestore query constraints for the given type and userCode
15109
15538
  */ function oidcEntriesByUserCodeQuery(type, userCode) {
15110
15539
  return [
15111
15540
  where('type', '==', type),
@@ -15114,6 +15543,10 @@ function _is_native_reflect_construct$2() {
15114
15543
  }
15115
15544
  /**
15116
15545
  * Query for OidcEntry documents with a specific type and uid.
15546
+ *
15547
+ * @param type - the OIDC entry type to filter by
15548
+ * @param uid - the Firebase user ID to match
15549
+ * @returns Firestore query constraints for the given type and uid
15117
15550
  */ function oidcEntriesByUidQuery(type, uid) {
15118
15551
  return [
15119
15552
  where('type', '==', type),
@@ -15122,6 +15555,10 @@ function _is_native_reflect_construct$2() {
15122
15555
  }
15123
15556
  /**
15124
15557
  * Query for OidcEntry documents with a specific type and grantId.
15558
+ *
15559
+ * @param type - the OIDC entry type to filter by
15560
+ * @param grantId - the grant ID to match
15561
+ * @returns Firestore query constraints for the given type and grantId
15125
15562
  */ function oidcEntriesByGrantIdQuery(type, grantId) {
15126
15563
  return [
15127
15564
  where('type', '==', type),
@@ -15130,6 +15567,9 @@ function _is_native_reflect_construct$2() {
15130
15567
  }
15131
15568
  /**
15132
15569
  * Query for OidcEntry Client documents owned by a specific user.
15570
+ *
15571
+ * @param ownershipKey - the ownership key identifying the owner
15572
+ * @returns Firestore query constraints for Client entries matching the ownership key
15133
15573
  */ function oidcClientEntriesByOwnerQuery(ownershipKey) {
15134
15574
  return [
15135
15575
  where('type', '==', 'Client'),
@@ -15457,6 +15897,10 @@ function _is_native_reflect_construct$1() {
15457
15897
  var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15458
15898
  /**
15459
15899
  * Creates a StorageFileGroupCreatedStorageFileKey from the input StorageFileGroupId and purpose.
15900
+ *
15901
+ * @param purpose - the purpose identifying the type of file within the group
15902
+ * @param storageFileGroupId - the ID of the parent StorageFileGroup
15903
+ * @returns a deterministic FirestoreCollectionModelKey for the storage file
15460
15904
  */ function storageFileGroupCreatedStorageFileKey(purpose, storageFileGroupId) {
15461
15905
  return firestoreModelKey(storageFileIdentity, "".concat(purpose, "_").concat(storageFileGroupId));
15462
15906
  }
@@ -15651,6 +16095,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15651
16095
  * ```ts
15652
16096
  * const colRef = storageFileCollectionReference(firestoreContext);
15653
16097
  * ```
16098
+ *
16099
+ * @param context - the Firestore context to use
16100
+ * @returns the CollectionReference for StorageFile documents
15654
16101
  */ function storageFileCollectionReference(context) {
15655
16102
  return context.collection(storageFileIdentity.collectionName);
15656
16103
  }
@@ -15662,6 +16109,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15662
16109
  * const collection = storageFileFirestoreCollection(firestoreContext);
15663
16110
  * const doc = collection.documentAccessor().newDocument();
15664
16111
  * ```
16112
+ *
16113
+ * @param firestoreContext - the Firestore context to use
16114
+ * @returns a configured StorageFileFirestoreCollection
15665
16115
  */ function storageFileFirestoreCollection(firestoreContext) {
15666
16116
  return firestoreContext.firestoreCollection({
15667
16117
  modelIdentity: storageFileIdentity,
@@ -15754,6 +16204,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15754
16204
  * ```ts
15755
16205
  * const colRef = storageFileGroupCollectionReference(firestoreContext);
15756
16206
  * ```
16207
+ *
16208
+ * @param context - the Firestore context to use
16209
+ * @returns the CollectionReference for StorageFileGroup documents
15757
16210
  */ function storageFileGroupCollectionReference(context) {
15758
16211
  return context.collection(storageFileGroupIdentity.collectionName);
15759
16212
  }
@@ -15765,6 +16218,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15765
16218
  * const collection = storageFileGroupFirestoreCollection(firestoreContext);
15766
16219
  * const doc = collection.documentAccessor().loadDocumentForId(groupId);
15767
16220
  * ```
16221
+ *
16222
+ * @param firestoreContext - the Firestore context to use
16223
+ * @returns a configured StorageFileGroupFirestoreCollection
15768
16224
  */ function storageFileGroupFirestoreCollection(firestoreContext) {
15769
16225
  return firestoreContext.firestoreCollection({
15770
16226
  modelIdentity: storageFileGroupIdentity,
@@ -15960,6 +16416,7 @@ function _ts_generator$2(thisArg, body) {
15960
16416
  * initial state setup.
15961
16417
  *
15962
16418
  * @param config - optional defaults for creation type, subgroup, and processing state
16419
+ * @returns a factory function that creates StorageFile document pairs
15963
16420
  * @throws {Error} When neither accessor nor context is provided
15964
16421
  * @throws {Error} When no storage path can be resolved from the input
15965
16422
  * @throws {Error} When FOR_STORAGE_FILE_GROUP is used without parentStorageFileGroup or purpose
@@ -16057,6 +16514,9 @@ function _ts_generator$2(thisArg, body) {
16057
16514
  * Convenience function for creating a StorageFileDocumentPair.
16058
16515
  *
16059
16516
  * Calls createStorageFileDocumentPairFactory() with no arguments, then passes the input to the factory and returns the result.
16517
+ *
16518
+ * @param input - the creation input specifying the storage path, purpose, and context
16519
+ * @returns a promise resolving to the created StorageFileDocument and StorageFile data
16060
16520
  */ function createStorageFileDocumentPair(input) {
16061
16521
  return _async_to_generator$2(function() {
16062
16522
  return _ts_generator$2(this, function(_state) {
@@ -16103,6 +16563,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16103
16563
  *
16104
16564
  * @param storageFileGroupId - the group's document ID
16105
16565
  * @param subPath - optional sub-paths to append
16566
+ * @returns the folder path as a SlashPathFolder string
16106
16567
  *
16107
16568
  * @example
16108
16569
  * ```ts
@@ -16128,6 +16589,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16128
16589
  /**
16129
16590
  * Returns the full storage path for a StorageFileGroup's zip file.
16130
16591
  *
16592
+ * @param storageFileGroupId - the group's document ID
16593
+ * @returns the full SlashPath to the group's zip archive
16594
+ *
16131
16595
  * @example
16132
16596
  * ```ts
16133
16597
  * const zipPath = storageFileGroupZipFileStoragePath('abc123');
@@ -16165,6 +16629,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16165
16629
  * const constraints = storageFilesQueuedForProcessingQuery();
16166
16630
  * const results = await collection.query(constraints);
16167
16631
  * ```
16632
+ *
16633
+ * @returns Firestore query constraints for StorageFiles queued for processing
16168
16634
  */ function storageFilesQueuedForProcessingQuery() {
16169
16635
  return [
16170
16636
  where('ps', '==', exports.StorageFileProcessingState.QUEUED_FOR_PROCESSING)
@@ -16176,6 +16642,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16176
16642
  * Used by the cleanup service to find files ready for permanent deletion.
16177
16643
  *
16178
16644
  * @param now - reference time for comparison; defaults to current time
16645
+ * @returns Firestore query constraints for StorageFiles whose scheduled delete date has passed
16179
16646
  *
16180
16647
  * @example
16181
16648
  * ```ts
@@ -16191,6 +16658,10 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16191
16658
  * with optional subgroup filtering.
16192
16659
  *
16193
16660
  * @example
16661
+ * @param input - the user, purpose, and optional subgroup to filter by
16662
+ * @returns Firestore query constraints for the given purpose and user
16663
+ *
16664
+ * @example
16194
16665
  * ```ts
16195
16666
  * const constraints = storageFilePurposeAndUserQuery({
16196
16667
  * user: 'user123',
@@ -16213,6 +16684,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16213
16684
  * Used by the sync service to find files whose group memberships need to be propagated.
16214
16685
  *
16215
16686
  * @example
16687
+ * @returns Firestore query constraints for StorageFiles flagged for group synchronization
16688
+ *
16689
+ * @example
16216
16690
  * ```ts
16217
16691
  * const constraints = storageFileFlaggedForSyncWithGroupsQuery();
16218
16692
  * ```
@@ -16228,6 +16702,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16228
16702
  * Used by the initialization service to find newly-created groups that haven't been synced yet.
16229
16703
  *
16230
16704
  * @example
16705
+ * @returns Firestore query constraints for StorageFileGroups needing initialization
16706
+ *
16707
+ * @example
16231
16708
  * ```ts
16232
16709
  * const constraints = storageFileGroupsFlaggedForNeedsInitializationQuery();
16233
16710
  * ```
@@ -16240,6 +16717,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16240
16717
  * Returns query constraints for StorageFileGroups flagged for content regeneration (`re == true`).
16241
16718
  *
16242
16719
  * @example
16720
+ * @returns Firestore query constraints for StorageFileGroups flagged for content regeneration
16721
+ *
16722
+ * @example
16243
16723
  * ```ts
16244
16724
  * const constraints = storageFileGroupsFlaggedForContentRegenerationQuery();
16245
16725
  * ```
@@ -16254,6 +16734,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16254
16734
  * Invalid groups are typically cleaned up (deleted along with their associated files).
16255
16735
  *
16256
16736
  * @example
16737
+ * @returns Firestore query constraints for StorageFileGroups flagged as invalid
16738
+ *
16739
+ * @example
16257
16740
  * ```ts
16258
16741
  * const constraints = storageFileGroupsFlaggedInvalidQuery();
16259
16742
  * ```
@@ -16276,6 +16759,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16276
16759
  * The created task is unique per StorageFile (only one processing task at a time).
16277
16760
  *
16278
16761
  * @param input - the target StorageFileDocument and optional subtask data
16762
+ * @returns a CreateNotificationTaskTemplate for the StorageFile processing task
16279
16763
  *
16280
16764
  * @example
16281
16765
  * ```ts
@@ -16520,6 +17004,7 @@ function _ts_generator$1(thisArg, body) {
16520
17004
  * Use this within a permission service to define role-based access for StorageFile operations.
16521
17005
  *
16522
17006
  * @param config - the permission output, auth context, and target document
17007
+ * @returns a function that accepts role configuration and returns a GrantRolesOtherwiseFunction
16523
17008
  *
16524
17009
  * @example
16525
17010
  * ```ts
@@ -16530,7 +17015,7 @@ function _ts_generator$1(thisArg, body) {
16530
17015
  * });
16531
17016
  * ```
16532
17017
  */ function grantStorageFileRolesForUserAuthFunction(config) {
16533
- var output = config.output, context = config.context; config.model;
17018
+ var output = config.output, context = config.context;
16534
17019
  return function(input) {
16535
17020
  var rolesForStorageFileUser = input.rolesForStorageFileUser, rolesForStorageFileOwnershipKey = input.rolesForStorageFileOwnershipKey;
16536
17021
  var result = function result() {
@@ -16609,6 +17094,8 @@ function _object_spread$1(target) {
16609
17094
  *
16610
17095
  * Should only be used server-side, as `copy` may not be available on the client.
16611
17096
  *
17097
+ * @returns a factory function that wraps FirebaseStorageAccessorFile instances into StoredFileReader accessors
17098
+ *
16612
17099
  * @example
16613
17100
  * ```ts
16614
17101
  * const factory = storedFileReaderFactory();
@@ -16636,7 +17123,8 @@ function _object_spread$1(target) {
16636
17123
  loadFileStream: file.getStream,
16637
17124
  loadFileMetadata: loadFileMetadata,
16638
17125
  loadCustomMetadata: loadCustomMetadata,
16639
- copy: file.copy // copy is always available on the server-side
17126
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- copy is always available on the server-side
17127
+ copy: file.copy
16640
17128
  };
16641
17129
  return accessor;
16642
17130
  };
@@ -16662,6 +17150,7 @@ function _object_spread$1(target) {
16662
17150
  * Creates a {@link UserUploadsFolderSlashPathFactory} that generates per-user upload folder paths.
16663
17151
  *
16664
17152
  * @param inputBasePath - optional custom base path; defaults to {@link ALL_USER_UPLOADS_FOLDER_PATH}
17153
+ * @returns a factory function that generates per-user upload folder slash paths
16665
17154
  *
16666
17155
  * @example
16667
17156
  * ```ts
@@ -16678,6 +17167,11 @@ function _object_spread$1(target) {
16678
17167
  /**
16679
17168
  * Creates a {@link UserUploadsFolderStoragePathFactory} that includes the storage bucket ID.
16680
17169
  *
17170
+ * @param root0 - the configuration object
17171
+ * @param root0.bucketId - the storage bucket ID to include in each generated path
17172
+ * @param root0.basePath - optional custom base path; defaults to {@link ALL_USER_UPLOADS_FOLDER_PATH}
17173
+ * @returns a factory function that generates per-user StoragePath values including the bucket ID
17174
+ *
16681
17175
  * @example
16682
17176
  * ```ts
16683
17177
  * const factory = userUploadsFolderStoragePathFactory({ bucketId: 'my-bucket' });
@@ -16912,6 +17406,7 @@ function _ts_generator(thisArg, body) {
16912
17406
  * (e.g., `image` matches `image.png`, `image-test.jpg`) at {@link HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL}.
16913
17407
  *
16914
17408
  * @param config - file type, match string, and optional determination levels
17409
+ * @returns an UploadedFileTypeDeterminer that classifies by file name
16915
17410
  *
16916
17411
  * @example
16917
17412
  * ```ts
@@ -16961,6 +17456,7 @@ function _ts_generator(thisArg, body) {
16961
17456
  * exactly equals the configured match string.
16962
17457
  *
16963
17458
  * @param config - file type and folder name to match
17459
+ * @returns an UploadedFileTypeDeterminer that classifies by folder name
16964
17460
  *
16965
17461
  * @example
16966
17462
  * ```ts
@@ -17000,6 +17496,7 @@ function _ts_generator(thisArg, body) {
17000
17496
  * built-in determiners.
17001
17497
  *
17002
17498
  * @param config - file type, path match config, optional bucket/file filters
17499
+ * @returns an UploadedFileTypeDeterminer that classifies by storage path
17003
17500
  *
17004
17501
  * @example
17005
17502
  * ```ts
@@ -17046,6 +17543,7 @@ function _ts_generator(thisArg, body) {
17046
17543
  * If `requireUser` is true, the determination fails when no user can be detected.
17047
17544
  *
17048
17545
  * @param config - root folder, user prefix, and matching options
17546
+ * @returns a wrapper function that adds user detection to any UploadedFileTypeDeterminer
17049
17547
  *
17050
17548
  * @example
17051
17549
  * ```ts
@@ -17057,8 +17555,7 @@ function _ts_generator(thisArg, body) {
17057
17555
  * ```
17058
17556
  */ function determineUserByFolderWrapperFunction(config) {
17059
17557
  var _config_matchSubPath;
17060
- var rootFolder = config.rootFolder, userFolderPrefix = config.userFolderPrefix, _config_requireUser = config.requireUser, requireUser = _config_requireUser === void 0 ? false : _config_requireUser, tmp = config.allowSubPaths, inputAllowSubPaths = tmp === void 0 ? true : tmp;
17061
- var allowSubPaths = inputAllowSubPaths !== null && inputAllowSubPaths !== void 0 ? inputAllowSubPaths : true;
17558
+ var rootFolder = config.rootFolder, userFolderPrefix = config.userFolderPrefix, _config_requireUser = config.requireUser, requireUser = _config_requireUser === void 0 ? false : _config_requireUser, _config_allowSubPaths = config.allowSubPaths, allowSubPaths = _config_allowSubPaths === void 0 ? true : _config_allowSubPaths;
17062
17559
  var subPathMatcherConfig = (_config_matchSubPath = config.matchSubPath) !== null && _config_matchSubPath !== void 0 ? _config_matchSubPath : {
17063
17560
  basePath: util.mergeSlashPaths([
17064
17561
  rootFolder,
@@ -17120,6 +17617,9 @@ function _ts_generator(thisArg, body) {
17120
17617
  /**
17121
17618
  * Convenience wrapper pre-configured for the standard uploads folder structure (`uploads/u/{userId}/...`).
17122
17619
  *
17620
+ * @param config - optional matching options (rootFolder and userFolderPrefix are pre-configured)
17621
+ * @returns a wrapper function that adds user detection for the standard uploads folder structure
17622
+ *
17123
17623
  * @example
17124
17624
  * ```ts
17125
17625
  * const addUser = determineUserByUserUploadsFolderWrapperFunction();
@@ -17146,6 +17646,7 @@ function _ts_generator(thisArg, body) {
17146
17646
  *
17147
17647
  * @param determiner - the determiner to filter
17148
17648
  * @param types - allowed file type identifier(s)
17649
+ * @returns an UploadedFileTypeDeterminer that only returns results for the specified file types
17149
17650
  *
17150
17651
  * @example
17151
17652
  * ```ts
@@ -17189,6 +17690,7 @@ function _ts_generator(thisArg, body) {
17189
17690
  * short-circuited via `completeSearchOnFirstMatch` or `completeSearchAtLevel`.
17190
17691
  *
17191
17692
  * @param config - determiners to combine and optional early-exit settings
17693
+ * @returns a combined UploadedFileTypeDeterminer that returns the highest-confidence match
17192
17694
  *
17193
17695
  * @example
17194
17696
  * ```ts
@@ -17203,9 +17705,9 @@ function _ts_generator(thisArg, body) {
17203
17705
  if (determiners.length === 1) {
17204
17706
  result = determiners[0];
17205
17707
  } else {
17206
- var possibleFileTypes = util.unique(determiners.map(function(d) {
17708
+ var possibleFileTypes = util.unique(determiners.flatMap(function(d) {
17207
17709
  return d.getPossibleFileTypes();
17208
- }).flat());
17710
+ }));
17209
17711
  var completeSearchOnFirstMatch = Boolean(inputCompleteSearchOnFirstMatch);
17210
17712
  var completeSearchAtLevel = completeSearchOnFirstMatch ? LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL : inputCompleteSearchAtLevel !== null && inputCompleteSearchAtLevel !== void 0 ? inputCompleteSearchAtLevel : EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
17211
17713
  result = {
@@ -17305,6 +17807,9 @@ function _ts_generator(thisArg, body) {
17305
17807
  * If a document is provided directly, it is returned as-is. Otherwise, the related model key
17306
17808
  * is converted to a group ID via {@link storageFileGroupIdForModel} and loaded from the accessor.
17307
17809
  *
17810
+ * @param input - reference pair containing either a document or a related model key
17811
+ * @param accessor - document accessor used to load the group document by ID
17812
+ * @returns the resolved StorageFileGroupDocument
17308
17813
  * @throws {Error} When neither storageFileGroupDocument nor storageFileGroupRelatedModelKey is provided
17309
17814
  *
17310
17815
  * @example
@@ -17368,7 +17873,7 @@ function _ts_generator(thisArg, body) {
17368
17873
  ]);
17369
17874
  }
17370
17875
  });
17371
- var re = currentRe || oneOrMoreItemsWereRemoved; // flag removed if any items were removed
17876
+ var re = currentRe !== null && currentRe !== void 0 ? currentRe : oneOrMoreItemsWereRemoved; // flag removed if any items were removed
17372
17877
  // recalculate re if it is false or the retain flag is false
17373
17878
  if (!re || allowRecalculateRegenerateFlag) {
17374
17879
  var flagRegenerate = calculateStorageFileGroupRegeneration({
@@ -17394,6 +17899,7 @@ function _ts_generator(thisArg, body) {
17394
17899
  * - Any embedded file has never been included in the zip (`zat` is unset on the entry)
17395
17900
  *
17396
17901
  * @param input - group state and optional force flag
17902
+ * @returns the regeneration result indicating whether the zip or other derived files need to be regenerated
17397
17903
  *
17398
17904
  * @example
17399
17905
  * ```ts
@@ -17561,6 +18067,9 @@ function _is_native_reflect_construct() {
17561
18067
  * ```ts
17562
18068
  * const colRef = systemStateCollectionReference(firestoreContext);
17563
18069
  * ```
18070
+ *
18071
+ * @param context - the Firestore context to use
18072
+ * @returns the CollectionReference for SystemState documents
17564
18073
  */ function systemStateCollectionReference(context) {
17565
18074
  return context.collection(systemStateIdentity.collectionName);
17566
18075
  }
@@ -17573,6 +18082,7 @@ function _is_native_reflect_construct() {
17573
18082
  *
17574
18083
  * @param firestoreContext - the Firestore context
17575
18084
  * @param converters - map of type identifiers to their data field converters
18085
+ * @returns a configured SystemStateFirestoreCollection with per-type data converters
17576
18086
  *
17577
18087
  * @example
17578
18088
  * ```ts
@@ -17638,10 +18148,13 @@ exports.DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = DEFAULT_UPLOADED_FILE_T
17638
18148
  exports.DEFAULT_WEBSITE_LINK = DEFAULT_WEBSITE_LINK;
17639
18149
  exports.EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP = EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP;
17640
18150
  exports.EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
18151
+ exports.FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR = FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR;
18152
+ exports.FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR = FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR;
17641
18153
  exports.FIREBASE_AUTH_NETWORK_REQUEST_ERROR = FIREBASE_AUTH_NETWORK_REQUEST_ERROR;
17642
18154
  exports.FIREBASE_AUTH_NETWORK_REQUEST_FAILED = FIREBASE_AUTH_NETWORK_REQUEST_FAILED;
17643
18155
  exports.FIREBASE_AUTH_PASSWORD_MAX_LENGTH = FIREBASE_AUTH_PASSWORD_MAX_LENGTH;
17644
18156
  exports.FIREBASE_AUTH_PASSWORD_MIN_LENGTH = FIREBASE_AUTH_PASSWORD_MIN_LENGTH;
18157
+ exports.FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR = FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR;
17645
18158
  exports.FIREBASE_AUTH_USER_NOT_FOUND_ERROR = FIREBASE_AUTH_USER_NOT_FOUND_ERROR;
17646
18159
  exports.FIREBASE_AUTH_WRONG_PASSWORD = FIREBASE_AUTH_WRONG_PASSWORD;
17647
18160
  exports.FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY = FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY;