@dereekb/firebase 5.2.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/package.json +5 -5
  3. package/src/lib/client/firestore/driver.accessor.js +1 -0
  4. package/src/lib/client/firestore/driver.accessor.js.map +1 -1
  5. package/src/lib/client/firestore/driver.query.js +5 -1
  6. package/src/lib/client/firestore/driver.query.js.map +1 -1
  7. package/src/lib/client/function/function.callable.d.ts +13 -0
  8. package/src/lib/client/function/function.callable.js +22 -0
  9. package/src/lib/client/function/function.callable.js.map +1 -0
  10. package/src/lib/client/function/index.d.ts +2 -0
  11. package/src/lib/client/function/index.js +2 -0
  12. package/src/lib/client/function/index.js.map +1 -1
  13. package/src/lib/client/function/model.function.factory.d.ts +45 -0
  14. package/src/lib/client/function/model.function.factory.js +41 -0
  15. package/src/lib/client/function/model.function.factory.js.map +1 -0
  16. package/src/lib/common/auth/auth.context.d.ts +33 -0
  17. package/src/lib/common/auth/auth.context.js +3 -0
  18. package/src/lib/common/auth/auth.context.js.map +1 -0
  19. package/src/lib/common/auth/auth.d.ts +9 -0
  20. package/src/lib/common/auth/index.d.ts +1 -0
  21. package/src/lib/common/auth/index.js +1 -0
  22. package/src/lib/common/auth/index.js.map +1 -1
  23. package/src/lib/common/firestore/accessor/document.d.ts +31 -9
  24. package/src/lib/common/firestore/accessor/document.js +26 -9
  25. package/src/lib/common/firestore/accessor/document.js.map +1 -1
  26. package/src/lib/common/firestore/collection/collection.d.ts +96 -0
  27. package/src/lib/common/firestore/collection/collection.js +14 -1
  28. package/src/lib/common/firestore/collection/collection.js.map +1 -1
  29. package/src/lib/common/firestore/driver/accessor.d.ts +2 -0
  30. package/src/lib/common/firestore/driver/query.d.ts +4 -2
  31. package/src/lib/common/firestore/driver/query.handler.d.ts +1 -1
  32. package/src/lib/common/firestore/driver/query.handler.js +3 -2
  33. package/src/lib/common/firestore/driver/query.handler.js.map +1 -1
  34. package/src/lib/common/firestore/query/constraint.d.ts +21 -3
  35. package/src/lib/common/firestore/query/constraint.js +20 -2
  36. package/src/lib/common/firestore/query/constraint.js.map +1 -1
  37. package/src/lib/common/firestore/query/constraint.template.d.ts +16 -0
  38. package/src/lib/common/firestore/query/constraint.template.js +27 -0
  39. package/src/lib/common/firestore/query/constraint.template.js.map +1 -0
  40. package/src/lib/common/firestore/query/index.d.ts +1 -0
  41. package/src/lib/common/firestore/query/index.js +1 -0
  42. package/src/lib/common/firestore/query/index.js.map +1 -1
  43. package/src/lib/common/firestore/reference.d.ts +7 -1
  44. package/src/lib/common/firestore/types.d.ts +8 -5
  45. package/src/lib/common/firestore/types.js.map +1 -1
  46. package/src/lib/common/function/action.d.ts +4 -0
  47. package/src/lib/common/index.d.ts +1 -0
  48. package/src/lib/common/index.js +1 -0
  49. package/src/lib/common/index.js.map +1 -1
  50. package/src/lib/common/model/context.d.ts +16 -0
  51. package/src/lib/common/model/context.js +3 -0
  52. package/src/lib/common/model/context.js.map +1 -0
  53. package/src/lib/common/model/function.d.ts +29 -0
  54. package/src/lib/common/model/function.js +27 -0
  55. package/src/lib/common/model/function.js.map +1 -0
  56. package/src/lib/common/model/index.d.ts +5 -0
  57. package/src/lib/common/model/index.js +9 -0
  58. package/src/lib/common/model/index.js.map +1 -0
  59. package/src/lib/common/model/model/index.d.ts +1 -0
  60. package/src/lib/common/model/model/index.js +5 -0
  61. package/src/lib/common/model/model/index.js.map +1 -0
  62. package/src/lib/common/model/model/model.loader.d.ts +29 -0
  63. package/src/lib/common/model/model/model.loader.js +21 -0
  64. package/src/lib/common/model/model/model.loader.js.map +1 -0
  65. package/src/lib/common/model/model.service.d.ts +77 -0
  66. package/src/lib/common/model/model.service.js +116 -0
  67. package/src/lib/common/model/model.service.js.map +1 -0
  68. package/src/lib/common/model/permission/index.d.ts +4 -0
  69. package/src/lib/common/model/permission/index.js +8 -0
  70. package/src/lib/common/model/permission/index.js.map +1 -0
  71. package/src/lib/common/model/permission/permission.context.d.ts +9 -0
  72. package/src/lib/common/model/permission/permission.context.js +3 -0
  73. package/src/lib/common/model/permission/permission.context.js.map +1 -0
  74. package/src/lib/common/model/permission/permission.d.ts +11 -0
  75. package/src/lib/common/model/permission/permission.js +3 -0
  76. package/src/lib/common/model/permission/permission.js.map +1 -0
  77. package/src/lib/common/model/permission/permission.service.d.ts +24 -0
  78. package/src/lib/common/model/permission/permission.service.js +48 -0
  79. package/src/lib/common/model/permission/permission.service.js.map +1 -0
  80. package/src/lib/common/model/permission/permission.service.role.d.ts +45 -0
  81. package/src/lib/common/model/permission/permission.service.role.js +88 -0
  82. package/src/lib/common/model/permission/permission.service.role.js.map +1 -0
  83. package/test/CHANGELOG.md +27 -0
  84. package/test/package.json +7 -7
  85. package/test/src/lib/common/firestore.d.ts +3 -3
  86. package/test/src/lib/common/firestore.js +2 -2
  87. package/test/src/lib/common/firestore.mock.item.d.ts +43 -16
  88. package/test/src/lib/common/firestore.mock.item.fixture.d.ts +3 -1
  89. package/test/src/lib/common/firestore.mock.item.fixture.js +12 -6
  90. package/test/src/lib/common/firestore.mock.item.fixture.js.map +1 -1
  91. package/test/src/lib/common/firestore.mock.item.js +85 -27
  92. package/test/src/lib/common/firestore.mock.item.js.map +1 -1
  93. package/test/src/lib/common/firestore.mock.item.query.d.ts +20 -1
  94. package/test/src/lib/common/firestore.mock.item.query.js +22 -1
  95. package/test/src/lib/common/firestore.mock.item.query.js.map +1 -1
  96. package/test/src/lib/common/firestore.mock.item.service.d.ts +40 -0
  97. package/test/src/lib/common/firestore.mock.item.service.js +62 -0
  98. package/test/src/lib/common/firestore.mock.item.service.js.map +1 -0
  99. package/test/src/lib/common/index.d.ts +1 -0
  100. package/test/src/lib/common/index.js +1 -0
  101. package/test/src/lib/common/index.js.map +1 -1
  102. package/test/src/lib/common/test.driver.accessor.js +77 -24
  103. package/test/src/lib/common/test.driver.accessor.js.map +1 -1
  104. package/test/src/lib/common/test.driver.query.js +138 -75
  105. package/test/src/lib/common/test.driver.query.js.map +1 -1
  106. package/test/src/lib/common/test.iterator.js +1 -0
  107. package/test/src/lib/common/test.iterator.js.map +1 -1
@@ -11,9 +11,9 @@ export interface TestingFirestoreAccessorDriver extends FirestoreAccessorDriver
11
11
  * Initializes fuzzed path names for the input collections. Returns the result of getFuzzedCollectionsNameMap().
12
12
  *
13
13
  * This initialization step is useful for the client, where the rules file needs to be updated to reflect the collection names properly in order to ensure rules are correct.
14
- * @param collectionPaths
14
+ * @param collectionNames
15
15
  */
16
- initWithCollectionNames(collectionPaths: string[]): Map<string, string>;
16
+ initWithCollectionNames(collectionNames: string[]): Map<string, string>;
17
17
  }
18
18
  export declare function makeTestingFirestoreAccesorDriver(driver: FirestoreAccessorDriver): TestingFirestoreAccessorDriver;
19
19
  /**
@@ -34,5 +34,5 @@ export interface TestingFirestoreContextExtension {
34
34
  drivers: TestingFirestoreDrivers;
35
35
  }
36
36
  export declare type TestFirestoreContext<C = FirestoreContext> = C & TestingFirestoreContextExtension;
37
- export declare type ClearTestFirestoreCollectionFunction = (collectionName: string, realCollectionPath: string) => Promise<void>;
37
+ export declare type ClearTestFirestoreCollectionFunction = (collectionName: string, realCollectionName: string) => Promise<void>;
38
38
  export declare function clearTestFirestoreContextCollections(context: TestFirestoreContext, clearCollection: ClearTestFirestoreCollectionFunction): Promise<void>;
@@ -30,8 +30,8 @@ function makeTestingFirestoreAccesorDriver(driver) {
30
30
  const fuzzedPath = fuzzedPathForPath(collectionId);
31
31
  return collectionGroup(f, fuzzedPath);
32
32
  };
33
- const initWithCollectionNames = (collectionPaths) => {
34
- collectionPaths.forEach((x) => fuzzedPathForPath(x));
33
+ const initWithCollectionNames = (collectionNames) => {
34
+ collectionNames.forEach((x) => fuzzedPathForPath(x));
35
35
  return fuzzedMap;
36
36
  };
37
37
  const injectedDriver = Object.assign(Object.assign({}, driver), { collection: fuzzedCollection, collectionGroup: fuzzedCollectionGroup, subcollection: fuzzedSubcollection, getFuzzedCollectionsNameMap: () => fuzzedMap, initWithCollectionNames });
@@ -1,5 +1,8 @@
1
1
  import { Maybe } from '@dereekb/util';
2
- import { CollectionReference, FirestoreCollection, FirestoreContext, AbstractFirestoreDocument, SingleItemFirestoreCollection, FirestoreCollectionWithParent, AbstractFirestoreDocumentWithParent, ExpectedFirestoreModelData, FirestoreModelData, CollectionGroup, FirestoreCollectionGroup } from '@dereekb/firebase';
2
+ import { CollectionReference, FirestoreCollection, FirestoreContext, AbstractFirestoreDocument, SingleItemFirestoreCollection, FirestoreCollectionWithParent, AbstractFirestoreDocumentWithParent, ExpectedFirestoreModelData, FirestoreModelData, CollectionGroup, FirestoreCollectionGroup, FirestoreModelIdentity } from '@dereekb/firebase';
3
+ import { GrantedReadRole } from '@dereekb/model';
4
+ export declare type MockItemTypes = typeof mockItemIdentity | typeof mockItemPrivateIdentity | typeof mockItemSubItemIdentity | typeof mockItemDeepSubItemIdentity;
5
+ export declare const mockItemIdentity: FirestoreModelIdentity<"mockItem">;
3
6
  /**
4
7
  * Converted data for a test item in our firestore collection.
5
8
  */
@@ -10,7 +13,9 @@ export interface MockItem {
10
13
  */
11
14
  test: boolean;
12
15
  }
16
+ export declare type MockItemRoles = GrantedReadRole | 'admin';
13
17
  export declare class MockItemDocument extends AbstractFirestoreDocument<MockItem, MockItemDocument> {
18
+ get modelIdentity(): FirestoreModelIdentity<"mockItem">;
14
19
  }
15
20
  /**
16
21
  * MockItem as it is stored into the database.
@@ -23,10 +28,6 @@ export declare type MockItemData = FirestoreModelData<MockItem, {
23
28
  */
24
29
  test?: Maybe<boolean>;
25
30
  }>;
26
- /**
27
- * Firestore collection path name.
28
- */
29
- export declare const mockItemCollectionPath = "test";
30
31
  /**
31
32
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
32
33
  */
@@ -45,6 +46,7 @@ export declare const mockItemConverter: import("@dereekb/firebase").SnapshotConv
45
46
  export declare function mockItemCollectionReference(context: FirestoreContext): CollectionReference<MockItem>;
46
47
  export declare type MockItemFirestoreCollection = FirestoreCollection<MockItem, MockItemDocument>;
47
48
  export declare function mockItemFirestoreCollection(firestoreContext: FirestoreContext): MockItemFirestoreCollection;
49
+ export declare const mockItemPrivateIdentity: FirestoreModelIdentity<"mockItemPrivate">;
48
50
  /**
49
51
  * Private data for each MockItem.
50
52
  *
@@ -54,16 +56,18 @@ export interface MockItemPrivate {
54
56
  comments?: Maybe<string>;
55
57
  createdAt: Date;
56
58
  }
59
+ export declare type MockItemPrivateRoles = GrantedReadRole | 'admin';
57
60
  /**
58
61
  * FirestoreDocument for MockItem
59
62
  */
60
63
  export declare class MockItemPrivateDocument extends AbstractFirestoreDocument<MockItemPrivate, MockItemPrivateDocument> {
64
+ get modelIdentity(): FirestoreModelIdentity<"mockItemPrivate">;
61
65
  }
62
66
  export declare type MockItemPrivateData = FirestoreModelData<MockItemPrivate, {}>;
63
67
  /**
64
68
  * Firestore collection path name.
65
69
  */
66
- export declare const mockItemPrivateCollectionPath = "private";
70
+ export declare const mockItemPrivateCollectionName = "mockitemprivate";
67
71
  export declare const mockItemPrivateIdentifier = "0";
68
72
  /**
69
73
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
@@ -85,6 +89,10 @@ export declare function mockItemPrivateCollectionReferenceFactory(context: Fires
85
89
  export declare type MockItemPrivateFirestoreCollection = SingleItemFirestoreCollection<MockItemPrivate, MockItem, MockItemPrivateDocument>;
86
90
  export declare type MockItemPrivateFirestoreCollectionFactory = (parent: MockItemDocument) => MockItemPrivateFirestoreCollection;
87
91
  export declare function mockItemPrivateFirestoreCollection(firestoreContext: FirestoreContext): MockItemPrivateFirestoreCollectionFactory;
92
+ export declare function mockItemPrivateCollectionReference(context: FirestoreContext): CollectionGroup<MockItemPrivate>;
93
+ export declare type MockItemPrivateFirestoreCollectionGroup = FirestoreCollectionGroup<MockItemPrivate, MockItemPrivateDocument>;
94
+ export declare function mockItemPrivateFirestoreCollectionGroup(firestoreContext: FirestoreContext): MockItemPrivateFirestoreCollectionGroup;
95
+ export declare const mockItemSubItemIdentity: FirestoreModelIdentity<"mockItemSub">;
88
96
  /**
89
97
  * Data for a sub item in our firestore collection.
90
98
  *
@@ -93,16 +101,14 @@ export declare function mockItemPrivateFirestoreCollection(firestoreContext: Fir
93
101
  export interface MockItemSubItem {
94
102
  value?: Maybe<number>;
95
103
  }
104
+ export declare type MockItemSubItemRoles = GrantedReadRole | 'admin';
96
105
  /**
97
106
  * FirestoreDocument for MockItem
98
107
  */
99
108
  export declare class MockItemSubItemDocument extends AbstractFirestoreDocumentWithParent<MockItem, MockItemSubItem, MockItemSubItemDocument> {
109
+ get modelIdentity(): FirestoreModelIdentity;
100
110
  }
101
111
  export declare type MockItemSubItemData = ExpectedFirestoreModelData<MockItemSubItem>;
102
- /**
103
- * Firestore collection path name.
104
- */
105
- export declare const mockItemSubItemCollectionPath = "sub";
106
112
  /**
107
113
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
108
114
  */
@@ -114,10 +120,31 @@ export declare function mockItemSubItemFirestoreCollection(firestoreContext: Fir
114
120
  export declare function mockItemSubItemCollectionReference(context: FirestoreContext): CollectionGroup<MockItemSubItem>;
115
121
  export declare type MockItemSubItemFirestoreCollectionGroup = FirestoreCollectionGroup<MockItemSubItem, MockItemSubItemDocument>;
116
122
  export declare function mockItemSubItemFirestoreCollectionGroup(firestoreContext: FirestoreContext): MockItemSubItemFirestoreCollectionGroup;
117
- export declare abstract class MockItemCollections {
118
- abstract readonly mockItem: MockItemFirestoreCollection;
119
- abstract readonly mockItemPrivate: MockItemPrivateFirestoreCollectionFactory;
120
- abstract readonly mockItemSubItem: MockItemSubItemFirestoreCollectionFactory;
121
- abstract readonly mockItemSubItemGroup: MockItemSubItemFirestoreCollectionGroup;
123
+ export declare const mockItemDeepSubItemIdentity: FirestoreModelIdentity<"mockItemDeepSub">;
124
+ /**
125
+ * Data for a sub item in our firestore collection.
126
+ *
127
+ * There may be an unlimited number of MockItemDeepSubItems for a MockSubItem.
128
+ */
129
+ export interface MockItemDeepSubItem {
130
+ value?: Maybe<number>;
131
+ }
132
+ export declare type MockItemDeepSubItemRoles = GrantedReadRole | 'admin';
133
+ /**
134
+ * FirestoreDocument for MockSubItem
135
+ */
136
+ export declare class MockItemDeepSubItemDocument extends AbstractFirestoreDocumentWithParent<MockItemSubItem, MockItemDeepSubItem, MockItemDeepSubItemDocument> {
137
+ get modelIdentity(): FirestoreModelIdentity<"mockItemDeepSub">;
122
138
  }
123
- export declare function makeMockItemCollections(firestoreContext: FirestoreContext): MockItemCollections;
139
+ export declare type MockItemDeepSubItemData = ExpectedFirestoreModelData<MockItemDeepSubItem>;
140
+ /**
141
+ * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
142
+ */
143
+ export declare const mockItemDeepSubItemConverter: import("@dereekb/firebase").SnapshotConverterFunctions<MockItemDeepSubItem, import("@dereekb/util").ReplaceType<MockItemDeepSubItem, object, any>>;
144
+ export declare function mockItemDeepSubItemCollectionReferenceFactory(context: FirestoreContext): (parent: MockItemSubItemDocument) => CollectionReference<MockItemDeepSubItem>;
145
+ export declare type MockItemDeepSubItemFirestoreCollection = FirestoreCollectionWithParent<MockItemDeepSubItem, MockItemSubItem, MockItemDeepSubItemDocument, MockItemSubItemDocument>;
146
+ export declare type MockItemDeepSubItemFirestoreCollectionFactory = (parent: MockItemSubItemDocument) => MockItemDeepSubItemFirestoreCollection;
147
+ export declare function mockItemDeepSubItemFirestoreCollection(firestoreContext: FirestoreContext): MockItemDeepSubItemFirestoreCollectionFactory;
148
+ export declare function mockItemDeepSubItemCollectionReference(context: FirestoreContext): CollectionGroup<MockItemDeepSubItem>;
149
+ export declare type MockItemDeepSubItemFirestoreCollectionGroup = FirestoreCollectionGroup<MockItemDeepSubItem, MockItemDeepSubItemDocument>;
150
+ export declare function mockItemDeepSubItemFirestoreCollectionGroup(firestoreContext: FirestoreContext): MockItemDeepSubItemFirestoreCollectionGroup;
@@ -4,12 +4,14 @@ import { MockItemFirestoreCollection, MockItem } from './firestore.mock.item';
4
4
  import { TestFirestoreContextFixture } from './firestore.mock';
5
5
  export declare class MockItemCollectionFixtureInstance {
6
6
  readonly fixture: MockItemCollectionFixture;
7
- readonly collections: import("./firestore.mock.item").MockItemCollections;
7
+ readonly collections: import("./firestore.mock.item.service").MockItemCollections;
8
8
  get collection(): CollectionReference<MockItem>;
9
9
  get firestoreCollection(): MockItemFirestoreCollection;
10
10
  get mockItemPrivateCollection(): import("./firestore.mock.item").MockItemPrivateFirestoreCollectionFactory;
11
11
  get mockItemSubItemCollection(): import("./firestore.mock.item").MockItemSubItemFirestoreCollectionFactory;
12
12
  get mockItemSubItemCollectionGroup(): import("./firestore.mock.item").MockItemSubItemFirestoreCollectionGroup;
13
+ get mockItemDeepSubItemCollection(): import("./firestore.mock.item").MockItemDeepSubItemFirestoreCollectionFactory;
14
+ get mockItemDeepSubItemCollectionGroup(): import("./firestore.mock.item").MockItemDeepSubItemFirestoreCollectionGroup;
13
15
  constructor(fixture: MockItemCollectionFixture);
14
16
  }
15
17
  /**
@@ -2,27 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.testWithMockItemFixture = exports.MockItemCollectionFixture = exports.MockItemCollectionFixtureInstance = void 0;
4
4
  const test_1 = require("@dereekb/util/test");
5
- const firestore_mock_item_1 = require("./firestore.mock.item");
5
+ const firestore_mock_item_service_1 = require("./firestore.mock.item.service");
6
6
  // MARK: Test Item Testing Fixture
7
7
  class MockItemCollectionFixtureInstance {
8
8
  constructor(fixture) {
9
9
  this.fixture = fixture;
10
- this.collections = (0, firestore_mock_item_1.makeMockItemCollections)(this.fixture.parent.context);
10
+ this.collections = (0, firestore_mock_item_service_1.makeMockItemCollections)(this.fixture.parent.context);
11
11
  }
12
12
  get collection() {
13
13
  return this.firestoreCollection.collection;
14
14
  }
15
15
  get firestoreCollection() {
16
- return this.collections.mockItem;
16
+ return this.collections.mockItemCollection;
17
17
  }
18
18
  get mockItemPrivateCollection() {
19
- return this.collections.mockItemPrivate;
19
+ return this.collections.mockItemPrivateCollectionFactory;
20
20
  }
21
21
  get mockItemSubItemCollection() {
22
- return this.collections.mockItemSubItem;
22
+ return this.collections.mockItemSubItemCollectionFactory;
23
23
  }
24
24
  get mockItemSubItemCollectionGroup() {
25
- return this.collections.mockItemSubItemGroup;
25
+ return this.collections.mockItemSubItemCollectionGroup;
26
+ }
27
+ get mockItemDeepSubItemCollection() {
28
+ return this.collections.mockItemDeepSubItemCollectionFactory;
29
+ }
30
+ get mockItemDeepSubItemCollectionGroup() {
31
+ return this.collections.mockItemDeepSubItemCollectionGroup;
26
32
  }
27
33
  }
28
34
  exports.MockItemCollectionFixtureInstance = MockItemCollectionFixtureInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"firestore.mock.item.fixture.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.fixture.ts"],"names":[],"mappings":";;;AACA,6CAAkJ;AAClJ,+DAAuG;AAGvG,kCAAkC;AAClC,MAAa,iCAAiC;IAsB5C,YAAqB,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;QArB9C,gBAAW,GAAG,IAAA,6CAAuB,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAqBlB,CAAC;IAnB3D,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC7C,CAAC;IACD,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC;IAC1C,CAAC;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC;IAC1C,CAAC;IAED,IAAI,8BAA8B;QAChC,OAAO,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC;IAC/C,CAAC;CAGF;AAvBD,8EAuBC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,yCAAkG;CAAG;AAApJ,8DAAoJ;AAIpJ,SAAgB,uBAAuB,CAAC,MAAgD;IACtF,OAAO,IAAA,yCAAkC,EAAC;QACxC,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC;QAChE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,iCAAiC,CAAC,IAAI,CAAC;QACnE,gBAAgB,EAAE,CAAC,QAA2C,EAAE,EAAE;YAChE,qDAAqD;QACvD,CAAC;QACD,sEAAsE;KACvE,CAAC,CAAC;AACL,CAAC;AATD,0DASC"}
1
+ {"version":3,"file":"firestore.mock.item.fixture.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.fixture.ts"],"names":[],"mappings":";;;AACA,6CAAkJ;AAGlJ,+EAAwE;AAExE,kCAAkC;AAClC,MAAa,iCAAiC;IA8B5C,YAAqB,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;QA7B9C,gBAAW,GAAG,IAAA,qDAAuB,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IA6BlB,CAAC;IA3B3D,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC7C,CAAC;IACD,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,gCAAgC,CAAC;IAC3D,CAAC;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,gCAAgC,CAAC;IAC3D,CAAC;IAED,IAAI,8BAA8B;QAChC,OAAO,IAAI,CAAC,WAAW,CAAC,8BAA8B,CAAC;IACzD,CAAC;IAED,IAAI,6BAA6B;QAC/B,OAAO,IAAI,CAAC,WAAW,CAAC,oCAAoC,CAAC;IAC/D,CAAC;IAED,IAAI,kCAAkC;QACpC,OAAO,IAAI,CAAC,WAAW,CAAC,kCAAkC,CAAC;IAC7D,CAAC;CAGF;AA/BD,8EA+BC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,yCAAkG;CAAG;AAApJ,8DAAoJ;AAIpJ,SAAgB,uBAAuB,CAAC,MAAgD;IACtF,OAAO,IAAA,yCAAkC,EAAC;QACxC,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC;QAChE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,iCAAiC,CAAC,IAAI,CAAC;QACnE,gBAAgB,EAAE,CAAC,QAA2C,EAAE,EAAE;YAChE,qDAAqD;QACvD,CAAC;QACD,sEAAsE;KACvE,CAAC,CAAC;AACL,CAAC;AATD,0DASC"}
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeMockItemCollections = exports.MockItemCollections = exports.mockItemSubItemFirestoreCollectionGroup = exports.mockItemSubItemCollectionReference = exports.mockItemSubItemFirestoreCollection = exports.mockItemSubItemCollectionReferenceFactory = exports.mockItemSubItemConverter = exports.mockItemSubItemCollectionPath = exports.MockItemSubItemDocument = exports.mockItemPrivateFirestoreCollection = exports.mockItemPrivateCollectionReferenceFactory = exports.mockItemPrivateConverter = exports.mockItemPrivateIdentifier = exports.mockItemPrivateCollectionPath = exports.MockItemPrivateDocument = exports.mockItemFirestoreCollection = exports.mockItemCollectionReference = exports.mockItemConverter = exports.mockItemCollectionPath = exports.MockItemDocument = void 0;
3
+ exports.mockItemDeepSubItemFirestoreCollectionGroup = exports.mockItemDeepSubItemCollectionReference = exports.mockItemDeepSubItemFirestoreCollection = exports.mockItemDeepSubItemCollectionReferenceFactory = exports.mockItemDeepSubItemConverter = exports.MockItemDeepSubItemDocument = exports.mockItemDeepSubItemIdentity = exports.mockItemSubItemFirestoreCollectionGroup = exports.mockItemSubItemCollectionReference = exports.mockItemSubItemFirestoreCollection = exports.mockItemSubItemCollectionReferenceFactory = exports.mockItemSubItemConverter = exports.MockItemSubItemDocument = exports.mockItemSubItemIdentity = exports.mockItemPrivateFirestoreCollectionGroup = exports.mockItemPrivateCollectionReference = exports.mockItemPrivateFirestoreCollection = exports.mockItemPrivateCollectionReferenceFactory = exports.mockItemPrivateConverter = exports.mockItemPrivateIdentifier = exports.mockItemPrivateCollectionName = exports.MockItemPrivateDocument = exports.mockItemPrivateIdentity = exports.mockItemFirestoreCollection = exports.mockItemCollectionReference = exports.mockItemConverter = exports.MockItemDocument = exports.mockItemIdentity = void 0;
4
4
  const util_1 = require("@dereekb/util");
5
5
  const firebase_1 = require("@dereekb/firebase");
6
+ // MARK: Mock Item
7
+ exports.mockItemIdentity = (0, firebase_1.firestoreModelIdentity)('mockItem');
6
8
  class MockItemDocument extends firebase_1.AbstractFirestoreDocument {
9
+ get modelIdentity() {
10
+ return exports.mockItemIdentity;
11
+ }
7
12
  }
8
13
  exports.MockItemDocument = MockItemDocument;
9
- /**
10
- * Firestore collection path name.
11
- */
12
- exports.mockItemCollectionPath = 'test';
13
14
  /**
14
15
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
15
16
  */
@@ -26,7 +27,7 @@ exports.mockItemConverter = (0, firebase_1.snapshotConverterFunctions)({
26
27
  * @returns
27
28
  */
28
29
  function mockItemCollectionReference(context) {
29
- return context.collection(exports.mockItemCollectionPath).withConverter(exports.mockItemConverter);
30
+ return context.collection(exports.mockItemIdentity.collection).withConverter(exports.mockItemConverter);
30
31
  }
31
32
  exports.mockItemCollectionReference = mockItemCollectionReference;
32
33
  function mockItemFirestoreCollection(firestoreContext) {
@@ -38,16 +39,21 @@ function mockItemFirestoreCollection(firestoreContext) {
38
39
  });
39
40
  }
40
41
  exports.mockItemFirestoreCollection = mockItemFirestoreCollection;
42
+ // MARK: MockItemPrivate
43
+ exports.mockItemPrivateIdentity = (0, firebase_1.firestoreModelIdentity)('mockItemPrivate');
41
44
  /**
42
45
  * FirestoreDocument for MockItem
43
46
  */
44
47
  class MockItemPrivateDocument extends firebase_1.AbstractFirestoreDocument {
48
+ get modelIdentity() {
49
+ return exports.mockItemPrivateIdentity;
50
+ }
45
51
  }
46
52
  exports.MockItemPrivateDocument = MockItemPrivateDocument;
47
53
  /**
48
54
  * Firestore collection path name.
49
55
  */
50
- exports.mockItemPrivateCollectionPath = 'private';
56
+ exports.mockItemPrivateCollectionName = 'mockitemprivate';
51
57
  exports.mockItemPrivateIdentifier = '0';
52
58
  /**
53
59
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
@@ -66,7 +72,7 @@ exports.mockItemPrivateConverter = (0, firebase_1.snapshotConverterFunctions)({
66
72
  */
67
73
  function mockItemPrivateCollectionReferenceFactory(context) {
68
74
  return (parent) => {
69
- return context.subcollection(parent.documentRef, exports.mockItemPrivateCollectionPath).withConverter(exports.mockItemPrivateConverter);
75
+ return context.subcollection(parent.documentRef, exports.mockItemPrivateCollectionName).withConverter(exports.mockItemPrivateConverter);
70
76
  };
71
77
  }
72
78
  exports.mockItemPrivateCollectionReferenceFactory = mockItemPrivateCollectionReferenceFactory;
@@ -84,16 +90,30 @@ function mockItemPrivateFirestoreCollection(firestoreContext) {
84
90
  };
85
91
  }
86
92
  exports.mockItemPrivateFirestoreCollection = mockItemPrivateFirestoreCollection;
93
+ function mockItemPrivateCollectionReference(context) {
94
+ return context.collectionGroup(exports.mockItemPrivateCollectionName).withConverter(exports.mockItemPrivateConverter);
95
+ }
96
+ exports.mockItemPrivateCollectionReference = mockItemPrivateCollectionReference;
97
+ function mockItemPrivateFirestoreCollectionGroup(firestoreContext) {
98
+ return firestoreContext.firestoreCollectionGroup({
99
+ itemsPerPage: 50,
100
+ queryLike: mockItemPrivateCollectionReference(firestoreContext),
101
+ makeDocument: (accessor, documentAccessor) => new MockItemPrivateDocument(accessor, documentAccessor),
102
+ firestoreContext
103
+ });
104
+ }
105
+ exports.mockItemPrivateFirestoreCollectionGroup = mockItemPrivateFirestoreCollectionGroup;
106
+ // MARK: MockItemSubItem
107
+ exports.mockItemSubItemIdentity = (0, firebase_1.firestoreModelIdentity)('mockItemSub');
87
108
  /**
88
109
  * FirestoreDocument for MockItem
89
110
  */
90
111
  class MockItemSubItemDocument extends firebase_1.AbstractFirestoreDocumentWithParent {
112
+ get modelIdentity() {
113
+ return exports.mockItemSubItemIdentity;
114
+ }
91
115
  }
92
116
  exports.MockItemSubItemDocument = MockItemSubItemDocument;
93
- /**
94
- * Firestore collection path name.
95
- */
96
- exports.mockItemSubItemCollectionPath = 'sub';
97
117
  /**
98
118
  * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
99
119
  */
@@ -104,7 +124,7 @@ exports.mockItemSubItemConverter = (0, firebase_1.snapshotConverterFunctions)({
104
124
  });
105
125
  function mockItemSubItemCollectionReferenceFactory(context) {
106
126
  return (parent) => {
107
- return context.subcollection(parent.documentRef, exports.mockItemSubItemCollectionPath).withConverter(exports.mockItemSubItemConverter);
127
+ return context.subcollection(parent.documentRef, exports.mockItemSubItemIdentity.collection).withConverter(exports.mockItemSubItemConverter);
108
128
  };
109
129
  }
110
130
  exports.mockItemSubItemCollectionReferenceFactory = mockItemSubItemCollectionReferenceFactory;
@@ -114,7 +134,7 @@ function mockItemSubItemFirestoreCollection(firestoreContext) {
114
134
  return firestoreContext.firestoreCollectionWithParent({
115
135
  itemsPerPage: 50,
116
136
  collection: factory(parent),
117
- makeDocument: (a, d) => new MockItemSubItemDocument(parent.documentRef, a, d),
137
+ makeDocument: (a, d) => new MockItemSubItemDocument(a, d),
118
138
  firestoreContext,
119
139
  parent
120
140
  });
@@ -122,29 +142,67 @@ function mockItemSubItemFirestoreCollection(firestoreContext) {
122
142
  }
123
143
  exports.mockItemSubItemFirestoreCollection = mockItemSubItemFirestoreCollection;
124
144
  function mockItemSubItemCollectionReference(context) {
125
- return context.collectionGroup(exports.mockItemSubItemCollectionPath).withConverter(exports.mockItemSubItemConverter);
145
+ return context.collectionGroup(exports.mockItemSubItemIdentity.collection).withConverter(exports.mockItemSubItemConverter);
126
146
  }
127
147
  exports.mockItemSubItemCollectionReference = mockItemSubItemCollectionReference;
128
148
  function mockItemSubItemFirestoreCollectionGroup(firestoreContext) {
129
149
  return firestoreContext.firestoreCollectionGroup({
130
150
  itemsPerPage: 50,
131
151
  queryLike: mockItemSubItemCollectionReference(firestoreContext),
132
- makeDocument: (accessor, documentAccessor) => new MockItemSubItemDocument(undefined, accessor, documentAccessor),
152
+ makeDocument: (accessor, documentAccessor) => new MockItemSubItemDocument(accessor, documentAccessor),
133
153
  firestoreContext
134
154
  });
135
155
  }
136
156
  exports.mockItemSubItemFirestoreCollectionGroup = mockItemSubItemFirestoreCollectionGroup;
137
- // MARK: Collection
138
- class MockItemCollections {
139
- }
140
- exports.MockItemCollections = MockItemCollections;
141
- function makeMockItemCollections(firestoreContext) {
142
- return {
143
- mockItem: mockItemFirestoreCollection(firestoreContext),
144
- mockItemPrivate: mockItemPrivateFirestoreCollection(firestoreContext),
145
- mockItemSubItem: mockItemSubItemFirestoreCollection(firestoreContext),
146
- mockItemSubItemGroup: mockItemSubItemFirestoreCollectionGroup(firestoreContext)
157
+ // MARK: Sub-Sub Item
158
+ exports.mockItemDeepSubItemIdentity = (0, firebase_1.firestoreModelIdentity)('mockItemDeepSub');
159
+ /**
160
+ * FirestoreDocument for MockSubItem
161
+ */
162
+ class MockItemDeepSubItemDocument extends firebase_1.AbstractFirestoreDocumentWithParent {
163
+ get modelIdentity() {
164
+ return exports.mockItemDeepSubItemIdentity;
165
+ }
166
+ }
167
+ exports.MockItemDeepSubItemDocument = MockItemDeepSubItemDocument;
168
+ /**
169
+ * Used to build a FirestoreDataConverter. Fields are configured via configuration. See the SnapshotConverterFunctions for more info.
170
+ */
171
+ exports.mockItemDeepSubItemConverter = (0, firebase_1.snapshotConverterFunctions)({
172
+ fields: {
173
+ value: (0, firebase_1.optionalFirestoreNumber)()
174
+ }
175
+ });
176
+ function mockItemDeepSubItemCollectionReferenceFactory(context) {
177
+ return (parent) => {
178
+ return context.subcollection(parent.documentRef, exports.mockItemDeepSubItemIdentity.collection).withConverter(exports.mockItemDeepSubItemConverter);
147
179
  };
148
180
  }
149
- exports.makeMockItemCollections = makeMockItemCollections;
181
+ exports.mockItemDeepSubItemCollectionReferenceFactory = mockItemDeepSubItemCollectionReferenceFactory;
182
+ function mockItemDeepSubItemFirestoreCollection(firestoreContext) {
183
+ const factory = mockItemDeepSubItemCollectionReferenceFactory(firestoreContext);
184
+ return (parent) => {
185
+ return firestoreContext.firestoreCollectionWithParent({
186
+ itemsPerPage: 50,
187
+ collection: factory(parent),
188
+ makeDocument: (a, d) => new MockItemDeepSubItemDocument(a, d),
189
+ firestoreContext,
190
+ parent
191
+ });
192
+ };
193
+ }
194
+ exports.mockItemDeepSubItemFirestoreCollection = mockItemDeepSubItemFirestoreCollection;
195
+ function mockItemDeepSubItemCollectionReference(context) {
196
+ return context.collectionGroup(exports.mockItemDeepSubItemIdentity.collection).withConverter(exports.mockItemDeepSubItemConverter);
197
+ }
198
+ exports.mockItemDeepSubItemCollectionReference = mockItemDeepSubItemCollectionReference;
199
+ function mockItemDeepSubItemFirestoreCollectionGroup(firestoreContext) {
200
+ return firestoreContext.firestoreCollectionGroup({
201
+ itemsPerPage: 50,
202
+ queryLike: mockItemDeepSubItemCollectionReference(firestoreContext),
203
+ makeDocument: (accessor, documentAccessor) => new MockItemDeepSubItemDocument(accessor, documentAccessor),
204
+ firestoreContext
205
+ });
206
+ }
207
+ exports.mockItemDeepSubItemFirestoreCollectionGroup = mockItemDeepSubItemFirestoreCollectionGroup;
150
208
  //# sourceMappingURL=firestore.mock.item.js.map
@@ -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,gDAAwb;AAexb,MAAa,gBAAiB,SAAQ,oCAAqD;CAAG;AAA9F,4CAA8F;AAiB9F;;GAEG;AACU,QAAA,sBAAsB,GAAG,MAAM,CAAC;AAE7C;;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,8BAAsB,CAAC,CAAC,aAAa,CAAW,yBAAiB,CAAC,CAAC;AAC/F,CAAC;AAFD,kEAEC;AAID,SAAgB,2BAA2B,CAAC,gBAAkC;IAC5E,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;QAC1C,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,2BAA2B,CAAC,gBAAgB,CAAC;QACzD,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;QAClD,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAPD,kEAOC;AAaD;;GAEG;AACH,MAAa,uBAAwB,SAAQ,oCAAmE;CAAG;AAAnH,0DAAmH;AAInH;;GAEG;AACU,QAAA,6BAA6B,GAAG,SAAS,CAAC;AAC1C,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAE7C;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,qCAA0B,EAAC;IACjE,gBAAgB,EAAE,IAAA,4BAAqB,EAAuC;QAC5E,QAAQ,EAAE,IAAA,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AAE,kCAAkC,CAAC,gBAAgB,CAAC;QACrE,oBAAoB,EAAE,uCAAuC,CAAC,gBAAgB,CAAC;KAChF,CAAC;AACJ,CAAC;AAPD,0DAOC"}
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,gDAAud;AAMvd,kBAAkB;AACL,QAAA,gBAAgB,GAAG,IAAA,iCAAsB,EAAC,UAAU,CAAC,CAAC;AAgBnE,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,aAAa,CAAW,yBAAiB,CAAC,CAAC;AACpG,CAAC;AAFD,kEAEC;AAID,SAAgB,2BAA2B,CAAC,gBAAkC;IAC5E,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;QAC1C,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,2BAA2B,CAAC,gBAAgB,CAAC;QACzD,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;QAClD,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAPD,kEAOC;AAED,wBAAwB;AACX,QAAA,uBAAuB,GAAG,IAAA,iCAAsB,EAAC,iBAAiB,CAAC,CAAC;A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C;AAJD,sGAIC;AAKD,SAAgB,sCAAsC,CAAC,gBAAkC;IACvF,MAAM,OAAO,GAAG,6CAA6C,CAAC,gBAAgB,CAAC,CAAC;IAEhF,OAAO,CAAC,MAA+B,EAAE,EAAE;QACzC,OAAO,gBAAgB,CAAC,6BAA6B,CAAC;YACpD,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;AAZD,wFAYC;AAED,SAAgB,sCAAsC,CAAC,OAAyB;IAC9E,OAAO,OAAO,CAAC,eAAe,CAAC,mCAA2B,CAAC,UAAU,CAAC,CAAC,aAAa,CAAsB,oCAA4B,CAAC,CAAC;AAC1I,CAAC;AAFD,wFAEC;AAID,SAAgB,2CAA2C,CAAC,gBAAkC;IAC5F,OAAO,gBAAgB,CAAC,wBAAwB,CAAC;QAC/C,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;AAPD,kGAOC"}
@@ -1,3 +1,22 @@
1
- import { FirestoreQueryConstraint } from '@dereekb/firebase';
1
+ import { MockItem } from './firestore.mock.item';
2
+ import { FirestoreQueryConstraint, DocumentReference } from '@dereekb/firebase';
2
3
  export declare function mockItemWithValue(value: string): FirestoreQueryConstraint;
3
4
  export declare function mockItemWithTestValue(test: boolean): FirestoreQueryConstraint;
5
+ /**
6
+ * This sorts all fields by their document ID, then filters in between two specific document id paths in order to only return values between a specific path.
7
+ *
8
+ * Visual Example:
9
+ *
10
+ * /a/b/c/c/a
11
+ * /a/b/c/d/A
12
+ * /a/b/c/d/B
13
+ * /a/b/c/d/C
14
+ * /a/b/c/e/a
15
+ *
16
+ * From:
17
+ * https://medium.com/firebase-developers/how-to-query-collections-in-firestore-under-a-certain-path-6a0d686cebd2
18
+ *
19
+ * @param parent
20
+ * @returns
21
+ */
22
+ export declare function allChildMockItemDeepSubItemsWithinMockItem(mockItem: DocumentReference<MockItem>): FirestoreQueryConstraint[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mockItemWithTestValue = exports.mockItemWithValue = void 0;
3
+ exports.allChildMockItemDeepSubItemsWithinMockItem = exports.mockItemWithTestValue = exports.mockItemWithValue = void 0;
4
4
  const firebase_1 = require("@dereekb/firebase");
5
5
  function mockItemWithValue(value) {
6
6
  return (0, firebase_1.where)('value', '==', value);
@@ -10,4 +10,25 @@ function mockItemWithTestValue(test) {
10
10
  return (0, firebase_1.where)('test', '==', test);
11
11
  }
12
12
  exports.mockItemWithTestValue = mockItemWithTestValue;
13
+ /**
14
+ * This sorts all fields by their document ID, then filters in between two specific document id paths in order to only return values between a specific path.
15
+ *
16
+ * Visual Example:
17
+ *
18
+ * /a/b/c/c/a
19
+ * /a/b/c/d/A
20
+ * /a/b/c/d/B
21
+ * /a/b/c/d/C
22
+ * /a/b/c/e/a
23
+ *
24
+ * From:
25
+ * https://medium.com/firebase-developers/how-to-query-collections-in-firestore-under-a-certain-path-6a0d686cebd2
26
+ *
27
+ * @param parent
28
+ * @returns
29
+ */
30
+ function allChildMockItemDeepSubItemsWithinMockItem(mockItem) {
31
+ return (0, firebase_1.allChildDocumentsUnderParent)(mockItem);
32
+ }
33
+ exports.allChildMockItemDeepSubItemsWithinMockItem = allChildMockItemDeepSubItemsWithinMockItem;
13
34
  //# sourceMappingURL=firestore.mock.item.query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"firestore.mock.item.query.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.query.ts"],"names":[],"mappings":";;;AACA,gDAAoE;AAEpE,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,IAAA,gBAAK,EAAW,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,8CAEC;AAED,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,gBAAK,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAFD,sDAEC"}
1
+ {"version":3,"file":"firestore.mock.item.query.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.query.ts"],"names":[],"mappings":";;;AACA,gDAAqH;AAErH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,IAAA,gBAAK,EAAW,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,8CAEC;AAED,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,gBAAK,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAFD,sDAEC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,0CAA0C,CAAC,QAAqC;IAC9F,OAAO,IAAA,uCAA4B,EAAC,QAAQ,CAAC,CAAC;AAChD,CAAC;AAFD,gGAEC"}
@@ -0,0 +1,40 @@
1
+ import { MockItem, MockItemDeepSubItem, MockItemDeepSubItemDocument, MockItemDeepSubItemFirestoreCollectionFactory, MockItemDeepSubItemFirestoreCollectionGroup, MockItemDeepSubItemRoles, MockItemDocument, MockItemFirestoreCollection, MockItemPrivate, MockItemPrivateDocument, MockItemPrivateFirestoreCollectionFactory, MockItemPrivateFirestoreCollectionGroup, MockItemPrivateRoles, MockItemRoles, MockItemSubItem, MockItemSubItemDocument, MockItemSubItemFirestoreCollectionFactory, MockItemSubItemFirestoreCollectionGroup, MockItemSubItemRoles, MockItemTypes } from './firestore.mock.item';
2
+ import { FirebaseAppModelContext, FirestoreContext } from '@dereekb/firebase';
3
+ import { GrantedRoleMap } from '@dereekb/model';
4
+ export declare abstract class MockItemCollections {
5
+ abstract readonly mockItemCollection: MockItemFirestoreCollection;
6
+ abstract readonly mockItemPrivateCollectionFactory: MockItemPrivateFirestoreCollectionFactory;
7
+ abstract readonly mockItemPrivateCollectionGroup: MockItemPrivateFirestoreCollectionGroup;
8
+ abstract readonly mockItemSubItemCollectionFactory: MockItemSubItemFirestoreCollectionFactory;
9
+ abstract readonly mockItemSubItemCollectionGroup: MockItemSubItemFirestoreCollectionGroup;
10
+ abstract readonly mockItemDeepSubItemCollectionFactory: MockItemDeepSubItemFirestoreCollectionFactory;
11
+ abstract readonly mockItemDeepSubItemCollectionGroup: MockItemDeepSubItemFirestoreCollectionGroup;
12
+ }
13
+ export declare function makeMockItemCollections(firestoreContext: FirestoreContext): MockItemCollections;
14
+ export declare const mockItemFirebaseModelServiceFactory: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItem, MockItemDocument, MockItemRoles>;
15
+ export declare const mockItemPrivateFirebaseModelServiceFactory: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemPrivate, MockItemPrivateDocument, MockItemPrivateRoles>;
16
+ export declare const mockItemSubItemFirebaseModelServiceFactory: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemSubItem, MockItemSubItemDocument, MockItemSubItemRoles>;
17
+ export declare const mockItemDeepSubItemFirebaseModelServiceFactory: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemDeepSubItem, MockItemDeepSubItemDocument, MockItemDeepSubItemRoles>;
18
+ export declare type MockModelTypes = MockItemTypes;
19
+ export declare type MockFirebaseContextAppContext = MockItemCollections;
20
+ export declare type MockFirebaseBaseContext = FirebaseAppModelContext<MockFirebaseContextAppContext> & {
21
+ /**
22
+ * Configured in the context and in mockItem role map functions to return this value if provided.
23
+ */
24
+ rolesToReturn?: GrantedRoleMap<any>;
25
+ };
26
+ export declare const MOCK_FIREBASE_MODEL_SERVICE_FACTORIES: {
27
+ mockItem: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItem, MockItemDocument, MockItemRoles>;
28
+ mockItemPrivate: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemPrivate, MockItemPrivateDocument, MockItemPrivateRoles>;
29
+ mockItemSub: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemSubItem, MockItemSubItemDocument, MockItemSubItemRoles>;
30
+ mockItemDeepSub: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemDeepSubItem, MockItemDeepSubItemDocument, MockItemDeepSubItemRoles>;
31
+ };
32
+ export declare const mockFirebaseModelServices: import("@dereekb/firebase").FirebaseModelsService<{
33
+ mockItem: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItem, MockItemDocument, MockItemRoles>;
34
+ mockItemPrivate: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemPrivate, MockItemPrivateDocument, MockItemPrivateRoles>;
35
+ mockItemSub: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemSubItem, MockItemSubItemDocument, MockItemSubItemRoles>;
36
+ mockItemDeepSub: import("@dereekb/firebase").FirebaseModelServiceFactory<MockFirebaseContext, MockItemDeepSubItem, MockItemDeepSubItemDocument, MockItemDeepSubItemRoles>;
37
+ }, MockFirebaseContext>;
38
+ export declare type MockFirebaseContext = MockFirebaseBaseContext & {
39
+ service?: typeof mockFirebaseModelServices;
40
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mockFirebaseModelServices = exports.MOCK_FIREBASE_MODEL_SERVICE_FACTORIES = exports.mockItemDeepSubItemFirebaseModelServiceFactory = exports.mockItemSubItemFirebaseModelServiceFactory = exports.mockItemPrivateFirebaseModelServiceFactory = exports.mockItemFirebaseModelServiceFactory = exports.makeMockItemCollections = exports.MockItemCollections = void 0;
4
+ const firestore_mock_item_1 = require("./firestore.mock.item");
5
+ const firebase_1 = require("@dereekb/firebase");
6
+ // MARK: Collections
7
+ class MockItemCollections {
8
+ }
9
+ exports.MockItemCollections = MockItemCollections;
10
+ function makeMockItemCollections(firestoreContext) {
11
+ return {
12
+ mockItemCollection: (0, firestore_mock_item_1.mockItemFirestoreCollection)(firestoreContext),
13
+ mockItemPrivateCollectionFactory: (0, firestore_mock_item_1.mockItemPrivateFirestoreCollection)(firestoreContext),
14
+ mockItemPrivateCollectionGroup: (0, firestore_mock_item_1.mockItemPrivateFirestoreCollectionGroup)(firestoreContext),
15
+ mockItemSubItemCollectionFactory: (0, firestore_mock_item_1.mockItemSubItemFirestoreCollection)(firestoreContext),
16
+ mockItemSubItemCollectionGroup: (0, firestore_mock_item_1.mockItemSubItemFirestoreCollectionGroup)(firestoreContext),
17
+ mockItemDeepSubItemCollectionFactory: (0, firestore_mock_item_1.mockItemDeepSubItemFirestoreCollection)(firestoreContext),
18
+ mockItemDeepSubItemCollectionGroup: (0, firestore_mock_item_1.mockItemDeepSubItemFirestoreCollectionGroup)(firestoreContext)
19
+ };
20
+ }
21
+ exports.makeMockItemCollections = makeMockItemCollections;
22
+ // MARK: Models
23
+ exports.mockItemFirebaseModelServiceFactory = (0, firebase_1.firebaseModelServiceFactory)({
24
+ roleMapForModel: function (output, context, model) {
25
+ var _a;
26
+ const roles = (_a = context.rolesToReturn) !== null && _a !== void 0 ? _a : { read: true };
27
+ return roles;
28
+ },
29
+ getFirestoreCollection: (c) => c.app.mockItemCollection
30
+ });
31
+ exports.mockItemPrivateFirebaseModelServiceFactory = (0, firebase_1.firebaseModelServiceFactory)({
32
+ roleMapForModel: function (output, context, model) {
33
+ var _a;
34
+ const roles = (_a = context.rolesToReturn) !== null && _a !== void 0 ? _a : { read: true };
35
+ return roles;
36
+ },
37
+ getFirestoreCollection: (c) => c.app.mockItemPrivateCollectionGroup
38
+ });
39
+ exports.mockItemSubItemFirebaseModelServiceFactory = (0, firebase_1.firebaseModelServiceFactory)({
40
+ roleMapForModel: function (output, context, model) {
41
+ var _a;
42
+ const roles = (_a = context.rolesToReturn) !== null && _a !== void 0 ? _a : { read: true };
43
+ return roles;
44
+ },
45
+ getFirestoreCollection: (c) => c.app.mockItemSubItemCollectionGroup
46
+ });
47
+ exports.mockItemDeepSubItemFirebaseModelServiceFactory = (0, firebase_1.firebaseModelServiceFactory)({
48
+ roleMapForModel: function (output, context, model) {
49
+ var _a;
50
+ const roles = (_a = context.rolesToReturn) !== null && _a !== void 0 ? _a : { read: true };
51
+ return roles;
52
+ },
53
+ getFirestoreCollection: (c) => c.app.mockItemDeepSubItemCollectionGroup
54
+ });
55
+ exports.MOCK_FIREBASE_MODEL_SERVICE_FACTORIES = {
56
+ mockItem: exports.mockItemFirebaseModelServiceFactory,
57
+ mockItemPrivate: exports.mockItemPrivateFirebaseModelServiceFactory,
58
+ mockItemSub: exports.mockItemSubItemFirebaseModelServiceFactory,
59
+ mockItemDeepSub: exports.mockItemDeepSubItemFirebaseModelServiceFactory
60
+ };
61
+ exports.mockFirebaseModelServices = (0, firebase_1.firebaseModelsService)(exports.MOCK_FIREBASE_MODEL_SERVICE_FACTORIES);
62
+ //# sourceMappingURL=firestore.mock.item.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestore.mock.item.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase/test/src/lib/common/firestore.mock.item.service.ts"],"names":[],"mappings":";;;AAAA,+DA4B+B;AAC/B,gDAAkK;AAIlK,oBAAoB;AACpB,MAAsB,mBAAmB;CAQxC;AARD,kDAQC;AAED,SAAgB,uBAAuB,CAAC,gBAAkC;IACxE,OAAO;QACL,kBAAkB,EAAE,IAAA,iDAA2B,EAAC,gBAAgB,CAAC;QACjE,gCAAgC,EAAE,IAAA,wDAA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O,KAAK,CAAC;IACf,CAAC;IACD,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,8BAA8B;CACpE,CAAC,CAAC;AAEU,QAAA,8CAA8C,GAAG,IAAA,sCAA2B,EAAkG;IACzL,eAAe,EAAE,UAAU,MAAwF,EAAE,OAA4B,EAAE,KAAkC;;QACnL,MAAM,KAAK,GAA6C,MAAA,OAAO,CAAC,aAAa,mCAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAChG,OAAO,KAAK,CAAC;IACf,CAAC;IACD,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,kCAAkC;CACxE,CAAC,CAAC;AAcU,QAAA,qCAAqC,GAAG;IACnD,QAAQ,EAAE,2CAAmC;IAC7C,eAAe,EAAE,kDAA0C;IAC3D,WAAW,EAAE,kDAA0C;IACvD,eAAe,EAAE,sDAA8C;CAChE,CAAC;AAEW,QAAA,yBAAyB,GAAG,IAAA,gCAAqB,EAAoF,6CAAqC,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './firestore.mock.item.fixture';
2
2
  export * from './firestore.mock.item.query';
3
+ export * from './firestore.mock.item.service';
3
4
  export * from './firestore.mock.item';
4
5
  export * from './firestore.mock';
5
6
  export * from './firestore';