@dereekb/firebase 10.0.18 → 10.0.20

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 (28) hide show
  1. package/index.cjs.js +163 -20
  2. package/index.esm.js +200 -22
  3. package/package.json +1 -1
  4. package/src/lib/client/firestore/driver.query.d.ts +2 -2
  5. package/src/lib/client/function/development.function.d.ts +2 -2
  6. package/src/lib/client/function/function.callable.d.ts +2 -2
  7. package/src/lib/client/function/function.d.ts +2 -2
  8. package/src/lib/client/function/function.factory.d.ts +5 -5
  9. package/src/lib/client/function/model.function.factory.d.ts +22 -5
  10. package/src/lib/common/auth/auth.d.ts +21 -9
  11. package/src/lib/common/auth/auth.error.d.ts +3 -3
  12. package/src/lib/common/firestore/accessor/accessor.d.ts +2 -2
  13. package/src/lib/common/firestore/accessor/converter.d.ts +1 -1
  14. package/src/lib/common/firestore/collection/collection.key.d.ts +8 -8
  15. package/src/lib/common/firestore/query/constraint.d.ts +15 -15
  16. package/src/lib/common/firestore/query/iterator.d.ts +3 -3
  17. package/src/lib/common/firestore/query/query.util.d.ts +3 -3
  18. package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +9 -9
  19. package/src/lib/common/model/function.d.ts +82 -11
  20. package/src/lib/common/model/model/model.loader.d.ts +2 -2
  21. package/src/lib/common/storage/accessor/path.model.d.ts +1 -1
  22. package/src/lib/common/storage/context.d.ts +2 -2
  23. package/src/lib/common/storage/driver/accessor.d.ts +5 -5
  24. package/src/lib/common/storage/driver/driver.d.ts +2 -2
  25. package/src/lib/common/storage/storage.d.ts +4 -4
  26. package/src/lib/common/storage/types.d.ts +25 -25
  27. package/test/CHANGELOG.md +8 -0
  28. package/test/package.json +1 -1
package/index.cjs.js CHANGED
@@ -6796,54 +6796,190 @@ function lazyFirebaseFunctionsFactory(configMap) {
6796
6796
  };
6797
6797
  }
6798
6798
 
6799
+ /**
6800
+ * Creates a OnCallTypedModelParamsFunction
6801
+ *
6802
+ * @param call
6803
+ * @returns
6804
+ */
6805
+ function onCallTypedModelParamsFunction(call) {
6806
+ return (modelTypeInput, data, specifier) => {
6807
+ const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
6808
+ if (!modelType) {
6809
+ throw new Error('modelType is required.');
6810
+ }
6811
+ const result = {
6812
+ call,
6813
+ modelType,
6814
+ data
6815
+ };
6816
+ if (specifier != null) {
6817
+ result.specifier = specifier;
6818
+ }
6819
+ return result;
6820
+ };
6821
+ }
6822
+ /**
6823
+ * Pre-configured OnCallTypedModelParamsFunctions for 'create'
6824
+ */
6825
+ const onCallCreateModelParams = onCallTypedModelParamsFunction('create');
6826
+ /**
6827
+ * Pre-configured OnCallTypedModelParamsFunctions for 'read'
6828
+ */
6829
+ const onCallReadModelParams = onCallTypedModelParamsFunction('read');
6830
+ /**
6831
+ * Pre-configured OnCallTypedModelParamsFunctions for 'update'
6832
+ */
6833
+ const onCallUpdateModelParams = onCallTypedModelParamsFunction('update');
6834
+ /**
6835
+ * Pre-configured OnCallTypedModelParamsFunctions for 'delete'
6836
+ */
6837
+ const onCallDeleteModelParams = onCallTypedModelParamsFunction('delete');
6799
6838
  /**
6800
6839
  * Creates a OnCallTypedModelParams
6801
6840
  *
6841
+ * @deprecated use onCallTypedModelParamsFunction instead.
6842
+ *
6802
6843
  * @param modelType
6803
6844
  * @param data
6804
6845
  * @returns
6805
6846
  */
6806
- function onCallTypedModelParams(modelTypeInput, data, specifier) {
6807
- const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
6808
- if (!modelType) {
6809
- throw new Error('modelType is required.');
6810
- }
6811
- const result = {
6812
- modelType,
6813
- data
6847
+ function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
6848
+ return onCallTypedModelParamsFunction(call)(modelTypeInput, data, specifier);
6849
+ }
6850
+ /**
6851
+ * Key used on the front-end and backend that refers to the call function.
6852
+ */
6853
+ const CALL_MODEL_APP_FUNCTION_KEY = 'callModel';
6854
+ function onCallCreateModelResultWithDocs(result) {
6855
+ return onCallCreateModelResult(util.asArray(result).map(x => x.documentRef.path));
6856
+ }
6857
+ function onCallCreateModelResult(modelKeys) {
6858
+ return {
6859
+ modelKeys: util.asArray(modelKeys)
6814
6860
  };
6815
- if (specifier != null) {
6816
- result.specifier = specifier;
6817
- }
6818
- return result;
6819
6861
  }
6862
+ // MARK: Compat
6820
6863
  /**
6821
6864
  * Key used on the front-end and backend that refers to a specific function for creating models.
6865
+ *
6866
+ * @deprecated Replaced by the callModel function.
6822
6867
  */
6823
6868
  const CREATE_MODEL_APP_FUNCTION_KEY = 'createModel';
6824
6869
  /**
6825
6870
  * Key used on the front-end and backend that refers to a specific function for reading models.
6871
+ *
6872
+ * @deprecated Replaced by the callModel function.
6826
6873
  */
6827
6874
  const READ_MODEL_APP_FUNCTION_KEY = 'readModel';
6828
6875
  /**
6829
6876
  * Key used on the front-end and backend that refers to a specific function for updating models.
6877
+ *
6878
+ * @deprecated Replaced by the callModel function.
6830
6879
  */
6831
6880
  const UPDATE_MODEL_APP_FUNCTION_KEY = 'updateModel';
6832
6881
  /**
6833
6882
  * Key used on the front-end and backend that refers to a specific function for deleting models.
6883
+ *
6884
+ * @deprecated Replaced by the callModel function.
6834
6885
  */
6835
6886
  const DELETE_MODEL_APP_FUNCTION_KEY = 'deleteModel';
6836
- function onCallCreateModelResultWithDocs(result) {
6837
- return onCallCreateModelResult(util.asArray(result).map(x => x.documentRef.path));
6838
- }
6839
- function onCallCreateModelResult(modelKeys) {
6840
- return {
6841
- modelKeys: util.asArray(modelKeys)
6842
- };
6843
- }
6844
6887
 
6845
6888
  const MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT = '_';
6846
6889
  const MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER = ',';
6890
+ /**
6891
+ * Creates a ModelFirebaseFunctionMapFactory for the input config that targets the "callModel" Firebase function.
6892
+ *
6893
+ * @param configMap
6894
+ * @param crudConfigMap
6895
+ * @returns
6896
+ */
6897
+ function callModelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
6898
+ const functionFactory = firebaseFunctionMapFactory(configMap);
6899
+ return functionsInstance => {
6900
+ const functionMap = functionFactory(functionsInstance);
6901
+ const _callFn = util.cachedGetter(() => functions.httpsCallable(functionsInstance, CALL_MODEL_APP_FUNCTION_KEY));
6902
+ function makeCallFunction(call, fn, modelType, specifier) {
6903
+ return mapHttpsCallable(fn(), {
6904
+ mapInput: data => onCallTypedModelParams(modelType, data, specifier, call)
6905
+ }, true);
6906
+ }
6907
+ function makeCallSpecifiers(call, fn, modelType, specifierKeys) {
6908
+ const modelTypeSuffix = util.capitalizeFirstLetter(modelType);
6909
+ const specifiers = {};
6910
+ specifierKeys.forEach(inputSpecifier => {
6911
+ const specifier = inputSpecifier === MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT ? '' : inputSpecifier;
6912
+ const specifierFn = makeCallFunction(call, fn, modelType, inputSpecifier);
6913
+ const fullSpecifierName = `${call}${modelTypeSuffix}${util.capitalizeFirstLetter(specifier)}`;
6914
+ specifiers[fullSpecifierName] = specifierFn;
6915
+ const shortSpecifierName = util.lowercaseFirstLetter(specifier) || call;
6916
+ specifiers[shortSpecifierName] = specifierFn;
6917
+ });
6918
+ return specifiers;
6919
+ }
6920
+ const result = util.build({
6921
+ base: functionMap,
6922
+ build: x => {
6923
+ Object.entries(crudConfigMap).forEach(([modelType, config]) => {
6924
+ const modelTypeSuffix = util.capitalizeFirstLetter(modelType);
6925
+ const {
6926
+ included: crudFunctionKeys,
6927
+ excluded: specifiedCallFunctionKeys
6928
+ } = util.separateValues(config, x => x.indexOf(':') === -1);
6929
+ const crudFunctions = new Set(crudFunctionKeys);
6930
+ const specifiedCallFunctionTuples = specifiedCallFunctionKeys.map(x => {
6931
+ const [crud, functionsSplit] = x.split(':', 2);
6932
+ const functions = functionsSplit.split(MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER);
6933
+ return [crud, functions];
6934
+ });
6935
+ // check that there isn't a repeat crud key configured, which disallowed configuration and would cause some functions to be ignored
6936
+ const encounteredCalls = new Set();
6937
+ function assertCallKeyNotEncountered(crud) {
6938
+ if (encounteredCalls.has(crud)) {
6939
+ throw new Error(`Cannot have multiple declarations of the same crud. Found repeat for crud: ${crud}`);
6940
+ } else {
6941
+ encounteredCalls.add(crud);
6942
+ }
6943
+ }
6944
+ crudFunctions.forEach(assertCallKeyNotEncountered);
6945
+ specifiedCallFunctionTuples.forEach(([crud]) => assertCallKeyNotEncountered(crud));
6946
+ // build and add the functions
6947
+ const specifierFunctions = new Map(specifiedCallFunctionTuples);
6948
+ function addCallFunctions(crud, fn, modelType) {
6949
+ let crudFns;
6950
+ if (crudFunctions.has(crud)) {
6951
+ crudFns = makeCallFunction(crud, fn, modelType);
6952
+ } else if (specifierFunctions.has(crud)) {
6953
+ crudFns = makeCallSpecifiers(crud, fn, modelType, specifierFunctions.get(crud));
6954
+ }
6955
+ if (crudFns) {
6956
+ modelTypeCalls[`${crud}${modelTypeSuffix}`] = crudFns;
6957
+ }
6958
+ }
6959
+ const modelTypeCalls = {};
6960
+ // add functions for each call type
6961
+ addCallFunctions('create', _callFn, modelType);
6962
+ addCallFunctions('read', _callFn, modelType);
6963
+ addCallFunctions('update', _callFn, modelType);
6964
+ addCallFunctions('delete', _callFn, modelType);
6965
+ // tslint:disable-next-line
6966
+ x[modelType] = modelTypeCalls;
6967
+ });
6968
+ }
6969
+ });
6970
+ return result;
6971
+ };
6972
+ }
6973
+ // MARK: Compat
6974
+ /**
6975
+ * @deprecated move to using callModelFirebaseFunctionMapFactory instead and the call configuration in general.
6976
+ *
6977
+ * This will be removed in the next release.
6978
+ *
6979
+ * @param configMap
6980
+ * @param crudConfigMap
6981
+ * @returns
6982
+ */
6847
6983
  function modelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
6848
6984
  const functionFactory = firebaseFunctionMapFactory(configMap);
6849
6985
  return functionsInstance => {
@@ -7831,6 +7967,7 @@ exports.AbstractFirestoreDocument = AbstractFirestoreDocument;
7831
7967
  exports.AbstractFirestoreDocumentDataAccessorWrapper = AbstractFirestoreDocumentDataAccessorWrapper;
7832
7968
  exports.AbstractFirestoreDocumentWithParent = AbstractFirestoreDocumentWithParent;
7833
7969
  exports.BASE_MODEL_STORAGE_FILE_PATH = BASE_MODEL_STORAGE_FILE_PATH;
7970
+ exports.CALL_MODEL_APP_FUNCTION_KEY = CALL_MODEL_APP_FUNCTION_KEY;
7834
7971
  exports.COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION = COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION;
7835
7972
  exports.CREATE_MODEL_APP_FUNCTION_KEY = CREATE_MODEL_APP_FUNCTION_KEY;
7836
7973
  exports.ContextGrantedModelRolesReaderInstance = ContextGrantedModelRolesReaderInstance;
@@ -7919,6 +8056,7 @@ exports.assignUnitedStatesAddressFunction = assignUnitedStatesAddressFunction;
7919
8056
  exports.assignWebsiteFileLinkFunction = assignWebsiteFileLinkFunction;
7920
8057
  exports.assignWebsiteLinkFunction = assignWebsiteLinkFunction;
7921
8058
  exports.buildFirebaseCollectionTypeModelTypeMap = buildFirebaseCollectionTypeModelTypeMap;
8059
+ exports.callModelFirebaseFunctionMapFactory = callModelFirebaseFunctionMapFactory;
7922
8060
  exports.childFirestoreModelKey = childFirestoreModelKey;
7923
8061
  exports.childFirestoreModelKeyPath = childFirestoreModelKeyPath;
7924
8062
  exports.childFirestoreModelKeys = childFirestoreModelKeys;
@@ -8130,10 +8268,15 @@ exports.modifyBeforeSetInterceptAccessorFactoryFunction = modifyBeforeSetInterce
8130
8268
  exports.newDocuments = newDocuments;
8131
8269
  exports.noStringFormatInStorageUploadOptionsError = noStringFormatInStorageUploadOptionsError;
8132
8270
  exports.offset = offset;
8271
+ exports.onCallCreateModelParams = onCallCreateModelParams;
8133
8272
  exports.onCallCreateModelResult = onCallCreateModelResult;
8134
8273
  exports.onCallCreateModelResultWithDocs = onCallCreateModelResultWithDocs;
8274
+ exports.onCallDeleteModelParams = onCallDeleteModelParams;
8135
8275
  exports.onCallDevelopmentParams = onCallDevelopmentParams;
8276
+ exports.onCallReadModelParams = onCallReadModelParams;
8136
8277
  exports.onCallTypedModelParams = onCallTypedModelParams;
8278
+ exports.onCallTypedModelParamsFunction = onCallTypedModelParamsFunction;
8279
+ exports.onCallUpdateModelParams = onCallUpdateModelParams;
8137
8280
  exports.optionalFirestoreArray = optionalFirestoreArray;
8138
8281
  exports.optionalFirestoreBoolean = optionalFirestoreBoolean;
8139
8282
  exports.optionalFirestoreDate = optionalFirestoreDate;
package/index.esm.js CHANGED
@@ -7556,44 +7556,95 @@ function lazyFirebaseFunctionsFactory(configMap) {
7556
7556
  };
7557
7557
  }
7558
7558
 
7559
+ /**
7560
+ * Set of known call types. The basic CRUD functions.
7561
+ */
7562
+
7563
+ /**
7564
+ * A call function type specifier.
7565
+ */
7566
+
7567
+ /**
7568
+ *
7569
+ */
7570
+
7571
+ /**
7572
+ * Creates a OnCallTypedModelParamsFunction
7573
+ *
7574
+ * @param call
7575
+ * @returns
7576
+ */
7577
+ function onCallTypedModelParamsFunction(call) {
7578
+ return (modelTypeInput, data, specifier) => {
7579
+ const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
7580
+ if (!modelType) {
7581
+ throw new Error('modelType is required.');
7582
+ }
7583
+ const result = {
7584
+ call,
7585
+ modelType,
7586
+ data
7587
+ };
7588
+ if (specifier != null) {
7589
+ result.specifier = specifier;
7590
+ }
7591
+ return result;
7592
+ };
7593
+ }
7594
+
7595
+ /**
7596
+ * Pre-configured OnCallTypedModelParamsFunctions for 'create'
7597
+ */
7598
+ const onCallCreateModelParams = onCallTypedModelParamsFunction('create');
7599
+
7600
+ /**
7601
+ * Pre-configured OnCallTypedModelParamsFunctions for 'read'
7602
+ */
7603
+ const onCallReadModelParams = onCallTypedModelParamsFunction('read');
7604
+
7605
+ /**
7606
+ * Pre-configured OnCallTypedModelParamsFunctions for 'update'
7607
+ */
7608
+ const onCallUpdateModelParams = onCallTypedModelParamsFunction('update');
7609
+
7610
+ /**
7611
+ * Pre-configured OnCallTypedModelParamsFunctions for 'delete'
7612
+ */
7613
+ const onCallDeleteModelParams = onCallTypedModelParamsFunction('delete');
7614
+
7559
7615
  /**
7560
7616
  * Creates a OnCallTypedModelParams
7561
7617
  *
7618
+ * @deprecated use onCallTypedModelParamsFunction instead.
7619
+ *
7562
7620
  * @param modelType
7563
7621
  * @param data
7564
7622
  * @returns
7565
7623
  */
7566
- function onCallTypedModelParams(modelTypeInput, data, specifier) {
7567
- const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
7568
- if (!modelType) {
7569
- throw new Error('modelType is required.');
7570
- }
7571
- const result = {
7572
- modelType,
7573
- data
7574
- };
7575
- if (specifier != null) {
7576
- result.specifier = specifier;
7577
- }
7578
- return result;
7624
+ function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
7625
+ return onCallTypedModelParamsFunction(call)(modelTypeInput, data, specifier);
7579
7626
  }
7580
7627
 
7581
7628
  /**
7582
- * Key used on the front-end and backend that refers to a specific function for creating models.
7629
+ * Key used on the front-end and backend that refers to the call function.
7583
7630
  */
7584
- const CREATE_MODEL_APP_FUNCTION_KEY = 'createModel';
7631
+ const CALL_MODEL_APP_FUNCTION_KEY = 'callModel';
7632
+
7585
7633
  /**
7586
- * Key used on the front-end and backend that refers to a specific function for reading models.
7634
+ * OnCallTypedModelParams for Create calls.
7587
7635
  */
7588
- const READ_MODEL_APP_FUNCTION_KEY = 'readModel';
7636
+
7589
7637
  /**
7590
- * Key used on the front-end and backend that refers to a specific function for updating models.
7638
+ * OnCallTypedModelParams for Read calls.
7591
7639
  */
7592
- const UPDATE_MODEL_APP_FUNCTION_KEY = 'updateModel';
7640
+
7593
7641
  /**
7594
- * Key used on the front-end and backend that refers to a specific function for deleting models.
7642
+ * OnCallTypedModelParams for Update calls.
7643
+ */
7644
+
7645
+ /**
7646
+ * OnCallTypedModelParams for Delete calls.
7595
7647
  */
7596
- const DELETE_MODEL_APP_FUNCTION_KEY = 'deleteModel';
7597
7648
 
7598
7649
  // MARK: Result
7599
7650
 
@@ -7606,6 +7657,35 @@ function onCallCreateModelResult(modelKeys) {
7606
7657
  };
7607
7658
  }
7608
7659
 
7660
+ // MARK: Compat
7661
+ /**
7662
+ * Key used on the front-end and backend that refers to a specific function for creating models.
7663
+ *
7664
+ * @deprecated Replaced by the callModel function.
7665
+ */
7666
+ const CREATE_MODEL_APP_FUNCTION_KEY = 'createModel';
7667
+
7668
+ /**
7669
+ * Key used on the front-end and backend that refers to a specific function for reading models.
7670
+ *
7671
+ * @deprecated Replaced by the callModel function.
7672
+ */
7673
+ const READ_MODEL_APP_FUNCTION_KEY = 'readModel';
7674
+
7675
+ /**
7676
+ * Key used on the front-end and backend that refers to a specific function for updating models.
7677
+ *
7678
+ * @deprecated Replaced by the callModel function.
7679
+ */
7680
+ const UPDATE_MODEL_APP_FUNCTION_KEY = 'updateModel';
7681
+
7682
+ /**
7683
+ * Key used on the front-end and backend that refers to a specific function for deleting models.
7684
+ *
7685
+ * @deprecated Replaced by the callModel function.
7686
+ */
7687
+ const DELETE_MODEL_APP_FUNCTION_KEY = 'deleteModel';
7688
+
7609
7689
  /**
7610
7690
  * Used to specify which function to direct requests to.
7611
7691
  */
@@ -7629,6 +7709,104 @@ const MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER = ',';
7629
7709
  * Used for building a FirebaseFunctionMap<M> for a specific Functions instance.
7630
7710
  */
7631
7711
 
7712
+ /**
7713
+ * Creates a ModelFirebaseFunctionMapFactory for the input config that targets the "callModel" Firebase function.
7714
+ *
7715
+ * @param configMap
7716
+ * @param crudConfigMap
7717
+ * @returns
7718
+ */
7719
+ function callModelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
7720
+ const functionFactory = firebaseFunctionMapFactory(configMap);
7721
+ return functionsInstance => {
7722
+ const functionMap = functionFactory(functionsInstance);
7723
+ const _callFn = cachedGetter(() => httpsCallable(functionsInstance, CALL_MODEL_APP_FUNCTION_KEY));
7724
+ function makeCallFunction(call, fn, modelType, specifier) {
7725
+ return mapHttpsCallable(fn(), {
7726
+ mapInput: data => onCallTypedModelParams(modelType, data, specifier, call)
7727
+ }, true);
7728
+ }
7729
+ function makeCallSpecifiers(call, fn, modelType, specifierKeys) {
7730
+ const modelTypeSuffix = capitalizeFirstLetter(modelType);
7731
+ const specifiers = {};
7732
+ specifierKeys.forEach(inputSpecifier => {
7733
+ const specifier = inputSpecifier === MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT ? '' : inputSpecifier;
7734
+ const specifierFn = makeCallFunction(call, fn, modelType, inputSpecifier);
7735
+ const fullSpecifierName = `${call}${modelTypeSuffix}${capitalizeFirstLetter(specifier)}`;
7736
+ specifiers[fullSpecifierName] = specifierFn;
7737
+ const shortSpecifierName = lowercaseFirstLetter(specifier) || call;
7738
+ specifiers[shortSpecifierName] = specifierFn;
7739
+ });
7740
+ return specifiers;
7741
+ }
7742
+ const result = build({
7743
+ base: functionMap,
7744
+ build: x => {
7745
+ Object.entries(crudConfigMap).forEach(([modelType, config]) => {
7746
+ const modelTypeSuffix = capitalizeFirstLetter(modelType);
7747
+ const {
7748
+ included: crudFunctionKeys,
7749
+ excluded: specifiedCallFunctionKeys
7750
+ } = separateValues(config, x => x.indexOf(':') === -1);
7751
+ const crudFunctions = new Set(crudFunctionKeys);
7752
+ const specifiedCallFunctionTuples = specifiedCallFunctionKeys.map(x => {
7753
+ const [crud, functionsSplit] = x.split(':', 2);
7754
+ const functions = functionsSplit.split(MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER);
7755
+ return [crud, functions];
7756
+ });
7757
+
7758
+ // check that there isn't a repeat crud key configured, which disallowed configuration and would cause some functions to be ignored
7759
+ const encounteredCalls = new Set();
7760
+ function assertCallKeyNotEncountered(crud) {
7761
+ if (encounteredCalls.has(crud)) {
7762
+ throw new Error(`Cannot have multiple declarations of the same crud. Found repeat for crud: ${crud}`);
7763
+ } else {
7764
+ encounteredCalls.add(crud);
7765
+ }
7766
+ }
7767
+ crudFunctions.forEach(assertCallKeyNotEncountered);
7768
+ specifiedCallFunctionTuples.forEach(([crud]) => assertCallKeyNotEncountered(crud));
7769
+
7770
+ // build and add the functions
7771
+ const specifierFunctions = new Map(specifiedCallFunctionTuples);
7772
+ function addCallFunctions(crud, fn, modelType) {
7773
+ let crudFns;
7774
+ if (crudFunctions.has(crud)) {
7775
+ crudFns = makeCallFunction(crud, fn, modelType);
7776
+ } else if (specifierFunctions.has(crud)) {
7777
+ crudFns = makeCallSpecifiers(crud, fn, modelType, specifierFunctions.get(crud));
7778
+ }
7779
+ if (crudFns) {
7780
+ modelTypeCalls[`${crud}${modelTypeSuffix}`] = crudFns;
7781
+ }
7782
+ }
7783
+ const modelTypeCalls = {};
7784
+
7785
+ // add functions for each call type
7786
+ addCallFunctions('create', _callFn, modelType);
7787
+ addCallFunctions('read', _callFn, modelType);
7788
+ addCallFunctions('update', _callFn, modelType);
7789
+ addCallFunctions('delete', _callFn, modelType);
7790
+
7791
+ // tslint:disable-next-line
7792
+ x[modelType] = modelTypeCalls;
7793
+ });
7794
+ }
7795
+ });
7796
+ return result;
7797
+ };
7798
+ }
7799
+
7800
+ // MARK: Compat
7801
+ /**
7802
+ * @deprecated move to using callModelFirebaseFunctionMapFactory instead and the call configuration in general.
7803
+ *
7804
+ * This will be removed in the next release.
7805
+ *
7806
+ * @param configMap
7807
+ * @param crudConfigMap
7808
+ * @returns
7809
+ */
7632
7810
  function modelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
7633
7811
  const functionFactory = firebaseFunctionMapFactory(configMap);
7634
7812
  return functionsInstance => {
@@ -8902,4 +9080,4 @@ function systemStateFirestoreCollection(firestoreContext, converters) {
8902
9080
  });
8903
9081
  }
8904
9082
 
8905
- export { AbstractFirestoreDocument, AbstractFirestoreDocumentDataAccessorWrapper, AbstractFirestoreDocumentWithParent, BASE_MODEL_STORAGE_FILE_PATH, COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION, CREATE_MODEL_APP_FUNCTION_KEY, ContextGrantedModelRolesReaderInstance, 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_QUERY_CHANGE_WATCHER_DELAY, DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER, DEFAULT_WEBSITE_LINK, DELETE_MODEL_APP_FUNCTION_KEY, 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_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, FirestoreItemPageIterationInstance, InferredTargetModelIdParams, InferredTargetModelParams, IsFirestoreModelId, 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, READ_MODEL_APP_FUNCTION_KEY, RUN_DEV_FUNCTION_APP_FUNCTION_KEY, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFunctionTypeEnum, SystemStateDocument, SystemStateFirestoreCollections, TargetModelIdParams, TargetModelParams, UPDATE_MODEL_APP_FUNCTION_KEY, addConstraintToBuilder, addOrReplaceLimitInConstraints, allChildDocumentsUnderParent, allChildDocumentsUnderParentPath, allChildDocumentsUnderRelativePath, asTopLevelFieldPath, asTopLevelFieldPaths, assertFirestoreUpdateHasData, assertStorageUploadOptionsStringFormat, assignDateCellRangeFunction, assignDateCellScheduleFunction, assignUnitedStatesAddressFunction, assignWebsiteFileLinkFunction, assignWebsiteLinkFunction, buildFirebaseCollectionTypeModelTypeMap, childFirestoreModelKey, childFirestoreModelKeyPath, childFirestoreModelKeys, clientFirebaseFirestoreContextFactory, clientFirebaseStorageContextFactory, contextGrantedModelRolesReader, contextGrantedModelRolesReaderDoesNotExistErrorMessage, contextGrantedModelRolesReaderPermissionErrorMessage, convertHttpsCallableErrorToReadableError, copyDocumentIdForUserRelatedModifierFunction, copyDocumentIdToFieldModifierFunction, copyUserRelatedDataAccessorFactoryFunction, copyUserRelatedDataModifierConfig, dataFromDocumentSnapshots, dataFromSnapshotStream, developmentFirebaseFunctionMapFactory, directDataHttpsCallable, documentData, documentDataFunction, documentDataWithIdAndKey, documentReferenceFromDocument, documentReferencesFromDocuments, documentReferencesFromSnapshot, endAt, endAtValue, endBefore, extendFirestoreCollectionWithSingleDocumentAccessor, filterConstraintsOfType, filterDisallowedFirestoreItemPageIteratorInputContraints, 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, firestoreClientIncrementUpdateToUpdateData, firestoreContextFactory, firestoreDate, firestoreDateCellRange, firestoreDateCellRangeArray, firestoreDateCellRangeAssignFn, firestoreDateCellSchedule, firestoreDateCellScheduleAssignFn, firestoreDencoderArray, firestoreDencoderMap, firestoreDencoderStringArray, firestoreDocumentAccessorContextExtension, firestoreDocumentAccessorFactory, firestoreDocumentLoader, 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, firestoreNumber, firestoreObjectArray, firestorePassThroughField, firestoreQueryConstraint, firestoreQueryConstraintFactory, firestoreQueryFactory, firestoreSingleDocumentAccessor, firestoreString, firestoreSubObject, firestoreTimezoneString, firestoreUID, firestoreUniqueArray, firestoreUniqueKeyedArray, firestoreUniqueStringArray, firestoreUnitedStatesAddress, firestoreUnitedStatesAddressAssignFn, firestoreUpdateWithNoDataError, firestoreWebsiteFileLink, firestoreWebsiteFileLinkAssignFn, firestoreWebsiteFileLinkEncodedArray, firestoreWebsiteFileLinkObjectArray, firestoreWebsiteLink, firestoreWebsiteLinkArray, firestoreWebsiteLinkAssignFn, flatFirestoreModelKey, getDataFromDocumentSnapshots, getDocumentSnapshotData, getDocumentSnapshotDataPair, getDocumentSnapshotDataPairs, getDocumentSnapshotDataTuples, getDocumentSnapshotPair, getDocumentSnapshotPairs, getDocumentSnapshots, getDocumentSnapshotsData, grantFullAccessIfAdmin, grantFullAccessIfAuthUserRelated, grantModelRolesIfAdmin, grantModelRolesIfAdminFunction, grantModelRolesIfAuthUserRelatedModelFunction, grantModelRolesIfFunction, grantModelRolesIfHasAuthRolesFactory, grantModelRolesIfHasAuthRolesFunction, grantModelRolesOnlyIfFunction, inContextFirebaseModelServiceFactory, inContextFirebaseModelsServiceFactory, incrementUpdateWithAccessorFunction, inferKeyFromTwoWayFlatFirestoreModelKey, interceptAccessorFactoryFunction, isAdminInFirebaseModelContext, isFirebaseStorageObjectNotFoundError, isFirestoreModelId, isFirestoreModelKey, isOwnerOfUserRelatedModelInFirebaseModelContext, iterateFirestoreDocumentSnapshotBatches, iterateFirestoreDocumentSnapshotCheckpoints, iterateFirestoreDocumentSnapshotPairBatches, iterateFirestoreDocumentSnapshotPairs, iterateFirestoreDocumentSnapshots, iterationQueryDocChangeWatcher, iterationQueryDocChangeWatcherChangeTypeForGroup, latestDataFromDocuments, latestSnapshotsFromDocuments, lazyFirebaseFunctionsFactory, limit, limitToLast, limitedFirestoreDocumentAccessorFactory, loadDocumentsForDocumentReferences, loadDocumentsForDocumentReferencesFromValues, loadDocumentsForIds, loadDocumentsForIdsFromValues, loadDocumentsForKeys, loadDocumentsForKeysFromValues, loadDocumentsForSnapshots, loadDocumentsForValues, makeDocuments, makeFirestoreCollection, makeFirestoreCollectionGroup, makeFirestoreCollectionWithParent, makeFirestoreItemPageIteratorDelegate, makeFirestoreQueryConstraintFunctionsDriver, makeRootSingleItemFirestoreCollection, makeSingleItemFirestoreCollection, mapDataFromSnapshot, mapHttpsCallable, modelFirebaseFunctionMapFactory, modelStorageSlashPathFactory, modifyBeforeSetInterceptAccessorFactoryFunction, newDocuments, noStringFormatInStorageUploadOptionsError, offset, onCallCreateModelResult, onCallCreateModelResultWithDocs, onCallDevelopmentParams, onCallTypedModelParams, optionalFirestoreArray, optionalFirestoreBoolean, optionalFirestoreDate, optionalFirestoreEnum, optionalFirestoreField, optionalFirestoreNumber, optionalFirestoreString, optionalFirestoreUID, optionalFirestoreUnitedStatesAddress, orderBy, orderByDocumentId, readFirestoreModelKey, replaceConstraints, selectFromFirebaseModelsService, separateConstraints, setIdAndKeyFromKeyIdRefOnDocumentData, setIdAndKeyFromSnapshotOnDocumentData, snapshotConverterFunctions, snapshotStreamDataForAccessor, snapshotStreamForAccessor, startAfter, startAt, startAtValue, storageListFilesResultFactory, storageListFilesResultHasNoNextError, storagePathFactory, streamFromOnSnapshot, systemStateCollectionReference, systemStateConverter, systemStateFirestoreCollection, systemStateIdentity, twoWayFlatFirestoreModelKey, unsupportedFirestoreDriverFunctionError, updateWithAccessorUpdateAndConverterFunction, useContextAuth, useContextAuthUid, useDocumentSnapshot, useDocumentSnapshotData, useFirebaseModelsService, where, whereDateIsAfter, whereDateIsAfterWithSort, whereDateIsBefore, whereDateIsBeforeWithSort, whereDateIsBetween, whereDateIsInRange, whereDateIsOnOrAfter, whereDateIsOnOrAfterWithSort, whereDateIsOnOrBefore, whereDateIsOnOrBeforeWithSort, whereDocumentId, whereStringHasRootIdentityModelKey, whereStringValueHasPrefix };
9083
+ export { AbstractFirestoreDocument, AbstractFirestoreDocumentDataAccessorWrapper, AbstractFirestoreDocumentWithParent, BASE_MODEL_STORAGE_FILE_PATH, CALL_MODEL_APP_FUNCTION_KEY, COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION, CREATE_MODEL_APP_FUNCTION_KEY, ContextGrantedModelRolesReaderInstance, 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_QUERY_CHANGE_WATCHER_DELAY, DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER, DEFAULT_WEBSITE_LINK, DELETE_MODEL_APP_FUNCTION_KEY, 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_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, FirestoreItemPageIterationInstance, InferredTargetModelIdParams, InferredTargetModelParams, IsFirestoreModelId, 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, READ_MODEL_APP_FUNCTION_KEY, RUN_DEV_FUNCTION_APP_FUNCTION_KEY, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFunctionTypeEnum, SystemStateDocument, SystemStateFirestoreCollections, TargetModelIdParams, TargetModelParams, UPDATE_MODEL_APP_FUNCTION_KEY, addConstraintToBuilder, addOrReplaceLimitInConstraints, allChildDocumentsUnderParent, allChildDocumentsUnderParentPath, allChildDocumentsUnderRelativePath, asTopLevelFieldPath, asTopLevelFieldPaths, assertFirestoreUpdateHasData, assertStorageUploadOptionsStringFormat, assignDateCellRangeFunction, assignDateCellScheduleFunction, assignUnitedStatesAddressFunction, assignWebsiteFileLinkFunction, assignWebsiteLinkFunction, buildFirebaseCollectionTypeModelTypeMap, callModelFirebaseFunctionMapFactory, childFirestoreModelKey, childFirestoreModelKeyPath, childFirestoreModelKeys, clientFirebaseFirestoreContextFactory, clientFirebaseStorageContextFactory, contextGrantedModelRolesReader, contextGrantedModelRolesReaderDoesNotExistErrorMessage, contextGrantedModelRolesReaderPermissionErrorMessage, convertHttpsCallableErrorToReadableError, copyDocumentIdForUserRelatedModifierFunction, copyDocumentIdToFieldModifierFunction, copyUserRelatedDataAccessorFactoryFunction, copyUserRelatedDataModifierConfig, dataFromDocumentSnapshots, dataFromSnapshotStream, developmentFirebaseFunctionMapFactory, directDataHttpsCallable, documentData, documentDataFunction, documentDataWithIdAndKey, documentReferenceFromDocument, documentReferencesFromDocuments, documentReferencesFromSnapshot, endAt, endAtValue, endBefore, extendFirestoreCollectionWithSingleDocumentAccessor, filterConstraintsOfType, filterDisallowedFirestoreItemPageIteratorInputContraints, 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, firestoreClientIncrementUpdateToUpdateData, firestoreContextFactory, firestoreDate, firestoreDateCellRange, firestoreDateCellRangeArray, firestoreDateCellRangeAssignFn, firestoreDateCellSchedule, firestoreDateCellScheduleAssignFn, firestoreDencoderArray, firestoreDencoderMap, firestoreDencoderStringArray, firestoreDocumentAccessorContextExtension, firestoreDocumentAccessorFactory, firestoreDocumentLoader, 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, firestoreNumber, firestoreObjectArray, firestorePassThroughField, firestoreQueryConstraint, firestoreQueryConstraintFactory, firestoreQueryFactory, firestoreSingleDocumentAccessor, firestoreString, firestoreSubObject, firestoreTimezoneString, firestoreUID, firestoreUniqueArray, firestoreUniqueKeyedArray, firestoreUniqueStringArray, firestoreUnitedStatesAddress, firestoreUnitedStatesAddressAssignFn, firestoreUpdateWithNoDataError, firestoreWebsiteFileLink, firestoreWebsiteFileLinkAssignFn, firestoreWebsiteFileLinkEncodedArray, firestoreWebsiteFileLinkObjectArray, firestoreWebsiteLink, firestoreWebsiteLinkArray, firestoreWebsiteLinkAssignFn, flatFirestoreModelKey, getDataFromDocumentSnapshots, getDocumentSnapshotData, getDocumentSnapshotDataPair, getDocumentSnapshotDataPairs, getDocumentSnapshotDataTuples, getDocumentSnapshotPair, getDocumentSnapshotPairs, getDocumentSnapshots, getDocumentSnapshotsData, grantFullAccessIfAdmin, grantFullAccessIfAuthUserRelated, grantModelRolesIfAdmin, grantModelRolesIfAdminFunction, grantModelRolesIfAuthUserRelatedModelFunction, grantModelRolesIfFunction, grantModelRolesIfHasAuthRolesFactory, grantModelRolesIfHasAuthRolesFunction, grantModelRolesOnlyIfFunction, inContextFirebaseModelServiceFactory, inContextFirebaseModelsServiceFactory, incrementUpdateWithAccessorFunction, inferKeyFromTwoWayFlatFirestoreModelKey, interceptAccessorFactoryFunction, isAdminInFirebaseModelContext, isFirebaseStorageObjectNotFoundError, isFirestoreModelId, isFirestoreModelKey, isOwnerOfUserRelatedModelInFirebaseModelContext, iterateFirestoreDocumentSnapshotBatches, iterateFirestoreDocumentSnapshotCheckpoints, iterateFirestoreDocumentSnapshotPairBatches, iterateFirestoreDocumentSnapshotPairs, iterateFirestoreDocumentSnapshots, iterationQueryDocChangeWatcher, iterationQueryDocChangeWatcherChangeTypeForGroup, latestDataFromDocuments, latestSnapshotsFromDocuments, lazyFirebaseFunctionsFactory, limit, limitToLast, limitedFirestoreDocumentAccessorFactory, loadDocumentsForDocumentReferences, loadDocumentsForDocumentReferencesFromValues, loadDocumentsForIds, loadDocumentsForIdsFromValues, loadDocumentsForKeys, loadDocumentsForKeysFromValues, loadDocumentsForSnapshots, loadDocumentsForValues, makeDocuments, makeFirestoreCollection, makeFirestoreCollectionGroup, makeFirestoreCollectionWithParent, makeFirestoreItemPageIteratorDelegate, makeFirestoreQueryConstraintFunctionsDriver, makeRootSingleItemFirestoreCollection, makeSingleItemFirestoreCollection, mapDataFromSnapshot, mapHttpsCallable, modelFirebaseFunctionMapFactory, modelStorageSlashPathFactory, modifyBeforeSetInterceptAccessorFactoryFunction, newDocuments, noStringFormatInStorageUploadOptionsError, offset, onCallCreateModelParams, onCallCreateModelResult, onCallCreateModelResultWithDocs, onCallDeleteModelParams, onCallDevelopmentParams, onCallReadModelParams, onCallTypedModelParams, onCallTypedModelParamsFunction, onCallUpdateModelParams, optionalFirestoreArray, optionalFirestoreBoolean, optionalFirestoreDate, optionalFirestoreEnum, optionalFirestoreField, optionalFirestoreNumber, optionalFirestoreString, optionalFirestoreUID, optionalFirestoreUnitedStatesAddress, orderBy, orderByDocumentId, readFirestoreModelKey, replaceConstraints, selectFromFirebaseModelsService, separateConstraints, setIdAndKeyFromKeyIdRefOnDocumentData, setIdAndKeyFromSnapshotOnDocumentData, snapshotConverterFunctions, snapshotStreamDataForAccessor, snapshotStreamForAccessor, startAfter, startAt, startAtValue, storageListFilesResultFactory, storageListFilesResultHasNoNextError, storagePathFactory, streamFromOnSnapshot, systemStateCollectionReference, systemStateConverter, systemStateFirestoreCollection, systemStateIdentity, twoWayFlatFirestoreModelKey, unsupportedFirestoreDriverFunctionError, updateWithAccessorUpdateAndConverterFunction, useContextAuth, useContextAuthUid, useDocumentSnapshot, useDocumentSnapshotData, useFirebaseModelsService, where, whereDateIsAfter, whereDateIsAfterWithSort, whereDateIsBefore, whereDateIsBeforeWithSort, whereDateIsBetween, whereDateIsInRange, whereDateIsOnOrAfter, whereDateIsOnOrAfterWithSort, whereDateIsOnOrBefore, whereDateIsOnOrBeforeWithSort, whereDocumentId, whereStringHasRootIdentityModelKey, whereStringValueHasPrefix };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "10.0.18",
3
+ "version": "10.0.20",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -4,8 +4,8 @@ import { type FullFirestoreQueryConstraintHandlersMapping } from './../../common
4
4
  import { type FirestoreQueryConstraintFunctionsDriver, type FirestoreQueryDriver } from '../../common/firestore/driver/query';
5
5
  import { type Query } from '../../common/firestore/types';
6
6
  export interface FirebaseFirestoreQueryBuilder {
7
- query: Query;
8
- constraints: QueryConstraint[];
7
+ readonly query: Query;
8
+ readonly constraints: QueryConstraint[];
9
9
  }
10
10
  export declare function addConstraintToBuilder(builder: FirebaseFirestoreQueryBuilder, constraint: ArrayOrValue<QueryConstraint>): FirebaseFirestoreQueryBuilder;
11
11
  export declare const FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING: FullFirestoreQueryConstraintHandlersMapping<FirebaseFirestoreQueryBuilder>;
@@ -8,7 +8,7 @@ export declare const FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY = "developmentFuncti
8
8
  * Base map of all development functions enabled by the server.
9
9
  */
10
10
  export type FirebaseDevelopmentFunctionTypeMap = {
11
- scheduledFunction: [ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFirebaseFunctionResult];
11
+ readonly scheduledFunction: [ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFirebaseFunctionResult];
12
12
  };
13
13
  /**
14
14
  * Base DevelopmentFirebaseFunctionMap for all development functions enabled by the server (via firebaseServerDevFunctions())
@@ -16,5 +16,5 @@ export type FirebaseDevelopmentFunctionTypeMap = {
16
16
  * Is used by dbx-firebase
17
17
  */
18
18
  export declare abstract class FirebaseDevelopmentFunctions {
19
- abstract scheduledFunction: FirebaseFunction<ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFirebaseFunctionResult>;
19
+ abstract readonly scheduledFunction: FirebaseFunction<ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFirebaseFunctionResult>;
20
20
  }
@@ -1,8 +1,8 @@
1
1
  import { type FactoryWithInput, type Maybe, type PromiseOrValue } from '@dereekb/util';
2
2
  import { type HttpsCallable } from 'firebase/functions';
3
3
  export interface MapHttpsCallable<I, O, A, B> {
4
- mapInput?: FactoryWithInput<PromiseOrValue<A>, Maybe<I>>;
5
- mapOutput?: FactoryWithInput<PromiseOrValue<O>, Maybe<B>>;
4
+ readonly mapInput?: FactoryWithInput<PromiseOrValue<A>, Maybe<I>>;
5
+ readonly mapOutput?: FactoryWithInput<PromiseOrValue<O>, Maybe<B>>;
6
6
  }
7
7
  /**
8
8
  * Maps input and output values when using HttpsCallable.
@@ -14,13 +14,13 @@ export type FirebaseFunction<I = unknown, O = unknown> = (input: I) => Promise<O
14
14
  * Type with keys corresponding to functions on the corresponding server for a client.
15
15
  */
16
16
  export type FirebaseFunctionTypeMap = {
17
- [key: FirebaseFunctionKey]: FirebaseFunctionType;
17
+ readonly [key: FirebaseFunctionKey]: FirebaseFunctionType;
18
18
  };
19
19
  /**
20
20
  * A FirebaseFunction map. Its types are relative to a FirebaseFunctionTypeMap.
21
21
  */
22
22
  export type FirebaseFunctionMap<M extends FirebaseFunctionTypeMap> = {
23
- [K in keyof M]: FirebaseFunctionMapFunction<M, K>;
23
+ readonly [K in keyof M]: FirebaseFunctionMapFunction<M, K>;
24
24
  };
25
25
  /**
26
26
  * Typings for a function within a FirebaseFunctionMap.
@@ -2,10 +2,10 @@ import { type ClassLikeType, type Getter, type Maybe } from '@dereekb/util';
2
2
  import { type Functions, type HttpsCallableOptions } from 'firebase/functions';
3
3
  import { type FirebaseFunctionMap, type FirebaseFunctionTypeMap } from './function';
4
4
  export interface FirebaseFunctionTypeConfig {
5
- options?: HttpsCallableOptions;
5
+ readonly options?: HttpsCallableOptions;
6
6
  }
7
7
  export type FirebaseFunctionTypeConfigMap<M extends FirebaseFunctionTypeMap> = {
8
- [K in keyof M]: Maybe<FirebaseFunctionTypeConfig>;
8
+ readonly [K in keyof M]: Maybe<FirebaseFunctionTypeConfig>;
9
9
  };
10
10
  /**
11
11
  * Used for building a FirebaseFunctionMap<M> for a specific Functions instance.
@@ -21,10 +21,10 @@ export type FirebaseFunctionGetter<T> = Getter<T> & {
21
21
  * Map of all firebase functions in the app.
22
22
  */
23
23
  export type FirebaseFunctionsMap = {
24
- [key: FirebaseFunctionMapKey]: FirebaseFunctionTypeMap;
24
+ readonly [key: FirebaseFunctionMapKey]: FirebaseFunctionTypeMap;
25
25
  };
26
26
  export type FirebaseFunctionsConfigMap<M extends FirebaseFunctionsMap> = {
27
- [K in keyof M]: FirebaseFunctionsConfigMapEntry<M[K]>;
27
+ readonly [K in keyof M]: FirebaseFunctionsConfigMapEntry<M[K]>;
28
28
  };
29
29
  export type FirebaseFunctionsConfigMapEntry<M extends FirebaseFunctionTypeMap> = [ClassLikeType, FirebaseFunctionMapFactory<M>];
30
30
  /**
@@ -35,6 +35,6 @@ export type LazyFirebaseFunctionsFactory<M extends FirebaseFunctionsMap> = (func
35
35
  * Map of FirebaseFunctionGetter values that are lazy-loaded via the getter.
36
36
  */
37
37
  export type LazyFirebaseFunctions<M extends FirebaseFunctionsMap> = {
38
- [K in keyof M]: FirebaseFunctionGetter<FirebaseFunctionMap<M[K]>>;
38
+ readonly [K in keyof M]: FirebaseFunctionGetter<FirebaseFunctionMap<M[K]>>;
39
39
  };
40
40
  export declare function lazyFirebaseFunctionsFactory<M extends FirebaseFunctionsMap, C extends FirebaseFunctionsConfigMap<M> = FirebaseFunctionsConfigMap<M>>(configMap: C): LazyFirebaseFunctionsFactory<M>;