@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
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { getListOfReferences } from
|
|
2
|
-
import { isFilesystem } from
|
|
3
|
-
import { normalize } from
|
|
4
|
-
|
|
1
|
+
import { getListOfReferences } from "./getListOfReferences.js";
|
|
2
|
+
import { isFilesystem } from "./isFilesystem.js";
|
|
3
|
+
import { normalize } from "./normalize.js";
|
|
5
4
|
function makeFilesystem(value, overwrites = {}) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (isFilesystem(value)) {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
const specification = normalize(value);
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
isEntrypoint: true,
|
|
12
|
+
specification,
|
|
13
|
+
filename: null,
|
|
14
|
+
dir: "./",
|
|
15
|
+
references: getListOfReferences(specification),
|
|
16
|
+
...overwrites
|
|
9
17
|
}
|
|
10
|
-
|
|
11
|
-
const specification = normalize(value);
|
|
12
|
-
// Create fake filesystem
|
|
13
|
-
return [
|
|
14
|
-
{
|
|
15
|
-
isEntrypoint: true,
|
|
16
|
-
specification,
|
|
17
|
-
filename: null,
|
|
18
|
-
dir: './',
|
|
19
|
-
references: getListOfReferences(specification),
|
|
20
|
-
...overwrites,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
18
|
+
];
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export {
|
|
21
|
+
makeFilesystem
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=makeFilesystem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/makeFilesystem.ts"],
|
|
4
|
+
"sourcesContent": ["import type { AnyObject, Filesystem, FilesystemEntry } from '../types/index'\nimport { getListOfReferences } from './getListOfReferences'\nimport { isFilesystem } from './isFilesystem'\nimport { normalize } from './normalize'\n\nexport function makeFilesystem(\n value: string | AnyObject | Filesystem,\n overwrites: Partial<FilesystemEntry> = {},\n): Filesystem {\n // Keep as is\n if (isFilesystem(value)) {\n return value as Filesystem\n }\n\n // Make an object\n const specification = normalize(value)\n\n // Create fake filesystem\n return [\n {\n isEntrypoint: true,\n specification,\n filename: null,\n dir: './',\n references: getListOfReferences(specification),\n ...overwrites,\n },\n ]\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAEnB,SAAS,eACd,OACA,aAAuC,CAAC,GAC5B;AAEZ,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO;AAAA,EACT;AAGA,QAAM,gBAAgB,UAAU,KAAK;AAGrC,SAAO;AAAA,IACL;AAAA,MACE,cAAc;AAAA,MACd;AAAA,MACA,UAAU;AAAA,MACV,KAAK;AAAA,MACL,YAAY,oBAAoB,aAAa;AAAA,MAC7C,GAAG;AAAA,IACL;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { isFilesystem } from "./isFilesystem.js";
|
|
3
|
+
import { makeFilesystem } from "./makeFilesystem.js";
|
|
4
|
+
describe("isFilesystem", () => {
|
|
5
|
+
it("transforms an object to a filesystem", () => {
|
|
6
|
+
const result = makeFilesystem({
|
|
7
|
+
foo: "bar"
|
|
8
|
+
});
|
|
9
|
+
expect(result).not.toBe({
|
|
10
|
+
foo: "bar"
|
|
11
|
+
});
|
|
12
|
+
expect(isFilesystem(result)).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=makeFilesystem.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/makeFilesystem.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { isFilesystem } from './isFilesystem'\nimport { makeFilesystem } from './makeFilesystem'\n\ndescribe('isFilesystem', () => {\n it('transforms an object to a filesystem', () => {\n const result = makeFilesystem({\n foo: 'bar',\n })\n\n expect(result).not.toBe({\n foo: 'bar',\n })\n\n expect(isFilesystem(result)).toBe(true)\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAE/B,SAAS,gBAAgB,MAAM;AAC7B,KAAG,wCAAwC,MAAM;AAC/C,UAAM,SAAS,eAAe;AAAA,MAC5B,KAAK;AAAA,IACP,CAAC;AAED,WAAO,MAAM,EAAE,IAAI,KAAK;AAAA,MACtB,KAAK;AAAA,IACP,CAAC;AAED,WAAO,aAAa,MAAM,CAAC,EAAE,KAAK,IAAI;AAAA,EACxC,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAwBxG"}
|
package/dist/utils/normalize.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
|
-
import { parse } from
|
|
2
|
-
import { isFilesystem } from
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.
|
|
6
|
-
*
|
|
7
|
-
* Doesn’t modify the object if it’s a `Filesystem` (multiple files) already.
|
|
8
|
-
*/
|
|
1
|
+
import { parse } from "yaml";
|
|
2
|
+
import { isFilesystem } from "./isFilesystem.js";
|
|
9
3
|
function normalize(specification) {
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
if (specification === null) {
|
|
5
|
+
return {};
|
|
6
|
+
}
|
|
7
|
+
if (typeof specification === "string") {
|
|
8
|
+
if (specification.trim() === "") {
|
|
9
|
+
return {};
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
catch (_error) {
|
|
21
|
-
return parse(specification, {
|
|
22
|
-
maxAliasCount: 10000,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (isFilesystem(specification)) {
|
|
27
|
-
return specification;
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(specification);
|
|
13
|
+
} catch (_error) {
|
|
14
|
+
return parse(specification, {
|
|
15
|
+
maxAliasCount: 1e4
|
|
16
|
+
});
|
|
28
17
|
}
|
|
18
|
+
}
|
|
19
|
+
if (isFilesystem(specification)) {
|
|
29
20
|
return specification;
|
|
21
|
+
}
|
|
22
|
+
return specification;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
export {
|
|
25
|
+
normalize
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/normalize.ts"],
|
|
4
|
+
"sourcesContent": ["import type { UnknownObject } from '@scalar/types/utils'\nimport { parse } from 'yaml'\n\nimport type { Filesystem } from '../types/index'\nimport { isFilesystem } from './isFilesystem'\n\n/**\n * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.\n *\n * Doesn\u2019t modify the object if it\u2019s a `Filesystem` (multiple files) already.\n */\nexport function normalize(specification: string | UnknownObject | Filesystem): UnknownObject | Filesystem {\n if (specification === null) {\n return {}\n }\n\n if (typeof specification === 'string') {\n if (specification.trim() === '') {\n return {}\n }\n\n try {\n return JSON.parse(specification)\n } catch (_error) {\n return parse(specification, {\n maxAliasCount: 10000,\n })\n }\n }\n\n if (isFilesystem(specification)) {\n return specification as Filesystem\n }\n\n return specification\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,aAAa;AAGtB,SAAS,oBAAoB;AAOtB,SAAS,UAAU,eAAgF;AACxG,MAAI,kBAAkB,MAAM;AAC1B,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,OAAO,kBAAkB,UAAU;AACrC,QAAI,cAAc,KAAK,MAAM,IAAI;AAC/B,aAAO,CAAC;AAAA,IACV;AAEA,QAAI;AACF,aAAO,KAAK,MAAM,aAAa;AAAA,IACjC,SAAS,QAAQ;AACf,aAAO,MAAM,eAAe;AAAA,QAC1B,eAAe;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,aAAa,aAAa,GAAG;AAC/B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { normalize } from "./normalize.js";
|
|
3
|
+
describe("normalize", () => {
|
|
4
|
+
it("should return an empty object if the specification is null", () => {
|
|
5
|
+
expect(normalize(null)).toEqual({});
|
|
6
|
+
});
|
|
7
|
+
it("should return the same filesystem if the specification is already a filesystem", () => {
|
|
8
|
+
const filesystem = [
|
|
9
|
+
{
|
|
10
|
+
isEntrypoint: true,
|
|
11
|
+
specification: {},
|
|
12
|
+
filename: null,
|
|
13
|
+
dir: "./",
|
|
14
|
+
references: []
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
expect(normalize(filesystem)).toBe(filesystem);
|
|
18
|
+
});
|
|
19
|
+
it("should parse JSON string specifications", () => {
|
|
20
|
+
const jsonString = '{"foo": "bar"}';
|
|
21
|
+
expect(normalize(jsonString)).toEqual({ foo: "bar" });
|
|
22
|
+
});
|
|
23
|
+
it("should parse YAML string specifications", () => {
|
|
24
|
+
const yamlString = "foo: bar";
|
|
25
|
+
expect(normalize(yamlString)).toEqual({ foo: "bar" });
|
|
26
|
+
});
|
|
27
|
+
it("should handle invalid YAML with custom maxAliasCount", () => {
|
|
28
|
+
const yamlString = `
|
|
29
|
+
aliases: &ref
|
|
30
|
+
- item1
|
|
31
|
+
- item2
|
|
32
|
+
items: *ref
|
|
33
|
+
`;
|
|
34
|
+
expect(() => normalize(yamlString)).not.toThrow();
|
|
35
|
+
});
|
|
36
|
+
it("should return the same object if specification is already an object", () => {
|
|
37
|
+
const obj = { foo: "bar" };
|
|
38
|
+
expect(normalize(obj)).toBe(obj);
|
|
39
|
+
});
|
|
40
|
+
it("should handle malformed JSON strings by falling back to YAML parsing", () => {
|
|
41
|
+
const malformedJson = '{ foo: "bar" }';
|
|
42
|
+
expect(normalize(malformedJson)).toEqual({ foo: "bar" });
|
|
43
|
+
});
|
|
44
|
+
it("should handle empty string input", () => {
|
|
45
|
+
expect(normalize("")).toEqual({});
|
|
46
|
+
});
|
|
47
|
+
it("should handle whitespace-only string input", () => {
|
|
48
|
+
expect(normalize(" ")).toEqual({});
|
|
49
|
+
});
|
|
50
|
+
it("should handle complex nested structures", () => {
|
|
51
|
+
const complex = {
|
|
52
|
+
nested: {
|
|
53
|
+
array: [1, 2, 3],
|
|
54
|
+
object: {
|
|
55
|
+
foo: "bar"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
expect(normalize(complex)).toEqual(complex);
|
|
60
|
+
});
|
|
61
|
+
it("should handle invalid JSON and YAML strings gracefully", () => {
|
|
62
|
+
const invalidString = "not a valid json or yaml";
|
|
63
|
+
expect(() => normalize(invalidString)).not.toThrow();
|
|
64
|
+
});
|
|
65
|
+
it("should handle non-string, non-object inputs", () => {
|
|
66
|
+
expect(normalize(42)).toEqual(42);
|
|
67
|
+
expect(normalize(true)).toEqual(true);
|
|
68
|
+
expect(normalize([1, 2, 3])).toEqual([1, 2, 3]);
|
|
69
|
+
});
|
|
70
|
+
it("should handle deeply nested structures", () => {
|
|
71
|
+
const nested = { a: { b: { c: { d: { e: "deep" } } } } };
|
|
72
|
+
expect(normalize(nested)).toEqual(nested);
|
|
73
|
+
});
|
|
74
|
+
it("should handle large input strings", () => {
|
|
75
|
+
const largeJson = JSON.stringify({ foo: "bar".repeat(1e4) });
|
|
76
|
+
expect(normalize(largeJson)).toEqual({ foo: "bar".repeat(1e4) });
|
|
77
|
+
});
|
|
78
|
+
it("should handle circular references", () => {
|
|
79
|
+
const circularObj = {};
|
|
80
|
+
circularObj.self = circularObj;
|
|
81
|
+
expect(() => normalize(circularObj)).not.toThrow();
|
|
82
|
+
});
|
|
83
|
+
it("should handle special characters in strings", () => {
|
|
84
|
+
const specialCharJson = '{"foo": "bar\\n"}';
|
|
85
|
+
expect(normalize(specialCharJson)).toEqual({ foo: "bar\n" });
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=normalize.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/normalize.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { normalize } from './normalize'\n\ndescribe('normalize', () => {\n it('should return an empty object if the specification is null', () => {\n expect(normalize(null)).toEqual({})\n })\n\n it('should return the same filesystem if the specification is already a filesystem', () => {\n const filesystem = [\n {\n isEntrypoint: true,\n specification: {},\n filename: null,\n dir: './',\n references: [],\n },\n ]\n expect(normalize(filesystem)).toBe(filesystem)\n })\n\n it('should parse JSON string specifications', () => {\n const jsonString = '{\"foo\": \"bar\"}'\n expect(normalize(jsonString)).toEqual({ foo: 'bar' })\n })\n\n it('should parse YAML string specifications', () => {\n const yamlString = 'foo: bar'\n expect(normalize(yamlString)).toEqual({ foo: 'bar' })\n })\n\n it('should handle invalid YAML with custom maxAliasCount', () => {\n const yamlString = `\n aliases: &ref\n - item1\n - item2\n items: *ref\n `\n expect(() => normalize(yamlString)).not.toThrow()\n })\n\n it('should return the same object if specification is already an object', () => {\n const obj = { foo: 'bar' }\n expect(normalize(obj)).toBe(obj)\n })\n\n it('should handle malformed JSON strings by falling back to YAML parsing', () => {\n const malformedJson = '{ foo: \"bar\" }' // Missing quotes around property name\n expect(normalize(malformedJson)).toEqual({ foo: 'bar' })\n })\n\n it('should handle empty string input', () => {\n expect(normalize('')).toEqual({})\n })\n\n it('should handle whitespace-only string input', () => {\n expect(normalize(' ')).toEqual({})\n })\n\n it('should handle complex nested structures', () => {\n const complex = {\n nested: {\n array: [1, 2, 3],\n object: {\n foo: 'bar',\n },\n },\n }\n expect(normalize(complex)).toEqual(complex)\n })\n\n it('should handle invalid JSON and YAML strings gracefully', () => {\n const invalidString = 'not a valid json or yaml'\n expect(() => normalize(invalidString)).not.toThrow()\n })\n\n it('should handle non-string, non-object inputs', () => {\n // @ts-expect-error testing bad input\n expect(normalize(42)).toEqual(42)\n // @ts-expect-error testing bad input\n expect(normalize(true)).toEqual(true)\n // @ts-expect-error testing bad input\n expect(normalize([1, 2, 3])).toEqual([1, 2, 3])\n })\n\n it('should handle deeply nested structures', () => {\n const nested = { a: { b: { c: { d: { e: 'deep' } } } } }\n expect(normalize(nested)).toEqual(nested)\n })\n\n it('should handle large input strings', () => {\n const largeJson = JSON.stringify({ foo: 'bar'.repeat(10000) })\n expect(normalize(largeJson)).toEqual({ foo: 'bar'.repeat(10000) })\n })\n\n it('should handle circular references', () => {\n const circularObj: any = {}\n circularObj.self = circularObj\n expect(() => normalize(circularObj)).not.toThrow()\n })\n\n it('should handle special characters in strings', () => {\n const specialCharJson = '{\"foo\": \"bar\\\\n\"}'\n expect(normalize(specialCharJson)).toEqual({ foo: 'bar\\n' })\n })\n})\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Queue, Task } from '../../../types/index.
|
|
2
|
-
import { details as detailsUtility } from '../../details.
|
|
1
|
+
import type { Queue, Task } from '../../../types/index.js';
|
|
2
|
+
import { details as detailsUtility } from '../../details.js';
|
|
3
3
|
/**
|
|
4
4
|
* Run the chained tasks and return just some basic information about the OpenAPI document
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAIzD;;GAEG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAI3G"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { details as
|
|
2
|
-
import { getEntrypoint } from
|
|
3
|
-
import { workThroughQueue } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Run the chained tasks and return just some basic information about the OpenAPI document
|
|
7
|
-
*/
|
|
1
|
+
import { details as detailsUtility } from "../../details.js";
|
|
2
|
+
import { getEntrypoint } from "../../getEntrypoint.js";
|
|
3
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
8
4
|
async function details(queue) {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
+
return detailsUtility(getEntrypoint(filesystem).specification);
|
|
11
7
|
}
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export {
|
|
9
|
+
details
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=details.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/details.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { details as detailsUtility } from '../../details'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return just some basic information about the OpenAPI document\n */\nexport async function details<T extends Task[]>(queue: Queue<T>): Promise<ReturnType<typeof detailsUtility>> {\n const { filesystem } = await workThroughQueue(queue)\n\n return detailsUtility(getEntrypoint(filesystem).specification)\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,WAAW,sBAAsB;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAKjC,eAAsB,QAA0B,OAA6D;AAC3G,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,eAAe,cAAc,UAAU,EAAE,aAAa;AAC/D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAGnE;;GAEG;AACH,wBAAsB,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAIlF"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { workThroughQueue } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Run the chained tasks and return just the filesystem
|
|
5
|
-
*/
|
|
1
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
6
2
|
async function files(queue) {
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
4
|
+
return filesystem;
|
|
9
5
|
}
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export {
|
|
7
|
+
files
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/files.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Filesystem, Queue, Task } from '../../../types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return just the filesystem\n */\nexport async function files<T extends Task[]>(queue: Queue<T>): Promise<Filesystem> {\n const { filesystem } = await workThroughQueue(queue)\n\n return filesystem\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,MAAwB,OAAsC;AAClF,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAGrE;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKrF"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { workThroughQueue } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Run the chained tasks and return the results
|
|
5
|
-
*/
|
|
1
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
6
2
|
async function get(queue) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
return {
|
|
4
|
+
filesystem: [],
|
|
5
|
+
...await workThroughQueue(queue)
|
|
6
|
+
};
|
|
11
7
|
}
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export {
|
|
9
|
+
get
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/get.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CommandChain, Queue, Task } from '../../../types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function get<T extends Task[]>(queue: Queue<T>): Promise<CommandChain<T>> {\n return {\n filesystem: [],\n ...(await workThroughQueue(queue)),\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,IAAsB,OAA2C;AACrF,SAAO;AAAA,IACL,YAAY,CAAC;AAAA,IACb,GAAI,MAAM,iBAAiB,KAAK;AAAA,EAClC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI3F"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { getEntrypoint } from
|
|
2
|
-
import { toJson as
|
|
3
|
-
import { workThroughQueue } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Run the chained tasks and return the results
|
|
7
|
-
*/
|
|
1
|
+
import { getEntrypoint } from "../../getEntrypoint.js";
|
|
2
|
+
import { toJson as toJsonUtility } from "../../toJson.js";
|
|
3
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
8
4
|
async function toJson(queue) {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
+
return toJsonUtility(getEntrypoint(filesystem).specification);
|
|
11
7
|
}
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export {
|
|
9
|
+
toJson
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toJson.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/toJson.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { toJson as toJsonUtility } from '../../toJson'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toJson<T extends Task[]>(queue: Queue<T>): Promise<string | undefined> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toJsonUtility(getEntrypoint(filesystem).specification)\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAA8C;AAC3F,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/E"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { getEntrypoint } from
|
|
2
|
-
import { toYaml as
|
|
3
|
-
import { workThroughQueue } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Run the chained tasks and return the results
|
|
7
|
-
*/
|
|
1
|
+
import { getEntrypoint } from "../../getEntrypoint.js";
|
|
2
|
+
import { toYaml as toYamlUtility } from "../../toYaml.js";
|
|
3
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
8
4
|
async function toYaml(queue) {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
+
return toYamlUtility(getEntrypoint(filesystem).specification);
|
|
11
7
|
}
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export {
|
|
9
|
+
toYaml
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toYaml.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/toYaml.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { toYaml as toYamlUtility } from '../../toYaml'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toYaml<T extends Task[]>(queue: Queue<T>): Promise<string> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toYamlUtility(getEntrypoint(filesystem).specification)\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAAkC;AAC/E,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DereferenceResult, Queue, Task } from '../../../types/index.
|
|
2
|
-
import type { DereferenceOptions } from '../../dereference.
|
|
1
|
+
import type { DereferenceResult, Queue, Task } from '../../../types/index.js';
|
|
2
|
+
import type { DereferenceOptions } from '../../dereference.js';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Commands {
|
|
5
5
|
dereference: {
|
|
@@ -15,9 +15,9 @@ declare global {
|
|
|
15
15
|
* Dereference the given OpenAPI document
|
|
16
16
|
*/
|
|
17
17
|
export declare function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions): {
|
|
18
|
-
details: () => Promise<import("../../../
|
|
19
|
-
files: () => Promise<import("../../../
|
|
20
|
-
get: () => Promise<import("../../../
|
|
18
|
+
details: () => Promise<import("../../../index.js").DetailsResult>;
|
|
19
|
+
files: () => Promise<import("../../../index.js").Filesystem>;
|
|
20
|
+
get: () => Promise<import("../../../index.js").CommandChain<[...T, {
|
|
21
21
|
name: "dereference";
|
|
22
22
|
options?: DereferenceOptions;
|
|
23
23
|
}]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dereferenceCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dereferenceCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,WAAW,EAAE;YACX,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,CAAA;gBACnB,OAAO,CAAC,EAAE,kBAAkB,CAAA;aAC7B,CAAA;YACD,MAAM,EAAE,iBAAiB,CAAA;SAC1B,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB;;;;cAX5F,aAAa;kBACT,kBAAkB;;;;EA4BnC"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { details } from
|
|
2
|
-
import { files } from
|
|
3
|
-
import { get } from
|
|
4
|
-
import { toJson } from
|
|
5
|
-
import { toYaml } from
|
|
6
|
-
import { queueTask } from
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Dereference the given OpenAPI document
|
|
10
|
-
*/
|
|
1
|
+
import { details } from "../actions/details.js";
|
|
2
|
+
import { files } from "../actions/files.js";
|
|
3
|
+
import { get } from "../actions/get.js";
|
|
4
|
+
import { toJson } from "../actions/toJson.js";
|
|
5
|
+
import { toYaml } from "../actions/toYaml.js";
|
|
6
|
+
import { queueTask } from "../utils/queueTask.js";
|
|
11
7
|
function dereferenceCommand(previousQueue, options) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
const task = {
|
|
9
|
+
name: "dereference",
|
|
10
|
+
options: {
|
|
11
|
+
throwOnError: previousQueue.options?.throwOnError,
|
|
12
|
+
...options ?? {}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const queue = queueTask(previousQueue, task);
|
|
16
|
+
return {
|
|
17
|
+
details: () => details(queue),
|
|
18
|
+
files: () => files(queue),
|
|
19
|
+
get: () => get(queue),
|
|
20
|
+
toJson: () => toJson(queue),
|
|
21
|
+
toYaml: () => toYaml(queue)
|
|
22
|
+
};
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
export {
|
|
25
|
+
dereferenceCommand
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=dereferenceCommand.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],
|
|
4
|
+
"sourcesContent": ["import type { DereferenceResult, Queue, Task } from '../../../types/index'\nimport type { DereferenceOptions } from '../../dereference'\nimport { details } from '../actions/details'\nimport { files } from '../actions/files'\nimport { get } from '../actions/get'\nimport { toJson } from '../actions/toJson'\nimport { toYaml } from '../actions/toYaml'\nimport { queueTask } from '../utils/queueTask'\n\ndeclare global {\n interface Commands {\n dereference: {\n task: {\n name: 'dereference'\n options?: DereferenceOptions\n }\n result: DereferenceResult\n }\n }\n}\n\n/**\n * Dereference the given OpenAPI document\n */\nexport function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions) {\n const task: Task = {\n name: 'dereference',\n options: {\n throwOnError: previousQueue.options?.throwOnError,\n ...(options ?? {}),\n },\n }\n\n const queue = queueTask<[...T, typeof task]>(previousQueue, task as Task)\n\n return {\n details: () => details(queue),\n files: () => files(queue),\n get: () => get(queue),\n toJson: () => toJson(queue),\n toYaml: () => toYaml(queue),\n }\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAiBnB,SAAS,mBAAqC,eAAyB,SAA8B;AAC1G,QAAM,OAAa;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,MACP,cAAc,cAAc,SAAS;AAAA,MACrC,GAAI,WAAW,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,QAAQ,UAA+B,eAAe,IAAY;AAExE,SAAO;AAAA,IACL,SAAS,MAAM,QAAQ,KAAK;AAAA,IAC5B,OAAO,MAAM,MAAM,KAAK;AAAA,IACxB,KAAK,MAAM,IAAI,KAAK;AAAA,IACpB,QAAQ,MAAM,OAAO,KAAK;AAAA,IAC1B,QAAQ,MAAM,OAAO,KAAK;AAAA,EAC5B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|