@kubb/plugin-zod 3.0.0-alpha.7 → 3.0.0-alpha.8
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-VSAW3SUC.js → chunk-CD3EZWBX.js} +12 -12
- package/dist/chunk-CD3EZWBX.js.map +1 -0
- package/dist/{chunk-PXJ5ZGKW.cjs → chunk-TSJ74266.cjs} +12 -12
- package/dist/chunk-TSJ74266.cjs.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +1 -1
- package/package.json +12 -12
- package/src/components/Operations.tsx +2 -2
- package/src/components/Schema.tsx +3 -3
- package/dist/chunk-PXJ5ZGKW.cjs.map +0 -1
- package/dist/chunk-VSAW3SUC.js.map +0 -1
|
@@ -2225,9 +2225,9 @@ var _hooks = require('@kubb/plugin-oas/hooks');
|
|
|
2225
2225
|
var _jsxruntime = require('@kubb/react/jsx-runtime');
|
|
2226
2226
|
function Template({ name, typeName, api }) {
|
|
2227
2227
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2228
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const` }),
|
|
2228
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const` }),
|
|
2229
2229
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
2230
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName, isExportable: true, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` }) })
|
|
2230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { name: typeName, export: true, children: `Infer<typeof ${name}>` }) })
|
|
2231
2231
|
] });
|
|
2232
2232
|
}
|
|
2233
2233
|
var defaultTemplates = { default: Template };
|
|
@@ -2565,10 +2565,10 @@ function Schema(props) {
|
|
|
2565
2565
|
);
|
|
2566
2566
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, import_react3.Fragment, { children: [
|
|
2567
2567
|
enums.map(({ name: name2, nameNode, typeName: typeName2, typeNode }, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, import_react3.Fragment, { children: [
|
|
2568
|
-
nameNode && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: name2, isExportable: true, children: _parserts.print.call(void 0, nameNode) }),
|
|
2569
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName2, isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType), isTypeOnly: true, children: _parserts.print.call(void 0, typeNode) })
|
|
2568
|
+
nameNode && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: name2, isExportable: true, isIndexable: true, children: _parserts.print.call(void 0, nameNode) }),
|
|
2569
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName2, isIndexable: true, isExportable: ["enum", "asConst", "constEnum", "literal", void 0].includes(enumType), isTypeOnly: true, children: _parserts.print.call(void 0, typeNode) })
|
|
2570
2570
|
] }, [name2, nameNode].join("-"))),
|
|
2571
|
-
enums.every((item) => item.typeName !== resolvedName) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName, isTypeOnly: true, isExportable: true, children: _parserts.print.call(void 0, typeNodes) })
|
|
2571
|
+
enums.every((item) => item.typeName !== resolvedName) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName, isTypeOnly: true, isExportable: true, isIndexable: true, children: _parserts.print.call(void 0, typeNodes) })
|
|
2572
2572
|
] });
|
|
2573
2573
|
}
|
|
2574
2574
|
Schema.File = function({}) {
|
|
@@ -2701,7 +2701,7 @@ OperationSchema.File = function({}) {
|
|
|
2701
2701
|
const combinedSchemaName = operation.method === "get" ? `${factoryName}Query` : `${factoryName}Mutation`;
|
|
2702
2702
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
|
|
2703
2703
|
items.map(mapItem),
|
|
2704
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: combinedSchemaName, isExportable: true, isTypeOnly: true, children: printCombinedSchema({ name: combinedSchemaName, operation, schemas, pluginManager }) })
|
|
2704
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: combinedSchemaName, isExportable: true, isIndexable: true, isTypeOnly: true, children: printCombinedSchema({ name: combinedSchemaName, operation, schemas, pluginManager }) })
|
|
2705
2705
|
] });
|
|
2706
2706
|
};
|
|
2707
2707
|
|
|
@@ -3137,8 +3137,8 @@ function Template2({ operationsName, pathsName, operations }) {
|
|
|
3137
3137
|
{}
|
|
3138
3138
|
);
|
|
3139
3139
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: operationsName, isExportable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Const, { export: true, name: operationsName, asConst: true, children: `{${_transformers2.default.stringifyObject(operationsJSON)}}` }) }),
|
|
3141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: pathsName, isExportable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Const, { export: true, name: pathsName, asConst: true, children: `{${_transformers2.default.stringifyObject(pathsJSON)}}` }) })
|
|
3140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: operationsName, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Const, { export: true, name: operationsName, asConst: true, children: `{${_transformers2.default.stringifyObject(operationsJSON)}}` }) }),
|
|
3141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: pathsName, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Const, { export: true, name: pathsName, asConst: true, children: `{${_transformers2.default.stringifyObject(pathsJSON)}}` }) })
|
|
3142
3142
|
] });
|
|
3143
3143
|
}
|
|
3144
3144
|
function RootTemplate({ children }) {
|
|
@@ -3377,7 +3377,7 @@ function Schema2(props) {
|
|
|
3377
3377
|
type: "type"
|
|
3378
3378
|
});
|
|
3379
3379
|
if (!tree.length) {
|
|
3380
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedName, isExportable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3380
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedName, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3381
3381
|
_react.Const,
|
|
3382
3382
|
{
|
|
3383
3383
|
name: resolvedName,
|
|
@@ -3398,7 +3398,7 @@ function Schema2(props) {
|
|
|
3398
3398
|
}).map((item) => parse2(void 0, item, { name, typeName, description, mapper, coercion, keysToOmit })).filter(Boolean).join("");
|
|
3399
3399
|
const suffix = output.endsWith(".nullable()") ? ".unwrap().and" : ".and";
|
|
3400
3400
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3401
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedName, isExportable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedName, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3402
3402
|
_react.Const,
|
|
3403
3403
|
{
|
|
3404
3404
|
export: true,
|
|
@@ -3413,7 +3413,7 @@ function Schema2(props) {
|
|
|
3413
3413
|
].filter(Boolean).join("") || ""
|
|
3414
3414
|
}
|
|
3415
3415
|
) }),
|
|
3416
|
-
typedSchema && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedTypeName, isExportable: true, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { export: true, name: resolvedTypeName, children: `z.infer<typeof ${resolvedName}>` }) })
|
|
3416
|
+
typedSchema && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: resolvedTypeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { export: true, name: resolvedTypeName, children: `z.infer<typeof ${resolvedName}>` }) })
|
|
3417
3417
|
] });
|
|
3418
3418
|
}
|
|
3419
3419
|
Schema2.File = function({}) {
|
|
@@ -3492,4 +3492,4 @@ react/cjs/react.development.js:
|
|
|
3492
3492
|
* LICENSE file in the root directory of this source tree.
|
|
3493
3493
|
*)
|
|
3494
3494
|
*/
|
|
3495
|
-
//# sourceMappingURL=chunk-
|
|
3495
|
+
//# sourceMappingURL=chunk-TSJ74266.cjs.map
|