@auto-engineer/server-generator-apollo-emmett 1.71.0 → 1.73.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/package.json CHANGED
@@ -32,8 +32,8 @@
32
32
  "uuid": "^11.0.0",
33
33
  "web-streams-polyfill": "^4.1.0",
34
34
  "zod": "^3.22.4",
35
- "@auto-engineer/message-bus": "1.71.0",
36
- "@auto-engineer/narrative": "1.71.0"
35
+ "@auto-engineer/narrative": "1.73.0",
36
+ "@auto-engineer/message-bus": "1.73.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
@@ -44,9 +44,9 @@
44
44
  "typescript": "^5.8.3",
45
45
  "vitest": "^3.2.4",
46
46
  "tsx": "^4.19.2",
47
- "@auto-engineer/cli": "1.71.0"
47
+ "@auto-engineer/cli": "1.73.0"
48
48
  },
49
- "version": "1.71.0",
49
+ "version": "1.73.0",
50
50
  "scripts": {
51
51
  "generate:server": "tsx src/cli/index.ts",
52
52
  "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",
@@ -100,17 +100,24 @@ function reactorSpecificationFor<Event, Command, Context extends { commandSender
100
100
  // Get the actual reactor instance
101
101
  const reactor = typeof processorOrReactor === 'function' ? processorOrReactor() : processorOrReactor;
102
102
 
103
- // Handle different reactor types
104
- if ('handle' in reactor && typeof reactor.handle === 'function') {
105
- // It's a MessageProcessor or has a handle method
106
- await reactor.handle(eventsWithMetadata, contextWithMock);
107
- } else if ('eachMessage' in reactor && typeof reactor.eachMessage === 'function') {
108
- // It has eachMessage
109
- for (const event of eventsWithMetadata) {
110
- await reactor.eachMessage(event, contextWithMock);
103
+ try {
104
+ if ('start' in reactor && typeof reactor.start === 'function') {
105
+ await reactor.start({});
106
+ }
107
+
108
+ if ('handle' in reactor && typeof reactor.handle === 'function') {
109
+ await reactor.handle(eventsWithMetadata, contextWithMock);
110
+ } else if ('eachMessage' in reactor && typeof reactor.eachMessage === 'function') {
111
+ for (const event of eventsWithMetadata) {
112
+ await reactor.eachMessage(event, contextWithMock);
113
+ }
114
+ } else {
115
+ throw new Error('Reactor must have either a handle or eachMessage method');
116
+ }
117
+ } finally {
118
+ if ('close' in reactor && typeof reactor.close === 'function') {
119
+ await reactor.close({});
111
120
  }
112
- } else {
113
- throw new Error('Reactor must have either a handle or eachMessage method');
114
121
  }
115
122
 
116
123
  return mockCommandSender.sentCommands;