@pogodisco/zephyr 1.5.6 → 1.5.7

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.
@@ -105,14 +105,11 @@ Input = unknown, Steps extends StepDef<Reg, any, any>[] = [], Results = {}, Outp
105
105
  parallel<Branches extends readonly WorkflowBuilder<Reg, Services, WFReg, Input, any, any>[]>(...branches: {
106
106
  [K in keyof Branches]: (builder: WorkflowBuilder<Reg, Services, WFReg, Input, [], Results>) => Branches[K];
107
107
  }): WorkflowBuilder<Reg, Services, WFReg, Input, MergeBranchSteps<Branches, Steps>, Simplify<MergeBranchResults<Branches, Results>>>;
108
- join<ID extends string = string, ActionName extends keyof Reg & string = any>(id: ID, action: ActionName, resolve?: (ctx: {
109
- input: Input;
110
- results: Results;
111
- } & Results & CallHelpers<Reg, ActionName>) => NormalizedCall, options?: StepOptions<Input, Results>): WorkflowBuilder<Reg, Services, WFReg, Input, [...Steps, StepDef<Reg, ID, ActionName>], Results & { [K_1 in ID]: ActionReturn<Reg, ActionName>; } extends infer T ? { [K in keyof T]: T[K]; } : never, undefined>;
108
+ join<ID extends string = string, ActionName extends keyof Reg & string = any>(id: ID): WorkflowBuilder<Reg, Services, WFReg, Input, [...Steps, StepDef<Reg, ID, ActionName>], Results & { [K_1 in ID]: ActionReturn<Reg, ActionName>; } extends infer T ? { [K in keyof T]: T[K]; } : never, undefined>;
112
109
  subflow<Prefix extends string, K extends keyof WFReg & string>(prefix: Prefix, workflowKey: K, resolveInput: (ctx: {
113
110
  input: Input;
114
111
  results: Results;
115
- }) => WorkflowInput<WFReg[K]>, options?: StepOptions<Input, Results>): WorkflowBuilder<Reg, Services, WFReg, Input, Steps, Results & {
112
+ } & Results) => WorkflowInput<WFReg[K]>, options?: StepOptions<Input, Results>): WorkflowBuilder<Reg, Services, WFReg, Input, Steps, Results & {
116
113
  [P in Prefix]: WorkflowOutput<WFReg[K]>;
117
114
  }>;
118
115
  private _subflow;
@@ -115,8 +115,10 @@ export class WorkflowBuilder {
115
115
  /* ------------------------------------------------ */
116
116
  /* Join helper */
117
117
  /* ------------------------------------------------ */
118
- join(id, action, resolve, options) {
119
- const result = this.step(id, action, resolve, [...this.frontier], options);
118
+ join(id) {
119
+ const result = this.step(id, "__join__", undefined,
120
+ // resolve,
121
+ [...this.frontier]);
120
122
  this.clearPendingWhen();
121
123
  return result;
122
124
  }
@@ -576,6 +576,10 @@ export async function executeWorkflow({ workflow, actionRegistry, services, inpu
576
576
  results[step.id] = undefined;
577
577
  return undefined;
578
578
  }
579
+ if (step.action === "__join__") {
580
+ results[step.id] = undefined;
581
+ return undefined;
582
+ }
579
583
  if (step.action === "__pipe_map__") {
580
584
  const isParallel = step?.options?.pipe?.parallel;
581
585
  const items = step.resolve(stepCtx).args ?? [];
@@ -593,7 +597,6 @@ export async function executeWorkflow({ workflow, actionRegistry, services, inpu
593
597
  extras: res.extras,
594
598
  })));
595
599
  const settled = await Promise.all(executions);
596
- console.log("SETTLED", settled);
597
600
  // ✅ preserve order (IMPORTANT)
598
601
  const outputs = settled
599
602
  .sort((a, b) => a.index - b.index)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pogodisco/zephyr",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },