@kubb/plugin-oas 2.26.5 → 2.26.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.
Files changed (40) hide show
  1. package/dist/{Schema-BCe0nBHJ.d.ts → Schema-CuyurjSt.d.ts} +1 -1
  2. package/dist/{Schema-tJWinW5z.d.cts → Schema-zMzShjL_.d.cts} +1 -1
  3. package/dist/{SchemaMapper-CAEI86qj.d.cts → SchemaMapper-BpjlzuXc.d.cts} +4 -0
  4. package/dist/{SchemaMapper-CAEI86qj.d.ts → SchemaMapper-BpjlzuXc.d.ts} +4 -0
  5. package/dist/{chunk-NLKNZBXU.js → chunk-2554UG3K.js} +8 -2
  6. package/dist/chunk-2554UG3K.js.map +1 -0
  7. package/dist/{chunk-HUFRXC4N.cjs → chunk-HJ3WPZIC.cjs} +3 -3
  8. package/dist/{chunk-HUFRXC4N.cjs.map → chunk-HJ3WPZIC.cjs.map} +1 -1
  9. package/dist/{chunk-2YX4XBMY.js → chunk-LZNNIZXR.js} +2 -2
  10. package/dist/{chunk-2YX4XBMY.js.map → chunk-LZNNIZXR.js.map} +1 -1
  11. package/dist/{chunk-2BGY3BRC.cjs → chunk-NYLS3UNE.cjs} +2 -2
  12. package/dist/{chunk-2BGY3BRC.cjs.map → chunk-NYLS3UNE.cjs.map} +1 -1
  13. package/dist/{chunk-U3JET6VT.js → chunk-S2XK63DP.js} +3 -3
  14. package/dist/{chunk-WF523MBA.cjs → chunk-XL6T57NL.cjs} +27 -21
  15. package/dist/chunk-XL6T57NL.cjs.map +1 -0
  16. package/dist/{chunk-B3QCCJ62.js → chunk-ZEDQKDE3.js} +2 -2
  17. package/dist/{chunk-OV72HOID.cjs → chunk-ZPBFS6LC.cjs} +23 -23
  18. package/dist/{chunk-OV72HOID.cjs.map → chunk-ZPBFS6LC.cjs.map} +1 -1
  19. package/dist/components.cjs +5 -5
  20. package/dist/components.d.cts +2 -2
  21. package/dist/components.d.ts +2 -2
  22. package/dist/components.js +3 -3
  23. package/dist/hooks.cjs +13 -13
  24. package/dist/hooks.d.cts +2 -2
  25. package/dist/hooks.d.ts +2 -2
  26. package/dist/hooks.js +3 -3
  27. package/dist/index.cjs +20 -20
  28. package/dist/index.d.cts +2 -2
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js +3 -3
  31. package/dist/utils.cjs +8 -8
  32. package/dist/utils.js +2 -2
  33. package/package.json +9 -9
  34. package/src/SchemaGenerator.ts +6 -0
  35. package/src/SchemaMapper.ts +2 -0
  36. package/src/utils/getSchemaFactory.ts +1 -1
  37. package/dist/chunk-NLKNZBXU.js.map +0 -1
  38. package/dist/chunk-WF523MBA.cjs.map +0 -1
  39. /package/dist/{chunk-U3JET6VT.js.map → chunk-S2XK63DP.js.map} +0 -0
  40. /package/dist/{chunk-B3QCCJ62.js.map → chunk-ZEDQKDE3.js.map} +0 -0
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkOV72HOIDcjs = require('./chunk-OV72HOID.cjs');
6
- require('./chunk-WF523MBA.cjs');
5
+ var _chunkZPBFS6LCcjs = require('./chunk-ZPBFS6LC.cjs');
6
+ require('./chunk-XL6T57NL.cjs');
7
7
 
8
8
 
9
- var _chunk2BGY3BRCcjs = require('./chunk-2BGY3BRC.cjs');
9
+ var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
10
10
 
11
11
  // src/components/index.ts
12
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
12
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.Oas = _chunkOV72HOIDcjs.Oas; exports.Operation = _chunkOV72HOIDcjs.Operation; exports.Schema = _chunkOV72HOIDcjs.Schema;
17
+ exports.Oas = _chunkZPBFS6LCcjs.Oas; exports.Operation = _chunkZPBFS6LCcjs.Operation; exports.Schema = _chunkZPBFS6LCcjs.Schema;
18
18
  //# sourceMappingURL=components.cjs.map
@@ -1,10 +1,10 @@
1
- import { S as Schema } from './Schema-tJWinW5z.cjs';
1
+ import { S as Schema } from './Schema-zMzShjL_.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-8tADySO6.cjs';
6
6
  import '@kubb/fs/types';
7
- import './SchemaMapper-CAEI86qj.cjs';
7
+ import './SchemaMapper-BpjlzuXc.cjs';
8
8
  import '@kubb/core';
9
9
  import './types-RVAPVtNi.cjs';
10
10
 
@@ -1,10 +1,10 @@
1
- import { S as Schema } from './Schema-BCe0nBHJ.js';
1
+ import { S as Schema } from './Schema-CuyurjSt.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-DvyNt6Xi.js';
6
6
  import '@kubb/fs/types';
7
- import './SchemaMapper-CAEI86qj.js';
7
+ import './SchemaMapper-BpjlzuXc.js';
8
8
  import '@kubb/core';
9
9
  import './types-RVAPVtNi.js';
10
10
 
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  Schema
5
- } from "./chunk-U3JET6VT.js";
6
- import "./chunk-NLKNZBXU.js";
5
+ } from "./chunk-S2XK63DP.js";
6
+ import "./chunk-2554UG3K.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-2YX4XBMY.js";
9
+ } from "./chunk-LZNNIZXR.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 _chunkOV72HOIDcjs = require('./chunk-OV72HOID.cjs');
6
- require('./chunk-WF523MBA.cjs');
5
+ var _chunkZPBFS6LCcjs = require('./chunk-ZPBFS6LC.cjs');
6
+ require('./chunk-XL6T57NL.cjs');
7
7
 
8
8
 
9
- var _chunk2BGY3BRCcjs = require('./chunk-2BGY3BRC.cjs');
9
+ var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
10
10
 
11
11
  // src/hooks/index.ts
12
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
12
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
13
13
 
14
14
  // src/hooks/useOas.ts
15
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
15
+ _chunkNYLS3UNEcjs.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, _chunkOV72HOIDcjs.Oas.Context);
18
+ const { oas } = _react.useContext.call(void 0, _chunkZPBFS6LCcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
26
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
  function useOperation() {
29
- const { operation } = _react.useContext.call(void 0, _chunkOV72HOIDcjs.Operation.Context);
29
+ const { operation } = _react.useContext.call(void 0, _chunkZPBFS6LCcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
37
+ _chunkNYLS3UNEcjs.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, _chunkOV72HOIDcjs.Oas.Context);
41
+ const { generator } = _react.useContext.call(void 0, _chunkZPBFS6LCcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
142
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
143
143
 
144
144
  function useOperations({ method, path } = {}) {
145
- const { operations } = _react.useContext.call(void 0, _chunkOV72HOIDcjs.Oas.Context);
145
+ const { operations } = _react.useContext.call(void 0, _chunkZPBFS6LCcjs.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 = _chunkOV72HOIDcjs.useSchema;
164
+ exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkZPBFS6LCcjs.useSchema;
165
165
  //# sourceMappingURL=hooks.cjs.map
package/dist/hooks.d.cts CHANGED
@@ -2,10 +2,10 @@ 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-RVAPVtNi.cjs';
5
- import { a as SchemaContextProps } from './Schema-tJWinW5z.cjs';
5
+ import { a as SchemaContextProps } from './Schema-zMzShjL_.cjs';
6
6
  import 'react';
7
7
  import '@kubb/react';
8
- import './SchemaMapper-CAEI86qj.cjs';
8
+ import './SchemaMapper-BpjlzuXc.cjs';
9
9
 
10
10
  declare function useOas(): Oas;
11
11
 
package/dist/hooks.d.ts CHANGED
@@ -2,10 +2,10 @@ 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-RVAPVtNi.js';
5
- import { a as SchemaContextProps } from './Schema-BCe0nBHJ.js';
5
+ import { a as SchemaContextProps } from './Schema-CuyurjSt.js';
6
6
  import 'react';
7
7
  import '@kubb/react';
8
- import './SchemaMapper-CAEI86qj.js';
8
+ import './SchemaMapper-BpjlzuXc.js';
9
9
 
10
10
  declare function useOas(): Oas;
11
11
 
package/dist/hooks.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  Oas,
3
3
  Operation,
4
4
  useSchema
5
- } from "./chunk-U3JET6VT.js";
6
- import "./chunk-NLKNZBXU.js";
5
+ } from "./chunk-S2XK63DP.js";
6
+ import "./chunk-2554UG3K.js";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-2YX4XBMY.js";
9
+ } from "./chunk-LZNNIZXR.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 _chunkHUFRXC4Ncjs = require('./chunk-HUFRXC4N.cjs');
3
+ var _chunkHJ3WPZICcjs = require('./chunk-HJ3WPZIC.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkWF523MBAcjs = require('./chunk-WF523MBA.cjs');
8
+ var _chunkXL6T57NLcjs = require('./chunk-XL6T57NL.cjs');
9
9
 
10
10
 
11
11
 
@@ -13,13 +13,13 @@ var _chunkWF523MBAcjs = require('./chunk-WF523MBA.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunk2BGY3BRCcjs = require('./chunk-2BGY3BRC.cjs');
16
+ var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
17
17
 
18
18
  // src/index.ts
19
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
19
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
20
20
 
21
21
  // src/plugin.ts
22
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
22
+ _chunkNYLS3UNEcjs.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);
@@ -28,7 +28,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
28
28
  const { output = { path: "schemas", export: false }, validate = true, serverIndex = 0, contentType, oasClass } = options;
29
29
  const getOas = async ({ config, logger }) => {
30
30
  try {
31
- const oas = await _chunkHUFRXC4Ncjs.parseFromConfig.call(void 0, config, oasClass);
31
+ const oas = await _chunkHJ3WPZICcjs.parseFromConfig.call(void 0, config, oasClass);
32
32
  if (validate) {
33
33
  await oas.valdiate();
34
34
  }
@@ -36,7 +36,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
36
36
  } catch (e) {
37
37
  const error = e;
38
38
  logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
39
- return _chunkHUFRXC4Ncjs.parseFromConfig.call(void 0, config, oasClass);
39
+ return _chunkHJ3WPZICcjs.parseFromConfig.call(void 0, config, oasClass);
40
40
  }
41
41
  };
42
42
  return {
@@ -50,7 +50,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
50
50
  },
51
51
  async getSchemas({ includes } = {}) {
52
52
  const oas = await this.getOas();
53
- return _chunk2BGY3BRCcjs.getSchemas.call(void 0, { oas, contentType, includes });
53
+ return _chunkNYLS3UNEcjs.getSchemas.call(void 0, { oas, contentType, includes });
54
54
  },
55
55
  async getBaseURL() {
56
56
  const oasInstance = await this.getOas();
@@ -85,7 +85,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
85
85
  logger: this.logger
86
86
  });
87
87
  await oas.dereference();
88
- const schemas = _chunk2BGY3BRCcjs.getSchemas.call(void 0, { oas, contentType });
88
+ const schemas = _chunkNYLS3UNEcjs.getSchemas.call(void 0, { oas, contentType });
89
89
  const mapSchema = async ([name, schema]) => {
90
90
  const resolvedPath = this.resolvePath({
91
91
  baseName: `${name}.json`,
@@ -115,21 +115,21 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
115
115
  });
116
116
 
117
117
  // src/OperationGenerator.ts
118
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
118
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
119
119
 
120
120
 
121
121
  var _operationsByMethod, _OperationGenerator_instances, getOptions_fn, isExcluded_fn, isIncluded_fn, methods_get;
122
122
  var OperationGenerator = class extends _core.Generator {
123
123
  constructor() {
124
124
  super(...arguments);
125
- _chunk2BGY3BRCcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
126
- _chunk2BGY3BRCcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
125
+ _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
126
+ _chunkNYLS3UNEcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
127
127
  }
128
128
  get operationsByMethod() {
129
- return _chunk2BGY3BRCcjs.__privateGet.call(void 0, this, _operationsByMethod);
129
+ return _chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _operationsByMethod);
130
130
  }
131
131
  set operationsByMethod(paths) {
132
- _chunk2BGY3BRCcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
132
+ _chunkNYLS3UNEcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
133
133
  }
134
134
  getSchemas(operation, { forStatusCode, resolveName = (name) => name } = {}) {
135
135
  const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
@@ -212,9 +212,9 @@ var OperationGenerator = class extends _core.Generator {
212
212
  const methods = Object.keys(method);
213
213
  methods.forEach((method2) => {
214
214
  const operation = oas.operation(path2, method2);
215
- if (operation && _chunk2BGY3BRCcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
216
- const isExcluded = _chunk2BGY3BRCcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
217
- const isIncluded = this.context.include ? _chunk2BGY3BRCcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
215
+ if (operation && _chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
216
+ const isExcluded = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
217
+ const isIncluded = this.context.include ? _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isIncluded_fn).call(this, operation, method2) : true;
218
218
  if (isIncluded && !isExcluded) {
219
219
  if (!acc[path2]) {
220
220
  acc[path2] = {};
@@ -235,8 +235,8 @@ var OperationGenerator = class extends _core.Generator {
235
235
  const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
236
236
  methods.forEach((method) => {
237
237
  const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
238
- const options = _chunk2BGY3BRCcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
239
- const promiseMethod = _optionalChain([_chunk2BGY3BRCcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
238
+ const options = _chunkNYLS3UNEcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
239
+ const promiseMethod = _optionalChain([_chunkNYLS3UNEcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
240
240
  ...this.options,
241
241
  ...options
242
242
  })]);
@@ -391,5 +391,5 @@ var src_default = definePluginDefault;
391
391
 
392
392
 
393
393
 
394
- exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkWF523MBAcjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkWF523MBAcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkWF523MBAcjs.schemaKeywords;
394
+ exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkXL6T57NLcjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkXL6T57NLcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkXL6T57NLcjs.schemaKeywords;
395
395
  //# 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-8tADySO6.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-CAEI86qj.cjs';
9
- export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-CAEI86qj.cjs';
8
+ import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-BpjlzuXc.cjs';
9
+ export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-BpjlzuXc.cjs';
10
10
 
11
11
  declare const pluginOasName = "plugin-oas";
12
12
  declare const pluginOas: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginOas>;
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-DvyNt6Xi.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-CAEI86qj.js';
9
- export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-CAEI86qj.js';
8
+ import { S as Schema, a as SchemaKeywordMapper } from './SchemaMapper-BpjlzuXc.js';
9
+ export { b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaMapper, i as isKeyword, s as schemaKeywords } from './SchemaMapper-BpjlzuXc.js';
10
10
 
11
11
  declare const pluginOasName = "plugin-oas";
12
12
  declare const pluginOas: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginOas>;
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  parseFromConfig
3
- } from "./chunk-B3QCCJ62.js";
3
+ } from "./chunk-ZEDQKDE3.js";
4
4
  import {
5
5
  SchemaGenerator,
6
6
  isKeyword,
7
7
  schemaKeywords
8
- } from "./chunk-NLKNZBXU.js";
8
+ } from "./chunk-2554UG3K.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-2YX4XBMY.js";
16
+ } from "./chunk-LZNNIZXR.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 _chunkHUFRXC4Ncjs = require('./chunk-HUFRXC4N.cjs');
3
+ var _chunkHJ3WPZICcjs = require('./chunk-HJ3WPZIC.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunk2BGY3BRCcjs = require('./chunk-2BGY3BRC.cjs');
8
+ var _chunkNYLS3UNEcjs = require('./chunk-NYLS3UNE.cjs');
9
9
 
10
10
  // src/utils/index.ts
11
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
11
+ _chunkNYLS3UNEcjs.init_cjs_shims.call(void 0, );
12
12
 
13
13
  // src/utils/getComments.ts
14
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
14
+ _chunkNYLS3UNEcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
27
+ _chunkNYLS3UNEcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
72
+ _chunkNYLS3UNEcjs.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
- _chunk2BGY3BRCcjs.init_cjs_shims.call(void 0, );
107
+ _chunkNYLS3UNEcjs.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 = _chunk2BGY3BRCcjs.getSchemaFactory; exports.getSchemas = _chunk2BGY3BRCcjs.getSchemas; exports.parseFromConfig = _chunkHUFRXC4Ncjs.parseFromConfig; exports.refsSorter = refsSorter;
126
+ exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkNYLS3UNEcjs.getSchemaFactory; exports.getSchemas = _chunkNYLS3UNEcjs.getSchemas; exports.parseFromConfig = _chunkHJ3WPZICcjs.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-B3QCCJ62.js";
3
+ } from "./chunk-ZEDQKDE3.js";
4
4
  import {
5
5
  getSchemaFactory,
6
6
  getSchemas,
7
7
  init_esm_shims
8
- } from "./chunk-2YX4XBMY.js";
8
+ } from "./chunk-LZNNIZXR.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.26.5",
3
+ "version": "2.26.7",
4
4
  "description": "Generator swagger",
5
5
  "keywords": [
6
6
  "typescript",
@@ -68,10 +68,10 @@
68
68
  "dependencies": {
69
69
  "@stoplight/yaml": "^4.3.0",
70
70
  "remeda": "^2.14.0",
71
- "@kubb/core": "2.26.5",
72
- "@kubb/fs": "2.26.5",
73
- "@kubb/oas": "2.26.5",
74
- "@kubb/react": "2.26.5"
71
+ "@kubb/core": "2.26.7",
72
+ "@kubb/fs": "2.26.7",
73
+ "@kubb/oas": "2.26.7",
74
+ "@kubb/react": "2.26.7"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/react": "^18.3.8",
@@ -79,12 +79,12 @@
79
79
  "react": "^18.3.1",
80
80
  "tsup": "^8.3.0",
81
81
  "typescript": "^5.6.2",
82
- "@kubb/config-biome": "2.26.5",
83
- "@kubb/config-ts": "2.26.5",
84
- "@kubb/config-tsup": "2.26.5"
82
+ "@kubb/config-biome": "2.26.7",
83
+ "@kubb/config-ts": "2.26.7",
84
+ "@kubb/config-tsup": "2.26.7"
85
85
  },
86
86
  "peerDependencies": {
87
- "@kubb/react": "2.26.5"
87
+ "@kubb/react": "2.26.7"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=18"
@@ -452,10 +452,16 @@ export abstract class SchemaGenerator<
452
452
  baseItems.push({ keyword: schemaKeywords.readOnly })
453
453
  }
454
454
 
455
+ if (schema.writeOnly) {
456
+ baseItems.push({ keyword: schemaKeywords.writeOnly })
457
+ }
458
+
455
459
  if (isReference(schema)) {
456
460
  return [
457
461
  ...this.#getRefAlias(schema),
458
462
  nullable && { keyword: schemaKeywords.nullable },
463
+ schema.readOnly && { keyword: schemaKeywords.readOnly },
464
+ schema.writeOnly && { keyword: schemaKeywords.writeOnly },
459
465
  {
460
466
  keyword: schemaKeywords.schema,
461
467
  args: {
@@ -12,6 +12,7 @@ export type SchemaKeywordMapper = {
12
12
  strict: { keyword: 'strict' }
13
13
  url: { keyword: 'url' }
14
14
  readOnly: { keyword: 'readOnly' }
15
+ writeOnly: { keyword: 'writeOnly' }
15
16
  uuid: { keyword: 'uuid' }
16
17
  email: { keyword: 'email' }
17
18
  firstName: { keyword: 'firstName' }
@@ -107,6 +108,7 @@ export const schemaKeywords = {
107
108
  max: 'max',
108
109
  optional: 'optional',
109
110
  readOnly: 'readOnly',
111
+ writeOnly: 'writeOnly',
110
112
 
111
113
  // custom ones
112
114
  object: 'object',
@@ -26,7 +26,7 @@ export function getSchemaFactory<TWithRef extends boolean = false>(oas: Oas): (s
26
26
  const version = isOpenApiV3_1Document(oas.api) ? '3.1' : '3.0'
27
27
 
28
28
  return {
29
- schema,
29
+ schema: oas.dereferenceWithRef(schema),
30
30
  version,
31
31
  } as SchemaResult<TWithRef>
32
32
  }