@scalar/openapi-parser 0.11.1 → 0.13.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 +12 -0
- package/dist/configuration/index.d.ts +2 -2
- package/dist/configuration/index.js +2 -2
- package/dist/configuration/index.js.map +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -4
- package/dist/index.js.map +2 -2
- package/dist/lib/Validator/Validator.d.ts.map +1 -1
- package/dist/lib/Validator/Validator.js +2 -2
- package/dist/lib/Validator/Validator.js.map +1 -1
- package/dist/lib/Validator/index.d.ts +1 -2
- package/dist/lib/Validator/index.d.ts.map +1 -1
- package/dist/lib/Validator/index.js +4 -2
- package/dist/lib/Validator/index.js.map +2 -2
- package/dist/plugins/fetch-urls/{fetchUrls.d.ts → fetch-urls.d.ts} +1 -1
- package/dist/plugins/fetch-urls/fetch-urls.d.ts.map +1 -0
- package/dist/plugins/fetch-urls/{fetchUrls.js → fetch-urls.js} +1 -1
- package/dist/plugins/fetch-urls/fetch-urls.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 +5 -1
- package/dist/plugins/fetch-urls/index.js.map +2 -2
- 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 +4 -1
- package/dist/plugins/read-files/index.js.map +2 -2
- package/dist/plugins/read-files/{readFiles.d.ts → read-files.d.ts} +1 -1
- package/dist/plugins/read-files/read-files.d.ts.map +1 -0
- package/dist/plugins/read-files/{readFiles.js → read-files.js} +3 -3
- package/dist/plugins/read-files/read-files.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 +22 -2
- package/dist/polyfills/index.js.map +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/betterAjvErrors/validation-errors/base.js.map +1 -1
- package/dist/utils/dereference.d.ts +1 -1
- package/dist/utils/dereference.d.ts.map +1 -1
- package/dist/utils/dereference.js +3 -3
- package/dist/utils/dereference.js.map +1 -1
- package/dist/utils/details.d.ts +1 -2
- package/dist/utils/details.d.ts.map +1 -1
- package/dist/utils/details.js +12 -9
- package/dist/utils/details.js.map +2 -2
- package/dist/utils/{escapeJsonPointer.d.ts → escape-json-pointer.d.ts} +1 -1
- package/dist/utils/escape-json-pointer.d.ts.map +1 -0
- package/dist/utils/{escapeJsonPointer.js → escape-json-pointer.js} +1 -1
- package/dist/utils/{escapeJsonPointer.js.map → escape-json-pointer.js.map} +1 -1
- package/dist/utils/filter.d.ts.map +1 -1
- package/dist/utils/filter.js +2 -2
- package/dist/utils/filter.js.map +1 -1
- package/dist/utils/{getEntrypoint.d.ts → get-entrypoint.d.ts} +1 -1
- package/dist/utils/get-entrypoint.d.ts.map +1 -0
- package/dist/utils/{getEntrypoint.js → get-entrypoint.js} +1 -1
- package/dist/utils/get-entrypoint.js.map +7 -0
- package/dist/utils/{getListOfReferences.d.ts → get-list-of-references.d.ts} +1 -1
- package/dist/utils/get-list-of-references.d.ts.map +1 -0
- package/dist/utils/{getListOfReferences.js → get-list-of-references.js} +1 -1
- package/dist/utils/get-list-of-references.js.map +7 -0
- package/dist/utils/{getSegmentsFromPath.d.ts → get-segments-from-path.d.ts} +1 -1
- package/dist/utils/get-segments-from-path.d.ts.map +1 -0
- package/dist/utils/{getSegmentsFromPath.js → get-segments-from-path.js} +2 -2
- package/dist/utils/get-segments-from-path.js.map +7 -0
- package/dist/utils/{isFilesystem.d.ts → is-filesystem.d.ts} +1 -1
- package/dist/utils/is-filesystem.d.ts.map +1 -0
- package/dist/utils/{isFilesystem.js → is-filesystem.js} +1 -1
- package/dist/utils/is-filesystem.js.map +7 -0
- package/dist/utils/{isJson.d.ts → is-json.d.ts} +1 -1
- package/dist/utils/is-json.d.ts.map +1 -0
- package/dist/utils/{isJson.js → is-json.js} +1 -1
- package/dist/utils/{isJson.js.map → is-json.js.map} +1 -1
- package/dist/utils/{isObject.d.ts → is-object.d.ts} +1 -1
- package/dist/utils/is-object.d.ts.map +1 -0
- package/dist/utils/{isObject.js → is-object.js} +1 -1
- package/dist/utils/{isObject.js.map → is-object.js.map} +1 -1
- package/dist/utils/{isYaml.d.ts → is-yaml.d.ts} +1 -1
- package/dist/utils/is-yaml.d.ts.map +1 -0
- package/dist/utils/{isYaml.js → is-yaml.js} +1 -1
- package/dist/utils/{isYaml.js.map → is-yaml.js.map} +1 -1
- 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 +4 -1
- package/dist/utils/load/index.js.map +2 -2
- package/dist/utils/load/load.d.ts.map +1 -1
- package/dist/utils/load/load.js +4 -4
- package/dist/utils/load/load.js.map +1 -1
- package/dist/utils/{makeFilesystem.d.ts → make-filesystem.d.ts} +1 -1
- package/dist/utils/make-filesystem.d.ts.map +1 -0
- package/dist/utils/{makeFilesystem.js → make-filesystem.js} +3 -3
- package/dist/utils/make-filesystem.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 +17 -12
- package/dist/utils/normalize.js.map +2 -2
- package/dist/utils/{resolveReferences.d.ts → resolve-references.d.ts} +1 -1
- package/dist/utils/resolve-references.d.ts.map +1 -0
- package/dist/utils/{resolveReferences.js → resolve-references.js} +15 -4
- package/dist/utils/resolve-references.js.map +7 -0
- package/dist/utils/{toJson.d.ts → to-json.d.ts} +1 -1
- package/dist/utils/to-json.d.ts.map +1 -0
- package/dist/utils/{toJson.js → to-json.js} +1 -1
- package/dist/utils/to-json.js.map +7 -0
- package/dist/utils/{toYaml.d.ts → to-yaml.d.ts} +1 -1
- package/dist/utils/to-yaml.d.ts.map +1 -0
- package/dist/utils/{toYaml.js → to-yaml.js} +1 -1
- package/dist/utils/{toYaml.js.map → to-yaml.js.map} +2 -2
- package/dist/utils/transform/sanitize.d.ts +2 -0
- package/dist/utils/transform/sanitize.d.ts.map +1 -1
- package/dist/utils/transform/sanitize.js.map +2 -2
- package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
- package/dist/utils/transform/utils/addInfoObject.js.map +1 -1
- package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
- package/dist/utils/transform/utils/addLatestOpenApiVersion.js.map +1 -1
- package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
- package/dist/utils/transform/utils/addMissingTags.js.map +1 -1
- package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
- package/dist/utils/transform/utils/normalizeSecuritySchemes.js.map +1 -1
- package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
- package/dist/utils/transform/utils/rejectSwaggerDocuments.js.map +1 -1
- package/dist/utils/{transformErrors.d.ts → transform-errors.d.ts} +1 -1
- package/dist/utils/transform-errors.d.ts.map +1 -0
- package/dist/utils/{transformErrors.js → transform-errors.js} +1 -1
- package/dist/utils/transform-errors.js.map +7 -0
- package/dist/utils/traverse.d.ts.map +1 -1
- package/dist/utils/traverse.js.map +1 -1
- package/dist/utils/{unescapeJsonPointer.d.ts → unescape-json-pointer.d.ts} +1 -1
- package/dist/utils/unescape-json-pointer.d.ts.map +1 -0
- package/dist/utils/{unescapeJsonPointer.js → unescape-json-pointer.js} +1 -1
- package/dist/utils/{unescapeJsonPointer.js.map → unescape-json-pointer.js.map} +1 -1
- package/dist/utils/{upgradeFromThreeToThreeOne.d.ts → upgrade-from-three-to-three-one.d.ts} +1 -1
- package/dist/utils/upgrade-from-three-to-three-one.d.ts.map +1 -0
- package/dist/utils/{upgradeFromThreeToThreeOne.js → upgrade-from-three-to-three-one.js} +1 -2
- package/dist/utils/upgrade-from-three-to-three-one.js.map +7 -0
- package/dist/utils/{upgradeFromTwoToThree.d.ts → upgrade-from-two-to-three.d.ts} +1 -1
- package/dist/utils/upgrade-from-two-to-three.d.ts.map +1 -0
- package/dist/utils/{upgradeFromTwoToThree.js → upgrade-from-two-to-three.js} +1 -1
- package/dist/utils/{upgradeFromTwoToThree.js.map → upgrade-from-two-to-three.js.map} +1 -1
- package/dist/utils/upgrade.bench.js +1 -1
- package/dist/utils/upgrade.bench.js.map +1 -1
- package/dist/utils/upgrade.d.ts.map +1 -1
- package/dist/utils/upgrade.js +4 -4
- package/dist/utils/upgrade.js.map +1 -1
- package/dist/utils/validate.d.ts.map +1 -1
- package/dist/utils/validate.js +1 -1
- package/dist/utils/validate.js.map +1 -1
- package/package.json +3 -3
- package/dist/lib/Validator/Validator.test.js +0 -8
- package/dist/lib/Validator/Validator.test.js.map +0 -7
- package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +0 -1
- package/dist/plugins/fetch-urls/fetchUrls.js.map +0 -7
- package/dist/plugins/fetch-urls/fetchUrls.test.js +0 -50
- package/dist/plugins/fetch-urls/fetchUrls.test.js.map +0 -7
- package/dist/plugins/read-files/readFiles.d.ts.map +0 -1
- package/dist/plugins/read-files/readFiles.js.map +0 -7
- package/dist/plugins/read-files/readFiles.test.js +0 -20
- package/dist/plugins/read-files/readFiles.test.js.map +0 -7
- package/dist/utils/dereference.test.js +0 -300
- package/dist/utils/dereference.test.js.map +0 -7
- package/dist/utils/errors.test.js +0 -48
- package/dist/utils/errors.test.js.map +0 -7
- package/dist/utils/escapeJsonPointer.d.ts.map +0 -1
- package/dist/utils/escapeJsonPointer.test.js +0 -11
- package/dist/utils/escapeJsonPointer.test.js.map +0 -7
- package/dist/utils/getEntrypoint.d.ts.map +0 -1
- package/dist/utils/getEntrypoint.js.map +0 -7
- package/dist/utils/getEntrypoint.test.js +0 -18
- package/dist/utils/getEntrypoint.test.js.map +0 -7
- package/dist/utils/getListOfReferences.d.ts.map +0 -1
- package/dist/utils/getListOfReferences.js.map +0 -7
- package/dist/utils/getSegmentsFromPath.d.ts.map +0 -1
- package/dist/utils/getSegmentsFromPath.js.map +0 -7
- package/dist/utils/getSegmentsFromPath.test.js +0 -13
- package/dist/utils/getSegmentsFromPath.test.js.map +0 -7
- package/dist/utils/index.d.ts +0 -27
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -27
- package/dist/utils/index.js.map +0 -7
- package/dist/utils/isFilesystem.d.ts.map +0 -1
- package/dist/utils/isFilesystem.js.map +0 -7
- package/dist/utils/isJson.d.ts.map +0 -1
- package/dist/utils/isObject.d.ts.map +0 -1
- package/dist/utils/isObject.test.js +0 -23
- package/dist/utils/isObject.test.js.map +0 -7
- package/dist/utils/isYaml.d.ts.map +0 -1
- package/dist/utils/load/load.test.js +0 -361
- package/dist/utils/load/load.test.js.map +0 -7
- package/dist/utils/makeFilesystem.d.ts.map +0 -1
- package/dist/utils/makeFilesystem.js.map +0 -7
- package/dist/utils/makeFilesystem.test.js +0 -15
- package/dist/utils/makeFilesystem.test.js.map +0 -7
- package/dist/utils/normalize.test.js +0 -88
- package/dist/utils/normalize.test.js.map +0 -7
- package/dist/utils/openapi/actions/details.d.ts +0 -7
- package/dist/utils/openapi/actions/details.d.ts.map +0 -1
- package/dist/utils/openapi/actions/details.js +0 -11
- package/dist/utils/openapi/actions/details.js.map +0 -7
- package/dist/utils/openapi/actions/files.d.ts +0 -6
- package/dist/utils/openapi/actions/files.d.ts.map +0 -1
- package/dist/utils/openapi/actions/files.js +0 -9
- package/dist/utils/openapi/actions/files.js.map +0 -7
- package/dist/utils/openapi/actions/get.d.ts +0 -6
- package/dist/utils/openapi/actions/get.d.ts.map +0 -1
- package/dist/utils/openapi/actions/get.js +0 -11
- package/dist/utils/openapi/actions/get.js.map +0 -7
- package/dist/utils/openapi/actions/toJson.d.ts +0 -6
- package/dist/utils/openapi/actions/toJson.d.ts.map +0 -1
- package/dist/utils/openapi/actions/toJson.js +0 -11
- package/dist/utils/openapi/actions/toJson.js.map +0 -7
- package/dist/utils/openapi/actions/toYaml.d.ts +0 -6
- package/dist/utils/openapi/actions/toYaml.d.ts.map +0 -1
- package/dist/utils/openapi/actions/toYaml.js +0 -11
- package/dist/utils/openapi/actions/toYaml.js.map +0 -7
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts +0 -27
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +0 -1
- package/dist/utils/openapi/commands/dereferenceCommand.js +0 -27
- package/dist/utils/openapi/commands/dereferenceCommand.js.map +0 -7
- package/dist/utils/openapi/commands/filterCommand.d.ts +0 -41
- package/dist/utils/openapi/commands/filterCommand.d.ts.map +0 -1
- package/dist/utils/openapi/commands/filterCommand.js +0 -26
- package/dist/utils/openapi/commands/filterCommand.js.map +0 -7
- package/dist/utils/openapi/commands/loadCommand.d.ts +0 -8321
- package/dist/utils/openapi/commands/loadCommand.d.ts.map +0 -1
- package/dist/utils/openapi/commands/loadCommand.js +0 -42
- package/dist/utils/openapi/commands/loadCommand.js.map +0 -7
- package/dist/utils/openapi/commands/upgradeCommand.d.ts +0 -3406
- package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +0 -1
- package/dist/utils/openapi/commands/upgradeCommand.js +0 -29
- package/dist/utils/openapi/commands/upgradeCommand.js.map +0 -7
- package/dist/utils/openapi/commands/validateCommand.d.ts +0 -3451
- package/dist/utils/openapi/commands/validateCommand.d.ts.map +0 -1
- package/dist/utils/openapi/commands/validateCommand.js +0 -33
- package/dist/utils/openapi/commands/validateCommand.js.map +0 -7
- package/dist/utils/openapi/index.d.ts +0 -2
- package/dist/utils/openapi/index.d.ts.map +0 -1
- package/dist/utils/openapi/index.js +0 -2
- package/dist/utils/openapi/index.js.map +0 -7
- package/dist/utils/openapi/openapi.d.ts +0 -1272
- package/dist/utils/openapi/openapi.d.ts.map +0 -1
- package/dist/utils/openapi/openapi.js +0 -15
- package/dist/utils/openapi/openapi.js.map +0 -7
- package/dist/utils/openapi/openapi.test-d.d.ts +0 -2
- package/dist/utils/openapi/openapi.test-d.d.ts.map +0 -1
- package/dist/utils/openapi/openapi.test-d.js +0 -14
- package/dist/utils/openapi/openapi.test-d.js.map +0 -7
- package/dist/utils/openapi/openapi.test.js +0 -309
- package/dist/utils/openapi/openapi.test.js.map +0 -7
- package/dist/utils/openapi/utils/queueTask.d.ts +0 -6
- package/dist/utils/openapi/utils/queueTask.d.ts.map +0 -1
- package/dist/utils/openapi/utils/queueTask.js +0 -10
- package/dist/utils/openapi/utils/queueTask.js.map +0 -7
- package/dist/utils/openapi/utils/workThroughQueue.d.ts +0 -6
- package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +0 -1
- package/dist/utils/openapi/utils/workThroughQueue.js +0 -52
- package/dist/utils/openapi/utils/workThroughQueue.js.map +0 -7
- package/dist/utils/openapi/utils/workThroughQueue.test.js +0 -244
- package/dist/utils/openapi/utils/workThroughQueue.test.js.map +0 -7
- package/dist/utils/resolveReferences.d.ts.map +0 -1
- package/dist/utils/resolveReferences.js.map +0 -7
- package/dist/utils/resolveReferences.test.js +0 -567
- package/dist/utils/resolveReferences.test.js.map +0 -7
- package/dist/utils/toJson.d.ts.map +0 -1
- package/dist/utils/toJson.js.map +0 -7
- package/dist/utils/toYaml.d.ts.map +0 -1
- package/dist/utils/transform/index.d.ts +0 -2
- package/dist/utils/transform/index.d.ts.map +0 -1
- package/dist/utils/transform/index.js +0 -2
- package/dist/utils/transform/index.js.map +0 -7
- package/dist/utils/transform/sanitize.test.js +0 -148
- package/dist/utils/transform/sanitize.test.js.map +0 -7
- package/dist/utils/transformErrors.d.ts.map +0 -1
- package/dist/utils/transformErrors.js.map +0 -7
- package/dist/utils/transformErrors.test.js +0 -17
- package/dist/utils/transformErrors.test.js.map +0 -7
- package/dist/utils/traverse.test.js +0 -68
- package/dist/utils/traverse.test.js.map +0 -7
- package/dist/utils/unescapeJsonPointer.d.ts.map +0 -1
- package/dist/utils/unescapeJsonPointer.test.js +0 -19
- package/dist/utils/unescapeJsonPointer.test.js.map +0 -7
- package/dist/utils/upgrade.test.js +0 -57
- package/dist/utils/upgrade.test.js.map +0 -7
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +0 -1
- package/dist/utils/upgradeFromThreeToThreeOne.js.map +0 -7
- package/dist/utils/upgradeFromThreeToThreeOne.test.js +0 -462
- package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +0 -7
- package/dist/utils/upgradeFromTwoToThree.d.ts.map +0 -1
- package/dist/utils/upgradeFromTwoToThree.test.js +0 -589
- package/dist/utils/upgradeFromTwoToThree.test.js.map +0 -7
- package/dist/utils/validate.test.js +0 -64
- package/dist/utils/validate.test.js.map +0 -7
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { stringify } from "yaml";
|
|
4
|
-
import { fetchUrls } from "../../plugins/fetch-urls/fetchUrls.js";
|
|
5
|
-
import { readFiles } from "../../plugins/read-files/readFiles.js";
|
|
6
|
-
import { getEntrypoint } from "../getEntrypoint.js";
|
|
7
|
-
import { load } from "./load.js";
|
|
8
|
-
global.fetch = vi.fn();
|
|
9
|
-
describe("load", async () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
global.fetch.mockReset();
|
|
12
|
-
});
|
|
13
|
-
it("loads JS object", async () => {
|
|
14
|
-
const { filesystem } = await load(
|
|
15
|
-
{
|
|
16
|
-
openapi: "3.1.0",
|
|
17
|
-
info: {
|
|
18
|
-
title: "Hello World",
|
|
19
|
-
version: "1.0.0"
|
|
20
|
-
},
|
|
21
|
-
paths: {}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
plugins: [readFiles(), fetchUrls()]
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
28
|
-
openapi: "3.1.0",
|
|
29
|
-
info: {
|
|
30
|
-
title: "Hello World",
|
|
31
|
-
version: "1.0.0"
|
|
32
|
-
},
|
|
33
|
-
paths: {}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
it("loads JSON string", async () => {
|
|
37
|
-
const { filesystem } = await load(
|
|
38
|
-
JSON.stringify({
|
|
39
|
-
openapi: "3.1.0",
|
|
40
|
-
info: {
|
|
41
|
-
title: "Hello World",
|
|
42
|
-
version: "1.0.0"
|
|
43
|
-
},
|
|
44
|
-
paths: {}
|
|
45
|
-
}),
|
|
46
|
-
{
|
|
47
|
-
plugins: [readFiles(), fetchUrls()]
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
51
|
-
openapi: "3.1.0",
|
|
52
|
-
info: {
|
|
53
|
-
title: "Hello World",
|
|
54
|
-
version: "1.0.0"
|
|
55
|
-
},
|
|
56
|
-
paths: {}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
it("loads YAML string", async () => {
|
|
60
|
-
const { filesystem } = await load(
|
|
61
|
-
stringify({
|
|
62
|
-
openapi: "3.1.0",
|
|
63
|
-
info: {
|
|
64
|
-
title: "Hello World",
|
|
65
|
-
version: "1.0.0"
|
|
66
|
-
},
|
|
67
|
-
paths: {}
|
|
68
|
-
}),
|
|
69
|
-
{
|
|
70
|
-
plugins: [readFiles(), fetchUrls()]
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
74
|
-
openapi: "3.1.0",
|
|
75
|
-
info: {
|
|
76
|
-
title: "Hello World",
|
|
77
|
-
version: "1.0.0"
|
|
78
|
-
},
|
|
79
|
-
paths: {}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
it("loads file", async () => {
|
|
83
|
-
const EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, "../../examples/openapi.yaml");
|
|
84
|
-
const { filesystem } = await load(EXAMPLE_FILE, {
|
|
85
|
-
plugins: [readFiles(), fetchUrls()]
|
|
86
|
-
});
|
|
87
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
88
|
-
openapi: "3.1.0",
|
|
89
|
-
info: {
|
|
90
|
-
title: "Hello World",
|
|
91
|
-
version: "1.0.0"
|
|
92
|
-
},
|
|
93
|
-
paths: {}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
it("loads referenced files in files", async () => {
|
|
97
|
-
const EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, "../../../../tests/filesystem/api/openapi.yaml");
|
|
98
|
-
const { filesystem } = await load(EXAMPLE_FILE, {
|
|
99
|
-
plugins: [readFiles()]
|
|
100
|
-
});
|
|
101
|
-
expect(filesystem.map((entry) => entry.filename)).toStrictEqual([
|
|
102
|
-
null,
|
|
103
|
-
"schemas/problem.yaml",
|
|
104
|
-
"schemas/upload.yaml",
|
|
105
|
-
"./components/coordinates.yaml"
|
|
106
|
-
]);
|
|
107
|
-
expect(filesystem[0].specification).toBeTypeOf("object");
|
|
108
|
-
expect(filesystem.filter((entry) => entry.isEntrypoint).length).toBe(1);
|
|
109
|
-
});
|
|
110
|
-
it("loads url", async () => {
|
|
111
|
-
fetch.mockResolvedValue({
|
|
112
|
-
text: async () => stringify({
|
|
113
|
-
openapi: "3.1.0",
|
|
114
|
-
info: {
|
|
115
|
-
title: "Hello World",
|
|
116
|
-
version: "1.0.0"
|
|
117
|
-
},
|
|
118
|
-
paths: {}
|
|
119
|
-
})
|
|
120
|
-
});
|
|
121
|
-
const { filesystem } = await load("https://example.com/openapi.yaml", {
|
|
122
|
-
plugins: [readFiles(), fetchUrls()]
|
|
123
|
-
});
|
|
124
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
125
|
-
openapi: "3.1.0",
|
|
126
|
-
info: {
|
|
127
|
-
title: "Hello World",
|
|
128
|
-
version: "1.0.0"
|
|
129
|
-
},
|
|
130
|
-
paths: {}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
it("handles failed requests", async () => {
|
|
134
|
-
fetch.mockImplementation(() => {
|
|
135
|
-
throw new TypeError("[load.test.ts] fetch failed");
|
|
136
|
-
});
|
|
137
|
-
const { filesystem } = await load(
|
|
138
|
-
{
|
|
139
|
-
openapi: "3.1.0",
|
|
140
|
-
info: {
|
|
141
|
-
title: "Hello World",
|
|
142
|
-
version: "1.0.0"
|
|
143
|
-
},
|
|
144
|
-
paths: {
|
|
145
|
-
"/foobar": {
|
|
146
|
-
post: {
|
|
147
|
-
requestBody: {
|
|
148
|
-
content: {
|
|
149
|
-
"application/json": {
|
|
150
|
-
schema: {
|
|
151
|
-
$ref: "https://DOES_NOT_EXIST"
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
plugins: [readFiles(), fetchUrls()]
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
expect(getEntrypoint(filesystem).specification).toMatchObject({
|
|
165
|
-
openapi: "3.1.0",
|
|
166
|
-
info: {
|
|
167
|
-
title: "Hello World",
|
|
168
|
-
version: "1.0.0"
|
|
169
|
-
},
|
|
170
|
-
paths: {}
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
it("limits the number of requests", async () => {
|
|
174
|
-
fetch.mockResolvedValue({
|
|
175
|
-
text: async () => "FOOBAR"
|
|
176
|
-
});
|
|
177
|
-
const { filesystem } = await load(
|
|
178
|
-
{
|
|
179
|
-
openapi: "3.1.0",
|
|
180
|
-
info: {
|
|
181
|
-
title: "Hello World",
|
|
182
|
-
version: "1.0.0"
|
|
183
|
-
},
|
|
184
|
-
paths: {
|
|
185
|
-
"/foobar": {
|
|
186
|
-
post: {
|
|
187
|
-
requestBody: {
|
|
188
|
-
content: {
|
|
189
|
-
"application/json": {
|
|
190
|
-
schema: {
|
|
191
|
-
$ref: "https://DOES_NOT_EXIST"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
plugins: [
|
|
202
|
-
fetchUrls({
|
|
203
|
-
limit: 0
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
);
|
|
208
|
-
expect(filesystem.length).toBe(1);
|
|
209
|
-
});
|
|
210
|
-
it("loads referenced urls", async () => {
|
|
211
|
-
fetch.mockImplementation((url) => {
|
|
212
|
-
if (url === "https://example.com/openapi.yaml") {
|
|
213
|
-
return Promise.resolve({
|
|
214
|
-
text: () => Promise.resolve(
|
|
215
|
-
stringify({
|
|
216
|
-
openapi: "3.1.0",
|
|
217
|
-
info: {
|
|
218
|
-
title: "Hello World",
|
|
219
|
-
version: "1.0.0"
|
|
220
|
-
},
|
|
221
|
-
paths: {
|
|
222
|
-
"/foobar": {
|
|
223
|
-
post: {
|
|
224
|
-
requestBody: {
|
|
225
|
-
$ref: "https://example.com/foobar.json"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
)
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
if (url === "https://example.com/foobar.json") {
|
|
235
|
-
return {
|
|
236
|
-
text: async () => JSON.stringify({
|
|
237
|
-
content: {
|
|
238
|
-
"application/json": {
|
|
239
|
-
schema: {
|
|
240
|
-
type: "string",
|
|
241
|
-
example: "foobar"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
})
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
const { filesystem } = await load("https://example.com/openapi.yaml", {
|
|
250
|
-
plugins: [readFiles(), fetchUrls()]
|
|
251
|
-
});
|
|
252
|
-
expect(filesystem[0].specification).toMatchObject({
|
|
253
|
-
openapi: "3.1.0",
|
|
254
|
-
info: {
|
|
255
|
-
title: "Hello World",
|
|
256
|
-
version: "1.0.0"
|
|
257
|
-
},
|
|
258
|
-
paths: {
|
|
259
|
-
"/foobar": {
|
|
260
|
-
post: {
|
|
261
|
-
requestBody: {
|
|
262
|
-
$ref: "https://example.com/foobar.json"
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
expect(filesystem[1].specification).toMatchObject({
|
|
269
|
-
content: {
|
|
270
|
-
"application/json": {
|
|
271
|
-
schema: {
|
|
272
|
-
type: "string",
|
|
273
|
-
example: "foobar"
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
it("loads string with url reference", async () => {
|
|
280
|
-
fetch.mockResolvedValue({
|
|
281
|
-
text: async () => JSON.stringify({
|
|
282
|
-
content: {
|
|
283
|
-
"application/json": {
|
|
284
|
-
schema: {
|
|
285
|
-
type: "string",
|
|
286
|
-
example: "foobar"
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
})
|
|
291
|
-
});
|
|
292
|
-
const { filesystem } = await load(
|
|
293
|
-
stringify({
|
|
294
|
-
openapi: "3.1.0",
|
|
295
|
-
info: {
|
|
296
|
-
title: "Hello World",
|
|
297
|
-
version: "1.0.0"
|
|
298
|
-
},
|
|
299
|
-
paths: {
|
|
300
|
-
"/foobar": {
|
|
301
|
-
post: {
|
|
302
|
-
requestBody: {
|
|
303
|
-
$ref: "https://example.com/foobar.json"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}),
|
|
309
|
-
{
|
|
310
|
-
plugins: [readFiles(), fetchUrls()]
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
expect(filesystem.map((entry) => entry.filename)).toStrictEqual([null, "https://example.com/foobar.json"]);
|
|
314
|
-
expect(filesystem[0].specification).toMatchObject({
|
|
315
|
-
openapi: "3.1.0",
|
|
316
|
-
info: {
|
|
317
|
-
title: "Hello World",
|
|
318
|
-
version: "1.0.0"
|
|
319
|
-
},
|
|
320
|
-
paths: {
|
|
321
|
-
"/foobar": {
|
|
322
|
-
post: {
|
|
323
|
-
requestBody: {
|
|
324
|
-
$ref: "https://example.com/foobar.json"
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
expect(filesystem[1].specification).toMatchObject({
|
|
331
|
-
content: {
|
|
332
|
-
"application/json": {
|
|
333
|
-
schema: {
|
|
334
|
-
type: "string",
|
|
335
|
-
example: "foobar"
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
it("returns an error", async () => {
|
|
342
|
-
const { errors } = await load("INVALID", {
|
|
343
|
-
plugins: [readFiles(), fetchUrls()]
|
|
344
|
-
});
|
|
345
|
-
expect(errors).toMatchObject([
|
|
346
|
-
{
|
|
347
|
-
code: "EXTERNAL_REFERENCE_NOT_FOUND",
|
|
348
|
-
message: "Can\u2019t resolve external reference: INVALID"
|
|
349
|
-
}
|
|
350
|
-
]);
|
|
351
|
-
});
|
|
352
|
-
it("throws an error", async () => {
|
|
353
|
-
expect(async () => {
|
|
354
|
-
await load("INVALID", {
|
|
355
|
-
plugins: [readFiles(), fetchUrls()],
|
|
356
|
-
throwOnError: true
|
|
357
|
-
});
|
|
358
|
-
}).rejects.toThrowError("Can\u2019t resolve external reference: INVALID");
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
//# sourceMappingURL=load.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/utils/load/load.test.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'node:path'\nimport { beforeEach, describe, expect, it, vi } from 'vitest'\nimport { stringify } from 'yaml'\n\nimport { fetchUrls } from '../../plugins/fetch-urls/fetchUrls'\nimport { readFiles } from '../../plugins/read-files/readFiles'\nimport { getEntrypoint } from '../getEntrypoint'\nimport { load } from './load'\n\nglobal.fetch = vi.fn()\n\ndescribe('load', async () => {\n beforeEach(() => {\n // @ts-expect-error\n global.fetch.mockReset()\n })\n\n it('loads JS object', async () => {\n const { filesystem } = await load(\n {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n {\n plugins: [readFiles(), fetchUrls()],\n },\n )\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('loads JSON string', async () => {\n const { filesystem } = await load(\n JSON.stringify({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n }),\n {\n plugins: [readFiles(), fetchUrls()],\n },\n )\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('loads YAML string', async () => {\n const { filesystem } = await load(\n stringify({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n }),\n {\n plugins: [readFiles(), fetchUrls()],\n },\n )\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('loads file', async () => {\n const EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, '../../examples/openapi.yaml')\n\n const { filesystem } = await load(EXAMPLE_FILE, {\n plugins: [readFiles(), fetchUrls()],\n })\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('loads referenced files in files', async () => {\n const EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, '../../../../tests/filesystem/api/openapi.yaml')\n\n const { filesystem } = await load(EXAMPLE_FILE, {\n plugins: [readFiles()],\n })\n\n // filenames\n expect(filesystem.map((entry) => entry.filename)).toStrictEqual([\n null,\n 'schemas/problem.yaml',\n 'schemas/upload.yaml',\n './components/coordinates.yaml',\n ])\n\n // specification\n expect(filesystem[0].specification).toBeTypeOf('object')\n\n // only one entrypoint\n expect(filesystem.filter((entry) => entry.isEntrypoint).length).toBe(1)\n })\n\n it('loads url', async () => {\n // @ts-expect-error\n fetch.mockResolvedValue({\n text: async () =>\n stringify({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n }),\n })\n\n const { filesystem } = await load('https://example.com/openapi.yaml', {\n plugins: [readFiles(), fetchUrls()],\n })\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('handles failed requests', async () => {\n // Failed request\n // @ts-expect-error\n fetch.mockImplementation(() => {\n throw new TypeError('[load.test.ts] fetch failed')\n })\n\n const { filesystem } = await load(\n {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n schema: {\n $ref: 'https://DOES_NOT_EXIST',\n },\n },\n },\n },\n },\n },\n },\n },\n {\n plugins: [readFiles(), fetchUrls()],\n },\n )\n\n expect(getEntrypoint(filesystem).specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n })\n })\n\n it('limits the number of requests', async () => {\n // @ts-expect-error\n fetch.mockResolvedValue({\n text: async () => 'FOOBAR',\n })\n\n const { filesystem } = await load(\n {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n schema: {\n $ref: 'https://DOES_NOT_EXIST',\n },\n },\n },\n },\n },\n },\n },\n },\n {\n plugins: [\n fetchUrls({\n limit: 0,\n }),\n ],\n },\n )\n\n expect(filesystem.length).toBe(1)\n })\n\n it('loads referenced urls', async () => {\n // @ts-expect-error\n fetch.mockImplementation((url: string) => {\n if (url === 'https://example.com/openapi.yaml') {\n return Promise.resolve({\n text: () =>\n Promise.resolve(\n stringify({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'https://example.com/foobar.json',\n },\n },\n },\n },\n }),\n ),\n } as Response)\n }\n\n if (url === 'https://example.com/foobar.json') {\n return {\n text: async () =>\n JSON.stringify({\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n }),\n } as Response\n }\n })\n\n const { filesystem } = await load('https://example.com/openapi.yaml', {\n plugins: [readFiles(), fetchUrls()],\n })\n\n expect(filesystem[0].specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'https://example.com/foobar.json',\n },\n },\n },\n },\n })\n\n expect(filesystem[1].specification).toMatchObject({\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n })\n })\n\n it('loads string with url reference', async () => {\n // @ts-expect-error\n fetch.mockResolvedValue({\n text: async () =>\n JSON.stringify({\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n }),\n })\n\n const { filesystem } = await load(\n stringify({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'https://example.com/foobar.json',\n },\n },\n },\n },\n }),\n {\n plugins: [readFiles(), fetchUrls()],\n },\n )\n\n expect(filesystem.map((entry) => entry.filename)).toStrictEqual([null, 'https://example.com/foobar.json'])\n\n expect(filesystem[0].specification).toMatchObject({\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'https://example.com/foobar.json',\n },\n },\n },\n },\n })\n\n expect(filesystem[1].specification).toMatchObject({\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n })\n })\n\n it('returns an error', async () => {\n const { errors } = await load('INVALID', {\n plugins: [readFiles(), fetchUrls()],\n })\n\n expect(errors).toMatchObject([\n {\n code: 'EXTERNAL_REFERENCE_NOT_FOUND',\n message: 'Can\u2019t resolve external reference: INVALID',\n },\n ])\n })\n\n it('throws an error', async () => {\n expect(async () => {\n await load('INVALID', {\n plugins: [readFiles(), fetchUrls()],\n throwOnError: true,\n })\n }).rejects.toThrowError('Can\u2019t resolve external reference: INVALID')\n })\n})\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,UAAU;AACjB,SAAS,YAAY,UAAU,QAAQ,IAAI,UAAU;AACrD,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AAErB,OAAO,QAAQ,GAAG,GAAG;AAErB,SAAS,QAAQ,YAAY;AAC3B,aAAW,MAAM;AAEf,WAAO,MAAM,UAAU;AAAA,EACzB,CAAC;AAED,KAAG,mBAAmB,YAAY;AAChC,UAAM,EAAE,WAAW,IAAI,MAAM;AAAA,MAC3B;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,UACJ,OAAO;AAAA,UACP,SAAS;AAAA,QACX;AAAA,QACA,OAAO,CAAC;AAAA,MACV;AAAA,MACA;AAAA,QACE,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;AAAA,MACpC;AAAA,IACF;AAEA,WAAO,cAAc,UAAU,EAAE,aAAa,EAAE,cAAc;AAAA,MAC5D,SAAS;AAAA,MACT,MAAM;AAAA,QACJ,OAAO;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,OAAO,CAAC;AAAA,IACV,CAAC;AAAA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ACH,CAAC;AAED,KAAG,oBAAoB,YAAY;AACjC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,WAAW;AAAA,MACvC,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;AAAA,IACpC,CAAC;AAED,WAAO,MAAM,EAAE,cAAc;AAAA,MAC3B;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,KAAG,mBAAmB,YAAY;AAChC,WAAO,YAAY;AACjB,YAAM,KAAK,WAAW;AAAA,QACpB,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;AAAA,QAClC,cAAc;AAAA,MAChB,CAAC;AAAA,IACH,CAAC,EAAE,QAAQ,aAAa,gDAA2C;AAAA,EACrE,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"makeFilesystem.d.ts","sourceRoot":"","sources":["../../src/utils/makeFilesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAK5E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,UAAU,GAAE,OAAO,CAAC,eAAe,CAAM,GACxC,UAAU,CAoBZ"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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,88 +0,0 @@
|
|
|
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
|
|
@@ -1,7 +0,0 @@
|
|
|
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": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,iBAAiB;AAE1B,SAAS,aAAa,MAAM;AAC1B,KAAG,8DAA8D,MAAM;AACrE,WAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACpC,CAAC;AAED,KAAG,kFAAkF,MAAM;AACzF,UAAM,aAAa;AAAA,MACjB;AAAA,QACE,cA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.js';
|
|
3
|
-
/**
|
|
4
|
-
* Run the chained tasks and return just some basic information about the OpenAPI document
|
|
5
|
-
*/
|
|
6
|
-
export declare function details<T extends Task[]>(queue: Queue<T>): Promise<ReturnType<typeof detailsUtility>>;
|
|
7
|
-
//# sourceMappingURL=details.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
1
|
-
import { details as detailsUtility } from "../../details.js";
|
|
2
|
-
import { getEntrypoint } from "../../getEntrypoint.js";
|
|
3
|
-
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
4
|
-
async function details(queue) {
|
|
5
|
-
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
-
return detailsUtility(getEntrypoint(filesystem).specification);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
details
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=details.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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"}
|