@cadenza.io/core 1.12.0 → 3.0.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/dist/index.d.mts +91 -84
- package/dist/index.d.ts +91 -84
- package/dist/index.js +306 -287
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +306 -286
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -48,8 +48,8 @@ declare class GraphContext {
|
|
|
48
48
|
* @returns Exported object.
|
|
49
49
|
*/
|
|
50
50
|
export(): {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
id: string;
|
|
52
|
+
context: AnyObject;
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -258,8 +258,8 @@ declare class GraphNode extends SignalEmitter implements Graph {
|
|
|
258
258
|
__id: string;
|
|
259
259
|
__task: AnyObject;
|
|
260
260
|
__context: {
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
id: string;
|
|
262
|
+
context: AnyObject;
|
|
263
263
|
};
|
|
264
264
|
__result: TaskResult;
|
|
265
265
|
__executionTime: number;
|
|
@@ -280,12 +280,12 @@ declare class GraphNode extends SignalEmitter implements Graph {
|
|
|
280
280
|
lightExport(): {
|
|
281
281
|
__id: string;
|
|
282
282
|
__task: {
|
|
283
|
-
__id: string;
|
|
284
283
|
__name: string;
|
|
284
|
+
__version: number;
|
|
285
285
|
};
|
|
286
286
|
__context: {
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
id: string;
|
|
288
|
+
context: AnyObject;
|
|
289
289
|
};
|
|
290
290
|
__executionTime: number;
|
|
291
291
|
__executionStart: number;
|
|
@@ -324,68 +324,6 @@ declare class TaskIterator implements Iterator {
|
|
|
324
324
|
next(): Task | undefined;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
declare class SignalParticipant extends SignalEmitter {
|
|
328
|
-
emitsSignals: Set<string>;
|
|
329
|
-
signalsToEmitAfter: Set<string>;
|
|
330
|
-
signalsToEmitOnFail: Set<string>;
|
|
331
|
-
observedSignals: Set<string>;
|
|
332
|
-
/**
|
|
333
|
-
* Subscribes to signals (chainable).
|
|
334
|
-
* @param signals The signal names.
|
|
335
|
-
* @returns This for chaining.
|
|
336
|
-
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
337
|
-
*/
|
|
338
|
-
doOn(...signals: string[]): this;
|
|
339
|
-
/**
|
|
340
|
-
* Sets signals to emit post-execution (chainable).
|
|
341
|
-
* @param signals The signal names.
|
|
342
|
-
* @returns This for chaining.
|
|
343
|
-
*/
|
|
344
|
-
emitsAfter(...signals: string[]): this;
|
|
345
|
-
emitsOnFail(...signals: string[]): this;
|
|
346
|
-
/**
|
|
347
|
-
* Unsubscribes from all observed signals.
|
|
348
|
-
* @returns This for chaining.
|
|
349
|
-
*/
|
|
350
|
-
unsubscribeAll(): this;
|
|
351
|
-
/**
|
|
352
|
-
* Unsubscribes from specific signals.
|
|
353
|
-
* @param signals The signals.
|
|
354
|
-
* @returns This for chaining.
|
|
355
|
-
* @edge No-op if not subscribed.
|
|
356
|
-
*/
|
|
357
|
-
unsubscribe(...signals: string[]): this;
|
|
358
|
-
/**
|
|
359
|
-
* Detaches specific emitted signals.
|
|
360
|
-
* @param signals The signals.
|
|
361
|
-
* @returns This for chaining.
|
|
362
|
-
*/
|
|
363
|
-
detachSignals(...signals: string[]): this;
|
|
364
|
-
/**
|
|
365
|
-
* Detaches all emitted signals.
|
|
366
|
-
* @returns This for chaining.
|
|
367
|
-
*/
|
|
368
|
-
detachAllSignals(): this;
|
|
369
|
-
mapSignals(callback: (signal: string) => void): void[];
|
|
370
|
-
mapOnFailSignals(callback: (signal: string) => void): void[];
|
|
371
|
-
/**
|
|
372
|
-
* Emits attached signals.
|
|
373
|
-
* @param context The context for emission.
|
|
374
|
-
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
375
|
-
*/
|
|
376
|
-
emitSignals(context: GraphContext): void;
|
|
377
|
-
/**
|
|
378
|
-
* Emits attached fail signals.
|
|
379
|
-
* @param context The context for emission.
|
|
380
|
-
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
381
|
-
*/
|
|
382
|
-
emitOnFailSignals(context: GraphContext): void;
|
|
383
|
-
/**
|
|
384
|
-
* Destroys the participant (unsub/detach).
|
|
385
|
-
*/
|
|
386
|
-
destroy(): void;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
327
|
type SchemaType = "string" | "number" | "boolean" | "array" | "object" | "any";
|
|
390
328
|
type SchemaConstraints = {
|
|
391
329
|
min?: number;
|
|
@@ -413,10 +351,10 @@ type SchemaDefinition = {
|
|
|
413
351
|
type TaskFunction = (context: AnyObject, emit: (signal: string, context: AnyObject) => void, progressCallback: (progress: number) => void) => TaskResult;
|
|
414
352
|
type TaskResult = boolean | AnyObject | Generator | Promise<any> | void;
|
|
415
353
|
type ThrottleTagGetter = (context?: AnyObject, task?: Task) => string;
|
|
416
|
-
declare class Task extends
|
|
417
|
-
id: string;
|
|
354
|
+
declare class Task extends SignalEmitter implements Graph {
|
|
418
355
|
readonly name: string;
|
|
419
356
|
readonly description: string;
|
|
357
|
+
version: number;
|
|
420
358
|
concurrency: number;
|
|
421
359
|
timeout: number;
|
|
422
360
|
readonly isMeta: boolean;
|
|
@@ -442,6 +380,10 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
442
380
|
onFailTasks: Set<Task>;
|
|
443
381
|
predecessorTasks: Set<Task>;
|
|
444
382
|
destroyed: boolean;
|
|
383
|
+
emitsSignals: Set<string>;
|
|
384
|
+
signalsToEmitAfter: Set<string>;
|
|
385
|
+
signalsToEmitOnFail: Set<string>;
|
|
386
|
+
observedSignals: Set<string>;
|
|
445
387
|
readonly taskFunction: TaskFunction;
|
|
446
388
|
/**
|
|
447
389
|
* Constructs a Task (static definition).
|
|
@@ -468,7 +410,7 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
468
410
|
*/
|
|
469
411
|
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
470
412
|
getTag(context?: AnyObject): string;
|
|
471
|
-
|
|
413
|
+
setVersion(version: number): void;
|
|
472
414
|
setTimeout(timeout: number): void;
|
|
473
415
|
setConcurrency(concurrency: number): void;
|
|
474
416
|
setProgressWeight(weight: number): void;
|
|
@@ -505,13 +447,63 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
505
447
|
doAfter(...tasks: Task[]): this;
|
|
506
448
|
then(...tasks: Task[]): this;
|
|
507
449
|
decouple(task: Task): void;
|
|
508
|
-
doOnFail(...tasks: Task[]): this;
|
|
509
450
|
updateProgressWeights(): void;
|
|
510
451
|
getSubgraphLayers(): Map<number, Set<Task>>;
|
|
511
452
|
updateLayerFromPredecessors(): void;
|
|
512
453
|
hasCycle(): boolean;
|
|
513
454
|
mapNext(callback: (task: Task) => any, failed?: boolean): any[];
|
|
514
455
|
mapPrevious(callback: (task: Task) => any): any[];
|
|
456
|
+
/**
|
|
457
|
+
* Subscribes to signals (chainable).
|
|
458
|
+
* @param signals The signal names.
|
|
459
|
+
* @returns This for chaining.
|
|
460
|
+
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
461
|
+
*/
|
|
462
|
+
doOn(...signals: string[]): this;
|
|
463
|
+
/**
|
|
464
|
+
* Sets signals to emit post-execution (chainable).
|
|
465
|
+
* @param signals The signal names.
|
|
466
|
+
* @returns This for chaining.
|
|
467
|
+
*/
|
|
468
|
+
emits(...signals: string[]): this;
|
|
469
|
+
emitsOnFail(...signals: string[]): this;
|
|
470
|
+
/**
|
|
471
|
+
* Unsubscribes from all observed signals.
|
|
472
|
+
* @returns This for chaining.
|
|
473
|
+
*/
|
|
474
|
+
unsubscribeAll(): this;
|
|
475
|
+
/**
|
|
476
|
+
* Unsubscribes from specific signals.
|
|
477
|
+
* @param signals The signals.
|
|
478
|
+
* @returns This for chaining.
|
|
479
|
+
* @edge No-op if not subscribed.
|
|
480
|
+
*/
|
|
481
|
+
unsubscribe(...signals: string[]): this;
|
|
482
|
+
/**
|
|
483
|
+
* Detaches specific emitted signals.
|
|
484
|
+
* @param signals The signals.
|
|
485
|
+
* @returns This for chaining.
|
|
486
|
+
*/
|
|
487
|
+
detachSignals(...signals: string[]): this;
|
|
488
|
+
/**
|
|
489
|
+
* Detaches all emitted signals.
|
|
490
|
+
* @returns This for chaining.
|
|
491
|
+
*/
|
|
492
|
+
detachAllSignals(): this;
|
|
493
|
+
mapSignals(callback: (signal: string) => void): void[];
|
|
494
|
+
mapOnFailSignals(callback: (signal: string) => void): void[];
|
|
495
|
+
/**
|
|
496
|
+
* Emits attached signals.
|
|
497
|
+
* @param context The context for emission.
|
|
498
|
+
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
499
|
+
*/
|
|
500
|
+
emitSignals(context: GraphContext): void;
|
|
501
|
+
/**
|
|
502
|
+
* Emits attached fail signals.
|
|
503
|
+
* @param context The context for emission.
|
|
504
|
+
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
505
|
+
*/
|
|
506
|
+
emitOnFailSignals(context: GraphContext): void;
|
|
515
507
|
destroy(): void;
|
|
516
508
|
export(): AnyObject;
|
|
517
509
|
getIterator(): TaskIterator;
|
|
@@ -578,12 +570,13 @@ declare class GraphRun {
|
|
|
578
570
|
setExporter(exporter: GraphExporter): void;
|
|
579
571
|
}
|
|
580
572
|
|
|
581
|
-
declare class GraphRoutine extends
|
|
582
|
-
id: string;
|
|
573
|
+
declare class GraphRoutine extends SignalEmitter {
|
|
583
574
|
readonly name: string;
|
|
575
|
+
version: number;
|
|
584
576
|
readonly description: string;
|
|
585
577
|
readonly isMeta: boolean;
|
|
586
578
|
tasks: Set<Task>;
|
|
579
|
+
observedSignals: Set<string>;
|
|
587
580
|
constructor(name: string, tasks: Task[], description: string, isMeta?: boolean);
|
|
588
581
|
/**
|
|
589
582
|
* Applies callback to starting tasks.
|
|
@@ -592,10 +585,29 @@ declare class GraphRoutine extends SignalParticipant {
|
|
|
592
585
|
*/
|
|
593
586
|
forEachTask(callBack: (task: Task) => any): Promise<void>;
|
|
594
587
|
/**
|
|
595
|
-
* Sets global
|
|
596
|
-
* @param
|
|
588
|
+
* Sets global Version.
|
|
589
|
+
* @param version The Version.
|
|
590
|
+
*/
|
|
591
|
+
setVersion(version: number): void;
|
|
592
|
+
/**
|
|
593
|
+
* Subscribes to signals (chainable).
|
|
594
|
+
* @param signals The signal names.
|
|
595
|
+
* @returns This for chaining.
|
|
596
|
+
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
597
|
+
*/
|
|
598
|
+
doOn(...signals: string[]): this;
|
|
599
|
+
/**
|
|
600
|
+
* Unsubscribes from all observed signals.
|
|
601
|
+
* @returns This for chaining.
|
|
597
602
|
*/
|
|
598
|
-
|
|
603
|
+
unsubscribeAll(): this;
|
|
604
|
+
/**
|
|
605
|
+
* Unsubscribes from specific signals.
|
|
606
|
+
* @param signals The signals.
|
|
607
|
+
* @returns This for chaining.
|
|
608
|
+
* @edge No-op if not subscribed.
|
|
609
|
+
*/
|
|
610
|
+
unsubscribe(...signals: string[]): this;
|
|
599
611
|
/**
|
|
600
612
|
* Destroys the routine.
|
|
601
613
|
*/
|
|
@@ -603,7 +615,6 @@ declare class GraphRoutine extends SignalParticipant {
|
|
|
603
615
|
}
|
|
604
616
|
|
|
605
617
|
declare class GraphRunner extends SignalEmitter {
|
|
606
|
-
readonly id: string;
|
|
607
618
|
currentRun: GraphRun;
|
|
608
619
|
debug: boolean;
|
|
609
620
|
verbose: boolean;
|
|
@@ -710,18 +721,14 @@ declare class GraphRegistry {
|
|
|
710
721
|
tasks: Map<string, Task>;
|
|
711
722
|
routines: Map<string, GraphRoutine>;
|
|
712
723
|
registerTask: Task;
|
|
713
|
-
updateTaskId: Task;
|
|
714
724
|
updateTaskInputSchema: Task;
|
|
715
725
|
updateTaskOutputSchema: Task;
|
|
716
|
-
getTaskById: Task;
|
|
717
726
|
getTaskByName: Task;
|
|
718
727
|
getTasksByLayer: Task;
|
|
719
728
|
getAllTasks: Task;
|
|
720
729
|
doForEachTask: Task;
|
|
721
730
|
deleteTask: Task;
|
|
722
731
|
registerRoutine: Task;
|
|
723
|
-
updateRoutineId: Task;
|
|
724
|
-
getRoutineById: Task;
|
|
725
732
|
getRoutineByName: Task;
|
|
726
733
|
getAllRoutines: Task;
|
|
727
734
|
doForEachRoutine: Task;
|
|
@@ -944,4 +951,4 @@ declare class SignalTask extends Task {
|
|
|
944
951
|
constructor(signal: string, description?: string);
|
|
945
952
|
}
|
|
946
953
|
|
|
947
|
-
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter,
|
|
954
|
+
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ declare class GraphContext {
|
|
|
48
48
|
* @returns Exported object.
|
|
49
49
|
*/
|
|
50
50
|
export(): {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
id: string;
|
|
52
|
+
context: AnyObject;
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -258,8 +258,8 @@ declare class GraphNode extends SignalEmitter implements Graph {
|
|
|
258
258
|
__id: string;
|
|
259
259
|
__task: AnyObject;
|
|
260
260
|
__context: {
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
id: string;
|
|
262
|
+
context: AnyObject;
|
|
263
263
|
};
|
|
264
264
|
__result: TaskResult;
|
|
265
265
|
__executionTime: number;
|
|
@@ -280,12 +280,12 @@ declare class GraphNode extends SignalEmitter implements Graph {
|
|
|
280
280
|
lightExport(): {
|
|
281
281
|
__id: string;
|
|
282
282
|
__task: {
|
|
283
|
-
__id: string;
|
|
284
283
|
__name: string;
|
|
284
|
+
__version: number;
|
|
285
285
|
};
|
|
286
286
|
__context: {
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
id: string;
|
|
288
|
+
context: AnyObject;
|
|
289
289
|
};
|
|
290
290
|
__executionTime: number;
|
|
291
291
|
__executionStart: number;
|
|
@@ -324,68 +324,6 @@ declare class TaskIterator implements Iterator {
|
|
|
324
324
|
next(): Task | undefined;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
declare class SignalParticipant extends SignalEmitter {
|
|
328
|
-
emitsSignals: Set<string>;
|
|
329
|
-
signalsToEmitAfter: Set<string>;
|
|
330
|
-
signalsToEmitOnFail: Set<string>;
|
|
331
|
-
observedSignals: Set<string>;
|
|
332
|
-
/**
|
|
333
|
-
* Subscribes to signals (chainable).
|
|
334
|
-
* @param signals The signal names.
|
|
335
|
-
* @returns This for chaining.
|
|
336
|
-
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
337
|
-
*/
|
|
338
|
-
doOn(...signals: string[]): this;
|
|
339
|
-
/**
|
|
340
|
-
* Sets signals to emit post-execution (chainable).
|
|
341
|
-
* @param signals The signal names.
|
|
342
|
-
* @returns This for chaining.
|
|
343
|
-
*/
|
|
344
|
-
emitsAfter(...signals: string[]): this;
|
|
345
|
-
emitsOnFail(...signals: string[]): this;
|
|
346
|
-
/**
|
|
347
|
-
* Unsubscribes from all observed signals.
|
|
348
|
-
* @returns This for chaining.
|
|
349
|
-
*/
|
|
350
|
-
unsubscribeAll(): this;
|
|
351
|
-
/**
|
|
352
|
-
* Unsubscribes from specific signals.
|
|
353
|
-
* @param signals The signals.
|
|
354
|
-
* @returns This for chaining.
|
|
355
|
-
* @edge No-op if not subscribed.
|
|
356
|
-
*/
|
|
357
|
-
unsubscribe(...signals: string[]): this;
|
|
358
|
-
/**
|
|
359
|
-
* Detaches specific emitted signals.
|
|
360
|
-
* @param signals The signals.
|
|
361
|
-
* @returns This for chaining.
|
|
362
|
-
*/
|
|
363
|
-
detachSignals(...signals: string[]): this;
|
|
364
|
-
/**
|
|
365
|
-
* Detaches all emitted signals.
|
|
366
|
-
* @returns This for chaining.
|
|
367
|
-
*/
|
|
368
|
-
detachAllSignals(): this;
|
|
369
|
-
mapSignals(callback: (signal: string) => void): void[];
|
|
370
|
-
mapOnFailSignals(callback: (signal: string) => void): void[];
|
|
371
|
-
/**
|
|
372
|
-
* Emits attached signals.
|
|
373
|
-
* @param context The context for emission.
|
|
374
|
-
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
375
|
-
*/
|
|
376
|
-
emitSignals(context: GraphContext): void;
|
|
377
|
-
/**
|
|
378
|
-
* Emits attached fail signals.
|
|
379
|
-
* @param context The context for emission.
|
|
380
|
-
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
381
|
-
*/
|
|
382
|
-
emitOnFailSignals(context: GraphContext): void;
|
|
383
|
-
/**
|
|
384
|
-
* Destroys the participant (unsub/detach).
|
|
385
|
-
*/
|
|
386
|
-
destroy(): void;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
327
|
type SchemaType = "string" | "number" | "boolean" | "array" | "object" | "any";
|
|
390
328
|
type SchemaConstraints = {
|
|
391
329
|
min?: number;
|
|
@@ -413,10 +351,10 @@ type SchemaDefinition = {
|
|
|
413
351
|
type TaskFunction = (context: AnyObject, emit: (signal: string, context: AnyObject) => void, progressCallback: (progress: number) => void) => TaskResult;
|
|
414
352
|
type TaskResult = boolean | AnyObject | Generator | Promise<any> | void;
|
|
415
353
|
type ThrottleTagGetter = (context?: AnyObject, task?: Task) => string;
|
|
416
|
-
declare class Task extends
|
|
417
|
-
id: string;
|
|
354
|
+
declare class Task extends SignalEmitter implements Graph {
|
|
418
355
|
readonly name: string;
|
|
419
356
|
readonly description: string;
|
|
357
|
+
version: number;
|
|
420
358
|
concurrency: number;
|
|
421
359
|
timeout: number;
|
|
422
360
|
readonly isMeta: boolean;
|
|
@@ -442,6 +380,10 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
442
380
|
onFailTasks: Set<Task>;
|
|
443
381
|
predecessorTasks: Set<Task>;
|
|
444
382
|
destroyed: boolean;
|
|
383
|
+
emitsSignals: Set<string>;
|
|
384
|
+
signalsToEmitAfter: Set<string>;
|
|
385
|
+
signalsToEmitOnFail: Set<string>;
|
|
386
|
+
observedSignals: Set<string>;
|
|
445
387
|
readonly taskFunction: TaskFunction;
|
|
446
388
|
/**
|
|
447
389
|
* Constructs a Task (static definition).
|
|
@@ -468,7 +410,7 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
468
410
|
*/
|
|
469
411
|
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
470
412
|
getTag(context?: AnyObject): string;
|
|
471
|
-
|
|
413
|
+
setVersion(version: number): void;
|
|
472
414
|
setTimeout(timeout: number): void;
|
|
473
415
|
setConcurrency(concurrency: number): void;
|
|
474
416
|
setProgressWeight(weight: number): void;
|
|
@@ -505,13 +447,63 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
505
447
|
doAfter(...tasks: Task[]): this;
|
|
506
448
|
then(...tasks: Task[]): this;
|
|
507
449
|
decouple(task: Task): void;
|
|
508
|
-
doOnFail(...tasks: Task[]): this;
|
|
509
450
|
updateProgressWeights(): void;
|
|
510
451
|
getSubgraphLayers(): Map<number, Set<Task>>;
|
|
511
452
|
updateLayerFromPredecessors(): void;
|
|
512
453
|
hasCycle(): boolean;
|
|
513
454
|
mapNext(callback: (task: Task) => any, failed?: boolean): any[];
|
|
514
455
|
mapPrevious(callback: (task: Task) => any): any[];
|
|
456
|
+
/**
|
|
457
|
+
* Subscribes to signals (chainable).
|
|
458
|
+
* @param signals The signal names.
|
|
459
|
+
* @returns This for chaining.
|
|
460
|
+
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
461
|
+
*/
|
|
462
|
+
doOn(...signals: string[]): this;
|
|
463
|
+
/**
|
|
464
|
+
* Sets signals to emit post-execution (chainable).
|
|
465
|
+
* @param signals The signal names.
|
|
466
|
+
* @returns This for chaining.
|
|
467
|
+
*/
|
|
468
|
+
emits(...signals: string[]): this;
|
|
469
|
+
emitsOnFail(...signals: string[]): this;
|
|
470
|
+
/**
|
|
471
|
+
* Unsubscribes from all observed signals.
|
|
472
|
+
* @returns This for chaining.
|
|
473
|
+
*/
|
|
474
|
+
unsubscribeAll(): this;
|
|
475
|
+
/**
|
|
476
|
+
* Unsubscribes from specific signals.
|
|
477
|
+
* @param signals The signals.
|
|
478
|
+
* @returns This for chaining.
|
|
479
|
+
* @edge No-op if not subscribed.
|
|
480
|
+
*/
|
|
481
|
+
unsubscribe(...signals: string[]): this;
|
|
482
|
+
/**
|
|
483
|
+
* Detaches specific emitted signals.
|
|
484
|
+
* @param signals The signals.
|
|
485
|
+
* @returns This for chaining.
|
|
486
|
+
*/
|
|
487
|
+
detachSignals(...signals: string[]): this;
|
|
488
|
+
/**
|
|
489
|
+
* Detaches all emitted signals.
|
|
490
|
+
* @returns This for chaining.
|
|
491
|
+
*/
|
|
492
|
+
detachAllSignals(): this;
|
|
493
|
+
mapSignals(callback: (signal: string) => void): void[];
|
|
494
|
+
mapOnFailSignals(callback: (signal: string) => void): void[];
|
|
495
|
+
/**
|
|
496
|
+
* Emits attached signals.
|
|
497
|
+
* @param context The context for emission.
|
|
498
|
+
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
499
|
+
*/
|
|
500
|
+
emitSignals(context: GraphContext): void;
|
|
501
|
+
/**
|
|
502
|
+
* Emits attached fail signals.
|
|
503
|
+
* @param context The context for emission.
|
|
504
|
+
* @edge If isMeta (from Task), suppresses further "meta.*" to prevent loops.
|
|
505
|
+
*/
|
|
506
|
+
emitOnFailSignals(context: GraphContext): void;
|
|
515
507
|
destroy(): void;
|
|
516
508
|
export(): AnyObject;
|
|
517
509
|
getIterator(): TaskIterator;
|
|
@@ -578,12 +570,13 @@ declare class GraphRun {
|
|
|
578
570
|
setExporter(exporter: GraphExporter): void;
|
|
579
571
|
}
|
|
580
572
|
|
|
581
|
-
declare class GraphRoutine extends
|
|
582
|
-
id: string;
|
|
573
|
+
declare class GraphRoutine extends SignalEmitter {
|
|
583
574
|
readonly name: string;
|
|
575
|
+
version: number;
|
|
584
576
|
readonly description: string;
|
|
585
577
|
readonly isMeta: boolean;
|
|
586
578
|
tasks: Set<Task>;
|
|
579
|
+
observedSignals: Set<string>;
|
|
587
580
|
constructor(name: string, tasks: Task[], description: string, isMeta?: boolean);
|
|
588
581
|
/**
|
|
589
582
|
* Applies callback to starting tasks.
|
|
@@ -592,10 +585,29 @@ declare class GraphRoutine extends SignalParticipant {
|
|
|
592
585
|
*/
|
|
593
586
|
forEachTask(callBack: (task: Task) => any): Promise<void>;
|
|
594
587
|
/**
|
|
595
|
-
* Sets global
|
|
596
|
-
* @param
|
|
588
|
+
* Sets global Version.
|
|
589
|
+
* @param version The Version.
|
|
590
|
+
*/
|
|
591
|
+
setVersion(version: number): void;
|
|
592
|
+
/**
|
|
593
|
+
* Subscribes to signals (chainable).
|
|
594
|
+
* @param signals The signal names.
|
|
595
|
+
* @returns This for chaining.
|
|
596
|
+
* @edge Duplicates ignored; assumes broker.observe binds this as handler.
|
|
597
|
+
*/
|
|
598
|
+
doOn(...signals: string[]): this;
|
|
599
|
+
/**
|
|
600
|
+
* Unsubscribes from all observed signals.
|
|
601
|
+
* @returns This for chaining.
|
|
597
602
|
*/
|
|
598
|
-
|
|
603
|
+
unsubscribeAll(): this;
|
|
604
|
+
/**
|
|
605
|
+
* Unsubscribes from specific signals.
|
|
606
|
+
* @param signals The signals.
|
|
607
|
+
* @returns This for chaining.
|
|
608
|
+
* @edge No-op if not subscribed.
|
|
609
|
+
*/
|
|
610
|
+
unsubscribe(...signals: string[]): this;
|
|
599
611
|
/**
|
|
600
612
|
* Destroys the routine.
|
|
601
613
|
*/
|
|
@@ -603,7 +615,6 @@ declare class GraphRoutine extends SignalParticipant {
|
|
|
603
615
|
}
|
|
604
616
|
|
|
605
617
|
declare class GraphRunner extends SignalEmitter {
|
|
606
|
-
readonly id: string;
|
|
607
618
|
currentRun: GraphRun;
|
|
608
619
|
debug: boolean;
|
|
609
620
|
verbose: boolean;
|
|
@@ -710,18 +721,14 @@ declare class GraphRegistry {
|
|
|
710
721
|
tasks: Map<string, Task>;
|
|
711
722
|
routines: Map<string, GraphRoutine>;
|
|
712
723
|
registerTask: Task;
|
|
713
|
-
updateTaskId: Task;
|
|
714
724
|
updateTaskInputSchema: Task;
|
|
715
725
|
updateTaskOutputSchema: Task;
|
|
716
|
-
getTaskById: Task;
|
|
717
726
|
getTaskByName: Task;
|
|
718
727
|
getTasksByLayer: Task;
|
|
719
728
|
getAllTasks: Task;
|
|
720
729
|
doForEachTask: Task;
|
|
721
730
|
deleteTask: Task;
|
|
722
731
|
registerRoutine: Task;
|
|
723
|
-
updateRoutineId: Task;
|
|
724
|
-
getRoutineById: Task;
|
|
725
732
|
getRoutineByName: Task;
|
|
726
733
|
getAllRoutines: Task;
|
|
727
734
|
doForEachRoutine: Task;
|
|
@@ -944,4 +951,4 @@ declare class SignalTask extends Task {
|
|
|
944
951
|
constructor(signal: string, description?: string);
|
|
945
952
|
}
|
|
946
953
|
|
|
947
|
-
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter,
|
|
954
|
+
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|