@kubb/adapter-oas 5.12.8 → 5.13.1
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/dist/index.cjs +333 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +340 -157
- package/dist/index.js.map +1 -1
- package/dist/validateWorker.js +17 -0
- package/dist/validateWorker.js.map +1 -0
- package/kubb-extension.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { parentPort, workerData } from "node:worker_threads";
|
|
2
|
+
import { validate } from "@readme/openapi-parser";
|
|
3
|
+
//#region src/load/validateWorker.ts
|
|
4
|
+
try {
|
|
5
|
+
const result = await validate(workerData, { validate: { errors: { colorize: false } } });
|
|
6
|
+
parentPort?.postMessage(result.valid ? { valid: true } : {
|
|
7
|
+
valid: false,
|
|
8
|
+
errors: result.errors.map(({ message }) => ({ message })),
|
|
9
|
+
additionalErrors: result.additionalErrors
|
|
10
|
+
});
|
|
11
|
+
} catch (error) {
|
|
12
|
+
parentPort?.postMessage({ thrown: error instanceof Error ? error.message : String(error) });
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export {};
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=validateWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateWorker.js","names":[],"sources":["../src/load/validateWorker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport { validate } from '@readme/openapi-parser'\nimport type { Document } from '../types.ts'\n\nexport type ValidationErrors = { errors: Array<{ message: string }>; additionalErrors: number }\n\nexport type WorkerResult = { valid: true } | ({ valid: false } & ValidationErrors) | { thrown: string }\n\n// Started by `validateDocumentInWorker`. `workerData` is a structured clone, so `validate` can dereference it in place.\ntry {\n const result = await validate(workerData as Document, { validate: { errors: { colorize: false } } })\n parentPort?.postMessage(\n (result.valid\n ? { valid: true }\n : { valid: false, errors: result.errors.map(({ message }) => ({ message })), additionalErrors: result.additionalErrors }) satisfies WorkerResult,\n )\n} catch (error) {\n parentPort?.postMessage({ thrown: error instanceof Error ? error.message : String(error) } satisfies WorkerResult)\n}\n"],"mappings":";;;AASA,IAAI;CACF,MAAM,SAAS,MAAM,SAAS,YAAwB,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;CACnG,YAAY,YACT,OAAO,QACJ,EAAE,OAAO,KAAK,IACd;EAAE,OAAO;EAAO,QAAQ,OAAO,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE;EAAG,kBAAkB,OAAO;CAAiB,CAC3H;AACF,SAAS,OAAO;CACd,YAAY,YAAY,EAAE,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,CAAwB;AACnH"}
|
package/kubb-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/adapter-oas",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"description": "OpenAPI and Swagger adapter for Kubb. Parses and validates OAS 2.0/3.x specifications into a @kubb/ast RootNode for downstream code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"registry": "https://registry.npmjs.org/"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@kubb/core": "5.
|
|
70
|
-
"@kubb/kit": "5.
|
|
71
|
-
"@readme/openapi-parser": "^
|
|
69
|
+
"@kubb/core": "5.13.1",
|
|
70
|
+
"@kubb/kit": "5.13.1",
|
|
71
|
+
"@readme/openapi-parser": "^10.0.0",
|
|
72
72
|
"@scalar/openapi-upgrader": "^0.4.5",
|
|
73
73
|
"api-ref-bundler": "0.5.1",
|
|
74
74
|
"js-yaml": "^5.5.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"openapi-types": "^12.1.3"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
|
-
"node": ">=22.
|
|
83
|
+
"node": ">=22.22"
|
|
84
84
|
},
|
|
85
85
|
"inlinedDependencies": {
|
|
86
86
|
"@types/json-schema": "7.0.15",
|