@kubb/plugin-oas 2.27.0 → 2.27.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/{chunk-HJ3WPZIC.cjs → chunk-6I26SJV6.cjs} +3 -3
- package/dist/{chunk-HJ3WPZIC.cjs.map → chunk-6I26SJV6.cjs.map} +1 -1
- package/dist/{chunk-LZNNIZXR.js → chunk-DW4XVEE4.js} +3 -3
- package/dist/{chunk-LZNNIZXR.js.map → chunk-DW4XVEE4.js.map} +1 -1
- package/dist/{chunk-NYLS3UNE.cjs → chunk-H4D7FGDY.cjs} +3 -3
- package/dist/{chunk-NYLS3UNE.cjs.map → chunk-H4D7FGDY.cjs.map} +1 -1
- package/dist/{chunk-WJTMPPRF.js → chunk-IWUQTVK4.js} +2 -2
- package/dist/{chunk-4QPARYEA.cjs → chunk-KMF5VE6J.cjs} +23 -23
- package/dist/{chunk-4QPARYEA.cjs.map → chunk-KMF5VE6J.cjs.map} +1 -1
- package/dist/{chunk-IEGRBJRL.js → chunk-P7OMLU5B.js} +3 -3
- package/dist/{chunk-ZEDQKDE3.js → chunk-RFA6KMXR.js} +2 -2
- package/dist/{chunk-SJASCTZX.cjs → chunk-VSCBUJRS.cjs} +21 -21
- package/dist/{chunk-SJASCTZX.cjs.map → chunk-VSCBUJRS.cjs.map} +1 -1
- 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 +20 -20
- package/dist/index.js +3 -3
- package/dist/utils.cjs +8 -8
- package/dist/utils.js +2 -2
- package/package.json +10 -10
- /package/dist/{chunk-WJTMPPRF.js.map → chunk-IWUQTVK4.js.map} +0 -0
- /package/dist/{chunk-IEGRBJRL.js.map → chunk-P7OMLU5B.js.map} +0 -0
- /package/dist/{chunk-ZEDQKDE3.js.map → chunk-RFA6KMXR.js.map} +0 -0
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
|
|
3
|
+
var _chunk6I26SJV6cjs = require('./chunk-6I26SJV6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkVSCBUJRScjs = require('./chunk-VSCBUJRS.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -13,13 +13,13 @@ var _chunkSJASCTZXcjs = require('./chunk-SJASCTZX.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
|
-
|
|
19
|
+
_chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
|
|
21
21
|
// src/plugin.ts
|
|
22
|
-
|
|
22
|
+
_chunkH4D7FGDYcjs.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
|
|
31
|
+
const oas = await _chunk6I26SJV6cjs.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
|
|
39
|
+
return _chunk6I26SJV6cjs.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
|
|
53
|
+
return _chunkH4D7FGDYcjs.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 =
|
|
88
|
+
const schemas = _chunkH4D7FGDYcjs.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
|
-
|
|
118
|
+
_chunkH4D7FGDYcjs.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
|
-
|
|
126
|
-
|
|
125
|
+
_chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _OperationGenerator_instances);
|
|
126
|
+
_chunkH4D7FGDYcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
|
|
127
127
|
}
|
|
128
128
|
get operationsByMethod() {
|
|
129
|
-
return
|
|
129
|
+
return _chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _operationsByMethod);
|
|
130
130
|
}
|
|
131
131
|
set operationsByMethod(paths) {
|
|
132
|
-
|
|
132
|
+
_chunkH4D7FGDYcjs.__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 &&
|
|
216
|
-
const isExcluded =
|
|
217
|
-
const isIncluded = this.context.include ?
|
|
215
|
+
if (operation && _chunkH4D7FGDYcjs.__privateGet.call(void 0, this, _OperationGenerator_instances, methods_get)[method2]) {
|
|
216
|
+
const isExcluded = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, isExcluded_fn).call(this, operation, method2);
|
|
217
|
+
const isIncluded = this.context.include ? _chunkH4D7FGDYcjs.__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 =
|
|
239
|
-
const promiseMethod = _optionalChain([
|
|
238
|
+
const options = _chunkH4D7FGDYcjs.__privateMethod.call(void 0, this, _OperationGenerator_instances, getOptions_fn).call(this, operation, method);
|
|
239
|
+
const promiseMethod = _optionalChain([_chunkH4D7FGDYcjs.__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 =
|
|
394
|
+
exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = _chunkVSCBUJRScjs.SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunkVSCBUJRScjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunkVSCBUJRScjs.schemaKeywords;
|
|
395
395
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFromConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RFA6KMXR.js";
|
|
4
4
|
import {
|
|
5
5
|
SchemaGenerator,
|
|
6
6
|
isKeyword,
|
|
7
7
|
schemaKeywords
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IWUQTVK4.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-
|
|
16
|
+
} from "./chunk-DW4XVEE4.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
|
|
3
|
+
var _chunk6I26SJV6cjs = require('./chunk-6I26SJV6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkH4D7FGDYcjs = require('./chunk-H4D7FGDY.cjs');
|
|
9
9
|
|
|
10
10
|
// src/utils/index.ts
|
|
11
|
-
|
|
11
|
+
_chunkH4D7FGDYcjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
|
|
13
13
|
// src/utils/getComments.ts
|
|
14
|
-
|
|
14
|
+
_chunkH4D7FGDYcjs.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
|
+
_chunkH4D7FGDYcjs.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
|
+
_chunkH4D7FGDYcjs.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
|
-
|
|
107
|
+
_chunkH4D7FGDYcjs.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 =
|
|
126
|
+
exports.getASTParams = getASTParams; exports.getComments = getComments; exports.getGroupedByTagFiles = getGroupedByTagFiles; exports.getPathParams = getPathParams; exports.getSchemaFactory = _chunkH4D7FGDYcjs.getSchemaFactory; exports.getSchemas = _chunkH4D7FGDYcjs.getSchemas; exports.parseFromConfig = _chunk6I26SJV6cjs.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-
|
|
3
|
+
} from "./chunk-RFA6KMXR.js";
|
|
4
4
|
import {
|
|
5
5
|
getSchemaFactory,
|
|
6
6
|
getSchemas,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DW4XVEE4.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.27.
|
|
3
|
+
"version": "2.27.1",
|
|
4
4
|
"description": "Generator swagger",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -68,23 +68,23 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@stoplight/yaml": "^4.3.0",
|
|
70
70
|
"remeda": "^2.14.0",
|
|
71
|
-
"@kubb/core": "2.27.
|
|
72
|
-
"@kubb/fs": "2.27.
|
|
73
|
-
"@kubb/oas": "2.27.
|
|
74
|
-
"@kubb/react": "2.27.
|
|
71
|
+
"@kubb/core": "2.27.1",
|
|
72
|
+
"@kubb/fs": "2.27.1",
|
|
73
|
+
"@kubb/oas": "2.27.1",
|
|
74
|
+
"@kubb/react": "2.27.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@types/react": "^18.3.
|
|
77
|
+
"@types/react": "^18.3.9",
|
|
78
78
|
"@types/react-dom": "^18.3.0",
|
|
79
79
|
"react": "^18.3.1",
|
|
80
80
|
"tsup": "^8.3.0",
|
|
81
81
|
"typescript": "^5.6.2",
|
|
82
|
-
"@kubb/config-biome": "2.27.
|
|
83
|
-
"@kubb/config-ts": "2.27.
|
|
84
|
-
"@kubb/config-tsup": "2.27.
|
|
82
|
+
"@kubb/config-biome": "2.27.1",
|
|
83
|
+
"@kubb/config-ts": "2.27.1",
|
|
84
|
+
"@kubb/config-tsup": "2.27.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@kubb/react": "2.27.
|
|
87
|
+
"@kubb/react": "2.27.1"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=18"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|