@kubb/plugin-oas 2.19.4 → 2.19.6
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/{chunk-3NSBUDVM.js → chunk-AHPYTLES.js} +34 -41
- package/dist/{chunk-3NSBUDVM.js.map → chunk-AHPYTLES.js.map} +1 -1
- package/dist/{chunk-USWJ3LIC.cjs → chunk-IJDG7KT6.cjs} +40 -47
- package/dist/chunk-IJDG7KT6.cjs.map +1 -0
- package/dist/{chunk-YS56QITS.cjs → chunk-LXHYPSLT.cjs} +11 -25
- package/dist/chunk-LXHYPSLT.cjs.map +1 -0
- package/dist/{chunk-WEZ6CODU.cjs → chunk-MZJFTD2Z.cjs} +3 -3
- package/dist/{chunk-CBVKDLCJ.js → chunk-RLUQTHVB.js} +45 -74
- package/dist/{chunk-CBVKDLCJ.js.map → chunk-RLUQTHVB.js.map} +1 -1
- package/dist/{chunk-FDLHRTTS.js → chunk-V7H5ZWZY.js} +2 -2
- package/dist/{chunk-SXUTBEJ7.js → chunk-VHGCZBHU.js} +11 -25
- package/dist/{chunk-SXUTBEJ7.js.map → chunk-VHGCZBHU.js.map} +1 -1
- package/dist/{chunk-I5KLDP43.cjs → chunk-XE6N3VWS.cjs} +65 -94
- package/dist/chunk-XE6N3VWS.cjs.map +1 -0
- package/dist/components.cjs +5 -5
- package/dist/components.js +3 -3
- package/dist/hooks.cjs +13 -13
- package/dist/hooks.js +3 -3
- package/dist/index.cjs +30 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -25
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +8 -8
- package/dist/utils.js +2 -2
- package/package.json +11 -11
- package/src/SchemaGenerator.ts +8 -2
- package/dist/chunk-I5KLDP43.cjs.map +0 -1
- package/dist/chunk-USWJ3LIC.cjs.map +0 -1
- package/dist/chunk-YS56QITS.cjs.map +0 -1
- /package/dist/{chunk-WEZ6CODU.cjs.map → chunk-MZJFTD2Z.cjs.map} +0 -0
- /package/dist/{chunk-FDLHRTTS.js.map → chunk-V7H5ZWZY.js.map} +0 -0
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
|
|
3
|
+
var _chunkMZJFTD2Zcjs = require('./chunk-MZJFTD2Z.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkLXHYPSLTcjs = require('./chunk-LXHYPSLT.cjs');
|
|
9
9
|
|
|
10
10
|
// src/utils/index.ts
|
|
11
|
-
|
|
11
|
+
_chunkLXHYPSLTcjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
|
|
13
13
|
// src/utils/getComments.ts
|
|
14
|
-
|
|
14
|
+
_chunkLXHYPSLTcjs.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
|
-
|
|
27
|
+
_chunkLXHYPSLTcjs.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
|
-
|
|
72
|
+
_chunkLXHYPSLTcjs.init_cjs_shims.call(void 0, );
|
|
73
73
|
var _oas = require('@kubb/oas');
|
|
74
74
|
function getASTParams(operationSchema, {
|
|
75
75
|
typed = false,
|
|
@@ -103,7 +103,7 @@ function getPathParams(operationSchema, options = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// src/utils/refSorter.ts
|
|
106
|
-
|
|
106
|
+
_chunkLXHYPSLTcjs.init_cjs_shims.call(void 0, );
|
|
107
107
|
function refsSorter(a, b) {
|
|
108
108
|
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])) {
|
|
109
109
|
return -1;
|
|
@@ -122,5 +122,5 @@ function refsSorter(a, b) {
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
|
|
125
|
-
exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory =
|
|
125
|
+
exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkLXHYPSLTcjs.getSchemaFactory; exports.getSchemas = _chunkLXHYPSLTcjs.getSchemas; exports.parseFromConfig = _chunkMZJFTD2Zcjs.parseFromConfig; exports.refsSorter = refsSorter;
|
|
126
126
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFromConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V7H5ZWZY.js";
|
|
4
4
|
import {
|
|
5
5
|
getSchemaFactory,
|
|
6
6
|
getSchemas,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VHGCZBHU.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.19.
|
|
3
|
+
"version": "2.19.6",
|
|
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": "^
|
|
71
|
-
"@kubb/core": "2.19.
|
|
72
|
-
"@kubb/fs": "2.19.
|
|
73
|
-
"@kubb/oas": "2.19.
|
|
74
|
-
"@kubb/react": "2.19.
|
|
70
|
+
"remeda": "^2.0.10",
|
|
71
|
+
"@kubb/core": "2.19.6",
|
|
72
|
+
"@kubb/fs": "2.19.6",
|
|
73
|
+
"@kubb/oas": "2.19.6",
|
|
74
|
+
"@kubb/react": "2.19.6"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/react": "^18.3.3",
|
|
78
78
|
"@types/react-dom": "^18.3.0",
|
|
79
79
|
"react": "^18.3.1",
|
|
80
|
-
"tsup": "^8.0
|
|
80
|
+
"tsup": "^8.1.0",
|
|
81
81
|
"typescript": "^5.4.5",
|
|
82
|
-
"@kubb/config-biome": "2.19.
|
|
83
|
-
"@kubb/config-ts": "2.19.
|
|
84
|
-
"@kubb/config-tsup": "2.19.
|
|
82
|
+
"@kubb/config-biome": "2.19.6",
|
|
83
|
+
"@kubb/config-ts": "2.19.6",
|
|
84
|
+
"@kubb/config-tsup": "2.19.6"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@kubb/react": "2.19.
|
|
87
|
+
"@kubb/react": "2.19.6"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=18"
|
package/src/SchemaGenerator.ts
CHANGED
|
@@ -560,6 +560,12 @@ export abstract class SchemaGenerator<
|
|
|
560
560
|
type: 'type',
|
|
561
561
|
})
|
|
562
562
|
|
|
563
|
+
const nullableEnum = schema.enum.includes(null)
|
|
564
|
+
if (nullableEnum) {
|
|
565
|
+
baseItems.push({ keyword: schemaKeywords.nullable })
|
|
566
|
+
}
|
|
567
|
+
const filteredValues = schema.enum.filter((value) => value !== null)
|
|
568
|
+
|
|
563
569
|
// x-enumNames has priority
|
|
564
570
|
const extensionEnums = ['x-enumNames', 'x-enum-varnames']
|
|
565
571
|
.filter((extensionKey) => extensionKey in schema)
|
|
@@ -600,7 +606,7 @@ export abstract class SchemaGenerator<
|
|
|
600
606
|
value,
|
|
601
607
|
format: 'number',
|
|
602
608
|
}))
|
|
603
|
-
: [...new Set(
|
|
609
|
+
: [...new Set(filteredValues)].map((value: string) => {
|
|
604
610
|
return {
|
|
605
611
|
name: value,
|
|
606
612
|
value,
|
|
@@ -624,7 +630,7 @@ export abstract class SchemaGenerator<
|
|
|
624
630
|
name: enumName,
|
|
625
631
|
typeName,
|
|
626
632
|
asConst: false,
|
|
627
|
-
items: [...new Set(
|
|
633
|
+
items: [...new Set(filteredValues)].map((value: string) => ({
|
|
628
634
|
name: transformers.stringify(value),
|
|
629
635
|
value,
|
|
630
636
|
format: isNumber(value) ? 'number' : 'string',
|