From 6e91a84798c985908fc32734f78c512ac575e2cb Mon Sep 17 00:00:00 2001 From: markford Date: Tue, 20 Aug 2024 16:53:29 -0400 Subject: [PATCH] fix: bump version of path validator to support current value expr --- package-lock.json | 14 +++---- package.json | 2 +- .../valid-current-value-predicate.json | 40 +++++++++++++++++++ 3 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 src/__tests__/definitions/valid-current-value-predicate.json diff --git a/package-lock.json b/package-lock.json index 8ba053d..d43a5e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "ajv": "^8.12.0", - "asl-path-validator": "^0.12.0", + "asl-path-validator": "^0.13.0", "commander": "^10.0.1", "jsonpath-plus": "^7.2.0", "yaml": "^2.3.1" @@ -2789,9 +2789,9 @@ } }, "node_modules/asl-path-validator": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/asl-path-validator/-/asl-path-validator-0.12.0.tgz", - "integrity": "sha512-pzBX2mKp8NQ7p1xM6sfSd2vFQJDX0UdUCun/YcRKMNSv7j93erTomK7iIU79N5rjJD++kPr9qwWhA67pFVpdhA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/asl-path-validator/-/asl-path-validator-0.13.0.tgz", + "integrity": "sha512-A1me0H6HFBIm4b1p3gtSL2N0rMxK0yCz/5YAIpeQixhIMaSQynjKCS+3Q7NNdI/K8sjGe12nU3RrJ77RKtvQYA==", "dependencies": { "jsonpath-plus": "^7.0.0" } @@ -14555,9 +14555,9 @@ "dev": true }, "asl-path-validator": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/asl-path-validator/-/asl-path-validator-0.12.0.tgz", - "integrity": "sha512-pzBX2mKp8NQ7p1xM6sfSd2vFQJDX0UdUCun/YcRKMNSv7j93erTomK7iIU79N5rjJD++kPr9qwWhA67pFVpdhA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/asl-path-validator/-/asl-path-validator-0.13.0.tgz", + "integrity": "sha512-A1me0H6HFBIm4b1p3gtSL2N0rMxK0yCz/5YAIpeQixhIMaSQynjKCS+3Q7NNdI/K8sjGe12nU3RrJ77RKtvQYA==", "requires": { "jsonpath-plus": "^7.0.0" } diff --git a/package.json b/package.json index eda2b94..b810843 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "homepage": "https://github.com/ChristopheBougere/asl-validator#readme", "dependencies": { "ajv": "^8.12.0", - "asl-path-validator": "^0.12.0", + "asl-path-validator": "^0.13.0", "commander": "^10.0.1", "jsonpath-plus": "^7.2.0", "yaml": "^2.3.1" diff --git a/src/__tests__/definitions/valid-current-value-predicate.json b/src/__tests__/definitions/valid-current-value-predicate.json new file mode 100644 index 0000000..1388f62 --- /dev/null +++ b/src/__tests__/definitions/valid-current-value-predicate.json @@ -0,0 +1,40 @@ +{ + "StartAt": "Mock Service Catalog Describe Record", + "States": { + "Mock Service Catalog Describe Record": { + "Type": "Pass", + "Parameters": { + "DescribeRecord": { + "RecordDetail": { + "RecordId": "rec-abcdefghijklm", + "Status": "SUCCEEDED", + "COMMENT": "there are more properties, limited for brevity" + }, + "RecordOutputs": [ + { + "Description": "Foo Bar", + "OutputKey": "FooBar", + "OutputValue": "0123456789" + }, + { + "Description": "Fizz Buzz", + "OutputKey": "FizzBuzz", + "OutputValue": "fizzbuzz@example.com" + } + ] + } + }, + "ResultPath": "$", + "Next": "Get Record Outputs" + }, + "Get Record Outputs": { + "Type": "Pass", + "Parameters": { + "FooBar.$": "States.ArrayGetItem($.DescribeRecord.RecordOutputs[?(@.OutputKey == FooBar)].OutputValue, 0)", + "FizzBuzz.$": "States.ArrayGetItem($.DescribeRecord.RecordOutputs[?(@.OutputKey == FizzBuzz)].OutputValue, 0)" + }, + "ResultPath": "$", + "End": true + } + } +}