@auto-engineer/server-generator-apollo-emmett 1.86.0 → 1.88.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 (33) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +5 -5
  3. package/.turbo/turbo-type-check.log +1 -1
  4. package/CHANGELOG.md +40 -0
  5. package/dist/src/codegen/extract/messages.d.ts +1 -1
  6. package/dist/src/codegen/extract/messages.d.ts.map +1 -1
  7. package/dist/src/codegen/extract/projection.d.ts +1 -1
  8. package/dist/src/codegen/extract/projection.d.ts.map +1 -1
  9. package/dist/src/codegen/extract/projection.js +14 -1
  10. package/dist/src/codegen/extract/projection.js.map +1 -1
  11. package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
  12. package/dist/src/codegen/templates/command/decide.specs.specs.ts +306 -0
  13. package/dist/src/codegen/templates/command/decide.specs.ts +4 -4
  14. package/dist/src/codegen/templates/command/decide.specs.ts.ejs +27 -1
  15. package/dist/src/codegen/templates/command/decide.ts.ejs +1 -1
  16. package/dist/src/codegen/templates/query/projection.specs.specs.ts +174 -1
  17. package/dist/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
  18. package/dist/src/commands/generate-server.d.ts +7 -1
  19. package/dist/src/commands/generate-server.d.ts.map +1 -1
  20. package/dist/src/index.d.ts +7 -1
  21. package/dist/src/index.d.ts.map +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/ketchup-plan.md +5 -1
  24. package/package.json +4 -4
  25. package/src/codegen/extract/messages.ts +1 -1
  26. package/src/codegen/extract/projection.ts +13 -3
  27. package/src/codegen/scaffoldFromSchema.ts +1 -1
  28. package/src/codegen/templates/command/decide.specs.specs.ts +306 -0
  29. package/src/codegen/templates/command/decide.specs.ts +4 -4
  30. package/src/codegen/templates/command/decide.specs.ts.ejs +27 -1
  31. package/src/codegen/templates/command/decide.ts.ejs +1 -1
  32. package/src/codegen/templates/query/projection.specs.specs.ts +174 -1
  33. package/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
@@ -96,7 +96,7 @@ describe('decide.ts.ejs', () => {
96
96
  *
97
97
  * You should:
98
98
  * - Validate the command input fields
99
- * - Inspect the current domain \`state\` to determine if the command is allowed
99
+ * - Inspect the current domain \`_state\` to determine if the command is allowed
100
100
  * - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
101
101
  * ⚠️ Error constructors: NotFoundError takes { id, type, message? }, while IllegalStateError/ValidationError take string
102
102
  * - If valid, return one or more events with the correct structure
@@ -229,7 +229,7 @@ describe('decide.ts.ejs', () => {
229
229
  *
230
230
  * You should:
231
231
  * - Validate the command input fields
232
- * - Inspect the current domain \`state\` to determine if the command is allowed
232
+ * - Inspect the current domain \`_state\` to determine if the command is allowed
233
233
  * - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
234
234
  * ⚠️ Error constructors: NotFoundError takes { id, type, message? }, while IllegalStateError/ValidationError take string
235
235
  * - If valid, return one or more events with the correct structure
@@ -382,7 +382,7 @@ describe('decide.ts.ejs', () => {
382
382
  *
383
383
  * You should:
384
384
  * - Validate the command input fields
385
- * - Inspect the current domain \`state\` to determine if the command is allowed
385
+ * - Inspect the current domain \`_state\` to determine if the command is allowed
386
386
  * - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
387
387
  * ⚠️ Error constructors: NotFoundError takes { id, type, message? }, while IllegalStateError/ValidationError take string
388
388
  * - If valid, return one or more events with the correct structure
@@ -579,7 +579,7 @@ describe('decide.ts.ejs', () => {
579
579
  *
580
580
  * You should:
581
581
  * - Validate the command input fields
582
- * - Inspect the current domain \`state\` to determine if the command is allowed
582
+ * - Inspect the current domain \`_state\` to determine if the command is allowed
583
583
  * - Use \`products\` (integration result) to enrich or filter the output
584
584
  * - If invalid, throw one of the following domain errors: \`NotFoundError\`, \`ValidationError\`, or \`IllegalStateError\`
585
585
  * ⚠️ Error constructors: NotFoundError takes { id, type, message? }, while IllegalStateError/ValidationError take string
@@ -53,6 +53,31 @@ for (const [importPath, eventTypes] of testEventsByPath.entries()) {
53
53
  }
54
54
 
55
55
  const uniqueEventTypes = Array.from(new Set(allEvents.map(e => e?.type).filter(Boolean))).sort();
56
+
57
+ function findDerivedDateValue(eventResults, commandSchema, givenEvents) {
58
+ const commandFields = new Set(commandSchema?.fields?.map(f => f.name) || []);
59
+ const givenValues = new Set();
60
+ for (const g of givenEvents || []) {
61
+ for (const val of Object.values(g.exampleData || {})) {
62
+ if (typeof val === 'string') givenValues.add(val);
63
+ }
64
+ }
65
+ const candidates = new Set();
66
+ for (const e of eventResults) {
67
+ const data = e.exampleData || {};
68
+ for (const [key, val] of Object.entries(data)) {
69
+ if (
70
+ !commandFields.has(key) &&
71
+ typeof val === 'string' &&
72
+ /^\d{4}-\d{2}-\d{2}$/.test(val) &&
73
+ !givenValues.has(val)
74
+ ) {
75
+ candidates.add(val);
76
+ }
77
+ }
78
+ }
79
+ return candidates.size === 1 ? [...candidates][0] : null;
80
+ }
56
81
  _%>
57
82
  import { describe, it } from 'vitest';
58
83
  import { DeciderSpecification } from '@event-driven-io/emmett';
@@ -97,7 +122,8 @@ describe('<%= ruleDescription %>', () => {
97
122
  .when({
98
123
  type: '<%= example.commandRef %>',
99
124
  data: <%- formatDataObject(example.exampleData, schema) %>,
100
- metadata: { now: new Date() },
125
+ <% const derivedDate = findDerivedDateValue(eventResults, schema, gwt.given); -%>
126
+ metadata: { now: <%= derivedDate ? `new Date('${derivedDate}')` : 'new Date()' %> },
101
127
  })
102
128
  <% if (errorResult) { %>
103
129
  .thenThrows((err) => err instanceof <%= errorResult.errorType %> && err.message === '<%= errorResult.message || '' %>');
@@ -60,7 +60,7 @@ case '<%= command %>': {
60
60
  *
61
61
  * You should:
62
62
  * - Validate the command input fields
63
- * - Inspect the current domain `state` to determine if the command is allowed
63
+ * - Inspect the current domain `_state` to determine if the command is allowed
64
64
  <% if (integrationReturnType) { -%>
65
65
  * - Use `<%= camelCase(integrationReturnType) %>` (integration result) to enrich or filter the output
66
66
  <% } -%>
@@ -1022,7 +1022,7 @@ describe('projection.specs.ts.ejs', () => {
1022
1022
  .then(async (state) => {
1023
1023
  const document = await state.database
1024
1024
  .collection<UserProject>('UserProjectsProjection')
1025
- .findOne((doc) => doc.id === 'test-id');
1025
+ .findOne((doc) => doc.userId === 'user_123' && doc.projectId === 'proj_456');
1026
1026
 
1027
1027
  const expected: UserProject = {
1028
1028
  userId: 'user_123',
@@ -2093,4 +2093,177 @@ describe('projection.specs.ts.ejs', () => {
2093
2093
  expect(specFile?.contents).toContain("service: 'haircut'");
2094
2094
  expect(specFile?.contents).not.toContain('"[{\\"appointmentId\\"');
2095
2095
  });
2096
+
2097
+ it('should resolve idField value from Given/When events when not in Then state data', async () => {
2098
+ const spec: SpecsSchema = {
2099
+ variant: 'specs',
2100
+ narratives: [
2101
+ {
2102
+ name: 'fitness-flow',
2103
+ slices: [
2104
+ {
2105
+ type: 'command',
2106
+ name: 'log-workout',
2107
+ stream: 'workouts-${memberId}',
2108
+ client: { specs: [] },
2109
+ server: {
2110
+ description: '',
2111
+ specs: [
2112
+ {
2113
+ type: 'gherkin',
2114
+ feature: 'Log workout',
2115
+ rules: [
2116
+ {
2117
+ name: 'Should log',
2118
+ examples: [
2119
+ {
2120
+ name: 'Logs workout',
2121
+ steps: [
2122
+ {
2123
+ keyword: 'When',
2124
+ text: 'LogWorkout',
2125
+ docString: { memberId: 'mem_001', caloriesBurned: 250 },
2126
+ },
2127
+ {
2128
+ keyword: 'Then',
2129
+ text: 'WorkoutRecorded',
2130
+ docString: { memberId: 'mem_001', caloriesBurned: 250 },
2131
+ },
2132
+ ],
2133
+ },
2134
+ ],
2135
+ },
2136
+ ],
2137
+ },
2138
+ ],
2139
+ },
2140
+ },
2141
+ {
2142
+ type: 'query',
2143
+ name: 'view-workout-summary',
2144
+ stream: 'workouts',
2145
+ client: { specs: [] },
2146
+ server: {
2147
+ description: '',
2148
+ data: {
2149
+ items: [
2150
+ {
2151
+ target: { type: 'State', name: 'WorkoutSummary' },
2152
+ origin: { type: 'projection', name: 'WorkoutSummaryProjection', idField: 'memberId' },
2153
+ },
2154
+ ],
2155
+ },
2156
+ specs: [
2157
+ {
2158
+ type: 'gherkin',
2159
+ feature: 'View workout summary',
2160
+ rules: [
2161
+ {
2162
+ name: 'Should summarize workouts',
2163
+ examples: [
2164
+ {
2165
+ name: 'Summary after workout recorded',
2166
+ steps: [
2167
+ {
2168
+ keyword: 'When',
2169
+ text: 'WorkoutRecorded',
2170
+ docString: { memberId: 'mem_001', caloriesBurned: 250 },
2171
+ },
2172
+ {
2173
+ keyword: 'Then',
2174
+ text: 'WorkoutSummary',
2175
+ docString: { totalCalories: 250, totalSessions: 1 },
2176
+ },
2177
+ ],
2178
+ },
2179
+ ],
2180
+ },
2181
+ ],
2182
+ },
2183
+ ],
2184
+ },
2185
+ },
2186
+ ],
2187
+ },
2188
+ ],
2189
+ messages: [
2190
+ {
2191
+ type: 'command',
2192
+ name: 'LogWorkout',
2193
+ fields: [
2194
+ { name: 'memberId', type: 'string', required: true },
2195
+ { name: 'caloriesBurned', type: 'number', required: true },
2196
+ ],
2197
+ },
2198
+ {
2199
+ type: 'event',
2200
+ name: 'WorkoutRecorded',
2201
+ source: 'internal',
2202
+ fields: [
2203
+ { name: 'memberId', type: 'string', required: true },
2204
+ { name: 'caloriesBurned', type: 'number', required: true },
2205
+ ],
2206
+ },
2207
+ {
2208
+ type: 'state',
2209
+ name: 'WorkoutSummary',
2210
+ fields: [
2211
+ { name: 'totalCalories', type: 'number', required: true },
2212
+ { name: 'totalSessions', type: 'number', required: true },
2213
+ ],
2214
+ },
2215
+ ],
2216
+ } as SpecsSchema;
2217
+
2218
+ const { plans } = await generateScaffoldFilePlans(spec.narratives, spec.messages, undefined, 'src/domain/flows');
2219
+ const specFile = plans.find((p) => p.outputPath.endsWith('view-workout-summary/projection.specs.ts'));
2220
+
2221
+ expect(specFile?.contents).toMatchInlineSnapshot(`
2222
+ "import { describe, it, beforeEach, expect } from 'vitest';
2223
+ import { InMemoryProjectionSpec } from '@event-driven-io/emmett';
2224
+ import { projection } from './projection';
2225
+ import type { WorkoutRecorded } from '../log-workout/events';
2226
+ import { WorkoutSummary } from './state';
2227
+
2228
+ type ProjectionEvent = WorkoutRecorded;
2229
+
2230
+ describe('Should summarize workouts', () => {
2231
+ let given: InMemoryProjectionSpec<ProjectionEvent>;
2232
+
2233
+ beforeEach(() => {
2234
+ given = InMemoryProjectionSpec.for({ projection });
2235
+ });
2236
+
2237
+ it('Summary after workout recorded', () =>
2238
+ given([])
2239
+ .when([
2240
+ {
2241
+ type: 'WorkoutRecorded',
2242
+ data: {
2243
+ memberId: 'mem_001',
2244
+ caloriesBurned: 250,
2245
+ },
2246
+ metadata: {
2247
+ streamName: 'workouts',
2248
+ streamPosition: 1n,
2249
+ globalPosition: 1n,
2250
+ },
2251
+ },
2252
+ ])
2253
+ .then(async (state) => {
2254
+ const document = await state.database
2255
+ .collection<WorkoutSummary>('WorkoutSummaryProjection')
2256
+ .findOne((doc) => doc.memberId === 'mem_001');
2257
+
2258
+ const expected: WorkoutSummary = {
2259
+ totalCalories: 250,
2260
+ totalSessions: 1,
2261
+ };
2262
+
2263
+ expect(document).toMatchObject(expected);
2264
+ }));
2265
+ });
2266
+ "
2267
+ `);
2268
+ });
2096
2269
  });
@@ -2,7 +2,9 @@
2
2
  const targetName = slice?.server?.data?.items?.[0]?.target?.name || 'UnknownState';
3
3
  const TargetType = pascalCase(targetName);
4
4
  const projName = projectionName || "UnknownProjection";
5
- const idField = projectionIdField ?? 'id';
5
+ const isCompositeKey = Array.isArray(projectionIdField);
6
+ const compositeKeyFields = isCompositeKey ? projectionIdField : [];
7
+ const idField = typeof projectionIdField === 'string' ? projectionIdField : 'id';
6
8
  const uniqueEventTypes = allEventTypesArray;
7
9
 
8
10
  // Extract query name from the slice's request field for query action detection
@@ -70,6 +72,29 @@ function formatSpecValue(value, tsType) {
70
72
  return `'${value}'`;
71
73
  }
72
74
 
75
+ function findIdFieldValue(fieldName, expectedState, allTestEvents, isQueryActionTest, testCase) {
76
+ let value = expectedState.exampleData?.[fieldName];
77
+ if (value === undefined) {
78
+ for (const evt of allTestEvents) {
79
+ if (evt.exampleData?.[fieldName] !== undefined) {
80
+ value = evt.exampleData[fieldName];
81
+ break;
82
+ }
83
+ }
84
+ }
85
+ if (value === undefined && isQueryActionTest && testCase.when?.args) {
86
+ value = testCase.when.args[fieldName];
87
+ }
88
+ return value;
89
+ }
90
+
91
+ function formatIdLookupValue(value) {
92
+ if (value === undefined || value === null) return null;
93
+ if (typeof value === 'object') return null;
94
+ const inferredType = typeof value === 'number' ? 'number' : typeof value === 'boolean' ? 'boolean' : 'string';
95
+ return formatSpecValue(value, inferredType);
96
+ }
97
+
73
98
  const queryName = extractQueryName(slice?.request);
74
99
  const ruleGroups = new Map();
75
100
 
@@ -228,20 +253,21 @@ _%>
228
253
  .findOne(<% if (projectionSingleton) { %>);<%
229
254
  } else {
230
255
  %>(doc) => <%
231
- const idField = projectionIdField ?? 'id';
232
- if (idField.includes('-')) {
233
- // Handle composite keys
234
- const parts = idField.split('-');
235
- const conditions = parts.map(part => {
236
- const value = expectedState.exampleData?.[part];
237
- const valueStr = typeof value === 'string' ? `'${value}'` : value || "'test-value'";
238
- return `doc.${part} === ${valueStr}`;
256
+ if (isCompositeKey) {
257
+ const conditions = compositeKeyFields.map(part => {
258
+ const value = findIdFieldValue(part, expectedState, allTestEvents, isQueryActionTest, testCase);
259
+ const formatted = formatIdLookupValue(value);
260
+ return `doc.${part} === ${formatted ?? "'test-id'"}`;
239
261
  }).join(' && ');
240
262
  %><%= conditions %><%
241
263
  } else {
242
- const value = expectedState.exampleData?.[idField];
243
- const valueStr = typeof value === 'string' ? `'${value}'` : value || "'test-id'";
244
- %>doc.<%= idField %> === <%= valueStr %><%
264
+ const value = findIdFieldValue(idField, expectedState, allTestEvents, isQueryActionTest, testCase);
265
+ const formatted = formatIdLookupValue(value);
266
+ if (formatted !== null) {
267
+ %>doc.<%= idField %> === <%= formatted %><%
268
+ } else {
269
+ %>doc.<%= idField %> === 'test-id'<%
270
+ }
245
271
  }
246
272
  %>);<%
247
273
  }
@@ -56,7 +56,13 @@ export type SliceGenerationFailedEvent = Event<'SliceGenerationFailed', {
56
56
  model: Model;
57
57
  }>;
58
58
  export type GenerateServerEvents = ServerGeneratedEvent | ServerGenerationFailedEvent | SliceGeneratedEvent | SliceGenerationFailedEvent;
59
- export declare const commandHandler: import("@auto-engineer/message-bus").CommandHandler;
59
+ export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
60
+ type: string;
61
+ data: Readonly<Record<string, unknown>>;
62
+ timestamp?: Date;
63
+ requestId?: string;
64
+ correlationId?: string;
65
+ }>>;
60
66
  export declare function deriveModelPath(destination: string): string;
61
67
  export declare function writeModelToDisk(model: Model, destination: string): Promise<void>;
62
68
  export declare function cleanServerDir(serverDir: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"generate-server.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAIxE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAGhB,MAAM,+BAA+B,CAAC;AAWvC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,S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AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB/D;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWnE;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C/F;AAqBD,eAAe,cAAc,CAAC"}
@@ -1,4 +1,10 @@
1
- export declare const COMMANDS: import("@auto-engineer/message-bus").CommandHandler[];
1
+ export declare const COMMANDS: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
2
+ type: string;
3
+ data: Readonly<Record<string, unknown>>;
4
+ timestamp?: Date;
5
+ requestId?: string;
6
+ correlationId?: string;
7
+ }>>[];
2
8
  export type { GenerateServerCommand, GenerateServerEvents, ServerGeneratedEvent, ServerGenerationFailedEvent, SliceGeneratedEvent, } from './commands/generate-server';
3
9
  export type { InitializeServerCommand, ServerInitializationFailedEvent, ServerInitializedEvent, } from './commands/initialize-server';
4
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,uDAAmD,CAAC;AACzE,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;KAAmD,CAAC;AACzE,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,8BAA8B,CAAC"}