@kubb/plugin-oas 2.18.3 → 2.18.4
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-VNFSHGSN.cjs → chunk-4OLWDMEK.cjs} +3 -3
- package/dist/{chunk-55NUFNT6.cjs → chunk-BDNSPC5Z.cjs} +3 -3
- package/dist/{chunk-55NUFNT6.cjs.map → chunk-BDNSPC5Z.cjs.map} +1 -1
- package/dist/{chunk-2MJ2CQMI.js → chunk-BIJSTJCQ.js} +2 -2
- package/dist/{chunk-ECXSQTMV.cjs → chunk-I2JOGJIB.cjs} +5 -5
- package/dist/{chunk-LQ6IAWRX.js → chunk-UMYKVV7G.js} +3 -3
- package/dist/{chunk-LQ6IAWRX.js.map → chunk-UMYKVV7G.js.map} +1 -1
- package/dist/{chunk-EPTOYYAP.js → chunk-XML4KQ5H.js} +3 -3
- package/dist/{chunk-3RCQ2LNT.js → chunk-XRPYJNPR.js} +2 -2
- package/dist/{chunk-H52M2RUX.cjs → chunk-YI3FIAD4.cjs} +23 -23
- 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 +102 -102
- package/dist/index.js +3 -3
- package/dist/utils.cjs +8 -8
- package/dist/utils.js +2 -2
- package/package.json +8 -8
- /package/dist/{chunk-VNFSHGSN.cjs.map → chunk-4OLWDMEK.cjs.map} +0 -0
- /package/dist/{chunk-2MJ2CQMI.js.map → chunk-BIJSTJCQ.js.map} +0 -0
- /package/dist/{chunk-ECXSQTMV.cjs.map → chunk-I2JOGJIB.cjs.map} +0 -0
- /package/dist/{chunk-EPTOYYAP.js.map → chunk-XML4KQ5H.js.map} +0 -0
- /package/dist/{chunk-3RCQ2LNT.js.map → chunk-XRPYJNPR.js.map} +0 -0
- /package/dist/{chunk-H52M2RUX.cjs.map → chunk-YI3FIAD4.cjs.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
4
4
|
|
|
5
5
|
// src/SchemaMapper.ts
|
|
6
|
-
|
|
6
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
var schemaKeywords = {
|
|
8
8
|
any: "any",
|
|
9
9
|
strict: "strict",
|
|
@@ -58,4 +58,4 @@ function isKeyword(meta, keyword) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
exports.schemaKeywords = schemaKeywords; exports.isKeyword = isKeyword;
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-4OLWDMEK.cjs.map
|
|
@@ -49,9 +49,9 @@ var __privateMethod = (obj, member, method) => {
|
|
|
49
49
|
return method;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
52
|
+
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/cjs_shims.js
|
|
53
53
|
var init_cjs_shims = __esm({
|
|
54
|
-
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
54
|
+
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/cjs_shims.js"() {
|
|
55
55
|
"use strict";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -65,4 +65,4 @@ var init_cjs_shims = __esm({
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod; exports.init_cjs_shims = init_cjs_shims;
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-BDNSPC5Z.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// 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"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UMYKVV7G.js";
|
|
4
4
|
|
|
5
5
|
// src/SchemaMapper.ts
|
|
6
6
|
init_esm_shims();
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
schemaKeywords,
|
|
59
59
|
isKeyword
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-BIJSTJCQ.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
4
4
|
|
|
5
5
|
// src/utils/getSchemas.ts
|
|
6
|
-
|
|
6
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
function getSchemas({ oas, contentType, includes = ["schemas", "requestBodies", "responses"] }) {
|
|
8
8
|
const components = oas.getDefinition().components;
|
|
9
9
|
let schemas = {};
|
|
@@ -35,7 +35,7 @@ function getSchemas({ oas, contentType, includes = ["schemas", "requestBodies",
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// src/utils/parseFromConfig.ts
|
|
38
|
-
|
|
38
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
39
39
|
var _path = require('path');
|
|
40
40
|
var _utils = require('@kubb/core/utils');
|
|
41
41
|
var _parser = require('@kubb/oas/parser');
|
|
@@ -61,7 +61,7 @@ function parseFromConfig(config, options = {}) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// src/utils/getSchemaFactory.ts
|
|
64
|
-
|
|
64
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
65
65
|
var _oas = require('@kubb/oas');
|
|
66
66
|
function getSchemaFactory(oas) {
|
|
67
67
|
return (schema) => {
|
|
@@ -78,4 +78,4 @@ function getSchemaFactory(oas) {
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
exports.getSchemas = getSchemas; exports.parseFromConfig = parseFromConfig; exports.getSchemaFactory = getSchemaFactory;
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-I2JOGJIB.cjs.map
|
|
@@ -49,9 +49,9 @@ var __privateMethod = (obj, member, method) => {
|
|
|
49
49
|
return method;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
52
|
+
// ../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/esm_shims.js
|
|
53
53
|
var init_esm_shims = __esm({
|
|
54
|
-
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
54
|
+
"../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/esm_shims.js"() {
|
|
55
55
|
"use strict";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -65,4 +65,4 @@ export {
|
|
|
65
65
|
__privateMethod,
|
|
66
66
|
init_esm_shims
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-UMYKVV7G.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.0.2_@microsoft+api-extractor@7.43.4_@types+node@20.12.11__postcss@8.4.38_ts-node@10.9._vnyhfq7fulozpuwbvh64t7gkvm/node_modules/tsup/assets/esm_shims.js"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
schemaKeywords
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BIJSTJCQ.js";
|
|
4
4
|
import {
|
|
5
5
|
__commonJS,
|
|
6
6
|
__toESM,
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UMYKVV7G.js";
|
|
9
9
|
|
|
10
10
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
|
|
11
11
|
var require_react_production_min = __commonJS({
|
|
@@ -3309,4 +3309,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
3309
3309
|
* LICENSE file in the root directory of this source tree.
|
|
3310
3310
|
*)
|
|
3311
3311
|
*/
|
|
3312
|
-
//# sourceMappingURL=chunk-
|
|
3312
|
+
//# sourceMappingURL=chunk-XML4KQ5H.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UMYKVV7G.js";
|
|
4
4
|
|
|
5
5
|
// src/utils/getSchemas.ts
|
|
6
6
|
init_esm_shims();
|
|
@@ -78,4 +78,4 @@ export {
|
|
|
78
78
|
parseFromConfig,
|
|
79
79
|
getSchemaFactory
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-XRPYJNPR.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunk4OLWDMEKcjs = require('./chunk-4OLWDMEK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
9
9
|
|
|
10
10
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
|
|
11
|
-
var require_react_production_min =
|
|
11
|
+
var require_react_production_min = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
12
12
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js"(exports) {
|
|
13
13
|
"use strict";
|
|
14
|
-
|
|
14
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
15
15
|
var l = Symbol.for("react.element");
|
|
16
16
|
var n = Symbol.for("react.portal");
|
|
17
17
|
var p = Symbol.for("react.fragment");
|
|
@@ -308,10 +308,10 @@ var require_react_production_min = _chunk55NUFNT6cjs.__commonJS.call(void 0, {
|
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js
|
|
311
|
-
var require_react_development =
|
|
311
|
+
var require_react_development = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
312
312
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
313
313
|
"use strict";
|
|
314
|
-
|
|
314
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
315
315
|
if (process.env.NODE_ENV !== "production") {
|
|
316
316
|
(function() {
|
|
317
317
|
"use strict";
|
|
@@ -2183,10 +2183,10 @@ var require_react_development = _chunk55NUFNT6cjs.__commonJS.call(void 0, {
|
|
|
2183
2183
|
});
|
|
2184
2184
|
|
|
2185
2185
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js
|
|
2186
|
-
var require_react =
|
|
2186
|
+
var require_react = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
2187
2187
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"(exports, module) {
|
|
2188
2188
|
"use strict";
|
|
2189
|
-
|
|
2189
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
2190
2190
|
if (process.env.NODE_ENV === "production") {
|
|
2191
2191
|
module.exports = require_react_production_min();
|
|
2192
2192
|
} else {
|
|
@@ -2196,10 +2196,10 @@ var require_react = _chunk55NUFNT6cjs.__commonJS.call(void 0, {
|
|
|
2196
2196
|
});
|
|
2197
2197
|
|
|
2198
2198
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js
|
|
2199
|
-
var require_react_jsx_runtime_production_min =
|
|
2199
|
+
var require_react_jsx_runtime_production_min = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
2200
2200
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports) {
|
|
2201
2201
|
"use strict";
|
|
2202
|
-
|
|
2202
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
2203
2203
|
var f = require_react();
|
|
2204
2204
|
var k = Symbol.for("react.element");
|
|
2205
2205
|
var l = Symbol.for("react.fragment");
|
|
@@ -2225,10 +2225,10 @@ var require_react_jsx_runtime_production_min = _chunk55NUFNT6cjs.__commonJS.call
|
|
|
2225
2225
|
});
|
|
2226
2226
|
|
|
2227
2227
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
2228
|
-
var require_react_jsx_runtime_development =
|
|
2228
|
+
var require_react_jsx_runtime_development = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
2229
2229
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
2230
2230
|
"use strict";
|
|
2231
|
-
|
|
2231
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
2232
2232
|
if (process.env.NODE_ENV !== "production") {
|
|
2233
2233
|
(function() {
|
|
2234
2234
|
"use strict";
|
|
@@ -3119,10 +3119,10 @@ var require_react_jsx_runtime_development = _chunk55NUFNT6cjs.__commonJS.call(vo
|
|
|
3119
3119
|
});
|
|
3120
3120
|
|
|
3121
3121
|
// ../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js
|
|
3122
|
-
var require_jsx_runtime =
|
|
3122
|
+
var require_jsx_runtime = _chunkBDNSPC5Zcjs.__commonJS.call(void 0, {
|
|
3123
3123
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"(exports, module) {
|
|
3124
3124
|
"use strict";
|
|
3125
|
-
|
|
3125
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
3126
3126
|
if (process.env.NODE_ENV === "production") {
|
|
3127
3127
|
module.exports = require_react_jsx_runtime_production_min();
|
|
3128
3128
|
} else {
|
|
@@ -3132,8 +3132,8 @@ var require_jsx_runtime = _chunk55NUFNT6cjs.__commonJS.call(void 0, {
|
|
|
3132
3132
|
});
|
|
3133
3133
|
|
|
3134
3134
|
// src/components/Operation.tsx
|
|
3135
|
-
|
|
3136
|
-
var import_jsx_runtime =
|
|
3135
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
3136
|
+
var import_jsx_runtime = _chunkBDNSPC5Zcjs.__toESM.call(void 0, require_jsx_runtime(), 1);
|
|
3137
3137
|
var _react = require('@kubb/react');
|
|
3138
3138
|
var OperationContext = _react.createContext.call(void 0, {});
|
|
3139
3139
|
function Operation({ operation, children }) {
|
|
@@ -3142,13 +3142,13 @@ function Operation({ operation, children }) {
|
|
|
3142
3142
|
Operation.Context = OperationContext;
|
|
3143
3143
|
|
|
3144
3144
|
// src/hooks/useSchema.ts
|
|
3145
|
-
|
|
3145
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
3146
3146
|
|
|
3147
3147
|
|
|
3148
3148
|
// src/components/Schema.tsx
|
|
3149
|
-
|
|
3149
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
3150
3150
|
|
|
3151
|
-
var import_jsx_runtime2 =
|
|
3151
|
+
var import_jsx_runtime2 = _chunkBDNSPC5Zcjs.__toESM.call(void 0, require_jsx_runtime(), 1);
|
|
3152
3152
|
var SchemaContext = _react.createContext.call(void 0, {
|
|
3153
3153
|
name: "unknown",
|
|
3154
3154
|
schemas: []
|
|
@@ -3215,7 +3215,7 @@ Schema.File = function({ output, isTypeOnly, children }) {
|
|
|
3215
3215
|
Schema.Imports = ({ isTypeOnly }) => {
|
|
3216
3216
|
const { generator, schemas } = useSchema();
|
|
3217
3217
|
const { path: root } = _react.useFile.call(void 0, );
|
|
3218
|
-
const refs = generator.deepSearch(schemas,
|
|
3218
|
+
const refs = generator.deepSearch(schemas, _chunk4OLWDMEKcjs.schemaKeywords.ref);
|
|
3219
3219
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: _optionalChain([refs, 'optionalAccess', _ => _.map, 'call', _2 => _2((item, i) => {
|
|
3220
3220
|
if (!item.args.path) {
|
|
3221
3221
|
return void 0;
|
|
@@ -3246,9 +3246,9 @@ function useSchema() {
|
|
|
3246
3246
|
}
|
|
3247
3247
|
|
|
3248
3248
|
// src/components/Oas.tsx
|
|
3249
|
-
|
|
3249
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
3250
3250
|
|
|
3251
|
-
var import_jsx_runtime3 =
|
|
3251
|
+
var import_jsx_runtime3 = _chunkBDNSPC5Zcjs.__toESM.call(void 0, require_jsx_runtime(), 1);
|
|
3252
3252
|
var OasContext = _react.createContext.call(void 0, {});
|
|
3253
3253
|
function Oas({ oas, children, operations, generator }) {
|
|
3254
3254
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OasContext.Provider, { value: { oas, generator, operations }, children });
|
|
@@ -3309,4 +3309,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
3309
3309
|
* LICENSE file in the root directory of this source tree.
|
|
3310
3310
|
*)
|
|
3311
3311
|
*/
|
|
3312
|
-
//# sourceMappingURL=chunk-
|
|
3312
|
+
//# sourceMappingURL=chunk-YI3FIAD4.cjs.map
|
package/dist/components.cjs
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkYI3FIAD4cjs = require('./chunk-YI3FIAD4.cjs');
|
|
6
|
+
require('./chunk-4OLWDMEK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
10
10
|
|
|
11
11
|
// src/components/index.ts
|
|
12
|
-
|
|
12
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.Oas =
|
|
17
|
+
exports.Oas = _chunkYI3FIAD4cjs.Oas; exports.Operation = _chunkYI3FIAD4cjs.Operation; exports.Schema = _chunkYI3FIAD4cjs.Schema;
|
|
18
18
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Oas,
|
|
3
3
|
Operation,
|
|
4
4
|
Schema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-XML4KQ5H.js";
|
|
6
|
+
import "./chunk-BIJSTJCQ.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UMYKVV7G.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
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkYI3FIAD4cjs = require('./chunk-YI3FIAD4.cjs');
|
|
6
|
+
require('./chunk-4OLWDMEK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
10
10
|
|
|
11
11
|
// src/hooks/index.ts
|
|
12
|
-
|
|
12
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
13
13
|
|
|
14
14
|
// src/hooks/useOas.ts
|
|
15
|
-
|
|
15
|
+
_chunkBDNSPC5Zcjs.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,
|
|
18
|
+
const { oas } = _react.useContext.call(void 0, _chunkYI3FIAD4cjs.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
|
-
|
|
26
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
27
27
|
|
|
28
28
|
function useOperation() {
|
|
29
|
-
const { operation } = _react.useContext.call(void 0,
|
|
29
|
+
const { operation } = _react.useContext.call(void 0, _chunkYI3FIAD4cjs.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
|
-
|
|
37
|
+
_chunkBDNSPC5Zcjs.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,
|
|
41
|
+
const { generator } = _react.useContext.call(void 0, _chunkYI3FIAD4cjs.Oas.Context);
|
|
42
42
|
if (!generator) {
|
|
43
43
|
throw new Error(`'generator' is not defined`);
|
|
44
44
|
}
|
|
@@ -126,10 +126,10 @@ function useOperationManager() {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/hooks/useOperations.ts
|
|
129
|
-
|
|
129
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
130
130
|
|
|
131
131
|
function useOperations({ method, path } = {}) {
|
|
132
|
-
const { operations } = _react.useContext.call(void 0,
|
|
132
|
+
const { operations } = _react.useContext.call(void 0, _chunkYI3FIAD4cjs.Oas.Context);
|
|
133
133
|
if (!operations) {
|
|
134
134
|
throw new Error("Operations is not defined");
|
|
135
135
|
}
|
|
@@ -148,5 +148,5 @@ function useOperations({ method, path } = {}) {
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
|
|
151
|
-
exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema =
|
|
151
|
+
exports.useOas = useOas; exports.useOperation = useOperation; exports.useOperationManager = useOperationManager; exports.useOperations = useOperations; exports.useSchema = _chunkYI3FIAD4cjs.useSchema;
|
|
152
152
|
//# sourceMappingURL=hooks.cjs.map
|
package/dist/hooks.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
Oas,
|
|
3
3
|
Operation,
|
|
4
4
|
useSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-XML4KQ5H.js";
|
|
6
|
+
import "./chunk-BIJSTJCQ.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UMYKVV7G.js";
|
|
10
10
|
|
|
11
11
|
// src/hooks/index.ts
|
|
12
12
|
init_esm_shims();
|
package/dist/index.cjs
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkI2JOGJIBcjs = require('./chunk-I2JOGJIB.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk4OLWDMEKcjs = require('./chunk-4OLWDMEK.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
|
-
|
|
19
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
|
|
21
21
|
// src/plugin.ts
|
|
22
|
-
|
|
22
|
+
_chunkBDNSPC5Zcjs.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);
|
|
@@ -35,7 +35,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
35
35
|
} = options;
|
|
36
36
|
const getOas = async ({ config, logger, formatOptions }) => {
|
|
37
37
|
try {
|
|
38
|
-
const oas = await
|
|
38
|
+
const oas = await _chunkI2JOGJIBcjs.parseFromConfig.call(void 0, config, formatOptions);
|
|
39
39
|
if (validate) {
|
|
40
40
|
await oas.valdiate();
|
|
41
41
|
}
|
|
@@ -43,7 +43,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
43
43
|
} catch (e) {
|
|
44
44
|
const error = e;
|
|
45
45
|
logger.emit("warning", _optionalChain([error, 'optionalAccess', _ => _.message]));
|
|
46
|
-
return
|
|
46
|
+
return _chunkI2JOGJIBcjs.parseFromConfig.call(void 0, config);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
return {
|
|
@@ -57,7 +57,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
57
57
|
},
|
|
58
58
|
async getSchemas({ includes } = {}) {
|
|
59
59
|
const oas = await this.getOas();
|
|
60
|
-
return
|
|
60
|
+
return _chunkI2JOGJIBcjs.getSchemas.call(void 0, { oas, contentType, includes });
|
|
61
61
|
},
|
|
62
62
|
async getBaseURL() {
|
|
63
63
|
const oasInstance = await this.getOas();
|
|
@@ -96,7 +96,7 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
await oas.dereference();
|
|
99
|
-
const schemas =
|
|
99
|
+
const schemas = _chunkI2JOGJIBcjs.getSchemas.call(void 0, { oas, contentType });
|
|
100
100
|
const mapSchema = async ([name, schema]) => {
|
|
101
101
|
const resolvedPath = this.resolvePath({
|
|
102
102
|
baseName: `${name}.json`,
|
|
@@ -126,32 +126,32 @@ var pluginOas = _core.createPlugin.call(void 0, (options) => {
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
// src/OperationGenerator.ts
|
|
129
|
-
|
|
129
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
var _operationsByMethod, _getOptions, getOptions_fn, _isExcluded, isExcluded_fn, _isIncluded, isIncluded_fn, _methods, methods_get;
|
|
133
133
|
var OperationGenerator = class extends _core.Generator {
|
|
134
134
|
constructor() {
|
|
135
135
|
super(...arguments);
|
|
136
|
-
|
|
136
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getOptions);
|
|
137
137
|
/**
|
|
138
138
|
*
|
|
139
139
|
* @deprecated
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _isExcluded);
|
|
142
142
|
/**
|
|
143
143
|
*
|
|
144
144
|
* @deprecated
|
|
145
145
|
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _isIncluded);
|
|
147
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _methods);
|
|
148
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _operationsByMethod, {});
|
|
149
149
|
}
|
|
150
150
|
get operationsByMethod() {
|
|
151
|
-
return
|
|
151
|
+
return _chunkBDNSPC5Zcjs.__privateGet.call(void 0, this, _operationsByMethod);
|
|
152
152
|
}
|
|
153
153
|
set operationsByMethod(paths) {
|
|
154
|
-
|
|
154
|
+
_chunkBDNSPC5Zcjs.__privateSet.call(void 0, this, _operationsByMethod, paths);
|
|
155
155
|
}
|
|
156
156
|
getSchemas(operation, forStatusCode) {
|
|
157
157
|
const pathParamsSchema = this.context.oas.getParametersSchema(operation, "path");
|
|
@@ -234,9 +234,9 @@ var OperationGenerator = class extends _core.Generator {
|
|
|
234
234
|
const methods = Object.keys(method);
|
|
235
235
|
methods.forEach((method2) => {
|
|
236
236
|
const operation = oas.operation(path2, method2);
|
|
237
|
-
if (operation &&
|
|
238
|
-
const isExcluded =
|
|
239
|
-
const isIncluded = this.context.include ?
|
|
237
|
+
if (operation && _chunkBDNSPC5Zcjs.__privateGet.call(void 0, this, _methods, methods_get)[method2]) {
|
|
238
|
+
const isExcluded = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _isExcluded, isExcluded_fn).call(this, operation, method2);
|
|
239
|
+
const isIncluded = this.context.include ? _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _isIncluded, isIncluded_fn).call(this, operation, method2) : true;
|
|
240
240
|
if (isIncluded && !isExcluded) {
|
|
241
241
|
if (!acc[path2]) {
|
|
242
242
|
acc[path2] = {};
|
|
@@ -257,8 +257,8 @@ var OperationGenerator = class extends _core.Generator {
|
|
|
257
257
|
const methods = this.operationsByMethod[path2] ? Object.keys(this.operationsByMethod[path2]) : [];
|
|
258
258
|
methods.forEach((method) => {
|
|
259
259
|
const { operation } = _optionalChain([this, 'access', _37 => _37.operationsByMethod, 'access', _38 => _38[path2], 'optionalAccess', _39 => _39[method]]);
|
|
260
|
-
const options =
|
|
261
|
-
const promiseMethod = _optionalChain([
|
|
260
|
+
const options = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getOptions, getOptions_fn).call(this, operation, method);
|
|
261
|
+
const promiseMethod = _optionalChain([_chunkBDNSPC5Zcjs.__privateGet.call(void 0, this, _methods, methods_get), 'access', _40 => _40[method], 'optionalAccess', _41 => _41.call, 'call', _42 => _42(this, operation, {
|
|
262
262
|
...this.options,
|
|
263
263
|
...options
|
|
264
264
|
})]);
|
|
@@ -356,7 +356,7 @@ methods_get = function() {
|
|
|
356
356
|
};
|
|
357
357
|
|
|
358
358
|
// src/SchemaGenerator.ts
|
|
359
|
-
|
|
359
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
360
360
|
|
|
361
361
|
|
|
362
362
|
var _utils = require('@kubb/core/utils');
|
|
@@ -366,27 +366,27 @@ var _usedAliasNames, _getUsedEnumNames, getUsedEnumNames_fn, _getOptions2, getOp
|
|
|
366
366
|
var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
367
367
|
constructor() {
|
|
368
368
|
super(...arguments);
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getUsedEnumNames);
|
|
370
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getOptions2);
|
|
371
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getUnknownReturn);
|
|
372
372
|
/**
|
|
373
373
|
* Recursively creates a type literal with the given props.
|
|
374
374
|
*/
|
|
375
|
-
|
|
375
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _parseProperties);
|
|
376
376
|
/**
|
|
377
377
|
* Create a type alias for the schema referenced by the given ReferenceObject
|
|
378
378
|
*/
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getRefAlias);
|
|
380
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _getParsedSchemaObject);
|
|
381
381
|
/**
|
|
382
382
|
* This is the very core of the OpenAPI to TS conversion - it takes a
|
|
383
383
|
* schema and returns the appropriate type.
|
|
384
384
|
*/
|
|
385
|
-
|
|
385
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _parseSchemaObject);
|
|
386
386
|
// Collect the types of all referenced schemas, so we can export them later
|
|
387
387
|
this.refs = {};
|
|
388
388
|
// Keep track of already used type aliases
|
|
389
|
-
|
|
389
|
+
_chunkBDNSPC5Zcjs.__privateAdd.call(void 0, this, _usedAliasNames, {});
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
392
|
* Creates a type node from a given schema.
|
|
@@ -394,8 +394,8 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
394
394
|
* optionally adds a union with null.
|
|
395
395
|
*/
|
|
396
396
|
buildSchemas(props) {
|
|
397
|
-
const options =
|
|
398
|
-
const defaultSchemas =
|
|
397
|
+
const options = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getOptions2, getOptions_fn2).call(this, props);
|
|
398
|
+
const defaultSchemas = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _parseSchemaObject, parseSchemaObject_fn).call(this, props);
|
|
399
399
|
const schemas = _optionalChain([options, 'access', _64 => _64.transformers, 'optionalAccess', _65 => _65.schema, 'optionalCall', _66 => _66(props, defaultSchemas)]) || defaultSchemas || [];
|
|
400
400
|
return _remeda.uniqueWith.call(void 0, schemas, _remeda.isDeepEqual);
|
|
401
401
|
}
|
|
@@ -411,7 +411,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
411
411
|
if (schema.keyword === keyword) {
|
|
412
412
|
foundItems.push(schema);
|
|
413
413
|
}
|
|
414
|
-
if (schema.keyword ===
|
|
414
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.object) {
|
|
415
415
|
const subItem = schema;
|
|
416
416
|
Object.values(_optionalChain([subItem, 'access', _69 => _69.args, 'optionalAccess', _70 => _70.properties]) || {}).forEach((entrySchema) => {
|
|
417
417
|
foundItems.push(..._SchemaGenerator.deepSearch(entrySchema, keyword));
|
|
@@ -420,25 +420,25 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
420
420
|
foundItems.push(..._SchemaGenerator.deepSearch([entrySchema], keyword));
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
|
-
if (schema.keyword ===
|
|
423
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.array) {
|
|
424
424
|
const subItem = schema;
|
|
425
425
|
subItem.args.items.forEach((entrySchema) => {
|
|
426
426
|
foundItems.push(..._SchemaGenerator.deepSearch([entrySchema], keyword));
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
if (schema.keyword ===
|
|
429
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.and) {
|
|
430
430
|
const subItem = schema;
|
|
431
431
|
subItem.args.forEach((entrySchema) => {
|
|
432
432
|
foundItems.push(..._SchemaGenerator.deepSearch([entrySchema], keyword));
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
|
-
if (schema.keyword ===
|
|
435
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.tuple) {
|
|
436
436
|
const subItem = schema;
|
|
437
437
|
subItem.args.forEach((entrySchema) => {
|
|
438
438
|
foundItems.push(..._SchemaGenerator.deepSearch([entrySchema], keyword));
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
-
if (schema.keyword ===
|
|
441
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.union) {
|
|
442
442
|
const subItem = schema;
|
|
443
443
|
subItem.args.forEach((entrySchema) => {
|
|
444
444
|
foundItems.push(..._SchemaGenerator.deepSearch([entrySchema], keyword));
|
|
@@ -453,7 +453,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
453
453
|
if (!foundItem && schema.keyword === keyword) {
|
|
454
454
|
foundItem = schema;
|
|
455
455
|
}
|
|
456
|
-
if (schema.keyword ===
|
|
456
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.object) {
|
|
457
457
|
const subItem = schema;
|
|
458
458
|
Object.values(_optionalChain([subItem, 'access', _75 => _75.args, 'optionalAccess', _76 => _76.properties]) || {}).forEach((entrySchema) => {
|
|
459
459
|
if (!foundItem) {
|
|
@@ -475,7 +475,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
475
475
|
if (!foundItem && schema.keyword === keyword) {
|
|
476
476
|
foundItem = schema;
|
|
477
477
|
}
|
|
478
|
-
if (schema.keyword ===
|
|
478
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.array) {
|
|
479
479
|
const subItem = schema;
|
|
480
480
|
subItem.args.items.forEach((entrySchema) => {
|
|
481
481
|
if (!foundItem) {
|
|
@@ -483,7 +483,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
if (schema.keyword ===
|
|
486
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.and) {
|
|
487
487
|
const subItem = schema;
|
|
488
488
|
subItem.args.forEach((entrySchema) => {
|
|
489
489
|
if (!foundItem) {
|
|
@@ -491,7 +491,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
491
491
|
}
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
if (schema.keyword ===
|
|
494
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.tuple) {
|
|
495
495
|
const subItem = schema;
|
|
496
496
|
subItem.args.forEach((entrySchema) => {
|
|
497
497
|
if (!foundItem) {
|
|
@@ -499,7 +499,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
499
499
|
}
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
|
-
if (schema.keyword ===
|
|
502
|
+
if (schema.keyword === _chunk4OLWDMEKcjs.schemaKeywords.union) {
|
|
503
503
|
const subItem = schema;
|
|
504
504
|
subItem.args.forEach((entrySchema) => {
|
|
505
505
|
if (!foundItem) {
|
|
@@ -512,7 +512,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
512
512
|
}
|
|
513
513
|
async build() {
|
|
514
514
|
const { oas, contentType, include } = this.context;
|
|
515
|
-
const schemas =
|
|
515
|
+
const schemas = _chunkI2JOGJIBcjs.getSchemas.call(void 0, { oas, contentType, includes: include });
|
|
516
516
|
const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {
|
|
517
517
|
const promiseOperation = this.schema.call(this, name, schema);
|
|
518
518
|
if (promiseOperation) {
|
|
@@ -527,7 +527,7 @@ var _SchemaGenerator = class _SchemaGenerator extends _core.Generator {
|
|
|
527
527
|
_usedAliasNames = new WeakMap();
|
|
528
528
|
_getUsedEnumNames = new WeakSet();
|
|
529
529
|
getUsedEnumNames_fn = function(props) {
|
|
530
|
-
const options =
|
|
530
|
+
const options = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getOptions2, getOptions_fn2).call(this, props);
|
|
531
531
|
return options.usedEnumNames || {};
|
|
532
532
|
};
|
|
533
533
|
_getOptions2 = new WeakSet();
|
|
@@ -545,11 +545,11 @@ getOptions_fn2 = function({ name }) {
|
|
|
545
545
|
};
|
|
546
546
|
_getUnknownReturn = new WeakSet();
|
|
547
547
|
getUnknownReturn_fn = function(props) {
|
|
548
|
-
const options =
|
|
548
|
+
const options = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getOptions2, getOptions_fn2).call(this, props);
|
|
549
549
|
if (options.unknownType === "any") {
|
|
550
|
-
return
|
|
550
|
+
return _chunk4OLWDMEKcjs.schemaKeywords.any;
|
|
551
551
|
}
|
|
552
|
-
return
|
|
552
|
+
return _chunk4OLWDMEKcjs.schemaKeywords.unknown;
|
|
553
553
|
};
|
|
554
554
|
_parseProperties = new WeakSet();
|
|
555
555
|
parseProperties_fn = function({ schema, name }) {
|
|
@@ -563,13 +563,13 @@ parseProperties_fn = function({ schema, name }) {
|
|
|
563
563
|
const nullable = _nullishCoalesce(_nullishCoalesce(propertySchema.nullable, () => ( propertySchema["x-nullable"])), () => ( false));
|
|
564
564
|
validationFunctions.push(...this.buildSchemas({ schema: propertySchema, name: propertyName, parentName: name }));
|
|
565
565
|
validationFunctions.push({
|
|
566
|
-
keyword:
|
|
566
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.name,
|
|
567
567
|
args: propertyName
|
|
568
568
|
});
|
|
569
569
|
if (!isRequired && nullable) {
|
|
570
|
-
validationFunctions.push({ keyword:
|
|
570
|
+
validationFunctions.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.nullish });
|
|
571
571
|
} else if (!isRequired) {
|
|
572
|
-
validationFunctions.push({ keyword:
|
|
572
|
+
validationFunctions.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.optional });
|
|
573
573
|
}
|
|
574
574
|
return {
|
|
575
575
|
[propertyName]: validationFunctions
|
|
@@ -577,11 +577,11 @@ parseProperties_fn = function({ schema, name }) {
|
|
|
577
577
|
}).reduce((acc, curr) => ({ ...acc, ...curr }), {});
|
|
578
578
|
let additionalPropertiesSchemas = [];
|
|
579
579
|
if (additionalProperties) {
|
|
580
|
-
additionalPropertiesSchemas = additionalProperties === true ? [{ keyword:
|
|
580
|
+
additionalPropertiesSchemas = additionalProperties === true ? [{ keyword: _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getUnknownReturn, getUnknownReturn_fn).call(this, { schema, name }) }] : this.buildSchemas({ schema: additionalProperties, parentName: name });
|
|
581
581
|
}
|
|
582
582
|
return [
|
|
583
583
|
{
|
|
584
|
-
keyword:
|
|
584
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.object,
|
|
585
585
|
args: {
|
|
586
586
|
properties: propertiesSchemas,
|
|
587
587
|
additionalProperties: additionalPropertiesSchemas
|
|
@@ -593,7 +593,7 @@ _getRefAlias = new WeakSet();
|
|
|
593
593
|
getRefAlias_fn = function(obj) {
|
|
594
594
|
const { $ref } = obj;
|
|
595
595
|
let ref = this.refs[$ref];
|
|
596
|
-
const originalName = _utils.getUniqueName.call(void 0, $ref.replace(/.+\//, ""),
|
|
596
|
+
const originalName = _utils.getUniqueName.call(void 0, $ref.replace(/.+\//, ""), _chunkBDNSPC5Zcjs.__privateGet.call(void 0, this, _usedAliasNames));
|
|
597
597
|
const propertyName = this.context.pluginManager.resolveName({
|
|
598
598
|
name: originalName,
|
|
599
599
|
pluginKey: this.context.plugin.key,
|
|
@@ -602,7 +602,7 @@ getRefAlias_fn = function(obj) {
|
|
|
602
602
|
if (ref) {
|
|
603
603
|
return [
|
|
604
604
|
{
|
|
605
|
-
keyword:
|
|
605
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.ref,
|
|
606
606
|
args: { name: ref.propertyName, path: ref.path }
|
|
607
607
|
}
|
|
608
608
|
];
|
|
@@ -624,21 +624,21 @@ getRefAlias_fn = function(obj) {
|
|
|
624
624
|
};
|
|
625
625
|
return [
|
|
626
626
|
{
|
|
627
|
-
keyword:
|
|
627
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.ref,
|
|
628
628
|
args: { name: ref.propertyName, path: _optionalChain([ref, 'optionalAccess', _89 => _89.path]), isTypeOnly: false }
|
|
629
629
|
}
|
|
630
630
|
];
|
|
631
631
|
};
|
|
632
632
|
_getParsedSchemaObject = new WeakSet();
|
|
633
633
|
getParsedSchemaObject_fn = function(schema) {
|
|
634
|
-
const parsedSchema =
|
|
634
|
+
const parsedSchema = _chunkI2JOGJIBcjs.getSchemaFactory.call(void 0, this.context.oas)(schema);
|
|
635
635
|
return parsedSchema;
|
|
636
636
|
};
|
|
637
637
|
_parseSchemaObject = new WeakSet();
|
|
638
638
|
parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
639
|
-
const options =
|
|
640
|
-
const unknownReturn =
|
|
641
|
-
const { schema, version } =
|
|
639
|
+
const options = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getOptions2, getOptions_fn2).call(this, { schema: _schema, name });
|
|
640
|
+
const unknownReturn = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getUnknownReturn, getUnknownReturn_fn).call(this, { schema: _schema, name });
|
|
641
|
+
const { schema, version } = _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getParsedSchemaObject, getParsedSchemaObject_fn).call(this, _schema);
|
|
642
642
|
const resolvedName = this.context.pluginManager.resolveName({
|
|
643
643
|
name: `${parentName || ""} ${name}`,
|
|
644
644
|
pluginKey: this.context.plugin.key,
|
|
@@ -649,7 +649,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
649
649
|
}
|
|
650
650
|
const baseItems = [
|
|
651
651
|
{
|
|
652
|
-
keyword:
|
|
652
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.schema,
|
|
653
653
|
args: {
|
|
654
654
|
type: schema.type,
|
|
655
655
|
format: schema.format
|
|
@@ -662,54 +662,54 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
662
662
|
if (schema.default !== void 0 && !Array.isArray(schema.default)) {
|
|
663
663
|
if (typeof schema.default === "string") {
|
|
664
664
|
baseItems.push({
|
|
665
|
-
keyword:
|
|
665
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.default,
|
|
666
666
|
args: _transformers2.default.stringify(schema.default)
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
669
|
if (typeof schema.default === "boolean") {
|
|
670
670
|
baseItems.push({
|
|
671
|
-
keyword:
|
|
671
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.default,
|
|
672
672
|
args: _nullishCoalesce(schema.default, () => ( false))
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
if (schema.description) {
|
|
677
677
|
baseItems.push({
|
|
678
|
-
keyword:
|
|
678
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.describe,
|
|
679
679
|
args: schema.description
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
if (schema.pattern) {
|
|
683
683
|
baseItems.unshift({
|
|
684
|
-
keyword:
|
|
684
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.matches,
|
|
685
685
|
args: schema.pattern
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
if (max !== void 0) {
|
|
689
|
-
baseItems.unshift({ keyword:
|
|
689
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.max, args: max });
|
|
690
690
|
}
|
|
691
691
|
if (min !== void 0) {
|
|
692
|
-
baseItems.unshift({ keyword:
|
|
692
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.min, args: min });
|
|
693
693
|
}
|
|
694
694
|
if (nullable) {
|
|
695
|
-
baseItems.push({ keyword:
|
|
695
|
+
baseItems.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.nullable });
|
|
696
696
|
}
|
|
697
697
|
if (schema.type && Array.isArray(schema.type)) {
|
|
698
698
|
const [_schema2, nullable2] = schema.type;
|
|
699
699
|
if (nullable2 === "null") {
|
|
700
|
-
baseItems.push({ keyword:
|
|
700
|
+
baseItems.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.nullable });
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
if (schema.readOnly) {
|
|
704
|
-
baseItems.push({ keyword:
|
|
704
|
+
baseItems.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.readOnly });
|
|
705
705
|
}
|
|
706
706
|
if (_oas.isReference.call(void 0, schema)) {
|
|
707
|
-
return [...
|
|
707
|
+
return [..._chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getRefAlias, getRefAlias_fn).call(this, schema), ...baseItems];
|
|
708
708
|
}
|
|
709
709
|
if (schema.oneOf) {
|
|
710
710
|
const schemaWithoutOneOf = { ...schema, oneOf: void 0 };
|
|
711
711
|
const union = {
|
|
712
|
-
keyword:
|
|
712
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.union,
|
|
713
713
|
args: schema.oneOf.map((item) => {
|
|
714
714
|
return item && this.buildSchemas({ schema: item, name, parentName })[0];
|
|
715
715
|
}).filter(Boolean).filter((item) => {
|
|
@@ -724,13 +724,13 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
724
724
|
if (schema.anyOf) {
|
|
725
725
|
const schemaWithoutAnyOf = { ...schema, anyOf: void 0 };
|
|
726
726
|
const union = {
|
|
727
|
-
keyword:
|
|
727
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.union,
|
|
728
728
|
args: schema.anyOf.map((item) => {
|
|
729
729
|
return item && this.buildSchemas({ schema: item, name, parentName })[0];
|
|
730
730
|
}).filter(Boolean).filter((item) => {
|
|
731
731
|
return item && item.keyword !== unknownReturn;
|
|
732
732
|
}).map((item) => {
|
|
733
|
-
if (
|
|
733
|
+
if (_chunk4OLWDMEKcjs.isKeyword.call(void 0, item, _chunk4OLWDMEKcjs.schemaKeywords.object)) {
|
|
734
734
|
return {
|
|
735
735
|
...item,
|
|
736
736
|
args: {
|
|
@@ -750,7 +750,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
750
750
|
if (schema.allOf) {
|
|
751
751
|
const schemaWithoutAllOf = { ...schema, allOf: void 0 };
|
|
752
752
|
const and = {
|
|
753
|
-
keyword:
|
|
753
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.and,
|
|
754
754
|
args: schema.allOf.map((item) => {
|
|
755
755
|
return item && this.buildSchemas({ schema: item, name, parentName })[0];
|
|
756
756
|
}).filter(Boolean).filter((item) => {
|
|
@@ -769,7 +769,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
769
769
|
return [and, ...baseItems];
|
|
770
770
|
}
|
|
771
771
|
if (schema.enum) {
|
|
772
|
-
const enumName = _utils.getUniqueName.call(void 0, _transformers.pascalCase.call(void 0, [parentName, name, options.enumSuffix].join(" ")),
|
|
772
|
+
const enumName = _utils.getUniqueName.call(void 0, _transformers.pascalCase.call(void 0, [parentName, name, options.enumSuffix].join(" ")), _chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _getUsedEnumNames, getUsedEnumNames_fn).call(this, { schema, name }));
|
|
773
773
|
const typeName = this.context.pluginManager.resolveName({
|
|
774
774
|
name: enumName,
|
|
775
775
|
pluginKey: this.context.plugin.key,
|
|
@@ -778,7 +778,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
778
778
|
const extensionEnums = ["x-enumNames", "x-enum-varnames"].filter((extensionKey) => extensionKey in schema).map((extensionKey) => {
|
|
779
779
|
return [
|
|
780
780
|
{
|
|
781
|
-
keyword:
|
|
781
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.enum,
|
|
782
782
|
args: {
|
|
783
783
|
name,
|
|
784
784
|
typeName,
|
|
@@ -791,15 +791,15 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
791
791
|
}
|
|
792
792
|
},
|
|
793
793
|
...baseItems.filter(
|
|
794
|
-
(item) => item.keyword !==
|
|
794
|
+
(item) => item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.min && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.max && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.matches
|
|
795
795
|
)
|
|
796
796
|
];
|
|
797
797
|
});
|
|
798
798
|
if (schema.type === "number" || schema.type === "integer") {
|
|
799
|
-
const enumNames = _optionalChain([extensionEnums, 'access', _94 => _94[0], 'optionalAccess', _95 => _95.find, 'call', _96 => _96((item) =>
|
|
799
|
+
const enumNames = _optionalChain([extensionEnums, 'access', _94 => _94[0], 'optionalAccess', _95 => _95.find, 'call', _96 => _96((item) => _chunk4OLWDMEKcjs.isKeyword.call(void 0, item, _chunk4OLWDMEKcjs.schemaKeywords.enum))]);
|
|
800
800
|
return [
|
|
801
801
|
{
|
|
802
|
-
keyword:
|
|
802
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.enum,
|
|
803
803
|
args: {
|
|
804
804
|
name: enumName,
|
|
805
805
|
typeName,
|
|
@@ -817,7 +817,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
817
817
|
})
|
|
818
818
|
}
|
|
819
819
|
},
|
|
820
|
-
...baseItems.filter((item) => item.keyword !==
|
|
820
|
+
...baseItems.filter((item) => item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.min && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.max && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.matches)
|
|
821
821
|
];
|
|
822
822
|
}
|
|
823
823
|
if (extensionEnums.length > 0 && extensionEnums[0]) {
|
|
@@ -825,7 +825,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
825
825
|
}
|
|
826
826
|
return [
|
|
827
827
|
{
|
|
828
|
-
keyword:
|
|
828
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.enum,
|
|
829
829
|
args: {
|
|
830
830
|
name: enumName,
|
|
831
831
|
typeName,
|
|
@@ -837,14 +837,14 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
837
837
|
}))
|
|
838
838
|
}
|
|
839
839
|
},
|
|
840
|
-
...baseItems.filter((item) => item.keyword !==
|
|
840
|
+
...baseItems.filter((item) => item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.min && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.max && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.matches)
|
|
841
841
|
];
|
|
842
842
|
}
|
|
843
843
|
if ("prefixItems" in schema) {
|
|
844
844
|
const prefixItems = schema.prefixItems;
|
|
845
845
|
return [
|
|
846
846
|
{
|
|
847
|
-
keyword:
|
|
847
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.tuple,
|
|
848
848
|
args: prefixItems.map((item) => {
|
|
849
849
|
return this.buildSchemas({ schema: item, name, parentName })[0];
|
|
850
850
|
}).filter(Boolean)
|
|
@@ -856,7 +856,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
856
856
|
if (schema["const"]) {
|
|
857
857
|
return [
|
|
858
858
|
{
|
|
859
|
-
keyword:
|
|
859
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.const,
|
|
860
860
|
args: {
|
|
861
861
|
name: schema["const"],
|
|
862
862
|
format: typeof schema["const"] === "number" ? "number" : "string",
|
|
@@ -866,57 +866,57 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
866
866
|
...baseItems
|
|
867
867
|
];
|
|
868
868
|
}
|
|
869
|
-
return [{ keyword:
|
|
869
|
+
return [{ keyword: _chunk4OLWDMEKcjs.schemaKeywords.null }];
|
|
870
870
|
}
|
|
871
871
|
if (schema.format) {
|
|
872
872
|
switch (schema.format) {
|
|
873
873
|
case "binary":
|
|
874
|
-
baseItems.push({ keyword:
|
|
874
|
+
baseItems.push({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.blob });
|
|
875
875
|
return baseItems;
|
|
876
876
|
case "date-time":
|
|
877
877
|
if (options.dateType) {
|
|
878
878
|
if (options.dateType === "date") {
|
|
879
|
-
baseItems.unshift({ keyword:
|
|
879
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.date, args: { type: "date" } });
|
|
880
880
|
return baseItems;
|
|
881
881
|
}
|
|
882
882
|
if (options.dateType === "stringOffset") {
|
|
883
|
-
baseItems.unshift({ keyword:
|
|
883
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.datetime, args: { offset: true } });
|
|
884
884
|
return baseItems;
|
|
885
885
|
}
|
|
886
886
|
if (options.dateType === "stringLocal") {
|
|
887
|
-
baseItems.unshift({ keyword:
|
|
887
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.datetime, args: { local: true } });
|
|
888
888
|
return baseItems;
|
|
889
889
|
}
|
|
890
|
-
baseItems.unshift({ keyword:
|
|
890
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.datetime, args: { offset: false } });
|
|
891
891
|
return baseItems;
|
|
892
892
|
}
|
|
893
893
|
break;
|
|
894
894
|
case "date":
|
|
895
895
|
if (options.dateType) {
|
|
896
896
|
if (options.dateType === "date") {
|
|
897
|
-
baseItems.unshift({ keyword:
|
|
897
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.date, args: { type: "date" } });
|
|
898
898
|
return baseItems;
|
|
899
899
|
}
|
|
900
|
-
baseItems.unshift({ keyword:
|
|
900
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.date, args: { type: "string" } });
|
|
901
901
|
return baseItems;
|
|
902
902
|
}
|
|
903
903
|
break;
|
|
904
904
|
case "time":
|
|
905
905
|
if (options.dateType) {
|
|
906
906
|
if (options.dateType === "date") {
|
|
907
|
-
baseItems.unshift({ keyword:
|
|
907
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.time, args: { type: "date" } });
|
|
908
908
|
return baseItems;
|
|
909
909
|
}
|
|
910
|
-
baseItems.unshift({ keyword:
|
|
910
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.time, args: { type: "string" } });
|
|
911
911
|
return baseItems;
|
|
912
912
|
}
|
|
913
913
|
break;
|
|
914
914
|
case "uuid":
|
|
915
|
-
baseItems.unshift({ keyword:
|
|
915
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.uuid });
|
|
916
916
|
break;
|
|
917
917
|
case "email":
|
|
918
918
|
case "idn-email":
|
|
919
|
-
baseItems.unshift({ keyword:
|
|
919
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.email });
|
|
920
920
|
break;
|
|
921
921
|
case "uri":
|
|
922
922
|
case "ipv4":
|
|
@@ -924,7 +924,7 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
924
924
|
case "uri-reference":
|
|
925
925
|
case "hostname":
|
|
926
926
|
case "idn-hostname":
|
|
927
|
-
baseItems.unshift({ keyword:
|
|
927
|
+
baseItems.unshift({ keyword: _chunk4OLWDMEKcjs.schemaKeywords.url });
|
|
928
928
|
break;
|
|
929
929
|
default:
|
|
930
930
|
break;
|
|
@@ -936,18 +936,18 @@ parseSchemaObject_fn = function({ schema: _schema, name, parentName }) {
|
|
|
936
936
|
const items = this.buildSchemas({ schema: "items" in schema ? schema.items : [], name, parentName });
|
|
937
937
|
return [
|
|
938
938
|
{
|
|
939
|
-
keyword:
|
|
939
|
+
keyword: _chunk4OLWDMEKcjs.schemaKeywords.array,
|
|
940
940
|
args: {
|
|
941
941
|
items,
|
|
942
942
|
min: min2,
|
|
943
943
|
max: max2
|
|
944
944
|
}
|
|
945
945
|
},
|
|
946
|
-
...baseItems.filter((item) => item.keyword !==
|
|
946
|
+
...baseItems.filter((item) => item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.min && item.keyword !== _chunk4OLWDMEKcjs.schemaKeywords.max)
|
|
947
947
|
];
|
|
948
948
|
}
|
|
949
949
|
if (schema.properties || schema.additionalProperties) {
|
|
950
|
-
return [...
|
|
950
|
+
return [..._chunkBDNSPC5Zcjs.__privateMethod.call(void 0, this, _parseProperties, parseProperties_fn).call(this, { schema, name }), ...baseItems];
|
|
951
951
|
}
|
|
952
952
|
if (schema.type) {
|
|
953
953
|
if (Array.isArray(schema.type)) {
|
|
@@ -981,5 +981,5 @@ var src_default = definePluginDefault;
|
|
|
981
981
|
|
|
982
982
|
|
|
983
983
|
|
|
984
|
-
exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = SchemaGenerator; exports.default = src_default; exports.isKeyword =
|
|
984
|
+
exports.OperationGenerator = OperationGenerator; exports.SchemaGenerator = SchemaGenerator; exports.default = src_default; exports.isKeyword = _chunk4OLWDMEKcjs.isKeyword; exports.pluginOas = pluginOas; exports.pluginOasName = pluginOasName; exports.schemaKeywords = _chunk4OLWDMEKcjs.schemaKeywords;
|
|
985
985
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
getSchemaFactory,
|
|
3
3
|
getSchemas,
|
|
4
4
|
parseFromConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XRPYJNPR.js";
|
|
6
6
|
import {
|
|
7
7
|
isKeyword,
|
|
8
8
|
schemaKeywords
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BIJSTJCQ.js";
|
|
10
10
|
import {
|
|
11
11
|
__privateAdd,
|
|
12
12
|
__privateGet,
|
|
13
13
|
__privateMethod,
|
|
14
14
|
__privateSet,
|
|
15
15
|
init_esm_shims
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UMYKVV7G.js";
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
19
|
init_esm_shims();
|
package/dist/utils.cjs
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkI2JOGJIBcjs = require('./chunk-I2JOGJIB.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkBDNSPC5Zcjs = require('./chunk-BDNSPC5Z.cjs');
|
|
9
9
|
|
|
10
10
|
// src/utils/index.ts
|
|
11
|
-
|
|
11
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
|
|
13
13
|
// src/utils/getComments.ts
|
|
14
|
-
|
|
14
|
+
_chunkBDNSPC5Zcjs.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
|
+
_chunkBDNSPC5Zcjs.init_cjs_shims.call(void 0, );
|
|
28
28
|
var _path = require('path');
|
|
29
29
|
var _core = require('@kubb/core');
|
|
30
30
|
var _fs = require('@kubb/core/fs');
|
|
@@ -69,7 +69,7 @@ async function getGroupedByTagFiles({ logger, files, plugin, template, exportAs,
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// src/utils/getParams.ts
|
|
72
|
-
|
|
72
|
+
_chunkBDNSPC5Zcjs.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
|
+
_chunkBDNSPC5Zcjs.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 = _chunkI2JOGJIBcjs.getSchemaFactory; exports.getSchemas = _chunkI2JOGJIBcjs.getSchemas; exports.parseFromConfig = _chunkI2JOGJIBcjs.parseFromConfig; exports.refsSorter = refsSorter;
|
|
126
126
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getSchemaFactory,
|
|
3
3
|
getSchemas,
|
|
4
4
|
parseFromConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XRPYJNPR.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UMYKVV7G.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.18.
|
|
3
|
+
"version": "2.18.4",
|
|
4
4
|
"description": "Generator swagger",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@stoplight/yaml": "^4.3.0",
|
|
70
70
|
"remeda": "^1.61.0",
|
|
71
|
-
"@kubb/core": "2.18.
|
|
72
|
-
"@kubb/oas": "2.18.
|
|
73
|
-
"@kubb/react": "2.18.
|
|
71
|
+
"@kubb/core": "2.18.4",
|
|
72
|
+
"@kubb/oas": "2.18.4",
|
|
73
|
+
"@kubb/react": "2.18.4"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/react": "^18.3.1",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"react": "^18.3.1",
|
|
79
79
|
"tsup": "^8.0.2",
|
|
80
80
|
"typescript": "^5.4.5",
|
|
81
|
-
"@kubb/config-biome": "2.18.
|
|
82
|
-
"@kubb/config-ts": "2.18.
|
|
83
|
-
"@kubb/config-tsup": "2.18.
|
|
81
|
+
"@kubb/config-biome": "2.18.4",
|
|
82
|
+
"@kubb/config-ts": "2.18.4",
|
|
83
|
+
"@kubb/config-tsup": "2.18.4"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@kubb/react": "2.18.
|
|
86
|
+
"@kubb/react": "2.18.4"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|
|
89
89
|
"node": ">=18",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|