@auto-engineer/server-generator-apollo-emmett 0.21.0 → 0.22.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/CHANGELOG.md +20 -0
- package/dist/src/codegen/extract/data-sink.js +2 -2
- package/dist/src/codegen/extract/data-sink.js.map +1 -1
- package/dist/src/codegen/extract/projection.js +2 -2
- package/dist/src/codegen/extract/projection.js.map +1 -1
- package/dist/src/codegen/extract/states.d.ts.map +1 -1
- package/dist/src/codegen/extract/states.js +5 -4
- package/dist/src/codegen/extract/states.js.map +1 -1
- package/dist/src/codegen/scaffoldFromSchema.js +1 -1
- package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
- package/dist/src/codegen/templates/command/decide.specs.ts +33 -31
- package/dist/src/codegen/templates/command/decide.ts.ejs +1 -1
- package/dist/src/codegen/templates/command/handle.specs.ts +46 -42
- package/dist/src/codegen/templates/command/handle.ts.ejs +2 -2
- package/dist/src/codegen/templates/command/mutation.resolver.specs.ts +12 -10
- package/dist/src/codegen/templates/command/register.specs.ts +13 -11
- package/dist/src/codegen/templates/query/projection.specs.specs.ts +64 -54
- package/dist/src/codegen/templates/query/projection.specs.ts +56 -48
- package/dist/src/codegen/templates/query/projection.specs.ts.ejs +1 -1
- package/dist/src/codegen/templates/query/projection.ts.ejs +10 -10
- package/dist/src/codegen/templates/query/query.resolver.specs.ts +92 -78
- package/dist/src/codegen/templates/query/query.resolver.ts.ejs +2 -2
- package/dist/src/codegen/templates/query/state.specs.ts +14 -12
- package/dist/src/codegen/templates/react/react.specs.specs.ts +8 -6
- package/dist/src/codegen/test-data/specVariant1.d.ts.map +1 -1
- package/dist/src/codegen/test-data/specVariant1.js +18 -16
- package/dist/src/codegen/test-data/specVariant1.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/codegen/extract/data-sink.ts +2 -2
- package/src/codegen/extract/projection.ts +2 -2
- package/src/codegen/extract/states.ts +6 -5
- package/src/codegen/scaffoldFromSchema.ts +1 -1
- package/src/codegen/templates/command/decide.specs.ts +33 -31
- package/src/codegen/templates/command/decide.ts.ejs +1 -1
- package/src/codegen/templates/command/handle.specs.ts +46 -42
- package/src/codegen/templates/command/handle.ts.ejs +2 -2
- package/src/codegen/templates/command/mutation.resolver.specs.ts +12 -10
- package/src/codegen/templates/command/register.specs.ts +13 -11
- package/src/codegen/templates/query/projection.specs.specs.ts +64 -54
- package/src/codegen/templates/query/projection.specs.ts +56 -48
- package/src/codegen/templates/query/projection.specs.ts.ejs +1 -1
- package/src/codegen/templates/query/projection.ts.ejs +10 -10
- package/src/codegen/templates/query/query.resolver.specs.ts +92 -78
- package/src/codegen/templates/query/query.resolver.ts.ejs +2 -2
- package/src/codegen/templates/query/state.specs.ts +14 -12
- package/src/codegen/templates/react/react.specs.specs.ts +8 -6
- package/src/codegen/test-data/specVariant1.ts +18 -16
- package/.turbo/turbo-format.log +0 -4
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -14
- package/.turbo/turbo-type-check.log +0 -4
- package/dist/src/codegen/scaffoldFromSchema.integration.specs.d.ts +0 -2
- package/dist/src/codegen/scaffoldFromSchema.integration.specs.d.ts.map +0 -1
- package/dist/src/codegen/scaffoldFromSchema.integration.specs.js +0 -59
- package/dist/src/codegen/scaffoldFromSchema.integration.specs.js.map +0 -1
|
@@ -83,19 +83,21 @@ describe('projection.specs.ts.ejs', () => {
|
|
|
83
83
|
client: { specs: [] },
|
|
84
84
|
server: {
|
|
85
85
|
description: '',
|
|
86
|
-
data:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
data: {
|
|
87
|
+
items: [
|
|
88
|
+
{
|
|
89
|
+
origin: {
|
|
90
|
+
type: 'projection',
|
|
91
|
+
idField: 'propertyId',
|
|
92
|
+
name: 'AvailablePropertiesProjection',
|
|
93
|
+
},
|
|
94
|
+
target: {
|
|
95
|
+
type: 'State',
|
|
96
|
+
name: 'AvailableListings',
|
|
97
|
+
},
|
|
96
98
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
],
|
|
100
|
+
},
|
|
99
101
|
specs: [
|
|
100
102
|
{
|
|
101
103
|
type: 'gherkin',
|
|
@@ -261,19 +263,21 @@ describe('projection.specs.ts.ejs', () => {
|
|
|
261
263
|
client: { specs: [] },
|
|
262
264
|
server: {
|
|
263
265
|
description: '',
|
|
264
|
-
data:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
266
|
+
data: {
|
|
267
|
+
items: [
|
|
268
|
+
{
|
|
269
|
+
target: {
|
|
270
|
+
type: 'State',
|
|
271
|
+
name: 'QuestionnaireProgress',
|
|
272
|
+
},
|
|
273
|
+
origin: {
|
|
274
|
+
type: 'projection',
|
|
275
|
+
name: 'Questionnaires',
|
|
276
|
+
idField: 'questionnaire-participantId',
|
|
277
|
+
},
|
|
274
278
|
},
|
|
275
|
-
|
|
276
|
-
|
|
279
|
+
],
|
|
280
|
+
},
|
|
277
281
|
specs: [
|
|
278
282
|
{
|
|
279
283
|
type: 'gherkin',
|
|
@@ -544,12 +548,14 @@ describe('projection.specs.ts.ejs', () => {
|
|
|
544
548
|
],
|
|
545
549
|
},
|
|
546
550
|
],
|
|
547
|
-
data:
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
551
|
+
data: {
|
|
552
|
+
items: [
|
|
553
|
+
{
|
|
554
|
+
origin: { name: 'Questionnaires', idField: 'questionnaireId-participantId' },
|
|
555
|
+
target: { name: 'QuestionnaireProgress' },
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
},
|
|
553
559
|
},
|
|
554
560
|
},
|
|
555
561
|
],
|
|
@@ -702,19 +708,21 @@ describe('projection.specs.ts.ejs', () => {
|
|
|
702
708
|
client: { specs: [] },
|
|
703
709
|
server: {
|
|
704
710
|
description: '',
|
|
705
|
-
data:
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
711
|
+
data: {
|
|
712
|
+
items: [
|
|
713
|
+
{
|
|
714
|
+
target: {
|
|
715
|
+
type: 'State',
|
|
716
|
+
name: 'TodoSummary',
|
|
717
|
+
},
|
|
718
|
+
origin: {
|
|
719
|
+
type: 'projection',
|
|
720
|
+
name: 'TodoSummaryProjection',
|
|
721
|
+
singleton: true,
|
|
722
|
+
},
|
|
715
723
|
},
|
|
716
|
-
|
|
717
|
-
|
|
724
|
+
],
|
|
725
|
+
},
|
|
718
726
|
specs: [
|
|
719
727
|
{
|
|
720
728
|
type: 'gherkin',
|
|
@@ -887,19 +895,21 @@ describe('projection.specs.ts.ejs', () => {
|
|
|
887
895
|
client: { specs: [] },
|
|
888
896
|
server: {
|
|
889
897
|
description: '',
|
|
890
|
-
data:
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
898
|
+
data: {
|
|
899
|
+
items: [
|
|
900
|
+
{
|
|
901
|
+
target: {
|
|
902
|
+
type: 'State',
|
|
903
|
+
name: 'UserProject',
|
|
904
|
+
},
|
|
905
|
+
origin: {
|
|
906
|
+
type: 'projection',
|
|
907
|
+
name: 'UserProjectsProjection',
|
|
908
|
+
idField: ['userId', 'projectId'],
|
|
909
|
+
},
|
|
900
910
|
},
|
|
901
|
-
|
|
902
|
-
|
|
911
|
+
],
|
|
912
|
+
},
|
|
903
913
|
specs: [
|
|
904
914
|
{
|
|
905
915
|
type: 'gherkin',
|
|
@@ -87,19 +87,21 @@ describe('projection.ts.ejs', () => {
|
|
|
87
87
|
},
|
|
88
88
|
server: {
|
|
89
89
|
description: 'projection for available listings',
|
|
90
|
-
data:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
data: {
|
|
91
|
+
items: [
|
|
92
|
+
{
|
|
93
|
+
target: {
|
|
94
|
+
type: 'State',
|
|
95
|
+
name: 'AvailableListings',
|
|
96
|
+
},
|
|
97
|
+
origin: {
|
|
98
|
+
type: 'projection',
|
|
99
|
+
name: 'AvailablePropertiesProjection',
|
|
100
|
+
idField: 'propertyId',
|
|
101
|
+
},
|
|
100
102
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
],
|
|
104
|
+
},
|
|
103
105
|
specs: [
|
|
104
106
|
{
|
|
105
107
|
type: 'gherkin',
|
|
@@ -309,19 +311,21 @@ describe('projection.ts.ejs', () => {
|
|
|
309
311
|
},
|
|
310
312
|
server: {
|
|
311
313
|
description: '',
|
|
312
|
-
data:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
314
|
+
data: {
|
|
315
|
+
items: [
|
|
316
|
+
{
|
|
317
|
+
origin: {
|
|
318
|
+
type: 'projection',
|
|
319
|
+
idField: 'sessionId',
|
|
320
|
+
name: 'WishlistProjection',
|
|
321
|
+
},
|
|
322
|
+
target: {
|
|
323
|
+
type: 'State',
|
|
324
|
+
name: 'Wishlist',
|
|
325
|
+
},
|
|
322
326
|
},
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
],
|
|
328
|
+
},
|
|
325
329
|
specs: [],
|
|
326
330
|
},
|
|
327
331
|
},
|
|
@@ -450,19 +454,21 @@ describe('projection.ts.ejs', () => {
|
|
|
450
454
|
},
|
|
451
455
|
server: {
|
|
452
456
|
description: 'singleton projection for todo summary',
|
|
453
|
-
data:
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
457
|
+
data: {
|
|
458
|
+
items: [
|
|
459
|
+
{
|
|
460
|
+
target: {
|
|
461
|
+
type: 'State',
|
|
462
|
+
name: 'TodoSummary',
|
|
463
|
+
},
|
|
464
|
+
origin: {
|
|
465
|
+
type: 'projection',
|
|
466
|
+
name: 'TodoSummaryProjection',
|
|
467
|
+
singleton: true,
|
|
468
|
+
},
|
|
463
469
|
},
|
|
464
|
-
|
|
465
|
-
|
|
470
|
+
],
|
|
471
|
+
},
|
|
466
472
|
specs: [
|
|
467
473
|
{
|
|
468
474
|
type: 'gherkin',
|
|
@@ -665,19 +671,21 @@ describe('projection.ts.ejs', () => {
|
|
|
665
671
|
},
|
|
666
672
|
server: {
|
|
667
673
|
description: 'composite key projection for user projects',
|
|
668
|
-
data:
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
674
|
+
data: {
|
|
675
|
+
items: [
|
|
676
|
+
{
|
|
677
|
+
target: {
|
|
678
|
+
type: 'State',
|
|
679
|
+
name: 'UserProject',
|
|
680
|
+
},
|
|
681
|
+
origin: {
|
|
682
|
+
type: 'projection',
|
|
683
|
+
name: 'UserProjectsProjection',
|
|
684
|
+
idField: ['userId', 'projectId'],
|
|
685
|
+
},
|
|
678
686
|
},
|
|
679
|
-
|
|
680
|
-
|
|
687
|
+
],
|
|
688
|
+
},
|
|
681
689
|
specs: [
|
|
682
690
|
{
|
|
683
691
|
type: 'gherkin',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%_
|
|
2
|
-
const targetName = slice?.server?.data?.[0]?.target?.name || 'UnknownState';
|
|
2
|
+
const targetName = slice?.server?.data?.items?.[0]?.target?.name || 'UnknownState';
|
|
3
3
|
const TargetType = pascalCase(targetName);
|
|
4
4
|
const projName = projectionName || "UnknownProjection";
|
|
5
5
|
const idField = projectionIdField ?? 'id';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const origin = slice.server?.data?.[0]?.origin;
|
|
2
|
+
const origin = slice.server?.data?.items?.[0]?.origin;
|
|
3
3
|
const isSingleton = origin?.singleton === true;
|
|
4
4
|
const idField = origin?.idField;
|
|
5
5
|
const isCompositeKey = Array.isArray(idField);
|
|
@@ -9,7 +9,7 @@ inMemorySingleStreamProjection,
|
|
|
9
9
|
type ReadEvent,
|
|
10
10
|
type InMemoryReadEventMetadata,
|
|
11
11
|
} from '@event-driven-io/emmett';
|
|
12
|
-
import type { <%= pascalCase(slice.server?.data?.[0]?.target?.name || 'UnknownState') %> } from './state';<%
|
|
12
|
+
import type { <%= pascalCase(slice.server?.data?.items?.[0]?.target?.name || 'UnknownState') %> } from './state';<%
|
|
13
13
|
if (eventImportGroups.length > 0) {
|
|
14
14
|
for (const group of eventImportGroups) {
|
|
15
15
|
%>
|
|
@@ -20,7 +20,7 @@ import type { <%= group.eventTypes.join(', ') %> } from '<%= group.importPath %>
|
|
|
20
20
|
|
|
21
21
|
// Collect enums used in state fields
|
|
22
22
|
const stateEnums = [];
|
|
23
|
-
const targetName = slice.server?.data?.[0]?.target?.name;
|
|
23
|
+
const targetName = slice.server?.data?.items?.[0]?.target?.name;
|
|
24
24
|
if (targetName && messages) {
|
|
25
25
|
const targetDef = messages.find(m => m.name === targetName);
|
|
26
26
|
if (targetDef?.fields) {
|
|
@@ -52,14 +52,14 @@ interface Internal<%= pascalCase(targetName || 'State') %> extends <%= pascalCas
|
|
|
52
52
|
type AllEvents = <%= allEventTypes %>;
|
|
53
53
|
|
|
54
54
|
export const projection = inMemorySingleStreamProjection<
|
|
55
|
-
<%= pascalCase(slice.server?.data?.[0]?.target?.name || 'UnknownState') %>,
|
|
55
|
+
<%= pascalCase(slice.server?.data?.items?.[0]?.target?.name || 'UnknownState') %>,
|
|
56
56
|
AllEvents
|
|
57
57
|
>({
|
|
58
|
-
collectionName: '<%= pascalCase(slice.server?.data?.[0]?.origin?.name || "unknown-collection") %>',
|
|
58
|
+
collectionName: '<%= pascalCase(slice.server?.data?.items?.[0]?.origin?.name || "unknown-collection") %>',
|
|
59
59
|
canHandle: [<%- events.map(e => `'${e.type}'`).join(', ') %>],
|
|
60
60
|
getDocumentId: (<%- isSingleton ? '_event' : 'event' %>) => <%
|
|
61
61
|
if (isSingleton) {
|
|
62
|
-
%>'<%= toKebabCase(slice.server?.data?.[0]?.target?.name || 'singleton') %>'<%
|
|
62
|
+
%>'<%= toKebabCase(slice.server?.data?.items?.[0]?.target?.name || 'singleton') %>'<%
|
|
63
63
|
} else if (isCompositeKey) {
|
|
64
64
|
const template = compositeKeyFields.map((field, index) =>
|
|
65
65
|
index === 0 ? `\${event.data.${field}}` : `-\${event.data.${field}}`
|
|
@@ -71,12 +71,12 @@ if (isSingleton) {
|
|
|
71
71
|
}
|
|
72
72
|
%>,
|
|
73
73
|
evolve: (
|
|
74
|
-
document: <%= pascalCase(slice.server?.data?.[0]?.target?.name || 'UnknownState') %> | null,
|
|
74
|
+
document: <%= pascalCase(slice.server?.data?.items?.[0]?.target?.name || 'UnknownState') %> | null,
|
|
75
75
|
event: ReadEvent<AllEvents, InMemoryReadEventMetadata>
|
|
76
|
-
): <%= pascalCase(slice.server?.data?.[0]?.target?.name || 'UnknownState') %> | null => {
|
|
76
|
+
): <%= pascalCase(slice.server?.data?.items?.[0]?.target?.name || 'UnknownState') %> | null => {
|
|
77
77
|
switch (event.type) {
|
|
78
78
|
<% for (const event of events) {
|
|
79
|
-
const targetName = slice.server?.data?.[0]?.target?.name;
|
|
79
|
+
const targetName = slice.server?.data?.items?.[0]?.target?.name;
|
|
80
80
|
const queryGwt = slice.type === 'query'
|
|
81
81
|
? queryGwtMapping.find(gwt => {
|
|
82
82
|
const inGiven = gwt.given && gwt.given.some(g => g.eventRef === event.type);
|
|
@@ -87,7 +87,7 @@ switch (event.type) {
|
|
|
87
87
|
const example = slice.type === 'query'
|
|
88
88
|
? queryGwt?.then.find(t => t.stateRef === targetName)?.exampleData
|
|
89
89
|
: gwtMapping[event.type]?.[0]?.then?.[0]?.exampleData;
|
|
90
|
-
const targetDef = messages.find(m => m.name === slice.server?.data?.[0]?.target?.name);
|
|
90
|
+
const targetDef = messages.find(m => m.name === slice.server?.data?.items?.[0]?.target?.name);
|
|
91
91
|
const targetFields = Object.fromEntries((targetDef?.fields ?? []).map(f => [f.name, f]));
|
|
92
92
|
let usedFields = [];
|
|
93
93
|
let isRemovalEvent = false;
|
|
@@ -29,19 +29,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
29
29
|
},
|
|
30
30
|
server: {
|
|
31
31
|
description: '',
|
|
32
|
-
data:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
data: {
|
|
33
|
+
items: [
|
|
34
|
+
{
|
|
35
|
+
origin: {
|
|
36
|
+
type: 'projection',
|
|
37
|
+
idField: 'propertyId',
|
|
38
|
+
name: 'AvailablePropertiesProjection',
|
|
39
|
+
},
|
|
40
|
+
target: {
|
|
41
|
+
type: 'State',
|
|
42
|
+
name: 'AvailableListings',
|
|
43
|
+
},
|
|
42
44
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
],
|
|
46
|
+
},
|
|
45
47
|
specs: [],
|
|
46
48
|
},
|
|
47
49
|
},
|
|
@@ -152,19 +154,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
152
154
|
client: { specs: [] },
|
|
153
155
|
server: {
|
|
154
156
|
description: '',
|
|
155
|
-
data:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
data: {
|
|
158
|
+
items: [
|
|
159
|
+
{
|
|
160
|
+
origin: {
|
|
161
|
+
type: 'projection',
|
|
162
|
+
idField: 'sessionId',
|
|
163
|
+
name: 'SuggestedItemsProjection',
|
|
164
|
+
},
|
|
165
|
+
target: {
|
|
166
|
+
type: 'State',
|
|
167
|
+
name: 'SuggestedItems',
|
|
168
|
+
},
|
|
165
169
|
},
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
],
|
|
171
|
+
},
|
|
168
172
|
specs: [],
|
|
169
173
|
},
|
|
170
174
|
},
|
|
@@ -268,12 +272,14 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
268
272
|
'query QuestionnaireProgress($participantId: ID!) {\n questionnaireProgress(participantId: $participantId) {\n questionnaireId\n participantId\n status\n currentQuestionId\n remainingQuestions\n answers {\n questionId\n value\n }\n }\n}',
|
|
269
273
|
server: {
|
|
270
274
|
description: '',
|
|
271
|
-
data:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
data: {
|
|
276
|
+
items: [
|
|
277
|
+
{
|
|
278
|
+
target: { type: 'State', name: 'QuestionnaireProgress' },
|
|
279
|
+
origin: { type: 'projection', name: 'Questionnaires', idField: 'questionnaire-participantId' },
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
277
283
|
specs: [
|
|
278
284
|
{
|
|
279
285
|
type: 'gherkin',
|
|
@@ -449,19 +455,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
449
455
|
},
|
|
450
456
|
server: {
|
|
451
457
|
description: '',
|
|
452
|
-
data:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
458
|
+
data: {
|
|
459
|
+
items: [
|
|
460
|
+
{
|
|
461
|
+
origin: {
|
|
462
|
+
type: 'projection',
|
|
463
|
+
idField: 'productId',
|
|
464
|
+
name: 'ProductPricesProjection',
|
|
465
|
+
},
|
|
466
|
+
target: {
|
|
467
|
+
type: 'State',
|
|
468
|
+
name: 'ProductPrice',
|
|
469
|
+
},
|
|
462
470
|
},
|
|
463
|
-
|
|
464
|
-
|
|
471
|
+
],
|
|
472
|
+
},
|
|
465
473
|
specs: [],
|
|
466
474
|
},
|
|
467
475
|
},
|
|
@@ -512,19 +520,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
512
520
|
},
|
|
513
521
|
server: {
|
|
514
522
|
description: '',
|
|
515
|
-
data:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
523
|
+
data: {
|
|
524
|
+
items: [
|
|
525
|
+
{
|
|
526
|
+
origin: {
|
|
527
|
+
type: 'projection',
|
|
528
|
+
idField: 'userId',
|
|
529
|
+
name: 'StatsProjection',
|
|
530
|
+
},
|
|
531
|
+
target: {
|
|
532
|
+
type: 'State',
|
|
533
|
+
name: 'Stats',
|
|
534
|
+
},
|
|
525
535
|
},
|
|
526
|
-
|
|
527
|
-
|
|
536
|
+
],
|
|
537
|
+
},
|
|
528
538
|
specs: [],
|
|
529
539
|
},
|
|
530
540
|
},
|
|
@@ -572,19 +582,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
572
582
|
},
|
|
573
583
|
server: {
|
|
574
584
|
description: '',
|
|
575
|
-
data:
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
+
data: {
|
|
586
|
+
items: [
|
|
587
|
+
{
|
|
588
|
+
origin: {
|
|
589
|
+
type: 'projection',
|
|
590
|
+
idField: 'productId',
|
|
591
|
+
name: 'ProductsProjection',
|
|
592
|
+
},
|
|
593
|
+
target: {
|
|
594
|
+
type: 'State',
|
|
595
|
+
name: 'Product',
|
|
596
|
+
},
|
|
585
597
|
},
|
|
586
|
-
|
|
587
|
-
|
|
598
|
+
],
|
|
599
|
+
},
|
|
588
600
|
specs: [],
|
|
589
601
|
},
|
|
590
602
|
},
|
|
@@ -636,19 +648,21 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
636
648
|
},
|
|
637
649
|
server: {
|
|
638
650
|
description: '',
|
|
639
|
-
data:
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
651
|
+
data: {
|
|
652
|
+
items: [
|
|
653
|
+
{
|
|
654
|
+
origin: {
|
|
655
|
+
type: 'projection',
|
|
656
|
+
name: 'TodoSummary',
|
|
657
|
+
singleton: true,
|
|
658
|
+
},
|
|
659
|
+
target: {
|
|
660
|
+
type: 'State',
|
|
661
|
+
name: 'TodoListSummary',
|
|
662
|
+
},
|
|
649
663
|
},
|
|
650
|
-
|
|
651
|
-
|
|
664
|
+
],
|
|
665
|
+
},
|
|
652
666
|
specs: [],
|
|
653
667
|
},
|
|
654
668
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const target = slice?.server?.data?.[0]?.target;
|
|
3
|
-
const projection = slice?.server?.data?.[0]?.origin;
|
|
2
|
+
const target = slice?.server?.data?.items?.[0]?.target;
|
|
3
|
+
const projection = slice?.server?.data?.items?.[0]?.origin;
|
|
4
4
|
const isSingleton = projection?.singleton === true;
|
|
5
5
|
const queryName = parsedRequest?.queryName ?? camelCase(sliceName);
|
|
6
6
|
const viewType = target?.name ? pascalCase(target.name) : 'UnknownView';
|
|
@@ -18,19 +18,21 @@ describe('state.ts.ejs', () => {
|
|
|
18
18
|
},
|
|
19
19
|
server: {
|
|
20
20
|
description: 'Projects available items',
|
|
21
|
-
data:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
data: {
|
|
22
|
+
items: [
|
|
23
|
+
{
|
|
24
|
+
origin: {
|
|
25
|
+
type: 'projection',
|
|
26
|
+
name: 'ItemCreated',
|
|
27
|
+
idField: 'id',
|
|
28
|
+
},
|
|
29
|
+
target: {
|
|
30
|
+
type: 'State',
|
|
31
|
+
name: 'AvailableItems',
|
|
32
|
+
},
|
|
27
33
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
name: 'AvailableItems',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
+
],
|
|
35
|
+
},
|
|
34
36
|
specs: [],
|
|
35
37
|
},
|
|
36
38
|
},
|
|
@@ -72,12 +72,14 @@ describe('react.specs.ts.ejs (react slice)', () => {
|
|
|
72
72
|
name: 'Send notification to host',
|
|
73
73
|
server: {
|
|
74
74
|
description: 'Sends a host notification command in response to BookingRequested',
|
|
75
|
-
data:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
data: {
|
|
76
|
+
items: [
|
|
77
|
+
{
|
|
78
|
+
target: { type: 'Command', name: 'NotifyHost' },
|
|
79
|
+
destination: { type: 'stream', pattern: 'booking-${hostId}' },
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
81
83
|
specs: [
|
|
82
84
|
{
|
|
83
85
|
type: 'gherkin',
|