@dereekb/firebase 10.1.30 → 11.0.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.
- package/index.cjs.js +1040 -723
- package/index.esm.js +93 -163
- package/package.json +1 -1
- package/src/lib/client/firestore/driver.accessor.batch.d.ts +2 -2
- package/src/lib/client/firestore/driver.accessor.transaction.d.ts +1 -1
- package/src/lib/client/function/model.function.factory.d.ts +0 -10
- package/src/lib/common/firestore/collection/collection.d.ts +6 -0
- package/src/lib/common/firestore/query/query.iterate.d.ts +17 -2
- package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +5 -9
- package/src/lib/common/model/function.d.ts +15 -37
- package/src/lib/common/model/model/model.param.d.ts +5 -5
- package/src/lib/common/model/model/model.validator.d.ts +4 -0
- package/test/CHANGELOG.md +23 -0
- package/test/package.json +1 -1
- package/test/src/lib/client/firebase.js +36 -21
- package/test/src/lib/client/firebase.js.map +1 -1
- package/test/src/lib/common/firebase.instance.js +2 -0
- package/test/src/lib/common/firebase.instance.js.map +1 -1
- package/test/src/lib/common/firestore/firestore.instance.js +1 -0
- package/test/src/lib/common/firestore/firestore.instance.js.map +1 -1
- package/test/src/lib/common/firestore/firestore.js +18 -10
- package/test/src/lib/common/firestore/firestore.js.map +1 -1
- package/test/src/lib/common/firestore/test.driver.accessor.js +273 -277
- package/test/src/lib/common/firestore/test.driver.accessor.js.map +1 -1
- package/test/src/lib/common/firestore/test.driver.query.js +411 -312
- package/test/src/lib/common/firestore/test.driver.query.js.map +1 -1
- package/test/src/lib/common/firestore/test.iterator.js +6 -7
- package/test/src/lib/common/firestore/test.iterator.js.map +1 -1
- package/test/src/lib/common/mock/mock.item.collection.fixture.d.ts +2 -1
- package/test/src/lib/common/mock/mock.item.collection.fixture.js +4 -2
- package/test/src/lib/common/mock/mock.item.collection.fixture.js.map +1 -1
- package/test/src/lib/common/mock/mock.item.service.js +6 -11
- package/test/src/lib/common/mock/mock.item.service.js.map +1 -1
- package/test/src/lib/common/mock/mock.item.storage.fixture.js +2 -1
- package/test/src/lib/common/mock/mock.item.storage.fixture.js.map +1 -1
- package/test/src/lib/common/storage/storage.instance.js +1 -0
- package/test/src/lib/common/storage/storage.instance.js.map +1 -1
- package/test/src/lib/common/storage/storage.js +10 -3
- package/test/src/lib/common/storage/storage.js.map +1 -1
- package/test/src/lib/common/storage/test.driver.accessor.js +132 -133
- package/test/src/lib/common/storage/test.driver.accessor.js.map +1 -1
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { increment, 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, filterMaybeValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyValues, 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, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction,
|
|
2
|
+
import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, wrapUseAsyncFunction, makeWithFactory, performMakeLoop, runAsyncTasksForValues, filterMaybeValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyValues, 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, groupValues, forEachInIterable, stringContains, arrayToObject, takeFront, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString } from '@dereekb/util';
|
|
3
3
|
import { filterMaybe, lazyFrom, itemAccumulator, ItemPageIterator, MappedPageItemIterationInstance } from '@dereekb/rxjs';
|
|
4
4
|
import { from, map, combineLatest, shareReplay, of, exhaustMap, Observable, switchMap, timer, skip } from 'rxjs';
|
|
5
5
|
import { UNKNOWN_WEBSITE_LINK_TYPE, decodeWebsiteLinkEncodedDataToWebsiteFileLink, encodeWebsiteFileLinkToWebsiteLinkEncodedData, AbstractModelPermissionService, grantedRoleMapReader, noAccessRoleMap, fullAccessRoleMap } from '@dereekb/model';
|
|
@@ -4393,15 +4393,28 @@ function firestoreFieldConfigToModelMapFunctionsRef(config) {
|
|
|
4393
4393
|
function firestoreObjectArray(config) {
|
|
4394
4394
|
var _objectField, _config$default9;
|
|
4395
4395
|
const {
|
|
4396
|
-
filterUnique: inputFilterUnique
|
|
4396
|
+
filterUnique: inputFilterUnique,
|
|
4397
|
+
filter: filterFn
|
|
4397
4398
|
} = config;
|
|
4398
|
-
const filterUnique = inputFilterUnique != null ? inputFilterUnique : MAP_IDENTITY;
|
|
4399
4399
|
const objectField = (_objectField = config.objectField) != null ? _objectField : firestoreFieldConfigToModelMapFunctionsRef(config.firestoreField);
|
|
4400
4400
|
const sortFn = sortValuesFunctionOrMapIdentityWithSortRef(config);
|
|
4401
4401
|
const {
|
|
4402
4402
|
from,
|
|
4403
4403
|
to: baseTo
|
|
4404
4404
|
} = toModelMapFunctions(objectField);
|
|
4405
|
+
let performFiltering;
|
|
4406
|
+
if (inputFilterUnique != null ? inputFilterUnique : filterFn) {
|
|
4407
|
+
const filterUnique = inputFilterUnique != null ? inputFilterUnique : MAP_IDENTITY;
|
|
4408
|
+
performFiltering = x => {
|
|
4409
|
+
let result = filterUnique(x);
|
|
4410
|
+
if (filterFn) {
|
|
4411
|
+
result = result.filter(filterFn);
|
|
4412
|
+
}
|
|
4413
|
+
return result;
|
|
4414
|
+
};
|
|
4415
|
+
} else {
|
|
4416
|
+
performFiltering = MAP_IDENTITY;
|
|
4417
|
+
}
|
|
4405
4418
|
const to = x => {
|
|
4406
4419
|
// remove null/undefined values from each field when converting to in order to mirror firestore usage (undefined is treated like null)
|
|
4407
4420
|
const base = baseTo(x);
|
|
@@ -4411,9 +4424,9 @@ function firestoreObjectArray(config) {
|
|
|
4411
4424
|
return firestoreField({
|
|
4412
4425
|
default: (_config$default9 = config.default) != null ? _config$default9 : () => [],
|
|
4413
4426
|
defaultBeforeSave: config.defaultBeforeSave,
|
|
4414
|
-
fromData: input => sortFn(
|
|
4427
|
+
fromData: input => sortFn(performFiltering(input.map(x => from(x))), false),
|
|
4415
4428
|
// map then filter then sort
|
|
4416
|
-
toData: input => filterMaybeValues(sortFn(
|
|
4429
|
+
toData: input => filterMaybeValues(sortFn(performFiltering(input), true)).map(x => to(x)) // filter then sort then map
|
|
4417
4430
|
});
|
|
4418
4431
|
}
|
|
4419
4432
|
|
|
@@ -4687,15 +4700,6 @@ function firestoreBitwiseObjectMap(config) {
|
|
|
4687
4700
|
}));
|
|
4688
4701
|
}
|
|
4689
4702
|
|
|
4690
|
-
// MARK: Compat
|
|
4691
|
-
/**
|
|
4692
|
-
* @deprecated use TransformStringFunctionConfigInput instead.
|
|
4693
|
-
*/
|
|
4694
|
-
|
|
4695
|
-
/**
|
|
4696
|
-
* @deprecated use TransformNumberFunctionConfigInput instead.
|
|
4697
|
-
*/
|
|
4698
|
-
|
|
4699
4703
|
function unsupportedFirestoreDriverFunctionError(message) {
|
|
4700
4704
|
throw new Error(message != null ? message : 'This function is not supported by this Firestore driver.');
|
|
4701
4705
|
}
|
|
@@ -5243,7 +5247,7 @@ function makeFirestoreItemPageIteratorDelegate() {
|
|
|
5243
5247
|
} = filter != null ? filter : {};
|
|
5244
5248
|
return prevQueryResult$.pipe(exhaustMap(prevResult => {
|
|
5245
5249
|
if ((prevResult == null ? void 0 : prevResult.snapshot.empty) === true) {
|
|
5246
|
-
// TODO: Shouldn't happen. Remove this later.
|
|
5250
|
+
// TODO(REMOVE): Shouldn't happen. Remove this later.
|
|
5247
5251
|
return of({
|
|
5248
5252
|
end: true
|
|
5249
5253
|
});
|
|
@@ -5563,6 +5567,24 @@ async function iterateFirestoreDocumentSnapshotBatches(config) {
|
|
|
5563
5567
|
* Config for iterateFirestoreDocumentSnapshotCheckpoints().
|
|
5564
5568
|
*/
|
|
5565
5569
|
|
|
5570
|
+
/**
|
|
5571
|
+
* Filter function used to filter out snapshots.
|
|
5572
|
+
*
|
|
5573
|
+
* @param snapshot
|
|
5574
|
+
* @returns
|
|
5575
|
+
*/
|
|
5576
|
+
|
|
5577
|
+
/**
|
|
5578
|
+
* Creates a IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction that filters out any repeat documents.
|
|
5579
|
+
*
|
|
5580
|
+
* Repeat documents can occur in cases where the document is updated and the query matches it again for a different reason.
|
|
5581
|
+
*
|
|
5582
|
+
* @param readKeyFunction
|
|
5583
|
+
*/
|
|
5584
|
+
function filterRepeatCheckpointSnapshots(readKeyFunction = x => x.id) {
|
|
5585
|
+
const allowOnceFilter = allowValueOnceFilter(readKeyFunction);
|
|
5586
|
+
return async snapshots => snapshots.filter(allowOnceFilter);
|
|
5587
|
+
}
|
|
5566
5588
|
/**
|
|
5567
5589
|
* Iterates through the results of a Firestore query in several batches.
|
|
5568
5590
|
*
|
|
@@ -6836,6 +6858,15 @@ function isFirestoreModelKey(input) {
|
|
|
6836
6858
|
return FIRESTORE_MODEL_KEY_REGEX.test(input);
|
|
6837
6859
|
}
|
|
6838
6860
|
|
|
6861
|
+
/**
|
|
6862
|
+
* Returns true if the input string is a FirestoreModelId.
|
|
6863
|
+
*
|
|
6864
|
+
* @param input
|
|
6865
|
+
*/
|
|
6866
|
+
function isFirestoreModelIdOrKey(input) {
|
|
6867
|
+
return stringContains(input, '/') ? FIRESTORE_MODEL_KEY_REGEX.test(input) : FIRESTORE_MODEL_ID_REGEX.test(input);
|
|
6868
|
+
}
|
|
6869
|
+
|
|
6839
6870
|
/**
|
|
6840
6871
|
* A part of a FirestoreModelKey.
|
|
6841
6872
|
*/
|
|
@@ -7228,7 +7259,7 @@ function makeFirestoreCollectionGroup(config) {
|
|
|
7228
7259
|
function makeFirestoreCollectionWithParent(config) {
|
|
7229
7260
|
const result = makeFirestoreCollection(config);
|
|
7230
7261
|
result.parent = config.parent;
|
|
7231
|
-
//
|
|
7262
|
+
// TODO: consider throwing an exception if parent is not provided.
|
|
7232
7263
|
return result;
|
|
7233
7264
|
}
|
|
7234
7265
|
|
|
@@ -7571,6 +7602,7 @@ class WriteBatchFirestoreDocumentContext {
|
|
|
7571
7602
|
constructor(batch) {
|
|
7572
7603
|
this.batch = batch;
|
|
7573
7604
|
this.contextType = FirestoreDocumentContextType.BATCH;
|
|
7605
|
+
this.accessorFactory = void 0;
|
|
7574
7606
|
this.accessorFactory = writeBatchAccessorFactory(this.batch);
|
|
7575
7607
|
}
|
|
7576
7608
|
}
|
|
@@ -7638,6 +7670,7 @@ class TransactionFirestoreDocumentContext {
|
|
|
7638
7670
|
constructor(transaction) {
|
|
7639
7671
|
this.transaction = transaction;
|
|
7640
7672
|
this.contextType = FirestoreDocumentContextType.TRANSACTION;
|
|
7673
|
+
this.accessorFactory = void 0;
|
|
7641
7674
|
this.accessorFactory = transactionAccessorFactory(this.transaction);
|
|
7642
7675
|
}
|
|
7643
7676
|
}
|
|
@@ -7887,6 +7920,21 @@ function onCallTypedModelParamsFunction(call) {
|
|
|
7887
7920
|
};
|
|
7888
7921
|
}
|
|
7889
7922
|
|
|
7923
|
+
/**
|
|
7924
|
+
* Creates OnCallTypedModelParams for the input.
|
|
7925
|
+
*
|
|
7926
|
+
* Convenience function for calling onCallTypedModelParamsFunction and executing it with the input.
|
|
7927
|
+
*
|
|
7928
|
+
* @deprecated Move towards using onCallTypedModelParamsFunction directly with the call type instead of using this function. Will not be removed in the future.
|
|
7929
|
+
*
|
|
7930
|
+
* @param modelType
|
|
7931
|
+
* @param data
|
|
7932
|
+
* @returns
|
|
7933
|
+
*/
|
|
7934
|
+
function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
|
|
7935
|
+
return onCallTypedModelParamsFunction(call)(modelTypeInput, data, specifier);
|
|
7936
|
+
}
|
|
7937
|
+
|
|
7890
7938
|
/**
|
|
7891
7939
|
* Pre-configured OnCallTypedModelParamsFunctions for 'create'
|
|
7892
7940
|
*/
|
|
@@ -7907,19 +7955,6 @@ const onCallUpdateModelParams = onCallTypedModelParamsFunction('update');
|
|
|
7907
7955
|
*/
|
|
7908
7956
|
const onCallDeleteModelParams = onCallTypedModelParamsFunction('delete');
|
|
7909
7957
|
|
|
7910
|
-
/**
|
|
7911
|
-
* Creates a OnCallTypedModelParams
|
|
7912
|
-
*
|
|
7913
|
-
* @deprecated use onCallTypedModelParamsFunction instead.
|
|
7914
|
-
*
|
|
7915
|
-
* @param modelType
|
|
7916
|
-
* @param data
|
|
7917
|
-
* @returns
|
|
7918
|
-
*/
|
|
7919
|
-
function onCallTypedModelParams(modelTypeInput, data, specifier, call) {
|
|
7920
|
-
return onCallTypedModelParamsFunction(call)(modelTypeInput, data, specifier);
|
|
7921
|
-
}
|
|
7922
|
-
|
|
7923
7958
|
/**
|
|
7924
7959
|
* Key used on the front-end and backend that refers to the call function.
|
|
7925
7960
|
*/
|
|
@@ -7952,35 +7987,6 @@ function onCallCreateModelResult(modelKeys) {
|
|
|
7952
7987
|
};
|
|
7953
7988
|
}
|
|
7954
7989
|
|
|
7955
|
-
// MARK: Compat
|
|
7956
|
-
/**
|
|
7957
|
-
* Key used on the front-end and backend that refers to a specific function for creating models.
|
|
7958
|
-
*
|
|
7959
|
-
* @deprecated Replaced by the callModel function.
|
|
7960
|
-
*/
|
|
7961
|
-
const CREATE_MODEL_APP_FUNCTION_KEY = 'createModel';
|
|
7962
|
-
|
|
7963
|
-
/**
|
|
7964
|
-
* Key used on the front-end and backend that refers to a specific function for reading models.
|
|
7965
|
-
*
|
|
7966
|
-
* @deprecated Replaced by the callModel function.
|
|
7967
|
-
*/
|
|
7968
|
-
const READ_MODEL_APP_FUNCTION_KEY = 'readModel';
|
|
7969
|
-
|
|
7970
|
-
/**
|
|
7971
|
-
* Key used on the front-end and backend that refers to a specific function for updating models.
|
|
7972
|
-
*
|
|
7973
|
-
* @deprecated Replaced by the callModel function.
|
|
7974
|
-
*/
|
|
7975
|
-
const UPDATE_MODEL_APP_FUNCTION_KEY = 'updateModel';
|
|
7976
|
-
|
|
7977
|
-
/**
|
|
7978
|
-
* Key used on the front-end and backend that refers to a specific function for deleting models.
|
|
7979
|
-
*
|
|
7980
|
-
* @deprecated Replaced by the callModel function.
|
|
7981
|
-
*/
|
|
7982
|
-
const DELETE_MODEL_APP_FUNCTION_KEY = 'deleteModel';
|
|
7983
|
-
|
|
7984
7990
|
/**
|
|
7985
7991
|
* Used to specify which function to direct requests to.
|
|
7986
7992
|
*/
|
|
@@ -7989,8 +7995,6 @@ const DELETE_MODEL_APP_FUNCTION_KEY = 'deleteModel';
|
|
|
7989
7995
|
* Provides a reference to a ModelFirebaseCrudFunctionSpecifier if available.
|
|
7990
7996
|
*/
|
|
7991
7997
|
|
|
7992
|
-
// TODO: Typings here could potentially be improved to always enforce _ being provided if the passed object is...
|
|
7993
|
-
|
|
7994
7998
|
const MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT = '_';
|
|
7995
7999
|
const MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER = ',';
|
|
7996
8000
|
|
|
@@ -8018,7 +8022,7 @@ function callModelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
|
|
|
8018
8022
|
const _callFn = cachedGetter(() => httpsCallable(functionsInstance, CALL_MODEL_APP_FUNCTION_KEY));
|
|
8019
8023
|
function makeCallFunction(call, fn, modelType, specifier) {
|
|
8020
8024
|
return mapHttpsCallable(fn(), {
|
|
8021
|
-
mapInput: data =>
|
|
8025
|
+
mapInput: data => onCallTypedModelParamsFunction(call)(modelType, data, specifier)
|
|
8022
8026
|
}, true);
|
|
8023
8027
|
}
|
|
8024
8028
|
function makeCallSpecifiers(call, fn, modelType, specifierKeys) {
|
|
@@ -8092,98 +8096,6 @@ function callModelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
|
|
|
8092
8096
|
};
|
|
8093
8097
|
}
|
|
8094
8098
|
|
|
8095
|
-
// MARK: Compat
|
|
8096
|
-
/**
|
|
8097
|
-
* @deprecated move to using callModelFirebaseFunctionMapFactory instead and the call configuration in general.
|
|
8098
|
-
*
|
|
8099
|
-
* This will be removed in the next release.
|
|
8100
|
-
*
|
|
8101
|
-
* @param configMap
|
|
8102
|
-
* @param crudConfigMap
|
|
8103
|
-
* @returns
|
|
8104
|
-
*/
|
|
8105
|
-
function modelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
|
|
8106
|
-
const functionFactory = firebaseFunctionMapFactory(configMap);
|
|
8107
|
-
return functionsInstance => {
|
|
8108
|
-
const functionMap = functionFactory(functionsInstance);
|
|
8109
|
-
const _readFn = cachedGetter(() => httpsCallable(functionsInstance, READ_MODEL_APP_FUNCTION_KEY));
|
|
8110
|
-
const _createFn = cachedGetter(() => httpsCallable(functionsInstance, CREATE_MODEL_APP_FUNCTION_KEY));
|
|
8111
|
-
const _updateFn = cachedGetter(() => httpsCallable(functionsInstance, UPDATE_MODEL_APP_FUNCTION_KEY));
|
|
8112
|
-
const _deleteFn = cachedGetter(() => httpsCallable(functionsInstance, DELETE_MODEL_APP_FUNCTION_KEY));
|
|
8113
|
-
function makeCrudFunction(fn, modelType, specifier) {
|
|
8114
|
-
return mapHttpsCallable(fn(), {
|
|
8115
|
-
mapInput: data => onCallTypedModelParams(modelType, data, specifier)
|
|
8116
|
-
}, true);
|
|
8117
|
-
}
|
|
8118
|
-
function makeCrudSpecifiers(crud, fn, modelType, specifierKeys) {
|
|
8119
|
-
const modelTypeSuffix = capitalizeFirstLetter(modelType);
|
|
8120
|
-
const specifiers = {};
|
|
8121
|
-
specifierKeys.forEach(inputSpecifier => {
|
|
8122
|
-
const specifier = inputSpecifier === MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT ? '' : inputSpecifier;
|
|
8123
|
-
const specifierFn = makeCrudFunction(fn, modelType, inputSpecifier);
|
|
8124
|
-
const fullSpecifierName = `${crud}${modelTypeSuffix}${capitalizeFirstLetter(specifier)}`;
|
|
8125
|
-
specifiers[fullSpecifierName] = specifierFn;
|
|
8126
|
-
const shortSpecifierName = lowercaseFirstLetter(specifier) || crud;
|
|
8127
|
-
specifiers[shortSpecifierName] = specifierFn;
|
|
8128
|
-
});
|
|
8129
|
-
return specifiers;
|
|
8130
|
-
}
|
|
8131
|
-
const result = build({
|
|
8132
|
-
base: functionMap,
|
|
8133
|
-
build: x => {
|
|
8134
|
-
Object.entries(crudConfigMap).forEach(([modelType, config]) => {
|
|
8135
|
-
const modelTypeSuffix = capitalizeFirstLetter(modelType);
|
|
8136
|
-
const {
|
|
8137
|
-
included: crudFunctionKeys,
|
|
8138
|
-
excluded: specifiedCrudFunctionKeys
|
|
8139
|
-
} = separateValues(config, x => x.indexOf(':') === -1);
|
|
8140
|
-
const crudFunctions = new Set(crudFunctionKeys);
|
|
8141
|
-
const specifiedCrudFunctionTuples = specifiedCrudFunctionKeys.map(x => {
|
|
8142
|
-
const [crud, functionsSplit] = x.split(':', 2);
|
|
8143
|
-
const functions = functionsSplit.split(MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER);
|
|
8144
|
-
return [crud, functions];
|
|
8145
|
-
});
|
|
8146
|
-
|
|
8147
|
-
// check that there isn't a repeat crud key configured, which disallowed configuration and would cause some functions to be ignored
|
|
8148
|
-
const encounteredCruds = new Set();
|
|
8149
|
-
function assertCrudKeyNotEncountered(crud) {
|
|
8150
|
-
if (encounteredCruds.has(crud)) {
|
|
8151
|
-
throw new Error(`Cannot have multiple declarations of the same crud. Found repeat for crud: ${crud}`);
|
|
8152
|
-
} else {
|
|
8153
|
-
encounteredCruds.add(crud);
|
|
8154
|
-
}
|
|
8155
|
-
}
|
|
8156
|
-
crudFunctions.forEach(assertCrudKeyNotEncountered);
|
|
8157
|
-
specifiedCrudFunctionTuples.forEach(([crud]) => assertCrudKeyNotEncountered(crud));
|
|
8158
|
-
|
|
8159
|
-
// build and add the functions
|
|
8160
|
-
const specifierFunctions = new Map(specifiedCrudFunctionTuples);
|
|
8161
|
-
function addFunctions(crud, fn, modelType) {
|
|
8162
|
-
let crudFns;
|
|
8163
|
-
if (crudFunctions.has(crud)) {
|
|
8164
|
-
crudFns = makeCrudFunction(fn, modelType);
|
|
8165
|
-
} else if (specifierFunctions.has(crud)) {
|
|
8166
|
-
crudFns = makeCrudSpecifiers(crud, fn, modelType, specifierFunctions.get(crud));
|
|
8167
|
-
}
|
|
8168
|
-
if (crudFns) {
|
|
8169
|
-
modelTypeCruds[`${crud}${modelTypeSuffix}`] = crudFns;
|
|
8170
|
-
}
|
|
8171
|
-
}
|
|
8172
|
-
const modelTypeCruds = {};
|
|
8173
|
-
addFunctions('create', _createFn, modelType);
|
|
8174
|
-
addFunctions('read', _readFn, modelType);
|
|
8175
|
-
addFunctions('update', _updateFn, modelType);
|
|
8176
|
-
addFunctions('delete', _deleteFn, modelType);
|
|
8177
|
-
|
|
8178
|
-
// tslint:disable-next-line
|
|
8179
|
-
x[modelType] = modelTypeCruds;
|
|
8180
|
-
});
|
|
8181
|
-
}
|
|
8182
|
-
});
|
|
8183
|
-
return result;
|
|
8184
|
-
};
|
|
8185
|
-
}
|
|
8186
|
-
|
|
8187
8099
|
// MARK: Function
|
|
8188
8100
|
/**
|
|
8189
8101
|
* Used to specify which function to direct requests to.
|
|
@@ -8503,7 +8415,7 @@ let ScheduledFunctionDevelopmentFirebaseFunctionParams = (_dec$1 = Expose(), _de
|
|
|
8503
8415
|
class ScheduledFunctionDevelopmentFirebaseFunctionListEntry {
|
|
8504
8416
|
constructor() {
|
|
8505
8417
|
this.name = void 0;
|
|
8506
|
-
} // TODO: Add priority to use for choosing execution order.
|
|
8418
|
+
} // TODO(FUTURE): Add priority to use for choosing execution order, probably with the move to v2 scheduled functions.
|
|
8507
8419
|
}
|
|
8508
8420
|
/**
|
|
8509
8421
|
* Key used on the front-end and backend that refers to the specifier for the scheduled functions access.
|
|
@@ -8570,25 +8482,43 @@ function IsFirestoreModelId(validationOptions) {
|
|
|
8570
8482
|
};
|
|
8571
8483
|
}
|
|
8572
8484
|
|
|
8485
|
+
/**
|
|
8486
|
+
* isFirestoreModelIdOrKey validator
|
|
8487
|
+
*/
|
|
8488
|
+
function IsFirestoreModelIdOrKey(validationOptions) {
|
|
8489
|
+
return function (object, propertyName) {
|
|
8490
|
+
registerDecorator({
|
|
8491
|
+
name: 'isFirestoreModelIdOrKey',
|
|
8492
|
+
target: object.constructor,
|
|
8493
|
+
propertyName: propertyName,
|
|
8494
|
+
options: validationOptions,
|
|
8495
|
+
validator: {
|
|
8496
|
+
validate: isFirestoreModelIdOrKey,
|
|
8497
|
+
defaultMessage: buildMessage((eachPrefix, args) => eachPrefix + `$property value of "${args == null ? void 0 : args.value}" is not a FirestoreModelId or FirestoreModelKey.`, validationOptions)
|
|
8498
|
+
}
|
|
8499
|
+
});
|
|
8500
|
+
};
|
|
8501
|
+
}
|
|
8502
|
+
|
|
8573
8503
|
var _dec, _dec2, _dec3, _dec4, _class, _descriptor, _dec5, _dec6, _dec7, _dec8, _dec9, _class2, _descriptor2, _dec10, _dec11, _dec12, _dec13, _class3, _descriptor3, _dec14, _dec15, _dec16, _dec17, _dec18, _class4, _descriptor4;
|
|
8574
8504
|
|
|
8575
8505
|
/**
|
|
8576
8506
|
* Simple annotated params that implements FirestoreModelKeyRef.
|
|
8577
8507
|
*/
|
|
8578
|
-
let TargetModelParams = (_dec = Expose(), _dec2 = IsNotEmpty(), _dec3 = IsFirestoreModelKey(), _dec4 = Reflect.metadata("design:type",
|
|
8508
|
+
let TargetModelParams = (_dec = Expose(), _dec2 = IsNotEmpty(), _dec3 = IsFirestoreModelKey(), _dec4 = Reflect.metadata("design:type", typeof FirestoreModelKey === "undefined" ? Object : FirestoreModelKey), (_class = class TargetModelParams {
|
|
8579
8509
|
constructor() {
|
|
8580
8510
|
_initializerDefineProperty(this, "key", _descriptor, this);
|
|
8581
|
-
}
|
|
8511
|
+
}
|
|
8582
8512
|
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "key", [_dec, _dec2, _dec3, _dec4], {
|
|
8583
8513
|
configurable: true,
|
|
8584
8514
|
enumerable: true,
|
|
8585
8515
|
writable: true,
|
|
8586
8516
|
initializer: null
|
|
8587
8517
|
})), _class));
|
|
8588
|
-
let InferredTargetModelParams = (_dec5 = Expose(), _dec6 = IsOptional(), _dec7 = IsNotEmpty(), _dec8 = IsFirestoreModelKey(), _dec9 = Reflect.metadata("design:type",
|
|
8518
|
+
let InferredTargetModelParams = (_dec5 = Expose(), _dec6 = IsOptional(), _dec7 = IsNotEmpty(), _dec8 = IsFirestoreModelKey(), _dec9 = Reflect.metadata("design:type", typeof FirestoreModelKey === "undefined" ? Object : FirestoreModelKey), (_class2 = class InferredTargetModelParams {
|
|
8589
8519
|
constructor() {
|
|
8590
8520
|
_initializerDefineProperty(this, "key", _descriptor2, this);
|
|
8591
|
-
}
|
|
8521
|
+
}
|
|
8592
8522
|
}, (_descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "key", [_dec5, _dec6, _dec7, _dec8, _dec9], {
|
|
8593
8523
|
configurable: true,
|
|
8594
8524
|
enumerable: true,
|
|
@@ -8599,20 +8529,20 @@ let InferredTargetModelParams = (_dec5 = Expose(), _dec6 = IsOptional(), _dec7 =
|
|
|
8599
8529
|
/**
|
|
8600
8530
|
* Simple annotated params that implements FirestoreModelKeyRef but key is a FirestoreModelId.
|
|
8601
8531
|
*/
|
|
8602
|
-
let TargetModelIdParams = (_dec10 = Expose(), _dec11 = IsNotEmpty(), _dec12 = IsFirestoreModelId(), _dec13 = Reflect.metadata("design:type",
|
|
8532
|
+
let TargetModelIdParams = (_dec10 = Expose(), _dec11 = IsNotEmpty(), _dec12 = IsFirestoreModelId(), _dec13 = Reflect.metadata("design:type", typeof FirestoreModelKey === "undefined" ? Object : FirestoreModelKey), (_class3 = class TargetModelIdParams {
|
|
8603
8533
|
constructor() {
|
|
8604
8534
|
_initializerDefineProperty(this, "key", _descriptor3, this);
|
|
8605
|
-
}
|
|
8535
|
+
}
|
|
8606
8536
|
}, (_descriptor3 = _applyDecoratedDescriptor(_class3.prototype, "key", [_dec10, _dec11, _dec12, _dec13], {
|
|
8607
8537
|
configurable: true,
|
|
8608
8538
|
enumerable: true,
|
|
8609
8539
|
writable: true,
|
|
8610
8540
|
initializer: null
|
|
8611
8541
|
})), _class3));
|
|
8612
|
-
let InferredTargetModelIdParams = (_dec14 = Expose(), _dec15 = IsOptional(), _dec16 = IsNotEmpty(), _dec17 = IsFirestoreModelId(), _dec18 = Reflect.metadata("design:type",
|
|
8542
|
+
let InferredTargetModelIdParams = (_dec14 = Expose(), _dec15 = IsOptional(), _dec16 = IsNotEmpty(), _dec17 = IsFirestoreModelId(), _dec18 = Reflect.metadata("design:type", typeof FirestoreModelKey === "undefined" ? Object : FirestoreModelKey), (_class4 = class InferredTargetModelIdParams {
|
|
8613
8543
|
constructor() {
|
|
8614
8544
|
_initializerDefineProperty(this, "key", _descriptor4, this);
|
|
8615
|
-
}
|
|
8545
|
+
}
|
|
8616
8546
|
}, (_descriptor4 = _applyDecoratedDescriptor(_class4.prototype, "key", [_dec14, _dec15, _dec16, _dec17, _dec18], {
|
|
8617
8547
|
configurable: true,
|
|
8618
8548
|
enumerable: true,
|
|
@@ -9371,4 +9301,4 @@ function systemStateFirestoreCollection(firestoreContext, converters) {
|
|
|
9371
9301
|
});
|
|
9372
9302
|
}
|
|
9373
9303
|
|
|
9374
|
-
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, allowDocumentSnapshotWithPathOnceFilter, 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, 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, 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, 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, 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, loadAllFirestoreDocumentSnapshot, loadAllFirestoreDocumentSnapshotPairs, 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, readFirestoreModelKeyFromDocumentSnapshot, 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 };
|
|
9304
|
+
export { AbstractFirestoreDocument, AbstractFirestoreDocumentDataAccessorWrapper, AbstractFirestoreDocumentWithParent, BASE_MODEL_STORAGE_FILE_PATH, CALL_MODEL_APP_FUNCTION_KEY, COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION, 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, 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, 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, RUN_DEV_FUNCTION_APP_FUNCTION_KEY, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionParams, ScheduledFunctionDevelopmentFunctionTypeEnum, SystemStateDocument, SystemStateFirestoreCollections, TargetModelIdParams, TargetModelParams, addConstraintToBuilder, addOrReplaceLimitInConstraints, allChildDocumentsUnderParent, allChildDocumentsUnderParentPath, allChildDocumentsUnderRelativePath, allowDocumentSnapshotWithPathOnceFilter, 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, 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, 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, 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, getDocumentSnapshotDataTuples, getDocumentSnapshotPair, getDocumentSnapshotPairs, getDocumentSnapshots, getDocumentSnapshotsData, grantFullAccessIfAdmin, grantFullAccessIfAuthUserRelated, grantModelRolesIfAdmin, grantModelRolesIfAdminFunction, grantModelRolesIfAuthUserRelatedModelFunction, grantModelRolesIfFunction, grantModelRolesIfHasAuthRolesFactory, grantModelRolesIfHasAuthRolesFunction, grantModelRolesOnlyIfFunction, inContextFirebaseModelServiceFactory, inContextFirebaseModelsServiceFactory, incrementUpdateWithAccessorFunction, inferKeyFromTwoWayFlatFirestoreModelKey, interceptAccessorFactoryFunction, isAdminInFirebaseModelContext, 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, makeDocuments, makeFirestoreCollection, makeFirestoreCollectionGroup, makeFirestoreCollectionWithParent, makeFirestoreItemPageIteratorDelegate, makeFirestoreQueryConstraintFunctionsDriver, makeRootSingleItemFirestoreCollection, makeSingleItemFirestoreCollection, mapDataFromSnapshot, mapHttpsCallable, 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, readFirestoreModelKeyFromDocumentSnapshot, 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,5 +1,5 @@
|
|
|
1
1
|
import { type DocumentReference, type WriteBatch as FirebaseFirestoreWriteBatch } from 'firebase/firestore';
|
|
2
|
-
import { type FirestoreDocumentContext, type UpdateData, type WithFieldValue, FirestoreDocumentContextType, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type SetOptions } from '../../common/firestore';
|
|
2
|
+
import { type FirestoreDocumentContext, type UpdateData, type DocumentData, type WithFieldValue, FirestoreDocumentContextType, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type SetOptions } from '../../common/firestore';
|
|
3
3
|
import { DefaultFirestoreDocumentDataAccessor } from './driver.accessor.default';
|
|
4
4
|
/**
|
|
5
5
|
* FirestoreDocumentDataAccessor implementation for a batch.
|
|
@@ -21,7 +21,7 @@ export declare function writeBatchAccessorFactory<T>(writeBatch: FirebaseFiresto
|
|
|
21
21
|
export declare class WriteBatchFirestoreDocumentContext<T> implements FirestoreDocumentContext<T> {
|
|
22
22
|
readonly batch: FirebaseFirestoreWriteBatch;
|
|
23
23
|
readonly contextType = FirestoreDocumentContextType.BATCH;
|
|
24
|
-
readonly accessorFactory: FirestoreDocumentDataAccessorFactory<T,
|
|
24
|
+
readonly accessorFactory: FirestoreDocumentDataAccessorFactory<T, DocumentData>;
|
|
25
25
|
constructor(batch: FirebaseFirestoreWriteBatch);
|
|
26
26
|
}
|
|
27
27
|
export declare function writeBatchDocumentContext<T>(batch: FirebaseFirestoreWriteBatch): WriteBatchFirestoreDocumentContext<T>;
|
|
@@ -28,7 +28,7 @@ export declare function transactionAccessorFactory<T>(transaction: FirebaseFires
|
|
|
28
28
|
export declare class TransactionFirestoreDocumentContext<T> implements FirestoreDocumentContext<T> {
|
|
29
29
|
readonly transaction: FirebaseFirestoreTransaction;
|
|
30
30
|
readonly contextType = FirestoreDocumentContextType.TRANSACTION;
|
|
31
|
-
readonly accessorFactory: FirestoreDocumentDataAccessorFactory<T
|
|
31
|
+
readonly accessorFactory: FirestoreDocumentDataAccessorFactory<T>;
|
|
32
32
|
constructor(transaction: FirebaseFirestoreTransaction);
|
|
33
33
|
}
|
|
34
34
|
export declare function transactionDocumentContext<T>(transaction: FirebaseFirestoreTransaction): TransactionFirestoreDocumentContext<T>;
|
|
@@ -85,13 +85,3 @@ export type ModelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U
|
|
|
85
85
|
* @returns
|
|
86
86
|
*/
|
|
87
87
|
export declare function callModelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U extends ModelFirebaseCrudFunctionTypeMap>(configMap: FirebaseFunctionTypeConfigMap<M>, crudConfigMap: ModelFirebaseCrudFunctionConfigMap<U, FirestoreModelIdentity>): ModelFirebaseFunctionMapFactory<M, U>;
|
|
88
|
-
/**
|
|
89
|
-
* @deprecated move to using callModelFirebaseFunctionMapFactory instead and the call configuration in general.
|
|
90
|
-
*
|
|
91
|
-
* This will be removed in the next release.
|
|
92
|
-
*
|
|
93
|
-
* @param configMap
|
|
94
|
-
* @param crudConfigMap
|
|
95
|
-
* @returns
|
|
96
|
-
*/
|
|
97
|
-
export declare function modelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U extends ModelFirebaseCrudFunctionTypeMap>(configMap: FirebaseFunctionTypeConfigMap<M>, crudConfigMap: ModelFirebaseCrudFunctionConfigMap<U, FirestoreModelIdentity>): ModelFirebaseFunctionMapFactory<M, U>;
|
|
@@ -243,6 +243,12 @@ export declare const FIRESTORE_MODEL_KEY_REGEX_STRICT: RegExp;
|
|
|
243
243
|
* @param input
|
|
244
244
|
*/
|
|
245
245
|
export declare function isFirestoreModelKey(input: string | FirestoreModelKey): input is FirestoreModelKey;
|
|
246
|
+
/**
|
|
247
|
+
* Returns true if the input string is a FirestoreModelId.
|
|
248
|
+
*
|
|
249
|
+
* @param input
|
|
250
|
+
*/
|
|
251
|
+
export declare function isFirestoreModelIdOrKey(input: string | FirestoreModelId | FirestoreModelKey): input is FirestoreModelId | FirestoreModelKey;
|
|
246
252
|
/**
|
|
247
253
|
* A part of a FirestoreModelKey.
|
|
248
254
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type GetterOrValue, type PromiseOrValue, type IndexRef, type Maybe, type PerformAsyncTasksConfig, type IndexNumber, type PerformAsyncTasksResult, type FactoryWithRequiredInput, type Milliseconds, type AllowValueOnceFilter } from '@dereekb/util';
|
|
1
|
+
import { type GetterOrValue, type PromiseOrValue, type IndexRef, type Maybe, type PerformAsyncTasksConfig, type IndexNumber, type PerformAsyncTasksResult, type FactoryWithRequiredInput, type Milliseconds, type AllowValueOnceFilter, type ReadKeyFunction } from '@dereekb/util';
|
|
2
2
|
import { type FirestoreDocument, type LimitedFirestoreDocumentAccessor, type FirestoreDocumentSnapshotDataPairWithData } from '../accessor';
|
|
3
3
|
import { type QueryDocumentSnapshot, type QuerySnapshot, type DocumentSnapshot } from '../types';
|
|
4
4
|
import { type FirestoreQueryConstraint } from './constraint';
|
|
@@ -184,7 +184,7 @@ export interface IterateFirestoreDocumentSnapshotCheckpointsConfig<T, R> {
|
|
|
184
184
|
* @param snapshot
|
|
185
185
|
* @returns
|
|
186
186
|
*/
|
|
187
|
-
filterCheckpointSnapshots
|
|
187
|
+
filterCheckpointSnapshots?: IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction<T>;
|
|
188
188
|
/**
|
|
189
189
|
* The iterate function per each snapshot.
|
|
190
190
|
*/
|
|
@@ -194,6 +194,21 @@ export interface IterateFirestoreDocumentSnapshotCheckpointsConfig<T, R> {
|
|
|
194
194
|
*/
|
|
195
195
|
useCheckpointResult?(checkpointResults: IterateFirestoreDocumentSnapshotCheckpointsIterationResult<T, R>): PromiseOrValue<void>;
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Filter function used to filter out snapshots.
|
|
199
|
+
*
|
|
200
|
+
* @param snapshot
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
export type IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction<T> = (snapshot: QueryDocumentSnapshot<T>[]) => PromiseOrValue<QueryDocumentSnapshot<T>[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Creates a IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction that filters out any repeat documents.
|
|
206
|
+
*
|
|
207
|
+
* Repeat documents can occur in cases where the document is updated and the query matches it again for a different reason.
|
|
208
|
+
*
|
|
209
|
+
* @param readKeyFunction
|
|
210
|
+
*/
|
|
211
|
+
export declare function filterRepeatCheckpointSnapshots<T>(readKeyFunction?: ReadKeyFunction<QueryDocumentSnapshot<T>>): IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction<T>;
|
|
197
212
|
export interface IterateFirestoreDocumentSnapshotCheckpointsIterationResult<T, R> extends IndexRef {
|
|
198
213
|
/***
|
|
199
214
|
* Checkpoint index number
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WebsiteLink, type GrantedRole, type WebsiteFileLink } from '@dereekb/model';
|
|
2
2
|
import { type DateCellRange, type DateCellSchedule } from '@dereekb/date';
|
|
3
|
-
import { type ModelFieldMapFunctionsConfig, type GetterOrValue, type Maybe, type ModelFieldMapConvertFunction, type PrimativeKey, type ReadKeyFunction, type ModelFieldMapFunctionsWithDefaultsConfig, type FilterUniqueStringsTransformConfig, type MapFunction, type FilterKeyValueTuplesInput, type ModelKey, type ToModelMapFunctionsInput, type ModelMapFunctionsRef, type LatLngPrecision, type LatLngString, type TimezoneString, type PrimativeKeyStringDencoderFunction, type PrimativeKeyDencoderFunction, type UnitedStatesAddress, type ZoomLevel, type FilterUniqueFunction, type BitwiseEncodedSet, type BitwiseObjectDencoder, type SortCompareFunctionRef, type TransformNumberFunctionConfigInput, type TransformStringFunctionConfigInput, type DecisionFunction, type ISO8601DateString } from '@dereekb/util';
|
|
3
|
+
import { type ModelFieldMapFunctionsConfig, type GetterOrValue, type Maybe, type ModelFieldMapConvertFunction, type PrimativeKey, type ReadKeyFunction, type ModelFieldMapFunctionsWithDefaultsConfig, type FilterUniqueStringsTransformConfig, type MapFunction, type FilterKeyValueTuplesInput, type ModelKey, type ToModelMapFunctionsInput, type ModelMapFunctionsRef, type LatLngPrecision, type LatLngString, type TimezoneString, type PrimativeKeyStringDencoderFunction, type PrimativeKeyDencoderFunction, type UnitedStatesAddress, type ZoomLevel, type FilterUniqueFunction, type BitwiseEncodedSet, type BitwiseObjectDencoder, type SortCompareFunctionRef, type TransformNumberFunctionConfigInput, type TransformStringFunctionConfigInput, type DecisionFunction, type ISO8601DateString, type FilterFunction } from '@dereekb/util';
|
|
4
4
|
import { type FirestoreModelData } from './snapshot.type';
|
|
5
5
|
export interface BaseFirestoreFieldConfig<V, D = unknown> {
|
|
6
6
|
fromData: ModelFieldMapConvertFunction<D, V>;
|
|
@@ -330,6 +330,10 @@ export type FirestoreObjectArrayFieldConfig<T extends object, O extends object =
|
|
|
330
330
|
* Filters the objects array uniquely.
|
|
331
331
|
*/
|
|
332
332
|
readonly filterUnique?: FilterUniqueFunction<T, any>;
|
|
333
|
+
/**
|
|
334
|
+
* Arbitrary filter to apply to the array. Is run after the filterUnique function is run.
|
|
335
|
+
*/
|
|
336
|
+
readonly filter?: FilterFunction<T>;
|
|
333
337
|
};
|
|
334
338
|
export type FirestoreObjectArrayFieldConfigObjectFieldInput<T extends object, O extends object = FirestoreModelData<T>> = {
|
|
335
339
|
/**
|
|
@@ -440,11 +444,3 @@ export interface FirestoreBitwiseObjectMapConfig<T extends object, K extends str
|
|
|
440
444
|
readonly dencoder: BitwiseObjectDencoder<T>;
|
|
441
445
|
}
|
|
442
446
|
export declare function firestoreBitwiseObjectMap<T extends object, K extends string = string>(config: FirestoreBitwiseObjectMapConfig<T, K>): FirestoreModelFieldMapFunctionsConfig<FirestoreEncodedObjectMapFieldValueType<T, K>, FirestoreMapFieldType<number, K>>;
|
|
443
|
-
/**
|
|
444
|
-
* @deprecated use TransformStringFunctionConfigInput instead.
|
|
445
|
-
*/
|
|
446
|
-
export type FirestoreStringTransformOptions<S extends string = string> = TransformStringFunctionConfigInput<S>;
|
|
447
|
-
/**
|
|
448
|
-
* @deprecated use TransformNumberFunctionConfigInput instead.
|
|
449
|
-
*/
|
|
450
|
-
export type FirestoreNumberTransformOptions<N extends number = number> = TransformNumberFunctionConfigInput<N>;
|