@dereekb/firebase 8.1.0 → 8.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [8.2.0](https://github.com/dereekb/dbx-components/compare/v8.1.2-dev...v8.2.0) (2022-06-20)
6
+
7
+
8
+ ### Features
9
+
10
+ * added DbxRouteParamReader ([a855283](https://github.com/dereekb/dbx-components/commit/a8552835aabbfa85814984a8fdafd7bd1fb2963e))
11
+
12
+
13
+
14
+ ## [8.1.2](https://github.com/dereekb/dbx-components/compare/v8.1.1-dev...v8.1.2) (2022-06-19)
15
+
16
+
17
+
18
+ ## [8.1.1](https://github.com/dereekb/dbx-components/compare/v8.1.0-dev...v8.1.1) (2022-06-18)
19
+
20
+
21
+
5
22
  # [8.1.0](https://github.com/dereekb/dbx-components/compare/v8.0.1-dev...v8.1.0) (2022-06-18)
6
23
 
7
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "devDependencies": {
5
5
  "@firebase/rules-unit-testing": "^2.0.0"
6
6
  },
@@ -23,16 +23,16 @@
23
23
  "rxfire": "^6.0.3",
24
24
  "rxjs": "^7.0.0",
25
25
  "firebase": "^9.8.0",
26
- "@dereekb/util": "8.1.0",
26
+ "@dereekb/util": "8.2.0",
27
27
  "make-error": "^1.3.0",
28
28
  "ts-essentials": "^9.1.2",
29
29
  "extra-set": "^2.2.11",
30
- "@dereekb/rxjs": "8.1.0",
30
+ "@dereekb/rxjs": "8.2.0",
31
31
  "ms": "^3.0.0-canary.1",
32
- "@dereekb/model": "8.1.0",
32
+ "@dereekb/model": "8.2.0",
33
33
  "class-transformer": "^0.5.1",
34
34
  "class-validator": "^0.13.2",
35
- "@dereekb/date": "8.1.0",
35
+ "@dereekb/date": "8.2.0",
36
36
  "date-fns": "^2.28.0",
37
37
  "date-fns-tz": "^1.3.0",
38
38
  "rrule": "2.7.0",
@@ -1,7 +1,7 @@
1
1
  import { MaybeNot } from '@dereekb/util';
2
2
  import { Functions } from 'firebase/functions';
3
3
  import { NonNever } from 'ts-essentials';
4
- import { FirestoreModelIdentity, FirestoreModelNames, OnCallCreateModelResult } from '../../common';
4
+ import { FirestoreModelIdentity, FirestoreModelTypes, OnCallCreateModelResult } from '../../common';
5
5
  import { FirebaseFunctionTypeMap, FirebaseFunctionMap, FirebaseFunction } from './function';
6
6
  import { FirebaseFunctionTypeConfigMap } from './function.factory';
7
7
  export declare type ModelFirebaseCrudFunction<I> = FirebaseFunction<I, void>;
@@ -9,7 +9,7 @@ export declare type ModelFirebaseCreateFunction<I, O extends OnCallCreateModelRe
9
9
  export declare type ModelFirebaseUpdateFunction<I> = ModelFirebaseCrudFunction<I>;
10
10
  export declare type ModelFirebaseDeleteFunction<I> = ModelFirebaseCrudFunction<I>;
11
11
  export declare type ModelFirebaseCrudFunctionTypeMap<T extends FirestoreModelIdentity = FirestoreModelIdentity> = {
12
- [K in FirestoreModelNames<T>]: ModelFirebaseCrudFunctionTypeMapEntry;
12
+ [K in FirestoreModelTypes<T>]: ModelFirebaseCrudFunctionTypeMapEntry;
13
13
  };
14
14
  export declare type ModelFirebaseCrudFunctionTypeMapEntry = MaybeNot | Partial<ModelFirebaseCrudFunctionCreateTypeConfig & ModelFirebaseCrudFunctionUpdateTypeConfig & ModelFirebaseCrudFunctionDeleteTypeConfig>;
15
15
  export declare type ModelFirebaseCrudFunctionCreateTypeConfig<I = unknown> = {
@@ -27,7 +27,7 @@ export declare type ModelFirebaseCrudFunctionDeleteTypeConfig<I = unknown> = {
27
27
  * The FirestoreModelIdentities that are allowed are passed too which add type checking to make sure we're passing the expected identities.
28
28
  */
29
29
  export declare type ModelFirebaseCrudFunctionConfigMap<C extends ModelFirebaseCrudFunctionTypeMap<T>, T extends FirestoreModelIdentity> = NonNever<{
30
- [K in FirestoreModelNames<T>]: C[K] extends null ? never : (keyof C[K])[];
30
+ [K in FirestoreModelTypes<T>]: C[K] extends null ? never : (keyof C[K])[];
31
31
  }>;
32
32
  export declare type ModelFirebaseCrudFunctionMap<C extends ModelFirebaseCrudFunctionTypeMap> = ModelFirebaseCrudFunctionRawMap<C>;
33
33
  export declare type ModelFirebaseCrudFunctionRawMap<C extends ModelFirebaseCrudFunctionTypeMap> = NonNever<{
@@ -1,28 +1,29 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { FirestoreAccessorDriverRef } from '../driver/accessor';
3
- import { FirestoreModelId, FirestoreModelIdRef, FirestoreModelKey, FirestoreModelKeyRef, FirestoreModelName } from './../collection/collection';
3
+ import { FirestoreCollectionNameRef, FirestoreModelId, FirestoreModelIdentityCollectionName, FirestoreModelIdentityModelType, FirestoreModelIdentityRef, FirestoreModelIdRef, FirestoreModelKey, FirestoreModelKeyRef } from './../collection/collection';
4
4
  import { DocumentReference, CollectionReference, Transaction, WriteBatch, DocumentSnapshot, SnapshotOptions, WriteResult } from '../types';
5
5
  import { FirestoreDocumentDataAccessor } from './accessor';
6
6
  import { CollectionReferenceRef, DocumentReferenceRef, FirestoreContextReference, FirestoreDataConverterRef } from '../reference';
7
7
  import { FirestoreDocumentContext } from './context';
8
8
  import { Maybe } from '@dereekb/util';
9
- import { FirestoreModelNameRef, FirestoreModelIdentity, FirestoreModelIdentityRef } from '../collection/collection';
9
+ import { FirestoreModelTypeRef, FirestoreModelIdentity, FirestoreModelTypeModelIdentityRef } from '../collection/collection';
10
10
  import { InterceptAccessorFactoryFunction } from './accessor.wrap';
11
- export interface FirestoreDocument<T, M extends FirestoreModelName = FirestoreModelName> extends DocumentReferenceRef<T>, CollectionReferenceRef<T>, FirestoreModelIdentityRef<M>, FirestoreModelNameRef<M>, FirestoreModelKeyRef, FirestoreModelIdRef {
11
+ export interface FirestoreDocument<T, I extends FirestoreModelIdentity = FirestoreModelIdentity> extends DocumentReferenceRef<T>, CollectionReferenceRef<T>, FirestoreModelIdentityRef<I>, FirestoreModelTypeRef<FirestoreModelIdentityModelType<I>>, FirestoreCollectionNameRef<FirestoreModelIdentityCollectionName<I>>, FirestoreModelKeyRef, FirestoreModelIdRef {
12
12
  readonly accessor: FirestoreDocumentDataAccessor<T>;
13
13
  readonly id: string;
14
14
  }
15
15
  /**
16
16
  * Abstract FirestoreDocument implementation that extends a FirestoreDocumentDataAccessor.
17
17
  */
18
- export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFirestoreDocument<T, any, M>, M extends FirestoreModelName = FirestoreModelName> implements FirestoreDocument<T>, LimitedFirestoreDocumentAccessorRef<T, D>, CollectionReferenceRef<T> {
18
+ export declare abstract class AbstractFirestoreDocument<T, D extends AbstractFirestoreDocument<T, any, I>, I extends FirestoreModelIdentity = FirestoreModelIdentity> implements FirestoreDocument<T>, LimitedFirestoreDocumentAccessorRef<T, D>, CollectionReferenceRef<T> {
19
19
  readonly accessor: FirestoreDocumentDataAccessor<T>;
20
20
  readonly documentAccessor: LimitedFirestoreDocumentAccessor<T, D>;
21
21
  readonly stream$: Observable<DocumentSnapshot<T>>;
22
22
  readonly data$: Observable<T>;
23
23
  constructor(accessor: FirestoreDocumentDataAccessor<T>, documentAccessor: LimitedFirestoreDocumentAccessor<T, D>);
24
- abstract get modelIdentity(): FirestoreModelIdentity<M>;
25
- get modelType(): M;
24
+ abstract get modelIdentity(): I;
25
+ get modelType(): FirestoreModelIdentityModelType<I>;
26
+ get collectionName(): FirestoreModelIdentityCollectionName<I>;
26
27
  get id(): FirestoreModelId;
27
28
  get key(): FirestoreModelKey;
28
29
  get documentRef(): DocumentReference<T>;
@@ -41,7 +42,7 @@ export interface LimitedFirestoreDocumentAccessorRef<T, D extends FirestoreDocum
41
42
  readonly documentAccessor: A;
42
43
  }
43
44
  export declare type FirestoreDocumentAccessorRef<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> = LimitedFirestoreDocumentAccessorRef<T, D, FirestoreDocumentAccessor<T, D>>;
44
- export interface LimitedFirestoreDocumentAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends FirestoreModelIdentityRef, FirestoreAccessorDriverRef {
45
+ export interface LimitedFirestoreDocumentAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends FirestoreModelTypeModelIdentityRef, FirestoreAccessorDriverRef {
45
46
  readonly databaseContext: FirestoreDocumentContext<T>;
46
47
  /**
47
48
  * Loads a document from the datastore.
@@ -110,7 +111,7 @@ export interface LimitedFirestoreDocumentAccessorFactory<T, D extends FirestoreD
110
111
  /**
111
112
  * FirestoreDocumentAccessor configuration.
112
113
  */
113
- export interface LimitedFirestoreDocumentAccessorFactoryConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends FirestoreDataConverterRef<T>, FirestoreModelIdentityRef, FirestoreContextReference, FirestoreAccessorDriverRef {
114
+ export interface LimitedFirestoreDocumentAccessorFactoryConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends FirestoreDataConverterRef<T>, FirestoreModelTypeModelIdentityRef, FirestoreContextReference, FirestoreAccessorDriverRef {
114
115
  /**
115
116
  * Optional InterceptAccessorFactoryFunction to intercept/return a modified accessor factory.
116
117
  */
@@ -159,10 +160,10 @@ export interface FirestoreDocumentAccessorContextExtension<T, D extends Firestor
159
160
  }
160
161
  export declare function firestoreDocumentAccessorContextExtension<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>({ documentAccessor, firestoreAccessorDriver }: FirestoreDocumentAccessorContextExtensionConfig<T, D>): FirestoreDocumentAccessorContextExtension<T, D>;
161
162
  export declare function firestoreDocumentAccessorContextExtension<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>({ documentAccessor, firestoreAccessorDriver }: LimitedFirestoreDocumentAccessorContextExtensionConfig<T, D>): LimitedFirestoreDocumentAccessorContextExtension<T, D>;
162
- export interface FirestoreDocumentWithParent<P, T> extends FirestoreDocument<T> {
163
+ export interface FirestoreDocumentWithParent<P, T, I extends FirestoreModelIdentity = FirestoreModelIdentity> extends FirestoreDocument<T, I> {
163
164
  readonly parent: DocumentReference<P>;
164
165
  }
165
- export declare abstract class AbstractFirestoreDocumentWithParent<P, T, D extends AbstractFirestoreDocument<T, any>> extends AbstractFirestoreDocument<T, D> implements FirestoreDocumentWithParent<P, T> {
166
+ export declare abstract class AbstractFirestoreDocumentWithParent<P, T, D extends AbstractFirestoreDocument<T, any, I>, I extends FirestoreModelIdentity = FirestoreModelIdentity> extends AbstractFirestoreDocument<T, D, I> implements FirestoreDocumentWithParent<P, T> {
166
167
  get parent(): DocumentReference<P>;
167
168
  constructor(accessor: FirestoreDocumentDataAccessor<T>, documentAccessor: LimitedFirestoreDocumentAccessor<T, D>);
168
169
  }
@@ -16,7 +16,10 @@ class AbstractFirestoreDocument {
16
16
  this.data$ = (0, accessor_1.dataFromSnapshotStream)(this.stream$);
17
17
  }
18
18
  get modelType() {
19
- return this.modelIdentity.model;
19
+ return this.modelIdentity.modelType;
20
+ }
21
+ get collectionName() {
22
+ return this.modelIdentity.collectionName;
20
23
  }
21
24
  get id() {
22
25
  return this.documentRef.id;
@@ -49,7 +52,7 @@ class AbstractFirestoreDocument {
49
52
  exports.AbstractFirestoreDocument = AbstractFirestoreDocument;
50
53
  function limitedFirestoreDocumentAccessorFactory(config) {
51
54
  const { firestoreContext, firestoreAccessorDriver, makeDocument, accessorFactory: interceptAccessorFactory, converter, modelIdentity } = config;
52
- const expectedCollectionName = firestoreAccessorDriver.fuzzedPathForPath ? firestoreAccessorDriver.fuzzedPathForPath(modelIdentity.collection) : modelIdentity.collection;
55
+ const expectedCollectionName = firestoreAccessorDriver.fuzzedPathForPath ? firestoreAccessorDriver.fuzzedPathForPath(modelIdentity.collectionName) : modelIdentity.collectionName;
53
56
  return (context) => {
54
57
  const databaseContext = context !== null && context !== void 0 ? context : config.firestoreAccessorDriver.defaultContextFactory();
55
58
  const dataAccessorFactory = interceptAccessorFactory ? interceptAccessorFactory(databaseContext.accessorFactory) : databaseContext.accessorFactory;
@@ -64,7 +67,7 @@ function limitedFirestoreDocumentAccessorFactory(config) {
64
67
  var _a;
65
68
  const ref = firestoreAccessorDriver.docAtPath(firestoreContext.firestore, fullPath);
66
69
  if (((_a = ref.parent) === null || _a === void 0 ? void 0 : _a.id) !== expectedCollectionName) {
67
- throw new Error(`unexpected key/path "${fullPath}" for expected type "${modelIdentity.collection}"/"${modelIdentity.model}".`);
70
+ throw new Error(`unexpected key/path "${fullPath}" for expected type "${modelIdentity.collectionName}"/"${modelIdentity.modelType}".`);
68
71
  }
69
72
  return ref.withConverter(converter);
70
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/accessor/document.ts"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,0GAA0G;;;AAM1G,yCAAkH;AAGlH,wCAA6C;AAS7C;;GAEG;AACH,MAAsB,yBAAyB;IAI7C,YAAqB,QAA0C,EAAW,gBAAwD;QAA7G,aAAQ,GAAR,QAAQ,CAAkC;QAAW,qBAAgB,GAAhB,gBAAgB,CAAwC;QAHzH,YAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjC,UAAK,GAAkB,IAAA,iCAAsB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEgE,CAAC;IAItI,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;IAClC,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IACnC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,WA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,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1I,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAZD,8FAYC;AAOD,MAAsB,mCAAuF,SAAQ,yBAA+B;IAClJ,IAAI,MAAM;QACR,OAAQ,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAiC,CAAC,MAA8B,CAAC;IACrG,CAAC;IAED,YAAY,QAA0C,EAAE,gBAAwD;QAC9G,KAAK,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACpC,CAAC;CACF;AARD,kFAQC;AAcD,SAAgB,+BAA+B,CAA2D,MAAmD;IAC3J,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE/D,OAAO;QACL,YAAY;YACV,OAAO,SAAS,CAAC,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACpE,CAAC;QACD,0BAA0B,CAAC,WAA+B;YACxD,OAAO,SAAS,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC7F,CAAC;QACD,yBAAyB,CAAC,UAA6B;YACrD,OAAO,SAAS,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC3F,CAAC;KACF,CAAC;AACJ,CAAC;AAdD,0EAcC"}
1
+ {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/accessor/document.ts"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,0GAA0G;;;AAM1G,yCAAkH;AAGlH,wCAA6C;AAS7C;;GAEG;AACH,MAAsB,yBAAyB;IAI7C,YAAqB,QAA0C,EAAW,gBAAwD;QAA7G,aAAQ,GAAR,QAAQ,CAAkC;QAAW,qBAAgB,GAAhB,gBAAgB,CAAwC;QAHzH,YAAO,GAA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SAAS,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC7F,CAAC;QACD,yBAAyB,CAAC,UAA6B;YACrD,OAAO,SAAS,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC3F,CAAC;KACF,CAAC;AACJ,CAAC;AAdD,0EAcC"}
@@ -1,4 +1,5 @@
1
1
  import { AsyncGetterOrValue, Maybe, UseAsync } from '@dereekb/util';
2
+ import { FirestoreModelId, FirestoreModelKey } from '../collection';
2
3
  import { DocumentDataWithId, DocumentReference, DocumentSnapshot, QuerySnapshot, Transaction } from '../types';
3
4
  import { FirestoreDocument, FirestoreDocumentAccessor, LimitedFirestoreDocumentAccessor, LimitedFirestoreDocumentAccessorContextExtension } from './document';
4
5
  export declare function newDocuments<T, D extends FirestoreDocument<T>>(documentAccessor: FirestoreDocumentAccessor<T, D>, count: number): D[];
@@ -25,8 +26,13 @@ export interface MakeDocumentsParams<T, D extends FirestoreDocument<T> = Firesto
25
26
  export declare function makeDocuments<T, D extends FirestoreDocument<T>>(documentAccessor: FirestoreDocumentAccessor<T, D>, make: MakeDocumentsParams<T, D>): Promise<D[]>;
26
27
  export declare function getDocumentSnapshots<T, D extends FirestoreDocument<T>>(documents: D[]): Promise<DocumentSnapshot<T>[]>;
27
28
  export declare function loadDocumentsForSnapshots<T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, snapshots: QuerySnapshot<T>): D[];
29
+ export declare function loadDocumentsForDocumentReferencesFromValues<I, T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, values: I[], getRef: (value: I) => DocumentReference<T>): D[];
30
+ export declare const loadDocumentsForValues: typeof loadDocumentsForDocumentReferencesFromValues;
28
31
  export declare function loadDocumentsForDocumentReferences<T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, refs: DocumentReference<T>[]): D[];
29
- export declare function loadDocumentsForValues<I, T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, values: I[], getRef: (value: I) => DocumentReference<T>): D[];
32
+ export declare function loadDocumentsForKeysFromValues<I, T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, values: I[], getKey: (value: I) => FirestoreModelKey): D[];
33
+ export declare function loadDocumentsForKeys<T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, keys: FirestoreModelKey[]): D[];
34
+ export declare function loadDocumentsForIdsFromValues<I, T, D extends FirestoreDocument<T>>(accessor: LimitedFirestoreDocumentAccessor<T, D>, values: I[], getId: (value: I) => FirestoreModelId): D[];
35
+ export declare function loadDocumentsForIds<T, D extends FirestoreDocument<T>>(accessor: FirestoreDocumentAccessor<T, D>, ids: FirestoreModelId[]): D[];
30
36
  /**
31
37
  * Used for loading documents for the input references.
32
38
  */
@@ -57,4 +63,4 @@ export declare function useDocumentSnapshot<T, D extends FirestoreDocument<T>, O
57
63
  /**
58
64
  * MappedUseAsyncFunction to load snapshot data from the input document and use it.
59
65
  */
60
- export declare const useDocumentSnapshotData: import("@dereekb/util").MappedUseAsyncFunction<FirestoreDocument<unknown, string>, unknown>;
66
+ export declare const useDocumentSnapshotData: import("@dereekb/util").MappedUseAsyncFunction<FirestoreDocument<unknown, import("../collection").FirestoreModelIdentity<string, string>>, unknown>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDocumentSnapshotData = exports.useDocumentSnapshot = exports.documentDataWithId = exports.firestoreDocumentLoader = exports.loadDocumentsForValues = exports.loadDocumentsForDocumentReferences = exports.loadDocumentsForSnapshots = exports.getDocumentSnapshots = exports.makeDocuments = exports.newDocuments = void 0;
3
+ exports.useDocumentSnapshotData = exports.useDocumentSnapshot = exports.documentDataWithId = exports.firestoreDocumentLoader = exports.loadDocumentsForIds = exports.loadDocumentsForIdsFromValues = exports.loadDocumentsForKeys = exports.loadDocumentsForKeysFromValues = exports.loadDocumentsForDocumentReferences = exports.loadDocumentsForValues = exports.loadDocumentsForDocumentReferencesFromValues = exports.loadDocumentsForSnapshots = exports.getDocumentSnapshots = exports.makeDocuments = exports.newDocuments = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const util_1 = require("@dereekb/util");
6
6
  function newDocuments(documentAccessor, count) {
@@ -38,14 +38,31 @@ function loadDocumentsForSnapshots(accessor, snapshots) {
38
38
  return snapshots.docs.map((x) => accessor.loadDocument(x.ref));
39
39
  }
40
40
  exports.loadDocumentsForSnapshots = loadDocumentsForSnapshots;
41
+ function loadDocumentsForDocumentReferencesFromValues(accessor, values, getRef) {
42
+ return loadDocumentsForDocumentReferences(accessor, values.map(getRef));
43
+ }
44
+ exports.loadDocumentsForDocumentReferencesFromValues = loadDocumentsForDocumentReferencesFromValues;
45
+ exports.loadDocumentsForValues = loadDocumentsForDocumentReferencesFromValues;
41
46
  function loadDocumentsForDocumentReferences(accessor, refs) {
42
47
  return refs.map((x) => accessor.loadDocument(x));
43
48
  }
44
49
  exports.loadDocumentsForDocumentReferences = loadDocumentsForDocumentReferences;
45
- function loadDocumentsForValues(accessor, values, getRef) {
46
- return values.map((x) => accessor.loadDocument(getRef(x)));
50
+ function loadDocumentsForKeysFromValues(accessor, values, getKey) {
51
+ return loadDocumentsForKeys(accessor, values.map(getKey));
52
+ }
53
+ exports.loadDocumentsForKeysFromValues = loadDocumentsForKeysFromValues;
54
+ function loadDocumentsForKeys(accessor, keys) {
55
+ return keys.map((x) => accessor.loadDocumentForKey(x));
56
+ }
57
+ exports.loadDocumentsForKeys = loadDocumentsForKeys;
58
+ function loadDocumentsForIdsFromValues(accessor, values, getId) {
59
+ return loadDocumentsForKeys(accessor, values.map(getId));
60
+ }
61
+ exports.loadDocumentsForIdsFromValues = loadDocumentsForIdsFromValues;
62
+ function loadDocumentsForIds(accessor, ids) {
63
+ return ids.map((x) => accessor.loadDocumentForId(x));
47
64
  }
48
- exports.loadDocumentsForValues = loadDocumentsForValues;
65
+ exports.loadDocumentsForIds = loadDocumentsForIds;
49
66
  /**
50
67
  * Used to make a FirestoreDocumentLoader.
51
68
  *
@@ -1 +1 @@
1
- {"version":3,"file":"document.utility.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/accessor/document.utility.ts"],"names":[],"mappings":";;;;AAAA,wCAAsJ;AAItJ,SAAgB,YAAY,CAAoC,gBAAiD,EAAE,KAAa;IAC9H,OAAO,IAAA,sBAAe,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAFD,oCAEC;AAkBD;;;;;;GAMG;AACH,SAAgB,aAAa,CAAoC,gBAAiD,EAAE,IAA+B;;IACjJ,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,WAAW,mCAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC;IACjF,OAAO,IAAA,sBAAe,EAAC;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,CAAO,CAAS,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAM,aAAa,CAAC,gBAAgB,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAE1C,IAAI,IAAI,IAAI,IAAI,EAAE;gBAChB,MAAM,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aACnC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA;KACF,CAAC,CAAC;AACL,CAAC;AAfD,sCAeC;AAED,SAAgB,oBAAoB,CAAoC,SAAc;IACpF,OAAO,qBAAc,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC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,IAAI,CAAC;AACd,CAAC;AARD,gDAQC;AAED;;;;;;;GAOG;AACH,SAAsB,mBAAmB,CAA8C,QAAkB,EAAE,GAAqC,EAAE,YAA2C;;QAC3L,MAAM,QAAQ,GAAG,MAAM,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,CAAC,GAAG,EAAE,CAAA,CAAC;QAChD,OAAO,IAAA,eAAQ,EAAC,QAAQ,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;CAAA;AAHD,kDAGC;AAED;;GAEG;AACU,QAAA,uBAAuB,GAAG,IAAA,2BAAoB,EAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"document.utility.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/accessor/document.utility.ts"],"names":[],"mappings":";;;;AAAA,wCAAsJ;AAKtJ,SAAgB,YAAY,CAAoC,gBAAiD,EAAE,KAAa;IAC9H,OAAO,IAAA,sBAAe,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAFD,oCAEC;AAkBD;;;;;;GAMG;AACH,SAAgB,aAAa,CAAoC,gBAAiD,EAAE,IAA+B;;IACjJ,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,WAAW,mCAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC;IACjF,OAAO,IAAA,sBAAe,EAAC;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,CAAO,CAAS,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAM,aAAa,CAAC,gBAAgB,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAE1C,IAAI,IA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R,QAAQ,CAAE,QAAQ,CAAC,GAAG,EAAE,CAAA,CAAC;QAChD,OAAO,IAAA,eAAQ,EAAC,QAAQ,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;CAAA;AAHD,kDAGC;AAED;;GAEG;AACU,QAAA,uBAAuB,GAAG,IAAA,2BAAoB,EAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC"}
@@ -4,13 +4,13 @@ import { FirestoreItemPageIterationBaseConfig, FirestoreItemPageIterationFactory
4
4
  import { FirestoreQueryFactory } from '../query/query';
5
5
  import { FirestoreDrivers } from '../driver/driver';
6
6
  import { FirestoreCollectionQueryFactory } from './collection.query';
7
- import { ModelKey, ModelTypeString } from '@dereekb/util';
7
+ import { ArrayOrValue, ModelKey, ModelTypeString } from '@dereekb/util';
8
8
  /**
9
- * The camelCase model name.
9
+ * The camelCase model name/type.
10
10
  */
11
- export declare type FirestoreModelName = ModelTypeString;
11
+ export declare type FirestoreModelType = ModelTypeString;
12
12
  /**
13
- * An all lowercase name that references a collection. Is usually the lowercase version of the FirestoreModelName.
13
+ * An all lowercase name that references a collection. Is usually the lowercase version of the FirestoreModelType.
14
14
  *
15
15
  * This is the part of the path that says what the collection is.
16
16
  *
@@ -21,65 +21,93 @@ export declare type FirestoreModelIdentityType = 'root' | 'nested';
21
21
  /**
22
22
  * A firestore model's identity
23
23
  */
24
- export declare type FirestoreModelIdentity<M extends FirestoreModelName = FirestoreModelName, C extends FirestoreCollectionName = FirestoreCollectionName> = {
24
+ export declare type FirestoreModelIdentity<M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelTypeRef<M> & FirestoreCollectionNameRef<C> & {
25
25
  readonly type: FirestoreModelIdentityType;
26
- readonly model: M;
26
+ /**
27
+ * @deprecated use collectionName instead.
28
+ *
29
+ * Will be removed in the future.
30
+ */
27
31
  readonly collection: C;
32
+ /**
33
+ * @deprecated use modelType instead.
34
+ *
35
+ * Will be removed in the future.
36
+ */
37
+ readonly model: M;
28
38
  };
39
+ export declare type FirestoreModelIdentityModelType<I> = I extends FirestoreModelIdentity<infer M> ? M : never;
40
+ export declare type FirestoreModelIdentityCollectionName<I> = I extends FirestoreModelIdentity<infer M, infer C> ? C : never;
29
41
  /**
30
42
  * A root-level FirestoreModelIdentity
31
43
  */
32
- export declare type RootFirestoreModelIdentity<M extends FirestoreModelName = FirestoreModelName, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelIdentity<M, C> & {
44
+ export declare type RootFirestoreModelIdentity<M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelIdentity<M, C> & {
33
45
  readonly type: 'root';
34
46
  };
35
47
  /**
36
48
  * A nested FirestoreModelIdentity with a parent.
37
49
  */
38
- export declare type FirestoreModelIdentityWithParent<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelName = FirestoreModelName, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelIdentity<M, C> & {
50
+ export declare type FirestoreModelIdentityWithParent<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelIdentity<M, C> & {
39
51
  readonly type: 'nested';
40
52
  readonly parent: P;
41
53
  };
42
54
  /**
43
55
  * A default collection name derived from the model name.
44
56
  */
45
- export declare type FirestoreModelDefaultCollectionName<M extends FirestoreModelName> = `${Lowercase<M>}`;
46
- export declare type FirestoreModelNames<I extends FirestoreModelIdentity> = I extends FirestoreModelIdentity<infer M> ? M : never;
57
+ export declare type FirestoreModelDefaultCollectionName<M extends FirestoreModelType> = `${Lowercase<M>}`;
58
+ export declare type FirestoreModelTypes<I extends FirestoreModelIdentity> = I extends FirestoreModelIdentity<infer M> ? M : never;
47
59
  /**
48
60
  * Creates a FirestoreModelIdentity value.
49
61
  *
50
62
  * @param modelName
51
63
  * @returns
52
64
  */
53
- export declare function firestoreModelIdentity<M extends FirestoreModelName>(modelName: M): RootFirestoreModelIdentity<M, FirestoreModelDefaultCollectionName<M>>;
54
- export declare function firestoreModelIdentity<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelName>(parent: P, modelName: M): FirestoreModelIdentityWithParent<P, M, FirestoreModelDefaultCollectionName<M>>;
55
- export declare function firestoreModelIdentity<M extends FirestoreModelName, C extends FirestoreCollectionName = FirestoreCollectionName>(modelName: M, collectionName: C): RootFirestoreModelIdentity<M, C>;
56
- export declare function firestoreModelIdentity<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelName, C extends FirestoreCollectionName = FirestoreCollectionName>(parent: P, modelName: M, collectionName: C): FirestoreModelIdentityWithParent<P, M, C>;
65
+ export declare function firestoreModelIdentity<M extends FirestoreModelType>(modelName: M): RootFirestoreModelIdentity<M, FirestoreModelDefaultCollectionName<M>>;
66
+ export declare function firestoreModelIdentity<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelType>(parent: P, modelName: M): FirestoreModelIdentityWithParent<P, M, FirestoreModelDefaultCollectionName<M>>;
67
+ export declare function firestoreModelIdentity<M extends FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName>(modelName: M, collectionName: C): RootFirestoreModelIdentity<M, C>;
68
+ export declare function firestoreModelIdentity<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName>(parent: P, modelName: M, collectionName: C): FirestoreModelIdentityWithParent<P, M, C>;
57
69
  /**
58
- * Reference to a FirestoreCollectionName
70
+ * Reference to a FirestoreModelType
59
71
  */
60
- export interface FirestoreModelNameRef<M extends FirestoreModelName = FirestoreModelName> {
72
+ export interface FirestoreModelTypeRef<M extends FirestoreModelType = FirestoreModelType> {
61
73
  /**
62
- * Returns the FirestoreModelName for this context.
74
+ * Returns the FirestoreModelType for this context.
63
75
  */
64
76
  readonly modelType: M;
65
77
  }
78
+ /**
79
+ * Reads the FirestoreModelType from a FirestoreModelType or FirestoreModelTypeRef.
80
+ *
81
+ * @param modelTypeInput
82
+ * @returns
83
+ */
84
+ export declare function firestoreModelType(modelTypeInput: FirestoreModelType | FirestoreModelTypeRef): FirestoreModelType;
66
85
  /**
67
86
  * Reference to a FirestoreCollectionName
68
87
  */
69
- export interface FirestoreCollectionNameRef {
88
+ export interface FirestoreCollectionNameRef<C extends FirestoreCollectionName = FirestoreCollectionName> {
70
89
  /**
71
90
  * Returns the FirestoreCollectionName for this context.
72
91
  */
73
- readonly collectionName: FirestoreCollectionName;
92
+ readonly collectionName: C;
93
+ }
94
+ /**
95
+ * Reference to a FirestoreModelIdentity via the FirestoreModelType and FirestoreCollectionName
96
+ */
97
+ export interface FirestoreModelTypeModelIdentityRef<M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> {
98
+ /**
99
+ * Returns the FirestoreModelIdentity for this context.
100
+ */
101
+ readonly modelIdentity: FirestoreModelIdentity<M, C>;
74
102
  }
75
103
  /**
76
104
  * Reference to a FirestoreModelIdentity
77
105
  */
78
- export interface FirestoreModelIdentityRef<M extends FirestoreModelName = FirestoreModelName> {
106
+ export interface FirestoreModelIdentityRef<I extends FirestoreModelIdentity> {
79
107
  /**
80
108
  * Returns the FirestoreModelIdentity for this context.
81
109
  */
82
- readonly modelIdentity: FirestoreModelIdentity<M>;
110
+ readonly modelIdentity: I;
83
111
  }
84
112
  /**
85
113
  * The model's id within a collection.
@@ -108,15 +136,54 @@ export interface FirestoreModelIdRef {
108
136
  * collection/12345/subcollection/67890
109
137
  */
110
138
  export declare type FirestoreModelKey = ModelKey;
111
- export declare type FirestoreIdentityModelKey<I extends RootFirestoreModelIdentity, K extends FirestoreModelId = FirestoreModelId> = I extends RootFirestoreModelIdentity<infer M, infer C> ? `${C}/${K}` : never;
112
139
  /**
113
- * Creates a firestoreModelKey for root identities.
140
+ * A part of a FirestoreModelKey.
141
+ */
142
+ export declare type FirestoreModelKeyPart<C extends FirestoreCollectionName = FirestoreCollectionName, K extends FirestoreModelId = FirestoreModelId> = `${C}/${K}`;
143
+ /**
144
+ * One part of a FirestoreModelKe
145
+ */
146
+ export declare type FirestoreCollectionModelKeyPart<N extends FirestoreCollectionNameRef = FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId> = N extends FirestoreCollectionNameRef<infer C> ? FirestoreModelKeyPart<C, K> : never;
147
+ export declare type FirestoreCollectionModelKey<N extends FirestoreCollectionNameRef = FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId> = FirestoreCollectionModelKeyPart<N, K>;
148
+ /**
149
+ * Creates a firestoreModelKeyPart
114
150
  *
115
151
  * @param identity
116
152
  * @param id
117
153
  * @returns
118
154
  */
119
- export declare function firestoreModelKey<I extends RootFirestoreModelIdentity, K extends FirestoreModelId = FirestoreModelId>(identity: I, id: K): FirestoreIdentityModelKey<I, K>;
155
+ export declare function firestoreModelKeyPart<N extends FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId>(identity: N, id: K): FirestoreCollectionModelKeyPart<N, K>;
156
+ /**
157
+ * Creates a firestoreModelKey for RootFirestoreModelIdentity values.
158
+ *
159
+ * @param identity
160
+ * @param id
161
+ * @returns
162
+ */
163
+ export declare const firestoreModelKey: <I extends RootFirestoreModelIdentity<string, string>, K extends string = string>(identity: I, id: K) => FirestoreCollectionModelKeyPart<I, K>;
164
+ /**
165
+ * Creates an array of FirestoreCollectionModelKey values from the input ids.
166
+ *
167
+ * @param identity
168
+ * @param ids
169
+ * @returns
170
+ */
171
+ export declare function firestoreModelKeys<I extends RootFirestoreModelIdentity, K extends FirestoreModelId = FirestoreModelId>(identity: I, ids: K[]): FirestoreCollectionModelKey<I, K>[];
172
+ /**
173
+ * Joins together a number of FirestoreModelKeyPart values.
174
+ *
175
+ * @param parts
176
+ * @returns
177
+ */
178
+ export declare function firestoreModelKeyPath(...parts: FirestoreModelKeyPart[]): FirestoreModelKey;
179
+ /**
180
+ * Creates a number of child paths from the parent path.
181
+ *
182
+ * @param parent
183
+ * @param children
184
+ * @returns
185
+ */
186
+ export declare function childFirestoreModelKeyPath(parent: FirestoreModelKeyPart, children: ArrayOrValue<FirestoreModelKeyPart>): FirestoreModelKey[];
120
187
  /**
121
188
  * Reference to a FirestoreModelKey
122
189
  */
@@ -154,3 +221,17 @@ export interface FirestoreCollectionRef<T, D extends FirestoreDocument<T> = Fire
154
221
  * Creates a new FirestoreCollection from the input config.
155
222
  */
156
223
  export declare function makeFirestoreCollection<T, D extends FirestoreDocument<T>>(inputConfig: FirestoreCollectionConfig<T, D>): FirestoreCollection<T, D>;
224
+ /**
225
+ * Alternative name for FirestoreModelType.
226
+ *
227
+ * @deprecated replaced by FirestoreModelType
228
+ */
229
+ export declare type FirestoreModelName = FirestoreModelType;
230
+ /**
231
+ * @deprecated replaced by FirestoreModelTypeRef
232
+ */
233
+ export declare type FirestoreModelNameRef<M extends FirestoreModelType = FirestoreModelType> = FirestoreModelTypeRef<M>;
234
+ /**
235
+ * @deprecated replaced by FirestoreModelTypes
236
+ */
237
+ export declare type FirestoreModelNames<I extends FirestoreModelIdentity> = FirestoreModelTypes<I>;
@@ -1,40 +1,105 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeFirestoreCollection = exports.firestoreModelKey = exports.firestoreModelIdentity = void 0;
3
+ exports.makeFirestoreCollection = exports.childFirestoreModelKeyPath = exports.firestoreModelKeyPath = exports.firestoreModelKeys = exports.firestoreModelKey = exports.firestoreModelKeyPart = exports.firestoreModelType = exports.firestoreModelIdentity = void 0;
4
4
  const document_1 = require("../accessor/document");
5
5
  const iterator_1 = require("../query/iterator");
6
6
  const query_1 = require("../query/query");
7
7
  const collection_query_1 = require("./collection.query");
8
- function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, collectionName) {
8
+ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, inputCollectionName) {
9
9
  var _a, _b;
10
10
  if (typeof parentOrModelName === 'object') {
11
+ const collectionName = (_a = inputCollectionName) !== null && _a !== void 0 ? _a : collectionNameOrModelName.toLowerCase();
11
12
  return {
12
13
  type: 'nested',
13
14
  parent: parentOrModelName,
14
- collection: (_a = collectionName) !== null && _a !== void 0 ? _a : collectionNameOrModelName.toLowerCase(),
15
- model: collectionNameOrModelName
15
+ collectionName,
16
+ collection: collectionName,
17
+ model: collectionNameOrModelName,
18
+ modelType: collectionNameOrModelName
16
19
  };
17
20
  }
18
21
  else {
22
+ const collectionName = (_b = collectionNameOrModelName) !== null && _b !== void 0 ? _b : parentOrModelName.toLowerCase();
19
23
  return {
20
24
  type: 'root',
21
- collection: (_b = collectionNameOrModelName) !== null && _b !== void 0 ? _b : parentOrModelName.toLowerCase(),
22
- model: parentOrModelName
25
+ collectionName,
26
+ collection: collectionName,
27
+ model: parentOrModelName,
28
+ modelType: parentOrModelName
23
29
  };
24
30
  }
25
31
  }
26
32
  exports.firestoreModelIdentity = firestoreModelIdentity;
27
33
  /**
28
- * Creates a firestoreModelKey for root identities.
34
+ * Reads the FirestoreModelType from a FirestoreModelType or FirestoreModelTypeRef.
35
+ *
36
+ * @param modelTypeInput
37
+ * @returns
38
+ */
39
+ function firestoreModelType(modelTypeInput) {
40
+ const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
41
+ if (!modelType) {
42
+ throw new Error('modelType is required.');
43
+ }
44
+ return modelType;
45
+ }
46
+ exports.firestoreModelType = firestoreModelType;
47
+ /**
48
+ * Creates a firestoreModelKeyPart
49
+ *
50
+ * @param identity
51
+ * @param id
52
+ * @returns
53
+ */
54
+ function firestoreModelKeyPart(identity, id) {
55
+ return `${identity.collectionName}/${id}`;
56
+ }
57
+ exports.firestoreModelKeyPart = firestoreModelKeyPart;
58
+ /**
59
+ * Creates a firestoreModelKey for RootFirestoreModelIdentity values.
29
60
  *
30
61
  * @param identity
31
62
  * @param id
32
63
  * @returns
33
64
  */
34
- function firestoreModelKey(identity, id) {
35
- return `${identity.collection}/${id}`;
65
+ exports.firestoreModelKey = firestoreModelKeyPart;
66
+ /**
67
+ * Creates an array of FirestoreCollectionModelKey values from the input ids.
68
+ *
69
+ * @param identity
70
+ * @param ids
71
+ * @returns
72
+ */
73
+ function firestoreModelKeys(identity, ids) {
74
+ return ids.map((x) => (0, exports.firestoreModelKey)(identity, x));
75
+ }
76
+ exports.firestoreModelKeys = firestoreModelKeys;
77
+ /**
78
+ * Joins together a number of FirestoreModelKeyPart values.
79
+ *
80
+ * @param parts
81
+ * @returns
82
+ */
83
+ function firestoreModelKeyPath(...parts) {
84
+ return parts.join('/');
85
+ }
86
+ exports.firestoreModelKeyPath = firestoreModelKeyPath;
87
+ /**
88
+ * Creates a number of child paths from the parent path.
89
+ *
90
+ * @param parent
91
+ * @param children
92
+ * @returns
93
+ */
94
+ function childFirestoreModelKeyPath(parent, children) {
95
+ if (Array.isArray(children)) {
96
+ return children.map((childPath) => `${parent}/${childPath}`);
97
+ }
98
+ else {
99
+ return [`${parent}/${children}`];
100
+ }
36
101
  }
37
- exports.firestoreModelKey = firestoreModelKey;
102
+ exports.childFirestoreModelKeyPath = childFirestoreModelKeyPath;
38
103
  /**
39
104
  * Creates a new FirestoreCollection from the input config.
40
105
  */
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/collection.ts"],"names":[],"mappings":";;;AACA,mDAc8B;AAC9B,gDAA0L;AAC1L,0CAA8E;AAE9E,yDAAsG;AA4DtG,SAAgB,sBAAsB,CAA8I,iBAAwB,EAAE,yBAAiC,EAAE,cAAkB;;IACjQ,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,iBAAsB;YAC9B,UAAU,EAAE,MAAC,cAAoB,mCAAM,yBAA+B,CAAC,WAAW,EAAQ;YAC1F,KAAK,EAAE,yBAA8B;SACtC,CAAC;KACH;SAAM;QACL,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,MAAC,yBAA+B,mCAAK,iBAAiB,CAAC,WAAW,EAAQ;YACtF,KAAK,EAAE,iBAAiB;SACzB,CAAC;KACH;AACH,CAAC;AAfD,wDAeC;AAgED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAsF,QAAW,EAAE,EAAK;IACvI,OAAO,GAAG,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAqC,CAAC;AAC3E,CAAC;AAFD,8CAEC;AAgDD;;GAEG;AACH,SAAgB,uBAAuB,CAAoC,WAA4C;IACrH,MAAM,MAAM,GAAG,WAAyE,CAAC;IAEzF,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC;IACxE,MAAwD,CAAC,SAAS,GAAG,UAAU,CAAC;IAEjF,MAAM,kBAAkB,GAAiD,IAAA,4CAAiC,EAAC,MAAM,CAAC,CAAC;IACnH,MAAM,gBAAgB,GAAmD,IAAA,2CAAgC,EAAC,MAAM,CAAC,CAAC;IAClH,MAAM,YAAY,GAA6B,IAAA,6BAAqB,EAAC,MAAM,CAAC,CAAC;IAE7E,MAAM,yBAAyB,GAAG,IAAA,oDAAyC,EAAC,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC3H,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,kDAA+B,EAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC;IACnG,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC;IAE/B,qCACE,MAAM;QACN,UAAU,EACV,SAAS,EAAE,UAAU,EACrB,gBAAgB,IACb,yBAAyB,KAC5B,kBAAkB;QAClB,KAAK;QACL,aAAa,IACb;AACJ,CAAC;AAxBD,0DAwBC"}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/collection.ts"],"names":[],"mappings":";;;AACA,mDAc8B;AAC9B,gDAA0L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AE,GAAG,YAAY,CAAC;IAE/B,qCACE,MAAM;QACN,UAAU,EACV,SAAS,EAAE,UAAU,EACrB,gBAAgB,IACb,yBAAyB,KAC5B,kBAAkB;QAClB,KAAK;QACL,aAAa,IACb;AACJ,CAAC;AAxBD,0DAwBC"}
@@ -1,7 +1,7 @@
1
1
  import { ArrayOrValue } from '@dereekb/util';
2
2
  import { DocumentReferenceRef } from '../firestore/reference';
3
- import { FirestoreModelKey, FirestoreModelName, FirestoreModelNameRef } from '../firestore/collection/collection';
4
- export interface OnCallTypedModelParams<T = unknown> extends FirestoreModelNameRef {
3
+ import { FirestoreModelKey, FirestoreModelType, FirestoreModelTypeRef } from '../firestore/collection/collection';
4
+ export interface OnCallTypedModelParams<T = unknown> extends FirestoreModelTypeRef {
5
5
  data: T;
6
6
  }
7
7
  /**
@@ -11,7 +11,7 @@ export interface OnCallTypedModelParams<T = unknown> extends FirestoreModelNameR
11
11
  * @param data
12
12
  * @returns
13
13
  */
14
- export declare function onCallTypedModelParams<T>(modelType: FirestoreModelName, data: T): OnCallTypedModelParams<T>;
14
+ export declare function onCallTypedModelParams<T>(modelTypeInput: FirestoreModelType | FirestoreModelTypeRef, data: T): OnCallTypedModelParams<T>;
15
15
  /**
16
16
  * Key used on the front-end and backend that refers to a specific function for creating models.
17
17
  */
@@ -9,7 +9,11 @@ const util_1 = require("@dereekb/util");
9
9
  * @param data
10
10
  * @returns
11
11
  */
12
- function onCallTypedModelParams(modelType, data) {
12
+ function onCallTypedModelParams(modelTypeInput, data) {
13
+ const modelType = typeof modelTypeInput === 'string' ? modelTypeInput : modelTypeInput.modelType;
14
+ if (!modelType) {
15
+ throw new Error('modelType is required.');
16
+ }
13
17
  return {
14
18
  modelType,
15
19
  data
@@ -1 +1 @@
1
- {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/model/function.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAQtD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAI,SAA6B,EAAE,IAAO;IAC9E,OAAO;QACL,SAAS;QACT,IAAI;KACL,CAAC;AACJ,CAAC;AALD,wDAKC;AAED;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAI3D;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAG3D;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAY3D,SAAgB,+BAA+B,CAAC,MAAmD;IACjG,OAAO,uBAAuB,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACjF,CAAC;AAFD,0EAEC;AAED,SAAgB,uBAAuB,CAAC,SAA0C;IAChF,OAAO;QACL,SAAS,EAAE,IAAA,cAAO,EAAC,SAAS,CAAC;KAC9B,CAAC;AACJ,CAAC;AAJD,0DAIC"}
1
+ {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/model/function.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAQtD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAI,cAA0D,EAAE,IAAO;IAC3G,MAAM,SAAS,GAAG,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC;IAEjG,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;KAC3C;IAED,OAAO;QACL,SAAS;QACT,IAAI;KACL,CAAC;AACJ,CAAC;AAXD,wDAWC;AAED;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAI3D;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAG3D;;GAEG;AACU,QAAA,6BAA6B,GAAG,aAAa,CAAC;AAY3D,SAAgB,+BAA+B,CAAC,MAAmD;IACjG,OAAO,uBAAuB,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACjF,CAAC;AAFD,0EAEC;AAED,SAAgB,uBAAuB,CAAC,SAA0C;IAChF,OAAO;QACL,SAAS,EAAE,IAAA,cAAO,EAAC,SAAS,CAAC;KAC9B,CAAC;AACJ,CAAC;AAJD,0DAIC"}
@@ -1,7 +1,7 @@
1
1
  import { GrantedRole } from '@dereekb/model';
2
2
  import { Getter, SetIncludesMode, ArrayOrValue, UseAsync, UsePromiseFunction } from '@dereekb/util';
3
3
  import { FirestoreDocument } from '../firestore/accessor/document';
4
- import { FirestoreModelIdentity, FirestoreModelKey, FirestoreModelNames } from '../firestore/collection/collection';
4
+ import { FirestoreModelIdentity, FirestoreModelKey, FirestoreModelTypes } from '../firestore/collection/collection';
5
5
  import { FirebaseModelCollectionLoader, FirebaseModelLoader, InContextFirebaseModelLoader } from './model/model.loader';
6
6
  import { InContextFirebaseModelPermissionService, FirebasePermissionContext, FirebaseModelPermissionService, FirebasePermissionServiceInstanceDelegate, InModelContextFirebaseModelPermissionService, FirebasePermissionErrorContext } from './permission';
7
7
  import { ContextGrantedModelRolesReader } from './permission/permission.service.role';
@@ -29,7 +29,7 @@ export declare type InModelContextFirebaseModelService<C, T, D extends Firestore
29
29
  export declare type InModelContextFirebaseModelServiceUseFunction<C, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = (roles: ArrayOrValue<R>, setIncludes?: SetIncludesMode) => UsePromiseFunction<ContextGrantedModelRolesReader<C, T, D, R>>;
30
30
  export declare function inContextFirebaseModelServiceFactory<C, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(factory: FirebaseModelServiceGetter<C, T, D, R>): InContextFirebaseModelServiceFactory<C, T, D, R>;
31
31
  export declare type FirebaseModelsServiceFactory<C extends FirebaseModelServiceContext, I extends FirestoreModelIdentity = FirestoreModelIdentity> = {
32
- [J in FirestoreModelNames<I>]: FirebaseModelServiceGetter<C, any>;
32
+ [J in FirestoreModelTypes<I>]: FirebaseModelServiceGetter<C, any>;
33
33
  };
34
34
  /**
35
35
  * Function that returns a configured service corresponding with the requested function, and for that context.
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [8.2.0](https://github.com/dereekb/dbx-components/compare/v8.1.2-dev...v8.2.0) (2022-06-20)
6
+
7
+
8
+ ### Features
9
+
10
+ * added DbxRouteParamReader ([a855283](https://github.com/dereekb/dbx-components/commit/a8552835aabbfa85814984a8fdafd7bd1fb2963e))
11
+
12
+
13
+
14
+ ## [8.1.2](https://github.com/dereekb/dbx-components/compare/v8.1.1-dev...v8.1.2) (2022-06-19)
15
+
16
+
17
+
18
+ ## [8.1.1](https://github.com/dereekb/dbx-components/compare/v8.1.0-dev...v8.1.1) (2022-06-18)
19
+
20
+
21
+
5
22
  # [8.1.0](https://github.com/dereekb/dbx-components/compare/v8.0.1-dev...v8.1.0) (2022-06-18)
6
23
 
7
24
 
package/test/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/test",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "main": "./src/index.js",
5
5
  "typings": "./src/index.d.ts",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
- "@dereekb/util/test": "8.1.0",
9
- "@dereekb/util": "8.1.0",
8
+ "@dereekb/util/test": "8.2.0",
9
+ "@dereekb/util": "8.2.0",
10
10
  "make-error": "^1.3.0",
11
11
  "ts-essentials": "^9.1.2",
12
12
  "extra-set": "^2.2.11",
13
- "@dereekb/firebase": "8.1.0",
13
+ "@dereekb/firebase": "8.2.0",
14
14
  "rxfire": "^6.0.3",
15
15
  "rxjs": "^7.0.0",
16
16
  "firebase": "^9.8.0",
17
- "@dereekb/rxjs": "8.1.0",
17
+ "@dereekb/rxjs": "8.2.0",
18
18
  "ms": "^3.0.0-canary.1",
19
- "@dereekb/model": "8.1.0",
19
+ "@dereekb/model": "8.2.0",
20
20
  "class-transformer": "^0.5.1",
21
21
  "class-validator": "^0.13.2",
22
- "@dereekb/date": "8.1.0",
22
+ "@dereekb/date": "8.2.0",
23
23
  "date-fns": "^2.28.0",
24
24
  "date-fns-tz": "^1.3.0",
25
25
  "rrule": "2.7.0",
@@ -1,5 +1,5 @@
1
1
  import { Maybe } from '@dereekb/util';
2
- import { CollectionReference, FirestoreCollection, FirestoreContext, AbstractFirestoreDocument, SingleItemFirestoreCollection, FirestoreCollectionWithParent, AbstractFirestoreDocumentWithParent, ExpectedFirestoreModelData, FirestoreModelData, CollectionGroup, FirestoreCollectionGroup, FirestoreModelIdentity, UserRelated, UserRelatedById } from '@dereekb/firebase';
2
+ import { CollectionReference, FirestoreCollection, FirestoreContext, AbstractFirestoreDocument, SingleItemFirestoreCollection, FirestoreCollectionWithParent, AbstractFirestoreDocumentWithParent, ExpectedFirestoreModelData, FirestoreModelData, CollectionGroup, FirestoreCollectionGroup, UserRelated, UserRelatedById } from '@dereekb/firebase';
3
3
  import { GrantedReadRole } from '@dereekb/model';
4
4
  export declare type MockItemTypes = typeof mockItemIdentity | typeof mockItemPrivateIdentity | typeof mockItemUserIdentity | typeof mockItemSubItemIdentity | typeof mockItemSubItemDeepIdentity;
5
5
  export declare const mockItemIdentity: import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">;
@@ -14,7 +14,7 @@ export interface MockItem {
14
14
  test: boolean;
15
15
  }
16
16
  export declare type MockItemRoles = GrantedReadRole | 'admin';
17
- export declare class MockItemDocument extends AbstractFirestoreDocument<MockItem, MockItemDocument> {
17
+ export declare class MockItemDocument extends AbstractFirestoreDocument<MockItem, MockItemDocument, typeof mockItemIdentity> {
18
18
  get modelIdentity(): import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">;
19
19
  }
20
20
  /**
@@ -61,7 +61,7 @@ export declare type MockItemPrivateRoles = GrantedReadRole | 'admin';
61
61
  /**
62
62
  * FirestoreDocument for MockItem
63
63
  */
64
- export declare class MockItemPrivateDocument extends AbstractFirestoreDocument<MockItemPrivate, MockItemPrivateDocument> {
64
+ export declare class MockItemPrivateDocument extends AbstractFirestoreDocument<MockItemPrivate, MockItemPrivateDocument, typeof mockItemPrivateIdentity> {
65
65
  get modelIdentity(): import("@dereekb/firebase").FirestoreModelIdentityWithParent<import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">, "mockItemPrivate", "mip">;
66
66
  }
67
67
  export declare type MockItemPrivateData = FirestoreModelData<MockItemPrivate, {}>;
@@ -102,7 +102,7 @@ export declare type MockItemUserRoles = GrantedReadRole | 'admin';
102
102
  /**
103
103
  * FirestoreDocument for MockItem
104
104
  */
105
- export declare class MockItemUserDocument extends AbstractFirestoreDocument<MockItemUser, MockItemUserDocument> {
105
+ export declare class MockItemUserDocument extends AbstractFirestoreDocument<MockItemUser, MockItemUserDocument, typeof mockItemUserIdentity> {
106
106
  get modelIdentity(): import("@dereekb/firebase").FirestoreModelIdentityWithParent<import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">, "mockItemUser", "miu">;
107
107
  }
108
108
  export declare type MockItemUserData = FirestoreModelData<MockItemUser, {}>;
@@ -148,8 +148,8 @@ export declare type MockItemSubItemRoles = GrantedReadRole | 'admin';
148
148
  /**
149
149
  * FirestoreDocument for MockItem
150
150
  */
151
- export declare class MockItemSubItemDocument extends AbstractFirestoreDocumentWithParent<MockItem, MockItemSubItem, MockItemSubItemDocument> {
152
- get modelIdentity(): FirestoreModelIdentity;
151
+ export declare class MockItemSubItemDocument extends AbstractFirestoreDocumentWithParent<MockItem, MockItemSubItem, MockItemSubItemDocument, typeof mockItemSubItemIdentity> {
152
+ get modelIdentity(): import("@dereekb/firebase").FirestoreModelIdentityWithParent<import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">, "mockItemSub", "misi">;
153
153
  }
154
154
  export declare type MockItemSubItemData = ExpectedFirestoreModelData<MockItemSubItem>;
155
155
  /**
@@ -176,7 +176,7 @@ export declare type MockItemSubItemDeepRoles = GrantedReadRole | 'admin';
176
176
  /**
177
177
  * FirestoreDocument for MockSubItem
178
178
  */
179
- export declare class MockItemSubItemDeepDocument extends AbstractFirestoreDocumentWithParent<MockItemSubItem, MockItemSubItemDeep, MockItemSubItemDeepDocument> {
179
+ export declare class MockItemSubItemDeepDocument extends AbstractFirestoreDocumentWithParent<MockItemSubItem, MockItemSubItemDeep, MockItemSubItemDeepDocument, typeof mockItemSubItemDeepIdentity> {
180
180
  get modelIdentity(): import("@dereekb/firebase").FirestoreModelIdentityWithParent<import("@dereekb/firebase").FirestoreModelIdentityWithParent<import("@dereekb/firebase").RootFirestoreModelIdentity<"mockItem", "mi">, "mockItemSub", "misi">, "mockItemSubItemDeep", "misid">;
181
181
  }
182
182
  export declare type MockItemSubItemDeepData = ExpectedFirestoreModelData<MockItemSubItemDeep>;
@@ -27,7 +27,7 @@ exports.mockItemConverter = (0, firebase_1.snapshotConverterFunctions)({
27
27
  * @returns
28
28
  */
29
29
  function mockItemCollectionReference(context) {
30
- return context.collection(exports.mockItemIdentity.collection);
30
+ return context.collection(exports.mockItemIdentity.collectionName);
31
31
  }
32
32
  exports.mockItemCollectionReference = mockItemCollectionReference;
33
33
  function mockItemFirestoreCollection(firestoreContext) {
@@ -71,7 +71,7 @@ exports.mockItemPrivateConverter = (0, firebase_1.snapshotConverterFunctions)({
71
71
  */
72
72
  function mockItemPrivateCollectionReferenceFactory(context) {
73
73
  return (parent) => {
74
- return context.subcollection(parent.documentRef, exports.mockItemPrivateIdentity.collection);
74
+ return context.subcollection(parent.documentRef, exports.mockItemPrivateIdentity.collectionName);
75
75
  };
76
76
  }
77
77
  exports.mockItemPrivateCollectionReferenceFactory = mockItemPrivateCollectionReferenceFactory;
@@ -92,7 +92,7 @@ function mockItemPrivateFirestoreCollection(firestoreContext) {
92
92
  }
93
93
  exports.mockItemPrivateFirestoreCollection = mockItemPrivateFirestoreCollection;
94
94
  function mockItemPrivateCollectionReference(context) {
95
- return context.collectionGroup(exports.mockItemPrivateIdentity.collection);
95
+ return context.collectionGroup(exports.mockItemPrivateIdentity.collectionName);
96
96
  }
97
97
  exports.mockItemPrivateCollectionReference = mockItemPrivateCollectionReference;
98
98
  function mockItemPrivateFirestoreCollectionGroup(firestoreContext) {
@@ -197,7 +197,7 @@ exports.mockItemSubItemConverter = (0, firebase_1.snapshotConverterFunctions)({
197
197
  });
198
198
  function mockItemSubItemCollectionReferenceFactory(context) {
199
199
  return (parent) => {
200
- return context.subcollection(parent.documentRef, exports.mockItemSubItemIdentity.collection);
200
+ return context.subcollection(parent.documentRef, exports.mockItemSubItemIdentity.collectionName);
201
201
  };
202
202
  }
203
203
  exports.mockItemSubItemCollectionReferenceFactory = mockItemSubItemCollectionReferenceFactory;
@@ -217,7 +217,7 @@ function mockItemSubItemFirestoreCollection(firestoreContext) {
217
217
  }
218
218
  exports.mockItemSubItemFirestoreCollection = mockItemSubItemFirestoreCollection;
219
219
  function mockItemSubItemCollectionReference(context) {
220
- return context.collectionGroup(exports.mockItemSubItemIdentity.collection);
220
+ return context.collectionGroup(exports.mockItemSubItemIdentity.collectionName);
221
221
  }
222
222
  exports.mockItemSubItemCollectionReference = mockItemSubItemCollectionReference;
223
223
  function mockItemSubItemFirestoreCollectionGroup(firestoreContext) {
@@ -252,7 +252,7 @@ exports.mockItemSubItemDeepConverter = (0, firebase_1.snapshotConverterFunctions
252
252
  });
253
253
  function mockItemSubItemDeepCollectionReferenceFactory(context) {
254
254
  return (parent) => {
255
- return context.subcollection(parent.documentRef, exports.mockItemSubItemDeepIdentity.collection);
255
+ return context.subcollection(parent.documentRef, exports.mockItemSubItemDeepIdentity.collectionName);
256
256
  };
257
257
  }
258
258
  exports.mockItemSubItemDeepCollectionReferenceFactory = mockItemSubItemDeepCollectionReferenceFactory;
@@ -272,7 +272,7 @@ function mockItemSubItemDeepFirestoreCollection(firestoreContext) {
272
272
  }
273
273
  exports.mockItemSubItemDeepFirestoreCollection = mockItemSubItemDeepFirestoreCollection;
274
274
  function mockItemSubItemDeepCollectionReference(context) {
275
- return context.collectionGroup(exports.mockItemSubItemDeepIdentity.collection);
275
+ return context.collectionGroup(exports.mockItemSubItemDeepIdentity.collectionName);
276
276
  }
277
277
  exports.mockItemSubItemDeepCollectionReference = mockItemSubItemDeepCollectionReference;
278
278
  function mockItemSubItemDeepFirestoreCollectionGroup(firestoreContext) {
@@ -1 +1 @@
1
- {"version":3,"file":"firestore.mock.item.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAC7D,gDAyB2B;AAM3B,kBAAkB;AACL,QAAA,gBAAgB,GAAG,IAAA,iCAAsB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAgBzE,MAAa,gBAAiB,SAAQ,oCAAqD;IACzF,IAAI,aAAa;QACf,OAAO,wBAAgB,CAAC;IAC1B,CAAC;CACF;AAJD,4CAIC;AAiBD;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,qCAA0B,EAAyB;IAClF,MAAM,EAAE;QACN,KAAK,EAAE,IAAA,kCAAuB,GAAE;QAChC,IAAI,EAAE,IAAA,2BAAgB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KAC1C;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,OAAyB;IACnE,OAAO,OAAO,CAAC,UAAU,CAAC,wBAAgB,CAAC,UAAU,CAAC,CAAC;AACzD,CAAC;AAFD,kEAEC;AAID,SAAgB,2BAA2B,CAAC,gBAAkC;IAC5E,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;QAC1C,SAAS,EAAE,yBAAiB;QAC5B,aAAa,EAAE,wBAA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AAE,mCAA2B;YAC1C,SAAS,EAAE,oCAA4B;YACvC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC;YAC3B,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,2BAA2B,CAAC,CAAC,EAAE,CAAC,CAAC;YAC7D,gBAAgB;YAChB,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAdD,wFAcC;AAED,SAAgB,sCAAsC,CAAC,OAAyB;IAC9E,OAAO,OAAO,CAAC,eAAe,CAAC,mCAA2B,CAAC,UAAU,CAAC,CAAC;AACzE,CAAC;AAFD,wFAEC;AAID,SAAgB,2CAA2C,CAAC,gBAAkC;IAC5F,OAAO,gBAAgB,CAAC,wBAAwB,CAAC;QAC/C,aAAa,EAAE,mCAA2B;QAC1C,SAAS,EAAE,oCAA4B;QACvC,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,sCAAsC,CAAC,gBAAgB,CAAC;QACnE,YAAY,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC,IAAI,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,CAAC;QACzG,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AATD,kGASC"}
1
+ {"version":3,"file":"firestore.mock.item.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAC7D,gDAwB2B;AAM3B,kBAAkB;AACL,QAAA,gBAAgB,GAAG,IAAA,iCAAsB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAgBzE,MAAa,gBAAiB,SAAQ,oCAA8E;IAClH,IAAI,aAAa;QACf,OAAO,wBAAgB,CAAC;IAC1B,CAAC;CACF;AAJD,4CAIC;AAiBD;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,qCAA0B,EAAyB;IAClF,MAAM,EAAE;QACN,KAAK,E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