@kubb/plugin-oas 2.25.2 → 2.25.3

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.
Files changed (42) hide show
  1. package/dist/{Schema-DefwBJMc.d.ts → Schema-CkGDfE-r.d.ts} +1 -1
  2. package/dist/{Schema-an5hOrjZ.d.cts → Schema-CxKiczSe.d.cts} +1 -1
  3. package/dist/{SchemaMapper-CsBQ6eEx.d.cts → SchemaMapper-BLcXlDBz.d.cts} +0 -1
  4. package/dist/{SchemaMapper-CsBQ6eEx.d.ts → SchemaMapper-BLcXlDBz.d.ts} +0 -1
  5. package/dist/{chunk-QSM6A5QX.js → chunk-7NYIF73B.js} +4 -4
  6. package/dist/{chunk-QSM6A5QX.js.map → chunk-7NYIF73B.js.map} +1 -1
  7. package/dist/{chunk-ZZ7ZC4TT.js → chunk-C7EB64G2.js} +3 -3
  8. package/dist/chunk-C7EB64G2.js.map +1 -0
  9. package/dist/{chunk-K4GEQ3C2.cjs → chunk-IOHUYXT5.cjs} +22 -22
  10. package/dist/chunk-IOHUYXT5.cjs.map +1 -0
  11. package/dist/{chunk-J7IF3KA3.cjs → chunk-P42X362U.cjs} +3 -3
  12. package/dist/chunk-P42X362U.cjs.map +1 -0
  13. package/dist/{chunk-3UN2S6P2.cjs → chunk-QLJIL3U5.cjs} +3 -3
  14. package/dist/{chunk-3UN2S6P2.cjs.map → chunk-QLJIL3U5.cjs.map} +1 -1
  15. package/dist/{chunk-UKUEVTRB.cjs → chunk-REUEIIL3.cjs} +25 -25
  16. package/dist/{chunk-UKUEVTRB.cjs.map → chunk-REUEIIL3.cjs.map} +1 -1
  17. package/dist/{chunk-Y272OQMW.js → chunk-UB552H4J.js} +3 -3
  18. package/dist/chunk-UB552H4J.js.map +1 -0
  19. package/dist/{chunk-GUPCIAYT.js → chunk-Y4V7HHX7.js} +2 -2
  20. package/dist/components.cjs +5 -5
  21. package/dist/components.d.cts +2 -2
  22. package/dist/components.d.ts +2 -2
  23. package/dist/components.js +3 -3
  24. package/dist/hooks.cjs +13 -13
  25. package/dist/hooks.d.cts +2 -2
  26. package/dist/hooks.d.ts +2 -2
  27. package/dist/hooks.js +3 -3
  28. package/dist/index.cjs +20 -20
  29. package/dist/index.d.cts +2 -2
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.js +3 -3
  32. package/dist/utils.cjs +8 -8
  33. package/dist/utils.js +2 -2
  34. package/package.json +11 -11
  35. package/src/SchemaGenerator.ts +1 -1
  36. package/src/SchemaMapper.ts +1 -1
  37. package/src/components/Schema.tsx +1 -3
  38. package/dist/chunk-J7IF3KA3.cjs.map +0 -1
  39. package/dist/chunk-K4GEQ3C2.cjs.map +0 -1
  40. package/dist/chunk-Y272OQMW.js.map +0 -1
  41. package/dist/chunk-ZZ7ZC4TT.js.map +0 -1
  42. /package/dist/{chunk-GUPCIAYT.js.map → chunk-Y4V7HHX7.js.map} +0 -0
@@ -35,9 +35,9 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
35
35
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
36
36
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
37
37
 
38
- // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.5_@types+node@20.14.15__jiti@1.21.6_postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js
38
+ // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js
39
39
  var init_esm_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.5_@types+node@20.14.15__jiti@1.21.6_postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js"() {
40
+ "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js"() {
41
41
  "use strict";
42
42
  }
43
43
  });
@@ -98,4 +98,4 @@ export {
98
98
  getSchemas,
99
99
  getSchemaFactory
100
100
  };
101
- //# sourceMappingURL=chunk-Y272OQMW.js.map
101
+ //# sourceMappingURL=chunk-UB552H4J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.7_@types+node@20.16.1__jiti@1.21.6_postcss@8.4.41_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/esm_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import type { Oas, OasTypes, contentType } from '@kubb/oas'\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\nexport type GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n}\n\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'] }: GetSchemasProps): Record<string, OasTypes.SchemaObject> {\n const components = oas.getDefinition().components\n\n let schemas: Record<string, OasTypes.SchemaObject> = {}\n\n if (includes.includes('schemas')) {\n schemas = {\n ...schemas,\n ...((components?.schemas as Record<string, OasTypes.SchemaObject>) || {}),\n }\n }\n\n const requestBodies = components?.requestBodies || {}\n if (includes.includes('responses')) {\n const responses = components?.responses || {}\n\n Object.entries(responses).forEach(([name, response]: [string, OasTypes.ResponseObject]) => {\n if (response.content && !schemas[name]) {\n const firstContentType = Object.keys(response.content)[0] || 'application/json'\n schemas[name] = response.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n if (includes.includes('requestBodies')) {\n Object.entries(requestBodies).forEach(([name, request]: [string, OasTypes.RequestBodyObject]) => {\n if (request.content && !schemas[name]) {\n const firstContentType = Object.keys(request.content)[0] || 'application/json'\n schemas[name] = request.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n return schemas\n}\n","import { isOpenApiV3_1Document } from '@kubb/oas'\n\nimport type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schema?: (TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.0'\n }\n | {\n schema?: (TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.1'\n }\n\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema?: SchemaObject) => SchemaResult<TWithRef> {\n return (schema?: SchemaObject) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schema,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAUO,SAAS,WAAW,EAAE,KAAK,aAAa,WAAW,CAAC,WAAW,iBAAiB,WAAW,EAAE,GAA2D;AAC7J,QAAM,aAAa,IAAI,cAAc,EAAE;AAEvC,MAAI,UAAiD,CAAC;AAEtD,MAAI,SAAS,SAAS,SAAS,GAAG;AAChC,cAAU;AAAA,MACR,GAAG;AAAA,MACH,GAAK,YAAY,WAAqD,CAAC;AAAA,IACzE;AAAA,EACF;AAEA,QAAM,gBAAgB,YAAY,iBAAiB,CAAC;AACpD,MAAI,SAAS,SAAS,WAAW,GAAG;AAClC,UAAM,YAAY,YAAY,aAAa,CAAC;AAE5C,WAAO,QAAQ,SAAS,EAAE,QAAQ,CAAC,CAAC,MAAM,QAAQ,MAAyC;AACzF,UAAI,SAAS,WAAW,CAAC,QAAQ,IAAI,GAAG;AACtC,cAAM,mBAAmB,OAAO,KAAK,SAAS,OAAO,EAAE,CAAC,KAAK;AAC7D,gBAAQ,IAAI,IAAI,SAAS,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACvE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MAAI,SAAS,SAAS,eAAe,GAAG;AACtC,WAAO,QAAQ,aAAa,EAAE,QAAQ,CAAC,CAAC,MAAM,OAAO,MAA4C;AAC/F,UAAI,QAAQ,WAAW,CAAC,QAAQ,IAAI,GAAG;AACrC,cAAM,mBAAmB,OAAO,KAAK,QAAQ,OAAO,EAAE,CAAC,KAAK;AAC5D,gBAAQ,IAAI,IAAI,QAAQ,UAAU,eAAe,gBAAgB,GAAG;AAAA,MACtE;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;;;AC5CA;AAAA,SAAS,6BAA6B;AAuB/B,SAAS,iBAAmD,KAA6D;AAC9H,SAAO,CAAC,WAA0B;AAChC,UAAM,UAAU,sBAAsB,IAAI,GAAG,IAAI,QAAQ;AAEzD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-Y272OQMW.js";
3
+ } from "./chunk-UB552H4J.js";
4
4
 
5
5
  // src/utils/parseFromConfig.ts
6
6
  init_esm_shims();
@@ -32,4 +32,4 @@ function parseFromConfig(config, options = {}, oasClass = Oas) {
32
32
  export {
33
33
  parseFromConfig
34
34
  };
35
- //# sourceMappingURL=chunk-GUPCIAYT.js.map
35
+ //# sourceMappingURL=chunk-Y4V7HHX7.js.map
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkUKUEVTRBcjs = require('./chunk-UKUEVTRB.cjs');
6
- require('./chunk-K4GEQ3C2.cjs');
5
+ var _chunkREUEIIL3cjs = require('./chunk-REUEIIL3.cjs');
6
+ require('./chunk-IOHUYXT5.cjs');
7
7
 
8
8
 
9
- var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
9
+ var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
10
10
 
11
11
  // src/components/index.ts
12
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
12
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.Oas = _chunkUKUEVTRBcjs.Oas; exports.Operation = _chunkUKUEVTRBcjs.Operation; exports.Schema = _chunkUKUEVTRBcjs.Schema;
17
+ exports.Oas = _chunkREUEIIL3cjs.Oas; exports.Operation = _chunkREUEIIL3cjs.Operation; exports.Schema = _chunkREUEIIL3cjs.Schema;
18
18
  //# sourceMappingURL=components.cjs.map
@@ -1,10 +1,10 @@
1
- import { S as Schema } from './Schema-an5hOrjZ.cjs';
1
+ import { S as Schema } from './Schema-CxKiczSe.cjs';
2
2
  import * as react from 'react';
3
3
  import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
4
4
  import { KubbNode } from '@kubb/react';
5
5
  import { a as OperationGenerator } from './OperationGenerator-BV6QRtkW.cjs';
6
6
  import '@kubb/fs/types';
7
- import './SchemaMapper-CsBQ6eEx.cjs';
7
+ import './SchemaMapper-BLcXlDBz.cjs';
8
8
  import '@kubb/core';
9
9
  import './types-Db0qp8u-.cjs';
10
10
  import '@kubb/oas/parser';
@@ -1,10 +1,10 @@
1
- import { S as Schema } from './Schema-DefwBJMc.js';
1
+ import { S as Schema } from './Schema-CkGDfE-r.js';
2
2
  import * as react from 'react';
3
3
  import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
4
4
  import { KubbNode } from '@kubb/react';
5
5
  import { a as OperationGenerator } from './OperationGenerator-DO5tNGuT.js';
6
6
  import '@kubb/fs/types';
7
- import './SchemaMapper-CsBQ6eEx.js';
7
+ import './SchemaMapper-BLcXlDBz.js';
8
8
  import '@kubb/core';
9
9
  import './types-Db0qp8u-.js';
10
10
  import '@kubb/oas/parser';
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  Schema
5
- } from "./chunk-QSM6A5QX.js";
6
- import "./chunk-ZZ7ZC4TT.js";
5
+ } from "./chunk-7NYIF73B.js";
6
+ import "./chunk-C7EB64G2.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-Y272OQMW.js";
9
+ } from "./chunk-UB552H4J.js";
10
10
 
11
11
  // src/components/index.ts
12
12
  init_esm_shims();
package/dist/hooks.cjs CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkUKUEVTRBcjs = require('./chunk-UKUEVTRB.cjs');
6
- require('./chunk-K4GEQ3C2.cjs');
5
+ var _chunkREUEIIL3cjs = require('./chunk-REUEIIL3.cjs');
6
+ require('./chunk-IOHUYXT5.cjs');
7
7
 
8
8
 
9
- var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
9
+ var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
10
10
 
11
11
  // src/hooks/index.ts
12
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
12
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
  // src/hooks/useOas.ts
15
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
15
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
16
16
  var _react = require('@kubb/react');
17
17
  function useOas() {
18
- const { oas } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
18
+ const { oas } = _react.useContext.call(void 0, _chunkREUEIIL3cjs.Oas.Context);
19
19
  if (!oas) {
20
20
  throw new Error("Oas is not defined");
21
21
  }
@@ -23,10 +23,10 @@ function useOas() {
23
23
  }
24
24
 
25
25
  // src/hooks/useOperation.ts
26
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
26
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
  function useOperation() {
29
- const { operation } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Operation.Context);
29
+ const { operation } = _react.useContext.call(void 0, _chunkREUEIIL3cjs.Operation.Context);
30
30
  if (!operation) {
31
31
  throw new Error("Operation is not defined");
32
32
  }
@@ -34,11 +34,11 @@ function useOperation() {
34
34
  }
35
35
 
36
36
  // src/hooks/useOperationManager.ts
37
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
37
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
38
38
 
39
39
  function useOperationManager() {
40
40
  const { plugin, pluginManager } = _react.useApp.call(void 0, );
41
- const { generator } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
41
+ const { generator } = _react.useContext.call(void 0, _chunkREUEIIL3cjs.Oas.Context);
42
42
  if (!generator) {
43
43
  throw new Error(`'generator' is not defined`);
44
44
  }
@@ -139,10 +139,10 @@ function useOperationManager() {
139
139
  }
140
140
 
141
141
  // src/hooks/useOperations.ts
142
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
142
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
143
143
 
144
144
  function useOperations({ method, path } = {}) {
145
- const { operations } = _react.useContext.call(void 0, _chunkUKUEVTRBcjs.Oas.Context);
145
+ const { operations } = _react.useContext.call(void 0, _chunkREUEIIL3cjs.Oas.Context);
146
146
  if (!operations) {
147
147
  throw new Error("Operations is not defined");
148
148
  }
@@ -161,5 +161,5 @@ function useOperations({ method, path } = {}) {
161
161
 
162
162
 
163
163
 
164
- exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkUKUEVTRBcjs.useSchema;
164
+ exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkREUEIIL3cjs.useSchema;
165
165
  //# sourceMappingURL=hooks.cjs.map
package/dist/hooks.d.cts CHANGED
@@ -2,11 +2,11 @@ import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
2
  import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
3
  import * as KubbFile from '@kubb/fs/types';
4
4
  import { f as OperationSchemas } from './types-Db0qp8u-.cjs';
5
- import { a as SchemaContextProps } from './Schema-an5hOrjZ.cjs';
5
+ import { a as SchemaContextProps } from './Schema-CxKiczSe.cjs';
6
6
  import '@kubb/oas/parser';
7
7
  import 'react';
8
8
  import '@kubb/react';
9
- import './SchemaMapper-CsBQ6eEx.cjs';
9
+ import './SchemaMapper-BLcXlDBz.cjs';
10
10
 
11
11
  declare function useOas(): Oas;
12
12
 
package/dist/hooks.d.ts CHANGED
@@ -2,11 +2,11 @@ import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
2
  import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
3
  import * as KubbFile from '@kubb/fs/types';
4
4
  import { f as OperationSchemas } from './types-Db0qp8u-.js';
5
- import { a as SchemaContextProps } from './Schema-DefwBJMc.js';
5
+ import { a as SchemaContextProps } from './Schema-CkGDfE-r.js';
6
6
  import '@kubb/oas/parser';
7
7
  import 'react';
8
8
  import '@kubb/react';
9
- import './SchemaMapper-CsBQ6eEx.js';
9
+ import './SchemaMapper-BLcXlDBz.js';
10
10
 
11
11
  declare function useOas(): Oas;
12
12
 
package/dist/hooks.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  useSchema
5
- } from "./chunk-QSM6A5QX.js";
6
- import "./chunk-ZZ7ZC4TT.js";
5
+ } from "./chunk-7NYIF73B.js";
6
+ import "./chunk-C7EB64G2.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-Y272OQMW.js";
9
+ } from "./chunk-UB552H4J.js";
10
10
 
11
11
  // src/hooks/index.ts
12
12
  init_esm_shims();
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk3UN2S6P2cjs = require('./chunk-3UN2S6P2.cjs');
3
+ var _chunkQLJIL3U5cjs = require('./chunk-QLJIL3U5.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkK4GEQ3C2cjs = require('./chunk-K4GEQ3C2.cjs');
8
+ var _chunkIOHUYXT5cjs = require('./chunk-IOHUYXT5.cjs');
9
9
 
10
10
 
11
11
 
@@ -13,13 +13,13 @@ var _chunkK4GEQ3C2cjs = require('./chunk-K4GEQ3C2.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
16
+ var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
17
17
 
18
18
  // src/index.ts
19
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
19
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
20
20
 
21
21
  // src/plugin.ts
22
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
22
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _core = require('@kubb/core');
25
25
  var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
@@ -36,7 +36,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
36
36
  } = options;
37
37
  const getOas = async ({ config, logger, formatOptions }) => {
38
38
  try {
39
- const oas = await _chunk3UN2S6P2cjs.parseFromConfig.call(void 0, config, formatOptions, oasClass);
39
+ const oas = await _chunkQLJIL3U5cjs.parseFromConfig.call(void 0, config, formatOptions, oasClass);
40
40
  if (validate) {
41
41
  await oas.valdiate();
42
42
  }
@@ -44,7 +44,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
44
44
  } catch (e) {
45
45
  const error = e;
46
46
  logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
47
- return _chunk3UN2S6P2cjs.parseFromConfig.call(void 0, config, {}, oasClass);
47
+ return _chunkQLJIL3U5cjs.parseFromConfig.call(void 0, config, {}, oasClass);
48
48
  }
49
49
  };
50
50
  return {
@@ -58,7 +58,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
58
58
  },
59
59
  async getSchemas({ includes } = {}) {
60
60
  const oas = await this.getOas();
61
- return _chunkJ7IF3KA3cjs.getSchemas.call(void 0, { oas, contentType, includes });
61
+ return _chunkP42X362Ucjs.getSchemas.call(void 0, { oas, contentType, includes });
62
62
  },
63
63
  async getBaseURL() {
64
64
  const oasInstance = await this.getOas();
@@ -97,7 +97,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
97
97
  }
98
98
  });
99
99
  await oas.dereference();
100
- const schemas = _chunkJ7IF3KA3cjs.getSchemas.call(void 0, { oas, contentType });
100
+ const schemas = _chunkP42X362Ucjs.getSchemas.call(void 0, { oas, contentType });
101
101
  const mapSchema = async ([name, schema]) => {
102
102
  const resolvedPath = this.resolvePath({
103
103
  baseName: `${name}.json`,
@@ -127,21 +127,21 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
127
127
  });
128
128
 
129
129
  // src/OperationGenerator.ts
130
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
130
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
131
131
 
132
132
 
133
133
  var _operationsByMethod, _OperationGenerator_instances, getOptions_fn, isExcluded_fn, isIncluded_fn, methods_get;
134
134
  var OperationGenerator = class extends _core.Generator {
135
135
  constructor() {
136
136
  super(...arguments);
137
- _chunkJ7IF3KA3cjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
138
- _chunkJ7IF3KA3cjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
137
+ _chunkP42X362Ucjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
138
+ _chunkP42X362Ucjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
139
139
  }
140
140
  get operationsByMethod() {
141
- return _chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _operationsByMethod);
141
+ return _chunkP42X362Ucjs.__privateGet.call(void 0, this, _operationsByMethod);
142
142
  }
143
143
  set operationsByMethod(paths) {
144
- _chunkJ7IF3KA3cjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
144
+ _chunkP42X362Ucjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
145
145
  }
146
146
  getSchemas(operation, { forStatusCode, resolveName = (name) => name } = {}) {
147
147
  const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
@@ -224,9 +224,9 @@ var OperationGenerator = class extends _core.Generator {
224
224
  const methods = Object.keys(method);
225
225
  methods.forEach((method2) => {
226
226
  const operation = oas.operation(path2, method2);
227
- if (operation && _chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
228
- const isExcluded = _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
229
- const isIncluded = this.context.include ? _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
227
+ if (operation && _chunkP42X362Ucjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
228
+ const isExcluded = _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
229
+ const isIncluded = this.context.include ? _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
230
230
  if (isIncluded && !isExcluded) {
231
231
  if (!acc[path2]) {
232
232
  acc[path2] = {};
@@ -247,8 +247,8 @@ var OperationGenerator = class extends _core.Generator {
247
247
  const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
248
248
  methods.forEach((method) => {
249
249
  const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
250
- const options = _chunkJ7IF3KA3cjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
251
- const promiseMethod = _optionalChain([_chunkJ7IF3KA3cjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
250
+ const options = _chunkP42X362Ucjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
251
+ const promiseMethod = _optionalChain([_chunkP42X362Ucjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
252
252
  ...this.options,
253
253
  ...options
254
254
  })]);
@@ -403,5 +403,5 @@ var src_default = definePluginDefault;
403
403
 
404
404
 
405
405
 
406
- exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkK4GEQ3C2cjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkK4GEQ3C2cjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkK4GEQ3C2cjs.schemaKeywords;
406
+ exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkIOHUYXT5cjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkIOHUYXT5cjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkIOHUYXT5cjs.schemaKeywords;
407
407
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -5,8 +5,8 @@ export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as Opera
5
5
  export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-BV6QRtkW.cjs';
6
6
  import * as KubbFile from '@kubb/fs/types';
7
7
  import { SchemaObject, Oas, contentType } from '@kubb/oas';
8
- import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.cjs';
9
- export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-CsBQ6eEx.cjs';
8
+ import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-BLcXlDBz.cjs';
9
+ export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-BLcXlDBz.cjs';
10
10
  import '@kubb/oas/parser';
11
11
 
12
12
  declare const pluginOasName = "plugin-oas";
package/dist/index.d.ts CHANGED
@@ -5,8 +5,8 @@ export { A as API, E as Exclude, I as Include, f as OperationSchemas, g as Opera
5
5
  export { G as GetOperationGeneratorOptions, a as OperationGenerator, O as OperationMethodResult } from './OperationGenerator-DO5tNGuT.js';
6
6
  import * as KubbFile from '@kubb/fs/types';
7
7
  import { SchemaObject, Oas, contentType } from '@kubb/oas';
8
- import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-CsBQ6eEx.js';
9
- export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-CsBQ6eEx.js';
8
+ import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-BLcXlDBz.js';
9
+ export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-BLcXlDBz.js';
10
10
  import '@kubb/oas/parser';
11
11
 
12
12
  declare const pluginOasName = "plugin-oas";
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseFromConfig
3
- } from "./chunk-GUPCIAYT.js";
3
+ } from "./chunk-Y4V7HHX7.js";
4
4
  import {
5
5
  SchemaGenerator,
6
6
  isKeyword,
7
7
  schemaKeywords
8
- } from "./chunk-ZZ7ZC4TT.js";
8
+ } from "./chunk-C7EB64G2.js";
9
9
  import {
10
10
  __privateAdd,
11
11
  __privateGet,
@@ -13,7 +13,7 @@ import {
13
13
  __privateSet,
14
14
  getSchemas,
15
15
  init_esm_shims
16
- } from "./chunk-Y272OQMW.js";
16
+ } from "./chunk-UB552H4J.js";
17
17
 
18
18
  // src/index.ts
19
19
  init_esm_shims();
package/dist/utils.cjs CHANGED
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk3UN2S6P2cjs = require('./chunk-3UN2S6P2.cjs');
3
+ var _chunkQLJIL3U5cjs = require('./chunk-QLJIL3U5.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkJ7IF3KA3cjs = require('./chunk-J7IF3KA3.cjs');
8
+ var _chunkP42X362Ucjs = require('./chunk-P42X362U.cjs');
9
9
 
10
10
  // src/utils/index.ts
11
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
11
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
12
12
 
13
13
  // src/utils/getComments.ts
14
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
14
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
15
15
  var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
16
16
  var _utils = require('@kubb/core/utils');
17
17
  function getComments(operation) {
@@ -24,7 +24,7 @@ function getComments(operation) {
24
24
  }
25
25
 
26
26
  // src/utils/getGroupedByTagFiles.ts
27
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
27
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
28
28
  var _path = require('path');
29
29
  var _core = require('@kubb/core');
30
30
 
@@ -69,7 +69,7 @@ async function getGroupedByTagFiles({ logger, files, plugin, template, exportAs,
69
69
  }
70
70
 
71
71
  // src/utils/getParams.ts
72
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
72
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
73
73
  var _oas = require('@kubb/oas');
74
74
 
75
75
  function getASTParams(operationSchema, {
@@ -104,7 +104,7 @@ function getPathParams(operationSchema, options = {}) {
104
104
  }
105
105
 
106
106
  // src/utils/refSorter.ts
107
- _chunkJ7IF3KA3cjs.init_cjs_shims.call(void 0, );
107
+ _chunkP42X362Ucjs.init_cjs_shims.call(void 0, );
108
108
  function refsSorter(a, b) {
109
109
  if (_optionalChain([Object, 'access', _10 => _10.keys, 'call', _11 => _11(a.import.refs), 'optionalAccess', _12 => _12.length]) < _optionalChain([Object, 'access', _13 => _13.keys, 'call', _14 => _14(b.import.refs), 'optionalAccess', _15 => _15.length])) {
110
110
  return -1;
@@ -123,5 +123,5 @@ function refsSorter(a, b) {
123
123
 
124
124
 
125
125
 
126
- exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkJ7IF3KA3cjs.getSchemaFactory; exports.getSchemas = _chunkJ7IF3KA3cjs.getSchemas; exports.parseFromConfig = _chunk3UN2S6P2cjs.parseFromConfig; exports.refsSorter = refsSorter;
126
+ exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkP42X362Ucjs.getSchemaFactory; exports.getSchemas = _chunkP42X362Ucjs.getSchemas; exports.parseFromConfig = _chunkQLJIL3U5cjs.parseFromConfig; exports.refsSorter = refsSorter;
127
127
  //# sourceMappingURL=utils.cjs.map
package/dist/utils.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseFromConfig
3
- } from "./chunk-GUPCIAYT.js";
3
+ } from "./chunk-Y4V7HHX7.js";
4
4
  import {
5
5
  getSchemaFactory,
6
6
  getSchemas,
7
7
  init_esm_shims
8
- } from "./chunk-Y272OQMW.js";
8
+ } from "./chunk-UB552H4J.js";
9
9
 
10
10
  // src/utils/index.ts
11
11
  init_esm_shims();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-oas",
3
- "version": "2.25.2",
3
+ "version": "2.25.3",
4
4
  "description": "Generator swagger",
5
5
  "keywords": [
6
6
  "typescript",
@@ -67,24 +67,24 @@
67
67
  ],
68
68
  "dependencies": {
69
69
  "@stoplight/yaml": "^4.3.0",
70
- "remeda": "^2.10.1",
71
- "@kubb/core": "2.25.2",
72
- "@kubb/fs": "2.25.2",
73
- "@kubb/oas": "2.25.2",
74
- "@kubb/react": "2.25.2"
70
+ "remeda": "^2.11.0",
71
+ "@kubb/core": "2.25.3",
72
+ "@kubb/fs": "2.25.3",
73
+ "@kubb/oas": "2.25.3",
74
+ "@kubb/react": "2.25.3"
75
75
  },
76
76
  "devDependencies": {
77
- "@types/react": "^18.3.3",
77
+ "@types/react": "^18.3.4",
78
78
  "@types/react-dom": "^18.3.0",
79
79
  "react": "^18.3.1",
80
80
  "tsup": "^8.2.4",
81
81
  "typescript": "^5.5.4",
82
- "@kubb/config-biome": "2.25.2",
83
- "@kubb/config-ts": "2.25.2",
84
- "@kubb/config-tsup": "2.25.2"
82
+ "@kubb/config-biome": "2.25.3",
83
+ "@kubb/config-ts": "2.25.3",
84
+ "@kubb/config-tsup": "2.25.3"
85
85
  },
86
86
  "peerDependencies": {
87
- "@kubb/react": "2.25.2"
87
+ "@kubb/react": "2.25.3"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=18"
@@ -360,7 +360,7 @@ export abstract class SchemaGenerator<
360
360
  return [
361
361
  {
362
362
  keyword: schemaKeywords.ref,
363
- args: { name: ref.propertyName, path: ref?.path, isTypeOnly: false },
363
+ args: { name: ref.propertyName, path: ref?.path },
364
364
  },
365
365
  ]
366
366
  }
@@ -51,7 +51,7 @@ export type SchemaKeywordMapper = {
51
51
  union: { keyword: 'union'; args: Schema[] }
52
52
  ref: {
53
53
  keyword: 'ref'
54
- args: { name: string; path: KubbFile.OptionalPath; isTypeOnly?: boolean }
54
+ args: { name: string; path: KubbFile.OptionalPath }
55
55
  }
56
56
  matches: { keyword: 'matches'; args?: string }
57
57
  boolean: { keyword: 'boolean' }
@@ -118,9 +118,7 @@ Schema.Imports = ({ isTypeOnly, extName }: SchemaImportsProps): ReactNode => {
118
118
  return undefined
119
119
  }
120
120
 
121
- return (
122
- <File.Import key={i} extName={extName} root={root} name={[item.args.name]} path={item.args.path} isTypeOnly={item.args.isTypeOnly ?? isTypeOnly} />
123
- )
121
+ return <File.Import key={i} extName={extName} root={root} name={[item.args.name]} path={item.args.path} isTypeOnly={isTypeOnly} />
124
122
  })
125
123
  .filter(Boolean)}
126
124
  </>
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-J7IF3KA3.cjs","../../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.47.5_@types+node@20.14.15__jiti@1.21.6_postcss@8.4.40_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js","../src/utils/getSchemas.ts","../src/utils/getSchemaFactory.ts"],"names":[],"mappings":"AAAA,ilBAAI,SAAS,EAAE,MAAM,CAAC,MAAM;AAC5B,IAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,iBAAiB,EAAE,MAAM,CAAC,wBAAwB;AACtD,IAAI,kBAAkB,EAAE,MAAM,CAAC,mBAAmB;AAClD,IAAI,aAAa,EAAE,MAAM,CAAC,cAAc;AACxC,IAAI,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc;AAClD,IAAI,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG;AAC3B,EAAE,MAAM,SAAS,CAAC,GAAG,CAAC;AACtB,CAAC;AACD,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,MAAM,CAAC,EAAE;AAC3C,EAAE,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG;AACrE,CAAC;AACD,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,SAAS,CAAC,EAAE;AACnD,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAA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AQ,QAAA,GAAW,CAAC,OAAA,CAAQ,IAAI,CAAA,EAAG;AACrC,QAAA,MAAM,iBAAA,EAAmB,MAAA,CAAO,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAA,CAAE,CAAC,EAAA,GAAK,kBAAA;AAC5D,QAAA,OAAA,CAAQ,IAAI,EAAA,kBAAI,OAAA,qBAAQ,OAAA,4BAAA,CAAU,YAAA,GAAe,gBAAgB,CAAA,6BAAG,QAAA;AAAA,MACtE;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO,OAAA;AACT;AF+BA;AACA;AG5EA,cAAA,CAAA,CAAA;AAAA,gCAAsC;AAuB/B,SAAS,gBAAA,CAAmD,GAAA,EAA6D;AAC9H,EAAA,OAAO,CAAC,MAAA,EAAA,GAA0B;AAChC,IAAA,MAAM,QAAA,EAAU,wCAAA,GAAsB,CAAI,GAAG,EAAA,EAAI,MAAA,EAAQ,KAAA;AAEzD,IAAA,OAAO;AAAA,MACL,MAAA;AAAA,MACA;AAAA,IACF,CAAA;AAAA,EACF,CAAA;AACF;AHwDA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,4UAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-oas/dist/chunk-J7IF3KA3.cjs","sourcesContent":[null,"// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","import type { Oas, OasTypes, contentType } from '@kubb/oas'\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\nexport type GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n}\n\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'] }: GetSchemasProps): Record<string, OasTypes.SchemaObject> {\n const components = oas.getDefinition().components\n\n let schemas: Record<string, OasTypes.SchemaObject> = {}\n\n if (includes.includes('schemas')) {\n schemas = {\n ...schemas,\n ...((components?.schemas as Record<string, OasTypes.SchemaObject>) || {}),\n }\n }\n\n const requestBodies = components?.requestBodies || {}\n if (includes.includes('responses')) {\n const responses = components?.responses || {}\n\n Object.entries(responses).forEach(([name, response]: [string, OasTypes.ResponseObject]) => {\n if (response.content && !schemas[name]) {\n const firstContentType = Object.keys(response.content)[0] || 'application/json'\n schemas[name] = response.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n if (includes.includes('requestBodies')) {\n Object.entries(requestBodies).forEach(([name, request]: [string, OasTypes.RequestBodyObject]) => {\n if (request.content && !schemas[name]) {\n const firstContentType = Object.keys(request.content)[0] || 'application/json'\n schemas[name] = request.content?.[contentType || firstContentType]?.schema as OasTypes.SchemaObject\n }\n })\n }\n\n return schemas\n}\n","import { isOpenApiV3_1Document } from '@kubb/oas'\n\nimport type { Oas, OpenAPIV3, OpenAPIV3_1, SchemaObject } from '@kubb/oas'\n\n/**\n * Make it possible to narrow down the schema based on a specific version(3 or 3.1)\n */\ntype SchemaResult<TWithRef extends boolean = false> =\n | {\n schema?: (TWithRef extends true ? OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject : OpenAPIV3.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.0'\n }\n | {\n schema?: (TWithRef extends true ? OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ReferenceObject : OpenAPIV3_1.SchemaObject) & {\n nullable?: boolean\n 'x-nullable'?: boolean\n }\n version: '3.1'\n }\n\nexport function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (schema?: SchemaObject) => SchemaResult<TWithRef> {\n return (schema?: SchemaObject) => {\n const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'\n\n return {\n schema,\n version,\n } as SchemaResult<TWithRef>\n }\n}\n"]}