@kubb/plugin-zod 4.20.2 → 4.20.5

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.
Files changed (73) hide show
  1. package/dist/components.d.cts +2 -1
  2. package/dist/components.d.ts +2 -1
  3. package/dist/{generators-DWTQMdiR.js → generators-BawvbIJ1.js} +13 -7
  4. package/dist/generators-BawvbIJ1.js.map +1 -0
  5. package/dist/{generators-YkwNz13t.cjs → generators-DGBZd16i.cjs} +13 -7
  6. package/dist/generators-DGBZd16i.cjs.map +1 -0
  7. package/dist/generators.cjs +1 -1
  8. package/dist/generators.d.cts +1 -1
  9. package/dist/generators.d.ts +1 -1
  10. package/dist/generators.js +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.d.cts +3 -2
  13. package/dist/index.d.ts +3 -2
  14. package/dist/index.js +1 -1
  15. package/dist/types-23ND42NW.d.cts +696 -0
  16. package/dist/types-CyZ4p-xC.d.ts +695 -0
  17. package/package.json +10 -6
  18. package/src/generators/__snapshots__/anyof.ts +1 -1
  19. package/src/generators/__snapshots__/coercion.ts +1 -1
  20. package/src/generators/__snapshots__/coercionDates.ts +1 -1
  21. package/src/generators/__snapshots__/coercionNumbers.ts +1 -1
  22. package/src/generators/__snapshots__/coercionStrings.ts +1 -1
  23. package/src/generators/__snapshots__/createItemUnionWithReadOnly.ts +1 -1
  24. package/src/generators/__snapshots__/createPet.ts +1 -1
  25. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +1 -1
  26. package/src/generators/__snapshots__/deletePet.ts +1 -1
  27. package/src/generators/__snapshots__/discriminator.ts +1 -1
  28. package/src/generators/__snapshots__/enumBooleanLiteral.ts +1 -1
  29. package/src/generators/__snapshots__/enumNamesType.ts +1 -1
  30. package/src/generators/__snapshots__/enumNullable.ts +1 -1
  31. package/src/generators/__snapshots__/enumSingleLiteral.ts +1 -1
  32. package/src/generators/__snapshots__/enumVarNamesType.ts +1 -1
  33. package/src/generators/__snapshots__/example.ts +1 -1
  34. package/src/generators/__snapshots__/exclusiveNumbers.ts +1 -1
  35. package/src/generators/__snapshots__/getPets.ts +1 -1
  36. package/src/generators/__snapshots__/getPetsWithQueryFilter_wrapOutput_all_.ts +1 -1
  37. package/src/generators/__snapshots__/imageNullable.ts +1 -1
  38. package/src/generators/__snapshots__/mixedValueTypeConst.ts +1 -1
  39. package/src/generators/__snapshots__/nullable.ts +1 -1
  40. package/src/generators/__snapshots__/nullableString.ts +1 -1
  41. package/src/generators/__snapshots__/nullableStringUuid.ts +1 -1
  42. package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +1 -1
  43. package/src/generators/__snapshots__/numberValueConst.ts +1 -1
  44. package/src/generators/__snapshots__/oneof.ts +1 -1
  45. package/src/generators/__snapshots__/operations.ts +1 -1
  46. package/src/generators/__snapshots__/optionalPetInfer.ts +1 -1
  47. package/src/generators/__snapshots__/optionalPetTyped.ts +1 -1
  48. package/src/generators/__snapshots__/order.ts +1 -1
  49. package/src/generators/__snapshots__/orderDateTyeString.ts +1 -1
  50. package/src/generators/__snapshots__/orderDateTypeFalse.ts +1 -1
  51. package/src/generators/__snapshots__/orderDateTypeString.ts +1 -1
  52. package/src/generators/__snapshots__/pet.ts +1 -1
  53. package/src/generators/__snapshots__/petArray.ts +1 -1
  54. package/src/generators/__snapshots__/petCoercion.ts +1 -1
  55. package/src/generators/__snapshots__/petTupleObject.ts +1 -1
  56. package/src/generators/__snapshots__/petV4.ts +1 -1
  57. package/src/generators/__snapshots__/petWithMapper.ts +1 -1
  58. package/src/generators/__snapshots__/pets.ts +1 -1
  59. package/src/generators/__snapshots__/queryAllDefaulted.ts +1 -1
  60. package/src/generators/__snapshots__/recursive.ts +1 -1
  61. package/src/generators/__snapshots__/showPetById.ts +1 -1
  62. package/src/generators/__snapshots__/stringValueConst.ts +1 -1
  63. package/src/generators/__snapshots__/toy.ts +1 -1
  64. package/src/generators/__snapshots__/unionWithReadOnly.ts +1 -1
  65. package/src/generators/__snapshots__/updateItemUnionWithReadOnly.ts +1 -1
  66. package/src/generators/__snapshots__/uuidSchema.ts +1 -1
  67. package/src/generators/operationsGenerator.tsx +3 -1
  68. package/src/generators/zodGenerator.tsx +6 -2
  69. package/templates/ToZod.ts +1 -1
  70. package/dist/generators-DWTQMdiR.js.map +0 -1
  71. package/dist/generators-YkwNz13t.cjs.map +0 -1
  72. package/dist/types-BBLRijaO.d.ts +0 -1354
  73. package/dist/types-HQfz08mH.d.cts +0 -1355
@@ -1,4 +1,5 @@
1
- import { c as __name, i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-HQfz08mH.cjs";
1
+ import { a as Operation, i as Schema, n as PluginZod, o as SchemaObject, s as __name } from "./types-23ND42NW.cjs";
2
+ import { FileMetaBase, Plugin, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
2
3
  import { KubbFile } from "@kubb/fabric-core/types";
3
4
  import { FabricReactNode } from "@kubb/react-fabric/types";
4
5
 
@@ -1,5 +1,6 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-BBLRijaO.js";
2
+ import { a as Operation, i as Schema, n as PluginZod, o as SchemaObject } from "./types-CyZ4p-xC.js";
3
+ import { FileMetaBase, Plugin, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
3
4
  import { KubbFile } from "@kubb/fabric-core/types";
4
5
  import { FabricReactNode } from "@kubb/react-fabric/types";
5
6
 
@@ -40,6 +40,7 @@ const operationsGenerator = createReactGenerator({
40
40
  path: getFile(operation).path
41
41
  }, key);
42
42
  }).filter(Boolean);
43
+ const isZodImport = importPath === "zod" || importPath === "zod/mini";
43
44
  return /* @__PURE__ */ jsxs(File, {
44
45
  baseName: file.baseName,
45
46
  path: file.path,
@@ -56,8 +57,9 @@ const operationsGenerator = createReactGenerator({
56
57
  children: [
57
58
  /* @__PURE__ */ jsx(File.Import, {
58
59
  isTypeOnly: true,
59
- name: ["z"],
60
- path: importPath
60
+ name: isZodImport ? "z" : ["z"],
61
+ path: importPath,
62
+ isNameSpace: isZodImport
61
63
  }),
62
64
  imports,
63
65
  /* @__PURE__ */ jsx(Operations, {
@@ -178,6 +180,7 @@ const zodGenerator = createReactGenerator({
178
180
  })
179
181
  ] });
180
182
  };
183
+ const isZodImport = plugin.options.importPath === "zod" || plugin.options.importPath === "zod/mini";
181
184
  return /* @__PURE__ */ jsxs(File, {
182
185
  baseName: file.baseName,
183
186
  path: file.path,
@@ -192,8 +195,9 @@ const zodGenerator = createReactGenerator({
192
195
  output: plugin.options.output
193
196
  }),
194
197
  children: [/* @__PURE__ */ jsx(File.Import, {
195
- name: ["z"],
196
- path: plugin.options.importPath
198
+ name: isZodImport ? "z" : ["z"],
199
+ path: plugin.options.importPath,
200
+ isNameSpace: isZodImport
197
201
  }), operationSchemas.map(mapOperationSchema)]
198
202
  });
199
203
  },
@@ -215,6 +219,7 @@ const zodGenerator = createReactGenerator({
215
219
  }),
216
220
  file: getFile(schema.name, { pluginKey: [pluginTsName] })
217
221
  };
222
+ const isZodImport = importPath === "zod" || importPath === "zod/mini";
218
223
  return /* @__PURE__ */ jsxs(File, {
219
224
  baseName: zod.file.baseName,
220
225
  path: zod.file.path,
@@ -230,8 +235,9 @@ const zodGenerator = createReactGenerator({
230
235
  }),
231
236
  children: [
232
237
  /* @__PURE__ */ jsx(File.Import, {
233
- name: ["z"],
234
- path: importPath
238
+ name: isZodImport ? "z" : ["z"],
239
+ path: importPath,
240
+ isNameSpace: isZodImport
235
241
  }),
236
242
  typed && /* @__PURE__ */ jsx(File.Import, {
237
243
  isTypeOnly: true,
@@ -274,4 +280,4 @@ const zodGenerator = createReactGenerator({
274
280
 
275
281
  //#endregion
276
282
  export { operationsGenerator as n, zodGenerator as t };
277
- //# sourceMappingURL=generators-DWTQMdiR.js.map
283
+ //# sourceMappingURL=generators-BawvbIJ1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-BawvbIJ1.js","names":["options"],"sources":["../src/generators/operationsGenerator.tsx","../src/generators/zodGenerator.tsx"],"sourcesContent":["import { usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations.tsx'\nimport type { PluginZod } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginZod>({\n name: 'operations',\n Operations({ operations, generator, plugin }) {\n const {\n key: pluginKey,\n options: { output, importPath },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getFile, groupSchemasByName } = useOperationManager(generator)\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const imports = Object.entries(transformedOperations)\n .map(([key, { data, operation }]) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={key} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import isTypeOnly name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n {imports}\n <Operations name={name} operations={transformedOperations} />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { useMode, usePluginManager } from '@kubb/core/hooks'\nimport { type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter, getImports } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/react-fabric'\nimport { Zod } from '../components'\nimport type { PluginZod } from '../types'\n\nexport const zodGenerator = createReactGenerator<PluginZod>({\n name: 'zod',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { coercion: globalCoercion, inferred, typed, mapper, wrapOutput, version, mini },\n } = plugin\n\n const mode = useMode()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getFile, getGroup } = useOperationManager(generator)\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const schemaGenerator = new SchemaGenerator(options, {\n fabric: generator.context.fabric,\n oas,\n plugin,\n pluginManager,\n events: generator.context.events,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema: schemaOriginal, description, keysToOmit: keysToOmitOriginal, ...options }: OperationSchemaType) => {\n let schemaObject = schemaOriginal\n let keysToOmit = keysToOmitOriginal\n\n if ((schemaOriginal.anyOf || schemaOriginal.oneOf) && keysToOmitOriginal && keysToOmitOriginal.length > 0) {\n schemaObject = structuredClone(schemaOriginal)\n\n // Remove $ref so the schema parser generates inline schema instead of a reference\n delete schemaObject.$ref\n\n for (const key of keysToOmitOriginal) {\n delete schemaObject.properties?.[key]\n }\n\n if (Array.isArray(schemaObject.required)) {\n schemaObject.required = schemaObject.required.filter((key) => !keysToOmitOriginal.includes(key))\n }\n\n keysToOmit = undefined\n }\n\n const hasProperties = Object.keys(schemaObject || {}).length > 0\n const hasDefaults = Object.values(schemaObject.properties || {}).some((prop) => prop && Object.hasOwn(prop, 'default'))\n\n const required = Array.isArray(schemaObject?.required) ? schemaObject.required.length > 0 : !!schemaObject?.required\n const optional = !required && !hasDefaults && hasProperties && name.includes('Params')\n\n if (!optional && Array.isArray(schemaObject.required) && !schemaObject.required.length) {\n schemaObject.required = Object.entries(schemaObject.properties || {})\n .filter(([_key, value]) => value && Object.hasOwn(value, 'default'))\n .map(([key]) => key)\n }\n\n const tree = [\n ...schemaGenerator.parse({ schema: schemaObject, name, parentName: null }),\n optional ? { keyword: schemaKeywords.optional } : undefined,\n ].filter(Boolean)\n const imports = getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const coercion = name.includes('Params') ? { numbers: true, strings: false, dates: true } : globalCoercion\n\n const zod = {\n name: schemaManager.getName(name, { type: 'function' }),\n inferTypeName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(name),\n }\n\n const type = {\n name: schemaManager.getName(name, {\n type: 'type',\n pluginKey: [pluginTsName],\n }),\n file: schemaManager.getFile(options.operationName || name, {\n pluginKey: [pluginTsName],\n group,\n }),\n }\n\n return (\n <>\n {typed && <File.Import isTypeOnly root={file.path} path={type.file.path} name={[type.name]} />}\n {typed && version === '3' && <File.Import name={['ToZod']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/ToZod.ts')} />}\n {imports.map((imp) => (\n <File.Import key={[imp.path, imp.name, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} />\n ))}\n <Zod\n name={zod.name}\n typeName={typed ? type.name : undefined}\n inferTypeName={inferred ? zod.inferTypeName : undefined}\n description={description}\n tree={tree}\n schema={schemaObject}\n mapper={mapper}\n coercion={coercion}\n keysToOmit={keysToOmit}\n wrapOutput={wrapOutput}\n version={plugin.options.version}\n emptySchemaType={plugin.options.emptySchemaType}\n mini={mini}\n />\n </>\n )\n }\n\n const isZodImport = plugin.options.importPath === 'zod' || plugin.options.importPath === 'zod/mini'\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n <File.Import name={isZodImport ? 'z' : ['z']} path={plugin.options.importPath} isNameSpace={isZodImport} />\n {operationSchemas.map(mapOperationSchema)}\n </File>\n )\n },\n Schema({ config, schema, plugin }) {\n const { getName, getFile } = useSchemaManager()\n const {\n options: { output, emptySchemaType, coercion, inferred, typed, mapper, importPath, wrapOutput, version, mini },\n } = plugin\n const pluginManager = usePluginManager()\n const oas = useOas()\n\n const imports = getImports(schema.tree)\n\n const zod = {\n name: getName(schema.name, { type: 'function' }),\n inferTypeName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n const type = {\n name: getName(schema.name, { type: 'type', pluginKey: [pluginTsName] }),\n file: getFile(schema.name, { pluginKey: [pluginTsName] }),\n }\n\n const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n\n return (\n <File\n baseName={zod.file.baseName}\n path={zod.file.path}\n meta={zod.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n {typed && <File.Import isTypeOnly root={zod.file.path} path={type.file.path} name={[type.name]} />}\n {typed && version === '3' && (\n <File.Import name={['ToZod']} root={zod.file.path} path={path.resolve(config.root, config.output.path, '.kubb/ToZod.ts')} />\n )}\n {imports.map((imp) => (\n <File.Import key={[imp.path, imp.name, imp.isTypeOnly].join('-')} root={zod.file.path} path={imp.path} name={imp.name} />\n ))}\n\n <Zod\n name={zod.name}\n typeName={typed ? type.name : undefined}\n inferTypeName={inferred ? zod.inferTypeName : undefined}\n description={schema.value.description}\n tree={schema.tree}\n schema={schema.value}\n mapper={mapper}\n coercion={coercion}\n wrapOutput={wrapOutput}\n version={version}\n emptySchemaType={emptySchemaType}\n mini={mini}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAa,sBAAsB,qBAAgC;CACjE,MAAM;CACN,WAAW,EAAE,YAAY,WAAW,UAAU;EAC5C,MAAM,EACJ,KAAK,WACL,SAAS,EAAE,QAAQ,iBACjB;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,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AAE,WAAW,CAAC,aAAa,EAAE,CAAC;GAC1D;EAED,MAAM,cAAc,eAAe,SAAS,eAAe;AAE3D,SACE,qBAAC;GACC,UAAU,IAAI,KAAK;GACnB,MAAM,IAAI,KAAK;GACf,MAAM,IAAI,KAAK;GACf,QAAQ,UAAU;IAAE;IAAK;IAAQ,QAAQ,cAAc;IAAQ,CAAC;GAChE,QAAQ,UAAU;IAAE;IAAK;IAAQ,CAAC;;IAElC,oBAAC,KAAK;KAAO,MAAM,cAAc,MAAM,CAAC,IAAI;KAAE,MAAM;KAAY,aAAa;MAAe;IAC3F,SAAS,oBAAC,KAAK;KAAO;KAAW,MAAM,IAAI,KAAK;KAAM,MAAM,KAAK,KAAK;KAAM,MAAM,CAAC,KAAK,KAAK;MAAI;IACjG,SAAS,YAAY,OACpB,oBAAC,KAAK;KAAO,MAAM,CAAC,QAAQ;KAAE,MAAM,IAAI,KAAK;KAAM,MAAM,KAAK,QAAQ,OAAO,MAAM,OAAO,OAAO,MAAM,iBAAiB;MAAI;IAE7H,QAAQ,KAAK,QACZ,oBAAC,KAAK;KAA4D,MAAM,IAAI,KAAK;KAAM,MAAM,IAAI;KAAM,MAAM,IAAI;OAA/F;KAAC,IAAI;KAAM,IAAI;KAAM,IAAI;KAAW,CAAC,KAAK,IAAI,CAAyD,CACzH;IAEF,oBAAC;KACC,MAAM,IAAI;KACV,UAAU,QAAQ,KAAK,OAAO;KAC9B,eAAe,WAAW,IAAI,gBAAgB;KAC9C,aAAa,OAAO,MAAM;KAC1B,MAAM,OAAO;KACb,QAAQ,OAAO;KACP;KACE;KACE;KACH;KACQ;KACX;MACN;;IACG;;CAGZ,CAAC"}
@@ -40,6 +40,7 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
40
40
  path: getFile(operation).path
41
41
  }, key);
42
42
  }).filter(Boolean);
43
+ const isZodImport = importPath === "zod" || importPath === "zod/mini";
43
44
  return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
44
45
  baseName: file.baseName,
45
46
  path: file.path,
@@ -56,8 +57,9 @@ const operationsGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator
56
57
  children: [
57
58
  /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
58
59
  isTypeOnly: true,
59
- name: ["z"],
60
- path: importPath
60
+ name: isZodImport ? "z" : ["z"],
61
+ path: importPath,
62
+ isNameSpace: isZodImport
61
63
  }),
62
64
  imports,
63
65
  /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.Operations, {
@@ -178,6 +180,7 @@ const zodGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
178
180
  })
179
181
  ] });
180
182
  };
183
+ const isZodImport = plugin.options.importPath === "zod" || plugin.options.importPath === "zod/mini";
181
184
  return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
182
185
  baseName: file.baseName,
183
186
  path: file.path,
@@ -192,8 +195,9 @@ const zodGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
192
195
  output: plugin.options.output
193
196
  }),
194
197
  children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
195
- name: ["z"],
196
- path: plugin.options.importPath
198
+ name: isZodImport ? "z" : ["z"],
199
+ path: plugin.options.importPath,
200
+ isNameSpace: isZodImport
197
201
  }), operationSchemas.map(mapOperationSchema)]
198
202
  });
199
203
  },
@@ -215,6 +219,7 @@ const zodGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
215
219
  }),
216
220
  file: getFile(schema.name, { pluginKey: [_kubb_plugin_ts.pluginTsName] })
217
221
  };
222
+ const isZodImport = importPath === "zod" || importPath === "zod/mini";
218
223
  return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
219
224
  baseName: zod.file.baseName,
220
225
  path: zod.file.path,
@@ -230,8 +235,9 @@ const zodGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
230
235
  }),
231
236
  children: [
232
237
  /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
233
- name: ["z"],
234
- path: importPath
238
+ name: isZodImport ? "z" : ["z"],
239
+ path: importPath,
240
+ isNameSpace: isZodImport
235
241
  }),
236
242
  typed && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
237
243
  isTypeOnly: true,
@@ -285,4 +291,4 @@ Object.defineProperty(exports, 'zodGenerator', {
285
291
  return zodGenerator;
286
292
  }
287
293
  });
288
- //# sourceMappingURL=generators-YkwNz13t.cjs.map
294
+ //# sourceMappingURL=generators-DGBZd16i.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-DGBZd16i.cjs","names":["File","Operations","SchemaGenerator","options","schemaKeywords","pluginTsName","File","path","Zod"],"sources":["../src/generators/operationsGenerator.tsx","../src/generators/zodGenerator.tsx"],"sourcesContent":["import { usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations.tsx'\nimport type { PluginZod } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginZod>({\n name: 'operations',\n Operations({ operations, generator, plugin }) {\n const {\n key: pluginKey,\n options: { output, importPath },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getFile, groupSchemasByName } = useOperationManager(generator)\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n const transformedOperations = operations.map((operation) => ({ operation, data: groupSchemasByName(operation, { type: 'function' }) }))\n\n const imports = Object.entries(transformedOperations)\n .map(([key, { data, operation }]) => {\n const names = [data.request, ...Object.values(data.responses), ...Object.values(data.parameters)].filter(Boolean)\n\n return <File.Import key={key} name={names} root={file.path} path={getFile(operation).path} />\n })\n .filter(Boolean)\n\n const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import isTypeOnly name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n {imports}\n <Operations name={name} operations={transformedOperations} />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { useMode, usePluginManager } from '@kubb/core/hooks'\nimport { type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter, getImports } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/react-fabric'\nimport { Zod } from '../components'\nimport type { PluginZod } from '../types'\n\nexport const zodGenerator = createReactGenerator<PluginZod>({\n name: 'zod',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { coercion: globalCoercion, inferred, typed, mapper, wrapOutput, version, mini },\n } = plugin\n\n const mode = useMode()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getFile, getGroup } = useOperationManager(generator)\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const schemaGenerator = new SchemaGenerator(options, {\n fabric: generator.context.fabric,\n oas,\n plugin,\n pluginManager,\n events: generator.context.events,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema: schemaOriginal, description, keysToOmit: keysToOmitOriginal, ...options }: OperationSchemaType) => {\n let schemaObject = schemaOriginal\n let keysToOmit = keysToOmitOriginal\n\n if ((schemaOriginal.anyOf || schemaOriginal.oneOf) && keysToOmitOriginal && keysToOmitOriginal.length > 0) {\n schemaObject = structuredClone(schemaOriginal)\n\n // Remove $ref so the schema parser generates inline schema instead of a reference\n delete schemaObject.$ref\n\n for (const key of keysToOmitOriginal) {\n delete schemaObject.properties?.[key]\n }\n\n if (Array.isArray(schemaObject.required)) {\n schemaObject.required = schemaObject.required.filter((key) => !keysToOmitOriginal.includes(key))\n }\n\n keysToOmit = undefined\n }\n\n const hasProperties = Object.keys(schemaObject || {}).length > 0\n const hasDefaults = Object.values(schemaObject.properties || {}).some((prop) => prop && Object.hasOwn(prop, 'default'))\n\n const required = Array.isArray(schemaObject?.required) ? schemaObject.required.length > 0 : !!schemaObject?.required\n const optional = !required && !hasDefaults && hasProperties && name.includes('Params')\n\n if (!optional && Array.isArray(schemaObject.required) && !schemaObject.required.length) {\n schemaObject.required = Object.entries(schemaObject.properties || {})\n .filter(([_key, value]) => value && Object.hasOwn(value, 'default'))\n .map(([key]) => key)\n }\n\n const tree = [\n ...schemaGenerator.parse({ schema: schemaObject, name, parentName: null }),\n optional ? { keyword: schemaKeywords.optional } : undefined,\n ].filter(Boolean)\n const imports = getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const coercion = name.includes('Params') ? { numbers: true, strings: false, dates: true } : globalCoercion\n\n const zod = {\n name: schemaManager.getName(name, { type: 'function' }),\n inferTypeName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(name),\n }\n\n const type = {\n name: schemaManager.getName(name, {\n type: 'type',\n pluginKey: [pluginTsName],\n }),\n file: schemaManager.getFile(options.operationName || name, {\n pluginKey: [pluginTsName],\n group,\n }),\n }\n\n return (\n <>\n {typed && <File.Import isTypeOnly root={file.path} path={type.file.path} name={[type.name]} />}\n {typed && version === '3' && <File.Import name={['ToZod']} root={file.path} path={path.resolve(config.root, config.output.path, '.kubb/ToZod.ts')} />}\n {imports.map((imp) => (\n <File.Import key={[imp.path, imp.name, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} />\n ))}\n <Zod\n name={zod.name}\n typeName={typed ? type.name : undefined}\n inferTypeName={inferred ? zod.inferTypeName : undefined}\n description={description}\n tree={tree}\n schema={schemaObject}\n mapper={mapper}\n coercion={coercion}\n keysToOmit={keysToOmit}\n wrapOutput={wrapOutput}\n version={plugin.options.version}\n emptySchemaType={plugin.options.emptySchemaType}\n mini={mini}\n />\n </>\n )\n }\n\n const isZodImport = plugin.options.importPath === 'zod' || plugin.options.importPath === 'zod/mini'\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n <File.Import name={isZodImport ? 'z' : ['z']} path={plugin.options.importPath} isNameSpace={isZodImport} />\n {operationSchemas.map(mapOperationSchema)}\n </File>\n )\n },\n Schema({ config, schema, plugin }) {\n const { getName, getFile } = useSchemaManager()\n const {\n options: { output, emptySchemaType, coercion, inferred, typed, mapper, importPath, wrapOutput, version, mini },\n } = plugin\n const pluginManager = usePluginManager()\n const oas = useOas()\n\n const imports = getImports(schema.tree)\n\n const zod = {\n name: getName(schema.name, { type: 'function' }),\n inferTypeName: getName(schema.name, { type: 'type' }),\n file: getFile(schema.name),\n }\n\n const type = {\n name: getName(schema.name, { type: 'type', pluginKey: [pluginTsName] }),\n file: getFile(schema.name, { pluginKey: [pluginTsName] }),\n }\n\n const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n\n return (\n <File\n baseName={zod.file.baseName}\n path={zod.file.path}\n meta={zod.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n {typed && <File.Import isTypeOnly root={zod.file.path} path={type.file.path} name={[type.name]} />}\n {typed && version === '3' && (\n <File.Import name={['ToZod']} root={zod.file.path} path={path.resolve(config.root, config.output.path, '.kubb/ToZod.ts')} />\n )}\n {imports.map((imp) => (\n <File.Import key={[imp.path, imp.name, imp.isTypeOnly].join('-')} root={zod.file.path} path={imp.path} name={imp.name} />\n ))}\n\n <Zod\n name={zod.name}\n typeName={typed ? type.name : undefined}\n inferTypeName={inferred ? zod.inferTypeName : undefined}\n description={schema.value.description}\n tree={schema.tree}\n schema={schema.value}\n mapper={mapper}\n coercion={coercion}\n wrapOutput={wrapOutput}\n version={version}\n emptySchemaType={emptySchemaType}\n mini={mini}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAa,4EAAsD;CACjE,MAAM;CACN,WAAW,EAAE,YAAY,WAAW,UAAU;EAC5C,MAAM,EACJ,KAAK,WACL,SAAS,EAAE,QAAQ,iBACjB;EACJ,MAAM,wDAAkC;EAExC,MAAM,0CAAc;EACpB,MAAM,EAAE,SAAS,uEAA2C,UAAU;EAEtE,MAAM,OAAO;EACb,MAAM,OAAO,cAAc,QAAQ;GAAE;GAAM,SAAS;GAAO;GAAW,CAAC;EAEvE,MAAM,wBAAwB,WAAW,KAAK,eAAe;GAAE;GAAW,MAAM,mBAAmB,WAAW,EAAE,MAAM,YAAY,CAAC;GAAE,EAAE;EAEvI,MAAM,UAAU,OAAO,QAAQ,sBAAsB,CAClD,KAAK,CAAC,KAAK,EAAE,MAAM,iBAAiB;GACnC,MAAM,QAAQ;IAAC,KAAK;IAAS,GAAG,OAAO,OAAO,KAAK,UAAU;IAAE,GAAG,OAAO,OAAO,KAAK,WAAW;IAAC,CAAC,OAAO,QAAQ;AAEjH,UAAO,wDAACA,wBAAK;IAAiB,MAAM;IAAO,MAAM,KAAK;IAAM,MAAM,QAAQ,UAAU,CAAC;MAA5D,IAAoE;IAC7F,CACD,OAAO,QAAQ;EAElB,MAAM,cAAc,eAAe,SAAS,eAAe;AAE3D,SACE,yDAAC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;KAAM,MAAM,IAAI;OAA/F;KAAC,IAAI;KAAM,IAAI;KAAM,IAAI;KAAW,CAAC,KAAK,IAAI,CAAyD,CACzH;IAEF,wDAACE;KACC,MAAM,IAAI;KACV,UAAU,QAAQ,KAAK,OAAO;KAC9B,eAAe,WAAW,IAAI,gBAAgB;KAC9C,aAAa,OAAO,MAAM;KAC1B,MAAM,OAAO;KACb,QAAQ,OAAO;KACP;KACE;KACE;KACH;KACQ;KACX;MACN;;IACG;;CAGZ,CAAC"}
@@ -1,4 +1,4 @@
1
- const require_generators = require('./generators-YkwNz13t.cjs');
1
+ const require_generators = require('./generators-DGBZd16i.cjs');
2
2
 
3
3
  exports.operationsGenerator = require_generators.operationsGenerator;
4
4
  exports.zodGenerator = require_generators.zodGenerator;
@@ -1,4 +1,4 @@
1
- import { c as __name, n as PluginZod, r as ReactGenerator } from "./types-HQfz08mH.cjs";
1
+ import { n as PluginZod, r as ReactGenerator, s as __name } from "./types-23ND42NW.cjs";
2
2
 
3
3
  //#region src/generators/operationsGenerator.d.ts
4
4
  declare const operationsGenerator: ReactGenerator<PluginZod>;
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { n as PluginZod, r as ReactGenerator } from "./types-BBLRijaO.js";
2
+ import { n as PluginZod, r as ReactGenerator } from "./types-CyZ4p-xC.js";
3
3
 
4
4
  //#region src/generators/operationsGenerator.d.ts
5
5
  declare const operationsGenerator: ReactGenerator<PluginZod>;
@@ -1,3 +1,3 @@
1
- import { n as operationsGenerator, t as zodGenerator } from "./generators-DWTQMdiR.js";
1
+ import { n as operationsGenerator, t as zodGenerator } from "./generators-BawvbIJ1.js";
2
2
 
3
3
  export { operationsGenerator, zodGenerator };
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_components = require('./components-Cs1U51T4.cjs');
2
- const require_generators = require('./generators-YkwNz13t.cjs');
2
+ const require_generators = require('./generators-DGBZd16i.cjs');
3
3
  let node_path = require("node:path");
4
4
  node_path = require_components.__toESM(node_path);
5
5
  let _kubb_core = require("@kubb/core");
package/dist/index.d.cts CHANGED
@@ -1,8 +1,9 @@
1
- import { a as UserPluginWithLifeCycle, c as __name, n as PluginZod, t as Options } from "./types-HQfz08mH.cjs";
1
+ import { n as PluginZod, s as __name, t as Options } from "./types-23ND42NW.cjs";
2
+ import * as _kubb_core0 from "@kubb/core";
2
3
 
3
4
  //#region src/plugin.d.ts
4
5
  declare const pluginZodName = "plugin-zod";
5
- declare const pluginZod: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginZod>;
6
+ declare const pluginZod: (options?: Options | undefined) => _kubb_core0.UserPluginWithLifeCycle<PluginZod>;
6
7
  //#endregion
7
8
  export { type PluginZod, pluginZod, pluginZodName };
8
9
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { a as UserPluginWithLifeCycle, n as PluginZod, t as Options } from "./types-BBLRijaO.js";
2
+ import { n as PluginZod, t as Options } from "./types-CyZ4p-xC.js";
3
+ import * as _kubb_core0 from "@kubb/core";
3
4
 
4
5
  //#region src/plugin.d.ts
5
6
  declare const pluginZodName = "plugin-zod";
6
- declare const pluginZod: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginZod>;
7
+ declare const pluginZod: (options?: Options | undefined) => _kubb_core0.UserPluginWithLifeCycle<PluginZod>;
7
8
  //#endregion
8
9
  export { type PluginZod, pluginZod, pluginZodName };
9
10
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { n as operationsGenerator, t as zodGenerator } from "./generators-DWTQMdiR.js";
2
+ import { n as operationsGenerator, t as zodGenerator } from "./generators-BawvbIJ1.js";
3
3
  import path from "node:path";
4
4
  import { PackageManager, definePlugin, getBarrelFiles, getMode } from "@kubb/core";
5
5
  import { camelCase, pascalCase } from "@kubb/core/transformers";