@kubb/plugin-ts 3.6.0 → 3.6.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-ULWNGDG4.js → chunk-2WAGTL4H.js} +92 -99
- package/dist/chunk-2WAGTL4H.js.map +1 -0
- package/dist/{chunk-4SOGPJKA.cjs → chunk-46QPECUV.cjs} +21 -21
- package/dist/{chunk-4SOGPJKA.cjs.map → chunk-46QPECUV.cjs.map} +1 -1
- package/dist/{chunk-6TOW4T6P.js → chunk-AYA2SL3G.js} +18 -18
- package/dist/{chunk-6TOW4T6P.js.map → chunk-AYA2SL3G.js.map} +1 -1
- package/dist/{chunk-BORNH5HV.cjs → chunk-TBG2ENOI.cjs} +92 -99
- package/dist/chunk-TBG2ENOI.cjs.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-BJ5UjIUu.d.cts → types-D1yD2jvM.d.cts} +2 -2
- package/dist/{types-BJ5UjIUu.d.ts → types-D1yD2jvM.d.ts} +2 -2
- package/package.json +10 -10
- package/src/generators/__snapshots__/enumArray.ts +2 -14
- package/src/generators/__snapshots__/enumArray20.ts +15 -0
- package/dist/chunk-BORNH5HV.cjs.map +0 -1
- package/dist/chunk-ULWNGDG4.js.map +0 -1
|
@@ -59,9 +59,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
59
59
|
mod
|
|
60
60
|
));
|
|
61
61
|
|
|
62
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
62
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.0_@types+node@20.17.19__jiti@2.4.2_postcss@8.5.3_typescript@5.7.3_yaml@2.6.1/node_modules/tsup/assets/cjs_shims.js
|
|
63
63
|
var init_cjs_shims = __esm({
|
|
64
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
64
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.0_@types+node@20.17.19__jiti@2.4.2_postcss@8.5.3_typescript@5.7.3_yaml@2.6.1/node_modules/tsup/assets/cjs_shims.js"() {
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
|
|
@@ -127,14 +127,14 @@ var require_react_production_min = __commonJS({
|
|
|
127
127
|
var L = { key: true, ref: true, __self: true, __source: true };
|
|
128
128
|
function M(a, b, e) {
|
|
129
129
|
var d, c = {}, k = null, h = null;
|
|
130
|
-
if (null != b) for (d in
|
|
130
|
+
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
131
131
|
var g = arguments.length - 2;
|
|
132
132
|
if (1 === g) c.children = e;
|
|
133
133
|
else if (1 < g) {
|
|
134
134
|
for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
|
|
135
135
|
c.children = f;
|
|
136
136
|
}
|
|
137
|
-
if (a && a.defaultProps) for (d in g = a.defaultProps, g)
|
|
137
|
+
if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
|
|
138
138
|
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
139
139
|
}
|
|
140
140
|
function N(a, b) {
|
|
@@ -239,13 +239,13 @@ var require_react_production_min = __commonJS({
|
|
|
239
239
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
240
240
|
exports.act = X;
|
|
241
241
|
exports.cloneElement = function(a, b, e) {
|
|
242
|
-
if (null === a ||
|
|
242
|
+
if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
243
243
|
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
244
244
|
if (null != b) {
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
246
|
+
void 0 !== b.key && (c = "" + b.key);
|
|
247
247
|
if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
|
|
248
|
-
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] =
|
|
248
|
+
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
249
249
|
}
|
|
250
250
|
var f = arguments.length - 2;
|
|
251
251
|
if (1 === f) d.children = e;
|
|
@@ -278,7 +278,7 @@ var require_react_production_min = __commonJS({
|
|
|
278
278
|
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
279
279
|
};
|
|
280
280
|
exports.memo = function(a, b) {
|
|
281
|
-
return { $$typeof: x, type: a, compare:
|
|
281
|
+
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
282
282
|
};
|
|
283
283
|
exports.startTransition = function(a) {
|
|
284
284
|
var b = V.transition;
|
|
@@ -575,7 +575,7 @@ var require_react_development = __commonJS({
|
|
|
575
575
|
Object.defineProperty(Component.prototype, methodName, {
|
|
576
576
|
get: function() {
|
|
577
577
|
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
578
|
-
return
|
|
578
|
+
return void 0;
|
|
579
579
|
}
|
|
580
580
|
});
|
|
581
581
|
};
|
|
@@ -729,7 +729,7 @@ var require_react_development = __commonJS({
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
-
return config.ref !==
|
|
732
|
+
return config.ref !== void 0;
|
|
733
733
|
}
|
|
734
734
|
function hasValidKey(config) {
|
|
735
735
|
{
|
|
@@ -740,7 +740,7 @@ var require_react_development = __commonJS({
|
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
return config.key !==
|
|
743
|
+
return config.key !== void 0;
|
|
744
744
|
}
|
|
745
745
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
746
746
|
var warnAboutAccessingKey = function() {
|
|
@@ -842,8 +842,8 @@ var require_react_development = __commonJS({
|
|
|
842
842
|
}
|
|
843
843
|
key = "" + config.key;
|
|
844
844
|
}
|
|
845
|
-
self = config.__self ===
|
|
846
|
-
source = config.__source ===
|
|
845
|
+
self = config.__self === void 0 ? null : config.__self;
|
|
846
|
+
source = config.__source === void 0 ? null : config.__source;
|
|
847
847
|
for (propName in config) {
|
|
848
848
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
849
849
|
props[propName] = config[propName];
|
|
@@ -868,7 +868,7 @@ var require_react_development = __commonJS({
|
|
|
868
868
|
if (type && type.defaultProps) {
|
|
869
869
|
var defaultProps = type.defaultProps;
|
|
870
870
|
for (propName in defaultProps) {
|
|
871
|
-
if (props[propName] ===
|
|
871
|
+
if (props[propName] === void 0) {
|
|
872
872
|
props[propName] = defaultProps[propName];
|
|
873
873
|
}
|
|
874
874
|
}
|
|
@@ -891,7 +891,7 @@ var require_react_development = __commonJS({
|
|
|
891
891
|
return newElement;
|
|
892
892
|
}
|
|
893
893
|
function cloneElement(element, config, children) {
|
|
894
|
-
if (element === null || element ===
|
|
894
|
+
if (element === null || element === void 0) {
|
|
895
895
|
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
896
896
|
}
|
|
897
897
|
var propName;
|
|
@@ -918,7 +918,7 @@ var require_react_development = __commonJS({
|
|
|
918
918
|
}
|
|
919
919
|
for (propName in config) {
|
|
920
920
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
921
|
-
if (config[propName] ===
|
|
921
|
+
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
922
922
|
props[propName] = defaultProps[propName];
|
|
923
923
|
} else {
|
|
924
924
|
props[propName] = config[propName];
|
|
@@ -1224,7 +1224,7 @@ var require_react_development = __commonJS({
|
|
|
1224
1224
|
if (payload._status === Resolved) {
|
|
1225
1225
|
var moduleObject = payload._result;
|
|
1226
1226
|
{
|
|
1227
|
-
if (moduleObject ===
|
|
1227
|
+
if (moduleObject === void 0) {
|
|
1228
1228
|
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
@@ -1338,7 +1338,7 @@ var require_react_development = __commonJS({
|
|
|
1338
1338
|
// types supported by any Flight configuration anywhere since
|
|
1339
1339
|
// we don't know which Flight build this will end up being used
|
|
1340
1340
|
// with.
|
|
1341
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !==
|
|
1341
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1342
1342
|
return true;
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
@@ -1353,7 +1353,7 @@ var require_react_development = __commonJS({
|
|
|
1353
1353
|
var elementType = {
|
|
1354
1354
|
$$typeof: REACT_MEMO_TYPE,
|
|
1355
1355
|
type,
|
|
1356
|
-
compare: compare ===
|
|
1356
|
+
compare: compare === void 0 ? null : compare
|
|
1357
1357
|
};
|
|
1358
1358
|
{
|
|
1359
1359
|
var ownName;
|
|
@@ -1385,7 +1385,7 @@ var require_react_development = __commonJS({
|
|
|
1385
1385
|
function useContext(Context) {
|
|
1386
1386
|
var dispatcher = resolveDispatcher();
|
|
1387
1387
|
{
|
|
1388
|
-
if (Context._context !==
|
|
1388
|
+
if (Context._context !== void 0) {
|
|
1389
1389
|
var realContext = Context._context;
|
|
1390
1390
|
if (realContext.Consumer === Context) {
|
|
1391
1391
|
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
@@ -1536,7 +1536,7 @@ var require_react_development = __commonJS({
|
|
|
1536
1536
|
var prefix;
|
|
1537
1537
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1538
1538
|
{
|
|
1539
|
-
if (prefix ===
|
|
1539
|
+
if (prefix === void 0) {
|
|
1540
1540
|
try {
|
|
1541
1541
|
throw Error();
|
|
1542
1542
|
} catch (x) {
|
|
@@ -1559,14 +1559,14 @@ var require_react_development = __commonJS({
|
|
|
1559
1559
|
}
|
|
1560
1560
|
{
|
|
1561
1561
|
var frame = componentFrameCache.get(fn);
|
|
1562
|
-
if (frame !==
|
|
1562
|
+
if (frame !== void 0) {
|
|
1563
1563
|
return frame;
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
1566
|
var control;
|
|
1567
1567
|
reentry = true;
|
|
1568
1568
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1569
|
-
Error.prepareStackTrace =
|
|
1569
|
+
Error.prepareStackTrace = void 0;
|
|
1570
1570
|
var previousDispatcher;
|
|
1571
1571
|
{
|
|
1572
1572
|
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
@@ -1720,7 +1720,7 @@ var require_react_development = __commonJS({
|
|
|
1720
1720
|
var has = Function.call.bind(hasOwnProperty);
|
|
1721
1721
|
for (var typeSpecName in typeSpecs) {
|
|
1722
1722
|
if (has(typeSpecs, typeSpecName)) {
|
|
1723
|
-
var error$1 =
|
|
1723
|
+
var error$1 = void 0;
|
|
1724
1724
|
try {
|
|
1725
1725
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1726
1726
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
@@ -1771,7 +1771,7 @@ var require_react_development = __commonJS({
|
|
|
1771
1771
|
return "";
|
|
1772
1772
|
}
|
|
1773
1773
|
function getSourceInfoErrorAddendum(source) {
|
|
1774
|
-
if (source !==
|
|
1774
|
+
if (source !== void 0) {
|
|
1775
1775
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1776
1776
|
var lineNumber = source.lineNumber;
|
|
1777
1777
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
@@ -1779,7 +1779,7 @@ var require_react_development = __commonJS({
|
|
|
1779
1779
|
return "";
|
|
1780
1780
|
}
|
|
1781
1781
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1782
|
-
if (elementProps !== null && elementProps !==
|
|
1782
|
+
if (elementProps !== null && elementProps !== void 0) {
|
|
1783
1783
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1784
1784
|
}
|
|
1785
1785
|
return "";
|
|
@@ -1848,7 +1848,7 @@ var require_react_development = __commonJS({
|
|
|
1848
1848
|
function validatePropTypes(element) {
|
|
1849
1849
|
{
|
|
1850
1850
|
var type = element.type;
|
|
1851
|
-
if (type === null || type ===
|
|
1851
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
1852
1852
|
return;
|
|
1853
1853
|
}
|
|
1854
1854
|
var propTypes;
|
|
@@ -1864,7 +1864,7 @@ var require_react_development = __commonJS({
|
|
|
1864
1864
|
if (propTypes) {
|
|
1865
1865
|
var name = getComponentNameFromType(type);
|
|
1866
1866
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1867
|
-
} else if (type.PropTypes !==
|
|
1867
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1868
1868
|
propTypesMisspellWarningShown = true;
|
|
1869
1869
|
var _name = getComponentNameFromType(type);
|
|
1870
1870
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
@@ -1897,7 +1897,7 @@ var require_react_development = __commonJS({
|
|
|
1897
1897
|
var validType = isValidElementType(type);
|
|
1898
1898
|
if (!validType) {
|
|
1899
1899
|
var info = "";
|
|
1900
|
-
if (type ===
|
|
1900
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1901
1901
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1902
1902
|
}
|
|
1903
1903
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
@@ -1911,7 +1911,7 @@ var require_react_development = __commonJS({
|
|
|
1911
1911
|
typeString = "null";
|
|
1912
1912
|
} else if (isArray(type)) {
|
|
1913
1913
|
typeString = "array";
|
|
1914
|
-
} else if (type !==
|
|
1914
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1915
1915
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1916
1916
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1917
1917
|
} else {
|
|
@@ -2009,7 +2009,7 @@ var require_react_development = __commonJS({
|
|
|
2009
2009
|
}
|
|
2010
2010
|
var channel = new MessageChannel();
|
|
2011
2011
|
channel.port1.onmessage = callback;
|
|
2012
|
-
channel.port2.postMessage(
|
|
2012
|
+
channel.port2.postMessage(void 0);
|
|
2013
2013
|
};
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
@@ -2230,7 +2230,7 @@ init_cjs_shims();
|
|
|
2230
2230
|
init_cjs_shims();
|
|
2231
2231
|
function OasType({ name, typeName, api }) {
|
|
2232
2232
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2233
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api,
|
|
2233
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const` }),
|
|
2234
2234
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
2235
2235
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` }) })
|
|
2236
2236
|
] });
|
|
@@ -2256,30 +2256,30 @@ var typeKeywordMapper = {
|
|
|
2256
2256
|
string: () => factory__namespace.keywordTypeNodes.string,
|
|
2257
2257
|
boolean: () => factory__namespace.keywordTypeNodes.boolean,
|
|
2258
2258
|
undefined: () => factory__namespace.keywordTypeNodes.undefined,
|
|
2259
|
-
nullable:
|
|
2259
|
+
nullable: void 0,
|
|
2260
2260
|
null: () => factory__namespace.keywordTypeNodes.null,
|
|
2261
|
-
nullish:
|
|
2261
|
+
nullish: void 0,
|
|
2262
2262
|
array: (nodes) => {
|
|
2263
2263
|
if (!nodes) {
|
|
2264
|
-
return
|
|
2264
|
+
return void 0;
|
|
2265
2265
|
}
|
|
2266
2266
|
return factory__namespace.createArrayDeclaration({ nodes });
|
|
2267
2267
|
},
|
|
2268
2268
|
tuple: (nodes) => {
|
|
2269
2269
|
if (!nodes) {
|
|
2270
|
-
return
|
|
2270
|
+
return void 0;
|
|
2271
2271
|
}
|
|
2272
2272
|
return factory__namespace.createTupleTypeNode(nodes);
|
|
2273
2273
|
},
|
|
2274
2274
|
enum: (name) => {
|
|
2275
2275
|
if (!name) {
|
|
2276
|
-
return
|
|
2276
|
+
return void 0;
|
|
2277
2277
|
}
|
|
2278
|
-
return factory__namespace.createTypeReferenceNode(name,
|
|
2278
|
+
return factory__namespace.createTypeReferenceNode(name, void 0);
|
|
2279
2279
|
},
|
|
2280
2280
|
union: (nodes) => {
|
|
2281
2281
|
if (!nodes) {
|
|
2282
|
-
return
|
|
2282
|
+
return void 0;
|
|
2283
2283
|
}
|
|
2284
2284
|
return factory__namespace.createUnionDeclaration({
|
|
2285
2285
|
withParentheses: true,
|
|
@@ -2288,7 +2288,7 @@ var typeKeywordMapper = {
|
|
|
2288
2288
|
},
|
|
2289
2289
|
const: (name, format) => {
|
|
2290
2290
|
if (!name) {
|
|
2291
|
-
return
|
|
2291
|
+
return void 0;
|
|
2292
2292
|
}
|
|
2293
2293
|
if (format === "boolean") {
|
|
2294
2294
|
if (name === true) {
|
|
@@ -2306,58 +2306,58 @@ var typeKeywordMapper = {
|
|
|
2306
2306
|
time: (type = "string") => type === "string" ? factory__namespace.keywordTypeNodes.string : factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier("Date")),
|
|
2307
2307
|
uuid: () => factory__namespace.keywordTypeNodes.string,
|
|
2308
2308
|
url: () => factory__namespace.keywordTypeNodes.string,
|
|
2309
|
-
strict:
|
|
2310
|
-
default:
|
|
2309
|
+
strict: void 0,
|
|
2310
|
+
default: void 0,
|
|
2311
2311
|
and: (nodes) => {
|
|
2312
2312
|
if (!nodes) {
|
|
2313
|
-
return
|
|
2313
|
+
return void 0;
|
|
2314
2314
|
}
|
|
2315
2315
|
return factory__namespace.createIntersectionDeclaration({
|
|
2316
2316
|
withParentheses: true,
|
|
2317
2317
|
nodes
|
|
2318
2318
|
});
|
|
2319
2319
|
},
|
|
2320
|
-
describe:
|
|
2321
|
-
min:
|
|
2322
|
-
max:
|
|
2323
|
-
optional:
|
|
2320
|
+
describe: void 0,
|
|
2321
|
+
min: void 0,
|
|
2322
|
+
max: void 0,
|
|
2323
|
+
optional: void 0,
|
|
2324
2324
|
matches: () => factory__namespace.keywordTypeNodes.string,
|
|
2325
2325
|
email: () => factory__namespace.keywordTypeNodes.string,
|
|
2326
|
-
firstName:
|
|
2327
|
-
lastName:
|
|
2328
|
-
password:
|
|
2329
|
-
phone:
|
|
2330
|
-
readOnly:
|
|
2331
|
-
writeOnly:
|
|
2326
|
+
firstName: void 0,
|
|
2327
|
+
lastName: void 0,
|
|
2328
|
+
password: void 0,
|
|
2329
|
+
phone: void 0,
|
|
2330
|
+
readOnly: void 0,
|
|
2331
|
+
writeOnly: void 0,
|
|
2332
2332
|
ref: (propertyName) => {
|
|
2333
2333
|
if (!propertyName) {
|
|
2334
|
-
return
|
|
2334
|
+
return void 0;
|
|
2335
2335
|
}
|
|
2336
|
-
return factory__namespace.createTypeReferenceNode(propertyName,
|
|
2336
|
+
return factory__namespace.createTypeReferenceNode(propertyName, void 0);
|
|
2337
2337
|
},
|
|
2338
2338
|
blob: () => factory__namespace.createTypeReferenceNode("Blob", []),
|
|
2339
|
-
deprecated:
|
|
2340
|
-
example:
|
|
2341
|
-
schema:
|
|
2342
|
-
catchall:
|
|
2343
|
-
name:
|
|
2339
|
+
deprecated: void 0,
|
|
2340
|
+
example: void 0,
|
|
2341
|
+
schema: void 0,
|
|
2342
|
+
catchall: void 0,
|
|
2343
|
+
name: void 0
|
|
2344
2344
|
};
|
|
2345
2345
|
function parse({ current, siblings }, options) {
|
|
2346
2346
|
const value = typeKeywordMapper[current.keyword];
|
|
2347
2347
|
if (!value) {
|
|
2348
|
-
return
|
|
2348
|
+
return void 0;
|
|
2349
2349
|
}
|
|
2350
2350
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.union)) {
|
|
2351
2351
|
return typeKeywordMapper.union(
|
|
2352
|
-
current.args.map((schema) => parse({
|
|
2352
|
+
current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2353
2353
|
);
|
|
2354
2354
|
}
|
|
2355
2355
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.and)) {
|
|
2356
|
-
return typeKeywordMapper.and(current.args.map((schema) => parse({
|
|
2356
|
+
return typeKeywordMapper.and(current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean));
|
|
2357
2357
|
}
|
|
2358
2358
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.array)) {
|
|
2359
2359
|
return typeKeywordMapper.array(
|
|
2360
|
-
current.args.items.map((schema) => parse({
|
|
2360
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2361
2361
|
);
|
|
2362
2362
|
}
|
|
2363
2363
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.enum)) {
|
|
@@ -2371,7 +2371,7 @@ function parse({ current, siblings }, options) {
|
|
|
2371
2371
|
}
|
|
2372
2372
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.tuple)) {
|
|
2373
2373
|
return typeKeywordMapper.tuple(
|
|
2374
|
-
current.args.items.map((schema) => parse({
|
|
2374
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2375
2375
|
);
|
|
2376
2376
|
}
|
|
2377
2377
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.const)) {
|
|
@@ -2399,7 +2399,7 @@ function parse({ current, siblings }, options) {
|
|
|
2399
2399
|
const minSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.min);
|
|
2400
2400
|
const maxSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.max);
|
|
2401
2401
|
const matchesSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.matches);
|
|
2402
|
-
let type = schemas.map((schema) => parse({
|
|
2402
|
+
let type = schemas.map((schema) => parse({ current: schema, siblings: schemas }, options)).filter(Boolean)[0];
|
|
2403
2403
|
if (isNullable) {
|
|
2404
2404
|
type = factory__namespace.createUnionDeclaration({
|
|
2405
2405
|
nodes: [type, factory__namespace.keywordTypeNodes.null]
|
|
@@ -2424,20 +2424,20 @@ function parse({ current, siblings }, options) {
|
|
|
2424
2424
|
return factory__namespace.appendJSDocToNode({
|
|
2425
2425
|
node: propertySignature,
|
|
2426
2426
|
comments: [
|
|
2427
|
-
describeSchema ? `@description ${transformers2__default.default.jsStringEscape(describeSchema.args)}` :
|
|
2428
|
-
deprecatedSchema ? "@deprecated" :
|
|
2429
|
-
minSchema ? `@minLength ${minSchema.args}` :
|
|
2430
|
-
maxSchema ? `@maxLength ${maxSchema.args}` :
|
|
2431
|
-
matchesSchema ? `@pattern ${matchesSchema.args}` :
|
|
2432
|
-
defaultSchema ? `@default ${defaultSchema.args}` :
|
|
2433
|
-
exampleSchema ? `@example ${exampleSchema.args}` :
|
|
2434
|
-
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") :
|
|
2427
|
+
describeSchema ? `@description ${transformers2__default.default.jsStringEscape(describeSchema.args)}` : void 0,
|
|
2428
|
+
deprecatedSchema ? "@deprecated" : void 0,
|
|
2429
|
+
minSchema ? `@minLength ${minSchema.args}` : void 0,
|
|
2430
|
+
maxSchema ? `@maxLength ${maxSchema.args}` : void 0,
|
|
2431
|
+
matchesSchema ? `@pattern ${matchesSchema.args}` : void 0,
|
|
2432
|
+
defaultSchema ? `@default ${defaultSchema.args}` : void 0,
|
|
2433
|
+
exampleSchema ? `@example ${exampleSchema.args}` : void 0,
|
|
2434
|
+
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") : void 0
|
|
2435
2435
|
].filter(Boolean)
|
|
2436
2436
|
});
|
|
2437
2437
|
});
|
|
2438
2438
|
const additionalProperties = current.args?.additionalProperties?.length ? factory__namespace.createIndexSignature(
|
|
2439
|
-
current.args.additionalProperties.map((schema) => parse({
|
|
2440
|
-
) :
|
|
2439
|
+
current.args.additionalProperties.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean).at(0)
|
|
2440
|
+
) : void 0;
|
|
2441
2441
|
return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
|
|
2442
2442
|
}
|
|
2443
2443
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.datetime)) {
|
|
@@ -2452,7 +2452,7 @@ function parse({ current, siblings }, options) {
|
|
|
2452
2452
|
if (current.keyword in typeKeywordMapper) {
|
|
2453
2453
|
return value();
|
|
2454
2454
|
}
|
|
2455
|
-
return
|
|
2455
|
+
return void 0;
|
|
2456
2456
|
}
|
|
2457
2457
|
function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntaxType, enumType, mapper, description }) {
|
|
2458
2458
|
const typeNodes = [];
|
|
@@ -2462,17 +2462,10 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2462
2462
|
const schemaFromTree = tree.find((item) => item.keyword === pluginOas.schemaKeywords.schema);
|
|
2463
2463
|
let type = tree.map(
|
|
2464
2464
|
(current, _index, siblings) => parse(
|
|
2465
|
-
{
|
|
2465
|
+
{ current, siblings },
|
|
2466
2466
|
{
|
|
2467
|
-
name,
|
|
2468
|
-
typedName,
|
|
2469
|
-
description,
|
|
2470
|
-
keysToOmit,
|
|
2471
2467
|
optionalType,
|
|
2472
|
-
|
|
2473
|
-
mapper,
|
|
2474
|
-
syntaxType
|
|
2475
|
-
}
|
|
2468
|
+
mapper}
|
|
2476
2469
|
)
|
|
2477
2470
|
).filter(Boolean).at(0) || typeKeywordMapper.undefined();
|
|
2478
2471
|
if (schemaFromTree && pluginOas.isKeyword(schemaFromTree, pluginOas.schemaKeywords.schema) && schemaFromTree.args.type !== "object") {
|
|
@@ -2507,13 +2500,13 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2507
2500
|
}) : type,
|
|
2508
2501
|
syntax: useTypeGeneration ? "type" : "interface",
|
|
2509
2502
|
comments: [
|
|
2510
|
-
description ? `@description ${transformers2__default.default.jsStringEscape(description)}` :
|
|
2511
|
-
schema.deprecated ? "@deprecated" :
|
|
2512
|
-
schema.minLength ? `@minLength ${schema.minLength}` :
|
|
2513
|
-
schema.maxLength ? `@maxLength ${schema.maxLength}` :
|
|
2514
|
-
schema.pattern ? `@pattern ${schema.pattern}` :
|
|
2515
|
-
schema.default ? `@default ${schema.default}` :
|
|
2516
|
-
schema.example ? `@example ${schema.example}` :
|
|
2503
|
+
description ? `@description ${transformers2__default.default.jsStringEscape(description)}` : void 0,
|
|
2504
|
+
schema.deprecated ? "@deprecated" : void 0,
|
|
2505
|
+
schema.minLength ? `@minLength ${schema.minLength}` : void 0,
|
|
2506
|
+
schema.maxLength ? `@maxLength ${schema.maxLength}` : void 0,
|
|
2507
|
+
schema.pattern ? `@pattern ${schema.pattern}` : void 0,
|
|
2508
|
+
schema.default ? `@default ${schema.default}` : void 0,
|
|
2509
|
+
schema.example ? `@example ${schema.example}` : void 0
|
|
2517
2510
|
]
|
|
2518
2511
|
})
|
|
2519
2512
|
);
|
|
@@ -2524,7 +2517,7 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2524
2517
|
const [nameNode, typeNode] = factory__namespace.createEnumDeclaration({
|
|
2525
2518
|
name: name2,
|
|
2526
2519
|
typeName,
|
|
2527
|
-
enums: enumSchema.args.items.map((item) => item.value ===
|
|
2520
|
+
enums: enumSchema.args.items.map((item) => item.value === void 0 ? void 0 : [transformers2__default.default.trimQuotes(item.name?.toString()), item.value]).filter(Boolean),
|
|
2528
2521
|
type: enumType
|
|
2529
2522
|
});
|
|
2530
2523
|
return {
|
|
@@ -2544,8 +2537,8 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2544
2537
|
{
|
|
2545
2538
|
name: typeName,
|
|
2546
2539
|
isIndexable: true,
|
|
2547
|
-
isExportable: ["enum", "asConst", "constEnum", "literal",
|
|
2548
|
-
isTypeOnly: ["asConst", "constEnum", "literal",
|
|
2540
|
+
isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2541
|
+
isTypeOnly: ["asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2549
2542
|
children: parserTs.print([typeNode])
|
|
2550
2543
|
}
|
|
2551
2544
|
)
|
|
@@ -2582,5 +2575,5 @@ react/cjs/react.development.js:
|
|
|
2582
2575
|
exports.OasType = OasType;
|
|
2583
2576
|
exports.Type = Type2;
|
|
2584
2577
|
exports.init_cjs_shims = init_cjs_shims;
|
|
2585
|
-
//# sourceMappingURL=chunk-
|
|
2586
|
-
//# sourceMappingURL=chunk-
|
|
2578
|
+
//# sourceMappingURL=chunk-TBG2ENOI.cjs.map
|
|
2579
|
+
//# sourceMappingURL=chunk-TBG2ENOI.cjs.map
|