@kubb/plugin-ts 3.6.0 → 3.6.2
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-4SOGPJKA.cjs → chunk-HODPITUW.cjs} +21 -21
- package/dist/{chunk-4SOGPJKA.cjs.map → chunk-HODPITUW.cjs.map} +1 -1
- package/dist/{chunk-BORNH5HV.cjs → chunk-ISG4ADLH.cjs} +93 -99
- package/dist/chunk-ISG4ADLH.cjs.map +1 -0
- package/dist/{chunk-6TOW4T6P.js → chunk-PM4CWXK4.js} +18 -18
- package/dist/{chunk-6TOW4T6P.js.map → chunk-PM4CWXK4.js.map} +1 -1
- package/dist/{chunk-ULWNGDG4.js → chunk-WBVEQ3D4.js} +93 -99
- package/dist/chunk-WBVEQ3D4.js.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-DOx63BPA.d.cts} +3 -3
- package/dist/{types-BJ5UjIUu.d.ts → types-DOx63BPA.d.ts} +3 -3
- package/package.json +11 -11
- package/src/generators/__snapshots__/createPet.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +38 -0
- package/src/generators/__snapshots__/enumArray.ts +2 -14
- package/src/generators/__snapshots__/enumArray20.ts +15 -0
- package/src/parser.ts +1 -0
- package/src/types.ts +1 -1
- 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.1_@types+node@20.17.24__jiti@2.4.2_postcss@8.5.3_typescript@5.8.2_yaml@2.7.0/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.1_@types+node@20.17.24__jiti@2.4.2_postcss@8.5.3_typescript@5.8.2_yaml@2.7.0/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
|
] });
|
|
@@ -2245,6 +2245,7 @@ init_cjs_shims();
|
|
|
2245
2245
|
var typeKeywordMapper = {
|
|
2246
2246
|
any: () => factory__namespace.keywordTypeNodes.any,
|
|
2247
2247
|
unknown: () => factory__namespace.keywordTypeNodes.unknown,
|
|
2248
|
+
void: () => factory__namespace.keywordTypeNodes.void,
|
|
2248
2249
|
number: () => factory__namespace.keywordTypeNodes.number,
|
|
2249
2250
|
integer: () => factory__namespace.keywordTypeNodes.number,
|
|
2250
2251
|
object: (nodes) => {
|
|
@@ -2256,30 +2257,30 @@ var typeKeywordMapper = {
|
|
|
2256
2257
|
string: () => factory__namespace.keywordTypeNodes.string,
|
|
2257
2258
|
boolean: () => factory__namespace.keywordTypeNodes.boolean,
|
|
2258
2259
|
undefined: () => factory__namespace.keywordTypeNodes.undefined,
|
|
2259
|
-
nullable:
|
|
2260
|
+
nullable: void 0,
|
|
2260
2261
|
null: () => factory__namespace.keywordTypeNodes.null,
|
|
2261
|
-
nullish:
|
|
2262
|
+
nullish: void 0,
|
|
2262
2263
|
array: (nodes) => {
|
|
2263
2264
|
if (!nodes) {
|
|
2264
|
-
return
|
|
2265
|
+
return void 0;
|
|
2265
2266
|
}
|
|
2266
2267
|
return factory__namespace.createArrayDeclaration({ nodes });
|
|
2267
2268
|
},
|
|
2268
2269
|
tuple: (nodes) => {
|
|
2269
2270
|
if (!nodes) {
|
|
2270
|
-
return
|
|
2271
|
+
return void 0;
|
|
2271
2272
|
}
|
|
2272
2273
|
return factory__namespace.createTupleTypeNode(nodes);
|
|
2273
2274
|
},
|
|
2274
2275
|
enum: (name) => {
|
|
2275
2276
|
if (!name) {
|
|
2276
|
-
return
|
|
2277
|
+
return void 0;
|
|
2277
2278
|
}
|
|
2278
|
-
return factory__namespace.createTypeReferenceNode(name,
|
|
2279
|
+
return factory__namespace.createTypeReferenceNode(name, void 0);
|
|
2279
2280
|
},
|
|
2280
2281
|
union: (nodes) => {
|
|
2281
2282
|
if (!nodes) {
|
|
2282
|
-
return
|
|
2283
|
+
return void 0;
|
|
2283
2284
|
}
|
|
2284
2285
|
return factory__namespace.createUnionDeclaration({
|
|
2285
2286
|
withParentheses: true,
|
|
@@ -2288,7 +2289,7 @@ var typeKeywordMapper = {
|
|
|
2288
2289
|
},
|
|
2289
2290
|
const: (name, format) => {
|
|
2290
2291
|
if (!name) {
|
|
2291
|
-
return
|
|
2292
|
+
return void 0;
|
|
2292
2293
|
}
|
|
2293
2294
|
if (format === "boolean") {
|
|
2294
2295
|
if (name === true) {
|
|
@@ -2306,58 +2307,58 @@ var typeKeywordMapper = {
|
|
|
2306
2307
|
time: (type = "string") => type === "string" ? factory__namespace.keywordTypeNodes.string : factory__namespace.createTypeReferenceNode(factory__namespace.createIdentifier("Date")),
|
|
2307
2308
|
uuid: () => factory__namespace.keywordTypeNodes.string,
|
|
2308
2309
|
url: () => factory__namespace.keywordTypeNodes.string,
|
|
2309
|
-
strict:
|
|
2310
|
-
default:
|
|
2310
|
+
strict: void 0,
|
|
2311
|
+
default: void 0,
|
|
2311
2312
|
and: (nodes) => {
|
|
2312
2313
|
if (!nodes) {
|
|
2313
|
-
return
|
|
2314
|
+
return void 0;
|
|
2314
2315
|
}
|
|
2315
2316
|
return factory__namespace.createIntersectionDeclaration({
|
|
2316
2317
|
withParentheses: true,
|
|
2317
2318
|
nodes
|
|
2318
2319
|
});
|
|
2319
2320
|
},
|
|
2320
|
-
describe:
|
|
2321
|
-
min:
|
|
2322
|
-
max:
|
|
2323
|
-
optional:
|
|
2321
|
+
describe: void 0,
|
|
2322
|
+
min: void 0,
|
|
2323
|
+
max: void 0,
|
|
2324
|
+
optional: void 0,
|
|
2324
2325
|
matches: () => factory__namespace.keywordTypeNodes.string,
|
|
2325
2326
|
email: () => factory__namespace.keywordTypeNodes.string,
|
|
2326
|
-
firstName:
|
|
2327
|
-
lastName:
|
|
2328
|
-
password:
|
|
2329
|
-
phone:
|
|
2330
|
-
readOnly:
|
|
2331
|
-
writeOnly:
|
|
2327
|
+
firstName: void 0,
|
|
2328
|
+
lastName: void 0,
|
|
2329
|
+
password: void 0,
|
|
2330
|
+
phone: void 0,
|
|
2331
|
+
readOnly: void 0,
|
|
2332
|
+
writeOnly: void 0,
|
|
2332
2333
|
ref: (propertyName) => {
|
|
2333
2334
|
if (!propertyName) {
|
|
2334
|
-
return
|
|
2335
|
+
return void 0;
|
|
2335
2336
|
}
|
|
2336
|
-
return factory__namespace.createTypeReferenceNode(propertyName,
|
|
2337
|
+
return factory__namespace.createTypeReferenceNode(propertyName, void 0);
|
|
2337
2338
|
},
|
|
2338
2339
|
blob: () => factory__namespace.createTypeReferenceNode("Blob", []),
|
|
2339
|
-
deprecated:
|
|
2340
|
-
example:
|
|
2341
|
-
schema:
|
|
2342
|
-
catchall:
|
|
2343
|
-
name:
|
|
2340
|
+
deprecated: void 0,
|
|
2341
|
+
example: void 0,
|
|
2342
|
+
schema: void 0,
|
|
2343
|
+
catchall: void 0,
|
|
2344
|
+
name: void 0
|
|
2344
2345
|
};
|
|
2345
2346
|
function parse({ current, siblings }, options) {
|
|
2346
2347
|
const value = typeKeywordMapper[current.keyword];
|
|
2347
2348
|
if (!value) {
|
|
2348
|
-
return
|
|
2349
|
+
return void 0;
|
|
2349
2350
|
}
|
|
2350
2351
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.union)) {
|
|
2351
2352
|
return typeKeywordMapper.union(
|
|
2352
|
-
current.args.map((schema) => parse({
|
|
2353
|
+
current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2353
2354
|
);
|
|
2354
2355
|
}
|
|
2355
2356
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.and)) {
|
|
2356
|
-
return typeKeywordMapper.and(current.args.map((schema) => parse({
|
|
2357
|
+
return typeKeywordMapper.and(current.args.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean));
|
|
2357
2358
|
}
|
|
2358
2359
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.array)) {
|
|
2359
2360
|
return typeKeywordMapper.array(
|
|
2360
|
-
current.args.items.map((schema) => parse({
|
|
2361
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2361
2362
|
);
|
|
2362
2363
|
}
|
|
2363
2364
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.enum)) {
|
|
@@ -2371,7 +2372,7 @@ function parse({ current, siblings }, options) {
|
|
|
2371
2372
|
}
|
|
2372
2373
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.tuple)) {
|
|
2373
2374
|
return typeKeywordMapper.tuple(
|
|
2374
|
-
current.args.items.map((schema) => parse({
|
|
2375
|
+
current.args.items.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean)
|
|
2375
2376
|
);
|
|
2376
2377
|
}
|
|
2377
2378
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.const)) {
|
|
@@ -2399,7 +2400,7 @@ function parse({ current, siblings }, options) {
|
|
|
2399
2400
|
const minSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.min);
|
|
2400
2401
|
const maxSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.max);
|
|
2401
2402
|
const matchesSchema = schemas.find((schema) => schema.keyword === pluginOas.schemaKeywords.matches);
|
|
2402
|
-
let type = schemas.map((schema) => parse({
|
|
2403
|
+
let type = schemas.map((schema) => parse({ current: schema, siblings: schemas }, options)).filter(Boolean)[0];
|
|
2403
2404
|
if (isNullable) {
|
|
2404
2405
|
type = factory__namespace.createUnionDeclaration({
|
|
2405
2406
|
nodes: [type, factory__namespace.keywordTypeNodes.null]
|
|
@@ -2424,20 +2425,20 @@ function parse({ current, siblings }, options) {
|
|
|
2424
2425
|
return factory__namespace.appendJSDocToNode({
|
|
2425
2426
|
node: propertySignature,
|
|
2426
2427
|
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(", ") :
|
|
2428
|
+
describeSchema ? `@description ${transformers2__default.default.jsStringEscape(describeSchema.args)}` : void 0,
|
|
2429
|
+
deprecatedSchema ? "@deprecated" : void 0,
|
|
2430
|
+
minSchema ? `@minLength ${minSchema.args}` : void 0,
|
|
2431
|
+
maxSchema ? `@maxLength ${maxSchema.args}` : void 0,
|
|
2432
|
+
matchesSchema ? `@pattern ${matchesSchema.args}` : void 0,
|
|
2433
|
+
defaultSchema ? `@default ${defaultSchema.args}` : void 0,
|
|
2434
|
+
exampleSchema ? `@example ${exampleSchema.args}` : void 0,
|
|
2435
|
+
schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") : void 0
|
|
2435
2436
|
].filter(Boolean)
|
|
2436
2437
|
});
|
|
2437
2438
|
});
|
|
2438
2439
|
const additionalProperties = current.args?.additionalProperties?.length ? factory__namespace.createIndexSignature(
|
|
2439
|
-
current.args.additionalProperties.map((schema) => parse({
|
|
2440
|
-
) :
|
|
2440
|
+
current.args.additionalProperties.map((schema) => parse({ current: schema, siblings }, options)).filter(Boolean).at(0)
|
|
2441
|
+
) : void 0;
|
|
2441
2442
|
return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
|
|
2442
2443
|
}
|
|
2443
2444
|
if (pluginOas.isKeyword(current, pluginOas.schemaKeywords.datetime)) {
|
|
@@ -2452,7 +2453,7 @@ function parse({ current, siblings }, options) {
|
|
|
2452
2453
|
if (current.keyword in typeKeywordMapper) {
|
|
2453
2454
|
return value();
|
|
2454
2455
|
}
|
|
2455
|
-
return
|
|
2456
|
+
return void 0;
|
|
2456
2457
|
}
|
|
2457
2458
|
function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntaxType, enumType, mapper, description }) {
|
|
2458
2459
|
const typeNodes = [];
|
|
@@ -2462,17 +2463,10 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2462
2463
|
const schemaFromTree = tree.find((item) => item.keyword === pluginOas.schemaKeywords.schema);
|
|
2463
2464
|
let type = tree.map(
|
|
2464
2465
|
(current, _index, siblings) => parse(
|
|
2465
|
-
{
|
|
2466
|
+
{ current, siblings },
|
|
2466
2467
|
{
|
|
2467
|
-
name,
|
|
2468
|
-
typedName,
|
|
2469
|
-
description,
|
|
2470
|
-
keysToOmit,
|
|
2471
2468
|
optionalType,
|
|
2472
|
-
|
|
2473
|
-
mapper,
|
|
2474
|
-
syntaxType
|
|
2475
|
-
}
|
|
2469
|
+
mapper}
|
|
2476
2470
|
)
|
|
2477
2471
|
).filter(Boolean).at(0) || typeKeywordMapper.undefined();
|
|
2478
2472
|
if (schemaFromTree && pluginOas.isKeyword(schemaFromTree, pluginOas.schemaKeywords.schema) && schemaFromTree.args.type !== "object") {
|
|
@@ -2507,13 +2501,13 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2507
2501
|
}) : type,
|
|
2508
2502
|
syntax: useTypeGeneration ? "type" : "interface",
|
|
2509
2503
|
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}` :
|
|
2504
|
+
description ? `@description ${transformers2__default.default.jsStringEscape(description)}` : void 0,
|
|
2505
|
+
schema.deprecated ? "@deprecated" : void 0,
|
|
2506
|
+
schema.minLength ? `@minLength ${schema.minLength}` : void 0,
|
|
2507
|
+
schema.maxLength ? `@maxLength ${schema.maxLength}` : void 0,
|
|
2508
|
+
schema.pattern ? `@pattern ${schema.pattern}` : void 0,
|
|
2509
|
+
schema.default ? `@default ${schema.default}` : void 0,
|
|
2510
|
+
schema.example ? `@example ${schema.example}` : void 0
|
|
2517
2511
|
]
|
|
2518
2512
|
})
|
|
2519
2513
|
);
|
|
@@ -2524,7 +2518,7 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2524
2518
|
const [nameNode, typeNode] = factory__namespace.createEnumDeclaration({
|
|
2525
2519
|
name: name2,
|
|
2526
2520
|
typeName,
|
|
2527
|
-
enums: enumSchema.args.items.map((item) => item.value ===
|
|
2521
|
+
enums: enumSchema.args.items.map((item) => item.value === void 0 ? void 0 : [transformers2__default.default.trimQuotes(item.name?.toString()), item.value]).filter(Boolean),
|
|
2528
2522
|
type: enumType
|
|
2529
2523
|
});
|
|
2530
2524
|
return {
|
|
@@ -2544,8 +2538,8 @@ function Type2({ name, typedName, tree, keysToOmit, schema, optionalType, syntax
|
|
|
2544
2538
|
{
|
|
2545
2539
|
name: typeName,
|
|
2546
2540
|
isIndexable: true,
|
|
2547
|
-
isExportable: ["enum", "asConst", "constEnum", "literal",
|
|
2548
|
-
isTypeOnly: ["asConst", "constEnum", "literal",
|
|
2541
|
+
isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2542
|
+
isTypeOnly: ["asConst", "constEnum", "literal", void 0].includes(enumType),
|
|
2549
2543
|
children: parserTs.print([typeNode])
|
|
2550
2544
|
}
|
|
2551
2545
|
)
|
|
@@ -2582,5 +2576,5 @@ react/cjs/react.development.js:
|
|
|
2582
2576
|
exports.OasType = OasType;
|
|
2583
2577
|
exports.Type = Type2;
|
|
2584
2578
|
exports.init_cjs_shims = init_cjs_shims;
|
|
2585
|
-
//# sourceMappingURL=chunk-
|
|
2586
|
-
//# sourceMappingURL=chunk-
|
|
2579
|
+
//# sourceMappingURL=chunk-ISG4ADLH.cjs.map
|
|
2580
|
+
//# sourceMappingURL=chunk-ISG4ADLH.cjs.map
|