@auto-engineer/server-generator-apollo-emmett 1.78.0 → 1.80.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +3 -3
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +70 -0
- package/dist/src/codegen/templates/query/projection.specs.ts +5 -8
- package/dist/src/codegen/templates/query/query.resolver.specs.ts +25 -40
- package/dist/src/codegen/templates/query/query.resolver.ts.ejs +5 -8
- package/dist/src/domain/shared/ReadModel.d.ts +2 -4
- package/dist/src/domain/shared/ReadModel.d.ts.map +1 -1
- package/dist/src/domain/shared/ReadModel.js +2 -9
- package/dist/src/domain/shared/ReadModel.js.map +1 -1
- package/dist/src/domain/shared/ReadModel.ts +3 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ketchup-plan.md +2 -3
- package/package.json +4 -4
- package/src/codegen/templates/query/projection.specs.ts +5 -8
- package/src/codegen/templates/query/query.resolver.specs.ts +25 -40
- package/src/codegen/templates/query/query.resolver.ts.ejs +5 -8
- package/src/domain/shared/ReadModel.ts +3 -12
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @auto-engineer/server-generator-apollo-emmett@1.
|
|
2
|
+
> @auto-engineer/server-generator-apollo-emmett@1.80.0 build /home/runner/work/auto-engineer/auto-engineer/packages/server-generator-apollo-emmett
|
|
3
3
|
> tsc && tsx ../../scripts/fix-esm-imports.ts && rm -rf dist/src/codegen/templates && mkdir -p dist/src/codegen && cp -r src/codegen/templates dist/src/codegen/templates && cp src/server.ts dist/src && cp -r src/utils dist/src && cp -r src/domain dist/src
|
|
4
4
|
|
|
5
5
|
Fixed ESM imports in dist/
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @auto-engineer/server-generator-apollo-emmett@1.
|
|
2
|
+
> @auto-engineer/server-generator-apollo-emmett@1.79.0 test /home/runner/work/auto-engineer/auto-engineer/packages/server-generator-apollo-emmett
|
|
3
3
|
> vitest run --reporter=dot
|
|
4
4
|
|
|
5
5
|
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
[2m Test Files [22m [1m[32m30 passed[39m[22m[2m | [22m[33m1 skipped[39m[90m (31)[39m
|
|
11
11
|
[2m Tests [22m [1m[32m174 passed[39m[22m[2m | [22m[33m1 skipped[39m[90m (175)[39m
|
|
12
|
-
[2m Start at [22m
|
|
13
|
-
[2m Duration [22m
|
|
12
|
+
[2m Start at [22m 23:09:25
|
|
13
|
+
[2m Duration [22m 22.14s[2m (transform 2.91s, setup 0ms, collect 44.94s, tests 9.58s, environment 7ms, prepare 4.37s)[22m
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @auto-engineer/server-generator-apollo-emmett@1.
|
|
2
|
+
> @auto-engineer/server-generator-apollo-emmett@1.79.0 type-check /home/runner/work/auto-engineer/auto-engineer/packages/server-generator-apollo-emmett
|
|
3
3
|
> tsc --noEmit --project tsconfig.json
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @auto-engineer/server-generator-apollo-emmett
|
|
2
2
|
|
|
3
|
+
## 1.80.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`43082f0`](https://github.com/BeOnAuto/auto-engineer/commit/43082f08820c36d3f380b0e47b98263bc0287cf2) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **server-checks**: extract runLintCheck core logic
|
|
8
|
+
- **server-checks**: extract runTypeCheck core logic
|
|
9
|
+
- **server-checks**: extract findProjectRoot into shared module
|
|
10
|
+
- **app-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
11
|
+
- **react-component-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`4bdde8b`](https://github.com/BeOnAuto/auto-engineer/commit/4bdde8b4803a8e85234786e4d2e0cc227ad10859) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - Temporarily disabled existing tests in app and component generator specs for upcoming refactor
|
|
16
|
+
|
|
17
|
+
- [`3e7f02d`](https://github.com/BeOnAuto/auto-engineer/commit/3e7f02d79e078374c02c76ee7d261c76c35ce3be) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - format files with biome
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`4bdde8b`](https://github.com/BeOnAuto/auto-engineer/commit/4bdde8b4803a8e85234786e4d2e0cc227ad10859), [`43082f0`](https://github.com/BeOnAuto/auto-engineer/commit/43082f08820c36d3f380b0e47b98263bc0287cf2), [`3e7f02d`](https://github.com/BeOnAuto/auto-engineer/commit/3e7f02d79e078374c02c76ee7d261c76c35ce3be)]:
|
|
20
|
+
- @auto-engineer/message-bus@1.80.0
|
|
21
|
+
- @auto-engineer/narrative@1.80.0
|
|
22
|
+
|
|
23
|
+
## 1.79.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [`ec198e5`](https://github.com/BeOnAuto/auto-engineer/commit/ec198e559e662df16611ba433c56938304a869b6) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: extract findProjectRoot into shared module
|
|
28
|
+
|
|
29
|
+
- [`f460341`](https://github.com/BeOnAuto/auto-engineer/commit/f46034125e102b216d35a59f7260170480dc7fa4) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: extract runTypeCheck core logic
|
|
30
|
+
|
|
31
|
+
- [`ec1480d`](https://github.com/BeOnAuto/auto-engineer/commit/ec1480d6431df13948ae26dc2ad691c28ddafdf8) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **react-component-implementer**: add aesthetic quality checks to visual evaluator
|
|
32
|
+
- **app-implementer**: add comprehensive recipe-based visual design system
|
|
33
|
+
- **react-component-implementer**: replace design principles with Tailwind recipes
|
|
34
|
+
- **global**: version packages
|
|
35
|
+
- **react-component-implementer**: finalize ketchup plan for design system upgrade
|
|
36
|
+
|
|
37
|
+
- [`8eb0244`](https://github.com/BeOnAuto/auto-engineer/commit/8eb02443763228e8182cfb3c30606e94cc9f0c30) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: extract runLintCheck core logic
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [`506b0b4`](https://github.com/BeOnAuto/auto-engineer/commit/506b0b4810247e10c0896d45a37f4f0610d53455) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **react-component-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
42
|
+
|
|
43
|
+
- [`087f977`](https://github.com/BeOnAuto/auto-engineer/commit/087f9776128b0610b945f23d0f4c3bc1a3d816dd) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **app-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
44
|
+
|
|
45
|
+
- [`9bc98b4`](https://github.com/BeOnAuto/auto-engineer/commit/9bc98b4f384fa3417447e65286b015e1e10e63e9) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: slim CheckLint handler to delegate to runLintCheck
|
|
46
|
+
|
|
47
|
+
- [`b3ed5c1`](https://github.com/BeOnAuto/auto-engineer/commit/b3ed5c10575d00ca106237137bafc3524e8e9d82) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-generator-apollo-emmett**: ketchup plan for slim ReadModel API
|
|
48
|
+
|
|
49
|
+
- [`9c7ad8f`](https://github.com/BeOnAuto/auto-engineer/commit/9c7ad8fb3dd5d8321a80c4035baa9fe20701b651) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **global**: ketchup plan for LLM context growth optimization
|
|
50
|
+
|
|
51
|
+
- [`cedc3c0`](https://github.com/BeOnAuto/auto-engineer/commit/cedc3c0995af6025ab3d38a5a65d5bec9b4ecc7d) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **model-factory**: add ChatMessage and ChatTurn types for refinement history
|
|
52
|
+
|
|
53
|
+
- [`9757597`](https://github.com/BeOnAuto/auto-engineer/commit/9757597a1e562dfe81efa2de128aa10e8d091c79) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: add ketchup plan for unify check commands
|
|
54
|
+
|
|
55
|
+
- [`8104cc8`](https://github.com/BeOnAuto/auto-engineer/commit/8104cc82e7193c6a1a52a60da844a3e3fdb20b3b) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: export findProjectRoot, runTypeCheck, runLintCheck from index
|
|
56
|
+
|
|
57
|
+
- [`0bdb8d9`](https://github.com/BeOnAuto/auto-engineer/commit/0bdb8d9e606ce702cb7bbe81cbdc1f55fff58881) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: finalize ketchup plan for unify check commands
|
|
58
|
+
|
|
59
|
+
- [`31f65ac`](https://github.com/BeOnAuto/auto-engineer/commit/31f65acb9dfb656edfd482afc454bb4373b1d29d) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-generator-apollo-emmett**: slim ReadModel API to find + findOne
|
|
60
|
+
|
|
61
|
+
- [`25f8375`](https://github.com/BeOnAuto/auto-engineer/commit/25f8375ac181f09ff50aca3bccc3132b97814637) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **react-component-implementer**: replace lint-tier with runLintCheck, delete type-checker
|
|
62
|
+
|
|
63
|
+
- [`ab92096`](https://github.com/BeOnAuto/auto-engineer/commit/ab920961c9fd7515be9c09b4dbb1054bf03c94b9) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **react-component-implementer**: replace type-check-tier with runTypeCheck
|
|
64
|
+
|
|
65
|
+
- [`bcd8c4a`](https://github.com/BeOnAuto/auto-engineer/commit/bcd8c4a1e5e3d867c248d6bd55f66d7ef4863f46) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: use shared findProjectRoot in check-tests
|
|
66
|
+
|
|
67
|
+
- [`41ed452`](https://github.com/BeOnAuto/auto-engineer/commit/41ed4525bc796b1bdc1825fed20dd9f336108ca8) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - **server-checks**: slim CheckTypes handler to delegate to runTypeCheck
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [[`506b0b4`](https://github.com/BeOnAuto/auto-engineer/commit/506b0b4810247e10c0896d45a37f4f0610d53455), [`087f977`](https://github.com/BeOnAuto/auto-engineer/commit/087f9776128b0610b945f23d0f4c3bc1a3d816dd), [`9bc98b4`](https://github.com/BeOnAuto/auto-engineer/commit/9bc98b4f384fa3417447e65286b015e1e10e63e9), [`b3ed5c1`](https://github.com/BeOnAuto/auto-engineer/commit/b3ed5c10575d00ca106237137bafc3524e8e9d82), [`ec198e5`](https://github.com/BeOnAuto/auto-engineer/commit/ec198e559e662df16611ba433c56938304a869b6), [`9c7ad8f`](https://github.com/BeOnAuto/auto-engineer/commit/9c7ad8fb3dd5d8321a80c4035baa9fe20701b651), [`cedc3c0`](https://github.com/BeOnAuto/auto-engineer/commit/cedc3c0995af6025ab3d38a5a65d5bec9b4ecc7d), [`f460341`](https://github.com/BeOnAuto/auto-engineer/commit/f46034125e102b216d35a59f7260170480dc7fa4), [`9757597`](https://github.com/BeOnAuto/auto-engineer/commit/9757597a1e562dfe81efa2de128aa10e8d091c79), [`8104cc8`](https://github.com/BeOnAuto/auto-engineer/commit/8104cc82e7193c6a1a52a60da844a3e3fdb20b3b), [`ec1480d`](https://github.com/BeOnAuto/auto-engineer/commit/ec1480d6431df13948ae26dc2ad691c28ddafdf8), [`0bdb8d9`](https://github.com/BeOnAuto/auto-engineer/commit/0bdb8d9e606ce702cb7bbe81cbdc1f55fff58881), [`31f65ac`](https://github.com/BeOnAuto/auto-engineer/commit/31f65acb9dfb656edfd482afc454bb4373b1d29d), [`25f8375`](https://github.com/BeOnAuto/auto-engineer/commit/25f8375ac181f09ff50aca3bccc3132b97814637), [`ab92096`](https://github.com/BeOnAuto/auto-engineer/commit/ab920961c9fd7515be9c09b4dbb1054bf03c94b9), [`bcd8c4a`](https://github.com/BeOnAuto/auto-engineer/commit/bcd8c4a1e5e3d867c248d6bd55f66d7ef4863f46), [`41ed452`](https://github.com/BeOnAuto/auto-engineer/commit/41ed4525bc796b1bdc1825fed20dd9f336108ca8), [`8eb0244`](https://github.com/BeOnAuto/auto-engineer/commit/8eb02443763228e8182cfb3c30606e94cc9f0c30)]:
|
|
70
|
+
- @auto-engineer/message-bus@1.79.0
|
|
71
|
+
- @auto-engineer/narrative@1.79.0
|
|
72
|
+
|
|
3
73
|
## 1.78.0
|
|
4
74
|
|
|
5
75
|
### Minor Changes
|
|
@@ -377,15 +377,12 @@ describe('projection.ts.ejs', () => {
|
|
|
377
377
|
): Promise<Wishlist[]> {
|
|
378
378
|
const model = new ReadModel<Wishlist>(ctx.database, 'WishlistProjection');
|
|
379
379
|
|
|
380
|
-
//
|
|
381
|
-
//
|
|
382
|
-
// - model.
|
|
383
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
384
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
385
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
380
|
+
// ReadModel API:
|
|
381
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
382
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
386
383
|
//
|
|
387
|
-
//
|
|
388
|
-
//
|
|
384
|
+
// The scaffolded code below uses find() returning an array.
|
|
385
|
+
// If this query should return a single item, switch to findOne().
|
|
389
386
|
|
|
390
387
|
return model.find((item) => {
|
|
391
388
|
if (sessionId !== undefined && item.sessionId !== sessionId) return false;
|
|
@@ -104,15 +104,12 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
104
104
|
): Promise<AvailableListings[]> {
|
|
105
105
|
const model = new ReadModel<AvailableListings>(ctx.database, 'AvailablePropertiesProjection');
|
|
106
106
|
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
// - model.
|
|
110
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
111
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
112
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
107
|
+
// ReadModel API:
|
|
108
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
109
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
113
110
|
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
111
|
+
// The scaffolded code below uses find() returning an array.
|
|
112
|
+
// If this query should return a single item, switch to findOne().
|
|
116
113
|
|
|
117
114
|
return model.find((item) => {
|
|
118
115
|
if (location !== undefined && item.location !== location) return false;
|
|
@@ -235,15 +232,12 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
235
232
|
): Promise<SuggestedItems[]> {
|
|
236
233
|
const model = new ReadModel<SuggestedItems>(ctx.database, 'SuggestedItemsProjection');
|
|
237
234
|
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// - model.
|
|
241
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
242
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
243
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
235
|
+
// ReadModel API:
|
|
236
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
237
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
244
238
|
//
|
|
245
|
-
//
|
|
246
|
-
//
|
|
239
|
+
// The scaffolded code below uses find() returning an array.
|
|
240
|
+
// If this query should return a single item, switch to findOne().
|
|
247
241
|
|
|
248
242
|
return model.find((item) => {
|
|
249
243
|
if (sessionId !== undefined && item.sessionId !== sessionId) return false;
|
|
@@ -411,15 +405,12 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
411
405
|
): Promise<QuestionnaireProgress[]> {
|
|
412
406
|
const model = new ReadModel<QuestionnaireProgress>(ctx.database, 'Questionnaires');
|
|
413
407
|
|
|
414
|
-
//
|
|
415
|
-
//
|
|
416
|
-
// - model.
|
|
417
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
418
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
419
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
408
|
+
// ReadModel API:
|
|
409
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
410
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
420
411
|
//
|
|
421
|
-
//
|
|
422
|
-
//
|
|
412
|
+
// The scaffolded code below uses find() returning an array.
|
|
413
|
+
// If this query should return a single item, switch to findOne().
|
|
423
414
|
|
|
424
415
|
return model.find((item) => {
|
|
425
416
|
if (participantId !== undefined && item.participantId !== participantId) return false;
|
|
@@ -936,15 +927,12 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
936
927
|
): Promise<RecipeMatchesRecipes[]> {
|
|
937
928
|
const model = new ReadModel<RecipeMatchesRecipes>(ctx.database, 'RecipeMatchesProjection');
|
|
938
929
|
|
|
939
|
-
//
|
|
940
|
-
//
|
|
941
|
-
// - model.
|
|
942
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
943
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
944
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
930
|
+
// ReadModel API:
|
|
931
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
932
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
945
933
|
//
|
|
946
|
-
//
|
|
947
|
-
//
|
|
934
|
+
// The scaffolded code below uses find() returning an array.
|
|
935
|
+
// If this query should return a single item, switch to findOne().
|
|
948
936
|
|
|
949
937
|
return model.find((item) => {
|
|
950
938
|
if (pantryId !== undefined && item.pantryId !== pantryId) return false;
|
|
@@ -1181,15 +1169,12 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
1181
1169
|
): Promise<RecipeMatchesRecipes[]> {
|
|
1182
1170
|
const model = new ReadModel<RecipeMatchesRecipes>(ctx.database, 'RecipeMatchesProjection');
|
|
1183
1171
|
|
|
1184
|
-
//
|
|
1185
|
-
//
|
|
1186
|
-
// - model.
|
|
1187
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
1188
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
1189
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
1172
|
+
// ReadModel API:
|
|
1173
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
1174
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
1190
1175
|
//
|
|
1191
|
-
//
|
|
1192
|
-
//
|
|
1176
|
+
// The scaffolded code below uses find() returning an array.
|
|
1177
|
+
// If this query should return a single item, switch to findOne().
|
|
1193
1178
|
|
|
1194
1179
|
return model.find((item) => {
|
|
1195
1180
|
if (pantryId !== undefined && item.pantryId !== pantryId) return false;
|
|
@@ -156,15 +156,12 @@ async <%= queryName %>(
|
|
|
156
156
|
): Promise<<%= viewType %>[]> {
|
|
157
157
|
const model = new ReadModel<<%= viewType %>>(ctx.database, '<%= collectionName %>');
|
|
158
158
|
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
// - model.
|
|
162
|
-
// - model.getById(id) — fetch a single document by ID (default key: 'id')
|
|
163
|
-
// - model.find(filterFn) — filter documents using a predicate
|
|
164
|
-
// - model.first(filterFn) — fetch the first document matching a predicate
|
|
159
|
+
// ReadModel API:
|
|
160
|
+
// - model.find(filterFn?) → T[] returns all matches (or all documents if no filter)
|
|
161
|
+
// - model.findOne(filterFn) → T | null returns the first match
|
|
165
162
|
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
163
|
+
// The scaffolded code below uses find() returning an array.
|
|
164
|
+
// If this query should return a single item, switch to findOne().
|
|
168
165
|
|
|
169
166
|
return model.find((<%= hasArgs ? 'item' : '_item' %>) => {
|
|
170
167
|
<% if (parsedRequest?.args?.length) {
|
|
@@ -2,9 +2,7 @@ import type { InMemoryDatabase } from '@event-driven-io/emmett';
|
|
|
2
2
|
export declare class ReadModel<T extends Record<string, unknown>> {
|
|
3
3
|
private collection;
|
|
4
4
|
constructor(database: InMemoryDatabase, collectionName: string);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
find(filterFn: (item: T) => boolean): Promise<T[]>;
|
|
8
|
-
first(filterFn: (item: T) => boolean): Promise<T | null>;
|
|
5
|
+
find(filterFn?: (item: T) => boolean): Promise<T[]>;
|
|
6
|
+
findOne(filterFn: (item: T) => boolean): Promise<T | null>;
|
|
9
7
|
}
|
|
10
8
|
//# sourceMappingURL=ReadModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadModel.d.ts","sourceRoot":"","sources":["../../../../src/domain/shared/ReadModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,UAAU,CAAC;gBAEP,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM;IAIxD,
|
|
1
|
+
{"version":3,"file":"ReadModel.d.ts","sourceRoot":"","sources":["../../../../src/domain/shared/ReadModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,UAAU,CAAC;gBAEP,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM;IAIxD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAInD,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAGjE"}
|
|
@@ -2,18 +2,11 @@ export class ReadModel {
|
|
|
2
2
|
constructor(database, collectionName) {
|
|
3
3
|
this.collection = database.collection(collectionName);
|
|
4
4
|
}
|
|
5
|
-
async getAll() {
|
|
6
|
-
return this.collection.find();
|
|
7
|
-
}
|
|
8
|
-
async getById(id, idField = 'id') {
|
|
9
|
-
return this.collection.findOne((doc) => doc[idField] === id);
|
|
10
|
-
}
|
|
11
5
|
async find(filterFn) {
|
|
12
6
|
return this.collection.find(filterFn);
|
|
13
7
|
}
|
|
14
|
-
async
|
|
15
|
-
|
|
16
|
-
return all[0] ?? null;
|
|
8
|
+
async findOne(filterFn) {
|
|
9
|
+
return this.collection.findOne(filterFn);
|
|
17
10
|
}
|
|
18
11
|
}
|
|
19
12
|
//# sourceMappingURL=ReadModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadModel.js","sourceRoot":"","sources":["../../../../src/domain/shared/ReadModel.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;IAGpB,YAAY,QAA0B,EAAE,cAAsB;QAC5D,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAI,cAAc,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ReadModel.js","sourceRoot":"","sources":["../../../../src/domain/shared/ReadModel.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;IAGpB,YAAY,QAA0B,EAAE,cAAsB;QAC5D,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAI,cAAc,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAA+B;QACxC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA8B;QAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -7,20 +7,11 @@ export class ReadModel<T extends Record<string, unknown>> {
|
|
|
7
7
|
this.collection = database.collection<T>(collectionName);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
async
|
|
11
|
-
return this.collection.find();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async getById(id: string, idField: keyof T = 'id' as keyof T): Promise<T | null> {
|
|
15
|
-
return this.collection.findOne((doc) => doc[idField] === id);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async find(filterFn: (item: T) => boolean): Promise<T[]> {
|
|
10
|
+
async find(filterFn?: (item: T) => boolean): Promise<T[]> {
|
|
19
11
|
return this.collection.find(filterFn);
|
|
20
12
|
}
|
|
21
13
|
|
|
22
|
-
async
|
|
23
|
-
|
|
24
|
-
return all[0] ?? null;
|
|
14
|
+
async findOne(filterFn: (item: T) => boolean): Promise<T | null> {
|
|
15
|
+
return this.collection.findOne(filterFn);
|
|
25
16
|
}
|
|
26
17
|
}
|