@lunnoa/client 2.4.0 → 2.5.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/react.d.cts CHANGED
@@ -829,6 +829,24 @@ interface components {
829
829
  name?: string;
830
830
  /** @description Step description. */
831
831
  description?: string;
832
+ /** @description Branches after this step. Only on flow-control_action_conditional-paths, flow-control_action_manually-decide-paths, or flow-control_action_request-approval (approved path first, then rejected), and only on the last step of a list. */
833
+ paths?: components["schemas"]["UpsertWorkflowPathDto"][];
834
+ };
835
+ UpsertWorkflowPathConditionDto: {
836
+ /** @description One step reference, e.g. ={{step:load,amount}}. */
837
+ field: string;
838
+ /** @description contains, does_not_contain, equals, does_not_equal, exists, does_not_exist, starts_with, ends_with, is_empty, is_not_empty, comes_before, comes_after, is_in_the_past, is_in_the_future, is_true, is_false, is_truthy, is_falsey, is_greater_than, is_less_than, is_greater_than_or_equal_to, is_less_than_or_equal_to, matches_regex, does_not_match_regex. */
839
+ condition: string;
840
+ /** @description Value to compare with. */
841
+ value?: string;
842
+ };
843
+ UpsertWorkflowPathDto: {
844
+ /** @description Path label, unique on its step. */
845
+ label: string;
846
+ /** @description Conditional Paths only. Groups are OR-ed, conditions inside a group AND-ed. Omit to always take this path. */
847
+ when?: components["schemas"]["UpsertWorkflowPathConditionDto"][][];
848
+ /** @description Steps on this path. */
849
+ steps: components["schemas"]["UpsertWorkflowStepDto"][];
832
850
  };
833
851
  UpsertWorkflowTriggerInputFieldDto: {
834
852
  /** @description Field id. Callers pass this key to workflows.execute. */
@@ -878,7 +896,7 @@ interface components {
878
896
  isActive?: boolean;
879
897
  /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
880
898
  trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
881
- /** @description Linear catalogue-action steps (v1; no branches). */
899
+ /** @description Catalogue-action steps in order. The last step may branch with `paths`. */
882
900
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
883
901
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
884
902
  managedByCode?: boolean;
@@ -2778,6 +2796,32 @@ interface WorkflowStepDefinition {
2778
2796
  /** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
2779
2797
  input?: Record<string, unknown>;
2780
2798
  name?: string;
2799
+ /**
2800
+ * Branches after this step. Only on Conditional Paths, Manually Decide Path,
2801
+ * or Request Approval (approved path first, then rejected), and only on the
2802
+ * last step of a list. Put later steps inside each path.
2803
+ */
2804
+ paths?: WorkflowPathDefinition[];
2805
+ }
2806
+ /** Conditions Conditional Paths evaluates (same list as the builder). */
2807
+ declare const PATH_CONDITIONS: readonly ["contains", "does_not_contain", "equals", "does_not_equal", "exists", "does_not_exist", "starts_with", "ends_with", "is_empty", "is_not_empty", "comes_before", "comes_after", "is_in_the_past", "is_in_the_future", "is_true", "is_false", "is_truthy", "is_falsey", "is_greater_than", "is_less_than", "is_greater_than_or_equal_to", "is_less_than_or_equal_to", "matches_regex", "does_not_match_regex"];
2808
+ type PathConditionType = (typeof PATH_CONDITIONS)[number];
2809
+ interface PathCondition {
2810
+ /** One reference: `ref.trigger(...)` or `ref.step(...)`. */
2811
+ field: string;
2812
+ condition: PathConditionType;
2813
+ /** Compared as text. Omit for exists / is_empty / is_true and similar. */
2814
+ value?: string;
2815
+ }
2816
+ interface WorkflowPathDefinition {
2817
+ /** Unique on its step. On Request Approval use `Approved` / `Rejected`. */
2818
+ label: string;
2819
+ /**
2820
+ * Conditional Paths only. Groups are OR-ed, conditions in a group AND-ed.
2821
+ * Omit to always take this path.
2822
+ */
2823
+ when?: PathCondition[][];
2824
+ steps: WorkflowStepDefinition[];
2781
2825
  }
2782
2826
  interface WorkflowDefinition {
2783
2827
  kind: typeof DEFINE_KINDS.workflow;
@@ -2791,7 +2835,7 @@ interface WorkflowDefinition {
2791
2835
  * `runs.start` ignores this and runs the steps only.
2792
2836
  */
2793
2837
  trigger?: TriggerDefinition;
2794
- /** Linear steps (v1; no branches). */
2838
+ /** Steps in order. The last step may branch with `paths`. */
2795
2839
  steps: WorkflowStepDefinition[];
2796
2840
  }
2797
2841
  type AgentToolDefinition = ActionDefinition | WorkflowDefinition | {
@@ -3564,6 +3608,13 @@ interface UpsertWorkflowStepInput {
3564
3608
  input?: Record<string, unknown>;
3565
3609
  name?: string;
3566
3610
  description?: string;
3611
+ /** Branches after this step (last step of a list only). */
3612
+ paths?: UpsertWorkflowPathInput[];
3613
+ }
3614
+ interface UpsertWorkflowPathInput {
3615
+ label: string;
3616
+ when?: WorkflowPathDefinition['when'];
3617
+ steps: UpsertWorkflowStepInput[];
3567
3618
  }
3568
3619
  interface UpsertWorkflowTriggerInput {
3569
3620
  triggerId: string;
package/dist/react.d.ts CHANGED
@@ -829,6 +829,24 @@ interface components {
829
829
  name?: string;
830
830
  /** @description Step description. */
831
831
  description?: string;
832
+ /** @description Branches after this step. Only on flow-control_action_conditional-paths, flow-control_action_manually-decide-paths, or flow-control_action_request-approval (approved path first, then rejected), and only on the last step of a list. */
833
+ paths?: components["schemas"]["UpsertWorkflowPathDto"][];
834
+ };
835
+ UpsertWorkflowPathConditionDto: {
836
+ /** @description One step reference, e.g. ={{step:load,amount}}. */
837
+ field: string;
838
+ /** @description contains, does_not_contain, equals, does_not_equal, exists, does_not_exist, starts_with, ends_with, is_empty, is_not_empty, comes_before, comes_after, is_in_the_past, is_in_the_future, is_true, is_false, is_truthy, is_falsey, is_greater_than, is_less_than, is_greater_than_or_equal_to, is_less_than_or_equal_to, matches_regex, does_not_match_regex. */
839
+ condition: string;
840
+ /** @description Value to compare with. */
841
+ value?: string;
842
+ };
843
+ UpsertWorkflowPathDto: {
844
+ /** @description Path label, unique on its step. */
845
+ label: string;
846
+ /** @description Conditional Paths only. Groups are OR-ed, conditions inside a group AND-ed. Omit to always take this path. */
847
+ when?: components["schemas"]["UpsertWorkflowPathConditionDto"][][];
848
+ /** @description Steps on this path. */
849
+ steps: components["schemas"]["UpsertWorkflowStepDto"][];
832
850
  };
833
851
  UpsertWorkflowTriggerInputFieldDto: {
834
852
  /** @description Field id. Callers pass this key to workflows.execute. */
@@ -878,7 +896,7 @@ interface components {
878
896
  isActive?: boolean;
879
897
  /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
880
898
  trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
881
- /** @description Linear catalogue-action steps (v1; no branches). */
899
+ /** @description Catalogue-action steps in order. The last step may branch with `paths`. */
882
900
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
883
901
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
884
902
  managedByCode?: boolean;
@@ -2778,6 +2796,32 @@ interface WorkflowStepDefinition {
2778
2796
  /** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
2779
2797
  input?: Record<string, unknown>;
2780
2798
  name?: string;
2799
+ /**
2800
+ * Branches after this step. Only on Conditional Paths, Manually Decide Path,
2801
+ * or Request Approval (approved path first, then rejected), and only on the
2802
+ * last step of a list. Put later steps inside each path.
2803
+ */
2804
+ paths?: WorkflowPathDefinition[];
2805
+ }
2806
+ /** Conditions Conditional Paths evaluates (same list as the builder). */
2807
+ declare const PATH_CONDITIONS: readonly ["contains", "does_not_contain", "equals", "does_not_equal", "exists", "does_not_exist", "starts_with", "ends_with", "is_empty", "is_not_empty", "comes_before", "comes_after", "is_in_the_past", "is_in_the_future", "is_true", "is_false", "is_truthy", "is_falsey", "is_greater_than", "is_less_than", "is_greater_than_or_equal_to", "is_less_than_or_equal_to", "matches_regex", "does_not_match_regex"];
2808
+ type PathConditionType = (typeof PATH_CONDITIONS)[number];
2809
+ interface PathCondition {
2810
+ /** One reference: `ref.trigger(...)` or `ref.step(...)`. */
2811
+ field: string;
2812
+ condition: PathConditionType;
2813
+ /** Compared as text. Omit for exists / is_empty / is_true and similar. */
2814
+ value?: string;
2815
+ }
2816
+ interface WorkflowPathDefinition {
2817
+ /** Unique on its step. On Request Approval use `Approved` / `Rejected`. */
2818
+ label: string;
2819
+ /**
2820
+ * Conditional Paths only. Groups are OR-ed, conditions in a group AND-ed.
2821
+ * Omit to always take this path.
2822
+ */
2823
+ when?: PathCondition[][];
2824
+ steps: WorkflowStepDefinition[];
2781
2825
  }
2782
2826
  interface WorkflowDefinition {
2783
2827
  kind: typeof DEFINE_KINDS.workflow;
@@ -2791,7 +2835,7 @@ interface WorkflowDefinition {
2791
2835
  * `runs.start` ignores this and runs the steps only.
2792
2836
  */
2793
2837
  trigger?: TriggerDefinition;
2794
- /** Linear steps (v1; no branches). */
2838
+ /** Steps in order. The last step may branch with `paths`. */
2795
2839
  steps: WorkflowStepDefinition[];
2796
2840
  }
2797
2841
  type AgentToolDefinition = ActionDefinition | WorkflowDefinition | {
@@ -3564,6 +3608,13 @@ interface UpsertWorkflowStepInput {
3564
3608
  input?: Record<string, unknown>;
3565
3609
  name?: string;
3566
3610
  description?: string;
3611
+ /** Branches after this step (last step of a list only). */
3612
+ paths?: UpsertWorkflowPathInput[];
3613
+ }
3614
+ interface UpsertWorkflowPathInput {
3615
+ label: string;
3616
+ when?: WorkflowPathDefinition['when'];
3617
+ steps: UpsertWorkflowStepInput[];
3567
3618
  }
3568
3619
  interface UpsertWorkflowTriggerInput {
3569
3620
  triggerId: string;
package/dist/react.js CHANGED
@@ -584,6 +584,33 @@ var ActionsResource = class {
584
584
  var DEFINE_KINDS = {
585
585
  action: "action",
586
586
  workflow: "workflow"};
587
+ var PATH_CONDITIONS = [
588
+ "contains",
589
+ "does_not_contain",
590
+ "equals",
591
+ "does_not_equal",
592
+ "exists",
593
+ "does_not_exist",
594
+ "starts_with",
595
+ "ends_with",
596
+ "is_empty",
597
+ "is_not_empty",
598
+ "comes_before",
599
+ "comes_after",
600
+ "is_in_the_past",
601
+ "is_in_the_future",
602
+ "is_true",
603
+ "is_false",
604
+ "is_truthy",
605
+ "is_falsey",
606
+ "is_greater_than",
607
+ "is_less_than",
608
+ "is_greater_than_or_equal_to",
609
+ "is_less_than_or_equal_to",
610
+ "matches_regex",
611
+ "does_not_match_regex"
612
+ ];
613
+ new Set(PATH_CONDITIONS);
587
614
  function resolveActionAppId(action) {
588
615
  if (action.appId?.trim()) {
589
616
  return action.appId.trim();
@@ -1843,6 +1870,11 @@ function stepFromDefinition(step) {
1843
1870
  ...step.name ? { name: step.name } : {}
1844
1871
  };
1845
1872
  }
1873
+ if (step.paths?.length) {
1874
+ throw new Error(
1875
+ "runs.start runs straight lines only. Deploy workflows with paths, then execute them."
1876
+ );
1877
+ }
1846
1878
  const use = step.use;
1847
1879
  const input = {
1848
1880
  ...use.input ?? {},
@@ -2075,7 +2107,14 @@ function stepToUpsertInput(step) {
2075
2107
  ...step.input ?? {}
2076
2108
  },
2077
2109
  name: step.name ?? use.name,
2078
- description: use.description
2110
+ description: use.description,
2111
+ ...step.paths?.length ? {
2112
+ paths: step.paths.map((path) => ({
2113
+ label: path.label,
2114
+ ...path.when ? { when: path.when } : {},
2115
+ steps: path.steps.map(stepToUpsertInput)
2116
+ }))
2117
+ } : {}
2079
2118
  };
2080
2119
  }
2081
2120
  function workflowDefinitionToUpsert(def) {