@dereekb/firebase 13.4.1 → 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 +892 -385
  2. package/index.esm.js +892 -385
  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 +22 -7
  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,13 +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';
9613
- /** Error code when a phone number is already associated with another account. */ var FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR = 'auth/phone-number-already-exists';
9614
- /** Error code when an email is already associated with another account. */ var FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR = 'auth/email-already-exists';
9615
- /** Error code when the provided phone number is not a valid E.164 string. */ var FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR = 'auth/invalid-phone-number';
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';
9616
9760
  /**
9617
9761
  * Converts a {@link FirebaseAuthError} into a user-friendly {@link ReadableError} with a human-readable message.
9618
9762
  *
@@ -9620,6 +9764,7 @@ var FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY = 'resetCommunicationAt'
9620
9764
  * suitable for display in the UI.
9621
9765
  *
9622
9766
  * @param inputError - the Firebase Auth error to convert
9767
+ * @returns a {@link ReadableError} with a human-readable message suitable for display
9623
9768
  *
9624
9769
  * @example
9625
9770
  * ```ts
@@ -9723,6 +9868,7 @@ function _define_property$f(obj, key, value) {
9723
9868
  * Automatically uses a transaction accessor when the context has an active transaction.
9724
9869
  *
9725
9870
  * @param getFirestoreCollection - function to retrieve the Firestore collection from context
9871
+ * @returns a {@link FirebaseModelLoader} that loads document wrappers for given keys
9726
9872
  *
9727
9873
  * @example
9728
9874
  * ```ts
@@ -9739,8 +9885,7 @@ function _define_property$f(obj, key, value) {
9739
9885
  } else {
9740
9886
  documentAccessor = firestoreCollection.documentAccessor();
9741
9887
  }
9742
- var document = documentAccessor.loadDocumentForKey(key);
9743
- return document;
9888
+ return documentAccessor.loadDocumentForKey(key);
9744
9889
  }
9745
9890
  };
9746
9891
  }
@@ -9748,17 +9893,17 @@ function _define_property$f(obj, key, value) {
9748
9893
  /**
9749
9894
  * ArkType schema for a FirestoreModelKey (full path like "collection/12345").
9750
9895
  */ var firestoreModelKeyType = arktype.type('string > 0').narrow(function(val, ctx) {
9751
- return val != null && isFirestoreModelKey(val) || ctx.mustBe('a valid FirestoreModelKey');
9896
+ return isFirestoreModelKey(val) || ctx.mustBe('a valid FirestoreModelKey');
9752
9897
  });
9753
9898
  /**
9754
9899
  * ArkType schema for a FirestoreModelId (document ID like "12345").
9755
9900
  */ var firestoreModelIdType = arktype.type('string > 0').narrow(function(val, ctx) {
9756
- return val != null && isFirestoreModelId(val) || ctx.mustBe('a valid FirestoreModelId');
9901
+ return isFirestoreModelId(val) || ctx.mustBe('a valid FirestoreModelId');
9757
9902
  });
9758
9903
  /**
9759
9904
  * ArkType schema for a FirestoreModelId or FirestoreModelKey.
9760
9905
  */ var firestoreModelIdOrKeyType = arktype.type('string > 0').narrow(function(val, ctx) {
9761
- return val != null && isFirestoreModelIdOrKey(val) || ctx.mustBe('a valid FirestoreModelId or FirestoreModelKey');
9906
+ return isFirestoreModelIdOrKey(val) || ctx.mustBe('a valid FirestoreModelId or FirestoreModelKey');
9762
9907
  });
9763
9908
 
9764
9909
  /**
@@ -10067,6 +10212,7 @@ function _ts_generator$9(thisArg, body) {
10067
10212
  * Creates a {@link FirebaseModelPermissionServiceInstance} from a delegate.
10068
10213
  *
10069
10214
  * @param delegate - provides model loading and role computation
10215
+ * @returns a {@link FirebaseModelPermissionServiceInstance} configured with the given delegate
10070
10216
  */ function firebaseModelPermissionService(delegate) {
10071
10217
  return new FirebaseModelPermissionServiceInstance(delegate);
10072
10218
  }
@@ -10229,8 +10375,7 @@ function _define_property$d(obj, key, value) {
10229
10375
  value: function throwDoesNotExistError() {
10230
10376
  var _ref;
10231
10377
  var _this_contextGrantedModelRoles_context_makeDoesNotExistError, _this_contextGrantedModelRoles_context;
10232
- 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));
10233
- 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));
10234
10379
  }
10235
10380
  },
10236
10381
  {
@@ -10238,8 +10383,7 @@ function _define_property$d(obj, key, value) {
10238
10383
  value: function throwPermissionError(role) {
10239
10384
  var _ref;
10240
10385
  var _this_contextGrantedModelRoles_context_makePermissionError, _this_contextGrantedModelRoles_context;
10241
- 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));
10242
- 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));
10243
10387
  }
10244
10388
  }
10245
10389
  ]);
@@ -10247,6 +10391,9 @@ function _define_property$d(obj, key, value) {
10247
10391
  }();
10248
10392
  /**
10249
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
10250
10397
  */ function contextGrantedModelRolesReader(service) {
10251
10398
  return service.roleMap().then(function(x) {
10252
10399
  return new ContextGrantedModelRolesReaderInstance(x);
@@ -10255,13 +10402,13 @@ function _define_property$d(obj, key, value) {
10255
10402
  /**
10256
10403
  * Creates the default permission error message.
10257
10404
  *
10258
- * @param contextGrantedModelRoles
10259
- * @param role
10260
- * @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
10261
10408
  */ function contextGrantedModelRolesReaderPermissionErrorMessage(contextGrantedModelRoles, roles) {
10262
10409
  var _contextGrantedModelRoles_data, _contextGrantedModelRoles_data1;
10263
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, '")');
10264
- if (roles && (roles === null || roles === void 0 ? void 0 : roles.length)) {
10411
+ if (roles === null || roles === void 0 ? void 0 : roles.length) {
10265
10412
  message = "".concat(message, ': required role(s) "').concat(roles, '"');
10266
10413
  }
10267
10414
  return message;
@@ -10269,13 +10416,11 @@ function _define_property$d(obj, key, value) {
10269
10416
  /**
10270
10417
  * Creates the default does not exist error message.
10271
10418
  *
10272
- * @param contextGrantedModelRoles
10273
- * @param role
10274
- * @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
10275
10421
  */ function contextGrantedModelRolesReaderDoesNotExistErrorMessage(contextGrantedModelRoles) {
10276
10422
  var _contextGrantedModelRoles_data, _contextGrantedModelRoles_data1;
10277
- 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, '")');
10278
- 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, '")');
10279
10424
  }
10280
10425
 
10281
10426
  function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
@@ -10411,6 +10556,9 @@ function _ts_generator$8(thisArg, body) {
10411
10556
  * Decision function that checks if the current user is an admin in the given context.
10412
10557
  *
10413
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
10414
10562
  */ var isAdminInFirebaseModelContext = function isAdminInFirebaseModelContext(context) {
10415
10563
  var _ref;
10416
10564
  var _context_auth;
@@ -10420,6 +10568,7 @@ function _ts_generator$8(thisArg, body) {
10420
10568
  * Creates a {@link GrantRolesIfFunction} that grants the specified roles when the user is an admin.
10421
10569
  *
10422
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
10423
10572
  *
10424
10573
  * @example
10425
10574
  * ```ts
@@ -10438,6 +10587,7 @@ function _ts_generator$8(thisArg, body) {
10438
10587
  * @param context - the model context to check
10439
10588
  * @param rolesToGrantToAdmin - roles to grant if admin
10440
10589
  * @param otherwise - fallback role computation when not admin
10590
+ * @returns a promise or value resolving to the granted role map
10441
10591
  */ function grantModelRolesIfAdmin(context, rolesToGrantToAdmin, otherwise) {
10442
10592
  return grantModelRolesIfAdminFunction(rolesToGrantToAdmin)(context, otherwise);
10443
10593
  }
@@ -10447,6 +10597,7 @@ function _ts_generator$8(thisArg, body) {
10447
10597
  *
10448
10598
  * @param authRoles - the auth roles the user must have
10449
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
10450
10601
  */ function grantModelRolesIfHasAuthRolesFunction(authRoles, rolesToGrantToAdmin) {
10451
10602
  return grantModelRolesIfFunction(function(context) {
10452
10603
  var _context_auth;
@@ -10462,6 +10613,7 @@ function _ts_generator$8(thisArg, body) {
10462
10613
  * Creates a reusable factory pre-configured with specific auth roles to check for.
10463
10614
  *
10464
10615
  * @param authRoles - the auth roles the user must have
10616
+ * @returns a {@link GrantModelRolesIfHasAuthRolesFactory} pre-configured to check the given auth roles
10465
10617
  */ function grantModelRolesIfHasAuthRolesFactory(authRoles) {
10466
10618
  var authRolesToHave = util.iterableToArray(authRoles);
10467
10619
  return function(context, rolesToGrantToMatch, otherwise) {
@@ -10520,6 +10672,7 @@ function _ts_generator$8(thisArg, body) {
10520
10672
  * Creates a {@link GrantRolesIfFunction} that grants roles when the authenticated user's UID matches the model's `uid` field.
10521
10673
  *
10522
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
10523
10676
  *
10524
10677
  * @example
10525
10678
  * ```ts
@@ -10537,6 +10690,7 @@ function _ts_generator$8(thisArg, body) {
10537
10690
  *
10538
10691
  * @param grantIf - decision function to evaluate
10539
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
10540
10694
  */ function grantModelRolesOnlyIfFunction(grantIf, grantedRoles) {
10541
10695
  var fn = grantModelRolesIfFunction(grantIf, grantedRoles);
10542
10696
  return function(context) {
@@ -10551,6 +10705,7 @@ function _ts_generator$8(thisArg, body) {
10551
10705
  *
10552
10706
  * @param grantIf - async decision function to evaluate
10553
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
10554
10709
  * @throws {Error} When `grantIf` is not provided.
10555
10710
  *
10556
10711
  * @example
@@ -10562,9 +10717,6 @@ function _ts_generator$8(thisArg, body) {
10562
10717
  * const roles = await grantIfOwner(context, () => noAccessRoleMap());
10563
10718
  * ```
10564
10719
  */ function grantModelRolesIfFunction(grantIf, grantedRoles) {
10565
- if (!grantIf) {
10566
- throw new Error('missing grant if');
10567
- }
10568
10720
  return function(context) {
10569
10721
  var otherwise = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : model.noAccessRoleMap;
10570
10722
  return _async_to_generator$8(function() {
@@ -10663,6 +10815,7 @@ function _object_spread_props$a(target, source) {
10663
10815
  * Creates a {@link FirebaseModelService} that wires together model loading and permission evaluation.
10664
10816
  *
10665
10817
  * @param config - collection loader and role mapping functions
10818
+ * @returns a {@link FirebaseModelService} combining model loading and permission evaluation
10666
10819
  *
10667
10820
  * @example
10668
10821
  * ```ts
@@ -10695,6 +10848,7 @@ function _object_spread_props$a(target, source) {
10695
10848
  * Creates a {@link FirebaseModelServiceFactory} that lazily instantiates and caches the service.
10696
10849
  *
10697
10850
  * @param config - the service configuration
10851
+ * @returns a {@link FirebaseModelServiceFactory} that lazily creates and caches the service
10698
10852
  */ function firebaseModelServiceFactory(config) {
10699
10853
  return util.cachedGetter(function() {
10700
10854
  return firebaseModelService(config);
@@ -10707,6 +10861,7 @@ function _object_spread_props$a(target, source) {
10707
10861
  * with a model or key to perform permission-checked operations.
10708
10862
  *
10709
10863
  * @param factory - lazy getter for the underlying model service
10864
+ * @returns an {@link InContextFirebaseModelServiceFactory} that binds contexts to the service
10710
10865
  */ function inContextFirebaseModelServiceFactory(factory) {
10711
10866
  return function(context) {
10712
10867
  var firebaseModelService = factory();
@@ -10776,8 +10931,8 @@ function _object_spread_props$a(target, source) {
10776
10931
  * export const demoFirebaseModelServices = firebaseModelsService<typeof DEMO_FIREBASE_MODEL_SERVICE_FACTORIES, DemoFirebaseBaseContext, DemoFirebaseModelTypes>(DEMO_FIREBASE_MODEL_SERVICE_FACTORIES);
10777
10932
  * export type DemoFirebaseContext = DemoFirebaseBaseContext & { service: typeof demoFirebaseModelServices };
10778
10933
  *
10779
- * @param services
10780
- * @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
10781
10936
  */ function firebaseModelsService(services) {
10782
10937
  var firebaseModelsServiceFunction = function firebaseModelsServiceFunction1(type, context) {
10783
10938
  var firebaseModelService = services[type];
@@ -10798,6 +10953,7 @@ function _object_spread_props$a(target, source) {
10798
10953
  * The returned factory binds a context, so callers can then select individual model services by type.
10799
10954
  *
10800
10955
  * @param service - the multi-model service to wrap
10956
+ * @returns an {@link InContextFirebaseModelsServiceFactory} that binds a context to the service
10801
10957
  */ function inContextFirebaseModelsServiceFactory(service) {
10802
10958
  var newInContextFirebaseModelsServiceFactory = function newInContextFirebaseModelsServiceFactory(context) {
10803
10959
  var result = function result(type) {
@@ -10815,6 +10971,7 @@ function _object_spread_props$a(target, source) {
10815
10971
  * @param service - the multi-model service
10816
10972
  * @param type - the model type to select
10817
10973
  * @param select - selection params including context and key
10974
+ * @returns the {@link FirebaseModelsServiceSelectionResult} bound to the specified model
10818
10975
  */ function selectFromFirebaseModelsService(service, type, select) {
10819
10976
  var key = readFirestoreModelKey(select.key, true);
10820
10977
  return service(type, select.context).forKey(key);
@@ -10827,10 +10984,12 @@ function _object_spread_props$a(target, source) {
10827
10984
  * @param service - the multi-model service
10828
10985
  * @param type - the model type to select
10829
10986
  * @param select - selection params including context, key, and optional role requirements
10987
+ * @returns a {@link UsePromiseFunction} for the resolved roles reader
10830
10988
  */ function useFirebaseModelsService(service, type, select) {
10989
+ var _select_roles;
10831
10990
  var inContextModelService = selectFromFirebaseModelsService(service, type, select);
10832
10991
  var result;
10833
- if (select.roles && select.roles.length) {
10992
+ if ((_select_roles = select.roles) === null || _select_roles === void 0 ? void 0 : _select_roles.length) {
10834
10993
  result = inContextModelService.requireUse(select.roles, select.rolesSetIncludes);
10835
10994
  } else {
10836
10995
  result = inContextModelService.use;
@@ -10844,6 +11003,7 @@ function _object_spread_props$a(target, source) {
10844
11003
  * Useful for routing incoming requests to the correct model service by collection path.
10845
11004
  *
10846
11005
  * @param inContextFirebaseModelsService - context-bound multi-model service
11006
+ * @returns a map of collection type strings to their {@link FirestoreModelIdentity} objects
10847
11007
  */ function buildFirebaseCollectionTypeModelTypeMap(inContextFirebaseModelsService) {
10848
11008
  var allTypes = inContextFirebaseModelsService.allTypes();
10849
11009
  var modelIdentities = allTypes.map(function(type) {
@@ -10870,6 +11030,7 @@ function _object_spread_props$a(target, source) {
10870
11030
  * The generated paths follow the convention `/model/[basePath/]<modelKey>/[path]`.
10871
11031
  *
10872
11032
  * @param config - optional base path to nest under
11033
+ * @returns a {@link ModelStorageSlashPathFactory} that maps Firestore model keys to storage paths
10873
11034
  *
10874
11035
  * @example
10875
11036
  * ```ts
@@ -11070,6 +11231,7 @@ function _ts_generator$7(thisArg, body) {
11070
11231
  * Wraps the folder's `list()` API with cursor-based pagination via {@link fetchPageFactory}.
11071
11232
  *
11072
11233
  * @param config - default listing options (e.g., maxResults)
11234
+ * @returns an {@link IterateStorageListFilesFactory} for paginated file listing
11073
11235
  *
11074
11236
  * @example
11075
11237
  * ```ts
@@ -11080,25 +11242,16 @@ function _ts_generator$7(thisArg, body) {
11080
11242
  return fetch.fetchPageFactory({
11081
11243
  fetch: function fetch(input) {
11082
11244
  return _async_to_generator$7(function() {
11083
- var _input_maxResults, _input_pageToken, list;
11245
+ var _input_maxResults, _input_pageToken;
11084
11246
  return _ts_generator$7(this, function(_state) {
11085
- switch(_state.label){
11086
- case 0:
11087
- return [
11088
- 4,
11089
- input.folder.list({
11090
- includeNestedResults: input.includeNestedResults,
11091
- maxResults: (_input_maxResults = input.maxResults) !== null && _input_maxResults !== void 0 ? _input_maxResults : factoryDefaultMaxResults,
11092
- pageToken: (_input_pageToken = input.pageToken) !== null && _input_pageToken !== void 0 ? _input_pageToken : undefined
11093
- })
11094
- ];
11095
- case 1:
11096
- list = _state.sent();
11097
- return [
11098
- 2,
11099
- list
11100
- ];
11101
- }
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
+ ];
11102
11255
  });
11103
11256
  })();
11104
11257
  },
@@ -11112,7 +11265,7 @@ function _ts_generator$7(thisArg, body) {
11112
11265
  };
11113
11266
  return info;
11114
11267
  },
11115
- buildInputForNextPage: function buildInputForNextPage(pageResult, input, options) {
11268
+ buildInputForNextPage: function buildInputForNextPage(pageResult, input, _options) {
11116
11269
  var _pageResult_nextPageCursor;
11117
11270
  return _object_spread_props$9(_object_spread$b({}, input), {
11118
11271
  pageToken: (_pageResult_nextPageCursor = pageResult.nextPageCursor) !== null && _pageResult_nextPageCursor !== void 0 ? _pageResult_nextPageCursor : undefined
@@ -11124,6 +11277,9 @@ function _ts_generator$7(thisArg, body) {
11124
11277
  * Iterates through every file in a storage folder, invoking a callback for each individual file result.
11125
11278
  *
11126
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
11127
11283
  */ function iterateStorageListFilesByEachFile(input) {
11128
11284
  var folder = input.folder, includeNestedResults = input.includeNestedResults, pageToken = input.pageToken;
11129
11285
  return fetch.iterateFetchPagesByEachItem(_object_spread_props$9(_object_spread$b({}, input), {
@@ -11139,6 +11295,9 @@ function _ts_generator$7(thisArg, body) {
11139
11295
  * Iterates through pages of file results in a storage folder, invoking a callback for each page.
11140
11296
  *
11141
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
11142
11301
  */ function iterateStorageListFiles(input) {
11143
11302
  var folder = input.folder, includeNestedResults = input.includeNestedResults, pageToken = input.pageToken;
11144
11303
  return fetch.iterateFetchPages(_object_spread_props$9(_object_spread$b({}, input), {
@@ -11217,6 +11376,7 @@ function _is_native_reflect_construct$4() {
11217
11376
  * Required when the upload input is a string, since the format (raw, base64, etc.) must be explicit.
11218
11377
  *
11219
11378
  * @param options - the upload options to extract from
11379
+ * @returns the {@link StorageDataStringType} extracted from the options
11220
11380
  * @throws {Error} When `stringFormat` is not set in the options.
11221
11381
  */ function assertStorageUploadOptionsStringFormat(options) {
11222
11382
  var stringFormat = options === null || options === void 0 ? void 0 : options.stringFormat;
@@ -11227,6 +11387,8 @@ function _is_native_reflect_construct$4() {
11227
11387
  }
11228
11388
  /**
11229
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
11230
11392
  */ function noStringFormatInStorageUploadOptionsError() {
11231
11393
  return new Error('stringFormat was missing a value in the StorageUploadOptions.');
11232
11394
  }
@@ -11383,6 +11545,7 @@ function _ts_generator$6(thisArg, body) {
11383
11545
  * @param file - the target file accessor to upload to
11384
11546
  * @param readableStream - the source stream to pipe
11385
11547
  * @param options - optional upload configuration (content type, metadata, etc.)
11548
+ * @returns a promise that resolves when the upload stream has finished
11386
11549
  * @throws {StorageFileUploadStreamUnsupportedError} When the file accessor does not support stream uploads.
11387
11550
  *
11388
11551
  * @example
@@ -11420,15 +11583,16 @@ function _ts_generator$6(thisArg, body) {
11420
11583
  * provides cursor-based pagination through the `next()` method.
11421
11584
  *
11422
11585
  * @param delegate - platform-specific implementation for extracting results
11586
+ * @returns a {@link StorageListFilesResultFactory} that normalizes raw SDK list results
11423
11587
  *
11424
11588
  * @example
11425
11589
  * ```ts
11426
11590
  * const factory = storageListFilesResultFactory(myDelegate);
11427
- * const result = factory(storage, folder, { maxResults: 50 }, rawSdkResult);
11591
+ * const result = factory({ storage, folder, options: { maxResults: 50 } }, rawSdkResult);
11428
11592
  * const files = result.files();
11429
11593
  * ```
11430
11594
  */ function storageListFilesResultFactory(delegate) {
11431
- return function(storage, folder, options, result) {
11595
+ return function(input, result) {
11432
11596
  var fileResult = function fileResult(item) {
11433
11597
  item.file = function() {
11434
11598
  return delegate.file(storage, item);
@@ -11441,12 +11605,13 @@ function _ts_generator$6(thisArg, body) {
11441
11605
  };
11442
11606
  return item;
11443
11607
  };
11608
+ var storage = input.storage, folder = input.folder, options = input.options;
11444
11609
  var hasNext = delegate.hasNext(result);
11445
11610
  var next = util.cachedGetter(function() {
11446
11611
  if (!hasNext) {
11447
11612
  throw storageListFilesResultHasNoNextError();
11448
11613
  }
11449
- return delegate.next(storage, options, folder, result);
11614
+ return delegate.next(input, result);
11450
11615
  });
11451
11616
  var files = util.cachedGetter(function() {
11452
11617
  return delegate.filesFromResult(result, folder).map(fileResult);
@@ -11474,6 +11639,8 @@ function _ts_generator$6(thisArg, body) {
11474
11639
  }
11475
11640
  /**
11476
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
11477
11644
  */ function storageListFilesResultHasNoNextError() {
11478
11645
  return new Error('hasNext is false, there are no more results available.');
11479
11646
  }
@@ -11485,6 +11652,7 @@ function _ts_generator$6(thisArg, body) {
11485
11652
  * a {@link StoragePathFactory} to normalize all path inputs.
11486
11653
  *
11487
11654
  * @param drivers - the storage driver implementations to use
11655
+ * @returns a {@link FirebaseStorageContextFactory} that creates storage contexts for a given storage instance
11488
11656
  * @throws {Error} When a default bucket ID cannot be resolved from the driver or config.
11489
11657
  *
11490
11658
  * @example
@@ -11495,9 +11663,10 @@ function _ts_generator$6(thisArg, body) {
11495
11663
  * ```
11496
11664
  */ function firebaseStorageContextFactory(drivers) {
11497
11665
  return function(firebaseStorage, config) {
11666
+ var _ref;
11498
11667
  var _drivers_storageAccessorDriver_getDefaultBucket, _drivers_storageAccessorDriver;
11499
- var _ref = config !== null && config !== void 0 ? config : {}, inputDefaultBucketId = _ref.defaultBucketId, _ref_forceBucket = _ref.forceBucket, forceBucket = _ref_forceBucket === void 0 ? false : _ref_forceBucket;
11500
- 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 : '';
11501
11670
  if (!defaultBucketId) {
11502
11671
  throw new Error('Could not resolve a default bucket id for the firebaseStorageContextFactory(). Supply a defaultBucketId.');
11503
11672
  }
@@ -11522,13 +11691,13 @@ function _ts_generator$6(thisArg, body) {
11522
11691
  };
11523
11692
  }
11524
11693
 
11525
- function _array_like_to_array$5(arr, len) {
11694
+ function _array_like_to_array$6(arr, len) {
11526
11695
  if (len == null || len > arr.length) len = arr.length;
11527
11696
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
11528
11697
  return arr2;
11529
11698
  }
11530
- function _array_without_holes$3(arr) {
11531
- 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);
11532
11701
  }
11533
11702
  function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
11534
11703
  try {
@@ -11572,10 +11741,10 @@ function _define_property$a(obj, key, value) {
11572
11741
  }
11573
11742
  return obj;
11574
11743
  }
11575
- function _iterable_to_array$3(iter) {
11744
+ function _iterable_to_array$5(iter) {
11576
11745
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11577
11746
  }
11578
- function _non_iterable_spread$3() {
11747
+ function _non_iterable_spread$5() {
11579
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.");
11580
11749
  }
11581
11750
  function _object_spread$a(target) {
@@ -11612,16 +11781,16 @@ function _object_spread_props$8(target, source) {
11612
11781
  }
11613
11782
  return target;
11614
11783
  }
11615
- function _to_consumable_array$3(arr) {
11616
- 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();
11617
11786
  }
11618
- function _unsupported_iterable_to_array$5(o, minLen) {
11787
+ function _unsupported_iterable_to_array$6(o, minLen) {
11619
11788
  if (!o) return;
11620
- 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);
11621
11790
  var n = Object.prototype.toString.call(o).slice(8, -1);
11622
11791
  if (n === "Object" && o.constructor) n = o.constructor.name;
11623
11792
  if (n === "Map" || n === "Set") return Array.from(n);
11624
- 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);
11625
11794
  }
11626
11795
  function _ts_generator$5(thisArg, body) {
11627
11796
  var f, y, t, _ = {
@@ -11729,6 +11898,7 @@ function _ts_generator$5(thisArg, body) {
11729
11898
  * e.g., to silently handle deletion of already-deleted files.
11730
11899
  *
11731
11900
  * @param input - the error or error message to check
11901
+ * @returns `true` if the error message contains `'storage/object-not-found'`, `false` otherwise
11732
11902
  *
11733
11903
  * @example
11734
11904
  * ```ts
@@ -11748,6 +11918,7 @@ function _ts_generator$5(thisArg, body) {
11748
11918
  *
11749
11919
  * @param storage - the client Firebase Storage instance
11750
11920
  * @param path - abstract storage path to resolve
11921
+ * @returns a `StorageReference` pointing to the resolved storage path
11751
11922
  */ function firebaseStorageRefForStorageFilePath(storage$1, path) {
11752
11923
  return storage.ref(storage$1, firebaseStorageFilePathFromStorageFilePath(path));
11753
11924
  }
@@ -11757,6 +11928,7 @@ function _ts_generator$5(thisArg, body) {
11757
11928
  * Returns `true` if metadata is successfully retrieved, `false` for any error (including permission errors).
11758
11929
  *
11759
11930
  * @param ref - the storage reference to check
11931
+ * @returns a promise that resolves to `true` if the file exists, `false` otherwise
11760
11932
  */ function firebaseStorageFileExists(ref) {
11761
11933
  return storage.getMetadata(ref).then(function(_) {
11762
11934
  return true;
@@ -11772,6 +11944,7 @@ function _ts_generator$5(thisArg, body) {
11772
11944
  *
11773
11945
  * @param storage - the client Firebase Storage instance
11774
11946
  * @param storagePath - the abstract storage path for the file
11947
+ * @returns a {@link FirebaseStorageClientAccessorFile} providing CRUD and upload operations for the given path
11775
11948
  *
11776
11949
  * @example
11777
11950
  * ```ts
@@ -11788,7 +11961,7 @@ function _ts_generator$5(thisArg, body) {
11788
11961
  contentEncoding: (_options_metadata2 = options.metadata) === null || _options_metadata2 === void 0 ? void 0 : _options_metadata2.contentEncoding,
11789
11962
  contentLanguage: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentLanguage,
11790
11963
  contentType: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentType,
11791
- 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))
11792
11965
  });
11793
11966
  }
11794
11967
  function uploadMetadataFromStorageUploadOptions(options) {
@@ -11917,7 +12090,8 @@ function _ts_generator$5(thisArg, body) {
11917
12090
  nextPageTokenFromResult: function nextPageTokenFromResult(result) {
11918
12091
  return result.listResult.nextPageToken;
11919
12092
  },
11920
- next: function next(storage, options, folder, result) {
12093
+ next: function next(param, result) {
12094
+ var options = param.options, folder = param.folder;
11921
12095
  return folder.list(_object_spread_props$8(_object_spread$a({}, options, result.options), {
11922
12096
  pageToken: result.listResult.nextPageToken
11923
12097
  }));
@@ -11959,6 +12133,7 @@ function _ts_generator$5(thisArg, body) {
11959
12133
  *
11960
12134
  * @param storage - the client Firebase Storage instance
11961
12135
  * @param storagePath - the abstract storage path for the folder
12136
+ * @returns a {@link FirebaseStorageClientAccessorFolder} providing listing and existence operations for the given path
11962
12137
  *
11963
12138
  * @example
11964
12139
  * ```ts
@@ -11987,7 +12162,11 @@ function _ts_generator$5(thisArg, body) {
11987
12162
  return [
11988
12163
  4,
11989
12164
  storage.list(ref, options).then(function(listResult) {
11990
- return firebaseStorageClientListFilesResultFactory(storage$1, folder, options, {
12165
+ return firebaseStorageClientListFilesResultFactory({
12166
+ storage: storage$1,
12167
+ folder: folder,
12168
+ options: options
12169
+ }, {
11991
12170
  options: options,
11992
12171
  listResult: listResult
11993
12172
  });
@@ -12014,7 +12193,7 @@ function _ts_generator$5(thisArg, body) {
12014
12193
  case 2:
12015
12194
  allNestedFolderFileResults = _state.sent();
12016
12195
  allNestedFiles = allNestedFolderFileResults.flat();
12017
- 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));
12018
12197
  result = _object_spread_props$8(_object_spread$a({}, rootResults), {
12019
12198
  files: function files() {
12020
12199
  return allFiles;
@@ -12050,6 +12229,8 @@ function _ts_generator$5(thisArg, body) {
12050
12229
  * Provides file and folder accessor factories and default bucket resolution.
12051
12230
  * Used internally by {@link firebaseStorageClientDrivers}.
12052
12231
  *
12232
+ * @returns a {@link FirebaseStorageAccessorDriver} backed by the `firebase/storage` client SDK
12233
+ *
12053
12234
  * @example
12054
12235
  * ```ts
12055
12236
  * const driver = firebaseStorageClientAccessorDriver();
@@ -12077,6 +12258,8 @@ function _ts_generator$5(thisArg, body) {
12077
12258
  *
12078
12259
  * Provides file and folder accessor operations for use with {@link clientFirebaseStorageContextFactory}.
12079
12260
  *
12261
+ * @returns the client-side {@link FirebaseStorageClientDrivers} for the `firebase/storage` SDK
12262
+ *
12080
12263
  * @example
12081
12264
  * ```ts
12082
12265
  * const drivers = firebaseStorageClientDrivers();
@@ -12135,6 +12318,7 @@ function _ts_generator$5(thisArg, body) {
12135
12318
  * by combining the given user model identity with the provided UID.
12136
12319
  *
12137
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
12138
12322
  *
12139
12323
  * @example
12140
12324
  * ```ts
@@ -12158,9 +12342,9 @@ function _ts_generator$5(thisArg, body) {
12158
12342
  /**
12159
12343
  * Creates a NotificationTaskUniqueId from the input model id and task type.
12160
12344
  *
12161
- * @param input model id input
12162
- * @param taskType task type
12163
- * @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
12164
12348
  */ function notificationTaskUniqueId(input, taskType) {
12165
12349
  return "".concat(firestoreModelId(input), "_").concat(taskType); // combineation of model id and template type
12166
12350
  }
@@ -12215,6 +12399,10 @@ function _object_spread_props$7(target, source) {
12215
12399
  /**
12216
12400
  * Merges two {@link NotificationBoxRecipientTemplateConfig} objects, preferring values from `a` over `b`.
12217
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
+ *
12218
12406
  * @example
12219
12407
  * ```ts
12220
12408
  * const merged = mergeNotificationBoxRecipientTemplateConfigs(
@@ -12239,6 +12427,9 @@ function _object_spread_props$7(target, source) {
12239
12427
  *
12240
12428
  * This produces the "effective" configuration used at send time, where each channel has a definite boolean.
12241
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
+ *
12242
12433
  * @example
12243
12434
  * ```ts
12244
12435
  * const effective = effectiveNotificationBoxRecipientTemplateConfig({ sd: true, se: false });
@@ -12258,6 +12449,10 @@ function _object_spread_props$7(target, source) {
12258
12449
  * Updates a {@link NotificationRecipient} with partial values, preserving existing fields where the update is undefined.
12259
12450
  *
12260
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
12261
12456
  */ function updateNotificationRecipient(a, b) {
12262
12457
  var inputUid = b.uid, inputN = b.n, inputE = b.e, inputT = b.t, inputS = b.s;
12263
12458
  var uid = util.updateMaybeValue(a.uid, inputUid);
@@ -12309,6 +12504,7 @@ function _object_spread_props$7(target, source) {
12309
12504
  *
12310
12505
  * @param uid - the user's Firebase auth UID
12311
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
12312
12508
  */ function newNotificationBoxRecipientForUid(uid, i) {
12313
12509
  return {
12314
12510
  c: {},
@@ -12318,6 +12514,10 @@ function _object_spread_props$7(target, source) {
12318
12514
  }
12319
12515
  /**
12320
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
12321
12521
  */ function mergeNotificationUserDefaultNotificationBoxRecipientConfig(a, b) {
12322
12522
  var c = mergeNotificationBoxRecipientTemplateConfigRecords(a.c, b.c);
12323
12523
  var result = _object_spread_props$7(_object_spread$9({}, util.mergeObjects([
@@ -12348,6 +12548,10 @@ function _object_spread_props$7(target, source) {
12348
12548
  })(exports.NotificationBoxRecipientTemplateConfigBoolean || (exports.NotificationBoxRecipientTemplateConfigBoolean = {}));
12349
12549
  /**
12350
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
12351
12555
  */ function mergeNotificationBoxRecipientTemplateConfigRecords(a, b) {
12352
12556
  var mergeConfigs = util.mergeObjectsFunction(util.KeyValueTypleValueFilter.UNDEFINED);
12353
12557
  return mergeConfigs([
@@ -12409,6 +12613,8 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12409
12613
  /**
12410
12614
  * Creates a Firestore field converter for {@link NotificationBoxRecipientTemplateConfigRecord},
12411
12615
  * using bitwise encoding for compact storage.
12616
+ *
12617
+ * @returns a Firestore field converter that encodes and decodes template config records using bitwise encoding
12412
12618
  */ function firestoreNotificationBoxRecipientTemplateConfigRecord() {
12413
12619
  return firestoreBitwiseObjectMap({
12414
12620
  dencoder: notificationBoxRecipientTemplateConfigDencoder
@@ -12498,6 +12704,9 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12498
12704
  /**
12499
12705
  * Converts a {@link NotificationBoxRecipientTemplateConfigRecord} to an array of entries with their type keys.
12500
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
+ *
12501
12710
  * @example
12502
12711
  * ```ts
12503
12712
  * const array = notificationBoxRecipientTemplateConfigRecordToArray({ 'comment': { se: true } });
@@ -12516,6 +12725,9 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12516
12725
  }
12517
12726
  /**
12518
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
12519
12731
  */ function notificationBoxRecipientTemplateConfigArrayToRecord(input) {
12520
12732
  var map = {};
12521
12733
  input.forEach(function(x) {
@@ -12558,6 +12770,7 @@ var notificationBoxRecipientTemplateConfigDencoder = util.bitwiseObjectDencoder(
12558
12770
  *
12559
12771
  * @param items - notification items to classify
12560
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
12561
12774
  *
12562
12775
  * @example
12563
12776
  * ```ts
@@ -12701,11 +12914,17 @@ var NotificationUserDocument = /*#__PURE__*/ function(AbstractFirestoreDocument)
12701
12914
  });
12702
12915
  /**
12703
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
12704
12920
  */ function notificationUserCollectionReference(context) {
12705
12921
  return context.collection(notificationUserIdentity.collectionName);
12706
12922
  }
12707
12923
  /**
12708
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
12709
12928
  */ function notificationUserFirestoreCollection(firestoreContext) {
12710
12929
  return firestoreContext.firestoreCollection({
12711
12930
  modelIdentity: notificationUserIdentity,
@@ -12768,11 +12987,17 @@ var NotificationSummaryDocument = /*#__PURE__*/ function(AbstractFirestoreDocume
12768
12987
  });
12769
12988
  /**
12770
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
12771
12993
  */ function notificationSummaryCollectionReference(context) {
12772
12994
  return context.collection(notificationSummaryIdentity.collectionName);
12773
12995
  }
12774
12996
  /**
12775
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
12776
13001
  */ function notificationSummaryFirestoreCollection(firestoreContext) {
12777
13002
  return firestoreContext.firestoreCollection({
12778
13003
  modelIdentity: notificationSummaryIdentity,
@@ -12835,11 +13060,17 @@ var NotificationBoxDocument = /*#__PURE__*/ function(AbstractFirestoreDocument)
12835
13060
  });
12836
13061
  /**
12837
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
12838
13066
  */ function notificationBoxCollectionReference(context) {
12839
13067
  return context.collection(notificationBoxIdentity.collectionName);
12840
13068
  }
12841
13069
  /**
12842
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
12843
13074
  */ function notificationBoxFirestoreCollection(firestoreContext) {
12844
13075
  return firestoreContext.firestoreCollection({
12845
13076
  modelIdentity: notificationBoxIdentity,
@@ -13007,6 +13238,9 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13007
13238
  });
13008
13239
  /**
13009
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
13010
13244
  */ function notificationCollectionReferenceFactory(context) {
13011
13245
  return function(notificationBox) {
13012
13246
  return context.subcollection(notificationBox.documentRef, notificationIdentity.collectionName);
@@ -13014,6 +13248,9 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13014
13248
  }
13015
13249
  /**
13016
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
13017
13254
  */ function notificationFirestoreCollectionFactory(firestoreContext) {
13018
13255
  var factory = notificationCollectionReferenceFactory(firestoreContext);
13019
13256
  return function(parent) {
@@ -13031,11 +13268,17 @@ var NotificationDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentWithP
13031
13268
  }
13032
13269
  /**
13033
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
13034
13274
  */ function notificationCollectionReference(context) {
13035
13275
  return context.collectionGroup(notificationIdentity.collectionName);
13036
13276
  }
13037
13277
  /**
13038
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
13039
13282
  */ function notificationFirestoreCollectionGroup(firestoreContext) {
13040
13283
  return firestoreContext.firestoreCollectionGroup({
13041
13284
  modelIdentity: notificationIdentity,
@@ -13084,6 +13327,9 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13084
13327
  });
13085
13328
  /**
13086
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
13087
13333
  */ function notificationWeekCollectionReferenceFactory(context) {
13088
13334
  return function(notificationBox) {
13089
13335
  return context.subcollection(notificationBox.documentRef, notificationWeekIdentity.collectionName);
@@ -13091,6 +13337,9 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13091
13337
  }
13092
13338
  /**
13093
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
13094
13343
  */ function notificationWeekFirestoreCollectionFactory(firestoreContext) {
13095
13344
  var factory = notificationWeekCollectionReferenceFactory(firestoreContext);
13096
13345
  return function(parent) {
@@ -13108,11 +13357,17 @@ var NotificationWeekDocument = /*#__PURE__*/ function(AbstractFirestoreDocumentW
13108
13357
  }
13109
13358
  /**
13110
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
13111
13363
  */ function notificationWeekCollectionReference(context) {
13112
13364
  return context.collectionGroup(notificationWeekIdentity.collectionName);
13113
13365
  }
13114
13366
  /**
13115
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
13116
13371
  */ function notificationWeekFirestoreCollectionGroup(firestoreContext) {
13117
13372
  return firestoreContext.firestoreCollectionGroup({
13118
13373
  modelIdentity: notificationWeekIdentity,
@@ -13257,16 +13512,42 @@ var notificationBoxModelCrudFunctionsConfig = {
13257
13512
  *
13258
13513
  * Error code constants thrown by the notification server action service.
13259
13514
  * These codes are returned in Firebase function error responses for client-side handling.
13260
- */ /** Thrown when a notification creation request is missing a required ID. */ var CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE = 'CREATE_NOTIFICATION_ID_REQUIRED';
13261
- /** Thrown when attempting to initialize a NotificationBox or NotificationSummary that is already initialized. */ var NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE = 'NOTIFICATION_MODEL_ALREADY_INITIALIZED';
13262
- /** Thrown when the target NotificationBox does not exist. */ var NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE = 'NOTIFICATION_BOX_DOES_NOT_EXIST';
13263
- /** 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';
13264
- /** 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';
13265
- /** 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';
13266
- /** 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';
13267
- /** 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';
13268
- /** 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';
13269
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
+ }
13270
13551
  function _define_property$8(obj, key, value) {
13271
13552
  if (key in obj) {
13272
13553
  Object.defineProperty(obj, key, {
@@ -13280,6 +13561,12 @@ function _define_property$8(obj, key, value) {
13280
13561
  }
13281
13562
  return obj;
13282
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
+ }
13283
13570
  function _object_spread$8(target) {
13284
13571
  for(var i = 1; i < arguments.length; i++){
13285
13572
  var source = arguments[i] != null ? arguments[i] : {};
@@ -13314,6 +13601,17 @@ function _object_spread_props$6(target, source) {
13314
13601
  }
13315
13602
  return target;
13316
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
+ }
13317
13615
  /**
13318
13616
  * Applies an array of config entry params to a {@link NotificationBoxRecipientTemplateConfigRecord},
13319
13617
  * inserting new entries, merging updates, and removing entries marked with `remove: true`.
@@ -13321,31 +13619,29 @@ function _object_spread_props$6(target, source) {
13321
13619
  * @param a - existing config record
13322
13620
  * @param b - array of update params to apply
13323
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
13324
13623
  */ function updateNotificationBoxRecipientTemplateConfigRecord(a, b, limitToAllowedConfigTypes) {
13325
- var c;
13326
- if (b != null) {
13327
- var cArray = notificationBoxRecipientTemplateConfigRecordToArray(a);
13328
- var updatedC = util.ModelRelationUtility.insertCollection(cArray, b, {
13329
- readKey: function readKey(x) {
13330
- return x.type;
13331
- },
13332
- merge: function merge(x, y) {
13333
- return _object_spread$8({}, x, y);
13334
- }
13335
- });
13336
- // remove types marked as remove
13337
- updatedC = util.ModelRelationUtility.removeKeysFromCollection(updatedC, b.filter(function(x) {
13338
- return x.remove;
13339
- }).map(function(x) {
13340
- return x.type;
13341
- }), function(x) {
13624
+ var cArray = notificationBoxRecipientTemplateConfigRecordToArray(a);
13625
+ var updatedC = util.ModelRelationUtility.insertCollection(cArray, b, {
13626
+ readKey: function readKey(x) {
13342
13627
  return x.type;
13343
- });
13344
- c = notificationBoxRecipientTemplateConfigArrayToRecord(updatedC);
13345
- // if the config types are limited to specific types, then filter those only
13346
- if (limitToAllowedConfigTypes) {
13347
- c = util.filterKeysOnPOJOFunction(limitToAllowedConfigTypes)(c);
13628
+ },
13629
+ merge: function merge(x, y) {
13630
+ return _object_spread$8({}, x, y);
13348
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);
13349
13645
  }
13350
13646
  return c;
13351
13647
  }
@@ -13356,6 +13652,7 @@ function _object_spread_props$6(target, source) {
13356
13652
  * @param a - existing config
13357
13653
  * @param b - update params to apply
13358
13654
  * @param limitToAllowedConfigTypes - when provided, filters config types to only allowed template types
13655
+ * @returns the updated default recipient config
13359
13656
  */ function updateNotificationUserDefaultNotificationBoxRecipientConfig(a, b, limitToAllowedConfigTypes) {
13360
13657
  var _ref;
13361
13658
  var inputC = b.configs, inputF = b.f, inputBk = b.bk, inputLk = b.lk;
@@ -13372,6 +13669,11 @@ function _object_spread_props$6(target, source) {
13372
13669
  * only if it actually changed. Returns `undefined` if no changes were detected.
13373
13670
  *
13374
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
13375
13677
  */ function updateNotificationUserNotificationBoxRecipientConfigIfChanged(a, b, limitToAllowedConfigTypes) {
13376
13678
  var _ref;
13377
13679
  var inputC = b.configs, inputRm = b.rm, inputLk = b.lk, inputBk = b.bk;
@@ -13402,6 +13704,11 @@ function _object_spread_props$6(target, source) {
13402
13704
  * through the optional {@link AppNotificationTemplateTypeInfoRecordService}.
13403
13705
  *
13404
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
13405
13712
  */ function updateNotificationUserNotificationBoxRecipientConfigs(a, b, filterWithService) {
13406
13713
  var boxesMap = util.makeModelMap(a, function(x) {
13407
13714
  return x.nb;
@@ -13431,7 +13738,7 @@ function _object_spread_props$6(target, source) {
13431
13738
  });
13432
13739
  var result;
13433
13740
  if (hasChanges) {
13434
- result = Array.from(boxesMap.values());
13741
+ result = _to_consumable_array$4(boxesMap.values());
13435
13742
  }
13436
13743
  return result;
13437
13744
  }
@@ -13570,6 +13877,9 @@ function _ts_generator$4(thisArg, body) {
13570
13877
  *
13571
13878
  * Maps friendly field names (`subject`, `message`, `createdBy`, etc.) to their Firestore abbreviations
13572
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
13573
13883
  */ function createNotificationTemplate(input) {
13574
13884
  var _ref, _ref1;
13575
13885
  var inputNotificationModel = input.notificationModel, type = input.type, unique = input.unique, overrideExistingTask = input.overrideExistingTask, // notification
@@ -13616,6 +13926,9 @@ function _ts_generator$4(thisArg, body) {
13616
13926
  * Determines whether a notification should be created based on the explicit toggle and throttle settings.
13617
13927
  *
13618
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
13619
13932
  */ function shouldSendCreatedNotificationInput(input) {
13620
13933
  var sendNotification = input.sendNotification, sendNotificationThrottleDate = input.sendNotificationThrottleDate, inputSendNotificationThrottleTime = input.sendNotificationThrottleTime;
13621
13934
  var sendNotificationThrottleTime = inputSendNotificationThrottleTime !== null && inputSendNotificationThrottleTime !== void 0 ? inputSendNotificationThrottleTime : util.MS_IN_HOUR;
@@ -13629,6 +13942,8 @@ function _ts_generator$4(thisArg, body) {
13629
13942
  *
13630
13943
  * For unique task notifications, generates a deterministic document ID from the target model and task type.
13631
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
13632
13947
  * @throws {Error} When neither an accessor nor sufficient context is provided
13633
13948
  * @throws {Error} When `unique=true` but no target model is specified
13634
13949
  */ function createNotificationDocumentPair(input) {
@@ -13637,15 +13952,13 @@ function _ts_generator$4(thisArg, body) {
13637
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;
13638
13953
  /**
13639
13954
  * Use the input, or default to true if inputUnique is true.
13640
- */ var overrideExistingTask = inputOverrideExistingTask != null ? inputOverrideExistingTask : inputUnique ? true : undefined;
13955
+ */ var overrideExistingTask = inputOverrideExistingTask !== null && inputOverrideExistingTask !== void 0 ? inputOverrideExistingTask : inputUnique ? true : undefined;
13641
13956
  var accessor = inputAccessor;
13642
13957
  var notificationBoxId = notificationBoxIdForModel(notificationModel);
13643
- if (!accessor && notificationBoxId) {
13644
- if (context) {
13645
- var notificationCollectionFactory = context.notificationCollectionFactory, notificationBoxCollection = context.notificationBoxCollection;
13646
- var notificationBoxDocument = notificationBoxCollection.documentAccessorForTransaction(transaction).loadDocumentForId(notificationBoxId);
13647
- accessor = notificationCollectionFactory(notificationBoxDocument).documentAccessorForTransaction(transaction);
13648
- }
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);
13649
13962
  }
13650
13963
  if (!accessor) {
13651
13964
  throw new Error('createNotificationDocument() failed as neither an accessor nor sufficient information was provided about the target.');
@@ -13726,6 +14039,10 @@ function _ts_generator$4(thisArg, body) {
13726
14039
  }
13727
14040
  /**
13728
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
13729
14046
  */ function _createNotificationDocumentFromPair(input, pair) {
13730
14047
  return _async_to_generator$4(function() {
13731
14048
  var notification, notificationDocument, isNotificationTask, overrideExistingTask;
@@ -13776,6 +14093,9 @@ function _ts_generator$4(thisArg, body) {
13776
14093
  *
13777
14094
  * For unique tasks with `overrideExistingTask`, uses `set()` to replace existing documents.
13778
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
13779
14099
  */ function createNotificationDocument(input) {
13780
14100
  return _async_to_generator$4(function() {
13781
14101
  var pair;
@@ -13792,6 +14112,9 @@ function _ts_generator$4(thisArg, body) {
13792
14112
  * Creates and saves a notification only if sending conditions are met (not throttled, not explicitly disabled).
13793
14113
  *
13794
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
13795
14118
  */ function createNotificationDocumentIfSending(input) {
13796
14119
  return _async_to_generator$4(function() {
13797
14120
  var pair;
@@ -13870,6 +14193,8 @@ function _object_spread_props$5(target, source) {
13870
14193
  /**
13871
14194
  * Creates a {@link CreateNotificationTaskTemplate} with `TASK_NOTIFICATION` send type and no recipients.
13872
14195
  *
14196
+ * @param input - task template input parameters
14197
+ * @returns the configured task notification template
13873
14198
  * @throws {Error} When `unique=true` but no `notificationModel` or target model is specified.
13874
14199
  *
13875
14200
  * @example
@@ -13907,11 +14232,17 @@ function _array_like_to_array$4(arr, len) {
13907
14232
  function _array_with_holes$1(arr) {
13908
14233
  if (Array.isArray(arr)) return arr;
13909
14234
  }
14235
+ function _array_without_holes$3(arr) {
14236
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
14237
+ }
13910
14238
  function _class_call_check$5(instance, Constructor) {
13911
14239
  if (!(instance instanceof Constructor)) {
13912
14240
  throw new TypeError("Cannot call a class as a function");
13913
14241
  }
13914
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
+ }
13915
14246
  function _iterable_to_array_limit$1(arr, i) {
13916
14247
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
13917
14248
  if (_i == null) return;
@@ -13939,9 +14270,15 @@ function _iterable_to_array_limit$1(arr, i) {
13939
14270
  function _non_iterable_rest$1() {
13940
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.");
13941
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
+ }
13942
14276
  function _sliced_to_array$1(arr, i) {
13943
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();
13944
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
+ }
13945
14282
  function _unsupported_iterable_to_array$4(o, minLen) {
13946
14283
  if (!o) return;
13947
14284
  if (typeof o === "string") return _array_like_to_array$4(o, minLen);
@@ -13953,6 +14290,8 @@ function _unsupported_iterable_to_array$4(o, minLen) {
13953
14290
  /**
13954
14291
  * Creates a {@link NotificationTemplateTypeInfoRecord} from an array of template type info entries.
13955
14292
  *
14293
+ * @param infoArray - array of template type info entries to index
14294
+ * @returns a record keyed by template type
13956
14295
  * @throws {Error} When duplicate template types are found in the input array.
13957
14296
  *
13958
14297
  * @example
@@ -13989,6 +14328,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
13989
14328
  * Handles alternative model identities defined in {@link NotificationTemplateTypeInfoIdentityInfoAlternativeModelIdentityPair}.
13990
14329
  *
13991
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
13992
14332
  *
13993
14333
  * @example
13994
14334
  * ```ts
@@ -14023,10 +14363,10 @@ function _unsupported_iterable_to_array$4(o, minLen) {
14023
14363
  allKnownTemplateTypeInfo.push(info);
14024
14364
  allKnownTemplateTypes.push(info.type);
14025
14365
  });
14026
- var allNotificationModelIdentityValues = Array.from(allNotificationModelIdentityValuesSet);
14366
+ var allNotificationModelIdentityValues = _to_consumable_array$3(allNotificationModelIdentityValuesSet);
14027
14367
  var notificationModelTemplateInfoMap = notificationModelTypeInfoMapBuilder.map();
14028
14368
  var targetModelTemplateInfoMap = targetModelTypeInfoMapBuilder.map();
14029
- 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) {
14030
14370
  var _param = _sliced_to_array$1(param, 2), k = _param[0], x = _param[1];
14031
14371
  return [
14032
14372
  k,
@@ -14035,7 +14375,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
14035
14375
  })
14036
14376
  ];
14037
14377
  }));
14038
- 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) {
14039
14379
  var _param = _sliced_to_array$1(param, 2), k = _param[0], x = _param[1];
14040
14380
  return [
14041
14381
  k,
@@ -14239,6 +14579,7 @@ function _ts_generator$3(thisArg, body) {
14239
14579
  *
14240
14580
  * @param fn - base function that generates message content per recipient
14241
14581
  * @param extras - optional delivery customization (global recipients, send callbacks)
14582
+ * @returns a {@link NotificationMessageFunction} with the extras attached
14242
14583
  *
14243
14584
  * @example
14244
14585
  * ```ts
@@ -14266,6 +14607,8 @@ function _ts_generator$3(thisArg, body) {
14266
14607
  *
14267
14608
  * Useful as a placeholder factory for template types that should not produce deliverable content.
14268
14609
  *
14610
+ * @returns a factory that produces no-content message functions
14611
+ *
14269
14612
  * @example
14270
14613
  * ```ts
14271
14614
  * const factory = noContentNotificationMessageFunctionFactory();
@@ -14274,7 +14617,7 @@ function _ts_generator$3(thisArg, body) {
14274
14617
  * // msg.flag === NotificationMessageFlag.NO_CONTENT
14275
14618
  * ```
14276
14619
  */ function noContentNotificationMessageFunctionFactory() {
14277
- return function(config) {
14620
+ return function(_config) {
14278
14621
  return _async_to_generator$3(function() {
14279
14622
  return _ts_generator$3(this, function(_state) {
14280
14623
  // const { item } = config;
@@ -14309,6 +14652,8 @@ function _ts_generator$3(thisArg, body) {
14309
14652
  * Query constraints for finding {@link NotificationUser} documents that have pending config syncs (`ns == true`).
14310
14653
  *
14311
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
14312
14657
  */ function notificationUsersFlaggedForNeedsSyncQuery() {
14313
14658
  return [
14314
14659
  where('ns', '==', true)
@@ -14318,6 +14663,7 @@ function _ts_generator$3(thisArg, body) {
14318
14663
  * Query constraints for finding {@link NotificationUser} documents that have any of the given exclusion IDs in their `x` array.
14319
14664
  *
14320
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
14321
14667
  */ function notificationUserHasExclusionQuery(exclusionId) {
14322
14668
  return [
14323
14669
  where('x', 'array-contains-any', exclusionId)
@@ -14326,6 +14672,8 @@ function _ts_generator$3(thisArg, body) {
14326
14672
  // MARK: NotificationSummary
14327
14673
  /**
14328
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
14329
14677
  */ function notificationSummariesFlaggedForNeedsInitializationQuery() {
14330
14678
  return [
14331
14679
  where('s', '==', true)
@@ -14335,6 +14683,8 @@ function _ts_generator$3(thisArg, body) {
14335
14683
  // MARK: NotificationBox
14336
14684
  /**
14337
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
14338
14688
  */ function notificationBoxesFlaggedForNeedsInitializationQuery() {
14339
14689
  return [
14340
14690
  where('s', '==', true)
@@ -14344,6 +14694,8 @@ function _ts_generator$3(thisArg, body) {
14344
14694
  * Query constraints for finding {@link NotificationBox} documents flagged as invalid (`fi == true`).
14345
14695
  *
14346
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
14347
14699
  */ function notificationBoxesFlaggedInvalidQuery() {
14348
14700
  return [
14349
14701
  where('fi', '==', true)
@@ -14357,6 +14709,7 @@ function _ts_generator$3(thisArg, body) {
14357
14709
  * This is the primary query used by the send queue processor.
14358
14710
  *
14359
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
14360
14713
  */ function notificationsPastSendAtTimeQuery() {
14361
14714
  var now = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
14362
14715
  return [
@@ -14367,6 +14720,8 @@ function _ts_generator$3(thisArg, body) {
14367
14720
  /**
14368
14721
  * Query constraints for finding {@link Notification} documents marked as done (`d == true`)
14369
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
14370
14725
  */ function notificationsReadyForCleanupQuery() {
14371
14726
  return [
14372
14727
  where('d', '==', true)
@@ -14403,6 +14758,10 @@ function _unsupported_iterable_to_array$3(o, minLen) {
14403
14758
  *
14404
14759
  * Used when combining results from multiple send batches within the same channel.
14405
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
+ *
14406
14765
  * @example
14407
14766
  * ```ts
14408
14767
  * const combined = mergeNotificationSendMessagesResult(firstBatchResult, secondBatchResult);
@@ -14469,6 +14828,8 @@ function _object_spread_props$4(target, source) {
14469
14828
  * Use this when the handler needs more time but doesn't want to increment the failure counter.
14470
14829
  * The task will be re-queued without counting as an error attempt.
14471
14830
  *
14831
+ * @returns an empty checkpoint array signaling in-progress without failure
14832
+ *
14472
14833
  * @example
14473
14834
  * ```ts
14474
14835
  * // Waiting for an external process — delay without failing
@@ -14484,6 +14845,7 @@ function _object_spread_props$4(target, source) {
14484
14845
  *
14485
14846
  * @param delayUntil - absolute date or relative milliseconds from the task's run start time
14486
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
14487
14849
  *
14488
14850
  * @example
14489
14851
  * ```ts
@@ -14505,6 +14867,7 @@ function _object_spread_props$4(target, source) {
14505
14867
  *
14506
14868
  * @param completedParts - checkpoint string(s) that were just completed
14507
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
14508
14871
  *
14509
14872
  * @example
14510
14873
  * ```ts
@@ -14521,6 +14884,7 @@ function _object_spread_props$4(target, source) {
14521
14884
  * Returns a result indicating the task completed successfully. The notification document will be deleted.
14522
14885
  *
14523
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
14524
14888
  *
14525
14889
  * @example
14526
14890
  * ```ts
@@ -14540,6 +14904,7 @@ function _object_spread_props$4(target, source) {
14540
14904
  *
14541
14905
  * @param updateMetadata - optional metadata updates
14542
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
14543
14908
  *
14544
14909
  * @example
14545
14910
  * ```ts
@@ -14561,6 +14926,7 @@ function _object_spread_props$4(target, source) {
14561
14926
  *
14562
14927
  * @param result - the task result to wrap
14563
14928
  * @param force - when true, overrides any existing `canRunNextCheckpoint` value
14929
+ * @returns a copy of the result with `canRunNextCheckpoint` set to true
14564
14930
  */ function notificationTaskCanRunNextCheckpoint(result, force) {
14565
14931
  if (force || result.canRunNextCheckpoint == null) {
14566
14932
  result = _object_spread_props$4(_object_spread$6({}, result), {
@@ -14634,6 +15000,8 @@ function _object_spread_props$3(target, source) {
14634
15000
  * Internal helper that marks the `'processing'` checkpoint complete and schedules the `'cleanup'` phase.
14635
15001
  *
14636
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
14637
15005
  */ function completeSubtaskProcessingAndScheduleCleanupTaskResult() {
14638
15006
  return notificationTaskPartiallyComplete([
14639
15007
  'processing'
@@ -14645,6 +15013,9 @@ function _object_spread_props$3(target, source) {
14645
15013
  * Unlike {@link notificationTaskComplete}, this signals that the cleanup checkpoint should still run.
14646
15014
  * Use `canRunNextCheckpoint: true` in options to run cleanup immediately in the same execution.
14647
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
+ *
14648
15019
  * @example
14649
15020
  * ```ts
14650
15021
  * // Processing done, schedule cleanup for next run
@@ -14737,6 +15108,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14737
15108
  *
14738
15109
  * Filters template configs to only include types applicable to the notification box's model.
14739
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
14740
15114
  */ function effectiveNotificationBoxRecipientConfig(input) {
14741
15115
  var _ref, _ref1, _gc_f, _gc_lk, _gc_e, _gc_t;
14742
15116
  var uid = input.uid, inputM = input.m, appNotificationTemplateTypeInfoRecordService = input.appNotificationTemplateTypeInfoRecordService, gc = input.gc, notificationUserNotificationBoxConfig = input.boxConfig, recipient = input.recipient;
@@ -14768,6 +15142,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14768
15142
  * and propagates exclusion flags to the per-box configs.
14769
15143
  *
14770
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
14771
15148
  */ function updateNotificationUserNotificationSendExclusions(input) {
14772
15149
  var notificationUser = input.notificationUser, inputAddExclusions = input.addExclusions, inputRemoveExclusions = input.removeExclusions;
14773
15150
  var associatedNotificationBoxes = notificationUser.b, currentExclusions = notificationUser.x, notificationBoxConfigs = notificationUser.bc;
@@ -14805,6 +15182,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14805
15182
  /**
14806
15183
  * Applies the current exclusion list to per-box configs, setting/clearing the `x` flag and marking
14807
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
14808
15188
  */ function applyExclusionsToNotificationUserNotificationBoxRecipientConfigs(params) {
14809
15189
  var _ref, _ref1;
14810
15190
  var inputX = params.x, inputBc = params.bc, notificationUser = params.notificationUser, recalculateNs = params.recalculateNs;
@@ -14832,6 +15212,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14832
15212
  }
14833
15213
  /**
14834
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
14835
15218
  */ function calculateNsForNotificationUserNotificationBoxRecipientConfigs(configs) {
14836
15219
  return configs.some(function(x) {
14837
15220
  return x.ns;
@@ -14840,11 +15223,14 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14840
15223
  /**
14841
15224
  * Creates a {@link NotificationSendExclusionCanSendFunction} from the given exclusion list.
14842
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
14843
15229
  */ var notificationSendExclusionCanSendFunction = function notificationSendExclusionCanSendFunction(exclusions) {
14844
15230
  var fn = function fn(notification) {
14845
- return exclusions.findIndex(function(x) {
15231
+ return !exclusions.some(function(x) {
14846
15232
  return notification.startsWith(x);
14847
- }) === -1;
15233
+ });
14848
15234
  };
14849
15235
  fn._exclusions = exclusions;
14850
15236
  return fn;
@@ -14853,12 +15239,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14853
15239
  /**
14854
15240
  * Returns true if all channels on the notification have reached a terminal state
14855
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
14856
15245
  */ function notificationSendFlagsImplyIsComplete(input) {
14857
15246
  return isCompleteNotificationSendState(input.es) && isCompleteNotificationSendState(input.ps) && isCompleteNotificationSendState(input.ts) && isCompleteNotificationSendState(input.ns);
14858
15247
  }
14859
15248
  /**
14860
15249
  * Returns true if the given send state is terminal — no further send attempts will be made.
14861
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
14862
15254
  */ function isCompleteNotificationSendState(input) {
14863
15255
  var isComplete = false;
14864
15256
  switch(input){
@@ -14868,7 +15260,11 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14868
15260
  case exports.NotificationSendState.SKIPPED:
14869
15261
  isComplete = true;
14870
15262
  break;
14871
- 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:
14872
15268
  isComplete = false;
14873
15269
  break;
14874
15270
  }
@@ -14876,6 +15272,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14876
15272
  }
14877
15273
  /**
14878
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
14879
15278
  */ function allowedNotificationRecipients(flag) {
14880
15279
  var canSendToGlobalRecipients = true;
14881
15280
  var canSendToBoxRecipients = true;
@@ -14909,6 +15308,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14909
15308
  *
14910
15309
  * Only notifications that can be sent to box recipients are archived (notifications restricted
14911
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
14912
15314
  */ function shouldSaveNotificationToNotificationWeek(notification) {
14913
15315
  return allowedNotificationRecipients(notification.rf).canSendToBoxRecipients;
14914
15316
  }
@@ -14916,6 +15318,10 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14916
15318
  /**
14917
15319
  * Merges a partial update into a {@link NotificationUserNotificationBoxRecipientConfig},
14918
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`
14919
15325
  */ function mergeNotificationUserNotificationBoxRecipientConfigs(a, b) {
14920
15326
  var _b_f;
14921
15327
  return _object_spread_props$2(_object_spread$4({}, mergeNotificationBoxRecipients(a, b)), {
@@ -14930,6 +15336,10 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14930
15336
  }
14931
15337
  /**
14932
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
14933
15343
  */ function mergeNotificationBoxRecipients(a, b) {
14934
15344
  return _object_spread_props$2(_object_spread$4({}, a, b), {
14935
15345
  // configs should be merged/ovewritten
@@ -14939,6 +15349,9 @@ function _unsupported_iterable_to_array$2(o, minLen) {
14939
15349
  /**
14940
15350
  * Resolves a {@link NotificationBoxDocument} from a reference pair, loading by model key if no document is provided directly.
14941
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
14942
15355
  * @throws {Error} When neither a document nor a model key is provided.
14943
15356
  */ function loadNotificationBoxDocumentForReferencePair(input, accessor) {
14944
15357
  var inputNotificationBoxDocument = input.notificationBoxDocument, inputNotificationBoxRelatedModelKey = input.notificationBoxRelatedModelKey;
@@ -15082,11 +15495,17 @@ function _is_native_reflect_construct$2() {
15082
15495
  });
15083
15496
  /**
15084
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
15085
15501
  */ function oidcEntryCollectionReference(context) {
15086
15502
  return context.collection(oidcEntryIdentity.collectionName);
15087
15503
  }
15088
15504
  /**
15089
15505
  * Creates an {@link OidcEntryFirestoreCollection} from the given configuration.
15506
+ *
15507
+ * @param config - the Firestore context and collection configuration
15508
+ * @returns a configured OidcEntryFirestoreCollection
15090
15509
  */ function oidcEntryFirestoreCollection(config) {
15091
15510
  var firestoreContext = config.firestoreContext;
15092
15511
  return firestoreContext.firestoreCollection({
@@ -15102,6 +15521,9 @@ function _is_native_reflect_construct$2() {
15102
15521
 
15103
15522
  /**
15104
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
15105
15527
  */ function oidcEntriesWithTypeQuery(type) {
15106
15528
  return [
15107
15529
  where('type', '==', type)
@@ -15109,6 +15531,10 @@ function _is_native_reflect_construct$2() {
15109
15531
  }
15110
15532
  /**
15111
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
15112
15538
  */ function oidcEntriesByUserCodeQuery(type, userCode) {
15113
15539
  return [
15114
15540
  where('type', '==', type),
@@ -15117,6 +15543,10 @@ function _is_native_reflect_construct$2() {
15117
15543
  }
15118
15544
  /**
15119
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
15120
15550
  */ function oidcEntriesByUidQuery(type, uid) {
15121
15551
  return [
15122
15552
  where('type', '==', type),
@@ -15125,6 +15555,10 @@ function _is_native_reflect_construct$2() {
15125
15555
  }
15126
15556
  /**
15127
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
15128
15562
  */ function oidcEntriesByGrantIdQuery(type, grantId) {
15129
15563
  return [
15130
15564
  where('type', '==', type),
@@ -15133,6 +15567,9 @@ function _is_native_reflect_construct$2() {
15133
15567
  }
15134
15568
  /**
15135
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
15136
15573
  */ function oidcClientEntriesByOwnerQuery(ownershipKey) {
15137
15574
  return [
15138
15575
  where('type', '==', 'Client'),
@@ -15460,6 +15897,10 @@ function _is_native_reflect_construct$1() {
15460
15897
  var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15461
15898
  /**
15462
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
15463
15904
  */ function storageFileGroupCreatedStorageFileKey(purpose, storageFileGroupId) {
15464
15905
  return firestoreModelKey(storageFileIdentity, "".concat(purpose, "_").concat(storageFileGroupId));
15465
15906
  }
@@ -15654,6 +16095,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15654
16095
  * ```ts
15655
16096
  * const colRef = storageFileCollectionReference(firestoreContext);
15656
16097
  * ```
16098
+ *
16099
+ * @param context - the Firestore context to use
16100
+ * @returns the CollectionReference for StorageFile documents
15657
16101
  */ function storageFileCollectionReference(context) {
15658
16102
  return context.collection(storageFileIdentity.collectionName);
15659
16103
  }
@@ -15665,6 +16109,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15665
16109
  * const collection = storageFileFirestoreCollection(firestoreContext);
15666
16110
  * const doc = collection.documentAccessor().newDocument();
15667
16111
  * ```
16112
+ *
16113
+ * @param firestoreContext - the Firestore context to use
16114
+ * @returns a configured StorageFileFirestoreCollection
15668
16115
  */ function storageFileFirestoreCollection(firestoreContext) {
15669
16116
  return firestoreContext.firestoreCollection({
15670
16117
  modelIdentity: storageFileIdentity,
@@ -15757,6 +16204,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15757
16204
  * ```ts
15758
16205
  * const colRef = storageFileGroupCollectionReference(firestoreContext);
15759
16206
  * ```
16207
+ *
16208
+ * @param context - the Firestore context to use
16209
+ * @returns the CollectionReference for StorageFileGroup documents
15760
16210
  */ function storageFileGroupCollectionReference(context) {
15761
16211
  return context.collection(storageFileGroupIdentity.collectionName);
15762
16212
  }
@@ -15768,6 +16218,9 @@ var storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
15768
16218
  * const collection = storageFileGroupFirestoreCollection(firestoreContext);
15769
16219
  * const doc = collection.documentAccessor().loadDocumentForId(groupId);
15770
16220
  * ```
16221
+ *
16222
+ * @param firestoreContext - the Firestore context to use
16223
+ * @returns a configured StorageFileGroupFirestoreCollection
15771
16224
  */ function storageFileGroupFirestoreCollection(firestoreContext) {
15772
16225
  return firestoreContext.firestoreCollection({
15773
16226
  modelIdentity: storageFileGroupIdentity,
@@ -15963,6 +16416,7 @@ function _ts_generator$2(thisArg, body) {
15963
16416
  * initial state setup.
15964
16417
  *
15965
16418
  * @param config - optional defaults for creation type, subgroup, and processing state
16419
+ * @returns a factory function that creates StorageFile document pairs
15966
16420
  * @throws {Error} When neither accessor nor context is provided
15967
16421
  * @throws {Error} When no storage path can be resolved from the input
15968
16422
  * @throws {Error} When FOR_STORAGE_FILE_GROUP is used without parentStorageFileGroup or purpose
@@ -16060,6 +16514,9 @@ function _ts_generator$2(thisArg, body) {
16060
16514
  * Convenience function for creating a StorageFileDocumentPair.
16061
16515
  *
16062
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
16063
16520
  */ function createStorageFileDocumentPair(input) {
16064
16521
  return _async_to_generator$2(function() {
16065
16522
  return _ts_generator$2(this, function(_state) {
@@ -16106,6 +16563,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16106
16563
  *
16107
16564
  * @param storageFileGroupId - the group's document ID
16108
16565
  * @param subPath - optional sub-paths to append
16566
+ * @returns the folder path as a SlashPathFolder string
16109
16567
  *
16110
16568
  * @example
16111
16569
  * ```ts
@@ -16131,6 +16589,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16131
16589
  /**
16132
16590
  * Returns the full storage path for a StorageFileGroup's zip file.
16133
16591
  *
16592
+ * @param storageFileGroupId - the group's document ID
16593
+ * @returns the full SlashPath to the group's zip archive
16594
+ *
16134
16595
  * @example
16135
16596
  * ```ts
16136
16597
  * const zipPath = storageFileGroupZipFileStoragePath('abc123');
@@ -16168,6 +16629,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16168
16629
  * const constraints = storageFilesQueuedForProcessingQuery();
16169
16630
  * const results = await collection.query(constraints);
16170
16631
  * ```
16632
+ *
16633
+ * @returns Firestore query constraints for StorageFiles queued for processing
16171
16634
  */ function storageFilesQueuedForProcessingQuery() {
16172
16635
  return [
16173
16636
  where('ps', '==', exports.StorageFileProcessingState.QUEUED_FOR_PROCESSING)
@@ -16179,6 +16642,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16179
16642
  * Used by the cleanup service to find files ready for permanent deletion.
16180
16643
  *
16181
16644
  * @param now - reference time for comparison; defaults to current time
16645
+ * @returns Firestore query constraints for StorageFiles whose scheduled delete date has passed
16182
16646
  *
16183
16647
  * @example
16184
16648
  * ```ts
@@ -16194,6 +16658,10 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16194
16658
  * with optional subgroup filtering.
16195
16659
  *
16196
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
16197
16665
  * ```ts
16198
16666
  * const constraints = storageFilePurposeAndUserQuery({
16199
16667
  * user: 'user123',
@@ -16216,6 +16684,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16216
16684
  * Used by the sync service to find files whose group memberships need to be propagated.
16217
16685
  *
16218
16686
  * @example
16687
+ * @returns Firestore query constraints for StorageFiles flagged for group synchronization
16688
+ *
16689
+ * @example
16219
16690
  * ```ts
16220
16691
  * const constraints = storageFileFlaggedForSyncWithGroupsQuery();
16221
16692
  * ```
@@ -16231,6 +16702,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16231
16702
  * Used by the initialization service to find newly-created groups that haven't been synced yet.
16232
16703
  *
16233
16704
  * @example
16705
+ * @returns Firestore query constraints for StorageFileGroups needing initialization
16706
+ *
16707
+ * @example
16234
16708
  * ```ts
16235
16709
  * const constraints = storageFileGroupsFlaggedForNeedsInitializationQuery();
16236
16710
  * ```
@@ -16243,6 +16717,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16243
16717
  * Returns query constraints for StorageFileGroups flagged for content regeneration (`re == true`).
16244
16718
  *
16245
16719
  * @example
16720
+ * @returns Firestore query constraints for StorageFileGroups flagged for content regeneration
16721
+ *
16722
+ * @example
16246
16723
  * ```ts
16247
16724
  * const constraints = storageFileGroupsFlaggedForContentRegenerationQuery();
16248
16725
  * ```
@@ -16257,6 +16734,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16257
16734
  * Invalid groups are typically cleaned up (deleted along with their associated files).
16258
16735
  *
16259
16736
  * @example
16737
+ * @returns Firestore query constraints for StorageFileGroups flagged as invalid
16738
+ *
16739
+ * @example
16260
16740
  * ```ts
16261
16741
  * const constraints = storageFileGroupsFlaggedInvalidQuery();
16262
16742
  * ```
@@ -16279,6 +16759,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
16279
16759
  * The created task is unique per StorageFile (only one processing task at a time).
16280
16760
  *
16281
16761
  * @param input - the target StorageFileDocument and optional subtask data
16762
+ * @returns a CreateNotificationTaskTemplate for the StorageFile processing task
16282
16763
  *
16283
16764
  * @example
16284
16765
  * ```ts
@@ -16523,6 +17004,7 @@ function _ts_generator$1(thisArg, body) {
16523
17004
  * Use this within a permission service to define role-based access for StorageFile operations.
16524
17005
  *
16525
17006
  * @param config - the permission output, auth context, and target document
17007
+ * @returns a function that accepts role configuration and returns a GrantRolesOtherwiseFunction
16526
17008
  *
16527
17009
  * @example
16528
17010
  * ```ts
@@ -16533,7 +17015,7 @@ function _ts_generator$1(thisArg, body) {
16533
17015
  * });
16534
17016
  * ```
16535
17017
  */ function grantStorageFileRolesForUserAuthFunction(config) {
16536
- var output = config.output, context = config.context; config.model;
17018
+ var output = config.output, context = config.context;
16537
17019
  return function(input) {
16538
17020
  var rolesForStorageFileUser = input.rolesForStorageFileUser, rolesForStorageFileOwnershipKey = input.rolesForStorageFileOwnershipKey;
16539
17021
  var result = function result() {
@@ -16612,6 +17094,8 @@ function _object_spread$1(target) {
16612
17094
  *
16613
17095
  * Should only be used server-side, as `copy` may not be available on the client.
16614
17096
  *
17097
+ * @returns a factory function that wraps FirebaseStorageAccessorFile instances into StoredFileReader accessors
17098
+ *
16615
17099
  * @example
16616
17100
  * ```ts
16617
17101
  * const factory = storedFileReaderFactory();
@@ -16639,7 +17123,8 @@ function _object_spread$1(target) {
16639
17123
  loadFileStream: file.getStream,
16640
17124
  loadFileMetadata: loadFileMetadata,
16641
17125
  loadCustomMetadata: loadCustomMetadata,
16642
- 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
16643
17128
  };
16644
17129
  return accessor;
16645
17130
  };
@@ -16665,6 +17150,7 @@ function _object_spread$1(target) {
16665
17150
  * Creates a {@link UserUploadsFolderSlashPathFactory} that generates per-user upload folder paths.
16666
17151
  *
16667
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
16668
17154
  *
16669
17155
  * @example
16670
17156
  * ```ts
@@ -16681,6 +17167,11 @@ function _object_spread$1(target) {
16681
17167
  /**
16682
17168
  * Creates a {@link UserUploadsFolderStoragePathFactory} that includes the storage bucket ID.
16683
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
+ *
16684
17175
  * @example
16685
17176
  * ```ts
16686
17177
  * const factory = userUploadsFolderStoragePathFactory({ bucketId: 'my-bucket' });
@@ -16915,6 +17406,7 @@ function _ts_generator(thisArg, body) {
16915
17406
  * (e.g., `image` matches `image.png`, `image-test.jpg`) at {@link HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL}.
16916
17407
  *
16917
17408
  * @param config - file type, match string, and optional determination levels
17409
+ * @returns an UploadedFileTypeDeterminer that classifies by file name
16918
17410
  *
16919
17411
  * @example
16920
17412
  * ```ts
@@ -16964,6 +17456,7 @@ function _ts_generator(thisArg, body) {
16964
17456
  * exactly equals the configured match string.
16965
17457
  *
16966
17458
  * @param config - file type and folder name to match
17459
+ * @returns an UploadedFileTypeDeterminer that classifies by folder name
16967
17460
  *
16968
17461
  * @example
16969
17462
  * ```ts
@@ -17003,6 +17496,7 @@ function _ts_generator(thisArg, body) {
17003
17496
  * built-in determiners.
17004
17497
  *
17005
17498
  * @param config - file type, path match config, optional bucket/file filters
17499
+ * @returns an UploadedFileTypeDeterminer that classifies by storage path
17006
17500
  *
17007
17501
  * @example
17008
17502
  * ```ts
@@ -17049,6 +17543,7 @@ function _ts_generator(thisArg, body) {
17049
17543
  * If `requireUser` is true, the determination fails when no user can be detected.
17050
17544
  *
17051
17545
  * @param config - root folder, user prefix, and matching options
17546
+ * @returns a wrapper function that adds user detection to any UploadedFileTypeDeterminer
17052
17547
  *
17053
17548
  * @example
17054
17549
  * ```ts
@@ -17060,8 +17555,7 @@ function _ts_generator(thisArg, body) {
17060
17555
  * ```
17061
17556
  */ function determineUserByFolderWrapperFunction(config) {
17062
17557
  var _config_matchSubPath;
17063
- 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;
17064
- 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;
17065
17559
  var subPathMatcherConfig = (_config_matchSubPath = config.matchSubPath) !== null && _config_matchSubPath !== void 0 ? _config_matchSubPath : {
17066
17560
  basePath: util.mergeSlashPaths([
17067
17561
  rootFolder,
@@ -17123,6 +17617,9 @@ function _ts_generator(thisArg, body) {
17123
17617
  /**
17124
17618
  * Convenience wrapper pre-configured for the standard uploads folder structure (`uploads/u/{userId}/...`).
17125
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
+ *
17126
17623
  * @example
17127
17624
  * ```ts
17128
17625
  * const addUser = determineUserByUserUploadsFolderWrapperFunction();
@@ -17149,6 +17646,7 @@ function _ts_generator(thisArg, body) {
17149
17646
  *
17150
17647
  * @param determiner - the determiner to filter
17151
17648
  * @param types - allowed file type identifier(s)
17649
+ * @returns an UploadedFileTypeDeterminer that only returns results for the specified file types
17152
17650
  *
17153
17651
  * @example
17154
17652
  * ```ts
@@ -17192,6 +17690,7 @@ function _ts_generator(thisArg, body) {
17192
17690
  * short-circuited via `completeSearchOnFirstMatch` or `completeSearchAtLevel`.
17193
17691
  *
17194
17692
  * @param config - determiners to combine and optional early-exit settings
17693
+ * @returns a combined UploadedFileTypeDeterminer that returns the highest-confidence match
17195
17694
  *
17196
17695
  * @example
17197
17696
  * ```ts
@@ -17206,9 +17705,9 @@ function _ts_generator(thisArg, body) {
17206
17705
  if (determiners.length === 1) {
17207
17706
  result = determiners[0];
17208
17707
  } else {
17209
- var possibleFileTypes = util.unique(determiners.map(function(d) {
17708
+ var possibleFileTypes = util.unique(determiners.flatMap(function(d) {
17210
17709
  return d.getPossibleFileTypes();
17211
- }).flat());
17710
+ }));
17212
17711
  var completeSearchOnFirstMatch = Boolean(inputCompleteSearchOnFirstMatch);
17213
17712
  var completeSearchAtLevel = completeSearchOnFirstMatch ? LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL : inputCompleteSearchAtLevel !== null && inputCompleteSearchAtLevel !== void 0 ? inputCompleteSearchAtLevel : EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
17214
17713
  result = {
@@ -17308,6 +17807,9 @@ function _ts_generator(thisArg, body) {
17308
17807
  * If a document is provided directly, it is returned as-is. Otherwise, the related model key
17309
17808
  * is converted to a group ID via {@link storageFileGroupIdForModel} and loaded from the accessor.
17310
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
17311
17813
  * @throws {Error} When neither storageFileGroupDocument nor storageFileGroupRelatedModelKey is provided
17312
17814
  *
17313
17815
  * @example
@@ -17371,7 +17873,7 @@ function _ts_generator(thisArg, body) {
17371
17873
  ]);
17372
17874
  }
17373
17875
  });
17374
- 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
17375
17877
  // recalculate re if it is false or the retain flag is false
17376
17878
  if (!re || allowRecalculateRegenerateFlag) {
17377
17879
  var flagRegenerate = calculateStorageFileGroupRegeneration({
@@ -17397,6 +17899,7 @@ function _ts_generator(thisArg, body) {
17397
17899
  * - Any embedded file has never been included in the zip (`zat` is unset on the entry)
17398
17900
  *
17399
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
17400
17903
  *
17401
17904
  * @example
17402
17905
  * ```ts
@@ -17564,6 +18067,9 @@ function _is_native_reflect_construct() {
17564
18067
  * ```ts
17565
18068
  * const colRef = systemStateCollectionReference(firestoreContext);
17566
18069
  * ```
18070
+ *
18071
+ * @param context - the Firestore context to use
18072
+ * @returns the CollectionReference for SystemState documents
17567
18073
  */ function systemStateCollectionReference(context) {
17568
18074
  return context.collection(systemStateIdentity.collectionName);
17569
18075
  }
@@ -17576,6 +18082,7 @@ function _is_native_reflect_construct() {
17576
18082
  *
17577
18083
  * @param firestoreContext - the Firestore context
17578
18084
  * @param converters - map of type identifiers to their data field converters
18085
+ * @returns a configured SystemStateFirestoreCollection with per-type data converters
17579
18086
  *
17580
18087
  * @example
17581
18088
  * ```ts