@dereekb/firebase 12.5.9 → 12.6.0

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 (27) hide show
  1. package/index.cjs.js +561 -16
  2. package/index.esm.js +520 -19
  3. package/package.json +1 -1
  4. package/src/lib/common/firestore/collection/collection.d.ts +8 -0
  5. package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +56 -0
  6. package/src/lib/common/model/permission/permission.service.grant.d.ts +5 -1
  7. package/src/lib/common/storage/driver/accessor.d.ts +2 -1
  8. package/src/lib/common/storage/types.d.ts +4 -4
  9. package/src/lib/model/notification/notification.api.d.ts +1 -1
  10. package/src/lib/model/notification/notification.d.ts +4 -2
  11. package/src/lib/model/notification/notification.task.subtask.d.ts +6 -0
  12. package/src/lib/model/storagefile/index.d.ts +4 -0
  13. package/src/lib/model/storagefile/storagefile.action.d.ts +7 -1
  14. package/src/lib/model/storagefile/storagefile.api.d.ts +175 -6
  15. package/src/lib/model/storagefile/storagefile.api.error.d.ts +16 -0
  16. package/src/lib/model/storagefile/storagefile.create.d.ts +24 -3
  17. package/src/lib/model/storagefile/storagefile.d.ts +173 -8
  18. package/src/lib/model/storagefile/storagefile.group.d.ts +9 -0
  19. package/src/lib/model/storagefile/storagefile.group.processing.d.ts +26 -0
  20. package/src/lib/model/storagefile/storagefile.id.d.ts +22 -1
  21. package/src/lib/model/storagefile/storagefile.permission.d.ts +28 -0
  22. package/src/lib/model/storagefile/storagefile.query.d.ts +22 -0
  23. package/src/lib/model/storagefile/storagefile.util.d.ts +55 -0
  24. package/test/CHANGELOG.md +8 -0
  25. package/test/package.json +1 -1
  26. package/test/src/lib/common/storage/test.driver.accessor.js +7 -11
  27. package/test/src/lib/common/storage/test.driver.accessor.js.map +1 -1
package/index.cjs.js CHANGED
@@ -3235,8 +3235,8 @@ function firestoreDate(config = {}) {
3235
3235
  return firestoreField({
3236
3236
  default: config.default ?? (() => new Date()),
3237
3237
  defaultBeforeSave: config.defaultBeforeSave ?? (config.saveDefaultAsNow ? date.formatToISO8601DateString : null),
3238
- fromData: input => date.toJsDate(input),
3239
- toData: input => date.toISODateString(input)
3238
+ fromData: date.toJsDate,
3239
+ toData: date.toISODateString
3240
3240
  });
3241
3241
  }
3242
3242
  /**
@@ -3257,12 +3257,78 @@ function optionalFirestoreDate(config) {
3257
3257
  return optionalFirestoreField({
3258
3258
  ...config,
3259
3259
  dontStoreValueIf,
3260
- transformFromData: input => {
3261
- return date.toJsDate(input);
3262
- },
3263
- transformToData: input => {
3264
- return date.toISODateString(input);
3265
- }
3260
+ transformFromData: date.toJsDate,
3261
+ transformToData: date.toISODateString
3262
+ });
3263
+ }
3264
+ /**
3265
+ * Creates a field mapping configuration for Firestore date fields.
3266
+ *
3267
+ * Handles conversion between JavaScript Date objects and ISO8601 strings stored in Firestore.
3268
+ *
3269
+ * @param config - Configuration for the date field
3270
+ * @returns A field mapping configuration for Date values
3271
+ */
3272
+ function firestoreDateNumber(config) {
3273
+ const {
3274
+ fromDate,
3275
+ toDate
3276
+ } = config;
3277
+ return firestoreField({
3278
+ default: config.default ?? (() => new Date()),
3279
+ defaultBeforeSave: config.defaultBeforeSave ?? (config.saveDefaultAsNow ? fromDate(new Date()) : null),
3280
+ fromData: toDate,
3281
+ toData: fromDate
3282
+ });
3283
+ }
3284
+ /**
3285
+ * Creates a field mapping configuration for optional Firestore date field that is stored as a number.
3286
+ *
3287
+ * @param config - Configuration for the optional date field
3288
+ * @returns A field mapping configuration for optional Date values
3289
+ */
3290
+ function optionalFirestoreDateNumber(config) {
3291
+ const {
3292
+ fromDate,
3293
+ toDate,
3294
+ dontStoreValueIf: inputDontStoreValueIf
3295
+ } = config;
3296
+ let dontStoreValueIf = inputDontStoreValueIf;
3297
+ if (dontStoreValueIf != null && util.isDate(dontStoreValueIf)) {
3298
+ const comparisonDate = dontStoreValueIf;
3299
+ dontStoreValueIf = x => date.isSameDate(x, comparisonDate);
3300
+ }
3301
+ return optionalFirestoreField({
3302
+ ...config,
3303
+ dontStoreValueIf,
3304
+ transformFromData: toDate,
3305
+ transformToData: fromDate
3306
+ });
3307
+ }
3308
+ /**
3309
+ * Creates a field mapping configuration for Firestore Date fields that are stored as a UnixDateTimeSecondsNumber.
3310
+ *
3311
+ * @param config - Configuration for the date field
3312
+ * @returns A field mapping configuration for Date values
3313
+ */
3314
+ function firestoreUnixDateTimeSecondsNumber(config) {
3315
+ return firestoreDateNumber({
3316
+ ...config,
3317
+ fromDate: util.unixDateTimeSecondsNumberFromDate,
3318
+ toDate: util.dateFromDateOrTimeSecondsNumber
3319
+ });
3320
+ }
3321
+ /**
3322
+ * Creates a field mapping configuration for optional Firestore Date fields that are stored as a UnixDateTimeSecondsNumber.
3323
+ *
3324
+ * @param config - Configuration for the optional date field
3325
+ * @returns A field mapping configuration for optional Date values
3326
+ */
3327
+ function optionalFirestoreUnixDateTimeSecondsNumber(config) {
3328
+ return optionalFirestoreDateNumber({
3329
+ ...config,
3330
+ fromDate: util.unixDateTimeSecondsNumberFromDate,
3331
+ toDate: util.dateFromDateOrTimeSecondsNumber
3266
3332
  });
3267
3333
  }
3268
3334
  /**
@@ -6111,6 +6177,12 @@ function firestoreModelKeyPart(identity, id) {
6111
6177
  * @returns
6112
6178
  */
6113
6179
  const firestoreModelKey = firestoreModelKeyPart;
6180
+ /**
6181
+ * Creates a FirestoreModelKeyFactory for the input root identity.
6182
+ */
6183
+ function firestoreModelKeyFactory(identity) {
6184
+ return id => firestoreModelKey(identity, id);
6185
+ }
6114
6186
  /**
6115
6187
  * Creates an array of FirestoreCollectionModelKey values from the input ids.
6116
6188
  *
@@ -8923,6 +8995,9 @@ const notificationSummaryConverter = snapshotConverterFunctions({
8923
8995
  rat: optionalFirestoreDate(),
8924
8996
  s: optionalFirestoreBoolean({
8925
8997
  dontStoreIf: false
8998
+ }),
8999
+ fi: optionalFirestoreBoolean({
9000
+ dontStoreIf: false
8926
9001
  })
8927
9002
  }
8928
9003
  });
@@ -10154,6 +10229,7 @@ function notificationUserHasExclusionQuery(exclusionId) {
10154
10229
  function notificationSummariesFlaggedForNeedsInitializationQuery() {
10155
10230
  return [where('s', '==', true)];
10156
10231
  }
10232
+ // TODO: Also grab summaries that are flagged as invalid and use to delete/cleanup as needed.
10157
10233
  // MARK: NotificationBox
10158
10234
  /**
10159
10235
  * Query for notificationBoxes that are flagged for initialization.
@@ -10279,10 +10355,21 @@ const DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS = 4;
10279
10355
  const DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY = util.MS_IN_HOUR;
10280
10356
  /**
10281
10357
  * Returned by a subtask to complete the processing step and schedule the cleanup step.
10358
+ *
10359
+ * This is used internally in subtask running. Do not use this directly. Use of notificationSubtaskComplete() is preferred.
10282
10360
  */
10283
10361
  function completeSubtaskProcessingAndScheduleCleanupTaskResult() {
10284
10362
  return notificationTaskPartiallyComplete(['processing']);
10285
10363
  }
10364
+ /**
10365
+ * Similar to notificationTaskComplete, but is customized for a subtask with the intent of running the cleanup checkpoint.
10366
+ */
10367
+ function notificationSubtaskComplete(options) {
10368
+ return {
10369
+ ...notificationTaskComplete(options?.updateMetadata),
10370
+ canRunNextCheckpoint: options?.canRunNextCheckpoint
10371
+ };
10372
+ }
10286
10373
 
10287
10374
  var $ = _export;
10288
10375
  var iterate = iterate$2;
@@ -10582,6 +10669,22 @@ const STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE = 'STORAGE_FILE_NOT_FLAGG
10582
10669
  * Thrown if the target StorageFileDocument is flagged for deletion, but has not reached the time to be deleted yet.
10583
10670
  */
10584
10671
  const STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE = 'STORAGE_FILE_CANNOT_BE_DELETED_YET';
10672
+ /**
10673
+ * Thrown if the target InitializedStorageFileModel has already been initialized.
10674
+ */
10675
+ const STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE = 'STORAGE_FILE_MODEL_ALREADY_INITIALIZED';
10676
+ /**
10677
+ * Thrown if the target StorageFileDocument is attempted to be synced with groups, but is not flagged for groups sync.
10678
+ */
10679
+ const STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE = 'STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC';
10680
+ /**
10681
+ * Thrown if the target StorageFileGroupDocument is queued for initialization and the current function is not yet allowed.
10682
+ */
10683
+ const STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE = 'STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION';
10684
+ /**
10685
+ * Thrown if both the target model and storageFileId is not provided in CreateStorageFileGroupParams.
10686
+ */
10687
+ const STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE = 'STORAGE_FILE_GROUP_CREATE_INPUT_ERROR';
10585
10688
 
10586
10689
  /**
10587
10690
  * Used for directly create a new StorageFile.
@@ -10637,16 +10740,21 @@ class ProcessStorageFileParams extends TargetModelParams {
10637
10740
  */
10638
10741
  this.checkRetryProcessing = void 0;
10639
10742
  /**
10640
- * Used with retryProcessing.
10743
+ * Used with checkRetryProcessing.
10641
10744
  *
10642
- * If set, will forcibly create a new processing task even if the existing processing task appears to be ok.
10745
+ * If set, will forcibly create a new processing task even if the existing processing task appears to be ok, or if processing was already marked complete.
10643
10746
  */
10644
10747
  this.forceRestartProcessing = void 0;
10748
+ /**
10749
+ * If set, will start the processing again if the StorageFile is in a successful processing state.
10750
+ */
10751
+ this.processAgainIfSuccessful = void 0;
10645
10752
  }
10646
10753
  }
10647
10754
  __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "runImmediately", void 0);
10648
10755
  __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "checkRetryProcessing", void 0);
10649
10756
  __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "forceRestartProcessing", void 0);
10757
+ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "processAgainIfSuccessful", void 0);
10650
10758
  /**
10651
10759
  * Processes all StorageFiles that are queued for processing.
10652
10760
  */
@@ -10675,16 +10783,132 @@ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidato
10675
10783
  * Processes all StorageFiles that are queued for processing.
10676
10784
  */
10677
10785
  class DeleteAllQueuedStorageFilesParams {}
10786
+ class DownloadStorageFileParams extends TargetModelParams {
10787
+ constructor(...args) {
10788
+ super(...args);
10789
+ /**
10790
+ * Date to expire the download URL.
10791
+ */
10792
+ this.expiresAt = void 0;
10793
+ /**
10794
+ * Duration in milliseconds to expire the download URL from now.
10795
+ */
10796
+ this.expiresIn = void 0;
10797
+ /**
10798
+ * The content disposition for the response to use.
10799
+ */
10800
+ this.responseDisposition = void 0;
10801
+ /**
10802
+ * The content type for the response to use.
10803
+ *
10804
+ * Only available to admins.
10805
+ */
10806
+ this.responseContentType = void 0;
10807
+ /**
10808
+ * Whether or not an admin is creating the link.
10809
+ *
10810
+ * Allows a longer expiration.
10811
+ */
10812
+ this.asAdmin = void 0;
10813
+ }
10814
+ }
10815
+ __decorate([classTransformer.Expose(), classValidator.IsDate(), classValidator.IsOptional(), classTransformer.Type(() => Date), __metadata("design:type", Object)], DownloadStorageFileParams.prototype, "expiresAt", void 0);
10816
+ __decorate([classTransformer.Expose(), classValidator.Min(0), classValidator.IsNumber(), classValidator.IsOptional(), __metadata("design:type", Object)], DownloadStorageFileParams.prototype, "expiresIn", void 0);
10817
+ __decorate([classTransformer.Expose(), classValidator.IsOptional(), classValidator.IsString(), __metadata("design:type", Object)], DownloadStorageFileParams.prototype, "responseDisposition", void 0);
10818
+ __decorate([classTransformer.Expose(), classValidator.IsOptional(), classValidator.IsString(), classValidator.IsMimeType(), __metadata("design:type", Object)], DownloadStorageFileParams.prototype, "responseContentType", void 0);
10819
+ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Object)], DownloadStorageFileParams.prototype, "asAdmin", void 0);
10820
+ /**
10821
+ * Used for creating or initializing a new StorageFileGroup for a StorageFile.
10822
+ *
10823
+ * Mainly used for testing. Not exposed to the API.
10824
+ *
10825
+ * The preferred way is to create a StorageFileGroup through a StorageFile.
10826
+ */
10827
+ class CreateStorageFileGroupParams {
10828
+ constructor() {
10829
+ /**
10830
+ * ModelKey to use for creating the StorageFileGroup.
10831
+ */
10832
+ this.model = void 0;
10833
+ /**
10834
+ * StorageFileId to use for creating the StorageFileGroup.
10835
+ */
10836
+ this.storageFileId = void 0;
10837
+ }
10838
+ }
10839
+ __decorate([classTransformer.Expose(), classValidator.IsOptional(), classValidator.IsNotEmpty(), IsFirestoreModelKey(), __metadata("design:type", Object)], CreateStorageFileGroupParams.prototype, "model", void 0);
10840
+ __decorate([classTransformer.Expose(), classValidator.IsNotEmpty(), IsFirestoreModelId(), __metadata("design:type", Object)], CreateStorageFileGroupParams.prototype, "storageFileId", void 0);
10841
+ class SyncStorageFileWithGroupsParams extends TargetModelParams {
10842
+ constructor(...args) {
10843
+ super(...args);
10844
+ /**
10845
+ * If true, will force syncing even if the StorageFile is not flagged for a resync.
10846
+ */
10847
+ this.force = void 0;
10848
+ }
10849
+ }
10850
+ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Boolean)], SyncStorageFileWithGroupsParams.prototype, "force", void 0);
10851
+ class SyncAllFlaggedStorageFilesWithGroupsParams {}
10852
+ class RegenerateStorageFileGroupContentParams extends TargetModelParams {
10853
+ constructor(...args) {
10854
+ super(...args);
10855
+ /**
10856
+ * If true, will force syncing even if the StorageFile is not flagged for a resync.
10857
+ */
10858
+ this.force = void 0;
10859
+ }
10860
+ }
10861
+ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Boolean)], RegenerateStorageFileGroupContentParams.prototype, "force", void 0);
10862
+ class RegenerateAllFlaggedStorageFileGroupsContentParams {}
10863
+ /**
10864
+ * Used for initializing an uninitialized model like NotificationBox or NotificationSummary.
10865
+ */
10866
+ class InitializeStorageFileModelParams extends TargetModelParams {
10867
+ constructor(...args) {
10868
+ super(...args);
10869
+ /**
10870
+ * Whether or not to throw an error if the notification has already been sent or is being sent.
10871
+ */
10872
+ this.throwErrorIfAlreadyInitialized = void 0;
10873
+ }
10874
+ }
10875
+ __decorate([classTransformer.Expose(), classValidator.IsBoolean(), classValidator.IsOptional(), __metadata("design:type", Boolean)], InitializeStorageFileModelParams.prototype, "throwErrorIfAlreadyInitialized", void 0);
10876
+ class InitializeAllApplicableStorageFileGroupsParams {}
10678
10877
  const storageFileFunctionTypeConfigMap = {};
10679
10878
  const storageFileModelCrudFunctionsConfig = {
10680
- storageFile: ['create:_,fromUpload,allFromUpload', 'update:_,process', 'delete:_']
10879
+ storageFile: ['create:_,fromUpload,allFromUpload', 'update:_,process,syncWithGroups', 'delete:_', 'read:download'],
10880
+ storageFileGroup: ['update:regenerateContent']
10681
10881
  };
10682
10882
  class StorageFileFunctions {}
10683
10883
  const storageFileFunctionMap = callModelFirebaseFunctionMapFactory(storageFileFunctionTypeConfigMap, storageFileModelCrudFunctionsConfig);
10684
10884
 
10885
+ /**
10886
+ * Creates a StorgaeFileGroupId from the input FirestoreModelKey.
10887
+ *
10888
+ * @param modelKey
10889
+ * @returns
10890
+ */
10891
+ const storageFileGroupIdForModel = twoWayFlatFirestoreModelKey;
10892
+ const inferStorageFileGroupRelatedModelKey = inferKeyFromTwoWayFlatFirestoreModelKey;
10893
+
10685
10894
  class StorageFileFirestoreCollections {}
10686
10895
  // MARK: StorageFile
10687
10896
  const storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
10897
+ /**
10898
+ * Creates a StorageFileGroupCreatedStorageFileKey from the input StorageFileGroupId and purpose.
10899
+ */
10900
+ function storageFileGroupCreatedStorageFileKey(purpose, storageFileGroupId) {
10901
+ return firestoreModelKey(storageFileIdentity, `${purpose}_${storageFileGroupId}`);
10902
+ }
10903
+ /**
10904
+ * Creates a factory function for generating StorageFileGroupCreatedStorageFileKey values using the input purpose.
10905
+ *
10906
+ * @param purpose The purpose of the StorageFileGroupCreatedStorageFileKey.
10907
+ * @returns A factory function that takes a StorageFileGroupId and returns a StorageFileGroupCreatedStorageFileKey.
10908
+ */
10909
+ function storageFileGroupCreateStorageFileKeyFactory(purpose) {
10910
+ return storageFileGroupId => storageFileGroupCreatedStorageFileKey(purpose, storageFileGroupId);
10911
+ }
10688
10912
  /**
10689
10913
  * This key is used in the CustomStorageMetadata of a Firebase Storage file that is associated with a StorageFile to link the file to the StorageFile.
10690
10914
  */
@@ -10706,6 +10930,13 @@ exports.StorageFileCreationType = void 0;
10706
10930
  * The StorageFile was initialized from an uploaded file.
10707
10931
  */
10708
10932
  StorageFileCreationType[StorageFileCreationType["INIT_FROM_UPLOAD"] = 2] = "INIT_FROM_UPLOAD";
10933
+ /**
10934
+ * This StorageFile was created by/for a StorageFileGroup.
10935
+ *
10936
+ * When creating a StorageFile via createStorageFileDocumentPairFactory(), this flag changes the behavior to use a parent
10937
+ * StorageFileGroup to derive the created StorageFile's identifier.
10938
+ */
10939
+ StorageFileCreationType[StorageFileCreationType["FOR_STORAGE_FILE_GROUP"] = 3] = "FOR_STORAGE_FILE_GROUP";
10709
10940
  })(exports.StorageFileCreationType || (exports.StorageFileCreationType = {}));
10710
10941
  /**
10711
10942
  * The current file state.
@@ -10825,7 +11056,11 @@ const storageFileConverter = snapshotConverterFunctions({
10825
11056
  o: optionalFirestoreString(),
10826
11057
  p: optionalFirestoreString(),
10827
11058
  d: firestorePassThroughField(),
10828
- sdat: optionalFirestoreDate()
11059
+ sdat: optionalFirestoreDate(),
11060
+ g: firestoreUniqueStringArray(),
11061
+ gs: optionalFirestoreBoolean({
11062
+ dontStoreIf: false
11063
+ })
10829
11064
  }
10830
11065
  });
10831
11066
  function storageFileCollectionReference(context) {
@@ -10840,6 +11075,65 @@ function storageFileFirestoreCollection(firestoreContext) {
10840
11075
  firestoreContext
10841
11076
  });
10842
11077
  }
11078
+ // MARK: StorageFileGroup
11079
+ const storageFileGroupIdentity = firestoreModelIdentity('storageFileGroup', 'sfg');
11080
+ const storageFileGroupEmbeddedFile = firestoreSubObject({
11081
+ objectField: {
11082
+ fields: {
11083
+ s: firestoreModelIdString,
11084
+ sat: firestoreUnixDateTimeSecondsNumber({
11085
+ saveDefaultAsNow: true
11086
+ }),
11087
+ zat: optionalFirestoreUnixDateTimeSecondsNumber()
11088
+ }
11089
+ }
11090
+ });
11091
+ class StorageFileGroupDocument extends AbstractFirestoreDocument {
11092
+ get modelIdentity() {
11093
+ return storageFileGroupIdentity;
11094
+ }
11095
+ get storageFileGroupRelatedModelKey() {
11096
+ return inferStorageFileGroupRelatedModelKey(this.id);
11097
+ }
11098
+ }
11099
+ const storageFileGroupConverter = snapshotConverterFunctions({
11100
+ fields: {
11101
+ f: firestoreObjectArray({
11102
+ objectField: storageFileGroupEmbeddedFile
11103
+ }),
11104
+ cat: firestoreDate(),
11105
+ o: optionalFirestoreString(),
11106
+ z: optionalFirestoreBoolean({
11107
+ dontStoreIf: false
11108
+ }),
11109
+ zsf: optionalFirestoreString(),
11110
+ zat: optionalFirestoreDate(),
11111
+ s: optionalFirestoreBoolean({
11112
+ dontStoreIf: false
11113
+ }),
11114
+ fi: optionalFirestoreBoolean({
11115
+ dontStoreIf: false
11116
+ }),
11117
+ re: optionalFirestoreBoolean({
11118
+ dontStoreIf: false
11119
+ }),
11120
+ c: optionalFirestoreBoolean({
11121
+ dontStoreIf: false
11122
+ })
11123
+ }
11124
+ });
11125
+ function storageFileGroupCollectionReference(context) {
11126
+ return context.collection(storageFileGroupIdentity.collectionName);
11127
+ }
11128
+ function storageFileGroupFirestoreCollection(firestoreContext) {
11129
+ return firestoreContext.firestoreCollection({
11130
+ modelIdentity: storageFileGroupIdentity,
11131
+ converter: storageFileGroupConverter,
11132
+ collection: storageFileGroupCollectionReference(firestoreContext),
11133
+ makeDocument: (accessor, documentAccessor) => new StorageFileGroupDocument(accessor, documentAccessor),
11134
+ firestoreContext
11135
+ });
11136
+ }
10843
11137
 
10844
11138
  /**
10845
11139
  * Creates a CreateStorageFileDocumentPairFactory.
@@ -10865,7 +11159,10 @@ function createStorageFileDocumentPairFactory(config = {}) {
10865
11159
  user,
10866
11160
  purpose,
10867
11161
  metadata,
10868
- shouldBeProcessed
11162
+ shouldBeProcessed,
11163
+ parentStorageFileGroup,
11164
+ storageFileGroupIds,
11165
+ flagForStorageFileGroupsSync
10869
11166
  } = input;
10870
11167
  const now = inputNow ?? new Date();
10871
11168
  let accessor = inputAccessor;
@@ -10882,17 +11179,33 @@ function createStorageFileDocumentPairFactory(config = {}) {
10882
11179
  if (!storagePath) {
10883
11180
  throw new Error('createStorageFileDocumentPair() failed as neither a file, storagePathRef, or storagePath was provided.');
10884
11181
  }
10885
- const storageFileDocument = accessor.newDocument();
11182
+ let storageFileDocument;
11183
+ const p = purpose ?? inputTemplate?.p;
11184
+ const ct = inputTemplate?.ct ?? defaultCreationType;
11185
+ if (ct === exports.StorageFileCreationType.FOR_STORAGE_FILE_GROUP) {
11186
+ if (!parentStorageFileGroup || !p) {
11187
+ throw new Error('createStorageFileDocumentPair() failed as either the "parentStorageFileGroup" or "purpose" value was not provided with StorageFileCreationType.FOR_STORAGE_FILE_GROUP creation type.');
11188
+ }
11189
+ const storageFileGroupId = firestoreModelId(parentStorageFileGroup);
11190
+ const storageFileKey = storageFileGroupCreatedStorageFileKey(p, storageFileGroupId);
11191
+ storageFileDocument = accessor.loadDocumentForKey(storageFileKey);
11192
+ } else {
11193
+ storageFileDocument = accessor.newDocument();
11194
+ }
11195
+ const g = storageFileGroupIds ?? [];
11196
+ const gs = g.length > 0 && flagForStorageFileGroupsSync !== false;
10886
11197
  const template = {
10887
11198
  ...inputTemplate,
11199
+ g,
11200
+ gs,
10888
11201
  cat: now,
10889
11202
  u: user ?? inputTemplate?.u,
10890
11203
  uby: uploadedBy ?? inputTemplate?.uby,
10891
- p: purpose ?? inputTemplate?.p,
11204
+ p,
10892
11205
  d: metadata ?? inputTemplate?.d,
10893
11206
  fs: inputTemplate?.fs ?? exports.StorageFileState.OK,
10894
11207
  ps: shouldBeProcessed ?? defaultShouldBeProcessed ? exports.StorageFileProcessingState.QUEUED_FOR_PROCESSING : exports.StorageFileProcessingState.DO_NOT_PROCESS,
10895
- ct: inputTemplate?.ct ?? defaultCreationType,
11208
+ ct,
10896
11209
  bucketId: storagePath.bucketId,
10897
11210
  pathString: storagePath.pathString
10898
11211
  };
@@ -10913,6 +11226,30 @@ async function createStorageFileDocumentPair(input) {
10913
11226
  return createStorageFileDocumentPairFactory()(input);
10914
11227
  }
10915
11228
 
11229
+ /**
11230
+ * All StorageFileGroup generated files are stored under this root folder.
11231
+ */
11232
+ const STORAGE_FILE_GROUP_ROOT_FOLDER_PATH = '/sfg/';
11233
+ function storageFileGroupFolderPath(storageFileGroupId, ...subPath) {
11234
+ return util.mergeSlashPaths([STORAGE_FILE_GROUP_ROOT_FOLDER_PATH, storageFileGroupId, '/', ...subPath]);
11235
+ }
11236
+ const STORAGE_FILE_GROUP_ZIP_FILE_PATH = 'z.zip';
11237
+ function storageFileGroupZipFileStoragePath(storageFileGroupId) {
11238
+ return storageFileGroupFolderPath(storageFileGroupId, STORAGE_FILE_GROUP_ZIP_FILE_PATH);
11239
+ }
11240
+
11241
+ // MARK: StorageFileGroup Zip StorageFile
11242
+ /**
11243
+ * StorageFilePurpose for a StorageFileGroup's generated zip file.
11244
+ */
11245
+ const STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE = 'sfg_zip';
11246
+ /**
11247
+ * Creates a StorageFileGroupZipStorageFileKey from the input StorageFileGroupId.
11248
+ */
11249
+ const storageFileGroupZipStorageFileKey = storageFileGroupCreateStorageFileKeyFactory(STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE);
11250
+ const STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK = 'create_zip';
11251
+ const STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME = 'info.json';
11252
+
10916
11253
  // MARK: StorageFile
10917
11254
  /**
10918
11255
  * Returns a query constraint for StorageFiles that are queued for processing.
@@ -10929,6 +11266,37 @@ function storageFilesQueuedForDeleteQuery(now) {
10929
11266
  function storageFilePurposeAndUserQuery(input) {
10930
11267
  return [where('p', '==', input.purpose), where('u', '==', input.user)];
10931
11268
  }
11269
+ function storageFileFlaggedForSyncWithGroupsQuery() {
11270
+ return [where('gs', '==', true)];
11271
+ }
11272
+ // MARK: StorageFileGroup
11273
+ /**
11274
+ * Query for storageFileGroups that are flagged for initialization.
11275
+ *
11276
+ * @param now
11277
+ * @returns
11278
+ */
11279
+ function storageFileGroupsFlaggedForNeedsInitializationQuery() {
11280
+ return [where('s', '==', true)];
11281
+ }
11282
+ /**
11283
+ * Query for storageFileGroups that are flagged for content regeneration.
11284
+ *
11285
+ * @param now
11286
+ * @returns
11287
+ */
11288
+ function storageFileGroupsFlaggedForContentRegenerationQuery() {
11289
+ return [where('re', '==', true)];
11290
+ }
11291
+ /**
11292
+ * Query for storageFileGroups that are flagged as invalid.
11293
+ *
11294
+ * @param now
11295
+ * @returns
11296
+ */
11297
+ function storageFileGroupsFlaggedInvalidQuery() {
11298
+ return [where('fi', '==', true)];
11299
+ }
10932
11300
 
10933
11301
  // MARK: Storage File Processing Notification
10934
11302
  const STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE = 'SFP';
@@ -10962,6 +11330,47 @@ const STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_PROCESSING = NOTIFICA
10962
11330
  */
10963
11331
  const STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_CLEANUP = NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP;
10964
11332
 
11333
+ /**
11334
+ * Creates a new GrantStorageFileRolesForUserAuthFunction given the input config/context.
11335
+ *
11336
+ * @param config
11337
+ * @returns
11338
+ */
11339
+ function grantStorageFileRolesForUserAuthFunction(config) {
11340
+ const {
11341
+ output,
11342
+ context,
11343
+ model
11344
+ } = config;
11345
+ return input => {
11346
+ const {
11347
+ rolesForStorageFileUser,
11348
+ rolesForStorageFileOwnershipKey
11349
+ } = input;
11350
+ const result = async () => {
11351
+ const {
11352
+ data: storageFile
11353
+ } = output;
11354
+ let userRoles;
11355
+ let ownershipKeyRoles;
11356
+ // check roles if the user matches
11357
+ if (rolesForStorageFileUser && storageFile?.u === context.auth?.uid) {
11358
+ userRoles = Promise.resolve(rolesForStorageFileUser());
11359
+ }
11360
+ // check roles if the ownership key is available
11361
+ if (rolesForStorageFileOwnershipKey && storageFile?.o) {
11362
+ ownershipKeyRoles = Promise.resolve(rolesForStorageFileOwnershipKey(storageFile.o));
11363
+ }
11364
+ const [a, b] = await Promise.all([userRoles, ownershipKeyRoles]);
11365
+ return {
11366
+ ...(a ?? {}),
11367
+ ...(b ?? {})
11368
+ };
11369
+ };
11370
+ return result;
11371
+ };
11372
+ }
11373
+
10965
11374
  /**
10966
11375
  * Creates a StoredFileReaderFactory.
10967
11376
  *
@@ -11291,6 +11700,98 @@ function combineUploadFileTypeDeterminers(config) {
11291
11700
  return result;
11292
11701
  }
11293
11702
 
11703
+ function loadStorageFileGroupDocumentForReferencePair(input, accessor) {
11704
+ const {
11705
+ storageFileGroupDocument: inputStorageFileGroupDocument,
11706
+ storageFileGroupRelatedModelKey: inputStorageFileGroupRelatedModelKey
11707
+ } = input;
11708
+ let storageFileGroupDocument;
11709
+ if (inputStorageFileGroupDocument != null) {
11710
+ storageFileGroupDocument = inputStorageFileGroupDocument;
11711
+ } else if (inputStorageFileGroupRelatedModelKey) {
11712
+ const storageFileGroupId = storageFileGroupIdForModel(inputStorageFileGroupRelatedModelKey);
11713
+ storageFileGroupDocument = accessor.loadDocumentForId(storageFileGroupId);
11714
+ } else {
11715
+ throw new Error('StorageFileGroupDocument or StorageFileGroupRelatedModelKey is required');
11716
+ }
11717
+ return storageFileGroupDocument;
11718
+ }
11719
+ function calculateStorageFileGroupEmbeddedFileUpdate(input) {
11720
+ const {
11721
+ storageFileGroup,
11722
+ insert,
11723
+ remove,
11724
+ allowRecalculateRegenerateFlag
11725
+ } = input;
11726
+ const {
11727
+ f: currentF,
11728
+ re: currentRe,
11729
+ z: currentZ,
11730
+ zat: currentZat
11731
+ } = storageFileGroup;
11732
+ const removeSet = new Set(remove);
11733
+ const mergeFunction = util.mergeObjectsFunction(util.KeyValueTypleValueFilter.UNDEFINED);
11734
+ const fWithRemovedTargetsRemoved = currentF.filter(x => !removeSet.has(x.s));
11735
+ const oneOrMoreItemsWereRemoved = fWithRemovedTargetsRemoved.length < currentF.length;
11736
+ const f = util.ModelRelationUtility.insertCollection(fWithRemovedTargetsRemoved, insert ?? [], {
11737
+ readKey: x => x.s,
11738
+ readType: () => 'x',
11739
+ merge: (a, b) => mergeFunction([a, b])
11740
+ });
11741
+ let re = currentRe || oneOrMoreItemsWereRemoved; // flag removed if any items were removed
11742
+ // recalculate re if it is false or the retain flag is false
11743
+ if (!re || allowRecalculateRegenerateFlag) {
11744
+ const {
11745
+ flagRegenerate
11746
+ } = calculateStorageFileGroupRegeneration({
11747
+ storageFileGroup: {
11748
+ f,
11749
+ z: currentZ,
11750
+ zat: currentZat
11751
+ }
11752
+ });
11753
+ re = flagRegenerate;
11754
+ }
11755
+ return {
11756
+ f,
11757
+ re
11758
+ };
11759
+ }
11760
+ /**
11761
+ * Calculates the regeneration flags for a StorageFileGroup.
11762
+ *
11763
+ * @param input CalculateStorageFileGroupRegenerationInput
11764
+ * @returns CalculateStorageFileGroupRegenerationResult
11765
+ */
11766
+ function calculateStorageFileGroupRegeneration(input) {
11767
+ const {
11768
+ storageFileGroup,
11769
+ force
11770
+ } = input;
11771
+ const {
11772
+ f,
11773
+ z,
11774
+ zat
11775
+ } = storageFileGroup;
11776
+ let regenerateZip = undefined;
11777
+ // check regeneration of zip file should be flagged
11778
+ if (z) {
11779
+ if (force) {
11780
+ regenerateZip = true;
11781
+ } else if (zat) {
11782
+ // check that each of the entries have a zat value. If not set, then they've never been added to the archive
11783
+ regenerateZip = f.some(x => !x.zat);
11784
+ } else {
11785
+ regenerateZip = f.length > 0; // if never generated, and there are files, regenerate it
11786
+ }
11787
+ }
11788
+ const re = regenerateZip ?? false;
11789
+ return {
11790
+ flagRegenerate: re,
11791
+ regenerateZip
11792
+ };
11793
+ }
11794
+
11294
11795
  // MARK: Collection
11295
11796
  class SystemStateFirestoreCollections {}
11296
11797
  // MARK: Mock Item
@@ -11352,6 +11853,7 @@ exports.ContextGrantedModelRolesReaderInstance = ContextGrantedModelRolesReaderI
11352
11853
  exports.CreateNotificationBoxParams = CreateNotificationBoxParams;
11353
11854
  exports.CreateNotificationSummaryParams = CreateNotificationSummaryParams;
11354
11855
  exports.CreateNotificationUserParams = CreateNotificationUserParams;
11856
+ exports.CreateStorageFileGroupParams = CreateStorageFileGroupParams;
11355
11857
  exports.CreateStorageFileParams = CreateStorageFileParams;
11356
11858
  exports.DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE = DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE;
11357
11859
  exports.DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE = DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE;
@@ -11372,6 +11874,7 @@ exports.DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = DEFAULT_UPLOADED_FILE_T
11372
11874
  exports.DEFAULT_WEBSITE_LINK = DEFAULT_WEBSITE_LINK;
11373
11875
  exports.DeleteAllQueuedStorageFilesParams = DeleteAllQueuedStorageFilesParams;
11374
11876
  exports.DeleteStorageFileParams = DeleteStorageFileParams;
11877
+ exports.DownloadStorageFileParams = DownloadStorageFileParams;
11375
11878
  exports.EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
11376
11879
  exports.FIREBASE_AUTH_NETWORK_REQUEST_ERROR = FIREBASE_AUTH_NETWORK_REQUEST_ERROR;
11377
11880
  exports.FIREBASE_AUTH_NETWORK_REQUEST_FAILED = FIREBASE_AUTH_NETWORK_REQUEST_FAILED;
@@ -11417,9 +11920,11 @@ exports.InferredTargetModelIdParams = InferredTargetModelIdParams;
11417
11920
  exports.InferredTargetModelParams = InferredTargetModelParams;
11418
11921
  exports.InitializeAllApplicableNotificationBoxesParams = InitializeAllApplicableNotificationBoxesParams;
11419
11922
  exports.InitializeAllApplicableNotificationSummariesParams = InitializeAllApplicableNotificationSummariesParams;
11923
+ exports.InitializeAllApplicableStorageFileGroupsParams = InitializeAllApplicableStorageFileGroupsParams;
11420
11924
  exports.InitializeAllStorageFilesFromUploadsParams = InitializeAllStorageFilesFromUploadsParams;
11421
11925
  exports.InitializeNotificationModelParams = InitializeNotificationModelParams;
11422
11926
  exports.InitializeStorageFileFromUploadParams = InitializeStorageFileFromUploadParams;
11927
+ exports.InitializeStorageFileModelParams = InitializeStorageFileModelParams;
11423
11928
  exports.IsFirestoreModelId = IsFirestoreModelId;
11424
11929
  exports.IsFirestoreModelIdOrKey = IsFirestoreModelIdOrKey;
11425
11930
  exports.IsFirestoreModelKey = IsFirestoreModelKey;
@@ -11462,13 +11967,24 @@ exports.NotificationWeekDocument = NotificationWeekDocument;
11462
11967
  exports.ProcessAllQueuedStorageFilesParams = ProcessAllQueuedStorageFilesParams;
11463
11968
  exports.ProcessStorageFileParams = ProcessStorageFileParams;
11464
11969
  exports.RUN_DEV_FUNCTION_APP_FUNCTION_KEY = RUN_DEV_FUNCTION_APP_FUNCTION_KEY;
11970
+ exports.RegenerateAllFlaggedStorageFileGroupsContentParams = RegenerateAllFlaggedStorageFileGroupsContentParams;
11971
+ exports.RegenerateStorageFileGroupContentParams = RegenerateStorageFileGroupContentParams;
11465
11972
  exports.ResyncAllNotificationUserParams = ResyncAllNotificationUserParams;
11466
11973
  exports.ResyncNotificationUserParams = ResyncNotificationUserParams;
11467
11974
  exports.SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER = SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER;
11468
11975
  exports.STORAGEFILE_RELATED_FILE_METADATA_KEY = STORAGEFILE_RELATED_FILE_METADATA_KEY;
11469
11976
  exports.STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE = STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE;
11470
11977
  exports.STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE = STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE;
11978
+ exports.STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE = STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE;
11979
+ exports.STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE = STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE;
11980
+ exports.STORAGE_FILE_GROUP_ROOT_FOLDER_PATH = STORAGE_FILE_GROUP_ROOT_FOLDER_PATH;
11981
+ exports.STORAGE_FILE_GROUP_ZIP_FILE_PATH = STORAGE_FILE_GROUP_ZIP_FILE_PATH;
11982
+ exports.STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME = STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME;
11983
+ exports.STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE = STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE;
11984
+ exports.STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK = STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK;
11985
+ exports.STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE = STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE;
11471
11986
  exports.STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE = STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE;
11987
+ exports.STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE = STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE;
11472
11988
  exports.STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_CLEANUP = STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_CLEANUP;
11473
11989
  exports.STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_PROCESSING = STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_CHECKPOINT_PROCESSING;
11474
11990
  exports.STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE = STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE;
@@ -11484,7 +12000,10 @@ exports.SendQueuedNotificationsParams = SendQueuedNotificationsParams;
11484
12000
  exports.StorageFileDocument = StorageFileDocument;
11485
12001
  exports.StorageFileFirestoreCollections = StorageFileFirestoreCollections;
11486
12002
  exports.StorageFileFunctions = StorageFileFunctions;
12003
+ exports.StorageFileGroupDocument = StorageFileGroupDocument;
11487
12004
  exports.StorageFileUploadStreamUnsupportedError = StorageFileUploadStreamUnsupportedError;
12005
+ exports.SyncAllFlaggedStorageFilesWithGroupsParams = SyncAllFlaggedStorageFilesWithGroupsParams;
12006
+ exports.SyncStorageFileWithGroupsParams = SyncStorageFileWithGroupsParams;
11488
12007
  exports.SystemStateDocument = SystemStateDocument;
11489
12008
  exports.SystemStateFirestoreCollections = SystemStateFirestoreCollections;
11490
12009
  exports.TargetModelIdParams = TargetModelIdParams;
@@ -11523,6 +12042,8 @@ exports.assignWebsiteFileLinkFunction = assignWebsiteFileLinkFunction;
11523
12042
  exports.assignWebsiteLinkFunction = assignWebsiteLinkFunction;
11524
12043
  exports.buildFirebaseCollectionTypeModelTypeMap = buildFirebaseCollectionTypeModelTypeMap;
11525
12044
  exports.calculateNsForNotificationUserNotificationBoxRecipientConfigs = calculateNsForNotificationUserNotificationBoxRecipientConfigs;
12045
+ exports.calculateStorageFileGroupEmbeddedFileUpdate = calculateStorageFileGroupEmbeddedFileUpdate;
12046
+ exports.calculateStorageFileGroupRegeneration = calculateStorageFileGroupRegeneration;
11526
12047
  exports.callModelFirebaseFunctionMapFactory = callModelFirebaseFunctionMapFactory;
11527
12048
  exports.canQueueStorageFileForProcessing = canQueueStorageFileForProcessing;
11528
12049
  exports.childFirestoreModelKey = childFirestoreModelKey;
@@ -11615,6 +12136,7 @@ exports.firestoreDateCellRangeArray = firestoreDateCellRangeArray;
11615
12136
  exports.firestoreDateCellRangeAssignFn = firestoreDateCellRangeAssignFn;
11616
12137
  exports.firestoreDateCellSchedule = firestoreDateCellSchedule;
11617
12138
  exports.firestoreDateCellScheduleAssignFn = firestoreDateCellScheduleAssignFn;
12139
+ exports.firestoreDateNumber = firestoreDateNumber;
11618
12140
  exports.firestoreDencoderArray = firestoreDencoderArray;
11619
12141
  exports.firestoreDencoderMap = firestoreDencoderMap;
11620
12142
  exports.firestoreDencoderStringArray = firestoreDencoderStringArray;
@@ -11659,6 +12181,7 @@ exports.firestoreModelKeyCollectionTypeArray = firestoreModelKeyCollectionTypeAr
11659
12181
  exports.firestoreModelKeyCollectionTypeArrayName = firestoreModelKeyCollectionTypeArrayName;
11660
12182
  exports.firestoreModelKeyCollectionTypePair = firestoreModelKeyCollectionTypePair;
11661
12183
  exports.firestoreModelKeyEncodedGrantedRoleMap = firestoreModelKeyEncodedGrantedRoleMap;
12184
+ exports.firestoreModelKeyFactory = firestoreModelKeyFactory;
11662
12185
  exports.firestoreModelKeyFromDocument = firestoreModelKeyFromDocument;
11663
12186
  exports.firestoreModelKeyGrantedRoleArrayMap = firestoreModelKeyGrantedRoleArrayMap;
11664
12187
  exports.firestoreModelKeyGrantedRoleMap = firestoreModelKeyGrantedRoleMap;
@@ -11699,6 +12222,7 @@ exports.firestoreUniqueNumberArray = firestoreUniqueNumberArray;
11699
12222
  exports.firestoreUniqueStringArray = firestoreUniqueStringArray;
11700
12223
  exports.firestoreUnitedStatesAddress = firestoreUnitedStatesAddress;
11701
12224
  exports.firestoreUnitedStatesAddressAssignFn = firestoreUnitedStatesAddressAssignFn;
12225
+ exports.firestoreUnixDateTimeSecondsNumber = firestoreUnixDateTimeSecondsNumber;
11702
12226
  exports.firestoreUpdateWithNoDataError = firestoreUpdateWithNoDataError;
11703
12227
  exports.firestoreWebsiteFileLink = firestoreWebsiteFileLink;
11704
12228
  exports.firestoreWebsiteFileLinkAssignFn = firestoreWebsiteFileLinkAssignFn;
@@ -11727,11 +12251,13 @@ exports.grantModelRolesIfFunction = grantModelRolesIfFunction;
11727
12251
  exports.grantModelRolesIfHasAuthRolesFactory = grantModelRolesIfHasAuthRolesFactory;
11728
12252
  exports.grantModelRolesIfHasAuthRolesFunction = grantModelRolesIfHasAuthRolesFunction;
11729
12253
  exports.grantModelRolesOnlyIfFunction = grantModelRolesOnlyIfFunction;
12254
+ exports.grantStorageFileRolesForUserAuthFunction = grantStorageFileRolesForUserAuthFunction;
11730
12255
  exports.inContextFirebaseModelServiceFactory = inContextFirebaseModelServiceFactory;
11731
12256
  exports.inContextFirebaseModelsServiceFactory = inContextFirebaseModelsServiceFactory;
11732
12257
  exports.incrementUpdateWithAccessorFunction = incrementUpdateWithAccessorFunction;
11733
12258
  exports.inferKeyFromTwoWayFlatFirestoreModelKey = inferKeyFromTwoWayFlatFirestoreModelKey;
11734
12259
  exports.inferNotificationBoxRelatedModelKey = inferNotificationBoxRelatedModelKey;
12260
+ exports.inferStorageFileGroupRelatedModelKey = inferStorageFileGroupRelatedModelKey;
11735
12261
  exports.interceptAccessorFactoryFunction = interceptAccessorFactoryFunction;
11736
12262
  exports.isAdminInFirebaseModelContext = isAdminInFirebaseModelContext;
11737
12263
  exports.isClientFirebaseError = isClientFirebaseError;
@@ -11769,6 +12295,7 @@ exports.loadDocumentsForKeysFromValues = loadDocumentsForKeysFromValues;
11769
12295
  exports.loadDocumentsForSnapshots = loadDocumentsForSnapshots;
11770
12296
  exports.loadDocumentsForValues = loadDocumentsForValues;
11771
12297
  exports.loadNotificationBoxDocumentForReferencePair = loadNotificationBoxDocumentForReferencePair;
12298
+ exports.loadStorageFileGroupDocumentForReferencePair = loadStorageFileGroupDocumentForReferencePair;
11772
12299
  exports.makeDocuments = makeDocuments;
11773
12300
  exports.makeFirestoreCollection = makeFirestoreCollection;
11774
12301
  exports.makeFirestoreCollectionGroup = makeFirestoreCollectionGroup;
@@ -11812,6 +12339,7 @@ exports.notificationIdentity = notificationIdentity;
11812
12339
  exports.notificationMessageFunction = notificationMessageFunction;
11813
12340
  exports.notificationSendExclusionCanSendFunction = notificationSendExclusionCanSendFunction;
11814
12341
  exports.notificationSendFlagsImplyIsComplete = notificationSendFlagsImplyIsComplete;
12342
+ exports.notificationSubtaskComplete = notificationSubtaskComplete;
11815
12343
  exports.notificationSummariesFlaggedForNeedsInitializationQuery = notificationSummariesFlaggedForNeedsInitializationQuery;
11816
12344
  exports.notificationSummaryCollectionReference = notificationSummaryCollectionReference;
11817
12345
  exports.notificationSummaryConverter = notificationSummaryConverter;
@@ -11854,12 +12382,14 @@ exports.onCallUpdateModelParams = onCallUpdateModelParams;
11854
12382
  exports.optionalFirestoreArray = optionalFirestoreArray;
11855
12383
  exports.optionalFirestoreBoolean = optionalFirestoreBoolean;
11856
12384
  exports.optionalFirestoreDate = optionalFirestoreDate;
12385
+ exports.optionalFirestoreDateNumber = optionalFirestoreDateNumber;
11857
12386
  exports.optionalFirestoreEnum = optionalFirestoreEnum;
11858
12387
  exports.optionalFirestoreField = optionalFirestoreField;
11859
12388
  exports.optionalFirestoreNumber = optionalFirestoreNumber;
11860
12389
  exports.optionalFirestoreString = optionalFirestoreString;
11861
12390
  exports.optionalFirestoreUID = optionalFirestoreUID;
11862
12391
  exports.optionalFirestoreUnitedStatesAddress = optionalFirestoreUnitedStatesAddress;
12392
+ exports.optionalFirestoreUnixDateTimeSecondsNumber = optionalFirestoreUnixDateTimeSecondsNumber;
11863
12393
  exports.orderBy = orderBy;
11864
12394
  exports.orderByDocumentId = orderByDocumentId;
11865
12395
  exports.readFirestoreModelKey = readFirestoreModelKey;
@@ -11881,8 +12411,23 @@ exports.startAtValue = startAtValue;
11881
12411
  exports.storageFileCollectionReference = storageFileCollectionReference;
11882
12412
  exports.storageFileConverter = storageFileConverter;
11883
12413
  exports.storageFileFirestoreCollection = storageFileFirestoreCollection;
12414
+ exports.storageFileFlaggedForSyncWithGroupsQuery = storageFileFlaggedForSyncWithGroupsQuery;
11884
12415
  exports.storageFileFunctionMap = storageFileFunctionMap;
11885
12416
  exports.storageFileFunctionTypeConfigMap = storageFileFunctionTypeConfigMap;
12417
+ exports.storageFileGroupCollectionReference = storageFileGroupCollectionReference;
12418
+ exports.storageFileGroupConverter = storageFileGroupConverter;
12419
+ exports.storageFileGroupCreateStorageFileKeyFactory = storageFileGroupCreateStorageFileKeyFactory;
12420
+ exports.storageFileGroupCreatedStorageFileKey = storageFileGroupCreatedStorageFileKey;
12421
+ exports.storageFileGroupEmbeddedFile = storageFileGroupEmbeddedFile;
12422
+ exports.storageFileGroupFirestoreCollection = storageFileGroupFirestoreCollection;
12423
+ exports.storageFileGroupFolderPath = storageFileGroupFolderPath;
12424
+ exports.storageFileGroupIdForModel = storageFileGroupIdForModel;
12425
+ exports.storageFileGroupIdentity = storageFileGroupIdentity;
12426
+ exports.storageFileGroupZipFileStoragePath = storageFileGroupZipFileStoragePath;
12427
+ exports.storageFileGroupZipStorageFileKey = storageFileGroupZipStorageFileKey;
12428
+ exports.storageFileGroupsFlaggedForContentRegenerationQuery = storageFileGroupsFlaggedForContentRegenerationQuery;
12429
+ exports.storageFileGroupsFlaggedForNeedsInitializationQuery = storageFileGroupsFlaggedForNeedsInitializationQuery;
12430
+ exports.storageFileGroupsFlaggedInvalidQuery = storageFileGroupsFlaggedInvalidQuery;
11886
12431
  exports.storageFileIdentity = storageFileIdentity;
11887
12432
  exports.storageFileModelCrudFunctionsConfig = storageFileModelCrudFunctionsConfig;
11888
12433
  exports.storageFileProcessingNotificationTaskTemplate = storageFileProcessingNotificationTaskTemplate;