@kubb/plugin-zod 4.3.1 → 4.4.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.
Files changed (36) hide show
  1. package/dist/chunk-DMmIE7y6.js +28 -0
  2. package/dist/{components-MHUlEVjU.cjs → components-BiOh-7_I.cjs} +19 -19
  3. package/dist/components-BiOh-7_I.cjs.map +1 -0
  4. package/dist/{components-BUkyR7lK.js → components-DUJ6Xkpc.js} +3 -3
  5. package/dist/components-DUJ6Xkpc.js.map +1 -0
  6. package/dist/components.cjs +1 -1
  7. package/dist/components.d.cts +5 -3
  8. package/dist/components.d.ts +5 -3
  9. package/dist/components.js +1 -1
  10. package/dist/{generators-Bo3q-m_p.cjs → generators-B2hD7k6l.cjs} +25 -24
  11. package/dist/generators-B2hD7k6l.cjs.map +1 -0
  12. package/dist/{generators-8AD8PdD3.js → generators-CwEOtNXG.js} +6 -5
  13. package/dist/generators-CwEOtNXG.js.map +1 -0
  14. package/dist/generators.cjs +2 -2
  15. package/dist/generators.d.cts +3 -3
  16. package/dist/generators.d.ts +3 -3
  17. package/dist/generators.js +2 -2
  18. package/dist/index.cjs +4 -2
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +4 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/{types-DfzoyARl.d.ts → types-CS916VXJ.d.ts} +106 -201
  25. package/dist/{types-CjFerqx4.d.cts → types-Cd7g28dR.d.cts} +106 -201
  26. package/package.json +16 -10
  27. package/src/components/Operations.tsx +4 -4
  28. package/src/components/Zod.tsx +3 -2
  29. package/src/generators/operationsGenerator.tsx +1 -1
  30. package/src/generators/zodGenerator.tsx +3 -2
  31. package/src/plugin.ts +2 -0
  32. package/src/types.ts +2 -1
  33. package/dist/components-BUkyR7lK.js.map +0 -1
  34. package/dist/components-MHUlEVjU.cjs.map +0 -1
  35. package/dist/generators-8AD8PdD3.js.map +0 -1
  36. package/dist/generators-Bo3q-m_p.cjs.map +0 -1
@@ -0,0 +1,28 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
26
+
27
+ //#endregion
28
+ export { };
@@ -25,10 +25,10 @@ let __kubb_core_transformers = require("@kubb/core/transformers");
25
25
  __kubb_core_transformers = __toESM(__kubb_core_transformers);
26
26
  let __kubb_plugin_oas = require("@kubb/plugin-oas");
27
27
  __kubb_plugin_oas = __toESM(__kubb_plugin_oas);
28
- let __kubb_react = require("@kubb/react");
29
- __kubb_react = __toESM(__kubb_react);
30
- let __kubb_react_jsx_runtime = require("@kubb/react/jsx-runtime");
31
- __kubb_react_jsx_runtime = __toESM(__kubb_react_jsx_runtime);
28
+ let __kubb_react_fabric = require("@kubb/react-fabric");
29
+ __kubb_react_fabric = __toESM(__kubb_react_fabric);
30
+ let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
31
+ __kubb_react_fabric_jsx_runtime = __toESM(__kubb_react_fabric_jsx_runtime);
32
32
 
33
33
  //#region src/components/Operations.tsx
34
34
  function Operations({ name, operations }) {
@@ -43,12 +43,12 @@ function Operations({ name, operations }) {
43
43
  };
44
44
  return prev;
45
45
  }, {});
46
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react_jsx_runtime.Fragment, { children: [
47
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
46
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
47
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
48
48
  name: "OperationSchema",
49
49
  isExportable: true,
50
50
  isIndexable: true,
51
- children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Type, {
51
+ children: /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Type, {
52
52
  name: "OperationSchema",
53
53
  export: true,
54
54
  children: `{
@@ -68,32 +68,32 @@ function Operations({ name, operations }) {
68
68
  }`
69
69
  })
70
70
  }),
71
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
71
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
72
72
  name: "OperationsMap",
73
73
  isExportable: true,
74
74
  isIndexable: true,
75
- children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Type, {
75
+ children: /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Type, {
76
76
  name: "OperationsMap",
77
77
  export: true,
78
78
  children: "Record<string, OperationSchema>"
79
79
  })
80
80
  }),
81
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
81
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
82
82
  name,
83
83
  isExportable: true,
84
84
  isIndexable: true,
85
- children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Const, {
85
+ children: /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Const, {
86
86
  export: true,
87
87
  name,
88
88
  asConst: true,
89
89
  children: `{${__kubb_core_transformers.default.stringifyObject(operationsJSON)}}`
90
90
  })
91
91
  }),
92
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
92
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
93
93
  name: "paths",
94
94
  isExportable: true,
95
95
  isIndexable: true,
96
- children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Const, {
96
+ children: /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Const, {
97
97
  export: true,
98
98
  name: "paths",
99
99
  asConst: true,
@@ -516,26 +516,26 @@ function Zod({ name, typeName, tree, rawSchema, inferTypeName, mapper, coercion,
516
516
  schema: rawSchema
517
517
  }) || baseSchemaOutput : baseSchemaOutput;
518
518
  const finalOutput = typeName ? `${wrappedSchemaOutput} as unknown as ${version === "4" ? "z.ZodType" : "ToZod"}<${typeName}>` : wrappedSchemaOutput;
519
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
519
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Source, {
520
520
  name,
521
521
  isExportable: true,
522
522
  isIndexable: true,
523
- children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Const, {
523
+ children: /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Const, {
524
524
  export: true,
525
525
  name,
526
526
  JSDoc: { comments: [description ? `@description ${__kubb_core_transformers.default.jsStringEscape(description)}` : void 0].filter(Boolean) },
527
527
  children: finalOutput
528
528
  })
529
- }), inferTypeName && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File.Source, {
529
+ }), inferTypeName && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File.Source, {
530
530
  name: inferTypeName,
531
531
  isExportable: true,
532
532
  isIndexable: true,
533
533
  isTypeOnly: true,
534
- children: [typeName && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Type, {
534
+ children: [typeName && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Type, {
535
535
  export: true,
536
536
  name: inferTypeName,
537
537
  children: typeName
538
- }), !typeName && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.Type, {
538
+ }), !typeName && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.Type, {
539
539
  export: true,
540
540
  name: inferTypeName,
541
541
  children: `z.infer<typeof ${name}>`
@@ -562,4 +562,4 @@ Object.defineProperty(exports, '__toESM', {
562
562
  return __toESM;
563
563
  }
564
564
  });
565
- //# sourceMappingURL=components-MHUlEVjU.cjs.map
565
+ //# sourceMappingURL=components-BiOh-7_I.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-BiOh-7_I.cjs","names":["File","Type","Const","transformers","order: string[]","schemaKeywords","transformers","name","SchemaGenerator","value","SchemaGenerator","schemaKeywords","parserZod.sort","parserZod.parse","File","Const","transformers","Type"],"sources":["../src/components/Operations.tsx","../src/parser.ts","../src/components/Zod.tsx"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { SchemaNames } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n name: string\n operations: Array<{ operation: Operation; data: SchemaNames }>\n}\n\nexport function Operations({ name, operations }: Props): KubbNode {\n const operationsJSON = operations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = operations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <File.Source name=\"OperationSchema\" isExportable isIndexable>\n <Type name=\"OperationSchema\" export>{`{\n readonly request: z.ZodTypeAny | undefined;\n readonly parameters: {\n readonly path: z.ZodTypeAny | undefined;\n readonly query: z.ZodTypeAny | undefined;\n readonly header: z.ZodTypeAny | undefined;\n };\n readonly responses: {\n readonly [status: number]: z.ZodTypeAny;\n readonly default: z.ZodTypeAny;\n };\n readonly errors: {\n readonly [status: number]: z.ZodTypeAny;\n };\n}`}</Type>\n </File.Source>\n <File.Source name=\"OperationsMap\" isExportable isIndexable>\n <Type name=\"OperationsMap\" export>\n {'Record<string, OperationSchema>'}\n </Type>\n </File.Source>\n <File.Source name={name} isExportable isIndexable>\n <Const export name={name} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n </File.Source>\n <File.Source name={'paths'} isExportable isIndexable>\n <Const export name={'paths'} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </File.Source>\n </>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport type { SchemaObject } from '@kubb/oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\nimport { isKeyword, SchemaGenerator, type SchemaKeywordMapper, type SchemaTree, schemaKeywords } from '@kubb/plugin-oas'\n\n//TODO add zodKeywordMapper as function that returns 3 versions: v3, v4 and v4 mini, this can also be used to have the custom mapping(see object type)\n// also include shouldCoerce\n\nconst zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n void: () => 'z.void()',\n number: (coercion?: boolean, min?: number, max?: number, exclusiveMinimum?: number, exclusiveMaximum?: number) => {\n return [\n coercion ? 'z.coerce.number()' : 'z.number()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n exclusiveMinimum !== undefined ? `.gt(${exclusiveMinimum})` : undefined,\n exclusiveMaximum !== undefined ? `.lt(${exclusiveMaximum})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number, version: '3' | '4' = '3', exclusiveMinimum?: number, exclusiveMaximum?: number) => {\n return [\n coercion ? 'z.coerce.number().int()' : version === '4' ? 'z.int()' : 'z.number().int()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n exclusiveMinimum !== undefined ? `.gt(${exclusiveMinimum})` : undefined,\n exclusiveMaximum !== undefined ? `.lt(${exclusiveMaximum})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n interface: (value?: string, strict?: boolean) => {\n if (strict) {\n return `z.strictInterface({\n ${value}\n })`\n }\n return `z.interface({\n ${value}\n })`\n },\n object: (value?: string, strict?: boolean, version: '3' | '4' = '3') => {\n if (version === '4' && strict) {\n return `z.strictObject({\n ${value}\n })`\n }\n\n if (strict) {\n return `z.object({\n ${value}\n }).strict()`\n }\n\n return `z.object({\n ${value}\n })`\n },\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n //support for discriminatedUnion\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: (value?: string) => {\n if (value) {\n return `z.nullable(${value})`\n }\n return '.nullable()'\n },\n null: () => 'z.null()',\n nullish: (value?: string) => {\n if (value) {\n return `z.nullish(${value})`\n }\n return '.nullish()'\n },\n array: (items: string[] = [], min?: number, max?: number, unique?: boolean) => {\n return [\n `z.array(${items?.join('')})`,\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n unique ? `.refine(items => new Set(items).size === items.length, { message: \"Array entries must be unique\" })` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number | boolean) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false, version: '3' | '4' = '3') => {\n if (offset) {\n return version === '4' ? `z.iso.datetime({ offset: ${offset} })` : `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return version === '4' ? `z.iso.datetime({ local: ${local} })` : `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean, version: '3' | '4' = '3') => {\n if (type === 'string') {\n return version === '4' ? 'z.iso.date()' : 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean, version: '3' | '4' = '3') => {\n if (type === 'string') {\n return version === '4' ? 'z.iso.time()' : 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().uuid()' : version === '4' ? 'z.uuid()' : 'z.string().uuid()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n url: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().url()' : version === '4' ? 'z.url()' : 'z.string().url()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n default: (value?: string | number | true | object) => {\n if (typeof value === 'object') {\n return '.default({})'\n }\n return `.default(${value ?? ''})`\n },\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n max: undefined,\n min: undefined,\n optional: (value?: string) => {\n if (value) {\n return `z.optional(${value})`\n }\n return '.optional()'\n },\n matches: (value = '', coercion?: boolean) => (coercion ? `z.coerce.string().regex(${value})` : `z.string().regex(${value})`),\n email: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().email()' : version === '4' ? 'z.email()' : 'z.string().email()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n writeOnly: undefined,\n ref: (value?: string, version: '3' | '4' = '3') => {\n if (!value) {\n return undefined\n }\n\n return version === '4' ? value : `z.lazy(() => ${value})`\n },\n blob: () => 'z.instanceof(File)',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n exclusiveMinimum: undefined,\n exclusiveMaximum: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.null,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\nconst shouldCoerce = (coercion: ParserOptions['coercion'] | undefined, type: 'dates' | 'strings' | 'numbers'): boolean => {\n if (coercion === undefined) {\n return false\n }\n if (typeof coercion === 'boolean') {\n return coercion\n }\n\n return !!coercion[type]\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean | { dates?: boolean; strings?: boolean; numbers?: boolean }\n wrapOutput?: (opts: { output: string; schema: any }) => string | undefined\n rawSchema: SchemaObject\n version: '3' | '4'\n}\n\nexport function parse({ parent, current, name, siblings }: SchemaTree, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n // Early exit: if siblings contain both matches and ref → skip matches entirely\n const hasMatches = siblings.some((it) => isKeyword(it, schemaKeywords.matches))\n const hasRef = siblings.some((it) => isKeyword(it, schemaKeywords.ref))\n\n if (hasMatches && hasRef && isKeyword(current, schemaKeywords.matches)) {\n return undefined // strip matches\n }\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse({ parent, name: name, current: current.args[0] as Schema, siblings }, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas, _index, siblings) => parse({ parent: current, name: name, current: schemas, siblings }, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n current.args.unique,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n if (current.args.items.length === 1) {\n const child = {\n keyword: schemaKeywords.const,\n args: current.args.items[0],\n }\n return parse({ parent: current, name: name, current: child, siblings: [child] }, options)\n }\n\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => ({\n keyword: schemaKeywords.const,\n args: schema,\n }))\n .map((schema, _index, siblings) => {\n return parse({ parent: current, name: name, current: schema, siblings }, options)\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'boolean') {\n return transformers.stringify(schema.value)\n }\n\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name, options.version)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const propertyEntries = Object.entries(current.args?.properties || {}).filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n\n const properties = propertyEntries\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((it) => it.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const isNullable = schemas.some((it) => isKeyword(it, schemaKeywords.nullable))\n const isNullish = schemas.some((it) => isKeyword(it, schemaKeywords.nullish))\n const isOptional = schemas.some((it) => isKeyword(it, schemaKeywords.optional))\n\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n const baseSchemaOutput = sort(schemas)\n .filter((schema) => {\n return !isKeyword(schema, schemaKeywords.optional) && !isKeyword(schema, schemaKeywords.nullable) && !isKeyword(schema, schemaKeywords.nullish)\n })\n .map((schema) => parse({ parent: current, name, current: schema, siblings: schemas }, options))\n .filter(Boolean)\n .join('')\n\n const objectValue = options.wrapOutput\n ? options.wrapOutput({ output: baseSchemaOutput, schema: options.rawSchema?.properties?.[name] }) || baseSchemaOutput\n : baseSchemaOutput\n\n if (options.version === '4' && SchemaGenerator.find(schemas, schemaKeywords.ref)) {\n // both optional and nullable\n if (isNullish) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.nullish(objectValue)}\n }`\n }\n\n // undefined\n if (isOptional) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.optional(objectValue)}\n }`\n }\n\n // null\n if (isNullable) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.nullable(objectValue)}\n }`\n }\n\n return `get \"${name}\"(){\n return ${objectValue}\n }`\n }\n\n // both optional and nullable\n if (isNullish) {\n return `\"${name}\": ${objectValue}${zodKeywordMapper.nullish()}`\n }\n\n // undefined\n if (isOptional) {\n return `\"${name}\": ${zodKeywordMapper.optional(objectValue)}`\n }\n\n // null\n if (isNullable) {\n return `\"${name}\": ${zodKeywordMapper.nullable(objectValue)}`\n }\n\n return `\"${name}\": ${objectValue}`\n })\n .join(',\\n')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean)\n .join('')\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties, current.args?.strict, options.version),\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n current.args.items.map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options)).filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number(current.args.value))\n }\n\n if (current.args.format === 'boolean' && current.args.value !== undefined) {\n return zodKeywordMapper.const(current.args.value)\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args, null), shouldCoerce(options.coercion, 'strings'))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.string(shouldCoerce(options.coercion, 'strings'), minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.uuid)) {\n return zodKeywordMapper.uuid(shouldCoerce(options.coercion, 'strings'), options.version)\n }\n\n if (isKeyword(current, schemaKeywords.email)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.email(shouldCoerce(options.coercion, 'strings'), options.version, minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.url)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.url(shouldCoerce(options.coercion, 'strings'), options.version, minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.number)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n const exclusiveMinimumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMinimum)\n const exclusiveMaximumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMaximum)\n return zodKeywordMapper.number(\n shouldCoerce(options.coercion, 'numbers'),\n minSchema?.args,\n maxSchema?.args,\n exclusiveMinimumSchema?.args,\n exclusiveMaximumSchema?.args,\n )\n }\n\n if (isKeyword(current, schemaKeywords.integer)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n const exclusiveMinimumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMinimum)\n const exclusiveMaximumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMaximum)\n return zodKeywordMapper.integer(\n shouldCoerce(options.coercion, 'numbers'),\n minSchema?.args,\n maxSchema?.args,\n options.version,\n exclusiveMinimumSchema?.args,\n exclusiveMaximumSchema?.args,\n )\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local, options.version)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, shouldCoerce(options.coercion, 'dates'), options.version)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, shouldCoerce(options.coercion, 'dates'), options.version)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers from '@kubb/core/transformers'\nimport type { SchemaObject } from '@kubb/oas'\nimport { isKeyword, type Schema, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Const, File, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport * as parserZod from '../parser.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n name: string\n typeName?: string\n inferTypeName?: string\n tree: Array<Schema>\n rawSchema: SchemaObject\n description?: string\n coercion: PluginZod['resolvedOptions']['coercion']\n mapper: PluginZod['resolvedOptions']['mapper']\n keysToOmit?: string[]\n wrapOutput?: PluginZod['resolvedOptions']['wrapOutput']\n version: '3' | '4'\n emptySchemaType: PluginZod['resolvedOptions']['emptySchemaType']\n}\n\nexport function Zod({\n name,\n typeName,\n tree,\n rawSchema,\n inferTypeName,\n mapper,\n coercion,\n keysToOmit,\n description,\n wrapOutput,\n version,\n emptySchemaType,\n}: Props): KubbNode {\n const hasTuple = !!SchemaGenerator.deepSearch(tree, schemaKeywords.tuple)\n\n const schemas = parserZod.sort(tree).filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n\n const output = schemas\n .map((schema, index) => {\n const siblings = schemas.filter((_, i) => i !== index)\n\n return parserZod.parse(\n { parent: undefined, current: schema, siblings },\n { name, keysToOmit, typeName, description, mapper, coercion, wrapOutput, rawSchema, version },\n )\n })\n .filter(Boolean)\n .join('')\n\n let suffix = ''\n const firstSchema = schemas.at(0)\n const lastSchema = schemas.at(-1)\n\n if (lastSchema && isKeyword(lastSchema, schemaKeywords.nullable)) {\n if (firstSchema && isKeyword(firstSchema, schemaKeywords.ref)) {\n if (version === '3') {\n suffix = '.unwrap().schema.unwrap()'\n } else {\n suffix = '.unwrap().unwrap()'\n }\n } else {\n suffix = '.unwrap()'\n }\n } else {\n if (firstSchema && isKeyword(firstSchema, schemaKeywords.ref) && version === '3') {\n suffix = '.schema'\n }\n }\n\n const emptyValue = parserZod.parse(\n {\n parent: undefined,\n current: {\n keyword: schemaKeywords[emptySchemaType],\n },\n siblings: [],\n },\n { name, keysToOmit, typeName, description, mapper, coercion, wrapOutput, rawSchema, version },\n )\n\n const baseSchemaOutput =\n [output, keysToOmit?.length ? `${suffix}.omit({ ${keysToOmit.map((key) => `'${key}': true`).join(',')} })` : undefined].filter(Boolean).join('') ||\n emptyValue ||\n ''\n const wrappedSchemaOutput = wrapOutput ? wrapOutput({ output: baseSchemaOutput, schema: rawSchema }) || baseSchemaOutput : baseSchemaOutput\n const finalOutput = typeName ? `${wrappedSchemaOutput} as unknown as ${version === '4' ? 'z.ZodType' : 'ToZod'}<${typeName}>` : wrappedSchemaOutput\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Const\n export\n name={name}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {finalOutput}\n </Const>\n </File.Source>\n {inferTypeName && (\n <File.Source name={inferTypeName} isExportable isIndexable isTypeOnly>\n {typeName && (\n <Type export name={inferTypeName}>\n {typeName}\n </Type>\n )}\n {!typeName && (\n <Type export name={inferTypeName}>\n {`z.infer<typeof ${name}>`}\n </Type>\n )}\n </File.Source>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAgB,WAAW,EAAE,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AI,mBAAmB;CAC3H,MAAM,cAAc,WAAW,GAAG,oBAAoB,iBAAiB,YAAY,MAAM,cAAc,QAAQ,GAAG,SAAS,KAAK;AAEhI,QACE,iHACE,yDAACG,yBAAK;EAAa;EAAM;EAAa;YACpC,yDAACC;GACC;GACM;GACN,OAAO,EACL,UAAU,CAAC,cAAc,gBAAgBC,iCAAa,eAAe,YAAY,KAAK,OAAU,CAAC,OAAO,QAAQ,EACjH;aAEA;IACK;GACI,EACb,iBACC,0DAACF,yBAAK;EAAO,MAAM;EAAe;EAAa;EAAY;aACxD,YACC,yDAACG;GAAK;GAAO,MAAM;aAChB;IACI,EAER,CAAC,YACA,yDAACA;GAAK;GAAO,MAAM;aAChB,kBAAkB,KAAK;IACnB;GAEG,IAEf"}
@@ -1,7 +1,7 @@
1
1
  import transformers from "@kubb/core/transformers";
2
2
  import { SchemaGenerator, isKeyword, schemaKeywords } from "@kubb/plugin-oas";
3
- import { Const, File, Type } from "@kubb/react";
4
- import { Fragment, jsx, jsxs } from "@kubb/react/jsx-runtime";
3
+ import { Const, File, Type } from "@kubb/react-fabric";
4
+ import { Fragment, jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
5
5
 
6
6
  //#region src/components/Operations.tsx
7
7
  function Operations({ name, operations }) {
@@ -518,4 +518,4 @@ function Zod({ name, typeName, tree, rawSchema, inferTypeName, mapper, coercion,
518
518
 
519
519
  //#endregion
520
520
  export { Operations as n, Zod as t };
521
- //# sourceMappingURL=components-BUkyR7lK.js.map
521
+ //# sourceMappingURL=components-DUJ6Xkpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-DUJ6Xkpc.js","names":["order: string[]","name","value","parserZod.sort","parserZod.parse"],"sources":["../src/components/Operations.tsx","../src/parser.ts","../src/components/Zod.tsx"],"sourcesContent":["import transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { SchemaNames } from '@kubb/plugin-oas/hooks'\nimport { Const, File, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n name: string\n operations: Array<{ operation: Operation; data: SchemaNames }>\n}\n\nexport function Operations({ name, operations }: Props): KubbNode {\n const operationsJSON = operations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.getOperationId()}\"`] = acc.data\n\n return prev\n },\n {} as Record<string, unknown>,\n )\n\n const pathsJSON = operations.reduce(\n (prev, acc) => {\n prev[`\"${acc.operation.path}\"`] = {\n ...(prev[`\"${acc.operation.path}\"`] || ({} as Record<HttpMethod, string>)),\n [acc.operation.method]: `operations[\"${acc.operation.getOperationId()}\"]`,\n }\n\n return prev\n },\n {} as Record<string, Record<HttpMethod, string>>,\n )\n\n return (\n <>\n <File.Source name=\"OperationSchema\" isExportable isIndexable>\n <Type name=\"OperationSchema\" export>{`{\n readonly request: z.ZodTypeAny | undefined;\n readonly parameters: {\n readonly path: z.ZodTypeAny | undefined;\n readonly query: z.ZodTypeAny | undefined;\n readonly header: z.ZodTypeAny | undefined;\n };\n readonly responses: {\n readonly [status: number]: z.ZodTypeAny;\n readonly default: z.ZodTypeAny;\n };\n readonly errors: {\n readonly [status: number]: z.ZodTypeAny;\n };\n}`}</Type>\n </File.Source>\n <File.Source name=\"OperationsMap\" isExportable isIndexable>\n <Type name=\"OperationsMap\" export>\n {'Record<string, OperationSchema>'}\n </Type>\n </File.Source>\n <File.Source name={name} isExportable isIndexable>\n <Const export name={name} asConst>\n {`{${transformers.stringifyObject(operationsJSON)}}`}\n </Const>\n </File.Source>\n <File.Source name={'paths'} isExportable isIndexable>\n <Const export name={'paths'} asConst>\n {`{${transformers.stringifyObject(pathsJSON)}}`}\n </Const>\n </File.Source>\n </>\n )\n}\n","import transformers from '@kubb/core/transformers'\nimport type { SchemaObject } from '@kubb/oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\nimport { isKeyword, SchemaGenerator, type SchemaKeywordMapper, type SchemaTree, schemaKeywords } from '@kubb/plugin-oas'\n\n//TODO add zodKeywordMapper as function that returns 3 versions: v3, v4 and v4 mini, this can also be used to have the custom mapping(see object type)\n// also include shouldCoerce\n\nconst zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n void: () => 'z.void()',\n number: (coercion?: boolean, min?: number, max?: number, exclusiveMinimum?: number, exclusiveMaximum?: number) => {\n return [\n coercion ? 'z.coerce.number()' : 'z.number()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n exclusiveMinimum !== undefined ? `.gt(${exclusiveMinimum})` : undefined,\n exclusiveMaximum !== undefined ? `.lt(${exclusiveMaximum})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number, version: '3' | '4' = '3', exclusiveMinimum?: number, exclusiveMaximum?: number) => {\n return [\n coercion ? 'z.coerce.number().int()' : version === '4' ? 'z.int()' : 'z.number().int()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n exclusiveMinimum !== undefined ? `.gt(${exclusiveMinimum})` : undefined,\n exclusiveMaximum !== undefined ? `.lt(${exclusiveMaximum})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n interface: (value?: string, strict?: boolean) => {\n if (strict) {\n return `z.strictInterface({\n ${value}\n })`\n }\n return `z.interface({\n ${value}\n })`\n },\n object: (value?: string, strict?: boolean, version: '3' | '4' = '3') => {\n if (version === '4' && strict) {\n return `z.strictObject({\n ${value}\n })`\n }\n\n if (strict) {\n return `z.object({\n ${value}\n }).strict()`\n }\n\n return `z.object({\n ${value}\n })`\n },\n string: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.string()' : 'z.string()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n //support for discriminatedUnion\n boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: (value?: string) => {\n if (value) {\n return `z.nullable(${value})`\n }\n return '.nullable()'\n },\n null: () => 'z.null()',\n nullish: (value?: string) => {\n if (value) {\n return `z.nullish(${value})`\n }\n return '.nullish()'\n },\n array: (items: string[] = [], min?: number, max?: number, unique?: boolean) => {\n return [\n `z.array(${items?.join('')})`,\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n unique ? `.refine(items => new Set(items).size === items.length, { message: \"Array entries must be unique\" })` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n tuple: (items: string[] = []) => `z.tuple([${items?.join(', ')}])`,\n enum: (items: string[] = []) => `z.enum([${items?.join(', ')}])`,\n union: (items: string[] = []) => `z.union([${items?.join(', ')}])`,\n const: (value?: string | number | boolean) => `z.literal(${value ?? ''})`,\n /**\n * ISO 8601\n */\n datetime: (offset = false, local = false, version: '3' | '4' = '3') => {\n if (offset) {\n return version === '4' ? `z.iso.datetime({ offset: ${offset} })` : `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return version === '4' ? `z.iso.datetime({ local: ${local} })` : `z.string().datetime({ local: ${local} })`\n }\n\n return 'z.string().datetime()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO date format (YYYY-MM-DD)\n * @default ISO date format (YYYY-MM-DD)\n */\n date: (type: 'date' | 'string' = 'string', coercion?: boolean, version: '3' | '4' = '3') => {\n if (type === 'string') {\n return version === '4' ? 'z.iso.date()' : 'z.string().date()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n /**\n * Type `'date'` Date\n * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])\n * @default ISO time format (HH:mm:ss[.SSSSSS])\n */\n time: (type: 'date' | 'string' = 'string', coercion?: boolean, version: '3' | '4' = '3') => {\n if (type === 'string') {\n return version === '4' ? 'z.iso.time()' : 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().uuid()' : version === '4' ? 'z.uuid()' : 'z.string().uuid()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n url: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().url()' : version === '4' ? 'z.url()' : 'z.string().url()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n default: (value?: string | number | true | object) => {\n if (typeof value === 'object') {\n return '.default({})'\n }\n return `.default(${value ?? ''})`\n },\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n max: undefined,\n min: undefined,\n optional: (value?: string) => {\n if (value) {\n return `z.optional(${value})`\n }\n return '.optional()'\n },\n matches: (value = '', coercion?: boolean) => (coercion ? `z.coerce.string().regex(${value})` : `z.string().regex(${value})`),\n email: (coercion?: boolean, version: '3' | '4' = '3', min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.string().email()' : version === '4' ? 'z.email()' : 'z.string().email()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n writeOnly: undefined,\n ref: (value?: string, version: '3' | '4' = '3') => {\n if (!value) {\n return undefined\n }\n\n return version === '4' ? value : `z.lazy(() => ${value})`\n },\n blob: () => 'z.instanceof(File)',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: undefined,\n exclusiveMinimum: undefined,\n exclusiveMaximum: undefined,\n} satisfies SchemaMapper<string | null | undefined>\n\n/**\n * @link based on https://github.com/cellular/oazapfts/blob/7ba226ebb15374e8483cc53e7532f1663179a22c/src/codegen/generate.ts#L398\n */\n\nexport function sort(items?: Schema[]): Schema[] {\n const order: string[] = [\n schemaKeywords.string,\n schemaKeywords.datetime,\n schemaKeywords.date,\n schemaKeywords.time,\n schemaKeywords.tuple,\n schemaKeywords.number,\n schemaKeywords.object,\n schemaKeywords.enum,\n schemaKeywords.url,\n schemaKeywords.email,\n schemaKeywords.firstName,\n schemaKeywords.lastName,\n schemaKeywords.password,\n schemaKeywords.matches,\n schemaKeywords.uuid,\n schemaKeywords.null,\n schemaKeywords.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n ]\n\n if (!items) {\n return []\n }\n\n return transformers.orderBy(items, [(v) => order.indexOf(v.keyword)], ['asc'])\n}\n\nconst shouldCoerce = (coercion: ParserOptions['coercion'] | undefined, type: 'dates' | 'strings' | 'numbers'): boolean => {\n if (coercion === undefined) {\n return false\n }\n if (typeof coercion === 'boolean') {\n return coercion\n }\n\n return !!coercion[type]\n}\n\ntype ParserOptions = {\n name: string\n typeName?: string\n description?: string\n keysToOmit?: string[]\n mapper?: Record<string, string>\n coercion?: boolean | { dates?: boolean; strings?: boolean; numbers?: boolean }\n wrapOutput?: (opts: { output: string; schema: any }) => string | undefined\n rawSchema: SchemaObject\n version: '3' | '4'\n}\n\nexport function parse({ parent, current, name, siblings }: SchemaTree, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\n\n // Early exit: if siblings contain both matches and ref → skip matches entirely\n const hasMatches = siblings.some((it) => isKeyword(it, schemaKeywords.matches))\n const hasRef = siblings.some((it) => isKeyword(it, schemaKeywords.ref))\n\n if (hasMatches && hasRef && isKeyword(current, schemaKeywords.matches)) {\n return undefined // strip matches\n }\n\n if (!value) {\n return undefined\n }\n\n if (isKeyword(current, schemaKeywords.union)) {\n // zod union type needs at least 2 items\n if (Array.isArray(current.args) && current.args.length === 1) {\n return parse({ parent, name: name, current: current.args[0] as Schema, siblings }, options)\n }\n if (Array.isArray(current.args) && !current.args.length) {\n return ''\n }\n\n return zodKeywordMapper.union(\n sort(current.args)\n .map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.and)) {\n const items = sort(current.args)\n .filter((schema: Schema) => {\n return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword as typeof schemaKeywords.describe)\n })\n .map((schema: Schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean)\n\n return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`\n }\n\n if (isKeyword(current, schemaKeywords.array)) {\n return zodKeywordMapper.array(\n sort(current.args.items)\n .map((schemas, _index, siblings) => parse({ parent: current, name: name, current: schemas, siblings }, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\n current.args.unique,\n )\n }\n\n if (isKeyword(current, schemaKeywords.enum)) {\n if (current.args.asConst) {\n if (current.args.items.length === 1) {\n const child = {\n keyword: schemaKeywords.const,\n args: current.args.items[0],\n }\n return parse({ parent: current, name: name, current: child, siblings: [child] }, options)\n }\n\n return zodKeywordMapper.union(\n current.args.items\n .map((schema) => ({\n keyword: schemaKeywords.const,\n args: schema,\n }))\n .map((schema, _index, siblings) => {\n return parse({ parent: current, name: name, current: schema, siblings }, options)\n })\n .filter(Boolean),\n )\n }\n\n return zodKeywordMapper.enum(\n current.args.items.map((schema) => {\n if (schema.format === 'boolean') {\n return transformers.stringify(schema.value)\n }\n\n if (schema.format === 'number') {\n return transformers.stringify(schema.value)\n }\n return transformers.stringify(schema.value)\n }),\n )\n }\n\n if (isKeyword(current, schemaKeywords.ref)) {\n return zodKeywordMapper.ref(current.args?.name, options.version)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const propertyEntries = Object.entries(current.args?.properties || {}).filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n\n const properties = propertyEntries\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((it) => it.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\n const isNullable = schemas.some((it) => isKeyword(it, schemaKeywords.nullable))\n const isNullish = schemas.some((it) => isKeyword(it, schemaKeywords.nullish))\n const isOptional = schemas.some((it) => isKeyword(it, schemaKeywords.optional))\n\n const mappedName = nameSchema?.args || name\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${name}\": ${options.mapper?.[mappedName]}`\n }\n\n const baseSchemaOutput = sort(schemas)\n .filter((schema) => {\n return !isKeyword(schema, schemaKeywords.optional) && !isKeyword(schema, schemaKeywords.nullable) && !isKeyword(schema, schemaKeywords.nullish)\n })\n .map((schema) => parse({ parent: current, name, current: schema, siblings: schemas }, options))\n .filter(Boolean)\n .join('')\n\n const objectValue = options.wrapOutput\n ? options.wrapOutput({ output: baseSchemaOutput, schema: options.rawSchema?.properties?.[name] }) || baseSchemaOutput\n : baseSchemaOutput\n\n if (options.version === '4' && SchemaGenerator.find(schemas, schemaKeywords.ref)) {\n // both optional and nullable\n if (isNullish) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.nullish(objectValue)}\n }`\n }\n\n // undefined\n if (isOptional) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.optional(objectValue)}\n }`\n }\n\n // null\n if (isNullable) {\n return `get \"${name}\"(){\n return ${zodKeywordMapper.nullable(objectValue)}\n }`\n }\n\n return `get \"${name}\"(){\n return ${objectValue}\n }`\n }\n\n // both optional and nullable\n if (isNullish) {\n return `\"${name}\": ${objectValue}${zodKeywordMapper.nullish()}`\n }\n\n // undefined\n if (isOptional) {\n return `\"${name}\": ${zodKeywordMapper.optional(objectValue)}`\n }\n\n // null\n if (isNullable) {\n return `\"${name}\": ${zodKeywordMapper.nullable(objectValue)}`\n }\n\n return `\"${name}\": ${objectValue}`\n })\n .join(',\\n')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options))\n .filter(Boolean)\n .join('')\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties, current.args?.strict, options.version),\n additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : undefined,\n ].filter(Boolean)\n\n return text.join('')\n }\n\n if (isKeyword(current, schemaKeywords.tuple)) {\n return zodKeywordMapper.tuple(\n current.args.items.map((schema, _index, siblings) => parse({ parent: current, name: name, current: schema, siblings }, options)).filter(Boolean),\n )\n }\n\n if (isKeyword(current, schemaKeywords.const)) {\n if (current.args.format === 'number' && current.args.value !== undefined) {\n return zodKeywordMapper.const(Number(current.args.value))\n }\n\n if (current.args.format === 'boolean' && current.args.value !== undefined) {\n return zodKeywordMapper.const(current.args.value)\n }\n return zodKeywordMapper.const(transformers.stringify(current.args.value))\n }\n\n if (isKeyword(current, schemaKeywords.matches)) {\n if (current.args) {\n return zodKeywordMapper.matches(transformers.toRegExpString(current.args, null), shouldCoerce(options.coercion, 'strings'))\n }\n }\n\n if (isKeyword(current, schemaKeywords.default)) {\n if (current.args) {\n return zodKeywordMapper.default(current.args)\n }\n }\n\n if (isKeyword(current, schemaKeywords.describe)) {\n if (current.args) {\n return zodKeywordMapper.describe(transformers.stringify(current.args.toString()))\n }\n }\n\n if (isKeyword(current, schemaKeywords.string)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.string(shouldCoerce(options.coercion, 'strings'), minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.uuid)) {\n return zodKeywordMapper.uuid(shouldCoerce(options.coercion, 'strings'), options.version)\n }\n\n if (isKeyword(current, schemaKeywords.email)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.email(shouldCoerce(options.coercion, 'strings'), options.version, minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.url)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n return zodKeywordMapper.url(shouldCoerce(options.coercion, 'strings'), options.version, minSchema?.args, maxSchema?.args)\n }\n\n if (isKeyword(current, schemaKeywords.number)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n const exclusiveMinimumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMinimum)\n const exclusiveMaximumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMaximum)\n return zodKeywordMapper.number(\n shouldCoerce(options.coercion, 'numbers'),\n minSchema?.args,\n maxSchema?.args,\n exclusiveMinimumSchema?.args,\n exclusiveMaximumSchema?.args,\n )\n }\n\n if (isKeyword(current, schemaKeywords.integer)) {\n const minSchema = SchemaGenerator.find(siblings, schemaKeywords.min)\n const maxSchema = SchemaGenerator.find(siblings, schemaKeywords.max)\n\n const exclusiveMinimumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMinimum)\n const exclusiveMaximumSchema = SchemaGenerator.find(siblings, schemaKeywords.exclusiveMaximum)\n return zodKeywordMapper.integer(\n shouldCoerce(options.coercion, 'numbers'),\n minSchema?.args,\n maxSchema?.args,\n options.version,\n exclusiveMinimumSchema?.args,\n exclusiveMaximumSchema?.args,\n )\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local, options.version)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, shouldCoerce(options.coercion, 'dates'), options.version)\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, shouldCoerce(options.coercion, 'dates'), options.version)\n }\n\n if (current.keyword in zodKeywordMapper && 'args' in current) {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper] as (typeof zodKeywordMapper)['const']\n\n return value((current as SchemaKeywordBase<unknown>).args as any)\n }\n\n if (current.keyword in zodKeywordMapper) {\n return value()\n }\n\n return undefined\n}\n","import transformers from '@kubb/core/transformers'\nimport type { SchemaObject } from '@kubb/oas'\nimport { isKeyword, type Schema, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Const, File, Type } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport * as parserZod from '../parser.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n name: string\n typeName?: string\n inferTypeName?: string\n tree: Array<Schema>\n rawSchema: SchemaObject\n description?: string\n coercion: PluginZod['resolvedOptions']['coercion']\n mapper: PluginZod['resolvedOptions']['mapper']\n keysToOmit?: string[]\n wrapOutput?: PluginZod['resolvedOptions']['wrapOutput']\n version: '3' | '4'\n emptySchemaType: PluginZod['resolvedOptions']['emptySchemaType']\n}\n\nexport function Zod({\n name,\n typeName,\n tree,\n rawSchema,\n inferTypeName,\n mapper,\n coercion,\n keysToOmit,\n description,\n wrapOutput,\n version,\n emptySchemaType,\n}: Props): KubbNode {\n const hasTuple = !!SchemaGenerator.deepSearch(tree, schemaKeywords.tuple)\n\n const schemas = parserZod.sort(tree).filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n\n const output = schemas\n .map((schema, index) => {\n const siblings = schemas.filter((_, i) => i !== index)\n\n return parserZod.parse(\n { parent: undefined, current: schema, siblings },\n { name, keysToOmit, typeName, description, mapper, coercion, wrapOutput, rawSchema, version },\n )\n })\n .filter(Boolean)\n .join('')\n\n let suffix = ''\n const firstSchema = schemas.at(0)\n const lastSchema = schemas.at(-1)\n\n if (lastSchema && isKeyword(lastSchema, schemaKeywords.nullable)) {\n if (firstSchema && isKeyword(firstSchema, schemaKeywords.ref)) {\n if (version === '3') {\n suffix = '.unwrap().schema.unwrap()'\n } else {\n suffix = '.unwrap().unwrap()'\n }\n } else {\n suffix = '.unwrap()'\n }\n } else {\n if (firstSchema && isKeyword(firstSchema, schemaKeywords.ref) && version === '3') {\n suffix = '.schema'\n }\n }\n\n const emptyValue = parserZod.parse(\n {\n parent: undefined,\n current: {\n keyword: schemaKeywords[emptySchemaType],\n },\n siblings: [],\n },\n { name, keysToOmit, typeName, description, mapper, coercion, wrapOutput, rawSchema, version },\n )\n\n const baseSchemaOutput =\n [output, keysToOmit?.length ? `${suffix}.omit({ ${keysToOmit.map((key) => `'${key}': true`).join(',')} })` : undefined].filter(Boolean).join('') ||\n emptyValue ||\n ''\n const wrappedSchemaOutput = wrapOutput ? wrapOutput({ output: baseSchemaOutput, schema: rawSchema }) || baseSchemaOutput : baseSchemaOutput\n const finalOutput = typeName ? `${wrappedSchemaOutput} as unknown as ${version === '4' ? 'z.ZodType' : 'ToZod'}<${typeName}>` : wrappedSchemaOutput\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Const\n export\n name={name}\n JSDoc={{\n comments: [description ? `@description ${transformers.jsStringEscape(description)}` : undefined].filter(Boolean),\n }}\n >\n {finalOutput}\n </Const>\n </File.Source>\n {inferTypeName && (\n <File.Source name={inferTypeName} isExportable isIndexable isTypeOnly>\n {typeName && (\n <Type export name={inferTypeName}>\n {typeName}\n </Type>\n )}\n {!typeName && (\n <Type export name={inferTypeName}>\n {`z.infer<typeof ${name}>`}\n </Type>\n )}\n </File.Source>\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AAWA,SAAgB,WAAW,EAAE,MAAM,cAA+B;CAChE,MAAM,iBAAiB,WAAW,QAC/B,MAAM,QAAQ;AACb,OAAK,IAAI,IAAI,UAAU,gBAAgB,CAAC,MAAM,IAAI;AAElD,SAAO;IAET,EAAE,CACH;CAED,MAAM,YAAY,WAAW,QAC1B,MAAM,QAAQ;AACb,OAAK,IAAI,IAAI,UAAU,KAAK,MAAM;GAChC,GAAI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;GACI,EACb,iBACC,qBAAC,KAAK;EAAO,MAAM;EAAe;EAAa;EAAY;aACxD,YACC,oBAAC;GAAK;GAAO,MAAM;aAChB;IACI,EAER,CAAC,YACA,oBAAC;GAAK;GAAO,MAAM;aAChB,kBAAkB,KAAK;IACnB;GAEG,IAEf"}
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-MHUlEVjU.cjs');
1
+ const require_components = require('./components-BiOh-7_I.cjs');
2
2
 
3
3
  exports.Operations = require_components.Operations;
4
4
  exports.Zod = require_components.Zod;
@@ -1,4 +1,6 @@
1
- import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-CjFerqx4.cjs";
1
+ import { n as PluginZod, o as Operation, r as Schema, s as SchemaObject } from "./types-Cd7g28dR.cjs";
2
+ import { KubbFile } from "@kubb/fabric-core/types";
3
+ import { KubbNode } from "@kubb/react-fabric/types";
2
4
 
3
5
  //#region ../plugin-oas/src/hooks/useOperationManager.d.ts
4
6
 
@@ -26,7 +28,7 @@ type Props$1 = {
26
28
  declare function Operations({
27
29
  name,
28
30
  operations
29
- }: Props$1): any;
31
+ }: Props$1): KubbNode;
30
32
  //#endregion
31
33
  //#region src/components/Zod.d.ts
32
34
  type Props = {
@@ -56,7 +58,7 @@ declare function Zod({
56
58
  wrapOutput,
57
59
  version,
58
60
  emptySchemaType
59
- }: Props): any;
61
+ }: Props): KubbNode;
60
62
  //#endregion
61
63
  export { Operations, Zod };
62
64
  //# sourceMappingURL=components.d.cts.map
@@ -1,4 +1,6 @@
1
- import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-DfzoyARl.js";
1
+ import { n as PluginZod, o as Operation, r as Schema, s as SchemaObject } from "./types-CS916VXJ.js";
2
+ import { KubbFile } from "@kubb/fabric-core/types";
3
+ import { KubbNode } from "@kubb/react-fabric/types";
2
4
 
3
5
  //#region ../plugin-oas/src/hooks/useOperationManager.d.ts
4
6
 
@@ -26,7 +28,7 @@ type Props$1 = {
26
28
  declare function Operations({
27
29
  name,
28
30
  operations
29
- }: Props$1): any;
31
+ }: Props$1): KubbNode;
30
32
  //#endregion
31
33
  //#region src/components/Zod.d.ts
32
34
  type Props = {
@@ -56,7 +58,7 @@ declare function Zod({
56
58
  wrapOutput,
57
59
  version,
58
60
  emptySchemaType
59
- }: Props): any;
61
+ }: Props): KubbNode;
60
62
  //#endregion
61
63
  export { Operations, Zod };
62
64
  //# sourceMappingURL=components.d.ts.map
@@ -1,3 +1,3 @@
1
- import { n as Operations, t as Zod } from "./components-BUkyR7lK.js";
1
+ import { n as Operations, t as Zod } from "./components-DUJ6Xkpc.js";
2
2
 
3
3
  export { Operations, Zod };
@@ -1,4 +1,4 @@
1
- const require_components = require('./components-MHUlEVjU.cjs');
1
+ const require_components = require('./components-BiOh-7_I.cjs');
2
2
  let __kubb_plugin_oas = require("@kubb/plugin-oas");
3
3
  __kubb_plugin_oas = require_components.__toESM(__kubb_plugin_oas);
4
4
  let __kubb_plugin_ts = require("@kubb/plugin-ts");
@@ -11,15 +11,15 @@ let __kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
11
11
  __kubb_plugin_oas_hooks = require_components.__toESM(__kubb_plugin_oas_hooks);
12
12
  let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
13
13
  __kubb_plugin_oas_utils = require_components.__toESM(__kubb_plugin_oas_utils);
14
- let __kubb_react = require("@kubb/react");
15
- __kubb_react = require_components.__toESM(__kubb_react);
16
- let __kubb_react_jsx_runtime = require("@kubb/react/jsx-runtime");
17
- __kubb_react_jsx_runtime = require_components.__toESM(__kubb_react_jsx_runtime);
14
+ let __kubb_react_fabric = require("@kubb/react-fabric");
15
+ __kubb_react_fabric = require_components.__toESM(__kubb_react_fabric);
16
+ let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
17
+ __kubb_react_fabric_jsx_runtime = require_components.__toESM(__kubb_react_fabric_jsx_runtime);
18
18
 
19
19
  //#region src/generators/zodGenerator.tsx
20
20
  const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
21
21
  name: "zod",
22
- Operation({ operation, options }) {
22
+ Operation({ operation, options, instance }) {
23
23
  const { coercion: globalCoercion, inferred, typed, mapper, wrapOutput } = options;
24
24
  const plugin = (0, __kubb_core_hooks.usePlugin)();
25
25
  const mode = (0, __kubb_core_hooks.useMode)();
@@ -30,6 +30,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
30
30
  const file = getFile(operation);
31
31
  const schemas = getSchemas(operation);
32
32
  const schemaGenerator = new __kubb_plugin_oas.SchemaGenerator(options, {
33
+ fabric: instance.context.fabric,
33
34
  oas,
34
35
  plugin,
35
36
  pluginManager,
@@ -74,23 +75,23 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
74
75
  group
75
76
  })
76
77
  };
77
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_plugin_oas_components.Oas.Schema, {
78
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_plugin_oas_components.Oas.Schema, {
78
79
  name,
79
80
  schemaObject,
80
81
  tree,
81
82
  children: [
82
- typed && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
83
+ typed && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
83
84
  isTypeOnly: true,
84
85
  root: file.path,
85
86
  path: type.file.path,
86
87
  name: [type.name]
87
88
  }),
88
- typed && plugin.options.version === "3" && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
89
+ typed && plugin.options.version === "3" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
89
90
  isTypeOnly: true,
90
91
  path: "@kubb/plugin-zod/utils",
91
92
  name: ["ToZod"]
92
93
  }),
93
- imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
94
+ imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
94
95
  root: file.path,
95
96
  path: imp.path,
96
97
  name: imp.name
@@ -99,7 +100,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
99
100
  imp.name,
100
101
  imp.isTypeOnly
101
102
  ].join("-"))),
102
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Zod, {
103
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Zod, {
103
104
  name: zod.name,
104
105
  typeName: typed ? type.name : void 0,
105
106
  inferTypeName: inferred ? zod.inferTypeName : void 0,
@@ -116,7 +117,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
116
117
  ]
117
118
  }, i);
118
119
  };
119
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
120
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
120
121
  baseName: file.baseName,
121
122
  path: file.path,
122
123
  meta: file.meta,
@@ -129,7 +130,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
129
130
  oas,
130
131
  output: plugin.options.output
131
132
  }),
132
- children: [/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
133
+ children: [/* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
133
134
  name: ["z"],
134
135
  path: plugin.options.importPath
135
136
  }), operationSchemas.map(mapOperationSchema)]
@@ -154,7 +155,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
154
155
  }),
155
156
  file: getFile(schema.name, { pluginKey: [__kubb_plugin_ts.pluginTsName] })
156
157
  };
157
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
158
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
158
159
  baseName: zod.file.baseName,
159
160
  path: zod.file.path,
160
161
  meta: zod.file.meta,
@@ -168,22 +169,22 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
168
169
  output
169
170
  }),
170
171
  children: [
171
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
172
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
172
173
  name: ["z"],
173
174
  path: importPath
174
175
  }),
175
- typed && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
176
+ typed && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
176
177
  isTypeOnly: true,
177
178
  root: zod.file.path,
178
179
  path: type.file.path,
179
180
  name: [type.name]
180
181
  }),
181
- typed && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
182
+ typed && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
182
183
  isTypeOnly: true,
183
184
  path: options.version === "4" ? "@kubb/plugin-zod/utils/v4" : "@kubb/plugin-zod/utils",
184
185
  name: ["ToZod"]
185
186
  }),
186
- imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
187
+ imports.map((imp) => /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
187
188
  root: zod.file.path,
188
189
  path: imp.path,
189
190
  name: imp.name
@@ -192,7 +193,7 @@ const zodGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
192
193
  imp.name,
193
194
  imp.isTypeOnly
194
195
  ].join("-"))),
195
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Zod, {
196
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Zod, {
196
197
  name: zod.name,
197
198
  typeName: typed ? type.name : void 0,
198
199
  inferTypeName: inferred ? zod.inferTypeName : void 0,
@@ -235,13 +236,13 @@ const operationsGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
235
236
  ...Object.values(data.responses),
236
237
  ...Object.values(data.parameters)
237
238
  ].filter(Boolean);
238
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
239
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
239
240
  name: names,
240
241
  root: file.path,
241
242
  path: getFile(operation).path
242
243
  }, key);
243
244
  }).filter(Boolean);
244
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
245
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
245
246
  baseName: file.baseName,
246
247
  path: file.path,
247
248
  meta: file.meta,
@@ -255,13 +256,13 @@ const operationsGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
255
256
  output
256
257
  }),
257
258
  children: [
258
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
259
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
259
260
  isTypeOnly: true,
260
261
  name: ["z"],
261
262
  path: importPath
262
263
  }),
263
264
  imports,
264
- /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Operations, {
265
+ /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Operations, {
265
266
  name,
266
267
  operations: transformedOperations
267
268
  })
@@ -283,4 +284,4 @@ Object.defineProperty(exports, 'zodGenerator', {
283
284
  return zodGenerator;
284
285
  }
285
286
  });
286
- //# sourceMappingURL=generators-Bo3q-m_p.cjs.map
287
+ //# sourceMappingURL=generators-B2hD7k6l.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-B2hD7k6l.cjs","names":["SchemaGenerator","options","schemaKeywords","pluginTsName","Oas","File","Zod","File","Operations"],"sources":["../src/generators/zodGenerator.tsx","../src/generators/operationsGenerator.tsx"],"sourcesContent":["import { useMode, usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator, type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } 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({ operation, options, instance }) {\n const { coercion: globalCoercion, inferred, typed, mapper, wrapOutput } = options\n\n const plugin = usePlugin<PluginZod>()\n const mode = useMode()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getFile, getGroup } = useOperationManager()\n const schemaManager = useSchemaManager()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const schemaGenerator = new SchemaGenerator(options, {\n fabric: instance.context.fabric,\n oas,\n plugin,\n pluginManager,\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: schemaObject, description, keysToOmit, ...options }: OperationSchemaType, i: number) => {\n // hack so Params can be optional when needed\n const required = Array.isArray(schemaObject?.required) ? !!schemaObject.required.length : !!schemaObject?.required\n const someDefaults = Object.values(schemaObject.properties || {}).some((property) => Object.hasOwn(property, 'default') && property.default !== undefined)\n const optional = !required && !someDefaults && name.includes('Params')\n\n const tree = [...schemaGenerator.parse({ schemaObject, name }), optional ? { keyword: schemaKeywords.optional } : undefined].filter(Boolean)\n const imports = schemaManager.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 <Oas.Schema key={i} name={name} schemaObject={schemaObject} tree={tree}>\n {typed && <File.Import isTypeOnly root={file.path} path={type.file.path} name={[type.name]} />}\n {typed && plugin.options.version === '3' && <File.Import isTypeOnly path={'@kubb/plugin-zod/utils'} name={['ToZod']} />}\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 rawSchema={schemaObject}\n mapper={mapper}\n coercion={coercion}\n keysToOmit={keysToOmit}\n wrapOutput={wrapOutput}\n version={plugin.options.version}\n emptySchemaType={plugin.options.emptySchemaType}\n />\n </Oas.Schema>\n )\n }\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={['z']} path={plugin.options.importPath} />\n {operationSchemas.map(mapOperationSchema)}\n </File>\n )\n },\n Schema({ schema, options }) {\n const { coercion, inferred, typed, mapper, importPath, wrapOutput, version } = options\n\n const { getName, getFile, getImports } = useSchemaManager()\n const {\n options: { output, emptySchemaType },\n } = usePlugin<PluginZod>()\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 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={['z']} path={importPath} />\n {typed && <File.Import isTypeOnly root={zod.file.path} path={type.file.path} name={[type.name]} />}\n {typed && <File.Import isTypeOnly path={options.version === '4' ? '@kubb/plugin-zod/utils/v4' : '@kubb/plugin-zod/utils'} name={['ToZod']} />}\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 rawSchema={schema.value}\n mapper={mapper}\n coercion={coercion}\n wrapOutput={wrapOutput}\n version={version}\n emptySchemaType={emptySchemaType}\n />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas'\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 }) {\n const {\n key: pluginKey,\n options: { output, importPath },\n } = usePlugin<PluginZod>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getFile, groupSchemasByName } = useOperationManager()\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 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={['z']} path={importPath} />\n {imports}\n <Operations name={name} operations={transformedOperations} />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAa,2DAA+C;CAC1D,MAAM;CACN,UAAU,EAAE,WAAW,SAAS,YAAY;EAC1C,MAAM,EAAE,UAAU,gBAAgB,UAAU,OAAO,QAAQ,eAAe;EAE1E,MAAM,2CAA+B;EACrC,MAAM,uCAAgB;EACtB,MAAM,yDAAkC;EAExC,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,+DAAkC;EAC/D,MAAM,+DAAkC;EAExC,MAAM,OAAO,QAAQ,UAAU;EAC/B,MAAM,UAAU,WAAW,UAAU;EACrC,MAAM,kBAAkB,IAAIA,kCAAgB,SAAS;GACnD,QAAQ,SAAS,QAAQ;GACzB;GACA;GACA;GACA;GACA,UAAU,QAAQ;GACnB,CAAC;EAEF,MAAM,mBAAmB;GAAC,QAAQ;GAAY,QAAQ;GAAa,QAAQ;GAAc,QAAQ;GAAa,QAAQ;GAAS,QAAQ;GAAS,CAC7I,MAAM,CACN,OAAO,QAAQ;EAElB,MAAM,sBAAsB,EAAE,MAAM,QAAQ,cAAc,aAAa,WAAY,GAAGC,aAAgC,MAAc;GAElI,MAAM,WAAW,MAAM,QAAQ,cAAc,SAAS,GAAG,CAAC,CAAC,aAAa,SAAS,SAAS,CAAC,CAAC,cAAc;GAC1G,MAA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