@auto-engineer/pipeline 0.19.0 → 0.20.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 (206) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +14 -0
  3. package/.turbo/turbo-type-check.log +4 -0
  4. package/CHANGELOG.md +8 -0
  5. package/coverage/base.css +224 -0
  6. package/coverage/block-navigation.js +87 -0
  7. package/coverage/builder/define.ts.html +2224 -0
  8. package/coverage/builder/index.html +116 -0
  9. package/coverage/config/index.html +116 -0
  10. package/coverage/config/pipeline-config.ts.html +181 -0
  11. package/coverage/core/descriptors.ts.html +397 -0
  12. package/coverage/core/index.html +131 -0
  13. package/coverage/core/types.ts.html +133 -0
  14. package/coverage/coverage-final.json +33 -0
  15. package/coverage/favicon.png +0 -0
  16. package/coverage/graph/filter-graph.ts.html +418 -0
  17. package/coverage/graph/index.html +131 -0
  18. package/coverage/graph/types.ts.html +172 -0
  19. package/coverage/index.html +266 -0
  20. package/coverage/logging/event-logger.ts.html +235 -0
  21. package/coverage/logging/index.html +116 -0
  22. package/coverage/plugins/handler-adapter.ts.html +148 -0
  23. package/coverage/plugins/index.html +131 -0
  24. package/coverage/plugins/plugin-loader.ts.html +691 -0
  25. package/coverage/prettify.css +1 -0
  26. package/coverage/prettify.js +2 -0
  27. package/coverage/projections/await-tracker-projection.ts.html +289 -0
  28. package/coverage/projections/index.html +221 -0
  29. package/coverage/projections/item-status-projection.ts.html +181 -0
  30. package/coverage/projections/latest-run-projection.ts.html +145 -0
  31. package/coverage/projections/message-log-projection.ts.html +424 -0
  32. package/coverage/projections/node-status-projection.ts.html +184 -0
  33. package/coverage/projections/phased-execution-projection.ts.html +523 -0
  34. package/coverage/projections/settled-instance-projection.ts.html +565 -0
  35. package/coverage/projections/stats-projection.ts.html +163 -0
  36. package/coverage/runtime/await-tracker.ts.html +271 -0
  37. package/coverage/runtime/context.ts.html +124 -0
  38. package/coverage/runtime/event-command-map.ts.html +220 -0
  39. package/coverage/runtime/index.html +191 -0
  40. package/coverage/runtime/phased-executor.ts.html +775 -0
  41. package/coverage/runtime/pipeline-runtime.ts.html +448 -0
  42. package/coverage/runtime/settled-tracker.ts.html +790 -0
  43. package/coverage/server/index.html +131 -0
  44. package/coverage/server/pipeline-server.ts.html +3253 -0
  45. package/coverage/server/sse-manager.ts.html +310 -0
  46. package/coverage/sort-arrow-sprite.png +0 -0
  47. package/coverage/sorter.js +210 -0
  48. package/coverage/store/index.html +146 -0
  49. package/coverage/store/pipeline-event-store.ts.html +553 -0
  50. package/coverage/store/pipeline-read-model.ts.html +754 -0
  51. package/coverage/store/sqlite-pipeline-event-store.ts.html +193 -0
  52. package/coverage/testing/event-capture.ts.html +280 -0
  53. package/coverage/testing/index.html +161 -0
  54. package/coverage/testing/mock-handlers.ts.html +259 -0
  55. package/coverage/testing/snapshot-compare.ts.html +403 -0
  56. package/coverage/testing/snapshot-sanitize.ts.html +136 -0
  57. package/dist/src/builder/define.specs.d.ts +2 -0
  58. package/dist/src/builder/define.specs.d.ts.map +1 -0
  59. package/dist/src/builder/define.specs.js +435 -0
  60. package/dist/src/builder/define.specs.js.map +1 -0
  61. package/dist/src/core/descriptors.specs.d.ts +2 -0
  62. package/dist/src/core/descriptors.specs.d.ts.map +1 -0
  63. package/dist/src/core/descriptors.specs.js +24 -0
  64. package/dist/src/core/descriptors.specs.js.map +1 -0
  65. package/dist/src/core/types.specs.d.ts +2 -0
  66. package/dist/src/core/types.specs.d.ts.map +1 -0
  67. package/dist/src/core/types.specs.js +40 -0
  68. package/dist/src/core/types.specs.js.map +1 -0
  69. package/dist/src/graph/filter-graph.specs.d.ts +2 -0
  70. package/dist/src/graph/filter-graph.specs.d.ts.map +1 -0
  71. package/dist/src/graph/filter-graph.specs.js +204 -0
  72. package/dist/src/graph/filter-graph.specs.js.map +1 -0
  73. package/dist/src/graph/types.specs.d.ts +2 -0
  74. package/dist/src/graph/types.specs.d.ts.map +1 -0
  75. package/dist/src/graph/types.specs.js +148 -0
  76. package/dist/src/graph/types.specs.js.map +1 -0
  77. package/dist/src/logging/event-logger.specs.d.ts +2 -0
  78. package/dist/src/logging/event-logger.specs.d.ts.map +1 -0
  79. package/dist/src/logging/event-logger.specs.js +81 -0
  80. package/dist/src/logging/event-logger.specs.js.map +1 -0
  81. package/dist/src/plugins/handler-adapter.specs.d.ts +2 -0
  82. package/dist/src/plugins/handler-adapter.specs.d.ts.map +1 -0
  83. package/dist/src/plugins/handler-adapter.specs.js +129 -0
  84. package/dist/src/plugins/handler-adapter.specs.js.map +1 -0
  85. package/dist/src/plugins/plugin-loader.specs.d.ts +2 -0
  86. package/dist/src/plugins/plugin-loader.specs.d.ts.map +1 -0
  87. package/dist/src/plugins/plugin-loader.specs.js +246 -0
  88. package/dist/src/plugins/plugin-loader.specs.js.map +1 -0
  89. package/dist/src/projections/item-status-projection.specs.d.ts +2 -0
  90. package/dist/src/projections/item-status-projection.specs.d.ts.map +1 -0
  91. package/dist/src/projections/item-status-projection.specs.js +119 -0
  92. package/dist/src/projections/item-status-projection.specs.js.map +1 -0
  93. package/dist/src/projections/latest-run-projection.specs.d.ts +2 -0
  94. package/dist/src/projections/latest-run-projection.specs.d.ts.map +1 -0
  95. package/dist/src/projections/latest-run-projection.specs.js +33 -0
  96. package/dist/src/projections/latest-run-projection.specs.js.map +1 -0
  97. package/dist/src/projections/message-log-projection.specs.d.ts +2 -0
  98. package/dist/src/projections/message-log-projection.specs.d.ts.map +1 -0
  99. package/dist/src/projections/message-log-projection.specs.js +101 -0
  100. package/dist/src/projections/message-log-projection.specs.js.map +1 -0
  101. package/dist/src/projections/node-status-projection.specs.d.ts +2 -0
  102. package/dist/src/projections/node-status-projection.specs.d.ts.map +1 -0
  103. package/dist/src/projections/node-status-projection.specs.js +116 -0
  104. package/dist/src/projections/node-status-projection.specs.js.map +1 -0
  105. package/dist/src/projections/phased-execution-projection.specs.d.ts +2 -0
  106. package/dist/src/projections/phased-execution-projection.specs.d.ts.map +1 -0
  107. package/dist/src/projections/phased-execution-projection.specs.js +171 -0
  108. package/dist/src/projections/phased-execution-projection.specs.js.map +1 -0
  109. package/dist/src/projections/settled-instance-projection.specs.d.ts +2 -0
  110. package/dist/src/projections/settled-instance-projection.specs.d.ts.map +1 -0
  111. package/dist/src/projections/settled-instance-projection.specs.js +217 -0
  112. package/dist/src/projections/settled-instance-projection.specs.js.map +1 -0
  113. package/dist/src/projections/stats-projection.specs.d.ts +2 -0
  114. package/dist/src/projections/stats-projection.specs.d.ts.map +1 -0
  115. package/dist/src/projections/stats-projection.specs.js +91 -0
  116. package/dist/src/projections/stats-projection.specs.js.map +1 -0
  117. package/dist/src/runtime/await-tracker.specs.d.ts +2 -0
  118. package/dist/src/runtime/await-tracker.specs.d.ts.map +1 -0
  119. package/dist/src/runtime/await-tracker.specs.js +64 -0
  120. package/dist/src/runtime/await-tracker.specs.js.map +1 -0
  121. package/dist/src/runtime/context.specs.d.ts +2 -0
  122. package/dist/src/runtime/context.specs.d.ts.map +1 -0
  123. package/dist/src/runtime/context.specs.js +26 -0
  124. package/dist/src/runtime/context.specs.js.map +1 -0
  125. package/dist/src/runtime/event-command-map.specs.d.ts +2 -0
  126. package/dist/src/runtime/event-command-map.specs.d.ts.map +1 -0
  127. package/dist/src/runtime/event-command-map.specs.js +108 -0
  128. package/dist/src/runtime/event-command-map.specs.js.map +1 -0
  129. package/dist/src/runtime/phased-executor.specs.d.ts +2 -0
  130. package/dist/src/runtime/phased-executor.specs.d.ts.map +1 -0
  131. package/dist/src/runtime/phased-executor.specs.js +418 -0
  132. package/dist/src/runtime/phased-executor.specs.js.map +1 -0
  133. package/dist/src/runtime/pipeline-runtime.specs.d.ts +2 -0
  134. package/dist/src/runtime/pipeline-runtime.specs.d.ts.map +1 -0
  135. package/dist/src/runtime/pipeline-runtime.specs.js +227 -0
  136. package/dist/src/runtime/pipeline-runtime.specs.js.map +1 -0
  137. package/dist/src/runtime/settled-tracker.specs.d.ts +2 -0
  138. package/dist/src/runtime/settled-tracker.specs.d.ts.map +1 -0
  139. package/dist/src/runtime/settled-tracker.specs.js +811 -0
  140. package/dist/src/runtime/settled-tracker.specs.js.map +1 -0
  141. package/dist/src/server/full-orchestration.e2e.specs.d.ts +2 -0
  142. package/dist/src/server/full-orchestration.e2e.specs.d.ts.map +1 -0
  143. package/dist/src/server/full-orchestration.e2e.specs.js +561 -0
  144. package/dist/src/server/full-orchestration.e2e.specs.js.map +1 -0
  145. package/dist/src/server/pipeline-server.e2e.specs.d.ts +2 -0
  146. package/dist/src/server/pipeline-server.e2e.specs.d.ts.map +1 -0
  147. package/dist/src/server/pipeline-server.e2e.specs.js +373 -0
  148. package/dist/src/server/pipeline-server.e2e.specs.js.map +1 -0
  149. package/dist/src/server/pipeline-server.specs.d.ts +2 -0
  150. package/dist/src/server/pipeline-server.specs.d.ts.map +1 -0
  151. package/dist/src/server/pipeline-server.specs.js +1407 -0
  152. package/dist/src/server/pipeline-server.specs.js.map +1 -0
  153. package/dist/src/server/sse-manager.specs.d.ts +2 -0
  154. package/dist/src/server/sse-manager.specs.d.ts.map +1 -0
  155. package/dist/src/server/sse-manager.specs.js +178 -0
  156. package/dist/src/server/sse-manager.specs.js.map +1 -0
  157. package/dist/src/store/pipeline-event-store.specs.d.ts +2 -0
  158. package/dist/src/store/pipeline-event-store.specs.d.ts.map +1 -0
  159. package/dist/src/store/pipeline-event-store.specs.js +287 -0
  160. package/dist/src/store/pipeline-event-store.specs.js.map +1 -0
  161. package/dist/src/store/pipeline-read-model.specs.d.ts +2 -0
  162. package/dist/src/store/pipeline-read-model.specs.d.ts.map +1 -0
  163. package/dist/src/store/pipeline-read-model.specs.js +830 -0
  164. package/dist/src/store/pipeline-read-model.specs.js.map +1 -0
  165. package/dist/src/testing/event-capture.specs.d.ts +2 -0
  166. package/dist/src/testing/event-capture.specs.d.ts.map +1 -0
  167. package/dist/src/testing/event-capture.specs.js +114 -0
  168. package/dist/src/testing/event-capture.specs.js.map +1 -0
  169. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts +2 -0
  170. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts.map +1 -0
  171. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js +263 -0
  172. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js.map +1 -0
  173. package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts +2 -0
  174. package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts.map +1 -0
  175. package/dist/src/testing/fixtures/kanban.pipeline.specs.js +29 -0
  176. package/dist/src/testing/fixtures/kanban.pipeline.specs.js.map +1 -0
  177. package/dist/src/testing/kanban-todo.e2e.specs.d.ts +2 -0
  178. package/dist/src/testing/kanban-todo.e2e.specs.d.ts.map +1 -0
  179. package/dist/src/testing/kanban-todo.e2e.specs.js +160 -0
  180. package/dist/src/testing/kanban-todo.e2e.specs.js.map +1 -0
  181. package/dist/src/testing/mock-handlers.specs.d.ts +2 -0
  182. package/dist/src/testing/mock-handlers.specs.d.ts.map +1 -0
  183. package/dist/src/testing/mock-handlers.specs.js +193 -0
  184. package/dist/src/testing/mock-handlers.specs.js.map +1 -0
  185. package/dist/src/testing/real-execution.e2e.specs.d.ts +2 -0
  186. package/dist/src/testing/real-execution.e2e.specs.d.ts.map +1 -0
  187. package/dist/src/testing/real-execution.e2e.specs.js +140 -0
  188. package/dist/src/testing/real-execution.e2e.specs.js.map +1 -0
  189. package/dist/src/testing/real-plugin.e2e.specs.d.ts +2 -0
  190. package/dist/src/testing/real-plugin.e2e.specs.d.ts.map +1 -0
  191. package/dist/src/testing/real-plugin.e2e.specs.js +65 -0
  192. package/dist/src/testing/real-plugin.e2e.specs.js.map +1 -0
  193. package/dist/src/testing/server-startup.e2e.specs.d.ts +2 -0
  194. package/dist/src/testing/server-startup.e2e.specs.d.ts.map +1 -0
  195. package/dist/src/testing/server-startup.e2e.specs.js +104 -0
  196. package/dist/src/testing/server-startup.e2e.specs.js.map +1 -0
  197. package/dist/src/testing/snapshot-compare.specs.d.ts +2 -0
  198. package/dist/src/testing/snapshot-compare.specs.d.ts.map +1 -0
  199. package/dist/src/testing/snapshot-compare.specs.js +112 -0
  200. package/dist/src/testing/snapshot-compare.specs.js.map +1 -0
  201. package/dist/src/testing/snapshot-sanitize.specs.d.ts +2 -0
  202. package/dist/src/testing/snapshot-sanitize.specs.d.ts.map +1 -0
  203. package/dist/src/testing/snapshot-sanitize.specs.js +104 -0
  204. package/dist/src/testing/snapshot-sanitize.specs.js.map +1 -0
  205. package/dist/tsconfig.tsbuildinfo +1 -1
  206. package/package.json +3 -3
@@ -0,0 +1,287 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { createPipelineEventStore } from './pipeline-event-store.js';
3
+ describe('PipelineEventStore', () => {
4
+ describe('appendToStream', () => {
5
+ it('should append events and update projections', async () => {
6
+ const { eventStore, database, close } = createPipelineEventStore();
7
+ try {
8
+ await eventStore.appendToStream('pipeline-c1', [
9
+ {
10
+ type: 'ItemStatusChanged',
11
+ data: {
12
+ correlationId: 'c1',
13
+ commandType: 'Cmd',
14
+ itemKey: 'a',
15
+ requestId: 'r1',
16
+ status: 'running',
17
+ attemptCount: 1,
18
+ },
19
+ },
20
+ ]);
21
+ const collection = database.collection('ItemStatus');
22
+ const items = await collection.find();
23
+ expect(items.length).toBe(1);
24
+ expect(items[0]?.status).toBe('running');
25
+ }
26
+ finally {
27
+ await close();
28
+ }
29
+ });
30
+ it('should project NodeStatusChanged events', async () => {
31
+ const { eventStore, database, close } = createPipelineEventStore();
32
+ try {
33
+ await eventStore.appendToStream('pipeline-c1', [
34
+ {
35
+ type: 'NodeStatusChanged',
36
+ data: {
37
+ correlationId: 'c1',
38
+ commandName: 'Cmd',
39
+ nodeId: 'node-1',
40
+ status: 'running',
41
+ previousStatus: 'idle',
42
+ pendingCount: 1,
43
+ endedCount: 0,
44
+ },
45
+ },
46
+ ]);
47
+ const collection = database.collection('NodeStatus');
48
+ const nodes = await collection.find();
49
+ expect(nodes.length).toBe(1);
50
+ expect(nodes[0]?.status).toBe('running');
51
+ }
52
+ finally {
53
+ await close();
54
+ }
55
+ });
56
+ it('should update existing projection documents', async () => {
57
+ const { eventStore, database, close } = createPipelineEventStore();
58
+ try {
59
+ await eventStore.appendToStream('pipeline-c1', [
60
+ {
61
+ type: 'ItemStatusChanged',
62
+ data: {
63
+ correlationId: 'c1',
64
+ commandType: 'Cmd',
65
+ itemKey: 'a',
66
+ requestId: 'r1',
67
+ status: 'running',
68
+ attemptCount: 1,
69
+ },
70
+ },
71
+ ]);
72
+ await eventStore.appendToStream('pipeline-c1', [
73
+ {
74
+ type: 'ItemStatusChanged',
75
+ data: {
76
+ correlationId: 'c1',
77
+ commandType: 'Cmd',
78
+ itemKey: 'a',
79
+ requestId: 'r1',
80
+ status: 'success',
81
+ attemptCount: 1,
82
+ },
83
+ },
84
+ ]);
85
+ const collection = database.collection('ItemStatus');
86
+ const items = await collection.find();
87
+ expect(items.length).toBe(1);
88
+ expect(items[0]?.status).toBe('success');
89
+ }
90
+ finally {
91
+ await close();
92
+ }
93
+ });
94
+ });
95
+ describe('readModel integration', () => {
96
+ it('should provide working read model queries', async () => {
97
+ const { eventStore, readModel, close } = createPipelineEventStore();
98
+ try {
99
+ await eventStore.appendToStream('pipeline-c1', [
100
+ {
101
+ type: 'ItemStatusChanged',
102
+ data: {
103
+ correlationId: 'c1',
104
+ commandType: 'Cmd',
105
+ itemKey: 'a',
106
+ requestId: 'r1',
107
+ status: 'running',
108
+ attemptCount: 1,
109
+ },
110
+ },
111
+ {
112
+ type: 'ItemStatusChanged',
113
+ data: {
114
+ correlationId: 'c1',
115
+ commandType: 'Cmd',
116
+ itemKey: 'b',
117
+ requestId: 'r2',
118
+ status: 'success',
119
+ attemptCount: 1,
120
+ },
121
+ },
122
+ ]);
123
+ const stats = await readModel.computeCommandStats('c1', 'Cmd');
124
+ expect(stats).toEqual({
125
+ pendingCount: 1,
126
+ endedCount: 1,
127
+ aggregateStatus: 'running',
128
+ });
129
+ }
130
+ finally {
131
+ await close();
132
+ }
133
+ });
134
+ it('should detect correlation via read model', async () => {
135
+ const { eventStore, readModel, close } = createPipelineEventStore();
136
+ try {
137
+ expect(await readModel.hasCorrelation('c1')).toBe(false);
138
+ await eventStore.appendToStream('pipeline-c1', [
139
+ {
140
+ type: 'NodeStatusChanged',
141
+ data: {
142
+ correlationId: 'c1',
143
+ commandName: 'Cmd',
144
+ nodeId: 'node-1',
145
+ status: 'running',
146
+ previousStatus: 'idle',
147
+ pendingCount: 1,
148
+ endedCount: 0,
149
+ },
150
+ },
151
+ ]);
152
+ expect(await readModel.hasCorrelation('c1')).toBe(true);
153
+ }
154
+ finally {
155
+ await close();
156
+ }
157
+ });
158
+ });
159
+ describe('settled instance projection', () => {
160
+ it('should project SettledInstanceCreated events', async () => {
161
+ const { eventStore, database, close } = createPipelineEventStore();
162
+ try {
163
+ await eventStore.appendToStream('settled-c1', [
164
+ {
165
+ type: 'SettledInstanceCreated',
166
+ data: {
167
+ templateId: 'template-CmdA,CmdB',
168
+ correlationId: 'c1',
169
+ commandTypes: ['CmdA', 'CmdB'],
170
+ },
171
+ },
172
+ ]);
173
+ const collection = database.collection('SettledInstance');
174
+ const instances = await collection.find();
175
+ expect(instances.length).toBe(1);
176
+ expect(instances[0]?.status).toBe('active');
177
+ expect(instances[0]?.commandTrackers).toHaveLength(2);
178
+ }
179
+ finally {
180
+ await close();
181
+ }
182
+ });
183
+ it('should update settled instance through lifecycle events', async () => {
184
+ const { eventStore, database, close } = createPipelineEventStore();
185
+ try {
186
+ await eventStore.appendToStream('settled-c1', [
187
+ {
188
+ type: 'SettledInstanceCreated',
189
+ data: {
190
+ templateId: 'template-CmdA',
191
+ correlationId: 'c1',
192
+ commandTypes: ['CmdA'],
193
+ },
194
+ },
195
+ {
196
+ type: 'SettledCommandStarted',
197
+ data: {
198
+ templateId: 'template-CmdA',
199
+ correlationId: 'c1',
200
+ commandType: 'CmdA',
201
+ },
202
+ },
203
+ ]);
204
+ const collection = database.collection('SettledInstance');
205
+ const instances = await collection.find();
206
+ expect(instances.length).toBe(1);
207
+ expect(instances[0]?.commandTrackers[0]?.hasStarted).toBe(true);
208
+ expect(instances[0]?.commandTrackers[0]?.hasCompleted).toBe(false);
209
+ }
210
+ finally {
211
+ await close();
212
+ }
213
+ });
214
+ });
215
+ describe('phased execution projection', () => {
216
+ it('should project PhasedExecutionStarted events', async () => {
217
+ const { eventStore, database, close } = createPipelineEventStore();
218
+ try {
219
+ await eventStore.appendToStream('phased-c1', [
220
+ {
221
+ type: 'PhasedExecutionStarted',
222
+ data: {
223
+ executionId: 'exec-1',
224
+ correlationId: 'c1',
225
+ handlerId: 'handler-1',
226
+ triggerEvent: { type: 'TestEvent', correlationId: 'c1', data: {} },
227
+ items: [{ key: 'a', phase: 'prepare', dispatched: false, completed: false }],
228
+ phases: ['prepare', 'execute'],
229
+ },
230
+ },
231
+ ]);
232
+ const collection = database.collection('PhasedExecution');
233
+ const executions = await collection.find();
234
+ expect(executions.length).toBe(1);
235
+ expect(executions[0]?.status).toBe('active');
236
+ expect(executions[0]?.items).toHaveLength(1);
237
+ }
238
+ finally {
239
+ await close();
240
+ }
241
+ });
242
+ it('should update phased execution through lifecycle events', async () => {
243
+ const { eventStore, database, close } = createPipelineEventStore();
244
+ try {
245
+ await eventStore.appendToStream('phased-c1', [
246
+ {
247
+ type: 'PhasedExecutionStarted',
248
+ data: {
249
+ executionId: 'exec-1',
250
+ correlationId: 'c1',
251
+ handlerId: 'handler-1',
252
+ triggerEvent: { type: 'TestEvent', correlationId: 'c1', data: {} },
253
+ items: [{ key: 'a', phase: 'prepare', dispatched: false, completed: false }],
254
+ phases: ['prepare'],
255
+ },
256
+ },
257
+ {
258
+ type: 'PhasedItemDispatched',
259
+ data: { executionId: 'exec-1', itemKey: 'a', phase: 'prepare' },
260
+ },
261
+ {
262
+ type: 'PhasedItemCompleted',
263
+ data: {
264
+ executionId: 'exec-1',
265
+ itemKey: 'a',
266
+ resultEvent: { type: 'ItemDone', correlationId: 'c1', data: {} },
267
+ },
268
+ },
269
+ {
270
+ type: 'PhasedExecutionCompleted',
271
+ data: { executionId: 'exec-1', success: true, results: ['a'] },
272
+ },
273
+ ]);
274
+ const collection = database.collection('PhasedExecution');
275
+ const executions = await collection.find();
276
+ expect(executions.length).toBe(1);
277
+ expect(executions[0]?.status).toBe('completed');
278
+ expect(executions[0]?.items[0]?.dispatched).toBe(true);
279
+ expect(executions[0]?.items[0]?.completed).toBe(true);
280
+ }
281
+ finally {
282
+ await close();
283
+ }
284
+ });
285
+ });
286
+ });
287
+ //# sourceMappingURL=pipeline-event-store.specs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-event-store.specs.js","sourceRoot":"","sources":["../../../src/store/pipeline-event-store.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAK9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;YAC3D,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,wBAAwB,EAAE,CAAC;YACnE,IAAI,CAAC;gBACH,MAAM,UAAU,CAAC,cAAc,CAAC,aAAa,EAAE;oBAC7C;wBACE,IAAI,EAAE,mBAAmB;wBACzB,IAAI,EAAE;4BACJ,aAAa,EAAE,IAAI;4BACnB,WAAW,EAAE,KAAK;4BAClB,OAAO,EAAE,GAAG;4BACZ,SAAS,EAAE,IAAI;4BACf,MAAM,EAAE,SAAS;4BACjB,YAAY,EAAE,CAAC;yBAChB;qBACF;iBACF,CAAC,CAAC;gBAEH,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAuC,YAAY,CAAC,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U,CAAC,IAAI,EAAE,CAAC;gBAE3C,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAChD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACvD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;oBAAS,CAAC;gBACT,MAAM,KAAK,EAAE,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pipeline-read-model.specs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-read-model.specs.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline-read-model.specs.ts"],"names":[],"mappings":""}