@dereekb/firebase 12.4.5 → 12.5.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 (37) hide show
  1. package/index.cjs.js +1523 -231
  2. package/index.esm.js +1458 -234
  3. package/package.json +1 -1
  4. package/src/lib/common/firestore/query/iterator.d.ts +39 -9
  5. package/src/lib/common/firestore/query/watcher.d.ts +2 -2
  6. package/src/lib/common/storage/driver/accessor.d.ts +62 -6
  7. package/src/lib/common/storage/driver/accessor.iterate.d.ts +38 -0
  8. package/src/lib/common/storage/driver/accessor.util.d.ts +14 -0
  9. package/src/lib/common/storage/driver/error.d.ts +4 -0
  10. package/src/lib/common/storage/driver/index.d.ts +2 -0
  11. package/src/lib/common/storage/driver/list.d.ts +4 -2
  12. package/src/lib/common/storage/storage.d.ts +7 -0
  13. package/src/lib/common/storage/types.d.ts +141 -32
  14. package/src/lib/model/index.d.ts +1 -0
  15. package/src/lib/model/notification/notification.api.d.ts +10 -0
  16. package/src/lib/model/notification/notification.create.d.ts +2 -2
  17. package/src/lib/model/notification/notification.item.d.ts +2 -0
  18. package/src/lib/model/notification/notification.task.d.ts +22 -8
  19. package/src/lib/model/storagefile/index.d.ts +12 -0
  20. package/src/lib/model/storagefile/storagefile.action.d.ts +8 -0
  21. package/src/lib/model/storagefile/storagefile.api.d.ts +148 -0
  22. package/src/lib/model/storagefile/storagefile.api.error.d.ts +51 -0
  23. package/src/lib/model/storagefile/storagefile.create.d.ts +121 -0
  24. package/src/lib/model/storagefile/storagefile.d.ts +164 -0
  25. package/src/lib/model/storagefile/storagefile.file.d.ts +55 -0
  26. package/src/lib/model/storagefile/storagefile.id.d.ts +20 -0
  27. package/src/lib/model/storagefile/storagefile.query.d.ts +17 -0
  28. package/src/lib/model/storagefile/storagefile.task.d.ts +67 -0
  29. package/src/lib/model/storagefile/storagefile.upload.claims.d.ts +26 -0
  30. package/src/lib/model/storagefile/storagefile.upload.d.ts +52 -0
  31. package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +271 -0
  32. package/test/CHANGELOG.md +9 -0
  33. package/test/package.json +1 -1
  34. package/test/src/lib/common/storage/storage.js +3 -3
  35. package/test/src/lib/common/storage/storage.js.map +1 -1
  36. package/test/src/lib/common/storage/test.driver.accessor.js +331 -29
  37. package/test/src/lib/common/storage/test.driver.accessor.js.map +1 -1
package/index.esm.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { increment, arrayUnion, arrayRemove, onSnapshot, getDoc, deleteDoc, setDoc, updateDoc, doc, collectionGroup, collection, runTransaction, writeBatch, limit as limit$1, limitToLast as limitToLast$1, orderBy as orderBy$1, documentId, where as where$1, startAt as startAt$1, startAfter as startAfter$1, endAt as endAt$1, endBefore as endBefore$1, getCountFromServer, getDocs, query } from 'firebase/firestore';
2
- import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, wrapUseAsyncFunction, makeWithFactory, performMakeLoop, runAsyncTasksForValues, filterMaybeArrayValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyArrayValues, modelFieldMapFunctions, toModelMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, sortAscendingIndexNumberRefFunction, bitwiseSetDencoder, MAP_IDENTITY, filterNullAndUndefinedValues, convertToArray, pushItemOrArrayItemsIntoArray, separateValues, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, performAsyncTasks, batch, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, flattenArray, calculateExpirationDate, groupValues, forEachInIterable, stringContains, arrayToObject, takeFront, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, updateMaybeValue, mergeObjects, mergeObjectsFunction, UNSET_INDEX_NUMBER, forEachKeyValue, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, isThrottled, MS_IN_HOUR, multiValueMapBuilder } from '@dereekb/util';
2
+ import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, wrapUseAsyncFunction, makeWithFactory, performMakeLoop, runAsyncTasksForValues, filterMaybeArrayValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyArrayValues, modelFieldMapFunctions, toModelMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, sortAscendingIndexNumberRefFunction, bitwiseSetDencoder, MAP_IDENTITY, filterNullAndUndefinedValues, convertToArray, pushItemOrArrayItemsIntoArray, separateValues, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, performAsyncTasks, batch, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, flattenArray, calculateExpirationDate, groupValues, forEachInIterable, stringContains, arrayToObject, takeFront, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, updateMaybeValue, mergeObjects, mergeObjectsFunction, UNSET_INDEX_NUMBER, forEachKeyValue, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, isThrottled, MS_IN_HOUR, multiValueMapBuilder, slashPathDetails, toAbsoluteSlashPathStartType, SLASH_PATH_FILE_TYPE_SEPARATOR, slashPathPathMatcher, decisionFunction, mergeSlashPaths, slashPathSubPathMatcher } from '@dereekb/util';
3
3
  import { filterMaybe, lazyFrom, itemAccumulator, ItemPageIterator, mappedPageItemIteration } from '@dereekb/rxjs';
4
4
  import { from, map as map$1, combineLatest, shareReplay, of, exhaustMap, Observable, switchMap, timer, skip } from 'rxjs';
5
5
  import { UNKNOWN_WEBSITE_LINK_TYPE, decodeWebsiteLinkEncodedDataToWebsiteFileLink, encodeWebsiteFileLinkToWebsiteLinkEncodedData, AbstractModelPermissionService, grantedRoleMapReader, noAccessRoleMap, fullAccessRoleMap, IsE164PhoneNumber } from '@dereekb/model';
6
6
  import { formatToISO8601DateString, toJsDate, toISODateString, isSameDate, dateRange, sortByDateFunction, yearWeekCode, UNKNOWN_YEAR_WEEK_CODE } from '@dereekb/date';
7
7
  import { httpsCallable } from 'firebase/functions';
8
- import { ref, getMetadata, getDownloadURL, uploadString, uploadBytes, getBytes, getBlob, uploadBytesResumable, deleteObject, list } from 'firebase/storage';
8
+ import { ref, getMetadata, getDownloadURL, updateMetadata, uploadString, uploadBytes, getBytes, getBlob, uploadBytesResumable, deleteObject, list } from 'firebase/storage';
9
9
  import { Expose, Type } from 'class-transformer';
10
10
  import { IsEnum, IsString, IsOptional, registerDecorator, buildMessage, IsNotEmpty, IsBoolean, IsNumber, IsEmail, IsArray, ValidateNested, IsPhoneNumber, IsDate, MinLength, MaxLength } from 'class-validator';
11
+ import { fetchPageFactory, iterateFetchPagesByEachItem, iterateFetchPages } from '@dereekb/util/fetch';
11
12
  import { isAfter } from 'date-fns';
12
13
 
13
14
  /**
@@ -649,10 +650,11 @@ function firestoreSingleDocumentAccessor(config) {
649
650
  singleItemIdentifier,
650
651
  accessors
651
652
  } = config;
653
+ const defaultAccessor = accessors.documentAccessor();
652
654
  return {
653
655
  singleItemIdentifier,
654
656
  loadDocument() {
655
- return accessors.documentAccessor().loadDocumentForId(singleItemIdentifier);
657
+ return defaultAccessor.loadDocumentForId(singleItemIdentifier);
656
658
  },
657
659
  loadDocumentForTransaction(transaction) {
658
660
  return accessors.documentAccessorForTransaction(transaction).loadDocumentForId(singleItemIdentifier);
@@ -661,7 +663,7 @@ function firestoreSingleDocumentAccessor(config) {
661
663
  return accessors.documentAccessorForWriteBatch(writeBatch).loadDocumentForId(singleItemIdentifier);
662
664
  },
663
665
  documentRef() {
664
- return accessors.documentAccessor().documentRefForId(singleItemIdentifier);
666
+ return defaultAccessor.documentRefForId(singleItemIdentifier);
665
667
  }
666
668
  };
667
669
  }
@@ -4679,6 +4681,199 @@ $$2({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
4679
4681
  }
4680
4682
  });
4681
4683
 
4684
+ var classofRaw$1 = classofRaw$2;
4685
+ var uncurryThis$1 = functionUncurryThis;
4686
+
4687
+ var functionUncurryThisClause = function (fn) {
4688
+ // Nashorn bug:
4689
+ // https://github.com/zloirock/core-js/issues/1128
4690
+ // https://github.com/zloirock/core-js/issues/1130
4691
+ if (classofRaw$1(fn) === 'Function') return uncurryThis$1(fn);
4692
+ };
4693
+
4694
+ var uncurryThis = functionUncurryThisClause;
4695
+ var aCallable$3 = aCallable$9;
4696
+ var NATIVE_BIND = functionBindNative;
4697
+
4698
+ var bind$1 = uncurryThis(uncurryThis.bind);
4699
+
4700
+ // optional / simple context binding
4701
+ var functionBindContext = function (fn, that) {
4702
+ aCallable$3(fn);
4703
+ return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
4704
+ return fn.apply(that, arguments);
4705
+ };
4706
+ };
4707
+
4708
+ var iterators = {};
4709
+
4710
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
4711
+ var Iterators$1 = iterators;
4712
+
4713
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
4714
+ var ArrayPrototype = Array.prototype;
4715
+
4716
+ // check on default Array iterator
4717
+ var isArrayIteratorMethod$1 = function (it) {
4718
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
4719
+ };
4720
+
4721
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
4722
+
4723
+ var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
4724
+ var test = {};
4725
+
4726
+ test[TO_STRING_TAG$1] = 'z';
4727
+
4728
+ var toStringTagSupport = String(test) === '[object z]';
4729
+
4730
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
4731
+ var isCallable = isCallable$e;
4732
+ var classofRaw = classofRaw$2;
4733
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
4734
+
4735
+ var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
4736
+ var $Object = Object;
4737
+
4738
+ // ES3 wrong here
4739
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
4740
+
4741
+ // fallback for IE11 Script Access Denied error
4742
+ var tryGet = function (it, key) {
4743
+ try {
4744
+ return it[key];
4745
+ } catch (error) { /* empty */ }
4746
+ };
4747
+
4748
+ // getting tag from ES6+ `Object.prototype.toString`
4749
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
4750
+ var O, tag, result;
4751
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
4752
+ // @@toStringTag case
4753
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
4754
+ // builtinTag case
4755
+ : CORRECT_ARGUMENTS ? classofRaw(O)
4756
+ // ES3 arguments fallback
4757
+ : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
4758
+ };
4759
+
4760
+ var classof = classof$1;
4761
+ var getMethod = getMethod$4;
4762
+ var isNullOrUndefined = isNullOrUndefined$3;
4763
+ var Iterators = iterators;
4764
+ var wellKnownSymbol = wellKnownSymbol$8;
4765
+
4766
+ var ITERATOR = wellKnownSymbol('iterator');
4767
+
4768
+ var getIteratorMethod$2 = function (it) {
4769
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
4770
+ || getMethod(it, '@@iterator')
4771
+ || Iterators[classof(it)];
4772
+ };
4773
+
4774
+ var call$1 = functionCall;
4775
+ var aCallable$2 = aCallable$9;
4776
+ var anObject$3 = anObject$e;
4777
+ var tryToString$1 = tryToString$3;
4778
+ var getIteratorMethod$1 = getIteratorMethod$2;
4779
+
4780
+ var $TypeError$1 = TypeError;
4781
+
4782
+ var getIterator$1 = function (argument, usingIterator) {
4783
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
4784
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$1(iteratorMethod, argument));
4785
+ throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
4786
+ };
4787
+
4788
+ var bind = functionBindContext;
4789
+ var call = functionCall;
4790
+ var anObject$2 = anObject$e;
4791
+ var tryToString = tryToString$3;
4792
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
4793
+ var lengthOfArrayLike = lengthOfArrayLike$3;
4794
+ var isPrototypeOf = objectIsPrototypeOf;
4795
+ var getIterator = getIterator$1;
4796
+ var getIteratorMethod = getIteratorMethod$2;
4797
+ var iteratorClose = iteratorClose$5;
4798
+
4799
+ var $TypeError = TypeError;
4800
+
4801
+ var Result = function (stopped, result) {
4802
+ this.stopped = stopped;
4803
+ this.result = result;
4804
+ };
4805
+
4806
+ var ResultPrototype = Result.prototype;
4807
+
4808
+ var iterate$2 = function (iterable, unboundFunction, options) {
4809
+ var that = options && options.that;
4810
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
4811
+ var IS_RECORD = !!(options && options.IS_RECORD);
4812
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
4813
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
4814
+ var fn = bind(unboundFunction, that);
4815
+ var iterator, iterFn, index, length, result, next, step;
4816
+
4817
+ var stop = function (condition) {
4818
+ if (iterator) iteratorClose(iterator, 'normal', condition);
4819
+ return new Result(true, condition);
4820
+ };
4821
+
4822
+ var callFn = function (value) {
4823
+ if (AS_ENTRIES) {
4824
+ anObject$2(value);
4825
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
4826
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
4827
+ };
4828
+
4829
+ if (IS_RECORD) {
4830
+ iterator = iterable.iterator;
4831
+ } else if (IS_ITERATOR) {
4832
+ iterator = iterable;
4833
+ } else {
4834
+ iterFn = getIteratorMethod(iterable);
4835
+ if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
4836
+ // optimisation for array iterators
4837
+ if (isArrayIteratorMethod(iterFn)) {
4838
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
4839
+ result = callFn(iterable[index]);
4840
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
4841
+ } return new Result(false);
4842
+ }
4843
+ iterator = getIterator(iterable, iterFn);
4844
+ }
4845
+
4846
+ next = IS_RECORD ? iterable.next : iterator.next;
4847
+ while (!(step = call(next, iterator)).done) {
4848
+ try {
4849
+ result = callFn(step.value);
4850
+ } catch (error) {
4851
+ iteratorClose(iterator, 'throw', error);
4852
+ }
4853
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
4854
+ } return new Result(false);
4855
+ };
4856
+
4857
+ var $$1 = _export;
4858
+ var iterate$1 = iterate$2;
4859
+ var aCallable$1 = aCallable$9;
4860
+ var anObject$1 = anObject$e;
4861
+ var getIteratorDirect$1 = getIteratorDirect$5;
4862
+
4863
+ // `Iterator.prototype.forEach` method
4864
+ // https://github.com/tc39/proposal-iterator-helpers
4865
+ $$1({ target: 'Iterator', proto: true, real: true }, {
4866
+ forEach: function forEach(fn) {
4867
+ anObject$1(this);
4868
+ aCallable$1(fn);
4869
+ var record = getIteratorDirect$1(this);
4870
+ var counter = 0;
4871
+ iterate$1(record, function (value) {
4872
+ fn(value, counter++);
4873
+ }, { IS_RECORD: true });
4874
+ }
4875
+ });
4876
+
4682
4877
  /**
4683
4878
  * Filters out constraints that should not be directly specified in pagination queries.
4684
4879
  *
@@ -4853,6 +5048,9 @@ const FIRESTORE_ITEM_PAGE_ITERATOR = new ItemPageIterator(FIRESTORE_ITEM_PAGE_IT
4853
5048
  */
4854
5049
  function firestoreItemPageIteration(config) {
4855
5050
  const snapshotIteration = FIRESTORE_ITEM_PAGE_ITERATOR.instance(config);
5051
+ return _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration);
5052
+ }
5053
+ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
4856
5054
  const mappedIteration = mappedPageItemIteration(snapshotIteration, {
4857
5055
  forwardDestroy: true,
4858
5056
  mapValue: x => x.docs
@@ -4863,6 +5061,128 @@ function firestoreItemPageIteration(config) {
4863
5061
  };
4864
5062
  return result;
4865
5063
  }
5064
+ /**
5065
+ * Creates a FirestoreFixedItemPageIterationFactoryFunction.
5066
+ */
5067
+ function firestoreFixedItemPageIterationFactory(baseConfig, documentAccessor) {
5068
+ return (items, filter) => {
5069
+ const result = firestoreFixedItemPageIteration({
5070
+ items,
5071
+ documentAccessor,
5072
+ queryLike: baseConfig.queryLike,
5073
+ itemsPerPage: baseConfig.itemsPerPage,
5074
+ firestoreQueryDriver: baseConfig.firestoreQueryDriver,
5075
+ maxPageLoadLimit: filter?.maxPageLoadLimit ?? baseConfig.maxPageLoadLimit,
5076
+ filter
5077
+ });
5078
+ return result;
5079
+ };
5080
+ }
5081
+ /**
5082
+ * Creates a FirestoreItemPageIterationInstance that iterates over the fixed
5083
+ */
5084
+ function firestoreFixedItemPageIteration(config) {
5085
+ const {
5086
+ items,
5087
+ documentAccessor
5088
+ } = config;
5089
+ const idLookupMap = new Map();
5090
+ // used to cache the index for ids that are looked up
5091
+ const indexForId = id => {
5092
+ let index = idLookupMap.get(id);
5093
+ if (index === undefined) {
5094
+ index = items.findIndex(x => x.id === id);
5095
+ idLookupMap.set(id, index);
5096
+ }
5097
+ return index;
5098
+ };
5099
+ const delegate = {
5100
+ loadItemsForPage: request => {
5101
+ const {
5102
+ page,
5103
+ iteratorConfig
5104
+ } = request;
5105
+ const prevQueryResult$ = page > 0 ? request.lastItem$ : of(undefined);
5106
+ const {
5107
+ itemsPerPage = DEFAULT_FIRESTORE_ITEM_PAGE_ITERATOR_ITEMS_PER_PAGE,
5108
+ filter
5109
+ } = iteratorConfig;
5110
+ const {
5111
+ limit: filterLimit
5112
+ } = filter ?? {};
5113
+ return prevQueryResult$.pipe(exhaustMap(prevResult => {
5114
+ if (prevResult?.snapshot.empty === true) {
5115
+ // TODO(REMOVE): Shouldn't happen. Remove this later.
5116
+ return of({
5117
+ end: true
5118
+ });
5119
+ } else {
5120
+ const cursorDocument = prevResult ? lastValue(prevResult.docs) : undefined;
5121
+ const startAtIndex = cursorDocument ? indexForId(cursorDocument.id) + 1 : 0;
5122
+ const limitCount = filterLimit ?? itemsPerPage;
5123
+ const time = new Date();
5124
+ const itemsForThisPage = items.slice(startAtIndex, startAtIndex + limitCount);
5125
+ const lastItemForThisPage = lastValue(itemsForThisPage);
5126
+ let end = false;
5127
+ if (lastItemForThisPage) {
5128
+ const lastItemForThisPageItemIndex = startAtIndex + (itemsForThisPage.length - 1);
5129
+ idLookupMap.set(lastItemForThisPage.id, lastItemForThisPageItemIndex);
5130
+ end = lastItemForThisPageItemIndex === items.length - 1;
5131
+ } else {
5132
+ end = true;
5133
+ }
5134
+ const documents = loadDocumentsForDocumentReferences(documentAccessor, itemsForThisPage);
5135
+ const _loadFakeQuerySnapshot = () => {
5136
+ return getDocumentSnapshots(documents).then(documentSnapshots => {
5137
+ const documentSnapshotsWithData = documentSnapshots.filter(x => x.data() != null);
5138
+ const docs = documentSnapshotsWithData;
5139
+ const query = {
5140
+ withConverter: () => {
5141
+ throw new Error('firestoreFixedItemPageIteration(): Not a real query');
5142
+ }
5143
+ }; // TODO: No great way to implement this. Not a great way to
5144
+ const snapshot = {
5145
+ query,
5146
+ docs,
5147
+ size: docs.length,
5148
+ empty: docs.length === 0,
5149
+ docChanges: () => {
5150
+ return []; // no changes to return in this fake snapshot
5151
+ },
5152
+ forEach: result => {
5153
+ docs.forEach(result);
5154
+ }
5155
+ };
5156
+ return snapshot;
5157
+ });
5158
+ };
5159
+ const resultPromise = _loadFakeQuerySnapshot().then(snapshot => {
5160
+ const result = {
5161
+ value: {
5162
+ time,
5163
+ docs: snapshot.docs,
5164
+ snapshot,
5165
+ reload() {
5166
+ return _loadFakeQuerySnapshot();
5167
+ },
5168
+ stream(options) {
5169
+ // TODO: Count potentially stream to fully implement, but might not be used anyways.
5170
+ return of(snapshot);
5171
+ }
5172
+ },
5173
+ end
5174
+ };
5175
+ return result;
5176
+ });
5177
+ return resultPromise;
5178
+ }
5179
+ }));
5180
+ }
5181
+ };
5182
+ const factory = new ItemPageIterator(delegate);
5183
+ const snapshotIteration = factory.instance(config);
5184
+ return _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration);
5185
+ }
4866
5186
  // MARK: Compat
4867
5187
  /**
4868
5188
  * @deprecated Use filterDisallowedFirestoreItemPageIteratorInputConstraints instead. Mispelling.
@@ -6026,13 +6346,14 @@ function makeFirestoreCollection(inputConfig) {
6026
6346
  firestoreAccessorDriver
6027
6347
  } = config;
6028
6348
  config.queryLike = collection;
6029
- const firestoreIteration = firestoreItemPageIterationFactory(config);
6030
6349
  const documentAccessor = firestoreDocumentAccessorFactory(config);
6031
- const queryFactory = firestoreQueryFactory(config);
6032
6350
  const documentAccessorExtension = firestoreDocumentAccessorContextExtension({
6033
6351
  documentAccessor,
6034
6352
  firestoreAccessorDriver
6035
6353
  });
6354
+ const firestoreIteration = firestoreItemPageIterationFactory(config);
6355
+ const firestoreFixedIteration = firestoreFixedItemPageIterationFactory(config, documentAccessorExtension.documentAccessor());
6356
+ const queryFactory = firestoreQueryFactory(config);
6036
6357
  const {
6037
6358
  queryDocument
6038
6359
  } = firestoreCollectionQueryFactory(queryFactory, documentAccessorExtension);
@@ -6047,6 +6368,7 @@ function makeFirestoreCollection(inputConfig) {
6047
6368
  firestoreContext,
6048
6369
  ...documentAccessorExtension,
6049
6370
  firestoreIteration,
6371
+ firestoreFixedIteration,
6050
6372
  query,
6051
6373
  queryDocument
6052
6374
  };
@@ -6098,17 +6420,18 @@ function makeFirestoreCollectionGroup(config) {
6098
6420
  firestoreContext,
6099
6421
  firestoreAccessorDriver
6100
6422
  } = config;
6101
- // Create the iteration factory for pagination support
6102
- const firestoreIteration = firestoreItemPageIterationFactory(config);
6103
6423
  // Create the document accessor for loading documents
6104
6424
  const documentAccessor = limitedFirestoreDocumentAccessorFactory(config);
6105
- // Create the query factory for building Firestore queries
6106
- const queryFactory = firestoreQueryFactory(config);
6107
6425
  // Create the document accessor extension with context
6108
6426
  const documentAccessorExtension = firestoreDocumentAccessorContextExtension({
6109
6427
  documentAccessor,
6110
6428
  firestoreAccessorDriver
6111
6429
  });
6430
+ // Create the iteration factory for pagination support
6431
+ const firestoreIteration = firestoreItemPageIterationFactory(config);
6432
+ const firestoreFixedIteration = firestoreFixedItemPageIterationFactory(config, documentAccessorExtension.documentAccessor());
6433
+ // Create the query factory for building Firestore queries
6434
+ const queryFactory = firestoreQueryFactory(config);
6112
6435
  // Create the document-aware query factory
6113
6436
  const {
6114
6437
  queryDocument
@@ -6124,6 +6447,7 @@ function makeFirestoreCollectionGroup(config) {
6124
6447
  firestoreContext,
6125
6448
  ...documentAccessorExtension,
6126
6449
  firestoreIteration,
6450
+ firestoreFixedIteration,
6127
6451
  query,
6128
6452
  queryDocument
6129
6453
  };
@@ -6250,199 +6574,6 @@ function firestoreContextFactory(drivers) {
6250
6574
  };
6251
6575
  }
6252
6576
 
6253
- var classofRaw$1 = classofRaw$2;
6254
- var uncurryThis$1 = functionUncurryThis;
6255
-
6256
- var functionUncurryThisClause = function (fn) {
6257
- // Nashorn bug:
6258
- // https://github.com/zloirock/core-js/issues/1128
6259
- // https://github.com/zloirock/core-js/issues/1130
6260
- if (classofRaw$1(fn) === 'Function') return uncurryThis$1(fn);
6261
- };
6262
-
6263
- var uncurryThis = functionUncurryThisClause;
6264
- var aCallable$3 = aCallable$9;
6265
- var NATIVE_BIND = functionBindNative;
6266
-
6267
- var bind$1 = uncurryThis(uncurryThis.bind);
6268
-
6269
- // optional / simple context binding
6270
- var functionBindContext = function (fn, that) {
6271
- aCallable$3(fn);
6272
- return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
6273
- return fn.apply(that, arguments);
6274
- };
6275
- };
6276
-
6277
- var iterators = {};
6278
-
6279
- var wellKnownSymbol$3 = wellKnownSymbol$8;
6280
- var Iterators$1 = iterators;
6281
-
6282
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
6283
- var ArrayPrototype = Array.prototype;
6284
-
6285
- // check on default Array iterator
6286
- var isArrayIteratorMethod$1 = function (it) {
6287
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
6288
- };
6289
-
6290
- var wellKnownSymbol$2 = wellKnownSymbol$8;
6291
-
6292
- var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
6293
- var test = {};
6294
-
6295
- test[TO_STRING_TAG$1] = 'z';
6296
-
6297
- var toStringTagSupport = String(test) === '[object z]';
6298
-
6299
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
6300
- var isCallable = isCallable$e;
6301
- var classofRaw = classofRaw$2;
6302
- var wellKnownSymbol$1 = wellKnownSymbol$8;
6303
-
6304
- var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
6305
- var $Object = Object;
6306
-
6307
- // ES3 wrong here
6308
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
6309
-
6310
- // fallback for IE11 Script Access Denied error
6311
- var tryGet = function (it, key) {
6312
- try {
6313
- return it[key];
6314
- } catch (error) { /* empty */ }
6315
- };
6316
-
6317
- // getting tag from ES6+ `Object.prototype.toString`
6318
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
6319
- var O, tag, result;
6320
- return it === undefined ? 'Undefined' : it === null ? 'Null'
6321
- // @@toStringTag case
6322
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
6323
- // builtinTag case
6324
- : CORRECT_ARGUMENTS ? classofRaw(O)
6325
- // ES3 arguments fallback
6326
- : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
6327
- };
6328
-
6329
- var classof = classof$1;
6330
- var getMethod = getMethod$4;
6331
- var isNullOrUndefined = isNullOrUndefined$3;
6332
- var Iterators = iterators;
6333
- var wellKnownSymbol = wellKnownSymbol$8;
6334
-
6335
- var ITERATOR = wellKnownSymbol('iterator');
6336
-
6337
- var getIteratorMethod$2 = function (it) {
6338
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
6339
- || getMethod(it, '@@iterator')
6340
- || Iterators[classof(it)];
6341
- };
6342
-
6343
- var call$1 = functionCall;
6344
- var aCallable$2 = aCallable$9;
6345
- var anObject$3 = anObject$e;
6346
- var tryToString$1 = tryToString$3;
6347
- var getIteratorMethod$1 = getIteratorMethod$2;
6348
-
6349
- var $TypeError$1 = TypeError;
6350
-
6351
- var getIterator$1 = function (argument, usingIterator) {
6352
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
6353
- if (aCallable$2(iteratorMethod)) return anObject$3(call$1(iteratorMethod, argument));
6354
- throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
6355
- };
6356
-
6357
- var bind = functionBindContext;
6358
- var call = functionCall;
6359
- var anObject$2 = anObject$e;
6360
- var tryToString = tryToString$3;
6361
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
6362
- var lengthOfArrayLike = lengthOfArrayLike$3;
6363
- var isPrototypeOf = objectIsPrototypeOf;
6364
- var getIterator = getIterator$1;
6365
- var getIteratorMethod = getIteratorMethod$2;
6366
- var iteratorClose = iteratorClose$5;
6367
-
6368
- var $TypeError = TypeError;
6369
-
6370
- var Result = function (stopped, result) {
6371
- this.stopped = stopped;
6372
- this.result = result;
6373
- };
6374
-
6375
- var ResultPrototype = Result.prototype;
6376
-
6377
- var iterate$2 = function (iterable, unboundFunction, options) {
6378
- var that = options && options.that;
6379
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
6380
- var IS_RECORD = !!(options && options.IS_RECORD);
6381
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
6382
- var INTERRUPTED = !!(options && options.INTERRUPTED);
6383
- var fn = bind(unboundFunction, that);
6384
- var iterator, iterFn, index, length, result, next, step;
6385
-
6386
- var stop = function (condition) {
6387
- if (iterator) iteratorClose(iterator, 'normal', condition);
6388
- return new Result(true, condition);
6389
- };
6390
-
6391
- var callFn = function (value) {
6392
- if (AS_ENTRIES) {
6393
- anObject$2(value);
6394
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
6395
- } return INTERRUPTED ? fn(value, stop) : fn(value);
6396
- };
6397
-
6398
- if (IS_RECORD) {
6399
- iterator = iterable.iterator;
6400
- } else if (IS_ITERATOR) {
6401
- iterator = iterable;
6402
- } else {
6403
- iterFn = getIteratorMethod(iterable);
6404
- if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
6405
- // optimisation for array iterators
6406
- if (isArrayIteratorMethod(iterFn)) {
6407
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
6408
- result = callFn(iterable[index]);
6409
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
6410
- } return new Result(false);
6411
- }
6412
- iterator = getIterator(iterable, iterFn);
6413
- }
6414
-
6415
- next = IS_RECORD ? iterable.next : iterator.next;
6416
- while (!(step = call(next, iterator)).done) {
6417
- try {
6418
- result = callFn(step.value);
6419
- } catch (error) {
6420
- iteratorClose(iterator, 'throw', error);
6421
- }
6422
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
6423
- } return new Result(false);
6424
- };
6425
-
6426
- var $$1 = _export;
6427
- var iterate$1 = iterate$2;
6428
- var aCallable$1 = aCallable$9;
6429
- var anObject$1 = anObject$e;
6430
- var getIteratorDirect$1 = getIteratorDirect$5;
6431
-
6432
- // `Iterator.prototype.forEach` method
6433
- // https://github.com/tc39/proposal-iterator-helpers
6434
- $$1({ target: 'Iterator', proto: true, real: true }, {
6435
- forEach: function forEach(fn) {
6436
- anObject$1(this);
6437
- aCallable$1(fn);
6438
- var record = getIteratorDirect$1(this);
6439
- var counter = 0;
6440
- iterate$1(record, function (value) {
6441
- fn(value, counter++);
6442
- }, { IS_RECORD: true });
6443
- }
6444
- });
6445
-
6446
6577
  function makeFirestoreQueryConstraintFunctionsDriver(config) {
6447
6578
  const {
6448
6579
  mapping,
@@ -7122,6 +7253,18 @@ const FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY = 'developmentFunctions';
7122
7253
  */
7123
7254
  class FirebaseDevelopmentFunctions {}
7124
7255
 
7256
+ /**
7257
+ * Creates a new StoragePath object with the same bucketId and pathString as the input.
7258
+ *
7259
+ * @param path The StoragePath to copy.
7260
+ * @returns A new StoragePath object.
7261
+ */
7262
+ function copyStoragePath(path) {
7263
+ return {
7264
+ bucketId: path.bucketId,
7265
+ pathString: path.pathString
7266
+ };
7267
+ }
7125
7268
  /**
7126
7269
  * Creates a StoragePathFactory.
7127
7270
  *
@@ -7807,6 +7950,237 @@ function modelStorageSlashPathFactory(config) {
7807
7950
  };
7808
7951
  }
7809
7952
 
7953
+ /**
7954
+ * Creates a new IterateStorageListFilesFactory.
7955
+ *
7956
+ * @param config
7957
+ * @returns
7958
+ */
7959
+ function iterateStorageListFilesFactory(config) {
7960
+ const {
7961
+ maxResults: factoryDefaultMaxResults
7962
+ } = config;
7963
+ return fetchPageFactory({
7964
+ fetch: async input => {
7965
+ const list = await input.folder.list({
7966
+ includeNestedResults: input.includeNestedResults,
7967
+ maxResults: input.maxResults ?? factoryDefaultMaxResults,
7968
+ pageToken: input.pageToken ?? undefined
7969
+ });
7970
+ return list;
7971
+ },
7972
+ readFetchPageResultInfo: result => {
7973
+ const cursor = result.nextPageToken();
7974
+ const info = {
7975
+ hasNext: result.hasNext,
7976
+ cursor: result.options?.pageToken,
7977
+ nextPageCursor: cursor
7978
+ };
7979
+ return info;
7980
+ },
7981
+ buildInputForNextPage: function (pageResult, input, options) {
7982
+ return {
7983
+ ...input,
7984
+ pageToken: pageResult.nextPageCursor ?? undefined
7985
+ };
7986
+ }
7987
+ });
7988
+ }
7989
+ /**
7990
+ * Convenience function for calling iterateFetchPagesByEachItem() for a storage folder.
7991
+ */
7992
+ function iterateStorageListFilesByEachFile(input) {
7993
+ const {
7994
+ folder,
7995
+ includeNestedResults,
7996
+ pageToken
7997
+ } = input;
7998
+ return iterateFetchPagesByEachItem({
7999
+ ...input,
8000
+ input: {
8001
+ folder,
8002
+ includeNestedResults,
8003
+ pageToken
8004
+ },
8005
+ fetchPageFactory: iterateStorageListFilesFactory({})
8006
+ });
8007
+ }
8008
+ /**
8009
+ * Convenience function for calling iterateFetchPages() for a storage folder.
8010
+ */
8011
+ function iterateStorageListFiles(input) {
8012
+ const {
8013
+ folder,
8014
+ includeNestedResults,
8015
+ pageToken
8016
+ } = input;
8017
+ return iterateFetchPages({
8018
+ ...input,
8019
+ input: {
8020
+ folder,
8021
+ includeNestedResults,
8022
+ pageToken
8023
+ },
8024
+ fetchPageFactory: iterateStorageListFilesFactory({})
8025
+ });
8026
+ }
8027
+
8028
+ var makeError = {exports: {}};
8029
+
8030
+ (function (module, exports) {
8031
+
8032
+ // ===================================================================
8033
+
8034
+ var construct = typeof Reflect !== "undefined" ? Reflect.construct : undefined;
8035
+ var defineProperty = Object.defineProperty;
8036
+
8037
+ // -------------------------------------------------------------------
8038
+
8039
+ var captureStackTrace = Error.captureStackTrace;
8040
+ if (captureStackTrace === undefined) {
8041
+ captureStackTrace = function captureStackTrace(error) {
8042
+ var container = new Error();
8043
+
8044
+ defineProperty(error, "stack", {
8045
+ configurable: true,
8046
+ get: function getStack() {
8047
+ var stack = container.stack;
8048
+
8049
+ // Replace property with value for faster future accesses.
8050
+ defineProperty(this, "stack", {
8051
+ configurable: true,
8052
+ value: stack,
8053
+ writable: true,
8054
+ });
8055
+
8056
+ return stack;
8057
+ },
8058
+ set: function setStack(stack) {
8059
+ defineProperty(error, "stack", {
8060
+ configurable: true,
8061
+ value: stack,
8062
+ writable: true,
8063
+ });
8064
+ },
8065
+ });
8066
+ };
8067
+ }
8068
+
8069
+ // -------------------------------------------------------------------
8070
+
8071
+ function BaseError(message) {
8072
+ if (message !== undefined) {
8073
+ defineProperty(this, "message", {
8074
+ configurable: true,
8075
+ value: message,
8076
+ writable: true,
8077
+ });
8078
+ }
8079
+
8080
+ var cname = this.constructor.name;
8081
+ if (cname !== undefined && cname !== this.name) {
8082
+ defineProperty(this, "name", {
8083
+ configurable: true,
8084
+ value: cname,
8085
+ writable: true,
8086
+ });
8087
+ }
8088
+
8089
+ captureStackTrace(this, this.constructor);
8090
+ }
8091
+
8092
+ BaseError.prototype = Object.create(Error.prototype, {
8093
+ // See: https://github.com/JsCommunity/make-error/issues/4
8094
+ constructor: {
8095
+ configurable: true,
8096
+ value: BaseError,
8097
+ writable: true,
8098
+ },
8099
+ });
8100
+
8101
+ // -------------------------------------------------------------------
8102
+
8103
+ // Sets the name of a function if possible (depends of the JS engine).
8104
+ var setFunctionName = (function() {
8105
+ function setFunctionName(fn, name) {
8106
+ return defineProperty(fn, "name", {
8107
+ configurable: true,
8108
+ value: name,
8109
+ });
8110
+ }
8111
+ try {
8112
+ var f = function() {};
8113
+ setFunctionName(f, "foo");
8114
+ if (f.name === "foo") {
8115
+ return setFunctionName;
8116
+ }
8117
+ } catch (_) {}
8118
+ })();
8119
+
8120
+ // -------------------------------------------------------------------
8121
+
8122
+ function makeError(constructor, super_) {
8123
+ if (super_ == null || super_ === Error) {
8124
+ super_ = BaseError;
8125
+ } else if (typeof super_ !== "function") {
8126
+ throw new TypeError("super_ should be a function");
8127
+ }
8128
+
8129
+ var name;
8130
+ if (typeof constructor === "string") {
8131
+ name = constructor;
8132
+ constructor =
8133
+ construct !== undefined
8134
+ ? function() {
8135
+ return construct(super_, arguments, this.constructor);
8136
+ }
8137
+ : function() {
8138
+ super_.apply(this, arguments);
8139
+ };
8140
+
8141
+ // If the name can be set, do it once and for all.
8142
+ if (setFunctionName !== undefined) {
8143
+ setFunctionName(constructor, name);
8144
+ name = undefined;
8145
+ }
8146
+ } else if (typeof constructor !== "function") {
8147
+ throw new TypeError("constructor should be either a string or a function");
8148
+ }
8149
+
8150
+ // Also register the super constructor also as `constructor.super_` just
8151
+ // like Node's `util.inherits()`.
8152
+ //
8153
+ // eslint-disable-next-line dot-notation
8154
+ constructor.super_ = constructor["super"] = super_;
8155
+
8156
+ var properties = {
8157
+ constructor: {
8158
+ configurable: true,
8159
+ value: constructor,
8160
+ writable: true,
8161
+ },
8162
+ };
8163
+
8164
+ // If the name could not be set on the constructor, set it on the
8165
+ // prototype.
8166
+ if (name !== undefined) {
8167
+ properties.name = {
8168
+ configurable: true,
8169
+ value: name,
8170
+ writable: true,
8171
+ };
8172
+ }
8173
+ constructor.prototype = Object.create(super_.prototype, properties);
8174
+
8175
+ return constructor;
8176
+ }
8177
+ exports = module.exports = makeError;
8178
+ exports.BaseError = BaseError;
8179
+ } (makeError, makeError.exports));
8180
+
8181
+ var makeErrorExports = makeError.exports;
8182
+
8183
+ // MARK: Upload Options
7810
8184
  function assertStorageUploadOptionsStringFormat(options) {
7811
8185
  const stringFormat = options?.stringFormat;
7812
8186
  if (!stringFormat) {
@@ -7817,6 +8191,36 @@ function assertStorageUploadOptionsStringFormat(options) {
7817
8191
  function noStringFormatInStorageUploadOptionsError() {
7818
8192
  return new Error('stringFormat was missing a value in the StorageUploadOptions.');
7819
8193
  }
8194
+ // MARK: Stream Error
8195
+ class StorageFileUploadStreamUnsupportedError extends makeErrorExports.BaseError {
8196
+ constructor() {
8197
+ super('Failed to upload file using a stream. The file does not support upload streams.');
8198
+ }
8199
+ }
8200
+
8201
+ /**
8202
+ * Uploads a file using a Readable, using the uploadStream() method on the FirebaseStorageAccessorFile.
8203
+ *
8204
+ * If uploadStream is not supported, a StorageFileUploadStreamUnsupportedError will be thrown.
8205
+ *
8206
+ * @param file The file to upload to.
8207
+ * @param readableStream The stream to upload.
8208
+ * @param options The upload options.
8209
+ * @returns A promise that resolves when the upload is complete.
8210
+ */
8211
+ async function uploadFileWithStream(file, readableStream, options) {
8212
+ if (!file.uploadStream) {
8213
+ throw new StorageFileUploadStreamUnsupportedError();
8214
+ }
8215
+ const uploadStream = file.uploadStream(options);
8216
+ readableStream.pipe(uploadStream, {
8217
+ end: true
8218
+ });
8219
+ return new Promise((resolve, reject) => {
8220
+ uploadStream.on('finish', resolve);
8221
+ uploadStream.on('error', reject);
8222
+ });
8223
+ }
7820
8224
 
7821
8225
  function storageListFilesResultFactory(delegate) {
7822
8226
  return (storage, folder, options, result) => {
@@ -7833,10 +8237,11 @@ function storageListFilesResultFactory(delegate) {
7833
8237
  if (!hasNext) {
7834
8238
  throw storageListFilesResultHasNoNextError();
7835
8239
  }
7836
- return delegate.next(storage, folder, result);
8240
+ return delegate.next(storage, options, folder, result);
7837
8241
  });
7838
8242
  const files = cachedGetter(() => delegate.filesFromResult(result, folder).map(fileResult));
7839
8243
  const folders = cachedGetter(() => delegate.foldersFromResult(result, folder).map(folderResult));
8244
+ const nextPageToken = cachedGetter(() => delegate.nextPageTokenFromResult(result));
7840
8245
  const filesResult = {
7841
8246
  raw: result,
7842
8247
  options,
@@ -7844,7 +8249,8 @@ function storageListFilesResultFactory(delegate) {
7844
8249
  hasItems: () => delegate.hasItems(result),
7845
8250
  next,
7846
8251
  files,
7847
- folders
8252
+ folders,
8253
+ nextPageToken
7848
8254
  };
7849
8255
  return filesResult;
7850
8256
  };
@@ -7865,7 +8271,7 @@ function firebaseStorageContextFactory(drivers) {
7865
8271
  defaultBucketId: inputDefaultBucketId,
7866
8272
  forceBucket = false
7867
8273
  } = config ?? {};
7868
- const defaultBucketId = inputDefaultBucketId || drivers.storageAccessorDriver.defaultBucket?.(firebaseStorage) || '';
8274
+ const defaultBucketId = inputDefaultBucketId || drivers.storageAccessorDriver.getDefaultBucket?.(firebaseStorage) || '';
7869
8275
  if (!defaultBucketId) {
7870
8276
  throw new Error('Could not resolve a default bucket id for the firebaseStorageContextFactory(). Supply a defaultBucketId.');
7871
8277
  }
@@ -7895,33 +8301,47 @@ function firebaseStorageFileExists(ref) {
7895
8301
  }
7896
8302
  function firebaseStorageClientAccessorFile(storage, storagePath) {
7897
8303
  const ref = firebaseStorageRefForStorageFilePath(storage, storagePath);
7898
- function asUploadMetadata(options) {
7899
- let result;
8304
+ function _configureMetadata(options) {
8305
+ return filterUndefinedValues({
8306
+ cacheControl: options.metadata?.cacheControl,
8307
+ contentDisposition: options.metadata?.contentDisposition,
8308
+ contentEncoding: options.metadata?.contentEncoding,
8309
+ contentLanguage: options.metadata?.contentLanguage,
8310
+ contentType: options.metadata?.contentType,
8311
+ customMetadata: filterUndefinedValues({
8312
+ ...options.metadata?.customMetadata,
8313
+ ...options?.customMetadata
8314
+ })
8315
+ });
8316
+ }
8317
+ function uploadMetadataFromStorageUploadOptions(options) {
8318
+ let result;
7900
8319
  if (options != null) {
7901
- const {
7902
- contentType,
7903
- metadata
7904
- } = options;
7905
- if (options.contentType || options.metadata) {
7906
- result = {
7907
- ...(contentType ? {
7908
- contentType
7909
- } : undefined),
7910
- ...metadata
7911
- };
7912
- }
8320
+ result = _configureMetadata({
8321
+ metadata: {
8322
+ ...options.metadata,
8323
+ contentType: options.contentType ?? options.metadata?.contentType
8324
+ },
8325
+ customMetadata: options.customMetadata
8326
+ });
7913
8327
  }
7914
8328
  return result;
7915
8329
  }
7916
- return {
8330
+ function asSettableMetadata(metadata) {
8331
+ return _configureMetadata({
8332
+ metadata
8333
+ });
8334
+ }
8335
+ const clientFile = {
7917
8336
  reference: ref,
7918
8337
  storagePath,
7919
8338
  exists: () => firebaseStorageFileExists(ref),
7920
8339
  getDownloadUrl: () => getDownloadURL(ref),
7921
8340
  getMetadata: () => getMetadata(ref),
8341
+ setMetadata: metadata => updateMetadata(ref, asSettableMetadata(metadata)),
7922
8342
  upload: (input, options) => {
7923
8343
  const inputType = typeof input === 'string';
7924
- const metadataOption = asUploadMetadata(options);
8344
+ const metadataOption = uploadMetadataFromStorageUploadOptions(options);
7925
8345
  if (inputType) {
7926
8346
  const stringFormat = assertStorageUploadOptionsStringFormat(options);
7927
8347
  return uploadString(ref, input, stringFormat, metadataOption);
@@ -7932,8 +8352,35 @@ function firebaseStorageClientAccessorFile(storage, storagePath) {
7932
8352
  getBytes: maxDownloadSizeBytes => getBytes(ref, maxDownloadSizeBytes),
7933
8353
  getBlob: maxDownloadSizeBytes => getBlob(ref, maxDownloadSizeBytes),
7934
8354
  uploadResumable: (input, options) => {
7935
- const metadataOption = asUploadMetadata(options);
7936
- return uploadBytesResumable(ref, input, metadataOption);
8355
+ const metadataOption = uploadMetadataFromStorageUploadOptions(options);
8356
+ const uploadBytesTask = uploadBytesResumable(ref, input, metadataOption);
8357
+ function wrapSnapshot(currentSnapshot) {
8358
+ const snapshot = {
8359
+ bytesTransferred: currentSnapshot.bytesTransferred,
8360
+ totalBytes: currentSnapshot.totalBytes,
8361
+ metadata: currentSnapshot.metadata,
8362
+ state: currentSnapshot.state,
8363
+ uploadTask
8364
+ };
8365
+ return snapshot;
8366
+ }
8367
+ const uploadTask = {
8368
+ taskRef: uploadBytesTask,
8369
+ cancel: () => uploadBytesTask.cancel(),
8370
+ pause: () => uploadBytesTask.pause(),
8371
+ resume: () => uploadBytesTask.resume(),
8372
+ getSnapshot: () => wrapSnapshot(uploadBytesTask.snapshot),
8373
+ streamSnapshotEvents: cachedGetter(() => {
8374
+ const internalSnapshotObs = new Observable(x => uploadBytesTask.on('state_changed', {
8375
+ next: y => x.next(y),
8376
+ error: e => x.error(e),
8377
+ complete: () => x.complete()
8378
+ }));
8379
+ const snapshotEvents = internalSnapshotObs.pipe(map$1(x => wrapSnapshot(x)), shareReplay(1));
8380
+ return snapshotEvents;
8381
+ })
8382
+ };
8383
+ return uploadTask;
7937
8384
  },
7938
8385
  delete: options => deleteObject(ref).catch(x => {
7939
8386
  if (!options.ignoreNotFound || !isFirebaseStorageObjectNotFoundError(x)) {
@@ -7941,6 +8388,7 @@ function firebaseStorageClientAccessorFile(storage, storagePath) {
7941
8388
  }
7942
8389
  })
7943
8390
  };
8391
+ return clientFile;
7944
8392
  }
7945
8393
  const firebaseStorageClientListFilesResultFactory = storageListFilesResultFactory({
7946
8394
  hasItems: result => {
@@ -7949,8 +8397,12 @@ const firebaseStorageClientListFilesResultFactory = storageListFilesResultFactor
7949
8397
  hasNext: result => {
7950
8398
  return result.listResult.nextPageToken != null;
7951
8399
  },
7952
- next(storage, folder, result) {
8400
+ nextPageTokenFromResult(result) {
8401
+ return result.listResult.nextPageToken;
8402
+ },
8403
+ next(storage, options, folder, result) {
7953
8404
  return folder.list({
8405
+ ...options,
7954
8406
  ...result.options,
7955
8407
  pageToken: result.listResult.nextPageToken
7956
8408
  });
@@ -7988,16 +8440,37 @@ function firebaseStorageClientAccessorFolder(storage, storagePath) {
7988
8440
  exists: () => folder.list({
7989
8441
  maxResults: 1
7990
8442
  }).then(x => x.hasItems()),
7991
- list: options => list(ref, options).then(listResult => firebaseStorageClientListFilesResultFactory(storage, folder, options, {
7992
- options,
7993
- listResult
7994
- }))
8443
+ list: async options => {
8444
+ const rootResults = await list(ref, options).then(listResult => firebaseStorageClientListFilesResultFactory(storage, folder, options, {
8445
+ options,
8446
+ listResult
8447
+ }));
8448
+ let result;
8449
+ if (options?.includeNestedResults) {
8450
+ const allImmediateFiles = rootResults.files();
8451
+ const allImmediateFolders = rootResults.folders();
8452
+ const allNestedFolderFileResults = await Promise.all(allImmediateFolders.map(x => x.folder().list({
8453
+ includeNestedResults: true
8454
+ }).then(x => x.files())));
8455
+ const allNestedFiles = allNestedFolderFileResults.flat();
8456
+ const allFiles = [...allImmediateFiles, ...allNestedFiles];
8457
+ result = {
8458
+ ...rootResults,
8459
+ files: () => allFiles,
8460
+ folders: () => [] // no folders
8461
+ };
8462
+ } else {
8463
+ result = rootResults;
8464
+ }
8465
+ return result;
8466
+ }
7995
8467
  };
7996
8468
  return folder;
7997
8469
  }
7998
8470
  function firebaseStorageClientAccessorDriver() {
7999
8471
  return {
8000
- defaultBucket: storage => storage.app.options.storageBucket ?? '',
8472
+ type: 'client',
8473
+ getDefaultBucket: storage => storage.app.options.storageBucket ?? '',
8001
8474
  file: (storage, path) => firebaseStorageClientAccessorFile(storage, path),
8002
8475
  folder: (storage, path) => firebaseStorageClientAccessorFolder(storage, path)
8003
8476
  };
@@ -9336,13 +9809,22 @@ function createNotificationDocumentPair(input) {
9336
9809
  const isNotificationTask = st === NotificationSendType.TASK_NOTIFICATION;
9337
9810
  if (isNotificationTask && inputUnique) {
9338
9811
  let uniqueId;
9812
+ /**
9813
+ * Defaults to the notification box id if no target model is provided.
9814
+ */
9815
+ const targetModelId = n.m;
9339
9816
  if (typeof inputUnique === 'string') {
9340
9817
  uniqueId = inputUnique;
9341
9818
  if (!isFirestoreModelId(uniqueId)) {
9342
9819
  throw new Error('Input "unique" notification task id is not a valid firestore model id.');
9343
9820
  }
9821
+ } else if (targetModelId) {
9822
+ uniqueId = notificationTaskUniqueId(targetModelId, n.t);
9344
9823
  } else {
9345
- uniqueId = notificationTaskUniqueId(notificationModel, n.t);
9824
+ // Without a target model, the generated id ends up being a type-global unique notification task id, or if
9825
+ // the notification task global default model type is used, being unique across the whole system, which is
9826
+ // generally unintended behavor. When it is desired, the inputUnique can be a string.
9827
+ throw new Error('Must provide a target model when using unique=true for a notification task. The default result otherwise would be an unintended type-global unique notification task id.');
9346
9828
  }
9347
9829
  notificationDocument = accessor.loadDocumentForId(uniqueId);
9348
9830
  } else {
@@ -9443,9 +9925,10 @@ async function createNotificationDocumentIfSending(input) {
9443
9925
  * @returns
9444
9926
  */
9445
9927
  function createNotificationTaskTemplate(input) {
9446
- return createNotificationTemplate({
9928
+ const notificationModel = input.notificationModel ?? DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY;
9929
+ const result = createNotificationTemplate({
9447
9930
  ...input,
9448
- notificationModel: input.notificationModel ?? DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY,
9931
+ notificationModel,
9449
9932
  tpr: input.completedCheckpoints ?? input.tpr,
9450
9933
  sendType: NotificationSendType.TASK_NOTIFICATION,
9451
9934
  st: undefined,
@@ -9453,6 +9936,10 @@ function createNotificationTaskTemplate(input) {
9453
9936
  recipients: undefined,
9454
9937
  r: undefined
9455
9938
  });
9939
+ if (!input.notificationModel && !result.n.m && input.unique === true) {
9940
+ throw new Error('Must provide a target model when using unique=true for a notification task template. The default result otherwise would be an unintended type-global unique notification task id.');
9941
+ }
9942
+ return result;
9456
9943
  }
9457
9944
 
9458
9945
  /**
@@ -9728,6 +10215,22 @@ function notificationTaskFailed(updateMetadata, removeFromCompletedCheckpoints)
9728
10215
  removeFromCompletedCheckpoints
9729
10216
  };
9730
10217
  }
10218
+ /**
10219
+ * Wraps an existing NotificationTaskServiceHandleNotificationTaskResult<D> and sets canRunNextCheckpoint to true if it is undefined.
10220
+ *
10221
+ * @param result The result to use as a template.
10222
+ * @param force If true, then canRunNextCheckpoint will be set to true even if it is already defined.
10223
+ * @returns A new result.
10224
+ */
10225
+ function notificationTaskCanRunNextCheckpoint(result, force) {
10226
+ if (force || result.canRunNextCheckpoint == null) {
10227
+ result = {
10228
+ ...result,
10229
+ canRunNextCheckpoint: true
10230
+ };
10231
+ }
10232
+ return result;
10233
+ }
9731
10234
 
9732
10235
  var $ = _export;
9733
10236
  var iterate = iterate$2;
@@ -9985,6 +10488,727 @@ function loadNotificationBoxDocumentForReferencePair(input, accessor) {
9985
10488
  return notificationBoxDocument;
9986
10489
  }
9987
10490
 
10491
+ /**
10492
+ * Thrown if the target uploaded file does not exist.
10493
+ */
10494
+ const UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE = 'UPLOADED_FILE_DOES_NOT_EXIST';
10495
+ /**
10496
+ * Thrown if the target uploaded file is not allowed to be initialized.
10497
+ */
10498
+ const UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE = 'UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED';
10499
+ /**
10500
+ * Thrown if the target uploaded file initialization failed.
10501
+ */
10502
+ const UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE = 'UPLOADED_FILE_INITIALIZATION_FAILED';
10503
+ /**
10504
+ * Thrown if the target uploaded file initialization was successful, but produced no new StorageFileDocument.
10505
+ */
10506
+ const UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE = 'UPLOADED_FILE_INITIALIZATION_DISCARDED';
10507
+ /**
10508
+ * Thrown if the target StorageFileDocument is not queued for processing and is called to be processed.
10509
+ */
10510
+ const STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE = 'STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING';
10511
+ /**
10512
+ * Thrown if:
10513
+ * - the target StorageFileDocument was marked as queued for processing but isn't actually a processable-type.
10514
+ * - the target StorageFileDocument is marked as init but has no purpose set, meaning it can't be processed.
10515
+ */
10516
+ const STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE = 'STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE';
10517
+ /**
10518
+ * Thrown if the StorageFile is not in an OK state.
10519
+ */
10520
+ const STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE = 'STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE';
10521
+ /**
10522
+ * Thrown if the target StorageFileDocument already finished processing.
10523
+ */
10524
+ const STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE = 'STORAGE_FILE_ALREADY_PROCESSED';
10525
+ /**
10526
+ * Thrown if the target StorageFileDocument is not flagged for deletion but attempts to be deleted.
10527
+ */
10528
+ const STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE = 'STORAGE_FILE_NOT_FLAGGED_FOR_DELETION';
10529
+ /**
10530
+ * Thrown if the target StorageFileDocument is flagged for deletion, but has not reached the time to be deleted yet.
10531
+ */
10532
+ const STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE = 'STORAGE_FILE_CANNOT_BE_DELETED_YET';
10533
+
10534
+ /**
10535
+ * Used for directly create a new StorageFile.
10536
+ */
10537
+ class CreateStorageFileParams {}
10538
+ /**
10539
+ * Initializes all StorageFiles in the uploads folder.
10540
+ */
10541
+ class InitializeAllStorageFilesFromUploadsParams {
10542
+ constructor() {
10543
+ /**
10544
+ * The maximum number of files to initialize at once.
10545
+ */
10546
+ this.maxFilesToInitialize = void 0;
10547
+ /**
10548
+ * The specific folder under the uploads folder to search for files and initialize
10549
+ */
10550
+ this.folderPath = void 0;
10551
+ /**
10552
+ * Overrides the default uploads folder path.
10553
+ */
10554
+ this.overrideUploadsFolderPath = void 0;
10555
+ }
10556
+ }
10557
+ __decorate([Expose(), IsNumber(), IsOptional(), __metadata("design:type", Object)], InitializeAllStorageFilesFromUploadsParams.prototype, "maxFilesToInitialize", void 0);
10558
+ __decorate([Expose(), IsString(), IsOptional(), __metadata("design:type", Object)], InitializeAllStorageFilesFromUploadsParams.prototype, "folderPath", void 0);
10559
+ __decorate([Expose(), IsString(), IsOptional(), __metadata("design:type", Object)], InitializeAllStorageFilesFromUploadsParams.prototype, "overrideUploadsFolderPath", void 0);
10560
+ /**
10561
+ * Initializes a StorageFile from the document at the given path.
10562
+ */
10563
+ class InitializeStorageFileFromUploadParams {
10564
+ constructor() {
10565
+ /**
10566
+ * Specific bucketId to use.
10567
+ *
10568
+ * If not defined, the default bucket will be used.
10569
+ */
10570
+ this.bucketId = void 0;
10571
+ this.pathString = void 0;
10572
+ }
10573
+ }
10574
+ __decorate([Expose(), IsOptional(), IsString(), __metadata("design:type", Object)], InitializeStorageFileFromUploadParams.prototype, "bucketId", void 0);
10575
+ __decorate([Expose(), IsString(), __metadata("design:type", String)], InitializeStorageFileFromUploadParams.prototype, "pathString", void 0);
10576
+ class ProcessStorageFileParams extends TargetModelParams {
10577
+ constructor(...args) {
10578
+ super(...args);
10579
+ /**
10580
+ * If set, will start/run the processing immediately instead of waiting for the next scheduled run.
10581
+ */
10582
+ this.runImmediately = void 0;
10583
+ /**
10584
+ * If set, will check and retry processing if the StorageFile is in a failed processing state.
10585
+ */
10586
+ this.checkRetryProcessing = void 0;
10587
+ /**
10588
+ * Used with retryProcessing.
10589
+ *
10590
+ * If set, will forcibly create a new processing task even if the existing processing task appears to be ok.
10591
+ */
10592
+ this.forceRestartProcessing = void 0;
10593
+ }
10594
+ }
10595
+ __decorate([Expose(), IsBoolean(), IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "runImmediately", void 0);
10596
+ __decorate([Expose(), IsBoolean(), IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "checkRetryProcessing", void 0);
10597
+ __decorate([Expose(), IsBoolean(), IsOptional(), __metadata("design:type", Object)], ProcessStorageFileParams.prototype, "forceRestartProcessing", void 0);
10598
+ /**
10599
+ * Processes all StorageFiles that are queued for processing.
10600
+ */
10601
+ class ProcessAllQueuedStorageFilesParams {}
10602
+ class UpdateStorageFileParams extends TargetModelParams {
10603
+ constructor(...args) {
10604
+ super(...args);
10605
+ /**
10606
+ * Sets the delete at time for the given StorageFileDocument, and queues the file for deletion.
10607
+ */
10608
+ this.sdat = void 0;
10609
+ }
10610
+ }
10611
+ __decorate([Expose(), IsDate(), IsOptional(), Type(() => Date), __metadata("design:type", Object)], UpdateStorageFileParams.prototype, "sdat", void 0);
10612
+ class DeleteStorageFileParams extends TargetModelParams {
10613
+ constructor(...args) {
10614
+ super(...args);
10615
+ /**
10616
+ * If true, will force the deletion of the StorageFile even if it is not queued for deletion.
10617
+ */
10618
+ this.force = void 0;
10619
+ }
10620
+ }
10621
+ __decorate([Expose(), IsBoolean(), IsOptional(), __metadata("design:type", Object)], DeleteStorageFileParams.prototype, "force", void 0);
10622
+ /**
10623
+ * Processes all StorageFiles that are queued for processing.
10624
+ */
10625
+ class DeleteAllQueuedStorageFilesParams {}
10626
+ const storageFileFunctionTypeConfigMap = {};
10627
+ const storageFileModelCrudFunctionsConfig = {
10628
+ storageFile: ['create:_,fromUpload,allFromUpload', 'update:_,process', 'delete:_']
10629
+ };
10630
+ class StorageFileFunctions {}
10631
+ const storageFileFunctionMap = callModelFirebaseFunctionMapFactory(storageFileFunctionTypeConfigMap, storageFileModelCrudFunctionsConfig);
10632
+
10633
+ class StorageFileFirestoreCollections {}
10634
+ // MARK: StorageFile
10635
+ const storageFileIdentity = firestoreModelIdentity('storageFile', 'sf');
10636
+ /**
10637
+ * The current file state.
10638
+ */
10639
+ var StorageFileCreationType;
10640
+ (function (StorageFileCreationType) {
10641
+ /**
10642
+ * No info about how this file was created.
10643
+ */
10644
+ StorageFileCreationType[StorageFileCreationType["NONE"] = 0] = "NONE";
10645
+ /**
10646
+ * The StorageFile was directly created.
10647
+ */
10648
+ StorageFileCreationType[StorageFileCreationType["DIRECTLY_CREATED"] = 1] = "DIRECTLY_CREATED";
10649
+ /**
10650
+ * The StorageFile was initialized from an uploaded file.
10651
+ */
10652
+ StorageFileCreationType[StorageFileCreationType["INIT_FROM_UPLOAD"] = 2] = "INIT_FROM_UPLOAD";
10653
+ })(StorageFileCreationType || (StorageFileCreationType = {}));
10654
+ /**
10655
+ * The current file state.
10656
+ */
10657
+ var StorageFileState;
10658
+ (function (StorageFileState) {
10659
+ /**
10660
+ * The StorageFile has no state, or is just being initialized.
10661
+ */
10662
+ StorageFileState[StorageFileState["INIT"] = 0] = "INIT";
10663
+ /**
10664
+ * The StorageFile failed to initialize properly and is considered invalid.
10665
+ *
10666
+ * StorageFiles that are marked invalid are deleted after a period of time.
10667
+ *
10668
+ * Files that are invalid cannot be processed.
10669
+ */
10670
+ StorageFileState[StorageFileState["INVALID"] = 1] = "INVALID";
10671
+ /**
10672
+ * The StorageFile has been initialized and is ok.
10673
+ */
10674
+ StorageFileState[StorageFileState["OK"] = 2] = "OK";
10675
+ /**
10676
+ * A previously OK file that is now queued for deletion.
10677
+ */
10678
+ StorageFileState[StorageFileState["QUEUED_FOR_DELETE"] = 3] = "QUEUED_FOR_DELETE";
10679
+ })(StorageFileState || (StorageFileState = {}));
10680
+ /**
10681
+ * The current processing state of the file.
10682
+ */
10683
+ var StorageFileProcessingState;
10684
+ (function (StorageFileProcessingState) {
10685
+ /**
10686
+ * The StorageFile has no processing state or is just being initialized.
10687
+ */
10688
+ StorageFileProcessingState[StorageFileProcessingState["INIT_OR_NONE"] = 0] = "INIT_OR_NONE";
10689
+ /**
10690
+ * The StorageFile is flagged for processing, which will create a NotificationTask for it.
10691
+ */
10692
+ StorageFileProcessingState[StorageFileProcessingState["QUEUED_FOR_PROCESSING"] = 1] = "QUEUED_FOR_PROCESSING";
10693
+ /**
10694
+ * The StorageFile has an associated NotificationTask for it.
10695
+ */
10696
+ StorageFileProcessingState[StorageFileProcessingState["PROCESSING"] = 2] = "PROCESSING";
10697
+ /**
10698
+ * The StorageFile has encountered an error during processing.
10699
+ */
10700
+ StorageFileProcessingState[StorageFileProcessingState["FAILED"] = 3] = "FAILED";
10701
+ /**
10702
+ * The StorageFile has been processed or required no processing and is done.
10703
+ */
10704
+ StorageFileProcessingState[StorageFileProcessingState["SUCCESS"] = 4] = "SUCCESS";
10705
+ /**
10706
+ * The StorageFile has been archived. It should not be processed.
10707
+ */
10708
+ StorageFileProcessingState[StorageFileProcessingState["ARCHIVED"] = 5] = "ARCHIVED";
10709
+ /**
10710
+ * The StorageFile shouldn't be processed.
10711
+ */
10712
+ StorageFileProcessingState[StorageFileProcessingState["DO_NOT_PROCESS"] = 6] = "DO_NOT_PROCESS";
10713
+ })(StorageFileProcessingState || (StorageFileProcessingState = {}));
10714
+ /**
10715
+ * After 3 hours of being in the PROCESSING state, we can check for retring processing.
10716
+ */
10717
+ const STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS = MS_IN_HOUR * 3;
10718
+ class StorageFileDocument extends AbstractFirestoreDocument {
10719
+ get modelIdentity() {
10720
+ return storageFileIdentity;
10721
+ }
10722
+ }
10723
+ const storageFileConverter = snapshotConverterFunctions({
10724
+ fields: {
10725
+ bucketId: firestoreString(),
10726
+ pathString: firestoreString(),
10727
+ cat: firestoreDate(),
10728
+ ct: optionalFirestoreEnum({
10729
+ defaultReadValue: StorageFileCreationType.NONE,
10730
+ dontStoreDefaultReadValue: true
10731
+ }),
10732
+ fs: firestoreEnum({
10733
+ default: StorageFileState.INIT
10734
+ }),
10735
+ ps: firestoreEnum({
10736
+ default: StorageFileProcessingState.INIT_OR_NONE
10737
+ }),
10738
+ pn: optionalFirestoreString(),
10739
+ pat: optionalFirestoreDate(),
10740
+ pcat: optionalFirestoreDate(),
10741
+ u: optionalFirestoreString(),
10742
+ uby: optionalFirestoreString(),
10743
+ o: optionalFirestoreString(),
10744
+ p: optionalFirestoreString(),
10745
+ d: firestorePassThroughField(),
10746
+ sdat: optionalFirestoreDate()
10747
+ }
10748
+ });
10749
+ function storageFileCollectionReference(context) {
10750
+ return context.collection(storageFileIdentity.collectionName);
10751
+ }
10752
+ function storageFileFirestoreCollection(firestoreContext) {
10753
+ return firestoreContext.firestoreCollection({
10754
+ modelIdentity: storageFileIdentity,
10755
+ converter: storageFileConverter,
10756
+ collection: storageFileCollectionReference(firestoreContext),
10757
+ makeDocument: (accessor, documentAccessor) => new StorageFileDocument(accessor, documentAccessor),
10758
+ firestoreContext
10759
+ });
10760
+ }
10761
+
10762
+ /**
10763
+ * Creates a CreateStorageFileDocumentPairFactory.
10764
+ *
10765
+ * @param config
10766
+ * @returns
10767
+ */
10768
+ function createStorageFileDocumentPairFactory(config = {}) {
10769
+ const {
10770
+ defaultCreationType: inputDefaultCreationType,
10771
+ defaultShouldBeProcessed: inputDefaultShouldBeProcessed
10772
+ } = config;
10773
+ const defaultCreationType = inputDefaultCreationType ?? StorageFileCreationType.DIRECTLY_CREATED;
10774
+ const defaultShouldBeProcessed = inputDefaultShouldBeProcessed ?? false;
10775
+ return async input => {
10776
+ const {
10777
+ template: inputTemplate,
10778
+ accessor: inputAccessor,
10779
+ transaction,
10780
+ context,
10781
+ now: inputNow,
10782
+ uploadedBy,
10783
+ user,
10784
+ purpose,
10785
+ metadata,
10786
+ shouldBeProcessed
10787
+ } = input;
10788
+ const now = inputNow ?? new Date();
10789
+ let accessor = inputAccessor;
10790
+ if (!accessor && context) {
10791
+ const {
10792
+ storageFileCollection
10793
+ } = context;
10794
+ accessor = storageFileCollection.documentAccessorForTransaction(transaction);
10795
+ }
10796
+ if (!accessor) {
10797
+ throw new Error('createStorageFileDocumentPair() failed as neither an accessor nor a context was provided.');
10798
+ }
10799
+ const storagePath = input.file?.storagePath ?? input.storagePathRef?.storagePath ?? input.storagePath;
10800
+ if (!storagePath) {
10801
+ throw new Error('createStorageFileDocumentPair() failed as neither a file, storagePathRef, or storagePath was provided.');
10802
+ }
10803
+ const storageFileDocument = accessor.newDocument();
10804
+ const template = {
10805
+ ...inputTemplate,
10806
+ cat: now,
10807
+ u: user ?? inputTemplate?.u,
10808
+ uby: uploadedBy ?? inputTemplate?.uby,
10809
+ p: purpose ?? inputTemplate?.p,
10810
+ d: metadata ?? inputTemplate?.d,
10811
+ fs: inputTemplate?.fs ?? StorageFileState.OK,
10812
+ ps: shouldBeProcessed ?? defaultShouldBeProcessed ? StorageFileProcessingState.QUEUED_FOR_PROCESSING : StorageFileProcessingState.DO_NOT_PROCESS,
10813
+ ct: inputTemplate?.ct ?? defaultCreationType,
10814
+ bucketId: storagePath.bucketId,
10815
+ pathString: storagePath.pathString
10816
+ };
10817
+ // create the StorageFileDocument
10818
+ await storageFileDocument.create(template);
10819
+ return {
10820
+ storageFileDocument,
10821
+ storageFile: template
10822
+ };
10823
+ };
10824
+ }
10825
+ /**
10826
+ * Convenience function for creating a StorageFileDocumentPair.
10827
+ *
10828
+ * Calls createStorageFileDocumentPairFactory() with no arguments, then passes the input to the factory and returns the result.
10829
+ */
10830
+ async function createStorageFileDocumentPair(input) {
10831
+ return createStorageFileDocumentPairFactory()(input);
10832
+ }
10833
+
10834
+ // MARK: StorageFile
10835
+ /**
10836
+ * Returns a query constraint for StorageFiles that are queued for processing.
10837
+ */
10838
+ function storageFilesQueuedForProcessingQuery() {
10839
+ return [where('ps', '==', StorageFileProcessingState.QUEUED_FOR_PROCESSING)];
10840
+ }
10841
+ /**
10842
+ * Returns a query constraint for StorageFiles that are queued for deletion and are past their scheduled delete date.
10843
+ */
10844
+ function storageFilesQueuedForDeleteQuery(now) {
10845
+ return [whereDateIsBefore('sdat', now ?? new Date())];
10846
+ }
10847
+ function storageFilePurposeAndUserQuery(input) {
10848
+ return [where('p', '==', input.purpose), where('u', '==', input.user)];
10849
+ }
10850
+
10851
+ // MARK: Storage File Processing Notification
10852
+ const STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE = 'SFP';
10853
+ /**
10854
+ * The maximum number of times to delay the cleanup step of a StorageFileProcessingNotificationTask.
10855
+ */
10856
+ const DEFAULT_MAX_STORAGE_FILE_PROCESSING_CLEANUP_RETRY_ATTEMPTS = 4;
10857
+ /**
10858
+ * The default amount of time to delay the cleanup step of a StorageFileProcessingNotificationTask that failed to cleanup successfully.
10859
+ */
10860
+ const DEFAULT_STORAGE_FILE_PROCESSING_CLEANUP_RETRY_DELAY = MS_IN_HOUR;
10861
+ function storageFileProcessingNotificationTaskTemplate(input) {
10862
+ const {
10863
+ storageFileDocument,
10864
+ overrideExistingTask
10865
+ } = input;
10866
+ return createNotificationTaskTemplate({
10867
+ type: STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE,
10868
+ targetModel: storageFileDocument,
10869
+ data: {
10870
+ storageFile: storageFileDocument.id,
10871
+ d: input.sd
10872
+ },
10873
+ /**
10874
+ * The task is unique to the StorageFile.
10875
+ */
10876
+ unique: true,
10877
+ overrideExistingTask
10878
+ });
10879
+ }
10880
+ // MARK: All Tasks
10881
+ const ALL_STORAGE_FILE_NOTIFICATION_TASK_TYPES = [STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE];
10882
+
10883
+ /**
10884
+ * Creates a StoredFileReaderFactory.
10885
+ *
10886
+ * Should generally only be used on the server-side, as copy may not be available on the client-side.
10887
+ */
10888
+ function storedFileReaderFactory() {
10889
+ return file => {
10890
+ const getPathDetails = cachedGetter(() => slashPathDetails(file.storagePath.pathString));
10891
+ const details = {
10892
+ ...file.storagePath
10893
+ };
10894
+ const loadFileMetadata = cachedGetter(() => file.getMetadata());
10895
+ const loadCustomMetadata = () => {
10896
+ return loadFileMetadata().then(x => x.customMetadata);
10897
+ };
10898
+ const accessor = {
10899
+ input: details,
10900
+ getPathDetails,
10901
+ loadFileBytes: file.getBytes,
10902
+ // do not cache the file data accessors
10903
+ loadFileStream: file.getStream,
10904
+ loadFileMetadata,
10905
+ loadCustomMetadata,
10906
+ copy: file.copy // copy is always available on the server-side
10907
+ };
10908
+ return accessor;
10909
+ };
10910
+ }
10911
+
10912
+ /**
10913
+ * The base path for all uploaded files.
10914
+ *
10915
+ * The uploads folder is a transient folder that is cleared/processed often of files that are uploaded to it.
10916
+ */
10917
+ const UPLOADS_FOLDER_PATH = 'uploads';
10918
+ /**
10919
+ * The folder name that contains the uploads for each user "u".
10920
+ */
10921
+ const ALL_USER_UPLOADS_FOLDER_NAME = `u`;
10922
+ /**
10923
+ * All users uploads folder path.
10924
+ *
10925
+ * For example, user 12345 will upload their files to folder "uploads/u/12345/".
10926
+ */
10927
+ const ALL_USER_UPLOADS_FOLDER_PATH = `${UPLOADS_FOLDER_PATH}/${ALL_USER_UPLOADS_FOLDER_NAME}`;
10928
+ function userUploadsFolderSlashPathFactory(inputBasePath) {
10929
+ const basePath = toAbsoluteSlashPathStartType(inputBasePath ?? ALL_USER_UPLOADS_FOLDER_PATH);
10930
+ return userId => `${basePath}/${userId}`;
10931
+ }
10932
+ function userUploadsFolderStoragePathFactory({
10933
+ bucketId,
10934
+ basePath: inputBasePath
10935
+ }) {
10936
+ const userUploadsFolderSlashPath = userUploadsFolderSlashPathFactory(inputBasePath);
10937
+ return userId => ({
10938
+ pathString: userUploadsFolderSlashPath(userId),
10939
+ bucketId
10940
+ });
10941
+ }
10942
+
10943
+ /**
10944
+ * The role used for uploading files.
10945
+ */
10946
+ const STORAGE_FILE_UPLOAD_USER_ROLE = 'uploads';
10947
+ /**
10948
+ * AuthRoleClaimsFactoryConfigEntrySimpleOptions configuration for adding the "uploads" role to the user when the disable uploads claim is not present.
10949
+ */
10950
+ const storageFileUploadUserSimpleClaimsConfiguration = {
10951
+ roles: STORAGE_FILE_UPLOAD_USER_ROLE,
10952
+ inverse: true
10953
+ };
10954
+
10955
+ /**
10956
+ * Lower determination level.
10957
+ */
10958
+ const LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = 1;
10959
+ /**
10960
+ * Default determination level.
10961
+ */
10962
+ const DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = 2;
10963
+ /**
10964
+ * High determination level.
10965
+ */
10966
+ const HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = 3;
10967
+ /**
10968
+ * Exact match determination level.
10969
+ *
10970
+ * The default highest determination level.
10971
+ */
10972
+ const EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = 10;
10973
+ /**
10974
+ * Creates an UploadedFileTypeDeterminer that determines the upload type based on the file name.
10975
+ *
10976
+ * @param config The configuration for the determiner.
10977
+ * @returns The determiner.
10978
+ */
10979
+ function determineByFileName(config) {
10980
+ const {
10981
+ fileType,
10982
+ match,
10983
+ exactMatchDeterminationLevel: inputExactMatchDeterminationLevel,
10984
+ nameMatchDeterminationLevel: inputNameMatchDeterminationLevel
10985
+ } = config;
10986
+ const mustMatchExactly = match.includes(SLASH_PATH_FILE_TYPE_SEPARATOR);
10987
+ const exactMatchDeterminationLevel = inputExactMatchDeterminationLevel ?? EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
10988
+ const nameMatchDeterminationLevel = inputNameMatchDeterminationLevel ?? HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
10989
+ const testFileName = mustMatchExactly ? fileName => fileName === match ? exactMatchDeterminationLevel : undefined // exact match
10990
+ : fileName => fileName.startsWith(match) ? nameMatchDeterminationLevel : undefined; // name match
10991
+ return {
10992
+ determine: input => {
10993
+ let result;
10994
+ const pathDetails = input.getPathDetails();
10995
+ if (pathDetails.file) {
10996
+ const matchLevel = testFileName(pathDetails.file);
10997
+ if (matchLevel != null) {
10998
+ result = {
10999
+ input,
11000
+ type: fileType,
11001
+ level: matchLevel
11002
+ };
11003
+ }
11004
+ }
11005
+ return result;
11006
+ },
11007
+ getPossibleFileTypes: () => [fileType]
11008
+ };
11009
+ }
11010
+ /**
11011
+ * Creates an UploadedFileTypeDeterminer that determines the upload type based on the folder name.
11012
+ *
11013
+ * @param config The configuration for the determiner.
11014
+ * @returns The determiner.
11015
+ */
11016
+ function determineByFolderName(config) {
11017
+ const {
11018
+ fileType,
11019
+ match
11020
+ } = config;
11021
+ return {
11022
+ determine: input => {
11023
+ const pathDetails = input.getPathDetails();
11024
+ const folderPath = pathDetails.folderPath;
11025
+ let result;
11026
+ if (folderPath === match) {
11027
+ result = {
11028
+ input,
11029
+ type: fileType,
11030
+ level: EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL
11031
+ };
11032
+ }
11033
+ return result;
11034
+ },
11035
+ getPossibleFileTypes: () => [fileType]
11036
+ };
11037
+ }
11038
+ /**
11039
+ * Creates an UploadedFileTypeDeterminer that determines the upload type based on the file name.
11040
+ *
11041
+ * @param config The configuration for the determiner.
11042
+ * @returns The determiner.
11043
+ */
11044
+ function determineByFilePath(config) {
11045
+ const {
11046
+ fileType,
11047
+ match,
11048
+ matchDeterminationLevel: inputMatchDeterminationLevel,
11049
+ matchBucket: inputMatchBucket,
11050
+ matchFileDetails: inputMatchFile
11051
+ } = config;
11052
+ const pathMatcher = slashPathPathMatcher(match);
11053
+ const matchBucket = typeof inputMatchBucket === 'function' ? inputMatchBucket : decisionFunction(true);
11054
+ const matchFileDetails = typeof inputMatchFile === 'function' ? inputMatchFile : decisionFunction(true);
11055
+ const matchDeterminationLevel = inputMatchDeterminationLevel ?? HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
11056
+ return {
11057
+ determine: input => {
11058
+ let result;
11059
+ const {
11060
+ bucketId,
11061
+ pathString
11062
+ } = input.input;
11063
+ if (matchBucket(bucketId)) {
11064
+ const {
11065
+ matchesTargetPath
11066
+ } = pathMatcher(pathString);
11067
+ if (matchesTargetPath && matchFileDetails(input)) {
11068
+ result = {
11069
+ input,
11070
+ type: fileType,
11071
+ level: matchDeterminationLevel
11072
+ };
11073
+ }
11074
+ }
11075
+ return result;
11076
+ },
11077
+ getPossibleFileTypes: () => [fileType]
11078
+ };
11079
+ }
11080
+ /**
11081
+ * Wraps a separate UploadedFileTypeDeterminer and adds user determination based on folder path structure.
11082
+ *
11083
+ * @param config Configuration.
11084
+ */
11085
+ function determineUserByFolderWrapperFunction(config) {
11086
+ const {
11087
+ rootFolder,
11088
+ userFolderPrefix,
11089
+ requireUser = false,
11090
+ allowSubPaths: inputAllowSubPaths = true
11091
+ } = config;
11092
+ const allowSubPaths = inputAllowSubPaths ?? true;
11093
+ const subPathMatcherConfig = config.matchSubPath ?? {
11094
+ basePath: mergeSlashPaths([rootFolder, userFolderPrefix])
11095
+ };
11096
+ const pathMatcher = slashPathSubPathMatcher(subPathMatcherConfig);
11097
+ return determiner => {
11098
+ return {
11099
+ determine: async input => {
11100
+ const determinerResult = await determiner.determine(input);
11101
+ let result;
11102
+ if (determinerResult) {
11103
+ if (determinerResult.user) {
11104
+ result = determinerResult;
11105
+ } else {
11106
+ const pathDetails = input.getPathDetails();
11107
+ const pathRootFolder = pathDetails.parts[0];
11108
+ if (pathRootFolder === rootFolder) {
11109
+ // root folder matches, continue
11110
+ const {
11111
+ matchesBasePath,
11112
+ subPathParts
11113
+ } = pathMatcher(pathDetails.path);
11114
+ if (matchesBasePath && (allowSubPaths ? subPathParts.length >= 2 : subPathParts.length === 2)) {
11115
+ // must have two parts: the user folder and the file
11116
+ const user = subPathParts[0];
11117
+ result = {
11118
+ ...determinerResult,
11119
+ user
11120
+ };
11121
+ }
11122
+ }
11123
+ }
11124
+ // If requireUser is true and no user was detected, return null.
11125
+ if (requireUser && !result?.user) {
11126
+ result = null;
11127
+ }
11128
+ }
11129
+ return result;
11130
+ },
11131
+ getPossibleFileTypes: () => determiner.getPossibleFileTypes()
11132
+ };
11133
+ };
11134
+ }
11135
+ function determineUserByUserUploadsFolderWrapperFunction(config) {
11136
+ return determineUserByFolderWrapperFunction({
11137
+ ...config,
11138
+ rootFolder: UPLOADS_FOLDER_PATH,
11139
+ userFolderPrefix: ALL_USER_UPLOADS_FOLDER_NAME
11140
+ });
11141
+ }
11142
+ /**
11143
+ * Convenience function for using determineUserByFolderWrapperFunction directly on a pre-set determiner.
11144
+ *
11145
+ * @param config Configuration.
11146
+ * @returns The wrapped UploadedFileTypeDeterminer.
11147
+ */
11148
+ function determineUserByFolder(config) {
11149
+ return determineUserByFolderWrapperFunction(config)(config.determiner);
11150
+ }
11151
+ /**
11152
+ * Wraps an UploadedFileTypeDeterminer to only allow respond to certain file types.
11153
+ *
11154
+ * @param determiner The determiner to wrap.
11155
+ * @param types The file types to allow.
11156
+ */
11157
+ function limitUploadFileTypeDeterminer(determiner, types) {
11158
+ const allowedTypes = asArray(types);
11159
+ const allowedTypeSet = new Set(allowedTypes);
11160
+ return {
11161
+ determine: async input => {
11162
+ const result = await determiner.determine(input);
11163
+ // if the result's type is not in the allowed types, return null.
11164
+ return result && allowedTypeSet.has(result.type) ? result : null;
11165
+ },
11166
+ getPossibleFileTypes: () => allowedTypes
11167
+ };
11168
+ }
11169
+ /**
11170
+ * Combines multiple UploadedFileTypeDeterminer instances into a single determiner.
11171
+ *
11172
+ * If a single determiner is provided, it will be returned and not wrapped.
11173
+ *
11174
+ * @param determiners The determiners to combine.
11175
+ * @returns The combined determiner.
11176
+ */
11177
+ function combineUploadFileTypeDeterminers(config) {
11178
+ const {
11179
+ determiners,
11180
+ completeSearchAtLevel: inputCompleteSearchAtLevel,
11181
+ completeSearchOnFirstMatch: inputCompleteSearchOnFirstMatch
11182
+ } = config;
11183
+ let result;
11184
+ if (determiners.length === 1) {
11185
+ result = determiners[0];
11186
+ } else {
11187
+ const possibleFileTypes = unique(determiners.map(d => d.getPossibleFileTypes()).flat());
11188
+ const completeSearchOnFirstMatch = Boolean(inputCompleteSearchOnFirstMatch);
11189
+ const completeSearchAtLevel = completeSearchOnFirstMatch ? LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL : inputCompleteSearchAtLevel ?? EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
11190
+ result = {
11191
+ determine: async input => {
11192
+ let result;
11193
+ for (const determiner of determiners) {
11194
+ const stepResult = await determiner.determine(input);
11195
+ if (stepResult) {
11196
+ if (stepResult.level >= completeSearchAtLevel) {
11197
+ result = stepResult;
11198
+ break;
11199
+ } else if (!result || stepResult.level > result.level) {
11200
+ result = stepResult; // update result to the higher level match
11201
+ }
11202
+ }
11203
+ }
11204
+ return result;
11205
+ },
11206
+ getPossibleFileTypes: () => possibleFileTypes
11207
+ };
11208
+ }
11209
+ return result;
11210
+ }
11211
+
9988
11212
  // MARK: Collection
9989
11213
  class SystemStateFirestoreCollections {}
9990
11214
  // MARK: Mock Item
@@ -10028,4 +11252,4 @@ function systemStateFirestoreCollection(firestoreContext, converters) {
10028
11252
  });
10029
11253
  }
10030
11254
 
10031
- export { AbstractFirestoreDocument, AbstractFirestoreDocumentDataAccessorWrapper, AbstractFirestoreDocumentWithParent, AbstractSubscribeOrUnsubscribeToNotificationBoxParams, AbstractSubscribeToNotificationBoxParams, AppNotificationTemplateTypeInfoRecordService, BASE_MODEL_STORAGE_FILE_PATH, CALL_MODEL_APP_FUNCTION_KEY, COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION, CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, CleanupSentNotificationsParams, ContextGrantedModelRolesReaderInstance, CreateNotificationBoxParams, CreateNotificationSummaryParams, CreateNotificationUserParams, DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE, DEFAULT_DATE_CELL_RANGE_VALUE, DEFAULT_FIRESTORE_DATE_CELL_SCHEDULE_VALUE, DEFAULT_FIRESTORE_ITEM_PAGE_ITERATOR_ITEMS_PER_PAGE, DEFAULT_FIRESTORE_STRING_FIELD_VALUE, DEFAULT_FIRESTORE_UNITED_STATES_ADDRESS_VALUE, DEFAULT_FIRESTORE_WEBSITE_FILE_LINK_VALUE, DEFAULT_ITERATE_FIRESTORE_DOCUMENT_SNAPSHOT_BATCHES_BATCH_SIZE, DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, DEFAULT_QUERY_CHANGE_WATCHER_DELAY, DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER, DEFAULT_WEBSITE_LINK, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_NETWORK_REQUEST_FAILED, FIREBASE_AUTH_PASSWORD_MAX_LENGTH, FIREBASE_AUTH_PASSWORD_MIN_LENGTH, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_AUTH_WRONG_PASSWORD, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FIRESTORE_COLLECTION_NAME_SEPARATOR, FIRESTORE_DUMMY_MODEL_KEY, FIRESTORE_EMPTY_VALUE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, FIRESTORE_ITEM_PAGE_ITERATOR, FIRESTORE_ITEM_PAGE_ITERATOR_DELEGATE, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_MAX_WHERE_IN_FILTER_ARGS_COUNT, FIRESTORE_MODEL_ID_REGEX, FIRESTORE_MODEL_KEY_REGEX, FIRESTORE_MODEL_KEY_REGEX_STRICT, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_PASSTHROUGH_FIELD, FIRESTORE_PERMISSION_DENIED_ERROR_CODE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FirebaseDevelopmentFunctions, FirebaseModelPermissionServiceInstance, FirebaseServerError, FirestoreAccessorStreamMode, FirestoreDocumentContextType, InferredTargetModelIdParams, InferredTargetModelParams, InitializeAllApplicableNotificationBoxesParams, InitializeAllApplicableNotificationSummariesParams, InitializeNotificationModelParams, IsFirestoreModelId, IsFirestoreModelIdOrKey, IsFirestoreModelKey, MAX_FIRESTORE_MAP_ZOOM_LEVEL_VALUE, MIN_FIRESTORE_MAP_ZOOM_LEVEL_VALUE, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER, MODEL_STORAGE_FILE_SLASH_PATH_FACTORY, ModifyBeforeSetFirestoreDocumentDataAccessorWrapper, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MESSAGE_MAX_LENGTH, NOTIFICATION_MESSAGE_MIN_LENGTH, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_RECIPIENT_NAME_MAX_LENGTH, NOTIFICATION_RECIPIENT_NAME_MIN_LENGTH, NOTIFICATION_SUBJECT_MAX_LENGTH, NOTIFICATION_SUBJECT_MIN_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT, NotificationBoxDocument, NotificationBoxRecipientFlag, NotificationBoxRecipientTemplateConfigArrayEntryParam, NotificationBoxRecipientTemplateConfigBoolean, NotificationDocument, NotificationFirestoreCollections, NotificationFunctions, NotificationMessageFlag, NotificationRecipientParams, NotificationRecipientSendFlag, NotificationSendState, NotificationSendType, NotificationSummaryDocument, NotificationUserDocument, NotificationWeekDocument, RUN_DEV_FUNCTION_APP_FUNCTION_KEY, ResyncAllNotificationUserParams, ResyncNotificationUserParams, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFunctionTypeEnum, SendNotificationParams, SendQueuedNotificationsParams, SystemStateDocument, SystemStateFirestoreCollections, TargetModelIdParams, TargetModelParams, UpdateNotificationBoxParams, UpdateNotificationBoxRecipientLikeParams, UpdateNotificationBoxRecipientParams, UpdateNotificationSummaryParams, UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams, UpdateNotificationUserNotificationBoxRecipientParams, UpdateNotificationUserParams, addConstraintToBuilder, addOrReplaceLimitInConstraints, allChildDocumentsUnderParent, allChildDocumentsUnderParentPath, allChildDocumentsUnderRelativePath, allowDocumentSnapshotWithPathOnceFilter, allowedNotificationRecipients, appNotificationTemplateTypeInfoRecordService, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, arrayUpdateWithAccessorFunction, asTopLevelFieldPath, asTopLevelFieldPaths, assertFirestoreUpdateHasData, assertStorageUploadOptionsStringFormat, assignDateCellRangeFunction, assignDateCellScheduleFunction, assignUnitedStatesAddressFunction, assignWebsiteFileLinkFunction, assignWebsiteLinkFunction, buildFirebaseCollectionTypeModelTypeMap, calculateNsForNotificationUserNotificationBoxRecipientConfigs, callModelFirebaseFunctionMapFactory, childFirestoreModelKey, childFirestoreModelKeyPath, childFirestoreModelKeys, clientFirebaseFirestoreContextFactory, clientFirebaseStorageContextFactory, contextGrantedModelRolesReader, contextGrantedModelRolesReaderDoesNotExistErrorMessage, contextGrantedModelRolesReaderPermissionErrorMessage, convertHttpsCallableErrorToReadableError, copyDocumentIdForUserRelatedModifierFunction, copyDocumentIdToFieldModifierFunction, copyUserRelatedDataAccessorFactoryFunction, copyUserRelatedDataModifierConfig, createNotificationDocument, createNotificationDocumentIfSending, createNotificationDocumentPair, createNotificationTaskTemplate, createNotificationTemplate, dataFromDocumentSnapshots, dataFromSnapshotStream, delayCompletion, developmentFirebaseFunctionMapFactory, directDataHttpsCallable, documentData, documentDataFunction, documentDataWithIdAndKey, documentReferenceFromDocument, documentReferencesFromDocuments, documentReferencesFromSnapshot, effectiveNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientTemplateConfig, endAt, endAtValue, endBefore, extendFirestoreCollectionWithSingleDocumentAccessor, filterConstraintsOfType, filterDisallowedFirestoreItemPageIteratorInputConstraints, filterDisallowedFirestoreItemPageIteratorInputContraints, filterRepeatCheckpointSnapshots, filterWithDateRange, firebaseAuthErrorToReadableError, firebaseFirestoreClientDrivers, firebaseFirestoreQueryConstraintFunctionsDriver, firebaseFirestoreQueryDriver, firebaseFunctionMapFactory, firebaseModelLoader, firebaseModelPermissionService, firebaseModelService, firebaseModelServiceFactory, firebaseModelsService, firebaseQueryItemAccumulator, firebaseQuerySnapshotAccumulator, firebaseStorageBucketFolderPath, firebaseStorageClientAccessorDriver, firebaseStorageClientAccessorFile, firebaseStorageClientAccessorFolder, firebaseStorageClientDrivers, firebaseStorageClientListFilesResultFactory, firebaseStorageContextFactory, firebaseStorageFileExists, firebaseStorageFilePathFromStorageFilePath, firebaseStorageRefForStorageFilePath, firestoreArray, firestoreArrayMap, firestoreBitwiseObjectMap, firestoreBitwiseSet, firestoreBitwiseSetMap, firestoreBoolean, firestoreClientAccessorDriver, firestoreClientArrayUpdateToUpdateData, firestoreClientIncrementUpdateToUpdateData, firestoreCollectionQueryFactory, firestoreContextFactory, firestoreDate, firestoreDateCellRange, firestoreDateCellRangeArray, firestoreDateCellRangeAssignFn, firestoreDateCellSchedule, firestoreDateCellScheduleAssignFn, firestoreDencoderArray, firestoreDencoderMap, firestoreDencoderStringArray, firestoreDocumentAccessorContextExtension, firestoreDocumentAccessorFactory, firestoreDocumentLoader, firestoreDocumentSnapshotPairsLoader, firestoreDocumentSnapshotPairsLoaderInstance, firestoreDummyKey, firestoreEncodedArray, firestoreEncodedObjectMap, firestoreEnum, firestoreEnumArray, firestoreField, firestoreFieldConfigToModelMapFunctionsRef, firestoreIdBatchVerifierFactory, firestoreIdentityTypeArray, firestoreIdentityTypeArrayName, firestoreItemPageIteration, firestoreItemPageIterationFactory, firestoreLatLngString, firestoreMap, firestoreMapZoomLevel, firestoreModelId, firestoreModelIdArrayField, firestoreModelIdFromDocument, firestoreModelIdGrantedRoleArrayMap, firestoreModelIdGrantedRoleMap, firestoreModelIdString, firestoreModelIdentity, firestoreModelIdentityTypeMap, firestoreModelIdsFromDocuments, firestoreModelIdsFromKey, firestoreModelKey, firestoreModelKeyArrayField, firestoreModelKeyCollectionName, firestoreModelKeyCollectionType, firestoreModelKeyCollectionTypeArray, firestoreModelKeyCollectionTypeArrayName, firestoreModelKeyCollectionTypePair, firestoreModelKeyEncodedGrantedRoleMap, firestoreModelKeyFromDocument, firestoreModelKeyGrantedRoleArrayMap, firestoreModelKeyGrantedRoleMap, firestoreModelKeyPairObject, firestoreModelKeyParentKey, firestoreModelKeyParentKeyPartPairs, firestoreModelKeyPart, firestoreModelKeyPartPairs, firestoreModelKeyPartPairsKeyPath, firestoreModelKeyPartPairsPaths, firestoreModelKeyPath, firestoreModelKeyString, firestoreModelKeyTypePair, firestoreModelKeys, firestoreModelKeysFromDocuments, firestoreModelType, firestoreNotificationBoxRecipient, firestoreNotificationBoxRecipientTemplateConfigRecord, firestoreNotificationItem, firestoreNotificationRecipientWithConfig, firestoreNotificationUserDefaultNotificationBoxRecipientConfig, firestoreNotificationUserNotificationBoxRecipientConfig, firestoreNumber, firestoreObjectArray, firestorePassThroughField, firestoreQueryConstraint, firestoreQueryConstraintFactory, firestoreQueryDocumentSnapshotPairsLoader, firestoreQueryFactory, firestoreSingleDocumentAccessor, firestoreString, firestoreSubObject, firestoreTimezoneString, firestoreUID, firestoreUniqueArray, firestoreUniqueKeyedArray, firestoreUniqueNumberArray, firestoreUniqueStringArray, firestoreUnitedStatesAddress, firestoreUnitedStatesAddressAssignFn, firestoreUpdateWithNoDataError, firestoreWebsiteFileLink, firestoreWebsiteFileLinkAssignFn, firestoreWebsiteFileLinkEncodedArray, firestoreWebsiteFileLinkObjectArray, firestoreWebsiteLink, firestoreWebsiteLinkArray, firestoreWebsiteLinkAssignFn, flatFirestoreModelKey, getDataFromDocumentSnapshots, getDocumentSnapshotData, getDocumentSnapshotDataPair, getDocumentSnapshotDataPairs, getDocumentSnapshotDataPairsWithData, getDocumentSnapshotDataTuples, getDocumentSnapshotPair, getDocumentSnapshotPairs, getDocumentSnapshots, getDocumentSnapshotsData, grantFullAccessIfAdmin, grantFullAccessIfAuthUserRelated, grantModelRolesIfAdmin, grantModelRolesIfAdminFunction, grantModelRolesIfAuthUserRelatedModelFunction, grantModelRolesIfFunction, grantModelRolesIfHasAuthRolesFactory, grantModelRolesIfHasAuthRolesFunction, grantModelRolesOnlyIfFunction, inContextFirebaseModelServiceFactory, inContextFirebaseModelsServiceFactory, incrementUpdateWithAccessorFunction, inferKeyFromTwoWayFlatFirestoreModelKey, inferNotificationBoxRelatedModelKey, interceptAccessorFactoryFunction, isAdminInFirebaseModelContext, isClientFirebaseError, isCompleteNotificationSendState, isFirebaseStorageObjectNotFoundError, isFirestoreModelId, isFirestoreModelIdOrKey, isFirestoreModelKey, isOwnerOfUserRelatedModelInFirebaseModelContext, iterateFirestoreDocumentSnapshotBatches, iterateFirestoreDocumentSnapshotCheckpoints, iterateFirestoreDocumentSnapshotPairBatches, iterateFirestoreDocumentSnapshotPairs, iterateFirestoreDocumentSnapshots, iterationQueryDocChangeWatcher, iterationQueryDocChangeWatcherChangeTypeForGroup, latestDataFromDocuments, latestSnapshotsFromDocuments, lazyFirebaseFunctionsFactory, limit, limitToLast, limitedFirestoreDocumentAccessorFactory, loadAllFirestoreDocumentSnapshot, loadAllFirestoreDocumentSnapshotPairs, loadDocumentsForDocumentReferences, loadDocumentsForDocumentReferencesFromValues, loadDocumentsForIds, loadDocumentsForIdsFromValues, loadDocumentsForKeys, loadDocumentsForKeysFromValues, loadDocumentsForSnapshots, loadDocumentsForValues, loadNotificationBoxDocumentForReferencePair, makeDocuments, makeFirestoreCollection, makeFirestoreCollectionGroup, makeFirestoreCollectionWithParent, makeFirestoreItemPageIteratorDelegate, makeFirestoreQueryConstraintFunctionsDriver, makeRootSingleItemFirestoreCollection, makeSingleItemFirestoreCollection, mapDataFromSnapshot, mapHttpsCallable, mergeNotificationBoxRecipientTemplateConfigRecords, mergeNotificationBoxRecipientTemplateConfigs, mergeNotificationBoxRecipients, mergeNotificationSendMessagesResult, mergeNotificationUserDefaultNotificationBoxRecipientConfig, mergeNotificationUserNotificationBoxRecipientConfigs, modelStorageSlashPathFactory, modifyBeforeSetInterceptAccessorFactoryFunction, newDocuments, newNotificationBoxRecipientForUid, noContentNotificationMessageFunctionFactory, noStringFormatInStorageUploadOptionsError, notificationBoxCollectionReference, notificationBoxConverter, notificationBoxFirestoreCollection, notificationBoxIdForModel, notificationBoxIdentity, notificationBoxModelCrudFunctionsConfig, notificationBoxRecipientTemplateConfigArrayToRecord, notificationBoxRecipientTemplateConfigRecordToArray, notificationBoxesFlaggedForNeedsInitializationQuery, notificationBoxesFlaggedInvalidQuery, notificationCollectionReference, notificationCollectionReferenceFactory, notificationConverter, notificationFirestoreCollectionFactory, notificationFirestoreCollectionGroup, notificationFunctionMap, notificationFunctionTypeConfigMap, notificationIdentity, notificationMessageFunction, notificationSendExclusionCanSendFunction, notificationSendFlagsImplyIsComplete, notificationSummariesFlaggedForNeedsInitializationQuery, notificationSummaryCollectionReference, notificationSummaryConverter, notificationSummaryFirestoreCollection, notificationSummaryIdForModel, notificationSummaryIdForUidFunctionForRootFirestoreModelIdentity, notificationSummaryIdentity, notificationTaskComplete, notificationTaskDelayRetry, notificationTaskFailed, notificationTaskPartiallyComplete, notificationTaskUniqueId, notificationTemplateTypeDetailsRecord, notificationTemplateTypeInfoRecord, notificationUserCollectionReference, notificationUserConverter, notificationUserFirestoreCollection, notificationUserHasExclusionQuery, notificationUserIdentity, notificationUsersFlaggedForNeedsSyncQuery, notificationWeekCollectionReference, notificationWeekCollectionReferenceFactory, notificationWeekConverter, notificationWeekFirestoreCollectionFactory, notificationWeekFirestoreCollectionGroup, notificationWeekIdentity, notificationsPastSendAtTimeQuery, notificationsReadyForCleanupQuery, offset, onCallCreateModelParams, onCallCreateModelResult, onCallCreateModelResultWithDocs, onCallDeleteModelParams, onCallDevelopmentParams, onCallReadModelParams, onCallTypedModelParams, onCallTypedModelParamsFunction, onCallUpdateModelParams, optionalFirestoreArray, optionalFirestoreBoolean, optionalFirestoreDate, optionalFirestoreEnum, optionalFirestoreField, optionalFirestoreNumber, optionalFirestoreString, optionalFirestoreUID, optionalFirestoreUnitedStatesAddress, orderBy, orderByDocumentId, readFirestoreModelKey, readFirestoreModelKeyFromDocumentSnapshot, replaceConstraints, selectFromFirebaseModelsService, separateConstraints, setIdAndKeyFromKeyIdRefOnDocumentData, setIdAndKeyFromSnapshotOnDocumentData, shouldSaveNotificationToNotificationWeek, shouldSendCreatedNotificationInput, snapshotConverterFunctions, snapshotStreamDataForAccessor, snapshotStreamForAccessor, sortNotificationItemsFunction, startAfter, startAt, startAtValue, storageListFilesResultFactory, storageListFilesResultHasNoNextError, storagePathFactory, streamFromOnSnapshot, systemStateCollectionReference, systemStateConverter, systemStateFirestoreCollection, systemStateIdentity, twoWayFlatFirestoreModelKey, unreadNotificationItems, unsupportedFirestoreDriverFunctionError, updateNotificationBoxRecipientTemplateConfigRecord, updateNotificationRecipient, updateNotificationUserDefaultNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigIfChanged, updateNotificationUserNotificationBoxRecipientConfigs, updateNotificationUserNotificationSendExclusions, updateWithAccessorUpdateAndConverterFunction, useContextAuth, useContextAuthUid, useDocumentSnapshot, useDocumentSnapshotData, useFirebaseModelsService, where, whereDateIsAfter, whereDateIsAfterWithSort, whereDateIsBefore, whereDateIsBeforeWithSort, whereDateIsBetween, whereDateIsInRange, whereDateIsOnOrAfter, whereDateIsOnOrAfterWithSort, whereDateIsOnOrBefore, whereDateIsOnOrBeforeWithSort, whereDocumentId, whereStringHasRootIdentityModelKey, whereStringValueHasPrefix };
11255
+ export { ALL_STORAGE_FILE_NOTIFICATION_TASK_TYPES, ALL_USER_UPLOADS_FOLDER_NAME, ALL_USER_UPLOADS_FOLDER_PATH, AbstractFirestoreDocument, AbstractFirestoreDocumentDataAccessorWrapper, AbstractFirestoreDocumentWithParent, AbstractSubscribeOrUnsubscribeToNotificationBoxParams, AbstractSubscribeToNotificationBoxParams, AppNotificationTemplateTypeInfoRecordService, BASE_MODEL_STORAGE_FILE_PATH, CALL_MODEL_APP_FUNCTION_KEY, COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION, CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, CleanupSentNotificationsParams, ContextGrantedModelRolesReaderInstance, CreateNotificationBoxParams, CreateNotificationSummaryParams, CreateNotificationUserParams, CreateStorageFileParams, DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE, DEFAULT_DATE_CELL_RANGE_VALUE, DEFAULT_FIRESTORE_DATE_CELL_SCHEDULE_VALUE, DEFAULT_FIRESTORE_ITEM_PAGE_ITERATOR_ITEMS_PER_PAGE, DEFAULT_FIRESTORE_STRING_FIELD_VALUE, DEFAULT_FIRESTORE_UNITED_STATES_ADDRESS_VALUE, DEFAULT_FIRESTORE_WEBSITE_FILE_LINK_VALUE, DEFAULT_ITERATE_FIRESTORE_DOCUMENT_SNAPSHOT_BATCHES_BATCH_SIZE, DEFAULT_MAX_STORAGE_FILE_PROCESSING_CLEANUP_RETRY_ATTEMPTS, DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, DEFAULT_QUERY_CHANGE_WATCHER_DELAY, DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER, DEFAULT_STORAGE_FILE_PROCESSING_CLEANUP_RETRY_DELAY, DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL, DEFAULT_WEBSITE_LINK, DeleteAllQueuedStorageFilesParams, DeleteStorageFileParams, EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_NETWORK_REQUEST_FAILED, FIREBASE_AUTH_PASSWORD_MAX_LENGTH, FIREBASE_AUTH_PASSWORD_MIN_LENGTH, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_AUTH_WRONG_PASSWORD, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FIRESTORE_COLLECTION_NAME_SEPARATOR, FIRESTORE_DUMMY_MODEL_KEY, FIRESTORE_EMPTY_VALUE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, FIRESTORE_ITEM_PAGE_ITERATOR, FIRESTORE_ITEM_PAGE_ITERATOR_DELEGATE, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_MAX_WHERE_IN_FILTER_ARGS_COUNT, FIRESTORE_MODEL_ID_REGEX, FIRESTORE_MODEL_KEY_REGEX, FIRESTORE_MODEL_KEY_REGEX_STRICT, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_PASSTHROUGH_FIELD, FIRESTORE_PERMISSION_DENIED_ERROR_CODE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FirebaseDevelopmentFunctions, FirebaseModelPermissionServiceInstance, FirebaseServerError, FirestoreAccessorStreamMode, FirestoreDocumentContextType, HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL, InferredTargetModelIdParams, InferredTargetModelParams, InitializeAllApplicableNotificationBoxesParams, InitializeAllApplicableNotificationSummariesParams, InitializeAllStorageFilesFromUploadsParams, InitializeNotificationModelParams, InitializeStorageFileFromUploadParams, IsFirestoreModelId, IsFirestoreModelIdOrKey, IsFirestoreModelKey, LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL, MAX_FIRESTORE_MAP_ZOOM_LEVEL_VALUE, MIN_FIRESTORE_MAP_ZOOM_LEVEL_VALUE, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER, MODEL_STORAGE_FILE_SLASH_PATH_FACTORY, ModifyBeforeSetFirestoreDocumentDataAccessorWrapper, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MESSAGE_MAX_LENGTH, NOTIFICATION_MESSAGE_MIN_LENGTH, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_RECIPIENT_NAME_MAX_LENGTH, NOTIFICATION_RECIPIENT_NAME_MIN_LENGTH, NOTIFICATION_SUBJECT_MAX_LENGTH, NOTIFICATION_SUBJECT_MIN_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT, NotificationBoxDocument, NotificationBoxRecipientFlag, NotificationBoxRecipientTemplateConfigArrayEntryParam, NotificationBoxRecipientTemplateConfigBoolean, NotificationDocument, NotificationFirestoreCollections, NotificationFunctions, NotificationMessageFlag, NotificationRecipientParams, NotificationRecipientSendFlag, NotificationSendState, NotificationSendType, NotificationSummaryDocument, NotificationUserDocument, NotificationWeekDocument, ProcessAllQueuedStorageFilesParams, ProcessStorageFileParams, RUN_DEV_FUNCTION_APP_FUNCTION_KEY, ResyncAllNotificationUserParams, ResyncNotificationUserParams, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, STORAGE_FILE_UPLOAD_USER_ROLE, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFunctionTypeEnum, SendNotificationParams, SendQueuedNotificationsParams, StorageFileCreationType, StorageFileDocument, StorageFileFirestoreCollections, StorageFileFunctions, StorageFileProcessingState, StorageFileState, StorageFileUploadStreamUnsupportedError, SystemStateDocument, SystemStateFirestoreCollections, TargetModelIdParams, TargetModelParams, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, UPLOADS_FOLDER_PATH, UpdateNotificationBoxParams, UpdateNotificationBoxRecipientLikeParams, UpdateNotificationBoxRecipientParams, UpdateNotificationSummaryParams, UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams, UpdateNotificationUserNotificationBoxRecipientParams, UpdateNotificationUserParams, UpdateStorageFileParams, addConstraintToBuilder, addOrReplaceLimitInConstraints, allChildDocumentsUnderParent, allChildDocumentsUnderParentPath, allChildDocumentsUnderRelativePath, allowDocumentSnapshotWithPathOnceFilter, allowedNotificationRecipients, appNotificationTemplateTypeInfoRecordService, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, arrayUpdateWithAccessorFunction, asTopLevelFieldPath, asTopLevelFieldPaths, assertFirestoreUpdateHasData, assertStorageUploadOptionsStringFormat, assignDateCellRangeFunction, assignDateCellScheduleFunction, assignUnitedStatesAddressFunction, assignWebsiteFileLinkFunction, assignWebsiteLinkFunction, buildFirebaseCollectionTypeModelTypeMap, calculateNsForNotificationUserNotificationBoxRecipientConfigs, callModelFirebaseFunctionMapFactory, childFirestoreModelKey, childFirestoreModelKeyPath, childFirestoreModelKeys, clientFirebaseFirestoreContextFactory, clientFirebaseStorageContextFactory, combineUploadFileTypeDeterminers, contextGrantedModelRolesReader, contextGrantedModelRolesReaderDoesNotExistErrorMessage, contextGrantedModelRolesReaderPermissionErrorMessage, convertHttpsCallableErrorToReadableError, copyDocumentIdForUserRelatedModifierFunction, copyDocumentIdToFieldModifierFunction, copyStoragePath, copyUserRelatedDataAccessorFactoryFunction, copyUserRelatedDataModifierConfig, createNotificationDocument, createNotificationDocumentIfSending, createNotificationDocumentPair, createNotificationTaskTemplate, createNotificationTemplate, createStorageFileDocumentPair, createStorageFileDocumentPairFactory, dataFromDocumentSnapshots, dataFromSnapshotStream, delayCompletion, determineByFileName, determineByFilePath, determineByFolderName, determineUserByFolder, determineUserByFolderWrapperFunction, determineUserByUserUploadsFolderWrapperFunction, developmentFirebaseFunctionMapFactory, directDataHttpsCallable, documentData, documentDataFunction, documentDataWithIdAndKey, documentReferenceFromDocument, documentReferencesFromDocuments, documentReferencesFromSnapshot, effectiveNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientTemplateConfig, endAt, endAtValue, endBefore, extendFirestoreCollectionWithSingleDocumentAccessor, filterConstraintsOfType, filterDisallowedFirestoreItemPageIteratorInputConstraints, filterDisallowedFirestoreItemPageIteratorInputContraints, filterRepeatCheckpointSnapshots, filterWithDateRange, firebaseAuthErrorToReadableError, firebaseFirestoreClientDrivers, firebaseFirestoreQueryConstraintFunctionsDriver, firebaseFirestoreQueryDriver, firebaseFunctionMapFactory, firebaseModelLoader, firebaseModelPermissionService, firebaseModelService, firebaseModelServiceFactory, firebaseModelsService, firebaseQueryItemAccumulator, firebaseQuerySnapshotAccumulator, firebaseStorageBucketFolderPath, firebaseStorageClientAccessorDriver, firebaseStorageClientAccessorFile, firebaseStorageClientAccessorFolder, firebaseStorageClientDrivers, firebaseStorageClientListFilesResultFactory, firebaseStorageContextFactory, firebaseStorageFileExists, firebaseStorageFilePathFromStorageFilePath, firebaseStorageRefForStorageFilePath, firestoreArray, firestoreArrayMap, firestoreBitwiseObjectMap, firestoreBitwiseSet, firestoreBitwiseSetMap, firestoreBoolean, firestoreClientAccessorDriver, firestoreClientArrayUpdateToUpdateData, firestoreClientIncrementUpdateToUpdateData, firestoreCollectionQueryFactory, firestoreContextFactory, firestoreDate, firestoreDateCellRange, firestoreDateCellRangeArray, firestoreDateCellRangeAssignFn, firestoreDateCellSchedule, firestoreDateCellScheduleAssignFn, firestoreDencoderArray, firestoreDencoderMap, firestoreDencoderStringArray, firestoreDocumentAccessorContextExtension, firestoreDocumentAccessorFactory, firestoreDocumentLoader, firestoreDocumentSnapshotPairsLoader, firestoreDocumentSnapshotPairsLoaderInstance, firestoreDummyKey, firestoreEncodedArray, firestoreEncodedObjectMap, firestoreEnum, firestoreEnumArray, firestoreField, firestoreFieldConfigToModelMapFunctionsRef, firestoreFixedItemPageIteration, firestoreFixedItemPageIterationFactory, firestoreIdBatchVerifierFactory, firestoreIdentityTypeArray, firestoreIdentityTypeArrayName, firestoreItemPageIteration, firestoreItemPageIterationFactory, firestoreLatLngString, firestoreMap, firestoreMapZoomLevel, firestoreModelId, firestoreModelIdArrayField, firestoreModelIdFromDocument, firestoreModelIdGrantedRoleArrayMap, firestoreModelIdGrantedRoleMap, firestoreModelIdString, firestoreModelIdentity, firestoreModelIdentityTypeMap, firestoreModelIdsFromDocuments, firestoreModelIdsFromKey, firestoreModelKey, firestoreModelKeyArrayField, firestoreModelKeyCollectionName, firestoreModelKeyCollectionType, firestoreModelKeyCollectionTypeArray, firestoreModelKeyCollectionTypeArrayName, firestoreModelKeyCollectionTypePair, firestoreModelKeyEncodedGrantedRoleMap, firestoreModelKeyFromDocument, firestoreModelKeyGrantedRoleArrayMap, firestoreModelKeyGrantedRoleMap, firestoreModelKeyPairObject, firestoreModelKeyParentKey, firestoreModelKeyParentKeyPartPairs, firestoreModelKeyPart, firestoreModelKeyPartPairs, firestoreModelKeyPartPairsKeyPath, firestoreModelKeyPartPairsPaths, firestoreModelKeyPath, firestoreModelKeyString, firestoreModelKeyTypePair, firestoreModelKeys, firestoreModelKeysFromDocuments, firestoreModelType, firestoreNotificationBoxRecipient, firestoreNotificationBoxRecipientTemplateConfigRecord, firestoreNotificationItem, firestoreNotificationRecipientWithConfig, firestoreNotificationUserDefaultNotificationBoxRecipientConfig, firestoreNotificationUserNotificationBoxRecipientConfig, firestoreNumber, firestoreObjectArray, firestorePassThroughField, firestoreQueryConstraint, firestoreQueryConstraintFactory, firestoreQueryDocumentSnapshotPairsLoader, firestoreQueryFactory, firestoreSingleDocumentAccessor, firestoreString, firestoreSubObject, firestoreTimezoneString, firestoreUID, firestoreUniqueArray, firestoreUniqueKeyedArray, firestoreUniqueNumberArray, firestoreUniqueStringArray, firestoreUnitedStatesAddress, firestoreUnitedStatesAddressAssignFn, firestoreUpdateWithNoDataError, firestoreWebsiteFileLink, firestoreWebsiteFileLinkAssignFn, firestoreWebsiteFileLinkEncodedArray, firestoreWebsiteFileLinkObjectArray, firestoreWebsiteLink, firestoreWebsiteLinkArray, firestoreWebsiteLinkAssignFn, flatFirestoreModelKey, getDataFromDocumentSnapshots, getDocumentSnapshotData, getDocumentSnapshotDataPair, getDocumentSnapshotDataPairs, getDocumentSnapshotDataPairsWithData, getDocumentSnapshotDataTuples, getDocumentSnapshotPair, getDocumentSnapshotPairs, getDocumentSnapshots, getDocumentSnapshotsData, grantFullAccessIfAdmin, grantFullAccessIfAuthUserRelated, grantModelRolesIfAdmin, grantModelRolesIfAdminFunction, grantModelRolesIfAuthUserRelatedModelFunction, grantModelRolesIfFunction, grantModelRolesIfHasAuthRolesFactory, grantModelRolesIfHasAuthRolesFunction, grantModelRolesOnlyIfFunction, inContextFirebaseModelServiceFactory, inContextFirebaseModelsServiceFactory, incrementUpdateWithAccessorFunction, inferKeyFromTwoWayFlatFirestoreModelKey, inferNotificationBoxRelatedModelKey, interceptAccessorFactoryFunction, isAdminInFirebaseModelContext, isClientFirebaseError, isCompleteNotificationSendState, isFirebaseStorageObjectNotFoundError, isFirestoreModelId, isFirestoreModelIdOrKey, isFirestoreModelKey, isOwnerOfUserRelatedModelInFirebaseModelContext, iterateFirestoreDocumentSnapshotBatches, iterateFirestoreDocumentSnapshotCheckpoints, iterateFirestoreDocumentSnapshotPairBatches, iterateFirestoreDocumentSnapshotPairs, iterateFirestoreDocumentSnapshots, iterateStorageListFiles, iterateStorageListFilesByEachFile, iterateStorageListFilesFactory, iterationQueryDocChangeWatcher, iterationQueryDocChangeWatcherChangeTypeForGroup, latestDataFromDocuments, latestSnapshotsFromDocuments, lazyFirebaseFunctionsFactory, limit, limitToLast, limitUploadFileTypeDeterminer, limitedFirestoreDocumentAccessorFactory, loadAllFirestoreDocumentSnapshot, loadAllFirestoreDocumentSnapshotPairs, loadDocumentsForDocumentReferences, loadDocumentsForDocumentReferencesFromValues, loadDocumentsForIds, loadDocumentsForIdsFromValues, loadDocumentsForKeys, loadDocumentsForKeysFromValues, loadDocumentsForSnapshots, loadDocumentsForValues, loadNotificationBoxDocumentForReferencePair, makeDocuments, makeFirestoreCollection, makeFirestoreCollectionGroup, makeFirestoreCollectionWithParent, makeFirestoreItemPageIteratorDelegate, makeFirestoreQueryConstraintFunctionsDriver, makeRootSingleItemFirestoreCollection, makeSingleItemFirestoreCollection, mapDataFromSnapshot, mapHttpsCallable, mergeNotificationBoxRecipientTemplateConfigRecords, mergeNotificationBoxRecipientTemplateConfigs, mergeNotificationBoxRecipients, mergeNotificationSendMessagesResult, mergeNotificationUserDefaultNotificationBoxRecipientConfig, mergeNotificationUserNotificationBoxRecipientConfigs, modelStorageSlashPathFactory, modifyBeforeSetInterceptAccessorFactoryFunction, newDocuments, newNotificationBoxRecipientForUid, noContentNotificationMessageFunctionFactory, noStringFormatInStorageUploadOptionsError, notificationBoxCollectionReference, notificationBoxConverter, notificationBoxFirestoreCollection, notificationBoxIdForModel, notificationBoxIdentity, notificationBoxModelCrudFunctionsConfig, notificationBoxRecipientTemplateConfigArrayToRecord, notificationBoxRecipientTemplateConfigRecordToArray, notificationBoxesFlaggedForNeedsInitializationQuery, notificationBoxesFlaggedInvalidQuery, notificationCollectionReference, notificationCollectionReferenceFactory, notificationConverter, notificationFirestoreCollectionFactory, notificationFirestoreCollectionGroup, notificationFunctionMap, notificationFunctionTypeConfigMap, notificationIdentity, notificationMessageFunction, notificationSendExclusionCanSendFunction, notificationSendFlagsImplyIsComplete, notificationSummariesFlaggedForNeedsInitializationQuery, notificationSummaryCollectionReference, notificationSummaryConverter, notificationSummaryFirestoreCollection, notificationSummaryIdForModel, notificationSummaryIdForUidFunctionForRootFirestoreModelIdentity, notificationSummaryIdentity, notificationTaskCanRunNextCheckpoint, notificationTaskComplete, notificationTaskDelayRetry, notificationTaskFailed, notificationTaskPartiallyComplete, notificationTaskUniqueId, notificationTemplateTypeDetailsRecord, notificationTemplateTypeInfoRecord, notificationUserCollectionReference, notificationUserConverter, notificationUserFirestoreCollection, notificationUserHasExclusionQuery, notificationUserIdentity, notificationUsersFlaggedForNeedsSyncQuery, notificationWeekCollectionReference, notificationWeekCollectionReferenceFactory, notificationWeekConverter, notificationWeekFirestoreCollectionFactory, notificationWeekFirestoreCollectionGroup, notificationWeekIdentity, notificationsPastSendAtTimeQuery, notificationsReadyForCleanupQuery, offset, onCallCreateModelParams, onCallCreateModelResult, onCallCreateModelResultWithDocs, onCallDeleteModelParams, onCallDevelopmentParams, onCallReadModelParams, onCallTypedModelParams, onCallTypedModelParamsFunction, onCallUpdateModelParams, optionalFirestoreArray, optionalFirestoreBoolean, optionalFirestoreDate, optionalFirestoreEnum, optionalFirestoreField, optionalFirestoreNumber, optionalFirestoreString, optionalFirestoreUID, optionalFirestoreUnitedStatesAddress, orderBy, orderByDocumentId, readFirestoreModelKey, readFirestoreModelKeyFromDocumentSnapshot, replaceConstraints, selectFromFirebaseModelsService, separateConstraints, setIdAndKeyFromKeyIdRefOnDocumentData, setIdAndKeyFromSnapshotOnDocumentData, shouldSaveNotificationToNotificationWeek, shouldSendCreatedNotificationInput, snapshotConverterFunctions, snapshotStreamDataForAccessor, snapshotStreamForAccessor, sortNotificationItemsFunction, startAfter, startAt, startAtValue, storageFileCollectionReference, storageFileConverter, storageFileFirestoreCollection, storageFileFunctionMap, storageFileFunctionTypeConfigMap, storageFileIdentity, storageFileModelCrudFunctionsConfig, storageFileProcessingNotificationTaskTemplate, storageFilePurposeAndUserQuery, storageFileUploadUserSimpleClaimsConfiguration, storageFilesQueuedForDeleteQuery, storageFilesQueuedForProcessingQuery, storageListFilesResultFactory, storageListFilesResultHasNoNextError, storagePathFactory, storedFileReaderFactory, streamFromOnSnapshot, systemStateCollectionReference, systemStateConverter, systemStateFirestoreCollection, systemStateIdentity, twoWayFlatFirestoreModelKey, unreadNotificationItems, unsupportedFirestoreDriverFunctionError, updateNotificationBoxRecipientTemplateConfigRecord, updateNotificationRecipient, updateNotificationUserDefaultNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigIfChanged, updateNotificationUserNotificationBoxRecipientConfigs, updateNotificationUserNotificationSendExclusions, updateWithAccessorUpdateAndConverterFunction, uploadFileWithStream, useContextAuth, useContextAuthUid, useDocumentSnapshot, useDocumentSnapshotData, useFirebaseModelsService, userUploadsFolderSlashPathFactory, userUploadsFolderStoragePathFactory, where, whereDateIsAfter, whereDateIsAfterWithSort, whereDateIsBefore, whereDateIsBeforeWithSort, whereDateIsBetween, whereDateIsInRange, whereDateIsOnOrAfter, whereDateIsOnOrAfterWithSort, whereDateIsOnOrBefore, whereDateIsOnOrBeforeWithSort, whereDocumentId, whereStringHasRootIdentityModelKey, whereStringValueHasPrefix };