@dereekb/firebase 9.19.5 → 9.20.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,15 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [9.20.0](https://github.com/dereekb/dbx-components/compare/v9.19.5-dev...v9.20.0) (2022-12-19)
6
+
7
+
8
+ ### Features
9
+
10
+ * added DbxFirebaseModelTypesService ([d711abb](https://github.com/dereekb/dbx-components/commit/d711abba56b507fa53e5a907d104717ac68106ca))
11
+
12
+
13
+
5
14
  ## [9.19.5](https://github.com/dereekb/dbx-components/compare/v9.19.4-dev...v9.19.5) (2022-12-17)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "9.19.5",
3
+ "version": "9.20.0",
4
4
  "devDependencies": {
5
5
  "@firebase/rules-unit-testing": "^2.0.0"
6
6
  },
@@ -24,17 +24,17 @@
24
24
  "peerDependencies": {
25
25
  "rxjs": "^7.5.0",
26
26
  "firebase": "^9.9.2",
27
- "@dereekb/util": "9.19.5",
27
+ "@dereekb/util": "9.20.0",
28
28
  "lodash.isequal": "^4.5.0",
29
29
  "make-error": "^1.3.0",
30
30
  "class-validator": "^0.13.2",
31
31
  "ts-essentials": "^9.1.2",
32
32
  "extra-set": "^2.2.11",
33
33
  "class-transformer": "^0.5.1",
34
- "@dereekb/rxjs": "9.19.5",
34
+ "@dereekb/rxjs": "9.20.0",
35
35
  "ms": "^3.0.0-canary.1",
36
- "@dereekb/model": "9.19.5",
37
- "@dereekb/date": "9.19.5",
36
+ "@dereekb/model": "9.20.0",
37
+ "@dereekb/date": "9.20.0",
38
38
  "date-fns": "^2.29.0",
39
39
  "date-fns-tz": "^1.3.0",
40
40
  "rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",
@@ -1,4 +1,5 @@
1
1
  import { Observable, OperatorFunction } from 'rxjs';
2
+ import { FirestoreModelKeyCollectionTypePair } from '../collection/collection';
2
3
  import { DocumentDataWithIdAndKey, DocumentSnapshot } from '../types';
3
4
  import { FirestoreDocument, FirestoreDocumentData } from './document';
4
5
  export declare function latestSnapshotsFromDocuments<D extends FirestoreDocument<any>>(documents: D[]): Observable<DocumentSnapshot<FirestoreDocumentData<D>>[]>;
@@ -12,3 +13,4 @@ export declare function streamDocumentSnapshots<T, D extends FirestoreDocument<T
12
13
  * @Deprecated use latestDataFromDocuments
13
14
  */
14
15
  export declare function streamDocumentData<T, D extends FirestoreDocument<T>>(documents: D[]): Observable<DocumentDataWithIdAndKey<T>[]>;
16
+ export declare function asFirestoreModelKeyCollectionType(): OperatorFunction<string, FirestoreModelKeyCollectionTypePair>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamDocumentData = exports.streamDocumentSnapshots = exports.dataFromDocumentSnapshots = exports.latestDataFromDocuments = exports.latestSnapshotsFromDocuments = void 0;
3
+ exports.asFirestoreModelKeyCollectionType = exports.streamDocumentData = exports.streamDocumentSnapshots = exports.dataFromDocumentSnapshots = exports.latestDataFromDocuments = exports.latestSnapshotsFromDocuments = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
+ const collection_1 = require("../collection/collection");
5
6
  const document_utility_1 = require("./document.utility");
6
7
  function latestSnapshotsFromDocuments(documents) {
7
8
  return documents.length ? (0, rxjs_1.combineLatest)(documents.map((x) => x.accessor.stream())).pipe((0, rxjs_1.shareReplay)(1)) : (0, rxjs_1.of)([]);
@@ -30,4 +31,8 @@ function streamDocumentData(documents) {
30
31
  return latestDataFromDocuments(documents);
31
32
  }
32
33
  exports.streamDocumentData = streamDocumentData;
34
+ function asFirestoreModelKeyCollectionType() {
35
+ return (0, rxjs_1.map)((key) => ({ key, collectionType: (0, collection_1.firestoreModelKeyCollectionType)(key) }));
36
+ }
37
+ exports.asFirestoreModelKeyCollectionType = asFirestoreModelKeyCollectionType;
33
38
  //# sourceMappingURL=document.rxjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document.rxjs.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/accessor/document.rxjs.ts"],"names":[],"mappings":";;;AAAA,+BAAyF;AAGzF,yDAAkE;AAElE,SAAgB,4BAA4B,CAAmC,SAAc;IAC3F,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,oBAAa,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,SAAE,EAAC,EAAE,CAAC,CAAC;AACnH,CAAC;AAFD,oEAEC;AAED,SAAgB,uBAAuB,CAAmC,SAAc;IACtF,OAAO,4BAA4B,CAAI,SAAS,CAAC,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC,CAAC;AACtG,CAAC;AAFD,0DAEC;AAED,SAAgB,yBAAyB;IACvC,OAAO,IAAA,UAAG,EAAC,CAAC,CAAwB,EAAE,EAAE,CAAC,IAAA,+CAA4B,EAAI,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC;AAFD,8DAEC;AAED,eAAe;AACf;;GAEG;AACH,SAAgB,uBAAuB,CAAoC,SAAc;IACvF,OAAO,4BAA4B,CAAC,SAAS,CAAC,CAAC;AACjD,CAAC;AAFD,0DAEC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAoC,SAAc;IAClF,OAAO,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAFD,gDAEC"}
1
+ {"version":3,"file":"document.rxjs.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src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export declare type FirestoreModelType = ModelTypeString;
18
18
  */
19
19
  export declare type FirestoreCollectionName = string;
20
20
  export declare const FIRESTORE_COLLECTION_NAME_SEPARATOR = "/";
21
+ /**
22
+ * Unique identifier for a nested collection type. Is the combination of all FirestoreCollectionNames of all parents.
23
+ *
24
+ * Example: parent/parentb/collectionname
25
+ */
26
+ export declare type FirestoreCollectionType = ModelTypeString;
27
+ /**
28
+ * Reference to a FirestoreCollectionType
29
+ */
30
+ export interface FirestoreCollectionTypeRef {
31
+ readonly collectionType: FirestoreCollectionType;
32
+ }
21
33
  export declare type FirestoreModelIdentityType = 'root' | 'nested';
22
34
  /**
23
35
  * A firestore model's identity
24
36
  */
25
- export declare type FirestoreModelIdentity<M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelTypeRef<M> & FirestoreCollectionNameRef<C> & {
37
+ export declare type FirestoreModelIdentity<M extends FirestoreModelType = FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName> = FirestoreModelTypeRef<M> & FirestoreCollectionNameRef<C> & FirestoreCollectionTypeRef & {
26
38
  readonly type: FirestoreModelIdentityType;
27
39
  };
28
40
  export declare type FirestoreModelIdentityModelType<I> = I extends FirestoreModelIdentity<infer M> ? M : never;
@@ -55,6 +67,16 @@ export declare function firestoreModelIdentity<M extends FirestoreModelType>(mod
55
67
  export declare function firestoreModelIdentity<P extends FirestoreModelIdentity<string, string>, M extends FirestoreModelType>(parent: P, modelName: M): FirestoreModelIdentityWithParent<P, M, FirestoreModelDefaultCollectionName<M>>;
56
68
  export declare function firestoreModelIdentity<M extends FirestoreModelType, C extends FirestoreCollectionName = FirestoreCollectionName>(modelName: M, collectionName: C): RootFirestoreModelIdentity<M, C>;
57
69
  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>;
70
+ /**
71
+ * Map that maps FirestoreModelIdentity value's FirestoreModelType, FirestoreCollectionName, and FirestoreCollectionType value to the FirestoreModelType.
72
+ */
73
+ export declare type FirestoreModelIdentityTypeMap = Map<FirestoreModelType | FirestoreCollectionName | FirestoreCollectionType, FirestoreModelType>;
74
+ /**
75
+ * Creates a FirestoreModelIdentityTypeMap from the input identities.
76
+ * @param identities
77
+ * @returns
78
+ */
79
+ export declare function firestoreModelIdentityTypeMap(identities: Iterable<FirestoreModelIdentity>): FirestoreModelIdentityTypeMap;
58
80
  /**
59
81
  * Reference to a FirestoreModelType
60
82
  */
@@ -92,7 +114,7 @@ export interface FirestoreModelTypeModelIdentityRef<M extends FirestoreModelType
92
114
  /**
93
115
  * Reference to a FirestoreModelIdentity
94
116
  */
95
- export interface FirestoreModelIdentityRef<I extends FirestoreModelIdentity> {
117
+ export interface FirestoreModelIdentityRef<I extends FirestoreModelIdentity = FirestoreModelIdentity> {
96
118
  /**
97
119
  * Returns the FirestoreModelIdentity for this context.
98
120
  */
@@ -192,6 +214,11 @@ export interface FirestoreModelIdRef {
192
214
  * collection/12345/subcollection/67890
193
215
  */
194
216
  export declare type FirestoreModelKey = ModelKey;
217
+ /**
218
+ * FirestoreModelKey and FirestoreCollectionType ref
219
+ */
220
+ export declare type FirestoreModelKeyCollectionTypePair = FirestoreModelKeyRef & FirestoreCollectionTypeRef;
221
+ export declare function firestoreModelKeyPair(): void;
195
222
  /**
196
223
  * Firestore Model Key Regex that checks for pairs.
197
224
  */
@@ -257,8 +284,9 @@ export declare function childFirestoreModelKeyPath(parent: FirestoreModelKeyPart
257
284
  export declare type FirestoreModelCollectionAndIdPairObject = Record<FirestoreCollectionName, FirestoreModelId>;
258
285
  export declare function firestoreModelKeyPairObject(input: FirestoreModelKey | DocumentReferenceRef<unknown> | FirestoreModelKeyRef): Maybe<FirestoreModelCollectionAndIdPairObject>;
259
286
  export declare type FirestoreModelCollectionTypeArrayName = string;
287
+ export declare function firestoreModelKeyCollectionType<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<string>;
260
288
  export declare function firestoreModelKeyCollectionTypeArrayName<T = unknown>(input: ReadFirestoreModelKeyInput<T>, separator?: string): Maybe<FirestoreModelCollectionTypeArrayName>;
261
- export declare function firestoreIdentityTypeArrayName(input: FirestoreModelIdentity, separator?: string): Maybe<FirestoreModelCollectionTypeArrayName>;
289
+ export declare function firestoreIdentityTypeArrayName(input: FirestoreModelIdentity, separator?: string): FirestoreModelCollectionTypeArrayName;
262
290
  export declare type FirestoreModelCollectionTypeArray = FirestoreCollectionName[];
263
291
  export declare function firestoreIdentityTypeArray(input: FirestoreModelIdentity): FirestoreModelCollectionTypeArray;
264
292
  export declare function firestoreModelKeyCollectionTypeArray<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<FirestoreModelCollectionTypeArray>;
@@ -281,7 +309,7 @@ export interface FirestoreModelKeyRef {
281
309
  /**
282
310
  * Instance that provides several accessors for accessing documents of a collection.
283
311
  */
284
- export interface FirestoreCollectionLike<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> extends FirestoreContextReference, QueryLikeReferenceRef<T>, FirestoreItemPageIterationFactory<T>, FirestoreQueryFactory<T>, LimitedFirestoreDocumentAccessorFactory<T, D, A>, LimitedFirestoreDocumentAccessorForTransactionFactory<T, D, A>, LimitedFirestoreDocumentAccessorForWriteBatchFactory<T, D, A>, FirestoreCollectionQueryFactory<T, D> {
312
+ export interface FirestoreCollectionLike<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> extends FirestoreContextReference, FirestoreModelIdentityRef, QueryLikeReferenceRef<T>, FirestoreItemPageIterationFactory<T>, FirestoreQueryFactory<T>, LimitedFirestoreDocumentAccessorFactory<T, D, A>, LimitedFirestoreDocumentAccessorForTransactionFactory<T, D, A>, LimitedFirestoreDocumentAccessorForWriteBatchFactory<T, D, A>, FirestoreCollectionQueryFactory<T, D> {
285
313
  }
286
314
  /**
287
315
  * FirestoreCollection configuration
@@ -9,7 +9,7 @@ const collection_query_1 = require("./collection.query");
9
9
  * Creates a new FirestoreCollection from the input config.
10
10
  */
11
11
  function makeFirestoreCollectionGroup(config) {
12
- const { queryLike, firestoreContext, firestoreAccessorDriver } = config;
12
+ const { modelIdentity, queryLike, firestoreContext, firestoreAccessorDriver } = config;
13
13
  const firestoreIteration = (0, iterator_1.firestoreItemPageIterationFactory)(config);
14
14
  const documentAccessor = (0, document_1.limitedFirestoreDocumentAccessorFactory)(config);
15
15
  const queryFactory = (0, query_1.firestoreQueryFactory)(config);
@@ -18,6 +18,7 @@ function makeFirestoreCollectionGroup(config) {
18
18
  const { query } = queryFactory;
19
19
  return Object.assign(Object.assign({ config,
20
20
  queryLike,
21
+ modelIdentity,
21
22
  firestoreContext }, documentAccessorExtension), { firestoreIteration,
22
23
  query,
23
24
  queryDocument });
@@ -1 +1 @@
1
- {"version":3,"file":"collection.group.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/collection.group.ts"],"names":[],"mappings":";;;AAAA,mDAA6O;AAC7O,gDAAuJ;AAEvJ,0CAA8E;AAE9E,yDAAqE;AAerE;;GAEG;AACH,SAAgB,4BAA4B,CAAoC,MAA4C;IAC1H,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC;IACxE,MAAM,kBAAkB,GAAiD,IAAA,4CAAiC,EAAC,MAAM,CAAC,CAAC;IACnH,MAAM,gBAAgB,GAA0D,IAAA,kDAAuC,EAAC,MAAM,CAAC,CAAC;IAChI,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,SAAS;QACT,gBAAgB,IACb,yBAAyB,KAC5B,kBAAkB;QAClB,KAAK;QACL,aAAa,IACb;AACJ,CAAC;AAnBD,oEAmBC;AAED,+LAA+L;AAC/L,8LAA8L;AAE9L,oMAAoM;AACpM,iKAAiK;AAEjK,2GAA2G"}
1
+ {"version":3,"file":"collection.group.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/collection.group.ts"],"names":[],"mappings":";;;AAAA,mDAA6O;AAC7O,gDAAuJ;AAEvJ,0CAA8E;AAE9E,yDAAqE;AAerE;;GAEG;AACH,SAAgB,4BAA4B,CAAoC,MAA4C;IAC1H,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,MAAM,CAAC;IACvF,MAAM,kBAAkB,GAAiD,IAAA,4CAAiC,EAAC,MAAM,CAAC,CAAC;IACnH,MAAM,gBAAgB,GAA0D,IAAA,kDAAuC,EAAC,MAAM,CAAC,CAAC;IAChI,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,SAAS;QACT,aAAa;QACb,gBAAgB,IACb,yBAAyB,KAC5B,kBAAkB;QAClB,KAAK;QACL,aAAa,IACb;AACJ,CAAC;AApBD,oEAoBC;AAED,+LAA+L;AAC/L,8LAA8L;AAE9L,oMAAoM;AACpM,iKAAiK;AAEjK,2GAA2G"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeFirestoreCollection = exports.readFirestoreModelKey = exports.firestoreModelKeyPartPairs = exports.firestoreModelKeyCollectionTypeArray = exports.firestoreIdentityTypeArray = exports.firestoreIdentityTypeArrayName = exports.firestoreModelKeyCollectionTypeArrayName = exports.firestoreModelKeyPairObject = exports.childFirestoreModelKeyPath = exports.firestoreModelKeyPath = exports.firestoreModelKeys = exports.firestoreModelKey = exports.firestoreModelKeyPart = exports.isFirestoreModelKey = exports.FIRESTORE_MODEL_KEY_REGEX_STRICT = exports.FIRESTORE_MODEL_KEY_REGEX = exports.isFirestoreModelId = exports.FIRESTORE_MODEL_ID_REGEX = exports.inferKeyFromTwoWayFlatFirestoreModelKey = exports.twoWayFlatFirestoreModelKey = exports.flatFirestoreModelKey = exports.firestoreModelIdsFromKey = exports.firestoreModelId = exports.firestoreModelType = exports.firestoreModelIdentity = exports.FIRESTORE_COLLECTION_NAME_SEPARATOR = void 0;
3
+ exports.makeFirestoreCollection = exports.readFirestoreModelKey = exports.firestoreModelKeyPartPairs = exports.firestoreModelKeyCollectionTypeArray = exports.firestoreIdentityTypeArray = exports.firestoreIdentityTypeArrayName = exports.firestoreModelKeyCollectionTypeArrayName = exports.firestoreModelKeyCollectionType = exports.firestoreModelKeyPairObject = exports.childFirestoreModelKeyPath = exports.firestoreModelKeyPath = exports.firestoreModelKeys = exports.firestoreModelKey = exports.firestoreModelKeyPart = exports.isFirestoreModelKey = exports.FIRESTORE_MODEL_KEY_REGEX_STRICT = exports.FIRESTORE_MODEL_KEY_REGEX = exports.firestoreModelKeyPair = exports.isFirestoreModelId = exports.FIRESTORE_MODEL_ID_REGEX = exports.inferKeyFromTwoWayFlatFirestoreModelKey = exports.twoWayFlatFirestoreModelKey = exports.flatFirestoreModelKey = exports.firestoreModelIdsFromKey = exports.firestoreModelId = exports.firestoreModelType = exports.firestoreModelIdentityTypeMap = exports.firestoreModelIdentity = exports.FIRESTORE_COLLECTION_NAME_SEPARATOR = 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");
@@ -11,23 +11,43 @@ function firestoreModelIdentity(parentOrModelName, collectionNameOrModelName, in
11
11
  var _a, _b;
12
12
  if (typeof parentOrModelName === 'object') {
13
13
  const collectionName = (_a = inputCollectionName) !== null && _a !== void 0 ? _a : collectionNameOrModelName.toLowerCase();
14
+ const collectionType = `${parentOrModelName.collectionType}/${collectionName}`;
14
15
  return {
15
16
  type: 'nested',
16
17
  parent: parentOrModelName,
17
18
  collectionName,
18
- modelType: collectionNameOrModelName
19
+ modelType: collectionNameOrModelName,
20
+ collectionType
19
21
  };
20
22
  }
21
23
  else {
22
24
  const collectionName = (_b = collectionNameOrModelName) !== null && _b !== void 0 ? _b : parentOrModelName.toLowerCase();
25
+ const collectionType = collectionName;
23
26
  return {
24
27
  type: 'root',
25
28
  collectionName,
26
- modelType: parentOrModelName
29
+ modelType: parentOrModelName,
30
+ collectionType
27
31
  };
28
32
  }
29
33
  }
30
34
  exports.firestoreModelIdentity = firestoreModelIdentity;
35
+ /**
36
+ * Creates a FirestoreModelIdentityTypeMap from the input identities.
37
+ * @param identities
38
+ * @returns
39
+ */
40
+ function firestoreModelIdentityTypeMap(identities) {
41
+ let map = new Map();
42
+ (0, util_1.forEachInIterable)(identities, (x) => {
43
+ const { modelType, collectionName, collectionType } = x;
44
+ map.set(modelType, modelType);
45
+ map.set(collectionType, modelType);
46
+ map.set(collectionName, modelType);
47
+ });
48
+ return map;
49
+ }
50
+ exports.firestoreModelIdentityTypeMap = firestoreModelIdentityTypeMap;
31
51
  /**
32
52
  * Reads the FirestoreModelType from a FirestoreModelType or FirestoreModelTypeRef.
33
53
  *
@@ -130,6 +150,8 @@ function isFirestoreModelId(input) {
130
150
  return exports.FIRESTORE_MODEL_ID_REGEX.test(input);
131
151
  }
132
152
  exports.isFirestoreModelId = isFirestoreModelId;
153
+ function firestoreModelKeyPair() { }
154
+ exports.firestoreModelKeyPair = firestoreModelKeyPair;
133
155
  /**
134
156
  * Firestore Model Key Regex that checks for pairs.
135
157
  */
@@ -212,14 +234,17 @@ function firestoreModelKeyPairObject(input) {
212
234
  return object;
213
235
  }
214
236
  exports.firestoreModelKeyPairObject = firestoreModelKeyPairObject;
237
+ function firestoreModelKeyCollectionType(input) {
238
+ return firestoreModelKeyCollectionTypeArrayName(input, exports.FIRESTORE_COLLECTION_NAME_SEPARATOR);
239
+ }
240
+ exports.firestoreModelKeyCollectionType = firestoreModelKeyCollectionType;
215
241
  function firestoreModelKeyCollectionTypeArrayName(input, separator = exports.FIRESTORE_COLLECTION_NAME_SEPARATOR) {
216
242
  var _a;
217
243
  return (_a = firestoreModelKeyCollectionTypeArray(input)) === null || _a === void 0 ? void 0 : _a.join(separator);
218
244
  }
219
245
  exports.firestoreModelKeyCollectionTypeArrayName = firestoreModelKeyCollectionTypeArrayName;
220
246
  function firestoreIdentityTypeArrayName(input, separator = exports.FIRESTORE_COLLECTION_NAME_SEPARATOR) {
221
- var _a;
222
- return (_a = firestoreIdentityTypeArray(input)) === null || _a === void 0 ? void 0 : _a.join(separator);
247
+ return firestoreIdentityTypeArray(input).join(separator);
223
248
  }
224
249
  exports.firestoreIdentityTypeArrayName = firestoreIdentityTypeArrayName;
225
250
  function firestoreIdentityTypeArray(input) {
@@ -296,7 +321,7 @@ exports.readFirestoreModelKey = readFirestoreModelKey;
296
321
  */
297
322
  function makeFirestoreCollection(inputConfig) {
298
323
  const config = inputConfig;
299
- const { collection, firestoreContext, firestoreAccessorDriver } = config;
324
+ const { modelIdentity, collection, firestoreContext, firestoreAccessorDriver } = config;
300
325
  config.queryLike = collection;
301
326
  const firestoreIteration = (0, iterator_1.firestoreItemPageIterationFactory)(config);
302
327
  const documentAccessor = (0, document_1.firestoreDocumentAccessorFactory)(config);
@@ -305,6 +330,7 @@ function makeFirestoreCollection(inputConfig) {
305
330
  const { queryDocument } = (0, collection_query_1.firestoreCollectionQueryFactory)(queryFactory, documentAccessorExtension);
306
331
  const { query } = queryFactory;
307
332
  return Object.assign(Object.assign({ config,
333
+ modelIdentity,
308
334
  collection, queryLike: collection, firestoreContext }, documentAccessorExtension), { firestoreIteration,
309
335
  query,
310
336
  queryDocument });
@@ -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;AACtG,wCAA8I;AAgBjI,QAAA,mCAAmC,GAAG,GAAG,CAAC;AA+CvD,SAAgB,sBAAsB,CAA8I,iBAAwB,EAAE,yBAAiC,EAAE,mBAAuB;;IACtQ,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,MAAM,cAAc,GAAG,MAAC,mBAAyB,mCAAM,yBAA+B,CAAC,WAAW,EAAQ,CAAC;QAC3G,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,iBAAsB;YAC9B,cAAc;YACd,SAAS,EAAE,yBAA8B;SAC1C,CAAC;KACH;SAAM;QACL,MAAM,cAAc,GAAG,MAAC,yBAA+B,mCAAK,iBAAiB,CAAC,WAAW,EAAQ,CAAC;QAClG,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,cAAc;YACd,SAAS,EAAE,iBAAiB;SAC7B,CAAC;KACH;AACH,CAAC;AAjBD,wDAiBC;AAYD;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,cAA0D;IAC3F,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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AyC,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;AAC1L,0CAA8E;AAE9E,yDAAsG;AACtG,wCAAoL;AAgBvK,QAAA,mCAAmC,GAAG,GAAG,CAAC;AA8DvD,SAAgB,sBAAsB,CAA8I,iBAAwB,EAAE,yBAAiC,EAAE,mBAAuB;;IACtQ,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QACzC,MAAM,cAAc,GAAG,MAAC,mBAAyB,mCAAM,yBAA+B,CAAC,WAAW,EAAQ,CAAC;QAC3G,MAAM,cAAc,GAAG,GAAG,iBAAiB,CAAC,cAAc,IAAI,cAAc,EAAE,CAAC;QAC/E,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,iBAAsB;YAC9B,cAAc;YACd,SAAS,EAAE,yBAA8B;YACzC,cAAc;SACf,CAAC;KACH;SAAM;QACL,MAAM,cAAc,GAAG,MAAC,yBAA+B,mCAAK,iBAAiB,CAAC,WAAW,EAAQ,CAAC;QAClG,MAAM,cAAc,GAAG,cAAc,CAAC;QACtC,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,cAAc;YACd,SAAS,EAAE,iBAAiB;YAC5B,cAAc;SACf,CAAC;KACH;AACH,CAAC;AArBD,wDAqBC;AAOD;;;;GAIG;AACH,S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CAAC;AAzBD,0DAyBC"}
@@ -1,5 +1,6 @@
1
1
  import { FirebaseTransactionContext, FirestoreCollectionLike, FirestoreDocument, FirestoreModelKey } from '../../firestore';
2
2
  import { InContextModelLoader, ModelLoader } from '@dereekb/model';
3
+ import { Getter } from '@dereekb/util';
3
4
  export declare type FirebaseModelLoaderContext = FirebaseTransactionContext;
4
5
  export declare type FirebaseModelGetFirestoreCollectionFunction<C extends FirebaseModelLoaderContext, T, D extends FirestoreDocument<T>> = (context: C) => FirestoreCollectionLike<T, D>;
5
6
  export interface FirebaseModelCollectionLoader<C extends FirebaseModelLoaderContext, T, D extends FirestoreDocument<T>> {
@@ -17,6 +18,9 @@ export interface FirebaseModelLoader<C extends FirebaseModelLoaderContext, T, D
17
18
  loadModelForKey(key: FirestoreModelKey, context: C): D;
18
19
  }
19
20
  export declare function firebaseModelLoader<C extends FirebaseModelLoaderContext, T, D extends FirestoreDocument<T>>(getFirestoreCollection: FirebaseModelGetFirestoreCollectionFunction<C, T, D>): FirebaseModelLoader<C, T, D>;
21
+ export interface InContextFirebaseModelCollectionLoader<T, D extends FirestoreDocument<T>> {
22
+ getFirestoreCollection: Getter<FirestoreCollectionLike<T, D>>;
23
+ }
20
24
  export interface InContextFirebaseModelLoader<T, D extends FirestoreDocument<T>> extends InContextModelLoader<D> {
21
25
  loadModelForKey(key: FirestoreModelKey): D;
22
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"model.loader.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/model/model/model.loader.ts"],"names":[],"mappings":";;;AAuBA,SAAgB,mBAAmB,CAA0E,sBAA4E;IACvL,OAAO;QACL,eAAe,CAAC,GAAsB,EAAE,OAAU;YAChD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,gBAAwD,CAAC;YAE7D,IAAI,OAAO,CAAC,WAAW,EAAE;gBACvB,gBAAgB,GAAG,mBAAmB,CAAC,8BAA8B,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aAC5F;iBAAM;gBACL,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,CAAC;aAC3D;YAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;YAC1D,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC;AAhBD,kDAgBC"}
1
+ {"version":3,"file":"model.loader.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/model/model/model.loader.ts"],"names":[],"mappings":";;;AAwBA,SAAgB,mBAAmB,CAA0E,sBAA4E;IACvL,OAAO;QACL,eAAe,CAAC,GAAsB,EAAE,OAAU;YAChD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,gBAAwD,CAAC;YAE7D,IAAI,OAAO,CAAC,WAAW,EAAE;gBACvB,gBAAgB,GAAG,mBAAmB,CAAC,8BAA8B,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aAC5F;iBAAM;gBACL,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,CAAC;aAC3D;YAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;YAC1D,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC;AAhBD,kDAgBC"}
@@ -1,12 +1,12 @@
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, FirestoreModelTypes, ReadFirestoreModelKeyInput } from '../firestore/collection/collection';
5
- import { FirebaseModelCollectionLoader, FirebaseModelLoader, InContextFirebaseModelLoader } from './model/model.loader';
4
+ import { FirestoreModelIdentity, FirestoreModelKey, FirestoreModelType, FirestoreModelTypes, ReadFirestoreModelKeyInput } from '../firestore/collection/collection';
5
+ import { FirebaseModelCollectionLoader, FirebaseModelLoader, InContextFirebaseModelCollectionLoader, 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';
8
8
  export declare type FirebaseModelServiceContext = FirebasePermissionContext & FirebasePermissionErrorContext;
9
- export interface FirebaseModelService<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> extends FirebaseModelPermissionService<C, T, D, R>, FirebaseModelLoader<C, T, D> {
9
+ export interface FirebaseModelService<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> extends FirebaseModelPermissionService<C, T, D, R>, FirebaseModelLoader<C, T, D>, FirebaseModelCollectionLoader<any, T, D> {
10
10
  }
11
11
  export declare type FirebaseModelServiceGetter<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = Getter<FirebaseModelService<C, T, D, R>>;
12
12
  export interface FirebaseModelServiceConfig<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> extends Omit<FirebasePermissionServiceInstanceDelegate<C, T, D, R>, 'loadModelForKey'>, FirebaseModelCollectionLoader<C, T, D> {
@@ -14,13 +14,13 @@ export interface FirebaseModelServiceConfig<C extends FirebaseModelServiceContex
14
14
  export declare function firebaseModelService<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(config: FirebaseModelServiceConfig<C, T, D, R>): FirebaseModelService<C, T, D, R>;
15
15
  export declare type FirebaseModelServiceFactory<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = Getter<FirebaseModelService<C, T, D, R>>;
16
16
  export declare function firebaseModelServiceFactory<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(config: FirebaseModelServiceConfig<C, T, D, R>): FirebaseModelServiceFactory<C, T, D, R>;
17
- export declare type LimitedInContextFirebaseModelService<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = InContextFirebaseModelPermissionService<C, T, D, R> & InContextFirebaseModelLoader<T, D> & {
17
+ export declare type LimitedInContextFirebaseModelService<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = InContextFirebaseModelPermissionService<C, T, D, R> & InContextFirebaseModelLoader<T, D> & InContextFirebaseModelCollectionLoader<T, D> & {
18
18
  forKey: (key: FirestoreModelKey) => InModelContextFirebaseModelService<C, T, D, R>;
19
19
  };
20
20
  export declare type InContextFirebaseModelService<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = InModelContextFirebaseModelServiceFactory<C, T, D, R> & LimitedInContextFirebaseModelService<C, T, D, R>;
21
21
  export declare type InContextFirebaseModelServiceFactory<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = (context: C) => InContextFirebaseModelService<C, T, D, R>;
22
22
  export declare type InModelContextFirebaseModelServiceFactory<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = (modelOrKey: D | FirestoreModelKey) => InModelContextFirebaseModelService<C, T, D, R>;
23
- export declare type InModelContextFirebaseModelService<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = InModelContextFirebaseModelPermissionService<C, T, D, R> & InModelContextFirebaseModelServiceUseFunction<C, T, D, R> & {
23
+ export declare type InModelContextFirebaseModelService<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole> = InModelContextFirebaseModelPermissionService<C, T, D, R> & InModelContextFirebaseModelServiceUseFunction<C, T, D, R> & InContextFirebaseModelCollectionLoader<T, D> & {
24
24
  roleReader: () => Promise<ContextGrantedModelRolesReader<C, T, D, R>>;
25
25
  requireRole: (roles: ArrayOrValue<R>, setIncludes?: SetIncludesMode) => Promise<ContextGrantedModelRolesReader<C, T, D, R>>;
26
26
  requireUse: InModelContextFirebaseModelServiceUseFunction<C, T, D, R>;
@@ -31,10 +31,13 @@ export declare function inContextFirebaseModelServiceFactory<C extends FirebaseM
31
31
  export declare type FirebaseModelsServiceFactory<C extends FirebaseModelServiceContext, I extends FirestoreModelIdentity = FirestoreModelIdentity> = {
32
32
  [J in FirestoreModelTypes<I>]: FirebaseModelServiceGetter<C, any>;
33
33
  };
34
+ export declare type FirebaseModelsServiceTypesAccessor = {
35
+ allTypes(): FirestoreModelType[];
36
+ };
34
37
  /**
35
38
  * Function that returns a configured service corresponding with the requested function, and for that context.
36
39
  */
37
- export declare type FirebaseModelsService<X extends FirebaseModelsServiceFactory<C>, C extends FirebaseModelServiceContext> = <K extends keyof X>(type: K, context: C) => X[K] extends FirebaseModelServiceGetter<C, infer T, infer D, infer R> ? InContextFirebaseModelService<C, T, D, R> : never;
40
+ export declare type FirebaseModelsService<X extends FirebaseModelsServiceFactory<C>, C extends FirebaseModelServiceContext> = (<K extends keyof X>(type: K, context: C) => X[K] extends FirebaseModelServiceGetter<C, infer T, infer D, infer R> ? InContextFirebaseModelService<C, T, D, R> : never) & FirebaseModelsServiceTypesAccessor;
38
41
  export declare type FirebaseModelsServiceTypes<S extends FirebaseModelsService<any, any>> = S extends FirebaseModelsService<infer X, any> ? keyof X : never;
39
42
  /**
40
43
  * Creates a new FirebaseModelsService.
@@ -52,8 +55,8 @@ export declare type FirebaseModelsServiceTypes<S extends FirebaseModelsService<a
52
55
  * @returns
53
56
  */
54
57
  export declare function firebaseModelsService<X extends FirebaseModelsServiceFactory<C, I>, C extends FirebaseModelServiceContext, I extends FirestoreModelIdentity = FirestoreModelIdentity>(services: X): FirebaseModelsService<X, C>;
55
- export declare type InContextFirebaseModelsService<Y> = Y extends FirebaseModelsService<infer X, infer C> ? <K extends keyof X>(type: K) => X[K] extends FirebaseModelServiceGetter<C, infer T, infer D, infer R> ? InContextFirebaseModelService<C, T, D, R> : never : never;
56
- export declare type InContextFirebaseModelsServiceFactory<Y> = Y extends FirebaseModelsService<infer X, infer C> ? (context: C) => InContextFirebaseModelsService<Y> : never;
58
+ export declare type InContextFirebaseModelsService<Y> = FirebaseModelsServiceTypesAccessor & (Y extends FirebaseModelsService<infer X, infer C> ? <K extends keyof X>(type: K) => X[K] extends FirebaseModelServiceGetter<C, infer T, infer D, infer R> ? InContextFirebaseModelService<C, T, D, R> : never : never);
59
+ export declare type InContextFirebaseModelsServiceFactory<Y> = FirebaseModelsServiceTypesAccessor & (Y extends FirebaseModelsService<infer X, infer C> ? (context: C) => InContextFirebaseModelsService<Y> : never);
57
60
  /**
58
61
  * Creates a InContextFirebaseModelsServiceFactory for a particular service.
59
62
  *
@@ -75,3 +78,4 @@ export declare type UseFirebaseModelsServiceSelectionResult<Y extends FirebaseMo
75
78
  export declare type UseFirebaseModelsServiceSelectionUseFunction<Y extends FirebaseModelsService<any, any>, T extends FirebaseModelsServiceTypes<Y>, O> = Y extends FirebaseModelsService<infer X, infer C> ? (T extends keyof X ? (X[T] extends FirebaseModelServiceGetter<C, infer T, infer D, infer R> ? UseAsync<ContextGrantedModelRolesReader<C, T, D, R>, O> : never) : never) : never;
76
79
  export declare function selectFromFirebaseModelsService<Y extends FirebaseModelsService<any, any>, T extends FirebaseModelsServiceTypes<Y>>(service: Y, type: T, select: FirebaseModelsServiceSelection<Y, T>): FirebaseModelsServiceSelectionResult<Y, T>;
77
80
  export declare function useFirebaseModelsService<Y extends FirebaseModelsService<any, any>, T extends FirebaseModelsServiceTypes<Y>>(service: Y, type: T, select: UseFirebaseModelsServiceSelection<Y, T>): UseFirebaseModelsServiceSelectionResult<Y, T>;
81
+ export declare function buildFirebaseCollectionTypeModelTypeMap<Y extends FirebaseModelsService<any, any>>(inContextFirebaseModelsService: InContextFirebaseModelsService<Y>): import("../firestore/collection/collection").FirestoreModelIdentityTypeMap;
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  // The use of any here does not degrade the type-safety. The correct type is inferred in most cases.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.useFirebaseModelsService = exports.selectFromFirebaseModelsService = exports.inContextFirebaseModelsServiceFactory = exports.firebaseModelsService = exports.inContextFirebaseModelServiceFactory = exports.firebaseModelServiceFactory = exports.firebaseModelService = void 0;
5
+ exports.buildFirebaseCollectionTypeModelTypeMap = exports.useFirebaseModelsService = exports.selectFromFirebaseModelsService = exports.inContextFirebaseModelsServiceFactory = exports.firebaseModelsService = exports.inContextFirebaseModelServiceFactory = exports.firebaseModelServiceFactory = exports.firebaseModelService = void 0;
6
6
  const util_1 = require("@dereekb/util");
7
7
  const collection_1 = require("../firestore/collection/collection");
8
8
  const model_loader_1 = require("./model/model.loader");
@@ -17,6 +17,7 @@ function firebaseModelService(config) {
17
17
  });
18
18
  const permissionService = (0, permission_1.firebaseModelPermissionService)(permissionServiceDelegate);
19
19
  const service = {
20
+ getFirestoreCollection: config.getFirestoreCollection,
20
21
  roleMapForModelContext: (model, context) => permissionService.roleMapForModelContext(model, context),
21
22
  roleMapForKeyContext: (key, context) => permissionService.roleMapForKeyContext(key, context),
22
23
  loadModelForKey: permissionServiceDelegate.loadModelForKey
@@ -31,6 +32,7 @@ exports.firebaseModelServiceFactory = firebaseModelServiceFactory;
31
32
  function inContextFirebaseModelServiceFactory(factory) {
32
33
  return (context) => {
33
34
  const firebaseModelService = factory();
35
+ const getFirestoreCollection = () => firebaseModelService.getFirestoreCollection(context);
34
36
  const base = (modelOrKey) => {
35
37
  const model = typeof modelOrKey === 'string' ? firebaseModelService.loadModelForKey(modelOrKey, context) : modelOrKey;
36
38
  const roleReader = () => (0, permission_service_role_1.contextGrantedModelRolesReader)(inModelContextService);
@@ -44,6 +46,7 @@ function inContextFirebaseModelServiceFactory(factory) {
44
46
  x.roleReader = roleReader;
45
47
  x.requireRole = requireRole;
46
48
  x.requireUse = requireUse;
49
+ x.getFirestoreCollection = getFirestoreCollection;
47
50
  x.use = (0, util_1.usePromise)(roleReader);
48
51
  }
49
52
  });
@@ -56,6 +59,7 @@ function inContextFirebaseModelServiceFactory(factory) {
56
59
  x.roleMapForModel = (model) => firebaseModelService.roleMapForModelContext(model, context);
57
60
  x.roleMapForKey = (key) => firebaseModelService.roleMapForKeyContext(key, context);
58
61
  x.loadModelForKey = (key) => firebaseModelService.loadModelForKey(key, context);
62
+ x.getFirestoreCollection = getFirestoreCollection;
59
63
  }
60
64
  });
61
65
  return service;
@@ -84,6 +88,7 @@ function firebaseModelsService(services) {
84
88
  const service = inContextFirebaseModelServiceFactory(firebaseModelService)(contextWithService);
85
89
  return service;
86
90
  };
91
+ firebaseModelsServiceFunction.allTypes = (0, util_1.cachedGetter)(() => Object.keys(services));
87
92
  return firebaseModelsServiceFunction;
88
93
  }
89
94
  exports.firebaseModelsService = firebaseModelsService;
@@ -94,10 +99,13 @@ exports.firebaseModelsService = firebaseModelsService;
94
99
  * @returns
95
100
  */
96
101
  function inContextFirebaseModelsServiceFactory(service) {
97
- const inContextFirebaseModelsServiceFactory = (context) => {
98
- return (type) => service(type, context);
102
+ const newInContextFirebaseModelsServiceFactory = (context) => {
103
+ const result = (type) => service(type, context);
104
+ result.allTypes = service.allTypes;
105
+ return result;
99
106
  };
100
- return inContextFirebaseModelsServiceFactory;
107
+ newInContextFirebaseModelsServiceFactory.allTypes = service.allTypes;
108
+ return newInContextFirebaseModelsServiceFactory;
101
109
  }
102
110
  exports.inContextFirebaseModelsServiceFactory = inContextFirebaseModelsServiceFactory;
103
111
  function selectFromFirebaseModelsService(service, type, select) {
@@ -117,4 +125,14 @@ function useFirebaseModelsService(service, type, select) {
117
125
  return result;
118
126
  }
119
127
  exports.useFirebaseModelsService = useFirebaseModelsService;
128
+ // MARK: Entity Map
129
+ function buildFirebaseCollectionTypeModelTypeMap(inContextFirebaseModelsService) {
130
+ const allTypes = inContextFirebaseModelsService.allTypes();
131
+ const modelIdentities = allTypes.map((type) => {
132
+ const service = inContextFirebaseModelsService(type);
133
+ return service.getFirestoreCollection().modelIdentity;
134
+ });
135
+ return (0, collection_1.firestoreModelIdentityTypeMap)(modelIdentities);
136
+ }
137
+ exports.buildFirebaseCollectionTypeModelTypeMap = buildFirebaseCollectionTypeModelTypeMap;
120
138
  //# sourceMappingURL=model.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/model/model.service.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,oGAAoG;;;AAGpG,wCAAqI;AAErI,mEAAuK;AACvK,uDAA6I;AAC7I,6CAA2R;AAC3R,kFAAsH;AAStH,SAAgB,oBAAoB,CAAuI,MAA8C;IACvN,MAAM,yBAAyB,GAAG,IAAA,YAAK,EAAwD;QAC7F,IAAI,EAAE,IAAA,kCAAmB,EAAC,MAAM,CAAC,sBAAsB,CAAC;QACxD,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,IAAA,2CAA8B,EAAC,yBAAyB,CAAC,CAAC;IAEpF,MAAM,OAAO,GAAqC;QAChD,sBAAsB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,iBA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,MAAM,CAAC,gBAAgB,CAAkD,CAAC;KACnI;SAAM;QACL,MAAM,GAAG,qBAAqB,CAAC,GAAoD,CAAC;KACrF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,4DAWC"}
1
+ {"version":3,"file":"model.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/model/model.service.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,oGAAoG;;;AAGpG,wCAA+I;AAE/I,mEAA0N;AAC1N,uDAAqL;AACrL,6CAA2R;AAC3R,kFAAsH;AAStH,SAAgB,oBAAoB,CAAuI,MAA8C;IACvN,MAAM,yBAAyB,GAAG,IAAA,YAAK,EAAwD;QAC7F,IAAI,EAAE,IAAA,kCAAmB,EAAC,MAAM,CAAC,sBAAsB,CAAC;QACxD,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,IAAA,2CAA8B,EAAC,yBAAyB,CAAC,CAAC;IAEpF,MAAM,OAAO,GAAqC;QAChD,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;QACrD,sBAAsB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC;QACpG,oBAAoB,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC;QAC5F,eAAe,EAAE,yBAAyB,CAAC,eAAe;KAC3D,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAlBD,oDAkBC;AAID,SAAgB,2BAA2B,CAAuI,MAA8C;IAC9N,OAAO,IAAA,mBAAY,EAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD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qB,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAkD,CAAC;KACnI;SAAM;QACL,MAAM,GAAG,qBAAqB,CAAC,GAAoD,CAAC;KACrF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,4DAWC;AAED,mBAAmB;AACnB,SAAgB,uCAAuC,CAA4C,8BAAiE;IAClK,MAAM,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,CAAC;IAC3D,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;QACrD,OAAO,OAAO,CAAC,sBAAsB,EAAE,CAAC,aAAa,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,0CAA6B,EAAC,eAAe,CAAC,CAAC;AACxD,CAAC;AARD,0FAQC"}
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [9.20.0](https://github.com/dereekb/dbx-components/compare/v9.19.5-dev...v9.20.0) (2022-12-19)
6
+
7
+
8
+
5
9
  ## [9.19.5](https://github.com/dereekb/dbx-components/compare/v9.19.4-dev...v9.19.5) (2022-12-17)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/test",
3
- "version": "9.19.5",
3
+ "version": "9.20.0",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {},
8
8
  "peerDependencies": {
9
- "@dereekb/util/test": "9.19.5",
10
- "@dereekb/util": "9.19.5",
9
+ "@dereekb/util/test": "9.20.0",
10
+ "@dereekb/util": "9.20.0",
11
11
  "lodash.isequal": "^4.5.0",
12
12
  "make-error": "^1.3.0",
13
13
  "class-validator": "^0.13.2",
14
14
  "ts-essentials": "^9.1.2",
15
15
  "extra-set": "^2.2.11",
16
- "@dereekb/firebase": "9.19.5",
16
+ "@dereekb/firebase": "9.20.0",
17
17
  "rxjs": "^7.5.0",
18
18
  "firebase": "^9.9.2",
19
19
  "class-transformer": "^0.5.1",
20
- "@dereekb/rxjs": "9.19.5",
20
+ "@dereekb/rxjs": "9.20.0",
21
21
  "ms": "^3.0.0-canary.1",
22
- "@dereekb/model": "9.19.5",
23
- "@dereekb/date": "9.19.5",
22
+ "@dereekb/model": "9.20.0",
23
+ "@dereekb/date": "9.20.0",
24
24
  "date-fns": "^2.29.0",
25
25
  "date-fns-tz": "^1.3.0",
26
26
  "rrule": "git+https://git@github.com/dereekb/rrule#2b13b1ea881059ba2ecfec380e12ef244ef54570",