@kubb/plugin-zod 4.4.1 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components-DUJ6Xkpc.js → components-BtBB23cQ.js} +85 -75
- package/dist/components-BtBB23cQ.js.map +1 -0
- package/dist/{components-BiOh-7_I.cjs → components-DIUzzW4k.cjs} +82 -72
- package/dist/components-DIUzzW4k.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +1 -1
- package/dist/{generators-CwEOtNXG.js → generators-9upbJt-4.js} +116 -122
- package/dist/generators-9upbJt-4.js.map +1 -0
- package/dist/{generators-B2hD7k6l.cjs → generators-T3e_E7Uy.cjs} +115 -120
- package/dist/generators-T3e_E7Uy.cjs.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +4 -4
- package/dist/generators.d.ts +4 -4
- package/dist/generators.js +2 -2
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-CS916VXJ.d.ts → types-CQSK_Scm.d.cts} +133 -139
- package/dist/{types-Cd7g28dR.d.cts → types-DcQBOr_-.d.ts} +133 -139
- package/package.json +10 -18
- package/src/components/Zod.tsx +7 -13
- package/src/generators/__snapshots__/createPet.ts +2 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +2 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput.ts +7 -9
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput_entire_.ts +7 -10
- package/src/generators/__snapshots__/createPet_wrapOutput.ts +7 -9
- package/src/generators/__snapshots__/discriminator.ts +20 -28
- package/src/generators/__snapshots__/getPets.ts +3 -3
- package/src/generators/__snapshots__/getPets_wrapOutput.ts +8 -10
- package/src/generators/__snapshots__/petArray.ts +1 -5
- package/src/generators/__snapshots__/queryAllDefaulted.ts +1 -1
- package/src/generators/__snapshots__/queryAllDefaulted_wrapOutput.ts +2 -2
- package/src/generators/__snapshots__/showPetById.ts +3 -3
- package/src/generators/__snapshots__/showPetById_wrapOutput.ts +8 -10
- package/src/generators/index.ts +1 -1
- package/src/generators/operationsGenerator.tsx +5 -5
- package/src/generators/zodGenerator.tsx +24 -21
- package/src/parser.ts +37 -36
- package/src/plugin.ts +15 -0
- package/dist/components-BiOh-7_I.cjs.map +0 -1
- package/dist/components-DUJ6Xkpc.js.map +0 -1
- package/dist/generators-B2hD7k6l.cjs.map +0 -1
- package/dist/generators-CwEOtNXG.js.map +0 -1
- package/dist/utils.cjs +0 -0
- package/dist/utils.d.cts +0 -28
- package/dist/utils.d.ts +0 -28
- package/dist/utils.js +0 -1
- package/src/utils/index.ts +0 -1
- /package/{src/utils → templates}/ToZod.ts +0 -0
|
@@ -231,9 +231,9 @@ const zodKeywordMapper = {
|
|
|
231
231
|
phone: void 0,
|
|
232
232
|
readOnly: void 0,
|
|
233
233
|
writeOnly: void 0,
|
|
234
|
-
ref: (value,
|
|
234
|
+
ref: (value, lazy = true) => {
|
|
235
235
|
if (!value) return;
|
|
236
|
-
return
|
|
236
|
+
return lazy ? `z.lazy(() => ${value})` : value;
|
|
237
237
|
},
|
|
238
238
|
blob: () => "z.instanceof(File)",
|
|
239
239
|
deprecated: void 0,
|
|
@@ -281,7 +281,7 @@ const shouldCoerce = (coercion, type) => {
|
|
|
281
281
|
if (typeof coercion === "boolean") return coercion;
|
|
282
282
|
return !!coercion[type];
|
|
283
283
|
};
|
|
284
|
-
function parse({ parent, current, name, siblings }, options) {
|
|
284
|
+
function parse({ schema, parent, current, name, siblings }, options) {
|
|
285
285
|
const value = zodKeywordMapper[current.keyword];
|
|
286
286
|
const hasMatches = siblings.some((it) => (0, __kubb_plugin_oas.isKeyword)(it, __kubb_plugin_oas.schemaKeywords.matches));
|
|
287
287
|
const hasRef = siblings.some((it) => (0, __kubb_plugin_oas.isKeyword)(it, __kubb_plugin_oas.schemaKeywords.ref));
|
|
@@ -289,36 +289,42 @@ function parse({ parent, current, name, siblings }, options) {
|
|
|
289
289
|
if (!value) return;
|
|
290
290
|
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.union)) {
|
|
291
291
|
if (Array.isArray(current.args) && current.args.length === 1) return parse({
|
|
292
|
+
schema,
|
|
292
293
|
parent,
|
|
293
294
|
name,
|
|
294
295
|
current: current.args[0],
|
|
295
296
|
siblings
|
|
296
297
|
}, options);
|
|
297
298
|
if (Array.isArray(current.args) && !current.args.length) return "";
|
|
298
|
-
return zodKeywordMapper.union(sort(current.args).map((
|
|
299
|
+
return zodKeywordMapper.union(sort(current.args).map((it, _index, siblings$1) => parse({
|
|
300
|
+
schema,
|
|
299
301
|
parent: current,
|
|
300
302
|
name,
|
|
301
|
-
current:
|
|
303
|
+
current: it,
|
|
302
304
|
siblings: siblings$1
|
|
303
305
|
}, options)).filter(Boolean));
|
|
304
306
|
}
|
|
305
307
|
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.and)) {
|
|
306
|
-
const items = sort(current.args).filter((schema) => {
|
|
307
|
-
return ![__kubb_plugin_oas.schemaKeywords.optional, __kubb_plugin_oas.schemaKeywords.describe].includes(schema.keyword);
|
|
308
|
-
}).map((
|
|
308
|
+
const items = sort(current.args).filter((schema$1) => {
|
|
309
|
+
return ![__kubb_plugin_oas.schemaKeywords.optional, __kubb_plugin_oas.schemaKeywords.describe].includes(schema$1.keyword);
|
|
310
|
+
}).map((it, _index, siblings$1) => parse({
|
|
311
|
+
schema,
|
|
309
312
|
parent: current,
|
|
310
313
|
name,
|
|
311
|
-
current:
|
|
314
|
+
current: it,
|
|
312
315
|
siblings: siblings$1
|
|
313
316
|
}, options)).filter(Boolean);
|
|
314
317
|
return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`;
|
|
315
318
|
}
|
|
316
|
-
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.array)) return zodKeywordMapper.array(sort(current.args.items).map((
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.array)) return zodKeywordMapper.array(sort(current.args.items).map((it, _index, siblings$1) => {
|
|
320
|
+
return parse({
|
|
321
|
+
schema,
|
|
322
|
+
parent: current,
|
|
323
|
+
name,
|
|
324
|
+
current: it,
|
|
325
|
+
siblings: siblings$1
|
|
326
|
+
}, options);
|
|
327
|
+
}).filter(Boolean), current.args.min, current.args.max, current.args.unique);
|
|
322
328
|
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.enum)) {
|
|
323
329
|
if (current.args.asConst) {
|
|
324
330
|
if (current.args.items.length === 1) {
|
|
@@ -327,85 +333,97 @@ function parse({ parent, current, name, siblings }, options) {
|
|
|
327
333
|
args: current.args.items[0]
|
|
328
334
|
};
|
|
329
335
|
return parse({
|
|
336
|
+
schema,
|
|
330
337
|
parent: current,
|
|
331
338
|
name,
|
|
332
339
|
current: child,
|
|
333
340
|
siblings: [child]
|
|
334
341
|
}, options);
|
|
335
342
|
}
|
|
336
|
-
return zodKeywordMapper.union(current.args.items.map((schema) => ({
|
|
343
|
+
return zodKeywordMapper.union(current.args.items.map((schema$1) => ({
|
|
337
344
|
keyword: __kubb_plugin_oas.schemaKeywords.const,
|
|
338
|
-
args: schema
|
|
339
|
-
})).map((
|
|
345
|
+
args: schema$1
|
|
346
|
+
})).map((it, _index, siblings$1) => {
|
|
340
347
|
return parse({
|
|
348
|
+
schema,
|
|
341
349
|
parent: current,
|
|
342
350
|
name,
|
|
343
|
-
current:
|
|
351
|
+
current: it,
|
|
344
352
|
siblings: siblings$1
|
|
345
353
|
}, options);
|
|
346
354
|
}).filter(Boolean));
|
|
347
355
|
}
|
|
348
|
-
return zodKeywordMapper.enum(current.args.items.map((schema) => {
|
|
349
|
-
if (schema.format === "boolean") return __kubb_core_transformers.default.stringify(schema.value);
|
|
350
|
-
if (schema.format === "number") return __kubb_core_transformers.default.stringify(schema.value);
|
|
351
|
-
return __kubb_core_transformers.default.stringify(schema.value);
|
|
356
|
+
return zodKeywordMapper.enum(current.args.items.map((schema$1) => {
|
|
357
|
+
if (schema$1.format === "boolean") return __kubb_core_transformers.default.stringify(schema$1.value);
|
|
358
|
+
if (schema$1.format === "number") return __kubb_core_transformers.default.stringify(schema$1.value);
|
|
359
|
+
return __kubb_core_transformers.default.stringify(schema$1.value);
|
|
352
360
|
}));
|
|
353
361
|
}
|
|
354
|
-
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.ref)) return zodKeywordMapper.ref(current.args?.name, options.
|
|
362
|
+
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.ref)) return zodKeywordMapper.ref(current.args?.name, options.lazy ?? name === current.args.name);
|
|
355
363
|
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.object)) {
|
|
356
364
|
const properties = Object.entries(current.args?.properties || {}).filter((item) => {
|
|
357
|
-
const schema = item[1];
|
|
358
|
-
return schema && typeof schema.map === "function";
|
|
359
|
-
}).map(([
|
|
365
|
+
const schema$1 = item[1];
|
|
366
|
+
return schema$1 && typeof schema$1.map === "function";
|
|
367
|
+
}).map(([propertyName, schemas]) => {
|
|
360
368
|
const nameSchema = schemas.find((it) => it.keyword === __kubb_plugin_oas.schemaKeywords.name);
|
|
361
369
|
const isNullable = schemas.some((it) => (0, __kubb_plugin_oas.isKeyword)(it, __kubb_plugin_oas.schemaKeywords.nullable));
|
|
362
370
|
const isNullish = schemas.some((it) => (0, __kubb_plugin_oas.isKeyword)(it, __kubb_plugin_oas.schemaKeywords.nullish));
|
|
363
371
|
const isOptional = schemas.some((it) => (0, __kubb_plugin_oas.isKeyword)(it, __kubb_plugin_oas.schemaKeywords.optional));
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
const hasRef$1 = !!__kubb_plugin_oas.SchemaGenerator.find(schemas, __kubb_plugin_oas.schemaKeywords.ref);
|
|
373
|
+
const mappedName = nameSchema?.args || propertyName;
|
|
374
|
+
if (options.mapper?.[mappedName]) return `"${propertyName}": ${options.mapper?.[mappedName]}`;
|
|
375
|
+
const baseSchemaOutput = sort(schemas).filter((schema$1) => {
|
|
376
|
+
return !(0, __kubb_plugin_oas.isKeyword)(schema$1, __kubb_plugin_oas.schemaKeywords.optional) && !(0, __kubb_plugin_oas.isKeyword)(schema$1, __kubb_plugin_oas.schemaKeywords.nullable) && !(0, __kubb_plugin_oas.isKeyword)(schema$1, __kubb_plugin_oas.schemaKeywords.nullish);
|
|
377
|
+
}).map((it) => {
|
|
378
|
+
const lazy = !(options.version === "4" && hasRef$1);
|
|
379
|
+
return parse({
|
|
380
|
+
schema,
|
|
381
|
+
parent: current,
|
|
382
|
+
name,
|
|
383
|
+
current: it,
|
|
384
|
+
siblings: schemas
|
|
385
|
+
}, {
|
|
386
|
+
...options,
|
|
387
|
+
lazy
|
|
388
|
+
});
|
|
389
|
+
}).filter(Boolean).join("");
|
|
374
390
|
const objectValue = options.wrapOutput ? options.wrapOutput({
|
|
375
391
|
output: baseSchemaOutput,
|
|
376
|
-
schema:
|
|
392
|
+
schema: schema?.properties?.[propertyName]
|
|
377
393
|
}) || baseSchemaOutput : baseSchemaOutput;
|
|
378
|
-
if (options.version === "4" &&
|
|
379
|
-
if (isNullish) return `get "${
|
|
380
|
-
return ${zodKeywordMapper.nullish(
|
|
394
|
+
if (options.version === "4" && hasRef$1) {
|
|
395
|
+
if (isNullish) return `get "${propertyName}"(){
|
|
396
|
+
return ${objectValue}${zodKeywordMapper.nullish()}
|
|
381
397
|
}`;
|
|
382
|
-
if (isOptional) return `get "${
|
|
383
|
-
return ${zodKeywordMapper.optional(
|
|
398
|
+
if (isOptional) return `get "${propertyName}"(){
|
|
399
|
+
return ${objectValue}${zodKeywordMapper.optional()}
|
|
384
400
|
}`;
|
|
385
|
-
if (isNullable) return `get "${
|
|
386
|
-
|
|
401
|
+
if (isNullable) return `get "${propertyName}"(){
|
|
402
|
+
return ${objectValue}${zodKeywordMapper.nullable()}
|
|
387
403
|
}`;
|
|
388
|
-
return `get "${
|
|
404
|
+
return `get "${propertyName}"(){
|
|
389
405
|
return ${objectValue}
|
|
390
406
|
}`;
|
|
391
407
|
}
|
|
392
|
-
if (isNullish) return `"${
|
|
393
|
-
if (isOptional) return `"${
|
|
394
|
-
if (isNullable) return `"${
|
|
395
|
-
return `"${
|
|
408
|
+
if (isNullish) return `"${propertyName}": ${objectValue}${zodKeywordMapper.nullish()}`;
|
|
409
|
+
if (isOptional) return `"${propertyName}": ${zodKeywordMapper.optional(objectValue)}`;
|
|
410
|
+
if (isNullable) return `"${propertyName}": ${zodKeywordMapper.nullable(objectValue)}`;
|
|
411
|
+
return `"${propertyName}": ${objectValue}`;
|
|
396
412
|
}).join(",\n");
|
|
397
|
-
const additionalProperties = current.args?.additionalProperties?.length ? current.args.additionalProperties.map((
|
|
413
|
+
const additionalProperties = current.args?.additionalProperties?.length ? current.args.additionalProperties.map((it, _index, siblings$1) => parse({
|
|
414
|
+
schema,
|
|
398
415
|
parent: current,
|
|
399
416
|
name,
|
|
400
|
-
current:
|
|
417
|
+
current: it,
|
|
401
418
|
siblings: siblings$1
|
|
402
419
|
}, options)).filter(Boolean).join("") : void 0;
|
|
403
420
|
return [zodKeywordMapper.object(properties, current.args?.strict, options.version), additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : void 0].filter(Boolean).join("");
|
|
404
421
|
}
|
|
405
|
-
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.tuple)) return zodKeywordMapper.tuple(current.args.items.map((
|
|
422
|
+
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.tuple)) return zodKeywordMapper.tuple(current.args.items.map((it, _index, siblings$1) => parse({
|
|
423
|
+
schema,
|
|
406
424
|
parent: current,
|
|
407
425
|
name,
|
|
408
|
-
current:
|
|
426
|
+
current: it,
|
|
409
427
|
siblings: siblings$1
|
|
410
428
|
}, options)).filter(Boolean));
|
|
411
429
|
if ((0, __kubb_plugin_oas.isKeyword)(current, __kubb_plugin_oas.schemaKeywords.const)) {
|
|
@@ -464,27 +482,24 @@ function parse({ parent, current, name, siblings }, options) {
|
|
|
464
482
|
|
|
465
483
|
//#endregion
|
|
466
484
|
//#region src/components/Zod.tsx
|
|
467
|
-
function Zod({ name, typeName, tree,
|
|
468
|
-
const hasTuple = !!__kubb_plugin_oas.SchemaGenerator.
|
|
485
|
+
function Zod({ name, typeName, tree, schema, inferTypeName, mapper, coercion, keysToOmit, description, wrapOutput, version, emptySchemaType }) {
|
|
486
|
+
const hasTuple = !!__kubb_plugin_oas.SchemaGenerator.find(tree, __kubb_plugin_oas.schemaKeywords.tuple);
|
|
469
487
|
const schemas = sort(tree).filter((item) => {
|
|
470
488
|
if (hasTuple && ((0, __kubb_plugin_oas.isKeyword)(item, __kubb_plugin_oas.schemaKeywords.min) || (0, __kubb_plugin_oas.isKeyword)(item, __kubb_plugin_oas.schemaKeywords.max))) return false;
|
|
471
489
|
return true;
|
|
472
490
|
});
|
|
473
|
-
const output = schemas.map((schema, index) => {
|
|
491
|
+
const output = schemas.map((schema$1, index) => {
|
|
474
492
|
const siblings = schemas.filter((_, i) => i !== index);
|
|
475
493
|
return parse({
|
|
494
|
+
schema: schema$1,
|
|
476
495
|
parent: void 0,
|
|
477
|
-
current: schema,
|
|
478
|
-
siblings
|
|
496
|
+
current: schema$1,
|
|
497
|
+
siblings,
|
|
498
|
+
name
|
|
479
499
|
}, {
|
|
480
|
-
name,
|
|
481
|
-
keysToOmit,
|
|
482
|
-
typeName,
|
|
483
|
-
description,
|
|
484
500
|
mapper,
|
|
485
501
|
coercion,
|
|
486
502
|
wrapOutput,
|
|
487
|
-
rawSchema,
|
|
488
503
|
version
|
|
489
504
|
});
|
|
490
505
|
}).filter(Boolean).join("");
|
|
@@ -494,26 +509,21 @@ function Zod({ name, typeName, tree, rawSchema, inferTypeName, mapper, coercion,
|
|
|
494
509
|
if (lastSchema && (0, __kubb_plugin_oas.isKeyword)(lastSchema, __kubb_plugin_oas.schemaKeywords.nullable)) if (firstSchema && (0, __kubb_plugin_oas.isKeyword)(firstSchema, __kubb_plugin_oas.schemaKeywords.ref)) if (version === "3") suffix = ".unwrap().schema.unwrap()";
|
|
495
510
|
else suffix = ".unwrap().unwrap()";
|
|
496
511
|
else suffix = ".unwrap()";
|
|
497
|
-
else if (firstSchema && (0, __kubb_plugin_oas.isKeyword)(firstSchema, __kubb_plugin_oas.schemaKeywords.ref) && version === "3") suffix = ".schema";
|
|
498
512
|
const emptyValue = parse({
|
|
513
|
+
schema,
|
|
499
514
|
parent: void 0,
|
|
500
515
|
current: { keyword: __kubb_plugin_oas.schemaKeywords[emptySchemaType] },
|
|
501
516
|
siblings: []
|
|
502
517
|
}, {
|
|
503
|
-
name,
|
|
504
|
-
keysToOmit,
|
|
505
|
-
typeName,
|
|
506
|
-
description,
|
|
507
518
|
mapper,
|
|
508
519
|
coercion,
|
|
509
520
|
wrapOutput,
|
|
510
|
-
rawSchema,
|
|
511
521
|
version
|
|
512
522
|
});
|
|
513
523
|
const baseSchemaOutput = [output, keysToOmit?.length ? `${suffix}.omit({ ${keysToOmit.map((key) => `'${key}': true`).join(",")} })` : void 0].filter(Boolean).join("") || emptyValue || "";
|
|
514
524
|
const wrappedSchemaOutput = wrapOutput ? wrapOutput({
|
|
515
525
|
output: baseSchemaOutput,
|
|
516
|
-
schema
|
|
526
|
+
schema
|
|
517
527
|
}) || baseSchemaOutput : baseSchemaOutput;
|
|
518
528
|
const finalOutput = typeName ? `${wrappedSchemaOutput} as unknown as ${version === "4" ? "z.ZodType" : "ToZod"}<${typeName}>` : wrappedSchemaOutput;
|
|
519
529
|
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, {
|
|
@@ -562,4 +572,4 @@ Object.defineProperty(exports, '__toESM', {
|
|
|
562
572
|
return __toESM;
|
|
563
573
|
}
|
|
564
574
|
});
|
|
565
|
-
//# sourceMappingURL=components-
|
|
575
|
+
//# sourceMappingURL=components-DIUzzW4k.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-DIUzzW4k.cjs","names":["File","Type","Const","transformers","order: string[]","schemaKeywords","transformers","schema","hasRef","SchemaGenerator","value","SchemaGenerator","schemaKeywords","parserZod.sort","parserZod.parse","schema","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'\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, lazy = true) => {\n if (!value) {\n return undefined\n }\n\n return lazy ? `z.lazy(() => ${value})` : 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 lazy?: boolean\n mapper?: Record<string, string>\n coercion?: boolean | { dates?: boolean; strings?: boolean; numbers?: boolean }\n wrapOutput?: (opts: { output: string; schema: any }) => string | undefined\n version: '3' | '4'\n}\n\nexport function parse({ schema, 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({ schema, parent, 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((it, _index, siblings) => parse({ schema, parent: current, name, current: it, 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((it: Schema, _index, siblings) => parse({ schema, parent: current, name, current: it, 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((it, _index, siblings) => {\n return parse({ schema, parent: current, name, current: it, siblings }, options)\n })\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({ schema, parent: current, 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((it, _index, siblings) => {\n return parse({ schema, parent: current, name, current: it, 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.lazy ?? name === current.args.name)\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(([propertyName, 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 const hasRef = !!SchemaGenerator.find(schemas, schemaKeywords.ref)\n\n const mappedName = nameSchema?.args || propertyName\n\n // custom mapper(pluginOptions)\n if (options.mapper?.[mappedName]) {\n return `\"${propertyName}\": ${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((it) => {\n const lazy = !(options.version === '4' && hasRef)\n return parse({ schema, parent: current, name, current: it, siblings: schemas }, { ...options, lazy })\n })\n .filter(Boolean)\n .join('')\n\n const objectValue = options.wrapOutput\n ? options.wrapOutput({ output: baseSchemaOutput, schema: schema?.properties?.[propertyName] }) || baseSchemaOutput\n : baseSchemaOutput\n\n if (options.version === '4' && hasRef) {\n // both optional and nullable\n if (isNullish) {\n return `get \"${propertyName}\"(){\n return ${objectValue}${zodKeywordMapper.nullish()}\n }`\n }\n\n // undefined\n if (isOptional) {\n return `get \"${propertyName}\"(){\n return ${objectValue}${zodKeywordMapper.optional()}\n }`\n }\n\n // null\n if (isNullable) {\n return `get \"${propertyName}\"(){\n return ${objectValue}${zodKeywordMapper.nullable()}\n }`\n }\n\n return `get \"${propertyName}\"(){\n return ${objectValue}\n }`\n }\n\n // both optional and nullable\n if (isNullish) {\n return `\"${propertyName}\": ${objectValue}${zodKeywordMapper.nullish()}`\n }\n\n // undefined\n if (isOptional) {\n return `\"${propertyName}\": ${zodKeywordMapper.optional(objectValue)}`\n }\n\n // null\n if (isNullable) {\n return `\"${propertyName}\": ${zodKeywordMapper.nullable(objectValue)}`\n }\n\n return `\"${propertyName}\": ${objectValue}`\n })\n .join(',\\n')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((it, _index, siblings) => parse({ schema, parent: current, name, current: it, 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((it, _index, siblings) => parse({ schema, parent: current, name, current: it, 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 schema: 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 schema,\n inferTypeName,\n mapper,\n coercion,\n keysToOmit,\n description,\n wrapOutput,\n version,\n emptySchemaType,\n}: Props): KubbNode {\n const hasTuple = !!SchemaGenerator.find(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({ schema, parent: undefined, current: schema, siblings, name }, { mapper, coercion, wrapOutput, version })\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 }\n\n const emptyValue = parserZod.parse(\n {\n schema,\n parent: undefined,\n current: {\n keyword: schemaKeywords[emptySchemaType],\n },\n siblings: [],\n },\n { mapper, coercion, wrapOutput, 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 }) || 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,KAAK,IAAI,IAAI,UAAU,KAAK,OAAQ,EAAE;IACzC,IAAI,UAAU,SAAS,eAAe,IAAI,UAAU,gBAAgB,CAAC;GACvE;AAED,SAAO;IAET,EAAE,CACH;AAED,QACE;EACE,yDAACA,yBAAK;GAAO,MAAK;GAAkB;GAAa;aAC/C,yDAACC;IAAK,MAAK;IAAkB;cAAQ;;;;;;;;;;;;;;;KAcnC;IACU;EACd,yDAACD,yBAAK;GAAO,MAAK;GAAgB;GAAa;aAC7C,yDAACC;IAAK,MAAK;IAAgB;cACxB;KACI;IACK;EACd,yDAACD,yBAAK;GAAa;GAAM;GAAa;aACpC,yDAACE;IAAM;IAAa;IAAM;cACvB,IAAIC,iCAAa,gBAAgB,eAAe,CAAC;KAC5C;IACI;E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,GAAG;CAEX,IAAI,SAAS;CACb,MAAM,cAAc,QAAQ,GAAG,EAAE;CACjC,MAAM,aAAa,QAAQ,GAAG,GAAG;AAEjC,KAAI,+CAAwB,YAAYH,iCAAe,SAAS,CAC9D,KAAI,gDAAyB,aAAaA,iCAAe,IAAI,CAC3D,KAAI,YAAY,IACd,UAAS;KAET,UAAS;KAGX,UAAS;CAIb,MAAM,aAAaE,MACjB;EACE;EACA,QAAQ;EACR,SAAS,EACP,SAASF,iCAAe,kBACzB;EACD,UAAU,EAAE;EACb,EACD;EAAE;EAAQ;EAAU;EAAY;EAAS,CAC1C;CAED,MAAM,mBACJ,CAAC,QAAQ,YAAY,SAAS,GAAG,OAAO,UAAU,WAAW,KAAK,QAAQ,IAAI,IAAI,SAAS,CAAC,KAAK,IAAI,CAAC,OAAO,OAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,GAAG,IAChJ,cACA;CACF,MAAM,sBAAsB,aAAa,WAAW;EAAE,QAAQ;EAAkB;EAAQ,CAAC,IAAI,mBAAmB;CAChH,MAAM,cAAc,WAAW,GAAG,oBAAoB,iBAAiB,YAAY,MAAM,cAAc,QAAQ,GAAG,SAAS,KAAK;AAEhI,QACE,iHACE,yDAACI,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"}
|
package/dist/components.cjs
CHANGED
package/dist/components.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-CQSK_Scm.cjs";
|
|
2
2
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ type Props = {
|
|
|
36
36
|
typeName?: string;
|
|
37
37
|
inferTypeName?: string;
|
|
38
38
|
tree: Array<Schema>;
|
|
39
|
-
|
|
39
|
+
schema: SchemaObject;
|
|
40
40
|
description?: string;
|
|
41
41
|
coercion: PluginZod['resolvedOptions']['coercion'];
|
|
42
42
|
mapper: PluginZod['resolvedOptions']['mapper'];
|
|
@@ -49,7 +49,7 @@ declare function Zod({
|
|
|
49
49
|
name,
|
|
50
50
|
typeName,
|
|
51
51
|
tree,
|
|
52
|
-
|
|
52
|
+
schema,
|
|
53
53
|
inferTypeName,
|
|
54
54
|
mapper,
|
|
55
55
|
coercion,
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as Schema, n as PluginZod, o as Operation, s as SchemaObject } from "./types-DcQBOr_-.js";
|
|
2
2
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ type Props = {
|
|
|
36
36
|
typeName?: string;
|
|
37
37
|
inferTypeName?: string;
|
|
38
38
|
tree: Array<Schema>;
|
|
39
|
-
|
|
39
|
+
schema: SchemaObject;
|
|
40
40
|
description?: string;
|
|
41
41
|
coercion: PluginZod['resolvedOptions']['coercion'];
|
|
42
42
|
mapper: PluginZod['resolvedOptions']['mapper'];
|
|
@@ -49,7 +49,7 @@ declare function Zod({
|
|
|
49
49
|
name,
|
|
50
50
|
typeName,
|
|
51
51
|
tree,
|
|
52
|
-
|
|
52
|
+
schema,
|
|
53
53
|
inferTypeName,
|
|
54
54
|
mapper,
|
|
55
55
|
coercion,
|
package/dist/components.js
CHANGED