@auto-engineer/server-generator-apollo-emmett 0.8.5 → 0.8.6
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 +2 -2
- package/CHANGELOG.md +8 -0
- package/dist/src/codegen/scaffoldFromSchema.d.ts +3 -3
- package/dist/src/codegen/scaffoldFromSchema.d.ts.map +1 -1
- package/dist/src/codegen/scaffoldFromSchema.js +54 -18
- package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
- package/dist/{codegen → src/codegen}/templates/command/commands.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/command/decide.specs.specs.ts +3 -3
- package/dist/{codegen → src/codegen}/templates/command/decide.specs.ts +1 -5
- package/dist/{codegen → src/codegen}/templates/command/events.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/command/evolve.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/command/handle.specs.ts +1 -3
- package/dist/src/codegen/templates/command/mutation.resolver.specs.ts +363 -0
- package/dist/src/codegen/templates/command/mutation.resolver.ts.ejs +99 -0
- package/dist/{codegen → src/codegen}/templates/command/register.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/command/state.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/query/projection.specs.specs..ts +3 -3
- package/dist/{codegen → src/codegen}/templates/query/projection.specs.ts +5 -9
- package/dist/{codegen → src/codegen}/templates/query/query.resolver.specs.ts +194 -23
- package/dist/src/codegen/templates/query/query.resolver.ts.ejs +137 -0
- package/dist/{codegen → src/codegen}/templates/query/state.specs.ts +1 -2
- package/dist/{codegen → src/codegen}/templates/react/react.specs.specs.ts +2 -2
- package/dist/{codegen → src/codegen}/templates/react/react.specs.ts +3 -3
- package/dist/{codegen → src/codegen}/templates/react/register.specs.ts +3 -3
- package/dist/src/codegen/test-data/specVariant1.d.ts +1 -1
- package/dist/src/codegen/test-data/specVariant1.d.ts.map +1 -1
- package/dist/src/codegen/test-data/specVariant1.js +4 -2
- package/dist/src/codegen/test-data/specVariant1.js.map +1 -1
- package/dist/src/commands/generate-server.d.ts.map +1 -1
- package/dist/src/commands/generate-server.js +34 -24
- package/dist/src/commands/generate-server.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/src/codegen/scaffoldFromSchema.ts +52 -20
- package/src/codegen/templates/command/commands.specs.ts +1 -2
- package/src/codegen/templates/command/decide.specs.specs.ts +3 -3
- package/src/codegen/templates/command/decide.specs.ts +1 -5
- package/src/codegen/templates/command/events.specs.ts +1 -2
- package/src/codegen/templates/command/evolve.specs.ts +1 -2
- package/src/codegen/templates/command/handle.specs.ts +1 -3
- package/src/codegen/templates/command/mutation.resolver.specs.ts +247 -8
- package/src/codegen/templates/command/mutation.resolver.ts.ejs +86 -12
- package/src/codegen/templates/command/register.specs.ts +1 -2
- package/src/codegen/templates/command/state.specs.ts +1 -2
- package/src/codegen/templates/query/projection.specs.specs..ts +3 -3
- package/src/codegen/templates/query/projection.specs.ts +5 -9
- package/src/codegen/templates/query/query.resolver.specs.ts +194 -23
- package/src/codegen/templates/query/query.resolver.ts.ejs +84 -45
- package/src/codegen/templates/query/state.specs.ts +1 -2
- package/src/codegen/templates/react/react.specs.specs.ts +2 -2
- package/src/codegen/templates/react/react.specs.ts +3 -3
- package/src/codegen/templates/react/register.specs.ts +3 -3
- package/src/codegen/test-data/specVariant1.ts +5 -3
- package/src/commands/generate-server.ts +38 -30
- package/tsconfig.test.json +9 -0
- package/.turbo/turbo-test.log +0 -14
- package/.turbo/turbo-type-check.log +0 -4
- package/dist/codegen/templates/command/mutation.resolver.specs.ts +0 -124
- package/dist/codegen/templates/command/mutation.resolver.ts.ejs +0 -25
- package/dist/codegen/templates/query/query.resolver.ts.ejs +0 -98
- package/dist/src/codegen/templates/command/commands.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/commands.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/commands.specs.js +0 -96
- package/dist/src/codegen/templates/command/commands.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/decide.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/decide.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/decide.specs.js +0 -567
- package/dist/src/codegen/templates/command/decide.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/decide.specs.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/decide.specs.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/decide.specs.specs.js +0 -278
- package/dist/src/codegen/templates/command/decide.specs.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/events.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/events.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/events.specs.js +0 -112
- package/dist/src/codegen/templates/command/events.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/evolve.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/evolve.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/evolve.specs.js +0 -108
- package/dist/src/codegen/templates/command/evolve.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/handle.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/handle.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/handle.specs.js +0 -326
- package/dist/src/codegen/templates/command/handle.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/mutation.resolver.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/mutation.resolver.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/mutation.resolver.specs.js +0 -121
- package/dist/src/codegen/templates/command/mutation.resolver.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/register.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/register.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/register.specs.js +0 -113
- package/dist/src/codegen/templates/command/register.specs.js.map +0 -1
- package/dist/src/codegen/templates/command/state.specs.d.ts +0 -2
- package/dist/src/codegen/templates/command/state.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/command/state.specs.js +0 -133
- package/dist/src/codegen/templates/command/state.specs.js.map +0 -1
- package/dist/src/codegen/templates/query/projection.specs.d.ts +0 -2
- package/dist/src/codegen/templates/query/projection.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/query/projection.specs.js +0 -363
- package/dist/src/codegen/templates/query/projection.specs.js.map +0 -1
- package/dist/src/codegen/templates/query/projection.specs.specs..d.ts +0 -2
- package/dist/src/codegen/templates/query/projection.specs.specs..d.ts.map +0 -1
- package/dist/src/codegen/templates/query/projection.specs.specs..js +0 -293
- package/dist/src/codegen/templates/query/projection.specs.specs..js.map +0 -1
- package/dist/src/codegen/templates/query/query.resolver.specs.d.ts +0 -2
- package/dist/src/codegen/templates/query/query.resolver.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/query/query.resolver.specs.js +0 -249
- package/dist/src/codegen/templates/query/query.resolver.specs.js.map +0 -1
- package/dist/src/codegen/templates/query/state.specs.d.ts +0 -2
- package/dist/src/codegen/templates/query/state.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/query/state.specs.js +0 -67
- package/dist/src/codegen/templates/query/state.specs.js.map +0 -1
- package/dist/src/codegen/templates/react/react.specs.d.ts +0 -2
- package/dist/src/codegen/templates/react/react.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/react/react.specs.js +0 -265
- package/dist/src/codegen/templates/react/react.specs.js.map +0 -1
- package/dist/src/codegen/templates/react/react.specs.specs.d.ts +0 -2
- package/dist/src/codegen/templates/react/react.specs.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/react/react.specs.specs.js +0 -229
- package/dist/src/codegen/templates/react/react.specs.specs.js.map +0 -1
- package/dist/src/codegen/templates/react/register.specs.d.ts +0 -2
- package/dist/src/codegen/templates/react/register.specs.d.ts.map +0 -1
- package/dist/src/codegen/templates/react/register.specs.js +0 -246
- package/dist/src/codegen/templates/react/register.specs.js.map +0 -1
- /package/dist/{codegen → src/codegen}/templates/command/commands.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/decide.specs.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/decide.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/events.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/evolve.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/handle.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/register.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/command/state.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/query/projection.specs.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/query/projection.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/query/state.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/react/react.specs.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/react/react.ts.ejs +0 -0
- /package/dist/{codegen → src/codegen}/templates/react/register.ts.ejs +0 -0
- /package/dist/{domain → src/domain}/shared/ReadModel.ts +0 -0
- /package/dist/{domain → src/domain}/shared/index.ts +0 -0
- /package/dist/{domain → src/domain}/shared/reactorSpecification.ts +0 -0
- /package/dist/{domain → src/domain}/shared/sendCommand.ts +0 -0
- /package/dist/{domain → src/domain}/shared/types.ts +0 -0
- /package/dist/{server.ts → src/server.ts} +0 -0
- /package/dist/{utils → src/utils}/index.ts +0 -0
- /package/dist/{utils → src/utils}/loadProjections.ts +0 -0
- /package/dist/{utils → src/utils}/loadRegisterFiles.ts +0 -0
- /package/dist/{utils → src/utils}/loadResolvers.ts +0 -0
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { generateScaffoldFilePlans } from '../../scaffoldFromSchema.js';
|
|
3
|
-
describe('decide.ts.ejs', () => {
|
|
4
|
-
it('should generate a valid decide file when both command and event exist', async () => {
|
|
5
|
-
const spec = {
|
|
6
|
-
variant: 'specs',
|
|
7
|
-
flows: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Host creates a listing',
|
|
10
|
-
slices: [
|
|
11
|
-
{
|
|
12
|
-
type: 'command',
|
|
13
|
-
name: 'Create listing',
|
|
14
|
-
client: {
|
|
15
|
-
description: 'test',
|
|
16
|
-
specs: [],
|
|
17
|
-
},
|
|
18
|
-
server: {
|
|
19
|
-
description: 'test',
|
|
20
|
-
specs: {
|
|
21
|
-
name: 'Create listing command',
|
|
22
|
-
rules: [
|
|
23
|
-
{
|
|
24
|
-
description: 'Should create listing with valid data',
|
|
25
|
-
examples: [
|
|
26
|
-
{
|
|
27
|
-
description: 'User creates listing successfully',
|
|
28
|
-
when: {
|
|
29
|
-
commandRef: 'CreateListing',
|
|
30
|
-
exampleData: {
|
|
31
|
-
propertyId: 'listing_123',
|
|
32
|
-
title: 'Some apartment',
|
|
33
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
34
|
-
rating: 4.8,
|
|
35
|
-
metadata: { foo: 'bar' },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
then: [
|
|
39
|
-
{
|
|
40
|
-
eventRef: 'ListingCreated',
|
|
41
|
-
exampleData: {
|
|
42
|
-
propertyId: 'listing_123',
|
|
43
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
44
|
-
rating: 4.8,
|
|
45
|
-
metadata: { foo: 'bar' },
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
messages: [
|
|
60
|
-
{
|
|
61
|
-
type: 'command',
|
|
62
|
-
name: 'CreateListing',
|
|
63
|
-
fields: [],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'event',
|
|
67
|
-
name: 'ListingCreated',
|
|
68
|
-
source: 'internal',
|
|
69
|
-
fields: [],
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
};
|
|
73
|
-
const plans = await generateScaffoldFilePlans(spec.flows, spec.messages, undefined, 'src/domain/flows');
|
|
74
|
-
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
75
|
-
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
76
|
-
"import { IllegalStateError } from '@event-driven-io/emmett';
|
|
77
|
-
import type { State } from './state.js';
|
|
78
|
-
import type { CreateListing } from './commands.js';
|
|
79
|
-
import type { ListingCreated } from './events.js';
|
|
80
|
-
|
|
81
|
-
export const decide = (command: CreateListing, state: State): ListingCreated => {
|
|
82
|
-
switch (command.type) {
|
|
83
|
-
case 'CreateListing': {
|
|
84
|
-
/**
|
|
85
|
-
* ## IMPLEMENTATION INSTRUCTIONS ##
|
|
86
|
-
*
|
|
87
|
-
* This command can directly emit one or more events based on the input.
|
|
88
|
-
*
|
|
89
|
-
* You should:
|
|
90
|
-
* - Validate the command input fields
|
|
91
|
-
* - Inspect the current domain \`state\` to determine if the command is allowed
|
|
92
|
-
* - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
|
|
93
|
-
* - If valid, return one or more events with the correct structure
|
|
94
|
-
*
|
|
95
|
-
* ⚠️ Only read from inputs — never mutate them. \`evolve.ts\` handles state updates.
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
// return {
|
|
99
|
-
// type: 'ListingCreated',
|
|
100
|
-
// data: { ...command.data },
|
|
101
|
-
// } as ListingCreated;
|
|
102
|
-
|
|
103
|
-
throw new IllegalStateError('Not yet implemented: ' + command.type);
|
|
104
|
-
}
|
|
105
|
-
default:
|
|
106
|
-
throw new IllegalStateError('Unexpected command type: ' + command.type);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
"
|
|
110
|
-
`);
|
|
111
|
-
});
|
|
112
|
-
it('should include implementation instructions when prior events are required', async () => {
|
|
113
|
-
const spec = {
|
|
114
|
-
variant: 'specs',
|
|
115
|
-
flows: [
|
|
116
|
-
{
|
|
117
|
-
name: 'Host removes a listing',
|
|
118
|
-
slices: [
|
|
119
|
-
{
|
|
120
|
-
type: 'command',
|
|
121
|
-
name: 'Remove listing',
|
|
122
|
-
client: {
|
|
123
|
-
description: 'test',
|
|
124
|
-
specs: [],
|
|
125
|
-
},
|
|
126
|
-
server: {
|
|
127
|
-
description: 'test',
|
|
128
|
-
specs: {
|
|
129
|
-
name: 'Remove listing command',
|
|
130
|
-
rules: [
|
|
131
|
-
{
|
|
132
|
-
description: 'Should remove existing listing',
|
|
133
|
-
examples: [
|
|
134
|
-
{
|
|
135
|
-
description: 'Existing listing can be removed',
|
|
136
|
-
given: [
|
|
137
|
-
{
|
|
138
|
-
eventRef: 'ListingCreated',
|
|
139
|
-
exampleData: {
|
|
140
|
-
propertyId: 'listing_123',
|
|
141
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
when: {
|
|
146
|
-
commandRef: 'RemoveListing',
|
|
147
|
-
exampleData: {
|
|
148
|
-
propertyId: 'listing_123',
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
then: [
|
|
152
|
-
{
|
|
153
|
-
eventRef: 'ListingRemoved',
|
|
154
|
-
exampleData: {
|
|
155
|
-
propertyId: 'listing_123',
|
|
156
|
-
removedAt: '2024-01-16T12:00:00Z',
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
],
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
],
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
messages: [
|
|
171
|
-
{
|
|
172
|
-
type: 'command',
|
|
173
|
-
name: 'RemoveListing',
|
|
174
|
-
fields: [{ name: 'propertyId', type: 'string', required: true }],
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
type: 'event',
|
|
178
|
-
name: 'ListingCreated',
|
|
179
|
-
source: 'internal',
|
|
180
|
-
fields: [
|
|
181
|
-
{ name: 'propertyId', type: 'string', required: true },
|
|
182
|
-
{ name: 'listedAt', type: 'Date', required: true },
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
type: 'event',
|
|
187
|
-
name: 'ListingRemoved',
|
|
188
|
-
source: 'internal',
|
|
189
|
-
fields: [
|
|
190
|
-
{ name: 'propertyId', type: 'string', required: true },
|
|
191
|
-
{ name: 'removedAt', type: 'Date', required: true },
|
|
192
|
-
],
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
};
|
|
196
|
-
const plans = await generateScaffoldFilePlans(spec.flows, spec.messages, undefined, 'src/domain/flows');
|
|
197
|
-
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
198
|
-
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
199
|
-
"import { IllegalStateError } from '@event-driven-io/emmett';
|
|
200
|
-
import type { State } from './state.js';
|
|
201
|
-
import type { RemoveListing } from './commands.js';
|
|
202
|
-
import type { ListingRemoved } from './events.js';
|
|
203
|
-
|
|
204
|
-
export const decide = (command: RemoveListing, state: State): ListingRemoved => {
|
|
205
|
-
switch (command.type) {
|
|
206
|
-
case 'RemoveListing': {
|
|
207
|
-
/**
|
|
208
|
-
* ## IMPLEMENTATION INSTRUCTIONS ##
|
|
209
|
-
*
|
|
210
|
-
* This command requires evaluating prior state to determine if it can proceed.
|
|
211
|
-
*
|
|
212
|
-
* You should:
|
|
213
|
-
* - Validate the command input fields
|
|
214
|
-
* - Inspect the current domain \`state\` to determine if the command is allowed
|
|
215
|
-
* - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
|
|
216
|
-
* - If valid, return one or more events with the correct structure
|
|
217
|
-
*
|
|
218
|
-
* ⚠️ Only read from inputs — never mutate them. \`evolve.ts\` handles state updates.
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
// return {
|
|
222
|
-
// type: 'ListingRemoved',
|
|
223
|
-
// data: { ...command.data },
|
|
224
|
-
// } as ListingRemoved;
|
|
225
|
-
|
|
226
|
-
throw new IllegalStateError('Not yet implemented: ' + command.type);
|
|
227
|
-
}
|
|
228
|
-
default:
|
|
229
|
-
throw new IllegalStateError('Unexpected command type: ' + command.type);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
"
|
|
233
|
-
`);
|
|
234
|
-
});
|
|
235
|
-
it('should generate a decide file that handles multiple GWTs including an error', async () => {
|
|
236
|
-
const spec = {
|
|
237
|
-
variant: 'specs',
|
|
238
|
-
flows: [
|
|
239
|
-
{
|
|
240
|
-
name: 'Host creates a listing',
|
|
241
|
-
slices: [
|
|
242
|
-
{
|
|
243
|
-
type: 'command',
|
|
244
|
-
name: 'Create listing',
|
|
245
|
-
client: {
|
|
246
|
-
description: 'test',
|
|
247
|
-
specs: [],
|
|
248
|
-
},
|
|
249
|
-
server: {
|
|
250
|
-
description: 'test',
|
|
251
|
-
specs: {
|
|
252
|
-
name: 'Create listing command',
|
|
253
|
-
rules: [
|
|
254
|
-
{
|
|
255
|
-
description: 'Should handle multiple scenarios including errors',
|
|
256
|
-
examples: [
|
|
257
|
-
{
|
|
258
|
-
description: 'User creates listing successfully',
|
|
259
|
-
when: {
|
|
260
|
-
commandRef: 'CreateListing',
|
|
261
|
-
exampleData: {
|
|
262
|
-
propertyId: 'listing_123',
|
|
263
|
-
title: 'Some Apartment',
|
|
264
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
265
|
-
rating: 4.8,
|
|
266
|
-
metadata: { foo: 'bar' },
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
then: [
|
|
270
|
-
{
|
|
271
|
-
eventRef: 'ListingCreated',
|
|
272
|
-
exampleData: {
|
|
273
|
-
propertyId: 'listing_123',
|
|
274
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
275
|
-
rating: 4.8,
|
|
276
|
-
metadata: { foo: 'bar' },
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
],
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
description: 'User creates listing with empty title should fail',
|
|
283
|
-
when: {
|
|
284
|
-
commandRef: 'CreateListing',
|
|
285
|
-
exampleData: {
|
|
286
|
-
propertyId: 'listing_123',
|
|
287
|
-
title: '',
|
|
288
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
289
|
-
rating: 4.8,
|
|
290
|
-
metadata: {},
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
then: [
|
|
294
|
-
{
|
|
295
|
-
errorType: 'ValidationError',
|
|
296
|
-
message: 'Title must not be empty',
|
|
297
|
-
},
|
|
298
|
-
],
|
|
299
|
-
},
|
|
300
|
-
],
|
|
301
|
-
},
|
|
302
|
-
],
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
messages: [
|
|
310
|
-
{
|
|
311
|
-
type: 'command',
|
|
312
|
-
name: 'CreateListing',
|
|
313
|
-
fields: [
|
|
314
|
-
{ name: 'propertyId', type: 'string', required: true },
|
|
315
|
-
{ name: 'title', type: 'string', required: true },
|
|
316
|
-
{ name: 'listedAt', type: 'Date', required: true },
|
|
317
|
-
{ name: 'rating', type: 'number', required: true },
|
|
318
|
-
{ name: 'metadata', type: 'object', required: true },
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
type: 'event',
|
|
323
|
-
name: 'ListingCreated',
|
|
324
|
-
source: 'internal',
|
|
325
|
-
fields: [
|
|
326
|
-
{ name: 'propertyId', type: 'string', required: true },
|
|
327
|
-
{ name: 'listedAt', type: 'Date', required: true },
|
|
328
|
-
{ name: 'rating', type: 'number', required: true },
|
|
329
|
-
{ name: 'metadata', type: 'object', required: true },
|
|
330
|
-
],
|
|
331
|
-
},
|
|
332
|
-
],
|
|
333
|
-
};
|
|
334
|
-
const plans = await generateScaffoldFilePlans(spec.flows, spec.messages, undefined, 'src/domain/flows');
|
|
335
|
-
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
336
|
-
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
337
|
-
"import { IllegalStateError, ValidationError } from '@event-driven-io/emmett';
|
|
338
|
-
import type { State } from './state.js';
|
|
339
|
-
import type { CreateListing } from './commands.js';
|
|
340
|
-
import type { ListingCreated } from './events.js';
|
|
341
|
-
|
|
342
|
-
export const decide = (command: CreateListing, state: State): ListingCreated => {
|
|
343
|
-
switch (command.type) {
|
|
344
|
-
case 'CreateListing': {
|
|
345
|
-
/**
|
|
346
|
-
* ## IMPLEMENTATION INSTRUCTIONS ##
|
|
347
|
-
*
|
|
348
|
-
* This command can directly emit one or more events based on the input.
|
|
349
|
-
*
|
|
350
|
-
* You should:
|
|
351
|
-
* - Validate the command input fields
|
|
352
|
-
* - Inspect the current domain \`state\` to determine if the command is allowed
|
|
353
|
-
* - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
|
|
354
|
-
* - If valid, return one or more events with the correct structure
|
|
355
|
-
*
|
|
356
|
-
* ⚠️ Only read from inputs — never mutate them. \`evolve.ts\` handles state updates.
|
|
357
|
-
*/
|
|
358
|
-
|
|
359
|
-
if (command.data.title === '') {
|
|
360
|
-
throw new ValidationError('Title must not be empty');
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// return {
|
|
364
|
-
// type: 'ListingCreated',
|
|
365
|
-
// data: { ...command.data },
|
|
366
|
-
// } as ListingCreated;
|
|
367
|
-
|
|
368
|
-
throw new IllegalStateError('Not yet implemented: ' + command.type);
|
|
369
|
-
}
|
|
370
|
-
default:
|
|
371
|
-
throw new IllegalStateError('Unexpected command type: ' + command.type);
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
"
|
|
375
|
-
`);
|
|
376
|
-
});
|
|
377
|
-
it('should include integration return type and usage in decide function', async () => {
|
|
378
|
-
const spec = {
|
|
379
|
-
variant: 'specs',
|
|
380
|
-
flows: [
|
|
381
|
-
{
|
|
382
|
-
name: 'Assistant suggests items',
|
|
383
|
-
slices: [
|
|
384
|
-
{
|
|
385
|
-
type: 'command',
|
|
386
|
-
name: 'Suggest Items',
|
|
387
|
-
stream: 'session-${sessionId}',
|
|
388
|
-
client: {
|
|
389
|
-
description: 'test',
|
|
390
|
-
specs: [],
|
|
391
|
-
},
|
|
392
|
-
server: {
|
|
393
|
-
description: '',
|
|
394
|
-
data: [
|
|
395
|
-
{
|
|
396
|
-
target: {
|
|
397
|
-
type: 'Command',
|
|
398
|
-
name: 'SuggestItems',
|
|
399
|
-
},
|
|
400
|
-
destination: {
|
|
401
|
-
type: 'integration',
|
|
402
|
-
systems: ['AI'],
|
|
403
|
-
message: {
|
|
404
|
-
name: 'DoChat',
|
|
405
|
-
type: 'command',
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
_additionalInstructions: 'Ensure systemPrompt includes product catalogue guidance',
|
|
409
|
-
_withState: {
|
|
410
|
-
target: {
|
|
411
|
-
type: 'State',
|
|
412
|
-
name: 'Products',
|
|
413
|
-
},
|
|
414
|
-
origin: {
|
|
415
|
-
type: 'integration',
|
|
416
|
-
systems: ['product-catalog'],
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
target: {
|
|
422
|
-
type: 'Event',
|
|
423
|
-
name: 'ItemsSuggested',
|
|
424
|
-
},
|
|
425
|
-
destination: {
|
|
426
|
-
type: 'stream',
|
|
427
|
-
pattern: 'session-${sessionId}',
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
],
|
|
431
|
-
specs: {
|
|
432
|
-
name: 'Suggest items command',
|
|
433
|
-
rules: [
|
|
434
|
-
{
|
|
435
|
-
description: 'Should suggest items successfully',
|
|
436
|
-
examples: [
|
|
437
|
-
{
|
|
438
|
-
description: 'User requests item suggestions',
|
|
439
|
-
when: {
|
|
440
|
-
commandRef: 'SuggestItems',
|
|
441
|
-
exampleData: {
|
|
442
|
-
sessionId: 'session-123',
|
|
443
|
-
prompt: 'What should I buy?',
|
|
444
|
-
},
|
|
445
|
-
},
|
|
446
|
-
then: [
|
|
447
|
-
{
|
|
448
|
-
eventRef: 'ItemsSuggested',
|
|
449
|
-
exampleData: {
|
|
450
|
-
sessionId: 'session-123',
|
|
451
|
-
items: [],
|
|
452
|
-
},
|
|
453
|
-
},
|
|
454
|
-
],
|
|
455
|
-
},
|
|
456
|
-
],
|
|
457
|
-
},
|
|
458
|
-
],
|
|
459
|
-
},
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
],
|
|
463
|
-
},
|
|
464
|
-
],
|
|
465
|
-
messages: [
|
|
466
|
-
{
|
|
467
|
-
type: 'command',
|
|
468
|
-
name: 'SuggestItems',
|
|
469
|
-
fields: [
|
|
470
|
-
{ name: 'sessionId', type: 'string', required: true },
|
|
471
|
-
{ name: 'prompt', type: 'string', required: true },
|
|
472
|
-
],
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
type: 'command',
|
|
476
|
-
name: 'DoChat',
|
|
477
|
-
fields: [
|
|
478
|
-
{ name: 'sessionId', type: 'string', required: true },
|
|
479
|
-
{ name: 'prompt', type: 'string', required: true },
|
|
480
|
-
{ name: 'systemPrompt', type: 'string', required: false },
|
|
481
|
-
],
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
type: 'event',
|
|
485
|
-
name: 'ItemsSuggested',
|
|
486
|
-
source: 'internal',
|
|
487
|
-
fields: [
|
|
488
|
-
{ name: 'sessionId', type: 'string', required: true },
|
|
489
|
-
{ name: 'items', type: 'Array<object>', required: true },
|
|
490
|
-
],
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
type: 'state',
|
|
494
|
-
name: 'Products',
|
|
495
|
-
fields: [
|
|
496
|
-
{
|
|
497
|
-
name: 'products',
|
|
498
|
-
type: 'Array<{ id: string, name: string }>',
|
|
499
|
-
required: true,
|
|
500
|
-
},
|
|
501
|
-
],
|
|
502
|
-
},
|
|
503
|
-
],
|
|
504
|
-
integrations: [
|
|
505
|
-
{
|
|
506
|
-
name: 'AI',
|
|
507
|
-
source: '@auto-engineer/ai-integration',
|
|
508
|
-
description: '',
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
name: 'product-catalog',
|
|
512
|
-
source: '@auto-engineer/product-catalogue-integration',
|
|
513
|
-
description: '',
|
|
514
|
-
},
|
|
515
|
-
],
|
|
516
|
-
};
|
|
517
|
-
const plans = await generateScaffoldFilePlans(spec.flows, spec.messages, spec.integrations);
|
|
518
|
-
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
519
|
-
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
520
|
-
"import { IllegalStateError } from '@event-driven-io/emmett';
|
|
521
|
-
import type { State } from './state.js';
|
|
522
|
-
import type { SuggestItems } from './commands.js';
|
|
523
|
-
import type { ItemsSuggested } from './events.js';
|
|
524
|
-
import type { Products } from '@auto-engineer/product-catalogue-integration';
|
|
525
|
-
|
|
526
|
-
export const decide = (command: SuggestItems, state: State, products?: Products): ItemsSuggested => {
|
|
527
|
-
switch (command.type) {
|
|
528
|
-
case 'SuggestItems': {
|
|
529
|
-
/**
|
|
530
|
-
* ## IMPLEMENTATION INSTRUCTIONS ##
|
|
531
|
-
*
|
|
532
|
-
* This command can directly emit one or more events based on the input.
|
|
533
|
-
*
|
|
534
|
-
* You should:
|
|
535
|
-
* - Validate the command input fields
|
|
536
|
-
* - Inspect the current domain \`state\` to determine if the command is allowed
|
|
537
|
-
* - Use \`products\` (integration result) to enrich or filter the output
|
|
538
|
-
* - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
|
|
539
|
-
* - If valid, return one or more events with the correct structure
|
|
540
|
-
*
|
|
541
|
-
* ⚠️ Only read from inputs — never mutate them. \`evolve.ts\` handles state updates.
|
|
542
|
-
*
|
|
543
|
-
* Integration result shape (Products):
|
|
544
|
-
* products?.data = {
|
|
545
|
-
* products: Array<{
|
|
546
|
-
* id: string;
|
|
547
|
-
* name: string };
|
|
548
|
-
* }>;
|
|
549
|
-
* }
|
|
550
|
-
*/
|
|
551
|
-
|
|
552
|
-
// return {
|
|
553
|
-
// type: 'ItemsSuggested',
|
|
554
|
-
// data: { ...command.data },
|
|
555
|
-
// } as ItemsSuggested;
|
|
556
|
-
|
|
557
|
-
throw new IllegalStateError('Not yet implemented: ' + command.type);
|
|
558
|
-
}
|
|
559
|
-
default:
|
|
560
|
-
throw new IllegalStateError('Unexpected command type: ' + command.type);
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
"
|
|
564
|
-
`);
|
|
565
|
-
});
|
|
566
|
-
});
|
|
567
|
-
//# sourceMappingURL=decide.specs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decide.specs.js","sourceRoot":"","sources":["../../../../../src/codegen/templates/command/decide.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,IAAI,GAAgB;YACxB,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,wBAAwB;oBAC9B,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,gBAAgB;4BACtB,MAAM,EAAE;gCACN,WAAW,EAAE,MAAM;gCACnB,KAAK,EAAE,EAAE;6BACV;4BACD,MAAM,EAAE;gCACN,WAAW,EAAE,M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Ae,EAAE,QAAQ,EAAE,IAAI,EAAE;qBACzD;iBACF;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,UAAU;4BAChB,IAAI,EAAE,qCAAqC;4BAC3C,QAAQ,EAAE,IAAI;yBACf;qBACF;iBACF;aACF;YACD,YAAY,EAAE;gBACZ;oBACE,IAAI,EAAE,IAAI;oBACV,MAAM,EAAE,+BAA+B;oBACvC,WAAW,EAAE,EAAE;iBAChB;gBACD;oBACE,IAAI,EAAE,iBAAiB;oBACvB,MAAM,EAAE,8CAA8C;oBACtD,WAAW,EAAE,EAAE;iBAChB;aACF;SACF,CAAC;QAEF,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5F,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QAEzE,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6ClD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decide.specs.specs.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/templates/command/decide.specs.specs.ts"],"names":[],"mappings":""}
|