@codemation/eventbus-redis 0.0.32 → 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 +14 -0
- package/dist/index.d.ts +173 -58
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
10
|
+
## 0.0.33
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`ed75183`](https://github.com/MadeRelevant/codemation/commit/ed75183f51ae71b06aa2e57ae4fc48ce9db2e4ce)]:
|
|
15
|
+
- @codemation/core@1.0.1
|
|
16
|
+
|
|
3
17
|
## 0.0.32
|
|
4
18
|
|
|
5
19
|
### 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 {
|
|
@@ -118,6 +150,12 @@ interface ConnectionInvocationRecord {
|
|
|
118
150
|
readonly startedAt?: string;
|
|
119
151
|
readonly finishedAt?: string;
|
|
120
152
|
readonly updatedAt: string;
|
|
153
|
+
/** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
|
|
154
|
+
readonly iterationId?: NodeIterationId;
|
|
155
|
+
/** Item index (0-based) of the iteration that produced this invocation. */
|
|
156
|
+
readonly itemIndex?: number;
|
|
157
|
+
/** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
|
|
158
|
+
readonly parentInvocationId?: ConnectionInvocationId;
|
|
121
159
|
}
|
|
122
160
|
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
123
161
|
interface PendingNodeExecution {
|
|
@@ -158,64 +196,7 @@ interface PersistedRunState {
|
|
|
158
196
|
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
159
197
|
}
|
|
160
198
|
//#endregion
|
|
161
|
-
//#region ../core/src/events/runEvents.d.ts
|
|
162
|
-
type RunEvent = Readonly<{
|
|
163
|
-
kind: "runCreated";
|
|
164
|
-
runId: RunId;
|
|
165
|
-
workflowId: WorkflowId;
|
|
166
|
-
parent?: ParentExecutionRef;
|
|
167
|
-
at: string;
|
|
168
|
-
}> | Readonly<{
|
|
169
|
-
kind: "runSaved";
|
|
170
|
-
runId: RunId;
|
|
171
|
-
workflowId: WorkflowId;
|
|
172
|
-
parent?: ParentExecutionRef;
|
|
173
|
-
at: string;
|
|
174
|
-
state: PersistedRunState;
|
|
175
|
-
}> | Readonly<{
|
|
176
|
-
kind: "nodeQueued";
|
|
177
|
-
runId: RunId;
|
|
178
|
-
workflowId: WorkflowId;
|
|
179
|
-
parent?: ParentExecutionRef;
|
|
180
|
-
at: string;
|
|
181
|
-
snapshot: NodeExecutionSnapshot;
|
|
182
|
-
}> | Readonly<{
|
|
183
|
-
kind: "nodeStarted";
|
|
184
|
-
runId: RunId;
|
|
185
|
-
workflowId: WorkflowId;
|
|
186
|
-
parent?: ParentExecutionRef;
|
|
187
|
-
at: string;
|
|
188
|
-
snapshot: NodeExecutionSnapshot;
|
|
189
|
-
}> | Readonly<{
|
|
190
|
-
kind: "nodeCompleted";
|
|
191
|
-
runId: RunId;
|
|
192
|
-
workflowId: WorkflowId;
|
|
193
|
-
parent?: ParentExecutionRef;
|
|
194
|
-
at: string;
|
|
195
|
-
snapshot: NodeExecutionSnapshot;
|
|
196
|
-
}> | Readonly<{
|
|
197
|
-
kind: "nodeFailed";
|
|
198
|
-
runId: RunId;
|
|
199
|
-
workflowId: WorkflowId;
|
|
200
|
-
parent?: ParentExecutionRef;
|
|
201
|
-
at: string;
|
|
202
|
-
snapshot: NodeExecutionSnapshot;
|
|
203
|
-
}>;
|
|
204
|
-
interface RunEventSubscription {
|
|
205
|
-
close(): Promise<void>;
|
|
206
|
-
}
|
|
207
|
-
interface RunEventBus {
|
|
208
|
-
publish(event: RunEvent): Promise<void>;
|
|
209
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
210
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
211
|
-
}
|
|
212
|
-
//#endregion
|
|
213
199
|
//#region ../core/src/contracts/workflowTypes.d.ts
|
|
214
|
-
type WorkflowId = string;
|
|
215
|
-
type NodeId = string;
|
|
216
|
-
type OutputPortKey = string;
|
|
217
|
-
type InputPortKey = string;
|
|
218
|
-
type PersistedTokenId = string;
|
|
219
200
|
type NodeKind = "trigger" | "node";
|
|
220
201
|
type JsonPrimitive = string | number | boolean | null;
|
|
221
202
|
interface JsonObject {
|
|
@@ -233,7 +214,6 @@ interface Edge {
|
|
|
233
214
|
input: InputPortKey;
|
|
234
215
|
};
|
|
235
216
|
}
|
|
236
|
-
type NodeConnectionName = string;
|
|
237
217
|
/**
|
|
238
218
|
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
239
219
|
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
@@ -276,6 +256,12 @@ type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
|
276
256
|
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
277
257
|
type RunId = string;
|
|
278
258
|
type NodeActivationId = string;
|
|
259
|
+
/**
|
|
260
|
+
* One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
|
|
261
|
+
* per-item connection invocations and telemetry. Undefined when the executing node is a batch
|
|
262
|
+
* node or trigger that does not iterate items.
|
|
263
|
+
*/
|
|
264
|
+
type NodeIterationId = string;
|
|
279
265
|
interface ParentExecutionRef {
|
|
280
266
|
runId: RunId;
|
|
281
267
|
workflowId: WorkflowId;
|
|
@@ -286,6 +272,12 @@ interface ParentExecutionRef {
|
|
|
286
272
|
engineMaxNodeActivations?: number;
|
|
287
273
|
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
288
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;
|
|
289
281
|
}
|
|
290
282
|
/** Whether to persist run execution data after the workflow finishes. */
|
|
291
283
|
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
@@ -298,6 +290,129 @@ interface PersistedRunPolicySnapshot {
|
|
|
298
290
|
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
299
291
|
}
|
|
300
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
|
|
301
416
|
//#region src/RedisRunEventBusRegistry.d.ts
|
|
302
417
|
declare class RedisRunEventBus implements RunEventBus {
|
|
303
418
|
private readonly redisUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemation/eventbus-redis",
|
|
3
|
-
"version": "0.0.
|
|
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": "
|
|
32
|
+
"@codemation/core": "2.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^25.3.5",
|