@scalar/openapi-parser 0.8.5 → 0.8.7
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 +13 -0
- package/README.md +1 -1
- package/dist/configuration/index.js +27 -1
- package/dist/index.js +26 -1
- package/dist/lib/Validator/Validator.js +127 -1
- package/dist/{utils/load/plugins → plugins/fetch-urls}/fetchUrls.d.ts +1 -1
- package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -0
- package/dist/plugins/fetch-urls/fetchUrls.js +45 -0
- package/dist/plugins/fetch-urls/index.d.ts +2 -0
- package/dist/plugins/fetch-urls/index.d.ts.map +1 -0
- package/dist/plugins/fetch-urls/index.js +1 -0
- package/dist/plugins/read-files/index.d.ts +2 -0
- package/dist/plugins/read-files/index.d.ts.map +1 -0
- package/dist/plugins/read-files/index.js +1 -0
- package/dist/plugins/read-files/readFiles.d.ts +3 -0
- package/dist/plugins/read-files/readFiles.d.ts.map +1 -0
- package/dist/plugins/read-files/readFiles.js +56 -0
- package/dist/polyfills/path.js +120 -1
- package/dist/schemas/v2.0/schema.json.js +1623 -1
- package/dist/schemas/v3.0/schema.json.js +1673 -1
- package/dist/schemas/v3.1/schema.json.js +1451 -1
- package/dist/utils/betterAjvErrors/helpers.js +108 -1
- package/dist/utils/betterAjvErrors/index.js +15 -1
- package/dist/utils/betterAjvErrors/utils.js +31 -1
- package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js +20 -1
- package/dist/utils/betterAjvErrors/validation-errors/base.js +34 -1
- package/dist/utils/betterAjvErrors/validation-errors/default.js +20 -1
- package/dist/utils/betterAjvErrors/validation-errors/enum.js +58 -1
- package/dist/utils/betterAjvErrors/validation-errors/pattern.js +20 -1
- package/dist/utils/betterAjvErrors/validation-errors/required.js +19 -1
- package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js +20 -1
- package/dist/utils/dereference.js +21 -1
- package/dist/utils/details.js +25 -1
- package/dist/utils/escapeJsonPointer.js +10 -1
- package/dist/utils/filter.js +17 -1
- package/dist/utils/getEntrypoint.js +8 -1
- package/dist/utils/getListOfReferences.js +27 -1
- package/dist/utils/getSegmentsFromPath.js +18 -1
- package/dist/utils/isFilesystem.js +11 -1
- package/dist/utils/isJson.js +11 -1
- package/dist/utils/isObject.js +6 -1
- package/dist/utils/isYaml.js +19 -1
- package/dist/utils/load/load.js +121 -1
- package/dist/utils/makeFilesystem.js +25 -1
- package/dist/utils/normalize.js +25 -1
- package/dist/utils/openapi/actions/details.js +13 -1
- package/dist/utils/openapi/actions/files.js +11 -1
- package/dist/utils/openapi/actions/get.js +13 -1
- package/dist/utils/openapi/actions/toJson.js +13 -1
- package/dist/utils/openapi/actions/toYaml.js +13 -1
- package/dist/utils/openapi/commands/dereferenceCommand.js +29 -1
- package/dist/utils/openapi/commands/filterCommand.js +28 -1
- package/dist/utils/openapi/commands/loadCommand.js +44 -1
- package/dist/utils/openapi/commands/upgradeCommand.js +31 -1
- package/dist/utils/openapi/commands/validateCommand.js +35 -1
- package/dist/utils/openapi/openapi.js +18 -1
- package/dist/utils/openapi/utils/queueTask.js +11 -1
- package/dist/utils/openapi/utils/workThroughQueue.js +67 -1
- package/dist/utils/resolveReferences.js +153 -1
- package/dist/utils/toJson.js +3 -1
- package/dist/utils/toYaml.js +5 -1
- package/dist/utils/transformErrors.js +23 -1
- package/dist/utils/traverse.d.ts +1 -1
- package/dist/utils/traverse.d.ts.map +1 -1
- package/dist/utils/traverse.js +26 -1
- package/dist/utils/unescapeJsonPointer.js +11 -1
- package/dist/utils/upgrade.js +20 -1
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts +3 -1
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +1 -1
- package/dist/utils/upgradeFromThreeToThreeOne.js +122 -1
- package/dist/utils/upgradeFromTwoToThree.d.ts.map +1 -1
- package/dist/utils/upgradeFromTwoToThree.js +174 -1
- package/dist/utils/validate.js +18 -1
- package/package.json +15 -13
- package/dist/utils/load/plugins/fetchUrls.d.ts.map +0 -1
- package/dist/utils/load/plugins/fetchUrls.js +0 -1
- package/dist/utils/load/plugins/readFiles.d.ts +0 -3
- package/dist/utils/load/plugins/readFiles.d.ts.map +0 -1
- package/dist/utils/load/plugins/readFiles.js +0 -1
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"parser",
|
|
18
18
|
"typescript"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.8.
|
|
20
|
+
"version": "0.8.7",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=18"
|
|
23
23
|
},
|
|
@@ -26,13 +26,19 @@
|
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"import": "./dist/index.js"
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
30
32
|
},
|
|
31
33
|
"./plugins/fetch-urls": {
|
|
32
|
-
"import": "./dist/
|
|
34
|
+
"import": "./dist/plugins/fetch-urls/index.js",
|
|
35
|
+
"types": "./dist/plugins/fetch-urls/index.d.ts",
|
|
36
|
+
"default": "./dist/plugins/fetch-urls/index.js"
|
|
33
37
|
},
|
|
34
38
|
"./plugins/read-files": {
|
|
35
|
-
"import": "./dist/
|
|
39
|
+
"import": "./dist/plugins/read-files/index.js",
|
|
40
|
+
"types": "./dist/plugins/read-files/index.d.ts",
|
|
41
|
+
"default": "./dist/plugins/read-files/index.js"
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
"files": [
|
|
@@ -53,27 +59,23 @@
|
|
|
53
59
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
54
60
|
"@babel/code-frame": "^7.24.7",
|
|
55
61
|
"@google-cloud/storage": "^7.12.1",
|
|
56
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
57
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
58
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
59
62
|
"@types/node": "^20.14.10",
|
|
60
63
|
"glob": "^10.3.10",
|
|
61
64
|
"json-to-ast": "^2.1.0",
|
|
62
65
|
"just-diff": "^6.0.2",
|
|
63
|
-
"rollup": "^4.16.4",
|
|
64
|
-
"rollup-plugin-output-size": "^1.4.1",
|
|
65
66
|
"tinybench": "^2.8.0",
|
|
66
|
-
"@scalar/
|
|
67
|
+
"@scalar/build-tooling": "0.1.11",
|
|
68
|
+
"@scalar/openapi-types": "0.1.3"
|
|
67
69
|
},
|
|
68
70
|
"scripts": {
|
|
69
|
-
"build": "
|
|
71
|
+
"build": "scalar-build-rollup",
|
|
70
72
|
"format": "prettier --write .",
|
|
71
73
|
"lint:check": "eslint .",
|
|
72
74
|
"lint:fix": "eslint . --fix",
|
|
73
75
|
"test": "vitest",
|
|
74
76
|
"test:prepare": "vite-node scripts/load-files.ts",
|
|
75
77
|
"test:unit": "vite-node scripts/load-files.ts && vitest",
|
|
76
|
-
"types:build": "
|
|
77
|
-
"types:check": "
|
|
78
|
+
"types:build": "scalar-types-build",
|
|
79
|
+
"types:check": "scalar-types-check"
|
|
78
80
|
}
|
|
79
81
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUrls.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/fetchUrls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,6BAA6B;;CAEzC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,KAAK,UAiDL,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t={limit:20},e=e=>{let s=0;const r={...t,...e};return{check:t=>"string"==typeof t&&!(!t.startsWith("http://")&&!t.startsWith("https://")),async get(t){if(!1!==r?.limit&&s>=r?.limit)console.warn(`[fetchUrls] Maximum number of requests reeached (${r?.limit}), skipping request`);else try{s++;const e=await(r?.fetch?r.fetch(t):fetch(t));return await e.text()}catch(e){console.error("[fetchUrls]",e.message,`(${t})`)}}}};export{e as fetchUrls,t as fetchUrlsDefaultConfiguration};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/readFiles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,SAAS,EAAE,MAAM,UAoD7B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"node:fs";import{ERRORS as r}from"../../../configuration/index.js";import{dirname as o,join as s}from"../../../polyfills/path.js";import{isJson as e}from"../../isJson.js";import{isYaml as i}from"../../isYaml.js";const n=()=>({check:t=>"string"==typeof t&&(!t.startsWith("http://")&&!t.startsWith("https://")&&(!t.includes("\n")&&(!e(t)&&!i(t)))),async get(o){if(!t.existsSync(o))throw new Error(r.FILE_DOES_NOT_EXIST.replace("%s",o));try{return t.readFileSync(o,"utf-8")}catch(t){console.error("[readFiles]",t)}},resolvePath(t,r){const e=o(t);return s(e,r)},getDir:t=>o(t),getFilename:t=>t.split("/").pop()});export{n as readFiles};
|