@scalar/openapi-parser 0.10.16 → 0.11.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/CHANGELOG.md +17 -0
- package/README.md +0 -27
- package/dist/configuration/index.js +19 -22
- package/dist/configuration/index.js.map +7 -0
- package/dist/declarations.d.js +1 -0
- package/dist/declarations.d.js.map +7 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -29
- package/dist/index.js.map +7 -0
- package/dist/lib/Validator/Validator.d.ts +2 -2
- package/dist/lib/Validator/Validator.d.ts.map +1 -1
- package/dist/lib/Validator/Validator.js +99 -119
- package/dist/lib/Validator/Validator.js.map +7 -0
- package/dist/lib/Validator/Validator.test.js +8 -0
- package/dist/lib/Validator/Validator.test.js.map +7 -0
- package/dist/lib/Validator/index.d.ts +2 -2
- package/dist/lib/Validator/index.d.ts.map +1 -1
- package/dist/lib/Validator/index.js +3 -0
- package/dist/lib/Validator/index.js.map +7 -0
- package/dist/plugins/fetch-urls/fetchUrls.d.ts +1 -1
- package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -1
- package/dist/plugins/fetch-urls/fetchUrls.js +36 -39
- package/dist/plugins/fetch-urls/fetchUrls.js.map +7 -0
- package/dist/plugins/fetch-urls/fetchUrls.test.js +50 -0
- package/dist/plugins/fetch-urls/fetchUrls.test.js.map +7 -0
- package/dist/plugins/fetch-urls/index.d.ts +1 -1
- package/dist/plugins/fetch-urls/index.d.ts.map +1 -1
- package/dist/plugins/fetch-urls/index.js +2 -1
- package/dist/plugins/fetch-urls/index.js.map +7 -0
- package/dist/plugins/read-files/index.d.ts +1 -1
- package/dist/plugins/read-files/index.d.ts.map +1 -1
- package/dist/plugins/read-files/index.js +2 -1
- package/dist/plugins/read-files/index.js.map +7 -0
- package/dist/plugins/read-files/readFiles.d.ts +1 -1
- package/dist/plugins/read-files/readFiles.d.ts.map +1 -1
- package/dist/plugins/read-files/readFiles.js +50 -55
- package/dist/plugins/read-files/readFiles.js.map +7 -0
- package/dist/plugins/read-files/readFiles.test.js +20 -0
- package/dist/plugins/read-files/readFiles.test.js.map +7 -0
- package/dist/polyfills/index.d.ts +1 -1
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +5 -0
- package/dist/polyfills/index.js.map +7 -0
- package/dist/polyfills/path.js +155 -98
- package/dist/polyfills/path.js.map +7 -0
- package/dist/schemas/v2.0/schema.d.ts +1405 -0
- package/dist/schemas/v2.0/schema.d.ts.map +1 -0
- package/dist/schemas/v2.0/schema.js +1463 -0
- package/dist/schemas/v2.0/schema.js.map +7 -0
- package/dist/schemas/v3.0/schema.d.ts +1264 -0
- package/dist/schemas/v3.0/schema.d.ts.map +1 -0
- package/dist/schemas/v3.0/schema.js +1493 -0
- package/dist/schemas/v3.0/schema.js.map +7 -0
- package/dist/schemas/v3.1/schema.d.ts +1225 -0
- package/dist/schemas/v3.1/schema.d.ts.map +1 -0
- package/dist/schemas/v3.1/schema.js +1296 -0
- package/dist/schemas/v3.1/schema.js.map +7 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +7 -0
- package/dist/utils/betterAjvErrors/helpers.js +88 -93
- package/dist/utils/betterAjvErrors/helpers.js.map +7 -0
- package/dist/utils/betterAjvErrors/index.js +14 -13
- package/dist/utils/betterAjvErrors/index.js.map +7 -0
- package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts +2 -0
- package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/json/get-meta-from-path.js +27 -0
- package/dist/utils/betterAjvErrors/json/get-meta-from-path.js.map +7 -0
- package/dist/utils/betterAjvErrors/json/index.d.ts +2 -0
- package/dist/utils/betterAjvErrors/json/index.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/json/index.js +5 -0
- package/dist/utils/betterAjvErrors/json/index.js.map +7 -0
- package/dist/utils/betterAjvErrors/json/utils.d.ts +2 -0
- package/dist/utils/betterAjvErrors/json/utils.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/json/utils.js +11 -0
- package/dist/utils/betterAjvErrors/json/utils.js.map +7 -0
- package/dist/utils/betterAjvErrors/utils.js +21 -14
- package/dist/utils/betterAjvErrors/utils.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts +10 -0
- package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js +8 -9
- package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/base.d.ts +23 -0
- package/dist/utils/betterAjvErrors/validation-errors/base.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/base.js +6 -10
- package/dist/utils/betterAjvErrors/validation-errors/base.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/default.d.ts +10 -0
- package/dist/utils/betterAjvErrors/validation-errors/default.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/default.js +8 -9
- package/dist/utils/betterAjvErrors/validation-errors/default.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts +11 -0
- package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/enum.js +19 -29
- package/dist/utils/betterAjvErrors/validation-errors/enum.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/index.d.ts +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/index.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/index.js +15 -0
- package/dist/utils/betterAjvErrors/validation-errors/index.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts +10 -0
- package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/pattern.js +8 -9
- package/dist/utils/betterAjvErrors/validation-errors/pattern.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/required.d.ts +10 -0
- package/dist/utils/betterAjvErrors/validation-errors/required.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/required.js +8 -9
- package/dist/utils/betterAjvErrors/validation-errors/required.js.map +7 -0
- package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts +10 -0
- package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts.map +1 -0
- package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js +8 -9
- package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js.map +7 -0
- package/dist/utils/dereference.d.ts +2 -2
- package/dist/utils/dereference.d.ts.map +1 -1
- package/dist/utils/dereference.js +17 -19
- package/dist/utils/dereference.js.map +7 -0
- package/dist/utils/dereference.test.js +300 -0
- package/dist/utils/dereference.test.js.map +7 -0
- package/dist/utils/details.d.ts +1 -1
- package/dist/utils/details.d.ts.map +1 -1
- package/dist/utils/details.js +26 -28
- package/dist/utils/details.js.map +7 -0
- package/dist/utils/errors.test.js +48 -0
- package/dist/utils/errors.test.js.map +7 -0
- package/dist/utils/escapeJsonPointer.js +5 -8
- package/dist/utils/escapeJsonPointer.js.map +7 -0
- package/dist/utils/escapeJsonPointer.test.js +11 -0
- package/dist/utils/escapeJsonPointer.test.js.map +7 -0
- package/dist/utils/filter.d.ts +1 -1
- package/dist/utils/filter.d.ts.map +1 -1
- package/dist/utils/filter.js +13 -15
- package/dist/utils/filter.js.map +7 -0
- package/dist/utils/getEntrypoint.d.ts +1 -1
- package/dist/utils/getEntrypoint.d.ts.map +1 -1
- package/dist/utils/getEntrypoint.js +5 -6
- package/dist/utils/getEntrypoint.js.map +7 -0
- package/dist/utils/getEntrypoint.test.js +18 -0
- package/dist/utils/getEntrypoint.test.js.map +7 -0
- package/dist/utils/getListOfReferences.d.ts +1 -1
- package/dist/utils/getListOfReferences.d.ts.map +1 -1
- package/dist/utils/getListOfReferences.js +15 -22
- package/dist/utils/getListOfReferences.js.map +7 -0
- package/dist/utils/getSegmentsFromPath.js +8 -15
- package/dist/utils/getSegmentsFromPath.js.map +7 -0
- package/dist/utils/getSegmentsFromPath.test.js +13 -0
- package/dist/utils/getSegmentsFromPath.test.js.map +7 -0
- package/dist/utils/index.d.ts +26 -26
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +27 -0
- package/dist/utils/index.js.map +7 -0
- package/dist/utils/isFilesystem.d.ts +2 -1
- package/dist/utils/isFilesystem.d.ts.map +1 -1
- package/dist/utils/isFilesystem.js +5 -9
- package/dist/utils/isFilesystem.js.map +7 -0
- package/dist/utils/isJson.js +10 -9
- package/dist/utils/isJson.js.map +7 -0
- package/dist/utils/isObject.js +5 -6
- package/dist/utils/isObject.js.map +7 -0
- package/dist/utils/isObject.test.js +23 -0
- package/dist/utils/isObject.test.js.map +7 -0
- package/dist/utils/isYaml.js +16 -17
- package/dist/utils/isYaml.js.map +7 -0
- package/dist/utils/load/index.d.ts +1 -1
- package/dist/utils/load/index.d.ts.map +1 -1
- package/dist/utils/load/index.js +2 -0
- package/dist/utils/load/index.js.map +7 -0
- package/dist/utils/load/load.d.ts +1 -1
- package/dist/utils/load/load.d.ts.map +1 -1
- package/dist/utils/load/load.js +89 -110
- package/dist/utils/load/load.js.map +7 -0
- package/dist/utils/load/load.test.js +361 -0
- package/dist/utils/load/load.test.js.map +7 -0
- package/dist/utils/makeFilesystem.d.ts +1 -1
- package/dist/utils/makeFilesystem.d.ts.map +1 -1
- package/dist/utils/makeFilesystem.js +20 -22
- package/dist/utils/makeFilesystem.js.map +7 -0
- package/dist/utils/makeFilesystem.test.js +15 -0
- package/dist/utils/makeFilesystem.test.js.map +7 -0
- package/dist/utils/normalize.d.ts +1 -1
- package/dist/utils/normalize.d.ts.map +1 -1
- package/dist/utils/normalize.js +22 -27
- package/dist/utils/normalize.js.map +7 -0
- package/dist/utils/normalize.test.js +88 -0
- package/dist/utils/normalize.test.js.map +7 -0
- package/dist/utils/openapi/actions/details.d.ts +2 -2
- package/dist/utils/openapi/actions/details.d.ts.map +1 -1
- package/dist/utils/openapi/actions/details.js +9 -11
- package/dist/utils/openapi/actions/details.js.map +7 -0
- package/dist/utils/openapi/actions/files.d.ts +1 -1
- package/dist/utils/openapi/actions/files.d.ts.map +1 -1
- package/dist/utils/openapi/actions/files.js +7 -9
- package/dist/utils/openapi/actions/files.js.map +7 -0
- package/dist/utils/openapi/actions/get.d.ts +1 -1
- package/dist/utils/openapi/actions/get.d.ts.map +1 -1
- package/dist/utils/openapi/actions/get.js +9 -11
- package/dist/utils/openapi/actions/get.js.map +7 -0
- package/dist/utils/openapi/actions/toJson.d.ts +1 -1
- package/dist/utils/openapi/actions/toJson.d.ts.map +1 -1
- package/dist/utils/openapi/actions/toJson.js +9 -11
- package/dist/utils/openapi/actions/toJson.js.map +7 -0
- package/dist/utils/openapi/actions/toYaml.d.ts +1 -1
- package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -1
- package/dist/utils/openapi/actions/toYaml.js +9 -11
- package/dist/utils/openapi/actions/toYaml.js.map +7 -0
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts +5 -5
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -1
- package/dist/utils/openapi/commands/dereferenceCommand.js +25 -27
- package/dist/utils/openapi/commands/dereferenceCommand.js.map +7 -0
- package/dist/utils/openapi/commands/filterCommand.d.ts +9 -9
- package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -1
- package/dist/utils/openapi/commands/filterCommand.js +24 -26
- package/dist/utils/openapi/commands/filterCommand.js.map +7 -0
- package/dist/utils/openapi/commands/loadCommand.d.ts +994 -994
- package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -1
- package/dist/utils/openapi/commands/loadCommand.js +40 -42
- package/dist/utils/openapi/commands/loadCommand.js.map +7 -0
- package/dist/utils/openapi/commands/upgradeCommand.d.ts +311 -311
- package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -1
- package/dist/utils/openapi/commands/upgradeCommand.js +27 -29
- package/dist/utils/openapi/commands/upgradeCommand.js.map +7 -0
- package/dist/utils/openapi/commands/validateCommand.d.ts +311 -311
- package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -1
- package/dist/utils/openapi/commands/validateCommand.js +31 -33
- package/dist/utils/openapi/commands/validateCommand.js.map +7 -0
- package/dist/utils/openapi/index.d.ts +1 -1
- package/dist/utils/openapi/index.d.ts.map +1 -1
- package/dist/utils/openapi/index.js +2 -0
- package/dist/utils/openapi/index.js.map +7 -0
- package/dist/utils/openapi/openapi.d.ts +702 -700
- package/dist/utils/openapi/openapi.d.ts.map +1 -1
- package/dist/utils/openapi/openapi.js +13 -16
- package/dist/utils/openapi/openapi.js.map +7 -0
- package/dist/utils/openapi/openapi.test-d.js +14 -0
- package/dist/utils/openapi/openapi.test-d.js.map +7 -0
- package/dist/utils/openapi/openapi.test.js +309 -0
- package/dist/utils/openapi/openapi.test.js.map +7 -0
- package/dist/utils/openapi/utils/queueTask.d.ts +1 -1
- package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -1
- package/dist/utils/openapi/utils/queueTask.js +8 -9
- package/dist/utils/openapi/utils/queueTask.js.map +7 -0
- package/dist/utils/openapi/utils/workThroughQueue.d.ts +1 -1
- package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -1
- package/dist/utils/openapi/utils/workThroughQueue.js +49 -64
- package/dist/utils/openapi/utils/workThroughQueue.js.map +7 -0
- package/dist/utils/openapi/utils/workThroughQueue.test.js +244 -0
- package/dist/utils/openapi/utils/workThroughQueue.test.js.map +7 -0
- package/dist/utils/resolveReferences.d.ts +1 -1
- package/dist/utils/resolveReferences.d.ts.map +1 -1
- package/dist/utils/resolveReferences.js +91 -139
- package/dist/utils/resolveReferences.js.map +7 -0
- package/dist/utils/resolveReferences.test.js +567 -0
- package/dist/utils/resolveReferences.test.js.map +7 -0
- package/dist/utils/toJson.d.ts +1 -1
- package/dist/utils/toJson.d.ts.map +1 -1
- package/dist/utils/toJson.js +4 -2
- package/dist/utils/toJson.js.map +7 -0
- package/dist/utils/toYaml.d.ts +1 -1
- package/dist/utils/toYaml.d.ts.map +1 -1
- package/dist/utils/toYaml.js +5 -4
- package/dist/utils/toYaml.js.map +7 -0
- package/dist/utils/transform/index.d.ts +1 -1
- package/dist/utils/transform/index.d.ts.map +1 -1
- package/dist/utils/transform/index.js +2 -0
- package/dist/utils/transform/index.js.map +7 -0
- package/dist/utils/transform/sanitize.d.ts +3 -3
- package/dist/utils/transform/sanitize.d.ts.map +1 -1
- package/dist/utils/transform/sanitize.js +22 -21
- package/dist/utils/transform/sanitize.js.map +7 -0
- package/dist/utils/transform/sanitize.test.js +148 -0
- package/dist/utils/transform/sanitize.test.js.map +7 -0
- package/dist/utils/transform/utils/addInfoObject.d.ts +1 -1
- package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
- package/dist/utils/transform/utils/addInfoObject.js +14 -10
- package/dist/utils/transform/utils/addInfoObject.js.map +7 -0
- package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts +1 -1
- package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
- package/dist/utils/transform/utils/addLatestOpenApiVersion.js +8 -5
- package/dist/utils/transform/utils/addLatestOpenApiVersion.js.map +7 -0
- package/dist/utils/transform/utils/addMissingTags.d.ts +1 -1
- package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
- package/dist/utils/transform/utils/addMissingTags.js +26 -27
- package/dist/utils/transform/utils/addMissingTags.js.map +7 -0
- package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts +1 -1
- package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
- package/dist/utils/transform/utils/normalizeSecuritySchemes.js +36 -40
- package/dist/utils/transform/utils/normalizeSecuritySchemes.js.map +7 -0
- package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts +1 -1
- package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
- package/dist/utils/transform/utils/rejectSwaggerDocuments.js +8 -6
- package/dist/utils/transform/utils/rejectSwaggerDocuments.js.map +7 -0
- package/dist/utils/transformErrors.d.ts +1 -1
- package/dist/utils/transformErrors.d.ts.map +1 -1
- package/dist/utils/transformErrors.js +18 -21
- package/dist/utils/transformErrors.js.map +7 -0
- package/dist/utils/transformErrors.test.js +17 -0
- package/dist/utils/transformErrors.test.js.map +7 -0
- package/dist/utils/traverse.d.ts +3 -3
- package/dist/utils/traverse.d.ts.map +1 -1
- package/dist/utils/traverse.js +22 -23
- package/dist/utils/traverse.js.map +7 -0
- package/dist/utils/traverse.test.js +68 -0
- package/dist/utils/traverse.test.js.map +7 -0
- package/dist/utils/unescapeJsonPointer.js +5 -9
- package/dist/utils/unescapeJsonPointer.js.map +7 -0
- package/dist/utils/unescapeJsonPointer.test.js +19 -0
- package/dist/utils/unescapeJsonPointer.test.js.map +7 -0
- package/dist/utils/upgrade.bench.d.ts +2 -0
- package/dist/utils/upgrade.bench.d.ts.map +1 -0
- package/dist/utils/upgrade.bench.js +31 -0
- package/dist/utils/upgrade.bench.js.map +7 -0
- package/dist/utils/upgrade.d.ts +1 -1
- package/dist/utils/upgrade.d.ts.map +1 -1
- package/dist/utils/upgrade.js +28 -22
- package/dist/utils/upgrade.js.map +7 -0
- package/dist/utils/upgrade.test-d.js +16 -0
- package/dist/utils/upgrade.test-d.js.map +7 -0
- package/dist/utils/upgrade.test.js +57 -0
- package/dist/utils/upgrade.test.js.map +7 -0
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts +3 -3
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +1 -1
- package/dist/utils/upgradeFromThreeToThreeOne.js +107 -144
- package/dist/utils/upgradeFromThreeToThreeOne.js.map +7 -0
- package/dist/utils/upgradeFromThreeToThreeOne.test.js +462 -0
- package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +7 -0
- package/dist/utils/upgradeFromTwoToThree.d.ts.map +1 -1
- package/dist/utils/upgradeFromTwoToThree.js +212 -219
- package/dist/utils/upgradeFromTwoToThree.js.map +7 -0
- package/dist/utils/upgradeFromTwoToThree.test.js +589 -0
- package/dist/utils/upgradeFromTwoToThree.test.js.map +7 -0
- package/dist/utils/validate.d.ts +1 -1
- package/dist/utils/validate.d.ts.map +1 -1
- package/dist/utils/validate.js +14 -16
- package/dist/utils/validate.js.map +7 -0
- package/dist/utils/validate.test.js +64 -0
- package/dist/utils/validate.test.js.map +7 -0
- package/package.json +7 -8
- package/dist/schemas/v2.0/schema.json.js +0 -1623
- package/dist/schemas/v3.0/schema.json.js +0 -1673
- package/dist/schemas/v3.1/schema.json.js +0 -1451
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class AdditionalPropValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
import BaseValidationError from './base.js';
|
|
10
|
+
//# sourceMappingURL=additional-prop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additional-prop.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/additional-prop.js"],"names":[],"mappings":"AAEA;IACE,4BAIC;IAFC,aAA2C;IAI7C;;;MAOC;CACF;gCAjB+B,QAAQ"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import BaseValidationError from
|
|
2
|
-
|
|
1
|
+
import BaseValidationError from "./base.js";
|
|
3
2
|
class AdditionalPropValidationError extends BaseValidationError {
|
|
4
3
|
constructor(...args) {
|
|
5
4
|
super(...args);
|
|
6
|
-
this.name =
|
|
5
|
+
this.name = "AdditionalPropValidationError";
|
|
7
6
|
this.options.isIdentifierLocation = true;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
getError() {
|
|
11
9
|
const { params } = this.options;
|
|
12
|
-
|
|
13
10
|
return {
|
|
14
11
|
message: `Property ${params.additionalProperty} is not expected to be here`,
|
|
15
|
-
path: this.instancePath
|
|
16
|
-
}
|
|
12
|
+
path: this.instancePath
|
|
13
|
+
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
AdditionalPropValidationError as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=additional-prop.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/additional-prop.js"],
|
|
4
|
+
"sourcesContent": ["import BaseValidationError from './base'\n\nexport default class AdditionalPropValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'AdditionalPropValidationError'\n this.options.isIdentifierLocation = true\n }\n\n getError() {\n const { params } = this.options\n\n return {\n message: `Property ${params.additionalProperty} is not expected to be here`,\n path: this.instancePath,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,yBAAyB;AAEhC,MAAO,sCAAoD,oBAAoB;AAAA,EAC7E,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ,uBAAuB;AAAA,EACtC;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,OAAO,IAAI,KAAK;AAExB,WAAO;AAAA,MACL,SAAS,YAAY,OAAO,kBAAkB;AAAA,MAC9C,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default class BaseValidationError {
|
|
2
|
+
constructor(options: {
|
|
3
|
+
isIdentifierLocation: boolean;
|
|
4
|
+
}, { data, schema, jsonAst, jsonRaw }: {
|
|
5
|
+
data: any;
|
|
6
|
+
schema: any;
|
|
7
|
+
jsonAst: any;
|
|
8
|
+
jsonRaw: any;
|
|
9
|
+
});
|
|
10
|
+
options: {
|
|
11
|
+
isIdentifierLocation: boolean;
|
|
12
|
+
};
|
|
13
|
+
data: any;
|
|
14
|
+
schema: any;
|
|
15
|
+
jsonAst: any;
|
|
16
|
+
jsonRaw: any;
|
|
17
|
+
/**
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
get instancePath(): string;
|
|
21
|
+
getError(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/base.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;OAMC;IALC;;MAAsB;IACtB,UAAgB;IAChB,YAAoB;IACpB,aAAsB;IACtB,aAAsB;IAGxB;;OAEG;IACH,2BAEC;IAED,iBAEC;CACF"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// import { codeFrameColumns } from '@babel/code-frame';
|
|
2
|
-
// import chalk from 'chalk';
|
|
3
|
-
// import { getMetaFromPath } from '../json/index'
|
|
4
|
-
|
|
5
1
|
class BaseValidationError {
|
|
6
2
|
constructor(options = { isIdentifierLocation: false }, { data, schema, jsonAst, jsonRaw }) {
|
|
7
3
|
this.options = options;
|
|
@@ -10,17 +6,17 @@ class BaseValidationError {
|
|
|
10
6
|
this.jsonAst = jsonAst;
|
|
11
7
|
this.jsonRaw = jsonRaw;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* @return {string}
|
|
16
11
|
*/
|
|
17
12
|
get instancePath() {
|
|
18
|
-
return typeof this.options.instancePath !==
|
|
13
|
+
return typeof this.options.instancePath !== "undefined" ? this.options.instancePath : this.options.dataPath;
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
getError() {
|
|
22
|
-
throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`)
|
|
16
|
+
throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`);
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
export {
|
|
20
|
+
BaseValidationError as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/base.js"],
|
|
4
|
+
"sourcesContent": ["// import { codeFrameColumns } from '@babel/code-frame';\n// import chalk from 'chalk';\n// import { getMetaFromPath } from '../json/index'\n\nexport default class BaseValidationError {\n constructor(options = { isIdentifierLocation: false }, { data, schema, jsonAst, jsonRaw }) {\n this.options = options\n this.data = data\n this.schema = schema\n this.jsonAst = jsonAst\n this.jsonRaw = jsonRaw\n }\n\n /**\n * @return {string}\n */\n get instancePath() {\n return typeof this.options.instancePath !== 'undefined' ? this.options.instancePath : this.options.dataPath\n }\n\n getError() {\n throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`)\n }\n}\n"],
|
|
5
|
+
"mappings": "AAIA,MAAO,oBAAkC;AAAA,EACvC,YAAY,UAAU,EAAE,sBAAsB,MAAM,GAAG,EAAE,MAAM,QAAQ,SAAS,QAAQ,GAAG;AACzF,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,eAAe;AACjB,WAAO,OAAO,KAAK,QAAQ,iBAAiB,cAAc,KAAK,QAAQ,eAAe,KAAK,QAAQ;AAAA,EACrG;AAAA,EAEA,WAAW;AACT,UAAM,IAAI,MAAM,0CAA0C,KAAK,YAAY,IAAI,GAAG;AAAA,EACpF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class DefaultValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
import BaseValidationError from './base.js';
|
|
10
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/default.js"],"names":[],"mappings":"AAEA;IACE,4BAIC;IAFC,aAAoC;IAItC;;;MAOC;CACF;gCAjB+B,QAAQ"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import BaseValidationError from
|
|
2
|
-
|
|
1
|
+
import BaseValidationError from "./base.js";
|
|
3
2
|
class DefaultValidationError extends BaseValidationError {
|
|
4
3
|
constructor(...args) {
|
|
5
4
|
super(...args);
|
|
6
|
-
this.name =
|
|
5
|
+
this.name = "DefaultValidationError";
|
|
7
6
|
this.options.isSkipEndLocation = true;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
getError() {
|
|
11
9
|
const { keyword, message } = this.options;
|
|
12
|
-
|
|
13
10
|
return {
|
|
14
11
|
message: `${keyword} ${message}`,
|
|
15
|
-
path: this.instancePath
|
|
16
|
-
}
|
|
12
|
+
path: this.instancePath
|
|
13
|
+
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
DefaultValidationError as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/default.js"],
|
|
4
|
+
"sourcesContent": ["import BaseValidationError from './base'\n\nexport default class DefaultValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'DefaultValidationError'\n this.options.isSkipEndLocation = true\n }\n\n getError() {\n const { keyword, message } = this.options\n\n return {\n message: `${keyword} ${message}`,\n path: this.instancePath,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,yBAAyB;AAEhC,MAAO,+BAA6C,oBAAoB;AAAA,EACtE,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ,oBAAoB;AAAA,EACnC;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,SAAS,QAAQ,IAAI,KAAK;AAElC,WAAO;AAAA,MACL,SAAS,GAAG,OAAO,IAAI,OAAO;AAAA,MAC9B,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class EnumValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
findBestMatch(): any;
|
|
9
|
+
}
|
|
10
|
+
import BaseValidationError from './base.js';
|
|
11
|
+
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/enum.js"],"names":[],"mappings":"AAKA;IACE,4BAGC;IADC,aAAiC;IAGnC;;;MAeC;IAED,qBAmBC;CACF;gCA7C+B,QAAQ"}
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import pointer from
|
|
2
|
-
import leven from
|
|
3
|
-
import BaseValidationError from
|
|
4
|
-
|
|
1
|
+
import pointer from "jsonpointer";
|
|
2
|
+
import leven from "leven";
|
|
3
|
+
import BaseValidationError from "./base.js";
|
|
5
4
|
class EnumValidationError extends BaseValidationError {
|
|
6
5
|
constructor(...args) {
|
|
7
6
|
super(...args);
|
|
8
|
-
this.name =
|
|
7
|
+
this.name = "EnumValidationError";
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
getError() {
|
|
12
10
|
const { message, params } = this.options;
|
|
13
11
|
const bestMatch = this.findBestMatch();
|
|
14
|
-
const allowedValues = params.allowedValues.join(
|
|
15
|
-
|
|
12
|
+
const allowedValues = params.allowedValues.join(", ");
|
|
16
13
|
const output = {
|
|
17
14
|
message: `${message}: ${allowedValues}`,
|
|
18
|
-
path: this.instancePath
|
|
15
|
+
path: this.instancePath
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
if (bestMatch !== null) {
|
|
22
18
|
output.suggestion = `Did you mean ${bestMatch}?`;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
return output
|
|
20
|
+
return output;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
findBestMatch() {
|
|
29
23
|
const {
|
|
30
|
-
params: { allowedValues }
|
|
24
|
+
params: { allowedValues }
|
|
31
25
|
} = this.options;
|
|
32
|
-
|
|
33
|
-
const currentValue = this.instancePath === '' ? this.data : pointer.get(this.data, this.instancePath);
|
|
34
|
-
|
|
26
|
+
const currentValue = this.instancePath === "" ? this.data : pointer.get(this.data, this.instancePath);
|
|
35
27
|
if (!currentValue) {
|
|
36
|
-
return null
|
|
28
|
+
return null;
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}))
|
|
44
|
-
.sort((x, y) => (x.weight > y.weight ? 1 : x.weight < y.weight ? -1 : 0))[0];
|
|
45
|
-
|
|
46
|
-
return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null
|
|
30
|
+
const bestMatch = allowedValues.map((value) => ({
|
|
31
|
+
value,
|
|
32
|
+
weight: leven(value, currentValue.toString())
|
|
33
|
+
})).sort((x, y) => x.weight > y.weight ? 1 : x.weight < y.weight ? -1 : 0)[0];
|
|
34
|
+
return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null;
|
|
47
35
|
}
|
|
48
36
|
}
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
export {
|
|
38
|
+
EnumValidationError as default
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/enum.js"],
|
|
4
|
+
"sourcesContent": ["import pointer from 'jsonpointer'\nimport leven from 'leven'\n\nimport BaseValidationError from './base'\n\nexport default class EnumValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'EnumValidationError'\n }\n\n getError() {\n const { message, params } = this.options\n const bestMatch = this.findBestMatch()\n const allowedValues = params.allowedValues.join(', ')\n\n const output = {\n message: `${message}: ${allowedValues}`,\n path: this.instancePath,\n }\n\n if (bestMatch !== null) {\n output.suggestion = `Did you mean ${bestMatch}?`\n }\n\n return output\n }\n\n findBestMatch() {\n const {\n params: { allowedValues },\n } = this.options\n\n const currentValue = this.instancePath === '' ? this.data : pointer.get(this.data, this.instancePath)\n\n if (!currentValue) {\n return null\n }\n\n const bestMatch = allowedValues\n .map((value) => ({\n value,\n weight: leven(value, currentValue.toString()),\n }))\n .sort((x, y) => (x.weight > y.weight ? 1 : x.weight < y.weight ? -1 : 0))[0]\n\n return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,aAAa;AACpB,OAAO,WAAW;AAElB,OAAO,yBAAyB;AAEhC,MAAO,4BAA0C,oBAAoB;AAAA,EACnE,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,SAAS,OAAO,IAAI,KAAK;AACjC,UAAM,YAAY,KAAK,cAAc;AACrC,UAAM,gBAAgB,OAAO,cAAc,KAAK,IAAI;AAEpD,UAAM,SAAS;AAAA,MACb,SAAS,GAAG,OAAO,KAAK,aAAa;AAAA,MACrC,MAAM,KAAK;AAAA,IACb;AAEA,QAAI,cAAc,MAAM;AACtB,aAAO,aAAa,gBAAgB,SAAS;AAAA,IAC/C;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB;AACd,UAAM;AAAA,MACJ,QAAQ,EAAE,cAAc;AAAA,IAC1B,IAAI,KAAK;AAET,UAAM,eAAe,KAAK,iBAAiB,KAAK,KAAK,OAAO,QAAQ,IAAI,KAAK,MAAM,KAAK,YAAY;AAEpG,QAAI,CAAC,cAAc;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,YAAY,cACf,IAAI,CAAC,WAAW;AAAA,MACf;AAAA,MACA,QAAQ,MAAM,OAAO,aAAa,SAAS,CAAC;AAAA,IAC9C,EAAE,EACD,KAAK,CAAC,GAAG,MAAO,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,SAAS,EAAE,SAAS,KAAK,CAAE,EAAE,CAAC;AAE7E,WAAO,cAAc,WAAW,KAAK,UAAU,SAAS,UAAU,MAAM,SAAS,UAAU,QAAQ;AAAA,EACrG;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as AdditionalPropValidationError } from "./additional-prop.js";
|
|
2
|
+
export { default as DefaultValidationError } from "./default.js";
|
|
3
|
+
export { default as EnumValidationError } from "./enum.js";
|
|
4
|
+
export { default as PatternValidationError } from "./pattern.js";
|
|
5
|
+
export { default as RequiredValidationError } from "./required.js";
|
|
6
|
+
export { default as UnevaluatedPropValidationError } from "./unevaluated-prop.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as default2 } from "./additional-prop.js";
|
|
2
|
+
import { default as default3 } from "./default.js";
|
|
3
|
+
import { default as default4 } from "./enum.js";
|
|
4
|
+
import { default as default5 } from "./pattern.js";
|
|
5
|
+
import { default as default6 } from "./required.js";
|
|
6
|
+
import { default as default7 } from "./unevaluated-prop.js";
|
|
7
|
+
export {
|
|
8
|
+
default2 as AdditionalPropValidationError,
|
|
9
|
+
default3 as DefaultValidationError,
|
|
10
|
+
default4 as EnumValidationError,
|
|
11
|
+
default5 as PatternValidationError,
|
|
12
|
+
default6 as RequiredValidationError,
|
|
13
|
+
default7 as UnevaluatedPropValidationError
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as AdditionalPropValidationError } from './additional-prop'\nexport { default as DefaultValidationError } from './default'\nexport { default as EnumValidationError } from './enum'\nexport { default as PatternValidationError } from './pattern'\nexport { default as RequiredValidationError } from './required'\nexport { default as UnevaluatedPropValidationError } from './unevaluated-prop'\n"],
|
|
5
|
+
"mappings": "AAAA,SAAoB,WAAXA,gBAAgD;AACzD,SAAoB,WAAXA,gBAAyC;AAClD,SAAoB,WAAXA,gBAAsC;AAC/C,SAAoB,WAAXA,gBAAyC;AAClD,SAAoB,WAAXA,gBAA0C;AACnD,SAAoB,WAAXA,gBAAiD;",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class PatternValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
import BaseValidationError from './base.js';
|
|
10
|
+
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/pattern.js"],"names":[],"mappings":"AAEA;IACE,4BAIC;IAFC,aAAoC;IAItC;;;MAOC;CACF;gCAjB+B,QAAQ"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import BaseValidationError from
|
|
2
|
-
|
|
1
|
+
import BaseValidationError from "./base.js";
|
|
3
2
|
class PatternValidationError extends BaseValidationError {
|
|
4
3
|
constructor(...args) {
|
|
5
4
|
super(...args);
|
|
6
|
-
this.name =
|
|
5
|
+
this.name = "PatternValidationError";
|
|
7
6
|
this.options.isIdentifierLocation = true;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
getError() {
|
|
11
9
|
const { params, propertyName } = this.options;
|
|
12
|
-
|
|
13
10
|
return {
|
|
14
11
|
message: `Property "${propertyName}" must match pattern ${params.pattern}`,
|
|
15
|
-
path: this.instancePath
|
|
16
|
-
}
|
|
12
|
+
path: this.instancePath
|
|
13
|
+
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
PatternValidationError as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=pattern.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/pattern.js"],
|
|
4
|
+
"sourcesContent": ["import BaseValidationError from './base'\n\nexport default class PatternValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'PatternValidationError'\n this.options.isIdentifierLocation = true\n }\n\n getError() {\n const { params, propertyName } = this.options\n\n return {\n message: `Property \"${propertyName}\" must match pattern ${params.pattern}`,\n path: this.instancePath,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,yBAAyB;AAEhC,MAAO,+BAA6C,oBAAoB;AAAA,EACtE,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ,uBAAuB;AAAA,EACtC;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,QAAQ,aAAa,IAAI,KAAK;AAEtC,WAAO;AAAA,MACL,SAAS,aAAa,YAAY,wBAAwB,OAAO,OAAO;AAAA,MACxE,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class RequiredValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
import BaseValidationError from './base.js';
|
|
10
|
+
//# sourceMappingURL=required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/required.js"],"names":[],"mappings":"AAEA;IACE,4BAGC;IADC,aAAqC;IAGvC;;;MAOC;CACF;gCAhB+B,QAAQ"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import BaseValidationError from
|
|
2
|
-
|
|
1
|
+
import BaseValidationError from "./base.js";
|
|
3
2
|
class RequiredValidationError extends BaseValidationError {
|
|
4
3
|
constructor(...args) {
|
|
5
4
|
super(...args);
|
|
6
|
-
this.name =
|
|
5
|
+
this.name = "RequiredValidationError";
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
getError() {
|
|
10
8
|
const { message } = this.options;
|
|
11
|
-
|
|
12
9
|
return {
|
|
13
10
|
message: `${message}`,
|
|
14
|
-
path: this.instancePath
|
|
15
|
-
}
|
|
11
|
+
path: this.instancePath
|
|
12
|
+
};
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
export {
|
|
16
|
+
RequiredValidationError as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=required.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/required.js"],
|
|
4
|
+
"sourcesContent": ["import BaseValidationError from './base'\n\nexport default class RequiredValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'RequiredValidationError'\n }\n\n getError() {\n const { message } = this.options\n\n return {\n message: `${message}`,\n path: this.instancePath,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,yBAAyB;AAEhC,MAAO,gCAA8C,oBAAoB;AAAA,EACvE,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,QAAQ,IAAI,KAAK;AAEzB,WAAO;AAAA,MACL,SAAS,GAAG,OAAO;AAAA,MACnB,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class UnevaluatedPropValidationError extends BaseValidationError {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
name: string;
|
|
4
|
+
getError(): {
|
|
5
|
+
message: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
import BaseValidationError from './base.js';
|
|
10
|
+
//# sourceMappingURL=unevaluated-prop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unevaluated-prop.d.ts","sourceRoot":"","sources":["../../../../src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js"],"names":[],"mappings":"AAEA;IACE,4BAIC;IAFC,aAA4C;IAI9C;;;MAOC;CACF;gCAjB+B,QAAQ"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import BaseValidationError from
|
|
2
|
-
|
|
1
|
+
import BaseValidationError from "./base.js";
|
|
3
2
|
class UnevaluatedPropValidationError extends BaseValidationError {
|
|
4
3
|
constructor(...args) {
|
|
5
4
|
super(...args);
|
|
6
|
-
this.name =
|
|
5
|
+
this.name = "UnevaluatedPropValidationError";
|
|
7
6
|
this.options.isIdentifierLocation = true;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
getError() {
|
|
11
9
|
const { params } = this.options;
|
|
12
|
-
|
|
13
10
|
return {
|
|
14
11
|
message: `Property ${params.unevaluatedProperty} is not expected to be here`,
|
|
15
|
-
path: this.instancePath
|
|
16
|
-
}
|
|
12
|
+
path: this.instancePath
|
|
13
|
+
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
UnevaluatedPropValidationError as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=unevaluated-prop.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/betterAjvErrors/validation-errors/unevaluated-prop.js"],
|
|
4
|
+
"sourcesContent": ["import BaseValidationError from './base'\n\nexport default class UnevaluatedPropValidationError extends BaseValidationError {\n constructor(...args) {\n super(...args)\n this.name = 'UnevaluatedPropValidationError'\n this.options.isIdentifierLocation = true\n }\n\n getError() {\n const { params } = this.options\n\n return {\n message: `Property ${params.unevaluatedProperty} is not expected to be here`,\n path: this.instancePath,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,yBAAyB;AAEhC,MAAO,uCAAqD,oBAAoB;AAAA,EAC9E,eAAe,MAAM;AACnB,UAAM,GAAG,IAAI;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ,uBAAuB;AAAA,EACtC;AAAA,EAEA,WAAW;AACT,UAAM,EAAE,OAAO,IAAI,KAAK;AAExB,WAAO;AAAA,MACL,SAAS,YAAY,OAAO,mBAAmB;AAAA,MAC/C,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyApiDefinitionFormat, DereferenceResult, Filesystem } from '../types/index.
|
|
2
|
-
import { type ResolveReferencesOptions } from './resolveReferences.
|
|
1
|
+
import type { AnyApiDefinitionFormat, DereferenceResult, Filesystem } from '../types/index.js';
|
|
2
|
+
import { type ResolveReferencesOptions } from './resolveReferences.js';
|
|
3
3
|
export type DereferenceOptions = ResolveReferencesOptions;
|
|
4
4
|
/**
|
|
5
5
|
* Resolves all references in an OpenAPI document
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dereference.d.ts","sourceRoot":"","sources":["../../src/utils/dereference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dereference.d.ts","sourceRoot":"","sources":["../../src/utils/dereference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAI3F,OAAO,EAAE,KAAK,wBAAwB,EAAqB,MAAM,qBAAqB,CAAA;AAEtF,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAEzD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,sBAAsB,GAAG,UAAU,EAC1C,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { details } from
|
|
2
|
-
import { getEntrypoint } from
|
|
3
|
-
import { makeFilesystem } from
|
|
4
|
-
import { resolveReferences } from
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Resolves all references in an OpenAPI document
|
|
8
|
-
*/
|
|
1
|
+
import { details } from "./details.js";
|
|
2
|
+
import { getEntrypoint } from "./getEntrypoint.js";
|
|
3
|
+
import { makeFilesystem } from "./makeFilesystem.js";
|
|
4
|
+
import { resolveReferences } from "./resolveReferences.js";
|
|
9
5
|
async function dereference(value, options) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const filesystem = makeFilesystem(value);
|
|
7
|
+
const entrypoint = getEntrypoint(filesystem);
|
|
8
|
+
const result = resolveReferences(filesystem, options);
|
|
9
|
+
return {
|
|
10
|
+
specification: entrypoint.specification,
|
|
11
|
+
errors: result.errors,
|
|
12
|
+
schema: result.schema,
|
|
13
|
+
...details(entrypoint.specification)
|
|
14
|
+
};
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export {
|
|
17
|
+
dereference
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=dereference.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/dereference.ts"],
|
|
4
|
+
"sourcesContent": ["import type { AnyApiDefinitionFormat, DereferenceResult, Filesystem } from '../types/index'\nimport { details } from './details'\nimport { getEntrypoint } from './getEntrypoint'\nimport { makeFilesystem } from './makeFilesystem'\nimport { type ResolveReferencesOptions, resolveReferences } from './resolveReferences'\n\nexport type DereferenceOptions = ResolveReferencesOptions\n\n/**\n * Resolves all references in an OpenAPI document\n */\nexport async function dereference(\n value: AnyApiDefinitionFormat | Filesystem,\n options?: DereferenceOptions,\n): Promise<DereferenceResult> {\n const filesystem = makeFilesystem(value)\n\n const entrypoint = getEntrypoint(filesystem)\n const result = resolveReferences(filesystem, options)\n\n return {\n specification: entrypoint.specification,\n errors: result.errors,\n schema: result.schema,\n ...details(entrypoint.specification),\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAwC,yBAAyB;AAOjE,eAAsB,YACpB,OACA,SAC4B;AAC5B,QAAM,aAAa,eAAe,KAAK;AAEvC,QAAM,aAAa,cAAc,UAAU;AAC3C,QAAM,SAAS,kBAAkB,YAAY,OAAO;AAEpD,SAAO;AAAA,IACL,eAAe,WAAW;AAAA,IAC1B,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,GAAG,QAAQ,WAAW,aAAa;AAAA,EACrC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|