@codemation/eventbus-redis 0.0.33 → 0.0.34

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @codemation/eventbus-redis
2
2
 
3
+ ## 0.0.34
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`4902978`](https://github.com/MadeRelevant/codemation/commit/49029782243ece59ab6aa5bb46396db445cad47c), [`6566d55`](https://github.com/MadeRelevant/codemation/commit/6566d55c829f6631357ac95052b0852e86092ac5), [`a77505f`](https://github.com/MadeRelevant/codemation/commit/a77505f331d7d3892f3c1c8f19dc37952b4d96bd), [`11616ae`](https://github.com/MadeRelevant/codemation/commit/11616aefb91d4b96b7eb9af4b935eec055a8a7bb), [`2c0723f`](https://github.com/MadeRelevant/codemation/commit/2c0723fb1670e842c272939b5db73d4b95b25535), [`fb9f7fe`](https://github.com/MadeRelevant/codemation/commit/fb9f7fed9bf5a3d6b0c5f78a30027be3ab7bcaca), [`2c0723f`](https://github.com/MadeRelevant/codemation/commit/2c0723fb1670e842c272939b5db73d4b95b25535), [`6fc7d3f`](https://github.com/MadeRelevant/codemation/commit/6fc7d3fe95f8d88386c16971fffa8dd3faa7704f), [`781c146`](https://github.com/MadeRelevant/codemation/commit/781c146eb9d8bb8bdbc1963ea2a4b9abe4b7bfbf), [`11616ae`](https://github.com/MadeRelevant/codemation/commit/11616aefb91d4b96b7eb9af4b935eec055a8a7bb), [`11616ae`](https://github.com/MadeRelevant/codemation/commit/11616aefb91d4b96b7eb9af4b935eec055a8a7bb)]:
8
+ - @codemation/core@2.0.0
9
+
3
10
  ## 0.0.33
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,6 +1,36 @@
1
1
  import IORedis from "ioredis";
2
2
 
3
+ //#region ../core/src/contracts/baseTypes.d.ts
4
+
5
+ /**
6
+ * Minimal base types that have no dependencies on other contracts.
7
+ * Used by credentialTypes, workflowTypes, and other contract layers
8
+ * to avoid circular dependencies.
9
+ */
10
+ type WorkflowId = string;
11
+ type NodeId = string;
12
+ type OutputPortKey = string;
13
+ type InputPortKey = string;
14
+ type PersistedTokenId = string;
15
+ type NodeConnectionName = string;
16
+ //#endregion
3
17
  //#region ../core/src/contracts/runTypes.d.ts
18
+ /**
19
+ * Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
20
+ * as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
21
+ * off the presence of this field. Subworkflow runs inherit it from their parent run.
22
+ */
23
+ interface RunTestContext {
24
+ readonly testSuiteRunId: string;
25
+ readonly testCaseIndex: number;
26
+ /**
27
+ * Optional human-friendly label for this test case (e.g. an email subject when fixtures
28
+ * are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
29
+ * persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
30
+ * instead of "run_1777755971399_bbb86beac1396".
31
+ */
32
+ readonly testCaseLabel?: string;
33
+ }
4
34
  interface RunExecutionOptions {
5
35
  /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
6
36
  localOnly?: boolean;
@@ -17,6 +47,8 @@ interface RunExecutionOptions {
17
47
  maxNodeActivations?: number;
18
48
  /** Effective cap after engine policy merge (subworkflow nesting). */
19
49
  maxSubworkflowDepth?: number;
50
+ /** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
51
+ testContext?: RunTestContext;
20
52
  }
21
53
  /** Engine-owned counters persisted with the run (worker-safe). */
22
54
  interface EngineRunCounters {
@@ -164,85 +196,7 @@ interface PersistedRunState {
164
196
  connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
165
197
  }
166
198
  //#endregion
167
- //#region ../core/src/events/runEvents.d.ts
168
- type RunEvent = Readonly<{
169
- kind: "runCreated";
170
- runId: RunId;
171
- workflowId: WorkflowId;
172
- parent?: ParentExecutionRef;
173
- at: string;
174
- }> | Readonly<{
175
- kind: "runSaved";
176
- runId: RunId;
177
- workflowId: WorkflowId;
178
- parent?: ParentExecutionRef;
179
- at: string;
180
- state: PersistedRunState;
181
- }> | Readonly<{
182
- kind: "nodeQueued";
183
- runId: RunId;
184
- workflowId: WorkflowId;
185
- parent?: ParentExecutionRef;
186
- at: string;
187
- snapshot: NodeExecutionSnapshot;
188
- }> | Readonly<{
189
- kind: "nodeStarted";
190
- runId: RunId;
191
- workflowId: WorkflowId;
192
- parent?: ParentExecutionRef;
193
- at: string;
194
- snapshot: NodeExecutionSnapshot;
195
- }> | Readonly<{
196
- kind: "nodeCompleted";
197
- runId: RunId;
198
- workflowId: WorkflowId;
199
- parent?: ParentExecutionRef;
200
- at: string;
201
- snapshot: NodeExecutionSnapshot;
202
- }> | Readonly<{
203
- kind: "nodeFailed";
204
- runId: RunId;
205
- workflowId: WorkflowId;
206
- parent?: ParentExecutionRef;
207
- at: string;
208
- snapshot: NodeExecutionSnapshot;
209
- }> | Readonly<{
210
- kind: "connectionInvocationStarted";
211
- runId: RunId;
212
- workflowId: WorkflowId;
213
- parent?: ParentExecutionRef;
214
- at: string;
215
- record: ConnectionInvocationRecord;
216
- }> | Readonly<{
217
- kind: "connectionInvocationCompleted";
218
- runId: RunId;
219
- workflowId: WorkflowId;
220
- parent?: ParentExecutionRef;
221
- at: string;
222
- record: ConnectionInvocationRecord;
223
- }> | Readonly<{
224
- kind: "connectionInvocationFailed";
225
- runId: RunId;
226
- workflowId: WorkflowId;
227
- parent?: ParentExecutionRef;
228
- at: string;
229
- record: ConnectionInvocationRecord;
230
- }>;
231
- interface RunEventSubscription {
232
- close(): Promise<void>;
233
- }
234
- interface RunEventBus {
235
- publish(event: RunEvent): Promise<void>;
236
- subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
237
- subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
238
- }
239
- //#endregion
240
199
  //#region ../core/src/contracts/workflowTypes.d.ts
241
- type WorkflowId = string;
242
- type NodeId = string;
243
- type OutputPortKey = string;
244
- type InputPortKey = string;
245
- type PersistedTokenId = string;
246
200
  type NodeKind = "trigger" | "node";
247
201
  type JsonPrimitive = string | number | boolean | null;
248
202
  interface JsonObject {
@@ -260,7 +214,6 @@ interface Edge {
260
214
  input: InputPortKey;
261
215
  };
262
216
  }
263
- type NodeConnectionName = string;
264
217
  /**
265
218
  * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
266
219
  * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
@@ -319,6 +272,12 @@ interface ParentExecutionRef {
319
272
  engineMaxNodeActivations?: number;
320
273
  /** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
321
274
  engineMaxSubworkflowDepth?: number;
275
+ /**
276
+ * Test-suite linkage inherited by the child subworkflow run. Set by whichever node
277
+ * spawns the subworkflow when its own `ctx.testContext` is present, so assertions
278
+ * emitted inside a subworkflow land under the correct parent test case.
279
+ */
280
+ testContext?: RunTestContext;
322
281
  }
323
282
  /** Whether to persist run execution data after the workflow finishes. */
324
283
  type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
@@ -331,6 +290,129 @@ interface PersistedRunPolicySnapshot {
331
290
  readonly storagePolicy: WorkflowStoragePolicyMode;
332
291
  }
333
292
  //#endregion
293
+ //#region ../core/src/contracts/testTriggerTypes.d.ts
294
+ /**
295
+ * Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
296
+ * One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
297
+ */
298
+ type TestSuiteRunId = string;
299
+ //#endregion
300
+ //#region ../core/src/events/runEvents.d.ts
301
+ /**
302
+ * Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
303
+ * - `running`: workflow still in flight
304
+ * - `succeeded`: workflow completed AND all assertions passed (or no assertions)
305
+ * - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
306
+ * - `errored` / `cancelled`: workflow itself errored or was cancelled
307
+ */
308
+ type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
309
+ /** Aggregate outcome of a TestSuiteRun. */
310
+ type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
311
+ type RunEvent = Readonly<{
312
+ kind: "runCreated";
313
+ runId: RunId;
314
+ workflowId: WorkflowId;
315
+ parent?: ParentExecutionRef;
316
+ at: string;
317
+ }> | Readonly<{
318
+ kind: "runSaved";
319
+ runId: RunId;
320
+ workflowId: WorkflowId;
321
+ parent?: ParentExecutionRef;
322
+ at: string;
323
+ state: PersistedRunState;
324
+ }> | Readonly<{
325
+ kind: "nodeQueued";
326
+ runId: RunId;
327
+ workflowId: WorkflowId;
328
+ parent?: ParentExecutionRef;
329
+ at: string;
330
+ snapshot: NodeExecutionSnapshot;
331
+ }> | Readonly<{
332
+ kind: "nodeStarted";
333
+ runId: RunId;
334
+ workflowId: WorkflowId;
335
+ parent?: ParentExecutionRef;
336
+ at: string;
337
+ snapshot: NodeExecutionSnapshot;
338
+ }> | Readonly<{
339
+ kind: "nodeCompleted";
340
+ runId: RunId;
341
+ workflowId: WorkflowId;
342
+ parent?: ParentExecutionRef;
343
+ at: string;
344
+ snapshot: NodeExecutionSnapshot;
345
+ }> | Readonly<{
346
+ kind: "nodeFailed";
347
+ runId: RunId;
348
+ workflowId: WorkflowId;
349
+ parent?: ParentExecutionRef;
350
+ at: string;
351
+ snapshot: NodeExecutionSnapshot;
352
+ }> | Readonly<{
353
+ kind: "connectionInvocationStarted";
354
+ runId: RunId;
355
+ workflowId: WorkflowId;
356
+ parent?: ParentExecutionRef;
357
+ at: string;
358
+ record: ConnectionInvocationRecord;
359
+ }> | Readonly<{
360
+ kind: "connectionInvocationCompleted";
361
+ runId: RunId;
362
+ workflowId: WorkflowId;
363
+ parent?: ParentExecutionRef;
364
+ at: string;
365
+ record: ConnectionInvocationRecord;
366
+ }> | Readonly<{
367
+ kind: "connectionInvocationFailed";
368
+ runId: RunId;
369
+ workflowId: WorkflowId;
370
+ parent?: ParentExecutionRef;
371
+ at: string;
372
+ record: ConnectionInvocationRecord;
373
+ }> | Readonly<{
374
+ kind: "testSuiteStarted";
375
+ testSuiteRunId: TestSuiteRunId;
376
+ workflowId: WorkflowId;
377
+ triggerNodeId: string;
378
+ triggerNodeName?: string;
379
+ concurrency: number;
380
+ at: string;
381
+ }> | Readonly<{
382
+ kind: "testSuiteFinished";
383
+ testSuiteRunId: TestSuiteRunId;
384
+ workflowId: WorkflowId;
385
+ status: TestSuiteRunStatus;
386
+ totalCases: number;
387
+ passedCases: number;
388
+ failedCases: number;
389
+ at: string;
390
+ }> | Readonly<{
391
+ kind: "testCaseStarted";
392
+ testSuiteRunId: TestSuiteRunId;
393
+ testCaseIndex: number;
394
+ runId: RunId;
395
+ workflowId: WorkflowId;
396
+ testCaseLabel?: string;
397
+ at: string;
398
+ }> | Readonly<{
399
+ kind: "testCaseCompleted";
400
+ testSuiteRunId: TestSuiteRunId;
401
+ testCaseIndex: number;
402
+ runId: RunId;
403
+ workflowId: WorkflowId;
404
+ status: TestCaseRunStatus;
405
+ at: string;
406
+ }>;
407
+ interface RunEventSubscription {
408
+ close(): Promise<void>;
409
+ }
410
+ interface RunEventBus {
411
+ publish(event: RunEvent): Promise<void>;
412
+ subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
413
+ subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
414
+ }
415
+ //#endregion
334
416
  //#region src/RedisRunEventBusRegistry.d.ts
335
417
  declare class RedisRunEventBus implements RunEventBus {
336
418
  private readonly redisUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemation/eventbus-redis",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "ioredis": "^5.7.0",
32
- "@codemation/core": "1.0.1"
32
+ "@codemation/core": "2.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^25.3.5",