@wmfs/statelint 1.24.0 → 1.25.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/.releaserc.json +1 -1
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/lib/schema/StateMachine.j2119 +84 -14
- package/lib/statelint/state_node.js +113 -25
- package/package.json +8 -8
- package/test/fixtures/backoff-with-invalid-jitter-on-retry.json +17 -0
- package/test/fixtures/backoff-with-jitter-on-retry.json +17 -0
- package/test/fixtures/choice-rule-with-comment.json +19 -0
- package/test/fixtures/choice-with-context-object.json +22 -0
- package/test/fixtures/choice-with-resultselector.json +23 -0
- package/test/fixtures/fail-with-error-and-cause-path-using-intrinsic-functions.json +10 -0
- package/test/fixtures/fail-with-error-and-cause-path.json +10 -0
- package/test/fixtures/fail-with-resultselector.json +13 -0
- package/test/fixtures/fail-with-static-and-dynamic-cause.json +10 -0
- package/test/fixtures/fail-with-static-and-dynamic-error.json +10 -0
- package/test/fixtures/invalid-backoff-with-jitter-on-retry.json +17 -0
- package/test/fixtures/invalid-function-invocation.json +13 -0
- package/test/fixtures/map-with-itemprocessor-and-iterator.json +30 -0
- package/test/fixtures/map-with-itemprocessor.json +21 -0
- package/test/fixtures/map-with-itemspath-context-object.json +21 -0
- package/test/fixtures/map-with-null-itemspath.json +20 -0
- package/test/fixtures/map-with-parameters-and-itemselector.json +27 -0
- package/test/fixtures/map-with-parameters.json +19 -0
- package/test/fixtures/map-with-resultselector.json +24 -0
- package/test/fixtures/parallel-with-resultselector.json +25 -0
- package/test/fixtures/pass-with-intrinsic-function-inputpath.json +12 -0
- package/test/fixtures/pass-with-io-path-context-object.json +13 -0
- package/test/fixtures/pass-with-null-inputpath.json +12 -0
- package/test/fixtures/pass-with-null-outputpath.json +12 -0
- package/test/fixtures/pass-with-resultselector.json +15 -0
- package/test/fixtures/states-array-intrinsic-functions.json +19 -0
- package/test/fixtures/states-array-invocation-leftpad.json +13 -0
- package/test/fixtures/states-array-invocation.json +13 -0
- package/test/fixtures/states-encoding-decoding-intrinsic-functions.json +14 -0
- package/test/fixtures/states-format-invocation.json +13 -0
- package/test/fixtures/states-hash-intrinsic-functions.json +13 -0
- package/test/fixtures/states-json-intrinsic-functions.json +15 -0
- package/test/fixtures/states-jsontostring-invocation.json +14 -0
- package/test/fixtures/states-math-intrinsic-functions.json +14 -0
- package/test/fixtures/states-string-intrinsic-functions.json +13 -0
- package/test/fixtures/states-stringtojson-invocation.json +13 -0
- package/test/fixtures/states-uuid-intrinsic-functions.json +13 -0
- package/test/fixtures/succeed-with-comment-in-catcher.json +23 -0
- package/test/fixtures/succeed-with-resultselector.json +13 -0
- package/test/fixtures/task-with-credentials.json +13 -0
- package/test/fixtures/task-with-dynamic-timeouts.json +13 -0
- package/test/fixtures/task-with-invalid-credentials.json +11 -0
- package/test/fixtures/task-with-resultselector.json +15 -0
- package/test/fixtures/task-with-static-and-dynamic-heartbeat.json +13 -0
- package/test/fixtures/task-with-static-and-dynamic-timeout.json +13 -0
- package/test/fixtures/wait-with-resultselector.json +15 -0
- package/test/statelint_test.js +230 -157
|
@@ -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,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,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,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,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
|
+
}
|