@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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +3 -3
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +67 -0
- package/dist/src/domain/shared/reactorSpecification.d.ts.map +1 -1
- package/dist/src/domain/shared/reactorSpecification.js +18 -11
- package/dist/src/domain/shared/reactorSpecification.js.map +1 -1
- package/dist/src/domain/shared/reactorSpecification.ts +17 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/domain/shared/reactorSpecification.ts +17 -10
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/
|
|
36
|
-
"@auto-engineer/
|
|
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.
|
|
47
|
+
"@auto-engineer/cli": "1.73.0"
|
|
48
48
|
},
|
|
49
|
-
"version": "1.
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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;
|