@pogodisco/zephyr 1.3.17 → 1.3.18

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.
@@ -78,6 +78,7 @@ type MergeBranchSteps<Branches extends readonly any[], Acc extends any[]> = Bran
78
78
  ...(Head extends WorkflowBuilder<any, any, any, infer S, any> ? S : [])
79
79
  ]> : Acc;
80
80
  type MergeBranchResults<Branches extends readonly WorkflowBuilder<any, any, any, any, any>[]> = Simplify<Branches extends readonly [infer Head, ...infer Tail] ? Head extends WorkflowBuilder<any, any, any, any, infer R> ? Tail extends readonly WorkflowBuilder<any, any, any, any, any>[] ? R & MergeBranchResults<Tail> : R : MergeBranchResults<Tail & WorkflowBuilder<any, any, any, any, any>[]> : {}>;
81
+ type WorkflowBuilderStatic<Reg extends ActionRegistry, Input, Context, Steps extends StepDef<Reg, any, any>[] = [], Results = {}, Output = undefined> = WorkflowBuilder<Reg, Input, Context, Steps, Results, Output>;
81
82
  export declare class WorkflowBuilder<Reg extends ActionRegistry, Input = unknown, Context = unknown, Steps extends StepDef<Reg, any, any>[] = [], Results = {}, Output = undefined> {
82
83
  private name;
83
84
  private steps;
@@ -104,8 +105,8 @@ export declare class WorkflowBuilder<Reg extends ActionRegistry, Input = unknown
104
105
  as<NewType>(): WorkflowBuilder<Reg, Input, Context, Steps, Steps extends [...infer Rest, infer Last] ? Last extends StepDef<Reg, infer ID, any> ? Simplify<Omit<Results, ID> & {
105
106
  [K in ID]: NewType;
106
107
  }> : Results : Results, Output>;
107
- parallel<Branches extends readonly WorkflowBuilder<Reg, Input, Context, any, any>[]>(...branches: {
108
- [K in keyof Branches]: (builder: WorkflowBuilder<Reg, Input, Context, [], Results>) => Branches[K];
108
+ parallel<Branches extends readonly WorkflowBuilderStatic<Reg, Input, Context, any, any>[]>(...branches: {
109
+ [K in keyof Branches]: (builder: WorkflowBuilderStatic<Reg, Input, Context, [], Results>) => Branches[K];
109
110
  }): WorkflowBuilder<Reg, Input, Context, MergeBranchSteps<Branches, Steps>, Results & MergeBranchResults<Branches>>;
110
111
  join<ID extends string = string, ActionName extends keyof Reg & string = any, ResolveOut extends ResolvedStepInput = ResolvedStepInput, BranchResults = {}>(id: ID, action: ActionName, resolve?: (ctx: {
111
112
  input: Input;
@@ -503,9 +503,6 @@
503
503
  //
504
504
  //
505
505
  //
506
- /* ------------------------------------------------ */
507
- /* FLUENT WORKFLOW BUILDER */
508
- /* ------------------------------------------------ */
509
506
  export class WorkflowBuilder {
510
507
  clearPendingWhen() {
511
508
  this.pendingWhen = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pogodisco/zephyr",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },