@auto-engineer/server-generator-apollo-emmett 0.11.12 → 0.11.13

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/package.json CHANGED
@@ -31,8 +31,8 @@
31
31
  "graphql-type-json": "^0.3.2",
32
32
  "uuid": "^11.0.0",
33
33
  "web-streams-polyfill": "^4.1.0",
34
- "@auto-engineer/narrative": "0.11.12",
35
- "@auto-engineer/message-bus": "0.11.12"
34
+ "@auto-engineer/narrative": "0.11.13",
35
+ "@auto-engineer/message-bus": "0.11.13"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
@@ -43,9 +43,9 @@
43
43
  "typescript": "^5.8.3",
44
44
  "vitest": "^3.2.4",
45
45
  "tsx": "^4.19.2",
46
- "@auto-engineer/cli": "0.11.12"
46
+ "@auto-engineer/cli": "0.11.13"
47
47
  },
48
- "version": "0.11.12",
48
+ "version": "0.11.13",
49
49
  "scripts": {
50
50
  "generate:server": "tsx src/cli/index.ts",
51
51
  "build": "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",
@@ -23,7 +23,7 @@ function createCommandMessage(
23
23
  export function extractCommandsFromGwt(
24
24
  gwtSpecs: Array<{
25
25
  given?: Array<EventExample | unknown>;
26
- when: CommandExample | EventExample | unknown[];
26
+ when?: CommandExample | EventExample | unknown[];
27
27
  then: Array<EventExample | unknown | { errorType: string; message?: string }>;
28
28
  }>,
29
29
  allMessages: MessageDefinition[],
@@ -86,7 +86,7 @@ function processCommandExample(
86
86
  export function extractCommandsFromThen(
87
87
  gwtSpecs: Array<{
88
88
  given?: Array<EventExample | unknown>;
89
- when: CommandExample | EventExample | unknown[];
89
+ when?: CommandExample | EventExample | unknown[];
90
90
  then: Array<EventExample | unknown | { errorType: string; message?: string }>;
91
91
  }>,
92
92
  allMessages: MessageDefinition[],
@@ -1,5 +1,5 @@
1
1
  import { extractCommandsFromGwt, extractCommandsFromThen } from './commands';
2
- import { CommandExample, ErrorExample, EventExample, Slice, StateExample } from '@auto-engineer/narrative';
2
+ import { CommandExample, EventExample, Slice } from '@auto-engineer/narrative';
3
3
  import { Message, MessageDefinition } from '../types';
4
4
  import { extractEventsFromGiven, extractEventsFromThen, extractEventsFromWhen } from './events';
5
5
  import { extractFieldsFromMessage } from './fields';
@@ -22,21 +22,10 @@ export interface ExtractedMessages {
22
22
  }
23
23
 
24
24
  export interface ReactGwtSpec {
25
- when: EventExample[];
25
+ when?: EventExample[];
26
26
  then: CommandExample[];
27
27
  }
28
28
 
29
- export interface CommandGwtSpec {
30
- given?: EventExample[];
31
- when: CommandExample;
32
- then: Array<EventExample | ErrorExample>;
33
- }
34
-
35
- export interface QueryGwtSpec {
36
- given: EventExample[];
37
- then: StateExample[];
38
- }
39
-
40
29
  const EMPTY_EXTRACTED_MESSAGES: ExtractedMessages = {
41
30
  commands: [],
42
31
  events: [],
@@ -634,7 +634,15 @@ function findCommandSource(flows: Narrative[], commandType: string): { flowName:
634
634
  })),
635
635
  )
636
636
  : [];
637
- if (gwtSpecs.some((g) => !Array.isArray(g.when) && 'commandRef' in g.when && g.when.commandRef === commandType)) {
637
+ if (
638
+ gwtSpecs.some(
639
+ (g) =>
640
+ g.when !== undefined &&
641
+ !Array.isArray(g.when) &&
642
+ 'commandRef' in g.when &&
643
+ g.when.commandRef === commandType,
644
+ )
645
+ ) {
638
646
  debugSlice(' Found command source in flow: %s, slice: %s', flow.name, slice.name);
639
647
  return { flowName: flow.name, sliceName: slice.name };
640
648
  }