@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.cjs CHANGED
@@ -586,6 +586,33 @@ var ActionsResource = class {
586
586
  var DEFINE_KINDS = {
587
587
  action: "action",
588
588
  workflow: "workflow"};
589
+ var PATH_CONDITIONS = [
590
+ "contains",
591
+ "does_not_contain",
592
+ "equals",
593
+ "does_not_equal",
594
+ "exists",
595
+ "does_not_exist",
596
+ "starts_with",
597
+ "ends_with",
598
+ "is_empty",
599
+ "is_not_empty",
600
+ "comes_before",
601
+ "comes_after",
602
+ "is_in_the_past",
603
+ "is_in_the_future",
604
+ "is_true",
605
+ "is_false",
606
+ "is_truthy",
607
+ "is_falsey",
608
+ "is_greater_than",
609
+ "is_less_than",
610
+ "is_greater_than_or_equal_to",
611
+ "is_less_than_or_equal_to",
612
+ "matches_regex",
613
+ "does_not_match_regex"
614
+ ];
615
+ new Set(PATH_CONDITIONS);
589
616
  function resolveActionAppId(action) {
590
617
  if (action.appId?.trim()) {
591
618
  return action.appId.trim();
@@ -1845,6 +1872,11 @@ function stepFromDefinition(step) {
1845
1872
  ...step.name ? { name: step.name } : {}
1846
1873
  };
1847
1874
  }
1875
+ if (step.paths?.length) {
1876
+ throw new Error(
1877
+ "runs.start runs straight lines only. Deploy workflows with paths, then execute them."
1878
+ );
1879
+ }
1848
1880
  const use = step.use;
1849
1881
  const input = {
1850
1882
  ...use.input ?? {},
@@ -2077,7 +2109,14 @@ function stepToUpsertInput(step) {
2077
2109
  ...step.input ?? {}
2078
2110
  },
2079
2111
  name: step.name ?? use.name,
2080
- description: use.description
2112
+ description: use.description,
2113
+ ...step.paths?.length ? {
2114
+ paths: step.paths.map((path) => ({
2115
+ label: path.label,
2116
+ ...path.when ? { when: path.when } : {},
2117
+ steps: path.steps.map(stepToUpsertInput)
2118
+ }))
2119
+ } : {}
2081
2120
  };
2082
2121
  }
2083
2122
  function workflowDefinitionToUpsert(def) {