@kubb/adapter-oas 5.20.3 → 5.21.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.
@@ -0,0 +1,12 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+ Object.defineProperty(exports, "__name", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return __name;
11
+ }
12
+ });
@@ -0,0 +1,7 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+ export { __name as t };
@@ -0,0 +1 @@
1
+ export { t as validateSpec } from "./validateSpec-Ospj1aaB.js";
@@ -0,0 +1,19 @@
1
+ require("./rolldown-runtime-BRMrT0dX.cjs");
2
+ let _readme_openapi_parser = require("@readme/openapi-parser");
3
+ // src/load/validateSpec.ts
4
+ /** Checks `document` with `@readme/openapi-parser`. It dereferences `document` in place, so pass a copy. */
5
+ async function validateSpec(document) {
6
+ try {
7
+ const result = await (0, _readme_openapi_parser.validate)(document, { validate: { errors: { colorize: false } } });
8
+ return result.valid ? { valid: true } : {
9
+ valid: false,
10
+ errors: result.errors.map(({ message }) => ({ message })),
11
+ additionalErrors: result.additionalErrors
12
+ };
13
+ } catch (error) {
14
+ return { thrown: error instanceof Error ? error.message : String(error) };
15
+ }
16
+ }
17
+ exports.validateSpec = validateSpec;
18
+
19
+ //# sourceMappingURL=validateSpec-DCiUXkMn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateSpec-DCiUXkMn.cjs","names":["validate"],"sources":["../src/load/validateSpec.ts"],"sourcesContent":["import { 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/** Checks `document` with `@readme/openapi-parser`. It dereferences `document` in place, so pass a copy. */\nexport async function validateSpec(document: Document): Promise<WorkerResult> {\n try {\n const result = await validate(document, { validate: { errors: { colorize: false } } })\n return result.valid\n ? { valid: true }\n : { valid: false, errors: result.errors.map(({ message }) => ({ message })), additionalErrors: result.additionalErrors }\n } catch (error) {\n // No `@internals/utils` here: the worker runs this file without the workspace build.\n return { thrown: error instanceof Error ? error.message : String(error) }\n }\n}\n"],"mappings":";;;;AAQA,eAAsB,aAAa,UAA2C;CAC5E,IAAI;EACF,MAAM,SAAS,OAAA,GAAMA,uBAAAA,SAAAA,CAAS,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;EACrF,OAAO,OAAO,QACV,EAAE,OAAO,KAAK,IACd;GAAE,OAAO;GAAO,QAAQ,OAAO,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE;GAAG,kBAAkB,OAAO;EAAiB;CAC3H,SAAS,OAAO;EAEd,OAAO,EAAE,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE;CAC1E;AACF"}
@@ -0,0 +1,19 @@
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { validate } from "@readme/openapi-parser";
3
+ // src/load/validateSpec.ts
4
+ /** Checks `document` with `@readme/openapi-parser`. It dereferences `document` in place, so pass a copy. */
5
+ async function validateSpec(document) {
6
+ try {
7
+ const result = await validate(document, { validate: { errors: { colorize: false } } });
8
+ return result.valid ? { valid: true } : {
9
+ valid: false,
10
+ errors: result.errors.map(({ message }) => ({ message })),
11
+ additionalErrors: result.additionalErrors
12
+ };
13
+ } catch (error) {
14
+ return { thrown: error instanceof Error ? error.message : String(error) };
15
+ }
16
+ }
17
+ export { validateSpec as t };
18
+
19
+ //# sourceMappingURL=validateSpec-Ospj1aaB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateSpec-Ospj1aaB.js","names":[],"sources":["../src/load/validateSpec.ts"],"sourcesContent":["import { 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/** Checks `document` with `@readme/openapi-parser`. It dereferences `document` in place, so pass a copy. */\nexport async function validateSpec(document: Document): Promise<WorkerResult> {\n try {\n const result = await validate(document, { validate: { errors: { colorize: false } } })\n return result.valid\n ? { valid: true }\n : { valid: false, errors: result.errors.map(({ message }) => ({ message })), additionalErrors: result.additionalErrors }\n } catch (error) {\n // No `@internals/utils` here: the worker runs this file without the workspace build.\n return { thrown: error instanceof Error ? error.message : String(error) }\n }\n}\n"],"mappings":";;;;AAQA,eAAsB,aAAa,UAA2C;CAC5E,IAAI;EACF,MAAM,SAAS,MAAM,SAAS,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;EACrF,OAAO,OAAO,QACV,EAAE,OAAO,KAAK,IACd;GAAE,OAAO;GAAO,QAAQ,OAAO,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE;GAAG,kBAAkB,OAAO;EAAiB;CAC3H,SAAS,OAAO;EAEd,OAAO,EAAE,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE;CAC1E;AACF"}
@@ -1,16 +1,7 @@
1
+ import { t as validateSpec } from "./validateSpec-Ospj1aaB.js";
1
2
  import { parentPort, workerData } from "node:worker_threads";
2
- import { validate } from "@readme/openapi-parser";
3
3
  // 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
- }
4
+ parentPort?.postMessage(await validateSpec(workerData));
14
5
  export {};
15
6
 
16
7
  //# sourceMappingURL=validateWorker.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"validateWorker.js","names":[],"sources":["../src/load/validateWorker.ts"],"sourcesContent":["import { parentPort, workerData } from 'node:worker_threads'\nimport type { Document } from '../types.ts'\nimport { validateSpec } from './validateSpec.ts'\n\n// Started by `validateDocumentInWorker`. `workerData` is a structured clone, so `validate` can dereference it in place.\nparentPort?.postMessage(await validateSpec(workerData as Document))\n"],"mappings":";;;AAKA,YAAY,YAAY,MAAM,aAAa,UAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/adapter-oas",
3
- "version": "5.20.3",
3
+ "version": "5.21.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,10 +66,10 @@
66
66
  "registry": "https://registry.npmjs.org/"
67
67
  },
68
68
  "dependencies": {
69
- "@kubb/core": "^5.20.3",
70
- "@kubb/kit": "5.20.3",
69
+ "@kubb/core": "^5.21.1",
70
+ "@kubb/kit": "5.21.1",
71
71
  "@readme/openapi-parser": "^10.0.0",
72
- "@scalar/openapi-upgrader": "^0.4.7",
72
+ "@scalar/openapi-upgrader": "^0.4.9",
73
73
  "api-ref-bundler": "0.5.1",
74
74
  "js-yaml": "^5.5.0",
75
75
  "yaml": "^2.9.1"