asl-path-validator
Advanced tools
Comparing version 0.14.2 to 0.15.0
@@ -7,2 +7,3 @@ import type Ajv from "ajv"; | ||
payload_template: string; | ||
result_path: string; | ||
}; | ||
@@ -16,2 +17,3 @@ silent: boolean; | ||
payload_template: string; | ||
result_path: string; | ||
}; | ||
@@ -18,0 +20,0 @@ silent: boolean; |
@@ -11,2 +11,3 @@ "use strict"; | ||
[types_1.AslPathContext.PAYLOAD_TEMPLATE]: "asl_payload_template", | ||
[types_1.AslPathContext.RESULT_PATH]: "asl_result_path", | ||
}, | ||
@@ -32,4 +33,7 @@ silent: true, | ||
}); | ||
ajv.addFormat(config.format_names[types_1.AslPathContext.RESULT_PATH], (path) => { | ||
return validateAdapter(path, types_1.AslPathContext.RESULT_PATH); | ||
}); | ||
}; | ||
exports.registerAll = registerAll; | ||
//# sourceMappingURL=ajv.js.map |
export declare const referencePathChecks: (ast: unknown) => boolean; | ||
export declare const hasFunctions: (ast: unknown) => boolean; | ||
export declare const hasVariable: (ast: unknown) => boolean; | ||
//# sourceMappingURL=ast.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasFunctions = exports.referencePathChecks = void 0; | ||
exports.hasVariable = exports.hasFunctions = exports.referencePathChecks = void 0; | ||
const jsonpath_plus_1 = require("jsonpath-plus"); | ||
@@ -20,2 +20,6 @@ const find = (path, ast) => { | ||
exports.hasFunctions = hasFunctions; | ||
const hasVariable = (ast) => { | ||
return find("$..[var]", ast); | ||
}; | ||
exports.hasVariable = hasVariable; | ||
//# sourceMappingURL=ast.js.map |
@@ -52,2 +52,3 @@ "use strict"; | ||
case types_1.AslPathContext.REFERENCE_PATH: | ||
case types_1.AslPathContext.RESULT_PATH: | ||
if ((0, ast_1.hasFunctions)(ast)) { | ||
@@ -65,2 +66,10 @@ return { | ||
} | ||
if (context === types_1.AslPathContext.RESULT_PATH) { | ||
if ((0, ast_1.hasVariable)(ast)) { | ||
return { | ||
isValid: false, | ||
code: types_1.ErrorCodes.exp_has_variable, | ||
}; | ||
} | ||
} | ||
break; | ||
@@ -67,0 +76,0 @@ default: { |
export declare enum AslPathContext { | ||
PATH = "path", | ||
REFERENCE_PATH = "reference_path", | ||
RESULT_PATH = "result_path", | ||
PAYLOAD_TEMPLATE = "payload_template" | ||
@@ -9,2 +10,3 @@ } | ||
exp_has_functions = "exp_has_functions", | ||
exp_has_variable = "exp_has_variable", | ||
exp_has_non_reference_path_ops = "exp_has_non_reference_path_ops" | ||
@@ -11,0 +13,0 @@ } |
@@ -8,2 +8,3 @@ "use strict"; | ||
AslPathContext["REFERENCE_PATH"] = "reference_path"; | ||
AslPathContext["RESULT_PATH"] = "result_path"; | ||
AslPathContext["PAYLOAD_TEMPLATE"] = "payload_template"; | ||
@@ -15,4 +16,5 @@ })(AslPathContext = exports.AslPathContext || (exports.AslPathContext = {})); | ||
ErrorCodes["exp_has_functions"] = "exp_has_functions"; | ||
ErrorCodes["exp_has_variable"] = "exp_has_variable"; | ||
ErrorCodes["exp_has_non_reference_path_ops"] = "exp_has_non_reference_path_ops"; | ||
})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "asl-path-validator", | ||
"version": "0.14.2", | ||
"version": "0.15.0", | ||
"description": "Validates the path expressions for the Amazon States Language", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
266776
5021