@dereekb/firebase 7.2.0 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [7.5.0](https://github.com/dereekb/dbx-components/compare/v7.4.0-dev...v7.5.0) (2022-06-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * updated GrantRolesOtherwiseFunction to allow returning Maybe ([552bb9c](https://github.com/dereekb/dbx-components/commit/552bb9c488c0f11aa1aca885d00c5a7c2a199591))
11
+
12
+
13
+ ### Features
14
+
15
+ * added UseFunction, MappedUseFunction ([84b6cbe](https://github.com/dereekb/dbx-components/commit/84b6cbe23b7e020ad7de49633642429d7e32f7d4))
16
+
17
+
18
+
19
+ # [7.4.0](https://github.com/dereekb/dbx-components/compare/v7.3.0-dev...v7.4.0) (2022-06-08)
20
+
21
+
22
+ ### Features
23
+
24
+ * added grantModelRolesIfFunction and related types ([5432fab](https://github.com/dereekb/dbx-components/commit/5432fab1677c29e24eac4015c35821aba2d64e10))
25
+ * updated FirebaseServerAuthUserContext to be synchronous ([92bfd84](https://github.com/dereekb/dbx-components/commit/92bfd849b4a6d6773c616069c3085b686938ef4d))
26
+
27
+
28
+
29
+ # [7.3.0](https://github.com/dereekb/dbx-components/compare/v7.2.0-dev...v7.3.0) (2022-06-08)
30
+
31
+
32
+ ### Features
33
+
34
+ * added FirestoreMap, FirestoreArrayMap snapshot fields ([bd23fd3](https://github.com/dereekb/dbx-components/commit/bd23fd372e3f2180980d7aec9c1b6ee1ec2bb3c7))
35
+
36
+
37
+
5
38
  # [7.2.0](https://github.com/dereekb/dbx-components/compare/v7.1.0-dev...v7.2.0) (2022-06-06)
6
39
 
7
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "7.2.0",
3
+ "version": "7.5.0",
4
4
  "devDependencies": {
5
5
  "@firebase/rules-unit-testing": "^2.0.0"
6
6
  },
@@ -22,19 +22,19 @@
22
22
  "rxjs": "^7.0.0",
23
23
  "rxfire": "^6.0.3",
24
24
  "firebase": "^9.8.0",
25
- "@dereekb/util": "7.2.0",
25
+ "@dereekb/util": "7.5.0",
26
26
  "make-error": "^1.3.0",
27
27
  "ts-essentials": "^9.1.2",
28
28
  "extra-set": "^2.2.11",
29
- "@dereekb/rxjs": "7.2.0",
29
+ "@dereekb/rxjs": "7.5.0",
30
30
  "ms": "^3.0.0-canary.1",
31
- "@dereekb/date": "7.2.0",
31
+ "@dereekb/model": "7.5.0",
32
32
  "class-transformer": "^0.5.1",
33
- "date-fns": "^2.28.0",
34
33
  "class-validator": "^0.13.2",
34
+ "@dereekb/date": "7.5.0",
35
+ "date-fns": "^2.28.0",
35
36
  "date-fns-tz": "^1.3.0",
36
37
  "rrule": "git+https://git@github.com/dereekb/rrule.git#17adf5708d6567b4d01a3a8afd106261421ea492",
37
- "@dereekb/model": "7.2.0",
38
38
  "tslib": "^2.0.0"
39
39
  }
40
40
  }
@@ -1,4 +1,4 @@
1
- import { AuthClaims, AuthRoleSet, Maybe } from '@dereekb/util';
1
+ import { AuthClaims, AuthClaimsObject, AuthRoleSet, MappedUseFunction, Maybe, UseValue } from '@dereekb/util';
2
2
  import { FirebaseAuthToken } from './auth';
3
3
  /**
4
4
  * Provides a context containing FirebaseAuthContextInfo
@@ -17,17 +17,31 @@ export interface FirebaseAuthContextInfo {
17
17
  /**
18
18
  * Returns true if the user is considered a system admin.
19
19
  */
20
- isAdmin?(): boolean;
20
+ isAdmin(): boolean;
21
21
  /**
22
22
  * Retrieves the claims in the context.
23
23
  */
24
- loadClaims(): Promise<AuthClaims>;
24
+ getClaims<T extends AuthClaimsObject = AuthClaimsObject>(): AuthClaims<T>;
25
25
  /**
26
26
  * The auth roles provided by the token in this context.
27
27
  */
28
+ getAuthRoles(): AuthRoleSet;
29
+ /**
30
+ * Retrieves the claims in the context.
31
+ *
32
+ * @deprecated Claims are now available synchronously.
33
+ */
34
+ loadClaims<T extends AuthClaimsObject = AuthClaimsObject>(): Promise<AuthClaims<T>>;
35
+ /**
36
+ * The auth roles provided by the token in this context.
37
+ *
38
+ * @deprecated Auth role set is now available synchronously.
39
+ */
28
40
  loadAuthRoles(): Promise<AuthRoleSet>;
29
41
  /**
30
42
  * The token in the context.
31
43
  */
32
44
  readonly token: FirebaseAuthToken;
33
45
  }
46
+ export declare type UseFirebaseAuthContextInfo<I extends FirebaseAuthContextInfo = FirebaseAuthContextInfo> = UseValue<I>;
47
+ export declare const useContextAuth: MappedUseFunction<FirebaseAuthContext, FirebaseAuthContextInfo>;
@@ -1,3 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useContextAuth = void 0;
4
+ const util_1 = require("@dereekb/util");
5
+ exports.useContextAuth = (0, util_1.mappedUseFunction)((x) => x.auth);
3
6
  //# sourceMappingURL=auth.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.context.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/auth/auth.context.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"auth.context.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/src/lib/common/auth/auth.context.ts"],"names":[],"mappings":";;;AAAA,wCAAiI;AAwDpH,QAAA,cAAc,GAAoE,IAAA,wBAAiB,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { GrantedRole } from '@dereekb/model';
2
+ import { FirebaseAuthUserId } from '../../auth';
3
+ import { FirestoreModelId, FirestoreModelKey } from './collection';
4
+ export declare type FirestoreModelKeyMap<T> = {
5
+ [key: FirestoreModelKey]: T;
6
+ };
7
+ /**
8
+ * Array of FirestoreModelKey values.
9
+ */
10
+ export declare type FirestoreModelKeyArray = FirestoreModelKey[];
11
+ /**
12
+ * A map with a single GrantedRole provided for a given model.
13
+ */
14
+ export declare type FirestoreModelKeyGrantedRoleMap<R extends GrantedRole> = {
15
+ [key: FirestoreModelKey]: R;
16
+ };
17
+ /**
18
+ * A map with multiple GrantedRoles provided for a given model.
19
+ */
20
+ export declare type FirestoreModelKeyGrantedRoleArrayMap<R extends GrantedRole> = {
21
+ [key: FirestoreModelKey]: R[];
22
+ };
23
+ export declare type FirestoreModelIdMap<T> = {
24
+ [key: FirestoreModelId]: T;
25
+ };
26
+ /**
27
+ * Array of FirestoreModelId values.
28
+ */
29
+ export declare type FirestoreModelIdArray = FirestoreModelId[];
30
+ /**
31
+ * A map with a single GrantedRole provided for a given model.
32
+ */
33
+ export declare type FirestoreModelIdGrantedRoleMap<R extends GrantedRole> = {
34
+ [key: FirestoreModelId]: R;
35
+ };
36
+ /**
37
+ * A map with multiple GrantedRoles provided for a given model.
38
+ */
39
+ export declare type FirestoreModelIdGrantedRoleArrayMap<R extends GrantedRole> = {
40
+ [key: FirestoreModelId]: R[];
41
+ };
42
+ /**
43
+ * A map with a single GrantedRole provided for a given user.
44
+ */
45
+ export declare type FirebaseAuthUserGrantedRoleMap<R extends GrantedRole> = {
46
+ [key: FirebaseAuthUserId]: R;
47
+ };
48
+ /**
49
+ * A map with multiple GrantedRoles provided for a given user.
50
+ */
51
+ export declare type FirebaseAuthUserRoleArrayMap<R extends GrantedRole> = {
52
+ [key: FirestoreModelKey]: R[];
53
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=collection.key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.key.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/collection.key.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  export * from './collection';
2
+ export * from './collection.key';
2
3
  export * from './collection.group';
3
4
  export * from './subcollection';
4
5
  export * from './subcollection.single';
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./collection"), exports);
5
+ tslib_1.__exportStar(require("./collection.key"), exports);
5
6
  tslib_1.__exportStar(require("./collection.group"), exports);
6
7
  tslib_1.__exportStar(require("./subcollection"), exports);
7
8
  tslib_1.__exportStar(require("./subcollection.single"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,6DAAmC;AACnC,0DAAgC;AAChC,iEAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/collection/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,2DAAiC;AACjC,6DAAmC;AACnC,0DAAgC;AAChC,iEAAuC"}
@@ -47,8 +47,7 @@ export interface WhereQueryConstraintData {
47
47
  export declare function where<T>(fieldPath: keyof T, opStr: WhereFilterOp, value: unknown): FirestoreQueryConstraint<WhereQueryConstraintData>;
48
48
  export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): FirestoreQueryConstraint<WhereQueryConstraintData>;
49
49
  export declare const FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE = "where_doc_id";
50
- export interface WhereDocumentIdQueryConstraintData extends Omit<WhereQueryConstraintData, 'fieldPath'> {
51
- }
50
+ export declare type WhereDocumentIdQueryConstraintData = Omit<WhereQueryConstraintData, 'fieldPath'>;
52
51
  export declare function whereDocumentId(opStr: WhereFilterOp, value: unknown): FirestoreQueryConstraint<WhereDocumentIdQueryConstraintData>;
53
52
  export declare const FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE = "order_by";
54
53
  export declare type OrderByDirection = SortingOrder;
@@ -1,4 +1,5 @@
1
- import { ModelFieldMapFunctionsConfig, GetterOrValue, Maybe, ModelFieldMapConvertFunction, PrimativeKey, ReadKeyFunction, ModelFieldMapFunctionsWithDefaultsConfig, FindUniqueFunction, FindUniqueStringsTransformConfig, MapFunction } from '@dereekb/util';
1
+ import { GrantedRole } from '@dereekb/model';
2
+ import { ModelFieldMapFunctionsConfig, GetterOrValue, Maybe, ModelFieldMapConvertFunction, PrimativeKey, ReadKeyFunction, ModelFieldMapFunctionsWithDefaultsConfig, FindUniqueFunction, FindUniqueStringsTransformConfig, MapFunction, FilterKeyValueTuplesInput, ModelKey } from '@dereekb/util';
2
3
  export interface BaseFirestoreFieldConfig<V, D = unknown> {
3
4
  fromData: ModelFieldMapConvertFunction<D, V>;
4
5
  toData: ModelFieldMapConvertFunction<V, D>;
@@ -33,6 +34,8 @@ export declare function firestoreString(config?: FirestoreStringConfig): Firesto
33
34
  export declare function optionalFirestoreString(): ModelFieldMapFunctionsConfig<Maybe<string>, Maybe<string>>;
34
35
  export declare function firestoreUID(): FirestoreModelFieldMapFunctionsConfig<string, string>;
35
36
  export declare function optionalFirestoreUID(): ModelFieldMapFunctionsConfig<Maybe<string>, Maybe<string>>;
37
+ export declare const firestoreModelKey: FirestoreModelFieldMapFunctionsConfig<string, string>;
38
+ export declare const firestoreModelId: FirestoreModelFieldMapFunctionsConfig<string, string>;
36
39
  export declare type FirestoreDateFieldConfig = DefaultMapConfiguredFirestoreFieldConfig<Date, string> & {
37
40
  saveDefaultAsNow?: boolean;
38
41
  };
@@ -57,6 +60,18 @@ export declare type FirestoreUniqueKeyedArrayFieldConfig<T, K extends PrimativeK
57
60
  export declare function firestoreUniqueKeyedArray<T, K extends PrimativeKey = PrimativeKey>(config: FirestoreUniqueKeyedArrayFieldConfig<T, K>): FirestoreModelFieldMapFunctionsConfig<T[], T[]>;
58
61
  export declare type FirestoreUniqueStringArrayFieldConfig = Omit<FirestoreUniqueArrayFieldConfig<string>, 'findUnique'> & FindUniqueStringsTransformConfig;
59
62
  export declare function firestoreUniqueStringArray(config: FirestoreUniqueStringArrayFieldConfig): FirestoreModelFieldMapFunctionsConfig<string[], string[]>;
63
+ /**
64
+ * FirestoreField configuration for an array of ModelKey values.
65
+ *
66
+ * @returns
67
+ */
68
+ export declare function firestoreModelKeyArray(): FirestoreModelFieldMapFunctionsConfig<string[], string[]>;
69
+ /**
70
+ * FirestoreField configuration for an array of ModelId values.
71
+ *
72
+ * @returns
73
+ */
74
+ export declare const firestoreModelIdArray: typeof firestoreModelKeyArray;
60
75
  export declare type FirestoreEncodedArrayFieldConfig<T, E extends string | number> = DefaultMapConfiguredFirestoreFieldConfig<T[], E[]> & {
61
76
  readonly convert: {
62
77
  fromData: MapFunction<E, T>;
@@ -70,6 +85,64 @@ export declare type FirestoreEncodedArrayFieldConfig<T, E extends string | numbe
70
85
  * @returns
71
86
  */
72
87
  export declare function firestoreEncodedArray<T, E extends string | number>(config: FirestoreEncodedArrayFieldConfig<T, E>): FirestoreModelFieldMapFunctionsConfig<T[], E[]>;
88
+ /**
89
+ * Firestore/JSON maps only have string keys.
90
+ */
91
+ export declare type FirestoreMapFieldType<T, K extends string = string> = Record<K, T>;
92
+ export declare type FirestoreMapFieldConfig<T, K extends string = string> = DefaultMapConfiguredFirestoreFieldConfig<FirestoreMapFieldType<T, K>, FirestoreMapFieldType<T, K>> & Partial<FirestoreFieldDefault<FirestoreMapFieldType<T, K>>> & {
93
+ /**
94
+ * Optional filter to apply when saving to data.
95
+ *
96
+ * By default will filter all null/undefined values from maps.
97
+ */
98
+ mapFilter?: FilterKeyValueTuplesInput<FirestoreMapFieldType<K>>;
99
+ /**
100
+ * Optional map function to apply to each input value before
101
+ */
102
+ mapFieldValues?: MapFunction<Maybe<T>, Maybe<T>>;
103
+ };
104
+ /**
105
+ * FirestoreField configuration for a map-type object.
106
+ *
107
+ * By default it will remove all null/undefined keys from objects before saving.
108
+ *
109
+ * @param config
110
+ * @returns
111
+ */
112
+ export declare function firestoreMap<T, K extends string = string>(config?: FirestoreMapFieldConfig<T, K>): FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<T, K>, FirestoreMapFieldType<T, K>>;
113
+ /**
114
+ * FirestoreField configuration for a map of granted roles, keyed by model keys.
115
+ *
116
+ * Filters out models with no/null roles by default.
117
+ */
118
+ export declare function firestoreModelKeyGrantedRoleMap<R extends GrantedRole>(): FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<R, string>, FirestoreMapFieldType<R, string>>;
119
+ /**
120
+ * FirestoreField configuration for a map of granted roles, keyed by model ids.
121
+ *
122
+ * Filters out models with no/null roles by default.
123
+ */
124
+ export declare const firestoreModelIdGrantedRoleMap: () => FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<ModelKey, string>, FirestoreMapFieldType<ModelKey, string>>;
125
+ /**
126
+ * FirestoreField configuration for a map-type object with array values.
127
+ *
128
+ * @param config
129
+ * @returns
130
+ */
131
+ export declare type FirestoreArrayMapFieldType<T, K extends string = string> = FirestoreMapFieldType<T[], K>;
132
+ export declare type FirestoreArrayMapFieldConfig<T, K extends string = string> = FirestoreMapFieldConfig<T[], K>;
133
+ export declare function firestoreArrayMap<T, K extends string = string>(config?: FirestoreArrayMapFieldConfig<T, K>): FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<T[], K>, FirestoreMapFieldType<T[], K>>;
134
+ /**
135
+ * FirestoreField configuration for a map of granted roles, keyed by models keys.
136
+ *
137
+ * Filters empty roles/arrays by default.
138
+ */
139
+ export declare function firestoreModelKeyGrantedRoleArrayMap<R extends GrantedRole>(): FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<R[], string>, FirestoreMapFieldType<R[], string>>;
140
+ /**
141
+ * FirestoreField configuration for a map of granted roles, keyed by models ids.
142
+ *
143
+ * Filters empty roles/arrays by default.
144
+ */
145
+ export declare const firestoreModelIdGrantedRoleArrayMap: () => FirestoreModelFieldMapFunctionsConfig<FirestoreMapFieldType<ModelKey[], string>, FirestoreMapFieldType<ModelKey[], string>>;
73
146
  export declare type FirestoreSetFieldConfig<T extends string | number> = DefaultMapConfiguredFirestoreFieldConfig<Set<T>, T[]>;
74
147
  /**
75
148
  * Do not use.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.firestoreSet = exports.firestoreEncodedArray = exports.firestoreUniqueStringArray = exports.firestoreUniqueKeyedArray = exports.firestoreUniqueArray = exports.optionalFirestoreArray = exports.firestoreArray = exports.optionalFirestoreNumber = exports.firestoreNumber = exports.optionalFirestoreBoolean = exports.firestoreBoolean = exports.optionalFirestoreDate = exports.firestoreDate = exports.optionalFirestoreUID = exports.firestoreUID = exports.optionalFirestoreString = exports.firestoreString = exports.firestorePassThroughField = exports.FIRESTORE_PASSTHROUGH_FIELD = exports.firestoreField = void 0;
3
+ exports.firestoreSet = exports.firestoreModelIdGrantedRoleArrayMap = exports.firestoreModelKeyGrantedRoleArrayMap = exports.firestoreArrayMap = exports.firestoreModelIdGrantedRoleMap = exports.firestoreModelKeyGrantedRoleMap = exports.firestoreMap = exports.firestoreEncodedArray = exports.firestoreModelIdArray = exports.firestoreModelKeyArray = exports.firestoreUniqueStringArray = exports.firestoreUniqueKeyedArray = exports.firestoreUniqueArray = exports.optionalFirestoreArray = exports.firestoreArray = exports.optionalFirestoreNumber = exports.firestoreNumber = exports.optionalFirestoreBoolean = exports.firestoreBoolean = exports.optionalFirestoreDate = exports.firestoreDate = exports.firestoreModelId = exports.firestoreModelKey = exports.optionalFirestoreUID = exports.firestoreUID = exports.optionalFirestoreString = exports.firestoreString = exports.firestorePassThroughField = exports.FIRESTORE_PASSTHROUGH_FIELD = exports.firestoreField = void 0;
4
4
  const date_1 = require("@dereekb/date");
5
5
  const util_1 = require("@dereekb/util");
6
6
  const snapshot_1 = require("./snapshot");
@@ -50,6 +50,8 @@ function optionalFirestoreUID() {
50
50
  return optionalFirestoreString();
51
51
  }
52
52
  exports.optionalFirestoreUID = optionalFirestoreUID;
53
+ exports.firestoreModelKey = firestoreString();
54
+ exports.firestoreModelId = firestoreString();
53
55
  function firestoreDate(config = {}) {
54
56
  var _a, _b;
55
57
  return firestoreField({
@@ -124,6 +126,22 @@ function firestoreUniqueStringArray(config) {
124
126
  return firestoreUniqueArray(Object.assign(Object.assign({}, config), { findUnique }));
125
127
  }
126
128
  exports.firestoreUniqueStringArray = firestoreUniqueStringArray;
129
+ /**
130
+ * FirestoreField configuration for an array of ModelKey values.
131
+ *
132
+ * @returns
133
+ */
134
+ function firestoreModelKeyArray() {
135
+ // firestore model key paths are case-sensitive, so don't transform them.
136
+ return firestoreUniqueStringArray({});
137
+ }
138
+ exports.firestoreModelKeyArray = firestoreModelKeyArray;
139
+ /**
140
+ * FirestoreField configuration for an array of ModelId values.
141
+ *
142
+ * @returns
143
+ */
144
+ exports.firestoreModelIdArray = firestoreModelKeyArray;
127
145
  /**
128
146
  * A Firestore array that encodes values to either string or number values using another FirestoreModelField config for encoding/decoding.
129
147
  *
@@ -140,6 +158,70 @@ function firestoreEncodedArray(config) {
140
158
  });
141
159
  }
142
160
  exports.firestoreEncodedArray = firestoreEncodedArray;
161
+ /**
162
+ * FirestoreField configuration for a map-type object.
163
+ *
164
+ * By default it will remove all null/undefined keys from objects before saving.
165
+ *
166
+ * @param config
167
+ * @returns
168
+ */
169
+ function firestoreMap(config = {}) {
170
+ var _a;
171
+ const { mapFilter: filter = util_1.KeyValueTypleValueFilter.NULL, mapFieldValues } = config;
172
+ const filterFinalMapValuesFn = (0, util_1.filterFromPOJOFunction)({
173
+ copy: false,
174
+ filter
175
+ });
176
+ const makeCopy = (mapFieldValues ? (0, util_1.mapObjectMapFunction)(mapFieldValues) : util_1.copyObject);
177
+ return firestoreField({
178
+ default: (_a = config.default) !== null && _a !== void 0 ? _a : {},
179
+ fromData: util_1.passThrough,
180
+ toData: (model) => {
181
+ const copy = makeCopy(model);
182
+ return filterFinalMapValuesFn(copy);
183
+ }
184
+ });
185
+ }
186
+ exports.firestoreMap = firestoreMap;
187
+ /**
188
+ * FirestoreField configuration for a map of granted roles, keyed by model keys.
189
+ *
190
+ * Filters out models with no/null roles by default.
191
+ */
192
+ function firestoreModelKeyGrantedRoleMap() {
193
+ return firestoreMap({
194
+ mapFilter: util_1.KeyValueTypleValueFilter.EMPTY
195
+ });
196
+ }
197
+ exports.firestoreModelKeyGrantedRoleMap = firestoreModelKeyGrantedRoleMap;
198
+ /**
199
+ * FirestoreField configuration for a map of granted roles, keyed by model ids.
200
+ *
201
+ * Filters out models with no/null roles by default.
202
+ */
203
+ exports.firestoreModelIdGrantedRoleMap = firestoreModelKeyGrantedRoleMap;
204
+ function firestoreArrayMap(config = {}) {
205
+ return firestoreMap(Object.assign({ mapFilter: util_1.KeyValueTypleValueFilter.EMPTY, mapFieldValues: util_1.filterMaybeValues }, config));
206
+ }
207
+ exports.firestoreArrayMap = firestoreArrayMap;
208
+ /**
209
+ * FirestoreField configuration for a map of granted roles, keyed by models keys.
210
+ *
211
+ * Filters empty roles/arrays by default.
212
+ */
213
+ function firestoreModelKeyGrantedRoleArrayMap() {
214
+ return firestoreArrayMap({
215
+ mapFieldValues: util_1.filterEmptyValues
216
+ });
217
+ }
218
+ exports.firestoreModelKeyGrantedRoleArrayMap = firestoreModelKeyGrantedRoleArrayMap;
219
+ /**
220
+ * FirestoreField configuration for a map of granted roles, keyed by models ids.
221
+ *
222
+ * Filters empty roles/arrays by default.
223
+ */
224
+ exports.firestoreModelIdGrantedRoleArrayMap = firestoreModelKeyGrantedRoleArrayMap;
143
225
  /**
144
226
  * Do not use.
145
227
  *
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.field.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/snapshot/snapshot.field.ts"],"names":[],"mappings":";;;AAAA,wCAA4E;AAC5E,wCAAyY;AACzY,yCAAmD;AA4BnD,SAAgB,cAAc,CAAiB,MAAkC;;IAC/E,OAAO;QACL,IAAI,EAAG,MAAgD,CAAC,OAAO;YAC7D,CAAC,CAAC;gBACE,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xF,OAAO,cAAc,CAAc;QACjC,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;QAC5C,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC;QACjC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;KACjC,CAAC,CAAC;AACL,CAAC;AAND,oCAMC"}
1
+ {"version":3,"file":"snapshot.field.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/snapshot/snapshot.field.ts"],"names":[],"mappings":";;;AAEA,wCAA4E;AAC5E,wCAAmf;AACnf,yCAAmD;AA4BnD,SAAgB,cAAc,CAAiB,MAAkC;;IAC/E,OAAO;QACL,IAAI,EAAG,MAAgD,CAAC,OAAO;YAC7D,CAAC,CAAC;gBACE,OAAO,EAAG,MAAgD,CAAC,OAAO;gBAClE,OAAO,EAAE,MAAM,CAAC,QAAQ;aACzB;YACH,CAAC,CAAC;gBACE,YAAY,EAAG,MAAoD,CAAC,WAAW;gBAC/E,OAAO,EAAE,MAAM,CAAC,QAAQ;aACzB;QACL,EAAE,EAAE;YACF,OAAO,EAAE,CAAC,MAAA,MAAM,CAAC,iBAAiB,mCAAI,gCAAqB,CAAqB;YAChF,OAAO,EAAE,MAAM,CAAC,MAAM;SACvB;KAC6C,CAAC;AACnD,CAAC;AAhBD,wCAgBC;AAEY,QAAA,2BAA2B,GAAG,cAAc,CAAmB;IAC1E,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,kBAAW;IACrB,MAAM,EAAE,kBAAW;CACpB,CAAC,CAAC;AAEH,SAAgB,yBAAyB;IACvC,OAAO,mCAAiE,CAAC;AAC3E,CAAC;AAFD,8DAEC;AAWD,SAAgB,eAAe,CAAC,MAA8B;IAC5D,OAAO,cAAc,+BACnB,OAAO,EAAE,EAAE,IACR,M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version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/firestore/snapshot/snapshot.ts"],"names":[],"mappings":";;;AAAA,wCAAgV;AAChV,oCAAyN;AAEzN,aAAa;AACb;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAI,CAAC;AAqE1C,SAAgB,0BAA0B,CAA6D,MAAqC;;IAC1I,MAAM,WAAW,GAAgC,MAAC,MAAuD,CAAC,gBAAgB,mCAAI,IAAA,4BAAqB,EAAQ,MAAkD,CAAC,MAAM,CAAC,CAAC;IACtN,MAAM,YAAY,GAAG,IAAA,4BAAqB,EAAO,WAAW,CAAC,CAAC;IAC9D,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,8BAAuB,EAAC,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAEhJ,MAAM,IAAI,GAAwC,CAAC,KAAuB,EAAE,MAA0B,EAAE,EAAE;QACxG,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,IAAS,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,EAAE,GAAsC,CAAC,KAAQ,EAAE,MAA0B,EAAE,OAA2B,EAAE,EAAE;QAClH,IAAI,SAA2C,CAAC;QAEhD,IAAI,OAAO,EAAE;YACX,MAAM,WAAW,GAAI,OAAiC,CAAC,WAAW,CAAC;YAEnE,IAAK,OAA2B,CAAC,KAAK,EAAE;gBACtC,SAAS,GAAG;oBACV,WAAW,EAAE,IAAI;iBAClB,CAAC;aACH;YAED,IAAI,WAAW,EAAE;gBACf,SAAS,mCACJ,SAAS,KACZ,MAAM,EAAE,IAAA,4BAAoB,EAAC,WAAW,CAAgB,GACzD,CAAC;aACH;SACF;QAED,OAAO,MA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C,KAAQ,EAAE,MAA0B,EAAE,OAA2B,EAAE,EAAE;QAClH,IAAI,SAA2C,CAAC;QAEhD,IAAI,OAAO,EAAE;YACX,MAAM,WAAW,GAAI,OAAiC,CAAC,WAAW,CAAC;YAEnE,IAAK,OAA2B,CAAC,KAAK,EAAE;gBACtC,SAAS,GAAG;oBACV,WAAW,EAAE,IAAI;iBAClB,CAAC;aACH;YAED,IAAI,WAAW,EAAE;gBACf,SAAS,mCACJ,SAAS,KACZ,MAAM,EAAE,IAAA,4BAAoB,EAAC,WAAW,CAAgB,GACzD,CAAC;aACH;SACF;QAED,OAAO,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,EAAE;QACF,aAAa,EAAE,CAAC,QAA6B,EAAE,OAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QAC/G,WAAW,EAAE,CAAC,WAAyD,EAAE,OAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,WAAgB,EAAE,SAAS,EAAE,OAAO,CAAC;KAC3I,CAAC;AACJ,CAAC;AAvCD,gEAuCC"}
@@ -4,12 +4,6 @@ import { FirebasePermissionContext, FirebasePermissionErrorContext } from './per
4
4
  * A base model context that contains info about what is current occuring.
5
5
  */
6
6
  export interface FirebaseModelContext extends FirebasePermissionContext, FirebasePermissionErrorContext, FirebaseAuthContext {
7
- /**
8
- * Whether or not to return all role checks for models as true if the auth context shows the current user as an admin.
9
- *
10
- * Is false by default.
11
- */
12
- readonly adminGetsAllowAllRoles?: boolean;
13
7
  }
14
8
  export interface FirebaseAppModelContext<C> extends FirebaseModelContext {
15
9
  readonly app: C;
@@ -1,6 +1,6 @@
1
1
  import { FirestoreDocument } from './../../firestore';
2
2
  import { AbstractModelPermissionService, GrantedRoleMap, InContextModelPermissionService, InModelContextModelPermissionService, ModelPermissionService } from '@dereekb/model';
3
- import { Maybe, PromiseOrValue } from '@dereekb/util';
3
+ import { DecisionFunction, Getter, GetterOrValue, Maybe, PromiseOrValue } from '@dereekb/util';
4
4
  import { FirebaseModelLoader, InModelContextFirebaseModelLoader } from '../model/model.loader';
5
5
  import { FirebaseModelContext } from '../context';
6
6
  import { FirebasePermissionServiceModel } from './permission';
@@ -16,9 +16,58 @@ export declare class FirebaseModelPermissionServiceInstance<C extends FirebaseMo
16
16
  constructor(delegate: FirebasePermissionServiceInstanceDelegate<C, T, D, R>);
17
17
  roleMapForModel(output: FirebasePermissionServiceModel<T, D>, context: C, model: D): PromiseOrValue<GrantedRoleMap<R>>;
18
18
  protected outputForModel(document: D): Promise<Maybe<FirebasePermissionServiceModel<T, D>>>;
19
- protected getRoleMapForOutput(output: FirebasePermissionServiceModel<T, D>, context: C, model: D): Promise<import("@dereekb/model").ContextGrantedModelRoles<FirebasePermissionServiceModel<T, D>, C, R>>;
20
19
  protected isUsableOutputForRoles(output: FirebasePermissionServiceModel<T, D>): boolean;
21
20
  }
22
21
  export declare function firebaseModelPermissionService<C extends FirebaseModelContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends string = string>(delegate: FirebasePermissionServiceInstanceDelegate<C, T, D, R>): FirebaseModelPermissionServiceInstance<C, T, D, R>;
23
22
  export declare type InContextFirebaseModelPermissionService<C, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends string = string> = InContextModelPermissionService<C, D, R, FirebasePermissionServiceModel<T, D>>;
24
23
  export declare type InModelContextFirebaseModelPermissionService<C, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends string = string> = InModelContextModelPermissionService<C, D, R, FirebasePermissionServiceModel<T, D>> & InModelContextFirebaseModelLoader<T, D>;
24
+ export declare const grantFullAccessIfAdmin: GeneralGrantRolesIfFunction;
25
+ export declare function grantModelRolesIfAdmin<R extends string = string>(context: FirebaseModelContext, rolesToGrantToAdmin: GetterOrValue<GrantedRoleMap<R>>, otherwise?: GrantRolesOtherwiseFunction<R>): GrantedRoleMap<R>;
26
+ /**
27
+ * Convenience function that checks the input context if the user is an admin or not and grants pre-set admin roles if they are.
28
+ *
29
+ * @param context
30
+ * @param rolesToGrantToAdmin
31
+ * @param otherwise
32
+ * @returns
33
+ */
34
+ export declare function grantModelRolesIfAdminFunction<R extends string = string>(rolesToGrantToAdmin: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<R>;
35
+ /**
36
+ * DecisionFunction for a FirebaseModelContext that checks if the current user is an admin.
37
+ *
38
+ * @param context
39
+ * @returns
40
+ */
41
+ export declare const isAdminInFirebaseModelContext: DecisionFunction<FirebaseModelContext>;
42
+ /**
43
+ * Grants the configured roles if the decision is made about the context. Otherwise, returns a NoAccessRoleMap.
44
+ */
45
+ export declare type GrantRolesOnlyIfFunction<R extends string = string, C extends FirebaseModelContext = FirebaseModelContext> = (context: C) => GrantedRoleMap<R>;
46
+ export declare type GeneralGrantRolesOnlyIfFunction = <R extends string = string, C extends FirebaseModelContext = FirebaseModelContext>(context: C) => GrantedRoleMap<R>;
47
+ /**
48
+ * Creates a GrantRolesOnlyIfFunction
49
+ *
50
+ * @param grantIf
51
+ * @param grantedRoles
52
+ * @returns
53
+ */
54
+ export declare function grantModelRolesOnlyIfFunction<C extends FirebaseModelContext, R extends string = string>(grantIf: DecisionFunction<C>, grantedRoles: GetterOrValue<GrantedRoleMap<R>>): GrantRolesOnlyIfFunction<R, C>;
55
+ /**
56
+ * Grants the configured roles if the decision is made about the context. Otherwise, invokes the otherwise function if available, or returns a NoAccessRoleMap.
57
+ */
58
+ export declare type GrantRolesIfFunction<R extends string = string, C extends FirebaseModelContext = FirebaseModelContext> = (context: C, otherwise?: GrantRolesOtherwiseFunction<R>) => GrantedRoleMap<R>;
59
+ export declare type GeneralGrantRolesIfFunction = <R extends string = string, C extends FirebaseModelContext = FirebaseModelContext>(context: C, otherwise?: GrantRolesOtherwiseFunction<R>) => GrantedRoleMap<R>;
60
+ /**
61
+ * Used as the "else" statement for grantModelRolesIfFunction.
62
+ *
63
+ * If no roles are returned, the grantModelRolesIfFunction() will return a NoAccessRoleMap.
64
+ */
65
+ export declare type GrantRolesOtherwiseFunction<R extends string = string> = Getter<Maybe<GrantedRoleMap<R>>>;
66
+ /**
67
+ * Creates a GrantRolesIfFunction.
68
+ *
69
+ * @param grantIf
70
+ * @param grantedRoles
71
+ * @returns
72
+ */
73
+ export declare function grantModelRolesIfFunction<C extends FirebaseModelContext, R extends string = string>(grantIf: DecisionFunction<C>, grantedRoles: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<R, C>;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.firebaseModelPermissionService = exports.FirebaseModelPermissionServiceInstance = void 0;
3
+ exports.grantModelRolesIfFunction = exports.grantModelRolesOnlyIfFunction = exports.isAdminInFirebaseModelContext = exports.grantModelRolesIfAdminFunction = exports.grantModelRolesIfAdmin = exports.grantFullAccessIfAdmin = exports.firebaseModelPermissionService = exports.FirebaseModelPermissionServiceInstance = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const model_1 = require("@dereekb/model");
6
+ const util_1 = require("@dereekb/util");
6
7
  /**
7
8
  * Abstract AbstractModelPermissionService implementation for FirebaseModelsPermissionService.
8
9
  */
@@ -22,20 +23,6 @@ class FirebaseModelPermissionServiceInstance extends model_1.AbstractModelPermis
22
23
  return model;
23
24
  });
24
25
  }
25
- getRoleMapForOutput(output, context, model) {
26
- const _super = Object.create(null, {
27
- getRoleMapForOutput: { get: () => super.getRoleMapForOutput }
28
- });
29
- var _a, _b;
30
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
- if (context.adminGetsAllowAllRoles && ((_b = (_a = context.auth) === null || _a === void 0 ? void 0 : _a.isAdmin) === null || _b === void 0 ? void 0 : _b.call(_a))) {
32
- return (0, model_1.fullAccessGrantedModelRoles)(context, output);
33
- }
34
- else {
35
- return _super.getRoleMapForOutput.call(this, output, context, model);
36
- }
37
- });
38
- }
39
26
  isUsableOutputForRoles(output) {
40
27
  return output.exists;
41
28
  }
@@ -45,4 +32,58 @@ function firebaseModelPermissionService(delegate) {
45
32
  return new FirebaseModelPermissionServiceInstance(delegate);
46
33
  }
47
34
  exports.firebaseModelPermissionService = firebaseModelPermissionService;
35
+ // MARK: Utility
36
+ exports.grantFullAccessIfAdmin = grantModelRolesIfAdminFunction(model_1.fullAccessRoleMap);
37
+ function grantModelRolesIfAdmin(context, rolesToGrantToAdmin, otherwise) {
38
+ return grantModelRolesIfAdminFunction(rolesToGrantToAdmin)(context, otherwise);
39
+ }
40
+ exports.grantModelRolesIfAdmin = grantModelRolesIfAdmin;
41
+ /**
42
+ * Convenience function that checks the input context if the user is an admin or not and grants pre-set admin roles if they are.
43
+ *
44
+ * @param context
45
+ * @param rolesToGrantToAdmin
46
+ * @param otherwise
47
+ * @returns
48
+ */
49
+ function grantModelRolesIfAdminFunction(rolesToGrantToAdmin) {
50
+ return grantModelRolesIfFunction(exports.isAdminInFirebaseModelContext, rolesToGrantToAdmin);
51
+ }
52
+ exports.grantModelRolesIfAdminFunction = grantModelRolesIfAdminFunction;
53
+ /**
54
+ * DecisionFunction for a FirebaseModelContext that checks if the current user is an admin.
55
+ *
56
+ * @param context
57
+ * @returns
58
+ */
59
+ const isAdminInFirebaseModelContext = (context) => { var _a, _b; return (_b = (_a = context.auth) === null || _a === void 0 ? void 0 : _a.isAdmin()) !== null && _b !== void 0 ? _b : false; };
60
+ exports.isAdminInFirebaseModelContext = isAdminInFirebaseModelContext;
61
+ /**
62
+ * Creates a GrantRolesOnlyIfFunction
63
+ *
64
+ * @param grantIf
65
+ * @param grantedRoles
66
+ * @returns
67
+ */
68
+ function grantModelRolesOnlyIfFunction(grantIf, grantedRoles) {
69
+ const fn = grantModelRolesIfFunction(grantIf, grantedRoles);
70
+ return (context) => fn(context);
71
+ }
72
+ exports.grantModelRolesOnlyIfFunction = grantModelRolesOnlyIfFunction;
73
+ /**
74
+ * Creates a GrantRolesIfFunction.
75
+ *
76
+ * @param grantIf
77
+ * @param grantedRoles
78
+ * @returns
79
+ */
80
+ function grantModelRolesIfFunction(grantIf, grantedRoles) {
81
+ return (context, otherwise = model_1.noAccessRoleMap) => {
82
+ var _a;
83
+ const decision = grantIf(context);
84
+ const results = decision ? (0, util_1.getValueFromGetter)(grantedRoles) : (_a = otherwise()) !== null && _a !== void 0 ? _a : (0, model_1.noAccessRoleMap)();
85
+ return results;
86
+ };
87
+ }
88
+ exports.grantModelRolesIfFunction = grantModelRolesIfFunction;
48
89
  //# sourceMappingURL=permission.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permission.service.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/model/permission/permission.service.ts"],"names":[],"mappings":";;;;AACA,0CAA4M;AAY5M;;GAEG;AACH,MAAa,sCAA4J,SAAQ,sCAA6E;IAC5P,YAAqB,QAA+D;QAClF,KAAK,CAAC,QAAQ,CAAC,CAAC;QADG,aAAQ,GAAR,QAAQ,CAAuD;IAEpF,CAAC;IAED,eAAe,CAAC,MAA4C,EAAE,OAAU,EAAE,KAAQ;QAChF,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAEe,cAAc,CAAC,QAAW;;YACxC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE7B,MAAM,KAAK,GAAgD,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;YAC9G,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;IAEwB,mBAAmB,CAAC,MAA4C,EAAE,OAAU,EAAE,KAAQ;;;;;;YAC7G,IAAI,OAAO,CAAC,sBAAsB,KAAI,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,kDAAI,CAAA,EAAE;gBAC/D,OAAO,IAAA,mCAA2B,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;aACrD;iBAAM;gBACL,OAAO,OAAM,mBAAmB,YAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;aAC1D;;KACF;IAEkB,sBAAsB,CAAC,MAA4C;QACpF,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF;AA5BD,wFA4BC;AAED,SAAgB,8BAA8B,CAAsH,QAA+D;IACjO,OAAO,IAAI,sCAAsC,CAAC,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAFD,wEAEC"}
1
+ {"version":3,"file":"permission.service.js","sourceRoot":"","sources":["../../../../../../../../packages/firebase/src/lib/common/model/permission/permission.service.ts"],"names":[],"mappings":";;;;AACA,0CAAmN;AACnN,wCAAmH;AAWnH;;GAEG;AACH,MAAa,sCAA4J,SAAQ,sCAA6E;IAC5P,YAAqB,QAA+D;QAClF,KAAK,CAAC,QAAQ,CAAC,CAAC;QADG,aAAQ,GAAR,QAAQ,CAAuD;IAEpF,CAAC;IAED,eAAe,CAAC,MAA4C,EAAE,OAAU,EAAE,KAAQ;QAChF,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAEe,cAAc,CAAC,QAAW;;YACxC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE7B,MAAM,KAAK,GAAgD,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;YAC9G,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;IAEkB,sBAAsB,CAAC,MAA4C;QACpF,OAAO,MAAM,CAAC,MAAM,C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CAAC,MAAA,SAAS,EAAE,mCAAI,IAAA,uBAAe,GAAE,CAAC;QAC/F,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAND,8DAMC"}
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [7.5.0](https://github.com/dereekb/dbx-components/compare/v7.4.0-dev...v7.5.0) (2022-06-08)
6
+
7
+
8
+
9
+ # [7.4.0](https://github.com/dereekb/dbx-components/compare/v7.3.0-dev...v7.4.0) (2022-06-08)
10
+
11
+
12
+
13
+ # [7.3.0](https://github.com/dereekb/dbx-components/compare/v7.2.0-dev...v7.3.0) (2022-06-08)
14
+
15
+
16
+
5
17
  # [7.2.0](https://github.com/dereekb/dbx-components/compare/v7.1.0-dev...v7.2.0) (2022-06-06)
6
18
 
7
19
 
package/test/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/test",
3
- "version": "7.2.0",
3
+ "version": "7.5.0",
4
4
  "main": "./src/index.js",
5
5
  "typings": "./src/index.d.ts",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
- "@dereekb/util/test": "7.2.0",
9
- "@dereekb/util": "7.2.0",
8
+ "@dereekb/util/test": "7.5.0",
9
+ "@dereekb/util": "7.5.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": "7.2.0",
13
+ "@dereekb/firebase": "7.5.0",
14
14
  "rxjs": "^7.0.0",
15
15
  "rxfire": "^6.0.3",
16
16
  "firebase": "^9.8.0",
17
- "@dereekb/rxjs": "7.2.0",
17
+ "@dereekb/rxjs": "7.5.0",
18
18
  "ms": "^3.0.0-canary.1",
19
- "@dereekb/date": "7.2.0",
19
+ "@dereekb/model": "7.5.0",
20
20
  "class-transformer": "^0.5.1",
21
- "date-fns": "^2.28.0",
22
21
  "class-validator": "^0.13.2",
22
+ "@dereekb/date": "7.5.0",
23
+ "date-fns": "^2.28.0",
23
24
  "date-fns-tz": "^1.3.0",
24
25
  "rrule": "git+https://git@github.com/dereekb/rrule.git#17adf5708d6567b4d01a3a8afd106261421ea492",
25
- "@dereekb/model": "7.2.0",
26
26
  "tslib": "^2.0.0"
27
27
  }
28
28
  }