@wmfs/statelint 1.24.0 → 1.26.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.
Files changed (53) hide show
  1. package/.releaserc.json +1 -1
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +1 -1
  4. package/lib/schema/StateMachine.j2119 +84 -14
  5. package/lib/statelint/state_node.js +113 -25
  6. package/package.json +8 -8
  7. package/test/fixtures/backoff-with-invalid-jitter-on-retry.json +17 -0
  8. package/test/fixtures/backoff-with-jitter-on-retry.json +17 -0
  9. package/test/fixtures/choice-rule-with-comment.json +19 -0
  10. package/test/fixtures/choice-with-context-object.json +22 -0
  11. package/test/fixtures/choice-with-resultselector.json +23 -0
  12. package/test/fixtures/fail-with-error-and-cause-path-using-intrinsic-functions.json +10 -0
  13. package/test/fixtures/fail-with-error-and-cause-path.json +10 -0
  14. package/test/fixtures/fail-with-resultselector.json +13 -0
  15. package/test/fixtures/fail-with-static-and-dynamic-cause.json +10 -0
  16. package/test/fixtures/fail-with-static-and-dynamic-error.json +10 -0
  17. package/test/fixtures/invalid-backoff-with-jitter-on-retry.json +17 -0
  18. package/test/fixtures/invalid-function-invocation.json +13 -0
  19. package/test/fixtures/map-with-itemprocessor-and-iterator.json +30 -0
  20. package/test/fixtures/map-with-itemprocessor.json +21 -0
  21. package/test/fixtures/map-with-itemspath-context-object.json +21 -0
  22. package/test/fixtures/map-with-null-itemspath.json +20 -0
  23. package/test/fixtures/map-with-parameters-and-itemselector.json +27 -0
  24. package/test/fixtures/map-with-parameters.json +19 -0
  25. package/test/fixtures/map-with-resultselector.json +24 -0
  26. package/test/fixtures/parallel-with-resultselector.json +25 -0
  27. package/test/fixtures/pass-with-intrinsic-function-inputpath.json +12 -0
  28. package/test/fixtures/pass-with-io-path-context-object.json +13 -0
  29. package/test/fixtures/pass-with-null-inputpath.json +12 -0
  30. package/test/fixtures/pass-with-null-outputpath.json +12 -0
  31. package/test/fixtures/pass-with-resultselector.json +15 -0
  32. package/test/fixtures/states-array-intrinsic-functions.json +19 -0
  33. package/test/fixtures/states-array-invocation-leftpad.json +13 -0
  34. package/test/fixtures/states-array-invocation.json +13 -0
  35. package/test/fixtures/states-encoding-decoding-intrinsic-functions.json +14 -0
  36. package/test/fixtures/states-format-invocation.json +13 -0
  37. package/test/fixtures/states-hash-intrinsic-functions.json +13 -0
  38. package/test/fixtures/states-json-intrinsic-functions.json +15 -0
  39. package/test/fixtures/states-jsontostring-invocation.json +14 -0
  40. package/test/fixtures/states-math-intrinsic-functions.json +14 -0
  41. package/test/fixtures/states-string-intrinsic-functions.json +13 -0
  42. package/test/fixtures/states-stringtojson-invocation.json +13 -0
  43. package/test/fixtures/states-uuid-intrinsic-functions.json +13 -0
  44. package/test/fixtures/succeed-with-comment-in-catcher.json +23 -0
  45. package/test/fixtures/succeed-with-resultselector.json +13 -0
  46. package/test/fixtures/task-with-credentials.json +13 -0
  47. package/test/fixtures/task-with-dynamic-timeouts.json +13 -0
  48. package/test/fixtures/task-with-invalid-credentials.json +11 -0
  49. package/test/fixtures/task-with-resultselector.json +15 -0
  50. package/test/fixtures/task-with-static-and-dynamic-heartbeat.json +13 -0
  51. package/test/fixtures/task-with-static-and-dynamic-timeout.json +13 -0
  52. package/test/fixtures/wait-with-resultselector.json +15 -0
  53. package/test/statelint_test.js +230 -157
@@ -0,0 +1,30 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "ItemProcessor": {
7
+ "ProcessorConfig": {
8
+ "Mode": "INLINE"
9
+ },
10
+ "StartAt": "y",
11
+ "States": {
12
+ "y": {
13
+ "Type": "Pass",
14
+ "End": true
15
+ }
16
+ }
17
+ },
18
+ "Iterator": {
19
+ "StartAt": "x",
20
+ "States": {
21
+ "x": {
22
+ "Type": "Pass",
23
+ "End": true
24
+ }
25
+ }
26
+ },
27
+ "End": true
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "ItemProcessor": {
7
+ "ProcessorConfig": {
8
+ "Mode": "INLINE"
9
+ },
10
+ "StartAt": "x",
11
+ "States": {
12
+ "x": {
13
+ "Type": "Pass",
14
+ "End": true
15
+ }
16
+ }
17
+ },
18
+ "End": true
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "ItemsPath": "$$.mapItems",
7
+ "Iterator": {
8
+ "StartAt": "x",
9
+ "States": {
10
+ "x": {
11
+ "Type": "Pass",
12
+ "End": true
13
+ }
14
+ }
15
+ },
16
+ "Parameters": "$.foo",
17
+ "End": true
18
+ }
19
+ }
20
+ }
21
+
@@ -0,0 +1,20 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "ItemsPath": null,
7
+ "Iterator": {
8
+ "StartAt": "x",
9
+ "States": {
10
+ "x": {
11
+ "Type": "Pass",
12
+ "End": true
13
+ }
14
+ }
15
+ },
16
+ "Parameters": "$.foo",
17
+ "End": true
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "Parameters": {
7
+ "foo.$": "$.bar"
8
+ },
9
+ "ItemSelector": {
10
+ "foo.$": "$.bar"
11
+ },
12
+ "ItemProcessor": {
13
+ "ProcessorConfig": {
14
+ "Mode": "INLINE"
15
+ },
16
+ "StartAt": "x",
17
+ "States": {
18
+ "x": {
19
+ "Type": "Pass",
20
+ "End": true
21
+ }
22
+ }
23
+ },
24
+ "End": true
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "Iterator": {
7
+ "StartAt": "x",
8
+ "States": {
9
+ "x": {
10
+ "Type": "Pass",
11
+ "End": true
12
+ }
13
+ }
14
+ },
15
+ "Parameters": "$.foo",
16
+ "End": true
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "StartAt": "m",
3
+ "States": {
4
+ "m": {
5
+ "Type": "Map",
6
+ "Iterator": {
7
+ "StartAt": "x",
8
+ "States": {
9
+ "x": {
10
+ "Type": "Pass",
11
+ "End": true
12
+ }
13
+ }
14
+ },
15
+ "Parameters": "$.foo",
16
+ "ResultSelector": {
17
+ "a": "x",
18
+ "b.$": "$.y",
19
+ "c.$": "$$.z"
20
+ },
21
+ "End": true
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Parallel",
6
+ "Branches": [
7
+ {
8
+ "StartAt": "x",
9
+ "States": {
10
+ "x": {
11
+ "Type": "Succeed"
12
+ }
13
+ }
14
+ }
15
+ ],
16
+ "Parameters": "$.foo",
17
+ "ResultSelector": {
18
+ "a": "x",
19
+ "b.$": "$.y",
20
+ "c.$": "$$.z"
21
+ },
22
+ "End": true
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Pass",
6
+ "Result": { "foo": 1 , "bar": 2},
7
+ "InputPath": "States.Format('{} xyz {}', 1, 'def')",
8
+ "End": true
9
+ }
10
+ }
11
+ }
12
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Pass",
6
+ "Result": { "foo": 1 , "bar": 2},
7
+ "InputPath": "$$.path.inputToProcess",
8
+ "OutputPath": "$$.outputToPass",
9
+ "End": true
10
+ }
11
+ }
12
+ }
13
+
@@ -0,0 +1,12 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Pass",
6
+ "Result": { "foo": 1 , "bar": 2},
7
+ "InputPath": null,
8
+ "End": true
9
+ }
10
+ }
11
+ }
12
+
@@ -0,0 +1,12 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Pass",
6
+ "Result": { "foo": 1 , "bar": 2},
7
+ "OutputPath": null,
8
+ "End": true
9
+ }
10
+ }
11
+ }
12
+
@@ -0,0 +1,15 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Pass",
6
+ "Result": { "foo": 1 },
7
+ "ResultSelector": {
8
+ "a": "$.foo",
9
+ "b.$": "$.y",
10
+ "c.$": "$$.z"
11
+ },
12
+ "End": true
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "array.$": "States.Array('Foo', $.xyz, 'Bar', 2.3)",
9
+ "partition.$": "States.ArrayPartition($.inputArray, 4)",
10
+ "contains.$": "States.ArrayContains($.inputArray, $.lookingFor)",
11
+ "range.$": "States.ArrayRange(1, 9, 2)",
12
+ "item.$": "States.ArrayGetItem($.inputArray, $.index)",
13
+ "length.$": "States.ArrayLength($.inputArray)",
14
+ "unique.$": "States.ArrayUnique($.inputArray)"
15
+ },
16
+ "End": true
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "abc.$": " States.Array('Foo', $.xyz, 'Bar', 2.3)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "abc.$": "States.Array('Foo', $.xyz, 'Bar', 2.3)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "base64.$": "States.Base64Encode($.input)",
9
+ "data.$": "States.Base64Decode($.base64)"
10
+ },
11
+ "End": true
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "Parameters": {
8
+ "abc.$": "States.Format('{} xyz {}', 1, 'def')"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "output.$": "States.Hash($.Data, $.Algorithm)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "output.$": "States.JsonMerge($.json1, $.json2, false)",
9
+ "json.$": "States.StringToJson($.escapedJsonString)",
10
+ "string.$": "States.JsonToString($.unescapedJson)"
11
+ },
12
+ "End": true
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "Parameters": {
8
+ "abc.$": "States.JsonToString($.xyz)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
14
+
@@ -0,0 +1,14 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "random.$": "States.MathRandom($.start, $.end)",
9
+ "addition.$": "States.MathAdd($.value1, $.step)"
10
+ },
11
+ "End": true
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "array.$": "States.StringSplit($.inputString, $.splitter)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "abc.$": "States.StringToJson($.result)"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "uuid.$": "States.UUID()"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "Comment": "test",
3
+ "StartAt": "foo",
4
+ "States": {
5
+ "foo": {
6
+ "Type":"Task",
7
+ "Resource":"arn:aws:states:::lambda:invoke",
8
+ "Next": "end",
9
+ "Catch": [
10
+ {
11
+ "ErrorEquals": [
12
+ "States.ALL"
13
+ ],
14
+ "Comment": "foo",
15
+ "Next": "end"
16
+ }
17
+ ]
18
+ },
19
+ "end": {
20
+ "Type": "Fail"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Succeed",
6
+ "ResultSelector": {
7
+ "a": "x",
8
+ "b.$": "$.y",
9
+ "c.$": "$$.z"
10
+ }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "Credentials": {
8
+ "roleArn": "fizz:buzz"
9
+ },
10
+ "End": true
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "TimeoutSecondsPath": "$.x",
8
+ "HeartbeatSecondsPath": "$.y",
9
+ "End": true
10
+ }
11
+ }
12
+ }
13
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "Credentials": "foo:bar",
8
+ "End": true
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "ResultSelector": {
8
+ "a": "x",
9
+ "b.$": "$.y",
10
+ "c.$": "$$.z"
11
+ },
12
+ "End": true
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "HeartbeatSeconds": 30,
8
+ "HeartbeatSecondsPath": "$.abc",
9
+ "End": true
10
+ }
11
+ }
12
+ }
13
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Task",
6
+ "Resource": "foo:bar",
7
+ "TimeoutSeconds": 30,
8
+ "TimeoutSecondsPath": "$.abc",
9
+ "End": true
10
+ }
11
+ }
12
+ }
13
+
@@ -0,0 +1,15 @@
1
+ {
2
+ "StartAt": "p",
3
+ "States": {
4
+ "p": {
5
+ "Type": "Wait",
6
+ "Seconds": 1,
7
+ "ResultSelector": {
8
+ "a": "x",
9
+ "b.$": "$.y",
10
+ "c.$": "$$.z"
11
+ },
12
+ "End": true
13
+ }
14
+ }
15
+ }