@kubb/plugin-zod 3.0.0-alpha.9 → 3.0.0-beta.10

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 (89) hide show
  1. package/README.md +14 -5
  2. package/dist/chunk-37OP7TSO.cjs +354 -0
  3. package/dist/chunk-37OP7TSO.cjs.map +1 -0
  4. package/dist/chunk-OOAUU32I.js +235 -0
  5. package/dist/chunk-OOAUU32I.js.map +1 -0
  6. package/dist/chunk-QEYWJ6VH.cjs +244 -0
  7. package/dist/chunk-QEYWJ6VH.cjs.map +1 -0
  8. package/dist/chunk-SSOO3TXR.js +347 -0
  9. package/dist/chunk-SSOO3TXR.js.map +1 -0
  10. package/dist/components.cjs +11 -10
  11. package/dist/components.cjs.map +1 -1
  12. package/dist/components.d.cts +20 -19
  13. package/dist/components.d.ts +20 -19
  14. package/dist/components.js +2 -14
  15. package/dist/components.js.map +1 -1
  16. package/dist/generators.cjs +17 -0
  17. package/dist/generators.cjs.map +1 -0
  18. package/dist/generators.d.cts +10 -0
  19. package/dist/generators.d.ts +10 -0
  20. package/dist/generators.js +4 -0
  21. package/dist/generators.js.map +1 -0
  22. package/dist/index.cjs +12 -8
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +4 -137
  25. package/dist/index.d.ts +4 -137
  26. package/dist/index.js +3 -12
  27. package/dist/index.js.map +1 -1
  28. package/dist/types-L1fXCZAs.d.cts +100 -0
  29. package/dist/types-L1fXCZAs.d.ts +100 -0
  30. package/package.json +19 -21
  31. package/src/components/Operations.tsx +12 -98
  32. package/src/components/Zod.tsx +68 -0
  33. package/src/components/index.ts +1 -2
  34. package/src/generators/__snapshots__/anyof.ts +3 -0
  35. package/src/generators/__snapshots__/coercion.ts +3 -0
  36. package/src/generators/__snapshots__/coercionDates.ts +3 -0
  37. package/src/generators/__snapshots__/coercionNumbers.ts +3 -0
  38. package/src/generators/__snapshots__/coercionStrings.ts +3 -0
  39. package/src/generators/__snapshots__/createPet.ts +15 -0
  40. package/src/generators/__snapshots__/createPetWithUnknownTypeAny.ts +13 -0
  41. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +15 -0
  42. package/src/generators/__snapshots__/deletePet.ts +3 -0
  43. package/src/generators/__snapshots__/discriminator.ts +3 -0
  44. package/src/generators/__snapshots__/enumBooleanLiteral.ts +3 -0
  45. package/src/generators/__snapshots__/enumNamesType.ts +3 -0
  46. package/src/generators/__snapshots__/enumNullable.ts +3 -0
  47. package/src/generators/__snapshots__/enumSingleLiteral.ts +3 -0
  48. package/src/generators/__snapshots__/enumVarNamesType.ts +3 -0
  49. package/src/generators/__snapshots__/example.ts +3 -0
  50. package/src/generators/__snapshots__/getPets.ts +15 -0
  51. package/src/generators/__snapshots__/mixedValueTypeConst.ts +6 -0
  52. package/src/generators/__snapshots__/nullableString.ts +3 -0
  53. package/src/generators/__snapshots__/nullableStringUuid.ts +3 -0
  54. package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +3 -0
  55. package/src/generators/__snapshots__/numberValueConst.ts +6 -0
  56. package/src/generators/__snapshots__/oneof.ts +3 -0
  57. package/src/generators/__snapshots__/operations.ts +43 -0
  58. package/src/generators/__snapshots__/optionalPetInfer.ts +5 -0
  59. package/src/generators/__snapshots__/optionalPetTyped.ts +3 -0
  60. package/src/generators/__snapshots__/order.ts +3 -0
  61. package/src/generators/__snapshots__/orderDateTyeString.ts +10 -0
  62. package/src/generators/__snapshots__/orderDateTypeFalse.ts +3 -0
  63. package/src/generators/__snapshots__/orderDateTypeString.ts +3 -0
  64. package/src/generators/__snapshots__/pet.ts +3 -0
  65. package/src/generators/__snapshots__/petArray.ts +6 -0
  66. package/src/generators/__snapshots__/petCoercion.ts +3 -0
  67. package/src/generators/__snapshots__/petTupleObject.ts +6 -0
  68. package/src/generators/__snapshots__/petWithMapper.ts +3 -0
  69. package/src/generators/__snapshots__/pets.ts +3 -0
  70. package/src/generators/__snapshots__/recursive.ts +3 -0
  71. package/src/generators/__snapshots__/showPetById.ts +15 -0
  72. package/src/generators/__snapshots__/stringValueConst.ts +6 -0
  73. package/src/generators/__snapshots__/uuidSchema.ts +3 -0
  74. package/src/generators/index.ts +2 -0
  75. package/src/generators/operationsGenerator.tsx +39 -0
  76. package/src/generators/zodGenerator.tsx +121 -0
  77. package/src/parser/index.ts +59 -31
  78. package/src/plugin.ts +30 -39
  79. package/src/types.ts +50 -89
  80. package/dist/Operations-BG26e_MW.d.cts +0 -47
  81. package/dist/Operations-BG26e_MW.d.ts +0 -47
  82. package/dist/chunk-57AHBVYK.cjs +0 -3502
  83. package/dist/chunk-57AHBVYK.cjs.map +0 -1
  84. package/dist/chunk-CUPQVLRZ.js +0 -3502
  85. package/dist/chunk-CUPQVLRZ.js.map +0 -1
  86. package/src/SchemaGenerator.tsx +0 -22
  87. package/src/components/OperationSchema.tsx +0 -60
  88. package/src/components/Schema.tsx +0 -166
  89. package/src/components/__snapshots__/operations.ts +0 -53
@@ -0,0 +1,347 @@
1
+ import { File, Const, Type } from '@kubb/react';
2
+ import transformers2 from '@kubb/core/transformers';
3
+ import { jsxs, Fragment, jsx } from '@kubb/react/jsx-runtime';
4
+ import { isKeyword, schemaKeywords } from '@kubb/plugin-oas';
5
+
6
+ // src/components/Operations.tsx
7
+ function Operations({ name, operations }) {
8
+ const operationsJSON = operations.reduce(
9
+ (prev, acc) => {
10
+ prev[`"${acc.operation.getOperationId()}"`] = acc.data;
11
+ return prev;
12
+ },
13
+ {}
14
+ );
15
+ const pathsJSON = operations.reduce(
16
+ (prev, acc) => {
17
+ prev[`"${acc.operation.path}"`] = {
18
+ ...prev[`"${acc.operation.path}"`] || {},
19
+ [acc.operation.method]: `operations["${acc.operation.getOperationId()}"]`
20
+ };
21
+ return prev;
22
+ },
23
+ {}
24
+ );
25
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Const, { export: true, name, asConst: true, children: `{${transformers2.stringifyObject(operationsJSON)}}` }) }),
27
+ /* @__PURE__ */ jsx(File.Source, { name: "paths", isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Const, { export: true, name: "paths", asConst: true, children: `{${transformers2.stringifyObject(pathsJSON)}}` }) })
28
+ ] });
29
+ }
30
+ var zodKeywordMapper = {
31
+ any: () => "z.any()",
32
+ unknown: () => "z.unknown()",
33
+ number: (coercion, min, max) => {
34
+ return [coercion ? "z.coerce.number()" : "z.number()", min !== void 0 ? `.min(${min})` : void 0, max !== void 0 ? `.max(${max})` : void 0].filter(Boolean).join("");
35
+ },
36
+ integer: (coercion, min, max) => {
37
+ return [
38
+ coercion ? "z.coerce.number().int()" : "z.number().int()",
39
+ min !== void 0 ? `.min(${min})` : void 0,
40
+ max !== void 0 ? `.max(${max})` : void 0
41
+ ].filter(Boolean).join("");
42
+ },
43
+ object: (value) => `z.object({${value}})`,
44
+ string: (coercion, min, max) => {
45
+ return [coercion ? "z.coerce.string()" : "z.string()", min !== void 0 ? `.min(${min})` : void 0, max !== void 0 ? `.max(${max})` : void 0].filter(Boolean).join("");
46
+ },
47
+ boolean: () => "z.boolean()",
48
+ undefined: () => "z.undefined()",
49
+ nullable: () => ".nullable()",
50
+ null: () => "z.null()",
51
+ nullish: () => ".nullish()",
52
+ array: (items = [], min, max) => {
53
+ return [`z.array(${items?.join("")})`, min !== void 0 ? `.min(${min})` : void 0, max !== void 0 ? `.max(${max})` : void 0].filter(Boolean).join("");
54
+ },
55
+ tuple: (items = []) => `z.tuple([${items?.join(", ")}])`,
56
+ enum: (items = []) => `z.enum([${items?.join(", ")}])`,
57
+ union: (items = []) => `z.union([${items?.join(", ")}])`,
58
+ const: (value) => `z.literal(${value ?? ""})`,
59
+ /**
60
+ * ISO 8601
61
+ */
62
+ datetime: (offset = false, local = false) => {
63
+ if (offset) {
64
+ return `z.string().datetime({ offset: ${offset} })`;
65
+ }
66
+ if (local) {
67
+ return `z.string().datetime({ local: ${local} })`;
68
+ }
69
+ return "z.string().datetime()";
70
+ },
71
+ /**
72
+ * Type `'date'` Date
73
+ * Type `'string'` ISO date format (YYYY-MM-DD)
74
+ * @default ISO date format (YYYY-MM-DD)
75
+ */
76
+ date: (type = "string", coercion) => {
77
+ if (type === "string") {
78
+ return "z.string().date()";
79
+ }
80
+ if (coercion) {
81
+ return "z.coerce.date()";
82
+ }
83
+ return "z.date()";
84
+ },
85
+ /**
86
+ * Type `'date'` Date
87
+ * Type `'string'` ISO time format (HH:mm:ss[.SSSSSS])
88
+ * @default ISO time format (HH:mm:ss[.SSSSSS])
89
+ */
90
+ time: (type = "string", coercion) => {
91
+ if (type === "string") {
92
+ return "z.string().time()";
93
+ }
94
+ if (coercion) {
95
+ return "z.coerce.date()";
96
+ }
97
+ return "z.date()";
98
+ },
99
+ uuid: () => ".uuid()",
100
+ url: () => ".url()",
101
+ strict: () => ".strict()",
102
+ default: (value) => `.default(${value ?? ""})`,
103
+ and: (items = []) => items?.map((item) => `.and(${item})`).join(""),
104
+ describe: (value = "") => `.describe(${value})`,
105
+ min: (value) => `.min(${value ?? ""})`,
106
+ max: (value) => `.max(${value ?? ""})`,
107
+ optional: () => ".optional()",
108
+ matches: (value = "") => `.regex(${value})`,
109
+ email: () => ".email()",
110
+ firstName: void 0,
111
+ lastName: void 0,
112
+ password: void 0,
113
+ phone: void 0,
114
+ readOnly: void 0,
115
+ writeOnly: void 0,
116
+ ref: (value) => value ? `z.lazy(() => ${value})` : void 0,
117
+ blob: () => "z.string()",
118
+ deprecated: void 0,
119
+ example: void 0,
120
+ schema: void 0,
121
+ catchall: (value) => value ? `.catchall(${value})` : void 0,
122
+ name: void 0
123
+ };
124
+ function sort(items) {
125
+ const order = [
126
+ schemaKeywords.string,
127
+ schemaKeywords.datetime,
128
+ schemaKeywords.date,
129
+ schemaKeywords.time,
130
+ schemaKeywords.tuple,
131
+ schemaKeywords.number,
132
+ schemaKeywords.object,
133
+ schemaKeywords.enum,
134
+ schemaKeywords.url,
135
+ schemaKeywords.email,
136
+ schemaKeywords.firstName,
137
+ schemaKeywords.lastName,
138
+ schemaKeywords.password,
139
+ schemaKeywords.matches,
140
+ schemaKeywords.uuid,
141
+ schemaKeywords.min,
142
+ schemaKeywords.max,
143
+ schemaKeywords.default,
144
+ schemaKeywords.describe,
145
+ schemaKeywords.optional,
146
+ schemaKeywords.nullable,
147
+ schemaKeywords.nullish,
148
+ schemaKeywords.null
149
+ ];
150
+ if (!items) {
151
+ return [];
152
+ }
153
+ return transformers2.orderBy(items, [(v) => order.indexOf(v.keyword)], ["asc"]);
154
+ }
155
+ var shouldCoerce = (coercion, type) => {
156
+ if (coercion === void 0) {
157
+ return false;
158
+ }
159
+ if (typeof coercion === "boolean") {
160
+ return coercion;
161
+ }
162
+ return !!coercion[type];
163
+ };
164
+ function parse({ parent, current, siblings }, options) {
165
+ const value = zodKeywordMapper[current.keyword];
166
+ if (!value) {
167
+ return void 0;
168
+ }
169
+ if (isKeyword(current, schemaKeywords.union)) {
170
+ if (Array.isArray(current.args) && current.args.length === 1) {
171
+ return parse({ parent, current: current.args[0], siblings }, options);
172
+ }
173
+ if (Array.isArray(current.args) && !current.args.length) {
174
+ return "";
175
+ }
176
+ return zodKeywordMapper.union(
177
+ sort(current.args).map((schema, _index, siblings2) => parse({ parent: current, current: schema, siblings: siblings2 }, options)).filter(Boolean)
178
+ );
179
+ }
180
+ if (isKeyword(current, schemaKeywords.and)) {
181
+ const items = sort(current.args).filter((schema) => {
182
+ return ![schemaKeywords.optional, schemaKeywords.describe].includes(schema.keyword);
183
+ }).map((schema, _index, siblings2) => parse({ parent: current, current: schema, siblings: siblings2 }, options)).filter(Boolean);
184
+ return `${items.slice(0, 1)}${zodKeywordMapper.and(items.slice(1))}`;
185
+ }
186
+ if (isKeyword(current, schemaKeywords.array)) {
187
+ return zodKeywordMapper.array(
188
+ sort(current.args.items).map((schemas, _index, siblings2) => parse({ parent: current, current: schemas, siblings: siblings2 }, options)).filter(Boolean),
189
+ current.args.min,
190
+ current.args.max
191
+ );
192
+ }
193
+ if (isKeyword(current, schemaKeywords.enum)) {
194
+ if (current.args.asConst) {
195
+ if (current.args.items.length === 1) {
196
+ const child = {
197
+ keyword: schemaKeywords.const,
198
+ args: current.args.items[0]
199
+ };
200
+ return parse({ parent: current, current: child, siblings: [child] }, options);
201
+ }
202
+ return zodKeywordMapper.union(
203
+ current.args.items.map((schema) => ({
204
+ keyword: schemaKeywords.const,
205
+ args: schema
206
+ })).map((schema, _index, siblings2) => {
207
+ return parse({ parent: current, current: schema, siblings: siblings2 }, options);
208
+ }).filter(Boolean)
209
+ );
210
+ }
211
+ return zodKeywordMapper.enum(
212
+ current.args.items.map((schema) => {
213
+ if (schema.format === "boolean") {
214
+ return transformers2.stringify(schema.value);
215
+ }
216
+ if (schema.format === "number") {
217
+ return transformers2.stringify(schema.value);
218
+ }
219
+ return transformers2.stringify(schema.value);
220
+ })
221
+ );
222
+ }
223
+ if (isKeyword(current, schemaKeywords.ref)) {
224
+ return zodKeywordMapper.ref(current.args?.name);
225
+ }
226
+ if (isKeyword(current, schemaKeywords.object)) {
227
+ const properties = Object.entries(current.args?.properties || {}).filter((item) => {
228
+ const schema = item[1];
229
+ return schema && typeof schema.map === "function";
230
+ }).map(([name, schemas]) => {
231
+ const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name);
232
+ const mappedName = nameSchema?.args || name;
233
+ if (options.mapper?.[mappedName]) {
234
+ return `"${name}": ${options.mapper?.[mappedName]}`;
235
+ }
236
+ return `"${name}": ${sort(schemas).map((schema, array, siblings2) => {
237
+ return parse({ parent: current, current: schema, siblings: siblings2 }, options);
238
+ }).filter(Boolean).join("")}`;
239
+ }).join(",");
240
+ const additionalProperties = current.args?.additionalProperties?.length ? current.args.additionalProperties.map((schema, _index, siblings2) => parse({ parent: current, current: schema, siblings: siblings2 }, options)).filter(Boolean).join("") : void 0;
241
+ const text = [
242
+ zodKeywordMapper.object(properties),
243
+ current.args?.strict ? zodKeywordMapper.strict() : void 0,
244
+ additionalProperties ? zodKeywordMapper.catchall(additionalProperties) : void 0
245
+ ].filter(Boolean);
246
+ return text.join("");
247
+ }
248
+ if (isKeyword(current, schemaKeywords.tuple)) {
249
+ return zodKeywordMapper.tuple(
250
+ current.args.items.map((schema, _index, siblings2) => parse({ parent: current, current: schema, siblings: siblings2 }, options)).filter(Boolean)
251
+ );
252
+ }
253
+ if (isKeyword(current, schemaKeywords.const)) {
254
+ if (current.args.format === "number" && current.args.value !== void 0) {
255
+ return zodKeywordMapper.const(Number.parseInt(current.args.value?.toString()));
256
+ }
257
+ if (current.args.format === "boolean" && current.args.value !== void 0) {
258
+ return zodKeywordMapper.const(current.args.value);
259
+ }
260
+ return zodKeywordMapper.const(transformers2.stringify(current.args.value));
261
+ }
262
+ if (isKeyword(current, schemaKeywords.matches)) {
263
+ if (current.args) {
264
+ return zodKeywordMapper.matches(transformers2.toRegExpString(current.args));
265
+ }
266
+ }
267
+ if (isKeyword(current, schemaKeywords.default)) {
268
+ if (current.args) {
269
+ return zodKeywordMapper.default(current.args);
270
+ }
271
+ }
272
+ if (isKeyword(current, schemaKeywords.describe)) {
273
+ if (current.args) {
274
+ return zodKeywordMapper.describe(transformers2.stringify(current.args.toString()));
275
+ }
276
+ }
277
+ if (isKeyword(current, schemaKeywords.string)) {
278
+ return zodKeywordMapper.string(shouldCoerce(options.coercion, "strings"));
279
+ }
280
+ if (isKeyword(current, schemaKeywords.number)) {
281
+ return zodKeywordMapper.number(shouldCoerce(options.coercion, "numbers"));
282
+ }
283
+ if (isKeyword(current, schemaKeywords.integer)) {
284
+ return zodKeywordMapper.integer(shouldCoerce(options.coercion, "numbers"));
285
+ }
286
+ if (isKeyword(current, schemaKeywords.min)) {
287
+ return zodKeywordMapper.min(current.args);
288
+ }
289
+ if (isKeyword(current, schemaKeywords.max)) {
290
+ return zodKeywordMapper.max(current.args);
291
+ }
292
+ if (isKeyword(current, schemaKeywords.datetime)) {
293
+ return zodKeywordMapper.datetime(current.args.offset, current.args.local);
294
+ }
295
+ if (isKeyword(current, schemaKeywords.date)) {
296
+ return zodKeywordMapper.date(current.args.type, shouldCoerce(options.coercion, "dates"));
297
+ }
298
+ if (isKeyword(current, schemaKeywords.time)) {
299
+ return zodKeywordMapper.time(current.args.type, shouldCoerce(options.coercion, "dates"));
300
+ }
301
+ if (current.keyword in zodKeywordMapper && "args" in current) {
302
+ const value2 = zodKeywordMapper[current.keyword];
303
+ return value2(current.args);
304
+ }
305
+ if (isKeyword(current, schemaKeywords.optional)) {
306
+ if (siblings.some((schema) => isKeyword(schema, schemaKeywords.default))) return "";
307
+ return value();
308
+ }
309
+ if (current.keyword in zodKeywordMapper) {
310
+ return value();
311
+ }
312
+ return void 0;
313
+ }
314
+ function Zod({ name, typeName, tree, inferTypeName, mapper, coercion, keysToOmit, description }) {
315
+ const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple));
316
+ const output = sort(tree).filter((item) => {
317
+ if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {
318
+ return false;
319
+ }
320
+ return true;
321
+ }).map(
322
+ (schema, _index, siblings) => parse({ parent: void 0, current: schema, siblings }, { name, keysToOmit, typeName, description, mapper, coercion })
323
+ ).filter(Boolean).join("");
324
+ const suffix = output.endsWith(".nullable()") ? ".unwrap().and" : ".and";
325
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
326
+ /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(
327
+ Const,
328
+ {
329
+ export: true,
330
+ name,
331
+ JSDoc: {
332
+ comments: [description ? `@description ${transformers2.jsStringEscape(description)}` : void 0].filter(Boolean)
333
+ },
334
+ children: [
335
+ output,
336
+ keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(",")} }))` : void 0,
337
+ typeName ? ` as z.ZodType<${typeName}>` : ""
338
+ ].filter(Boolean).join("") || "z.undefined()"
339
+ }
340
+ ) }),
341
+ inferTypeName && /* @__PURE__ */ jsx(File.Source, { name: inferTypeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { export: true, name: inferTypeName, children: `z.infer<typeof ${name}>` }) })
342
+ ] });
343
+ }
344
+
345
+ export { Operations, Zod };
346
+ //# sourceMappingURL=chunk-SSOO3TXR.js.map
347
+ //# sourceMappingURL=chunk-SSOO3TXR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Operations.tsx","../src/parser/index.ts","../src/components/Zod.tsx"],"names":["transformers","siblings","value","isKeyword","schemaKeywords","jsxs","Fragment","jsx","File","Const"],"mappings":";;;;;;AAYO,SAAS,UAAW,CAAA,EAAE,IAAM,EAAA,UAAA,EAA+B,EAAA;AAChE,EAAA,MAAM,iBAAiB,UAAW,CAAA,MAAA;AAAA,IAChC,CAAC,MAAM,GAAQ,KAAA;AACb,MAAA,IAAA,CAAK,IAAI,GAAI,CAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA,CAAG,IAAI,GAAI,CAAA,IAAA;AAElD,MAAO,OAAA,IAAA;AAAA,KACT;AAAA,IACA;AAAC,GACH;AAEA,EAAA,MAAM,YAAY,UAAW,CAAA,MAAA;AAAA,IAC3B,CAAC,MAAM,GAAQ,KAAA;AACb,MAAA,IAAA,CAAK,CAAI,CAAA,EAAA,GAAA,CAAI,SAAU,CAAA,IAAI,GAAG,CAAI,GAAA;AAAA,QAChC,GAAI,KAAK,CAAI,CAAA,EAAA,GAAA,CAAI,UAAU,IAAI,CAAA,CAAA,CAAG,KAAM,EAAC;AAAA,QACzC,CAAC,IAAI,SAAU,CAAA,MAAM,GAAG,CAAe,YAAA,EAAA,GAAA,CAAI,SAAU,CAAA,cAAA,EAAgB,CAAA,EAAA;AAAA,OACvE;AAEA,MAAO,OAAA,IAAA;AAAA,KACT;AAAA,IACA;AAAC,GACH;AAEA,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EA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AAO,CAAA,OAAO,CACd,CAAA,IAAA,CAAK,EAAE,CAAK,IAAA;AAAA;AAAA,KAEnB,EAAA,CAAA;AAAA,IACC,aAAA,oBACCO,GAAAA,CAACC,IAAK,CAAA,MAAA,EAAL,EAAY,IAAM,EAAA,aAAA,EAAe,YAAY,EAAA,IAAA,EAAC,WAAW,EAAA,IAAA,EAAC,YAAU,IACnE,EAAA,QAAA,kBAAAD,GAAC,CAAA,IAAA,EAAA,EAAK,MAAM,EAAA,IAAA,EAAC,MAAM,aAChB,EAAA,QAAA,EAAA,CAAA,eAAA,EAAkB,IAAI,CAAA,CAAA,CAAA,EACzB,CACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ","file":"chunk-SSOO3TXR.js","sourcesContent":["import type { SchemaNames } from '@kubb/plugin-oas/hooks'\nimport { Const, File } from '@kubb/react'\n\nimport transformers from '@kubb/core/transformers'\nimport type { HttpMethod, Operation } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/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={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, { createJSDocBlockText } from '@kubb/core/transformers'\nimport { type SchemaKeywordMapper, type SchemaTree, isKeyword, schemaKeywords } from '@kubb/plugin-oas'\n\nimport type { Schema, SchemaKeywordBase, SchemaMapper } from '@kubb/plugin-oas'\n\nconst zodKeywordMapper = {\n any: () => 'z.any()',\n unknown: () => 'z.unknown()',\n number: (coercion?: boolean, min?: number, max?: number) => {\n return [coercion ? 'z.coerce.number()' : 'z.number()', min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\n .filter(Boolean)\n .join('')\n },\n integer: (coercion?: boolean, min?: number, max?: number) => {\n return [\n coercion ? 'z.coerce.number().int()' : 'z.number().int()',\n min !== undefined ? `.min(${min})` : undefined,\n max !== undefined ? `.max(${max})` : undefined,\n ]\n .filter(Boolean)\n .join('')\n },\n object: (value?: string) => `z.object({${value}})`,\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 boolean: () => 'z.boolean()',\n undefined: () => 'z.undefined()',\n nullable: () => '.nullable()',\n null: () => 'z.null()',\n nullish: () => '.nullish()',\n array: (items: string[] = [], min?: number, max?: number) => {\n return [`z.array(${items?.join('')})`, min !== undefined ? `.min(${min})` : undefined, max !== undefined ? `.max(${max})` : undefined]\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) => {\n if (offset) {\n return `z.string().datetime({ offset: ${offset} })`\n }\n\n if (local) {\n return `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) => {\n if (type === 'string') {\n return '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) => {\n if (type === 'string') {\n return 'z.string().time()'\n }\n\n if (coercion) {\n return 'z.coerce.date()'\n }\n\n return 'z.date()'\n },\n uuid: () => '.uuid()',\n url: () => '.url()',\n strict: () => '.strict()',\n default: (value?: string | number | true) => `.default(${value ?? ''})`,\n and: (items: string[] = []) => items?.map((item) => `.and(${item})`).join(''),\n describe: (value = '') => `.describe(${value})`,\n min: (value?: number) => `.min(${value ?? ''})`,\n max: (value?: number) => `.max(${value ?? ''})`,\n optional: () => '.optional()',\n matches: (value = '') => `.regex(${value})`,\n email: () => '.email()',\n firstName: undefined,\n lastName: undefined,\n password: undefined,\n phone: undefined,\n readOnly: undefined,\n writeOnly: undefined,\n ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined),\n blob: () => 'z.string()',\n deprecated: undefined,\n example: undefined,\n schema: undefined,\n catchall: (value?: string) => (value ? `.catchall(${value})` : undefined),\n name: 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.min,\n schemaKeywords.max,\n schemaKeywords.default,\n schemaKeywords.describe,\n schemaKeywords.optional,\n schemaKeywords.nullable,\n schemaKeywords.nullish,\n schemaKeywords.null,\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}\n\nexport function parse({ parent, current, siblings }: SchemaTree, options: ParserOptions): string | undefined {\n const value = zodKeywordMapper[current.keyword as keyof typeof zodKeywordMapper]\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, 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, 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, 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, current: schemas, siblings }, options))\n .filter(Boolean),\n current.args.min,\n current.args.max,\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, 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, 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)\n }\n\n if (isKeyword(current, schemaKeywords.object)) {\n const properties = Object.entries(current.args?.properties || {})\n .filter((item) => {\n const schema = item[1]\n return schema && typeof schema.map === 'function'\n })\n .map(([name, schemas]) => {\n const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name) as SchemaKeywordMapper['name']\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 return `\"${name}\": ${sort(schemas)\n .map((schema, array, siblings) => {\n return parse({ parent: current, current: schema, siblings }, options)\n })\n .filter(Boolean)\n .join('')}`\n })\n .join(',')\n\n const additionalProperties = current.args?.additionalProperties?.length\n ? current.args.additionalProperties\n .map((schema, _index, siblings) => parse({ parent: current, current: schema, siblings }, options))\n .filter(Boolean)\n .join('')\n : undefined\n\n const text = [\n zodKeywordMapper.object(properties),\n current.args?.strict ? zodKeywordMapper.strict() : undefined,\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, 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.parseInt(current.args.value?.toString()))\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))\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 return zodKeywordMapper.string(shouldCoerce(options.coercion, 'strings'))\n }\n\n if (isKeyword(current, schemaKeywords.number)) {\n return zodKeywordMapper.number(shouldCoerce(options.coercion, 'numbers'))\n }\n\n if (isKeyword(current, schemaKeywords.integer)) {\n return zodKeywordMapper.integer(shouldCoerce(options.coercion, 'numbers'))\n }\n\n if (isKeyword(current, schemaKeywords.min)) {\n return zodKeywordMapper.min(current.args)\n }\n if (isKeyword(current, schemaKeywords.max)) {\n return zodKeywordMapper.max(current.args)\n }\n\n if (isKeyword(current, schemaKeywords.datetime)) {\n return zodKeywordMapper.datetime(current.args.offset, current.args.local)\n }\n\n if (isKeyword(current, schemaKeywords.date)) {\n return zodKeywordMapper.date(current.args.type, shouldCoerce(options.coercion, 'dates'))\n }\n\n if (isKeyword(current, schemaKeywords.time)) {\n return zodKeywordMapper.time(current.args.type, shouldCoerce(options.coercion, 'dates'))\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 (isKeyword(current, schemaKeywords.optional)) {\n if (siblings.some((schema) => isKeyword(schema, schemaKeywords.default))) return ''\n\n return value()\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 Schema, schemaKeywords } from '@kubb/plugin-oas'\nimport { isKeyword } from '@kubb/plugin-oas'\nimport { Const, File, Type } from '@kubb/react'\nimport type { KubbNode } from '@kubb/react/types'\nimport * as parserZod from '../parser/index.ts'\nimport type { PluginZod } from '../types.ts'\n\ntype Props = {\n name: string\n typeName?: string\n inferTypeName?: string\n tree: Array<Schema>\n description?: string\n coercion: PluginZod['resolvedOptions']['coercion']\n mapper: PluginZod['resolvedOptions']['mapper']\n keysToOmit?: string[]\n}\n\nexport function Zod({ name, typeName, tree, inferTypeName, mapper, coercion, keysToOmit, description }: Props): KubbNode {\n const hasTuple = tree.some((item) => isKeyword(item, schemaKeywords.tuple))\n\n const output = parserZod\n .sort(tree)\n .filter((item) => {\n if (hasTuple && (isKeyword(item, schemaKeywords.min) || isKeyword(item, schemaKeywords.max))) {\n return false\n }\n\n return true\n })\n .map((schema, _index, siblings) =>\n parserZod.parse({ parent: undefined, current: schema, siblings }, { name, keysToOmit, typeName: typeName, description, mapper, coercion }),\n )\n .filter(Boolean)\n .join('')\n\n const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and'\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 {[\n output,\n keysToOmit?.length ? `${suffix}(z.object({ ${keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` : undefined,\n typeName ? ` as z.ZodType<${typeName}>` : '',\n ]\n .filter(Boolean)\n .join('') || 'z.undefined()'}\n </Const>\n </File.Source>\n {inferTypeName && (\n <File.Source name={inferTypeName} isExportable isIndexable isTypeOnly>\n <Type export name={inferTypeName}>\n {`z.infer<typeof ${name}>`}\n </Type>\n </File.Source>\n )}\n </>\n )\n}\n"]}
@@ -1,15 +1,16 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ 'use strict';
2
2
 
3
+ var chunk37OP7TSO_cjs = require('./chunk-37OP7TSO.cjs');
3
4
 
4
5
 
5
6
 
6
- var _chunk57AHBVYKcjs = require('./chunk-57AHBVYK.cjs');
7
-
8
- // src/components/index.ts
9
- _chunk57AHBVYKcjs.init_cjs_shims.call(void 0, );
10
-
11
-
12
-
13
-
14
- exports.OperationSchema = _chunk57AHBVYKcjs.OperationSchema; exports.Operations = _chunk57AHBVYKcjs.Operations; exports.Schema = _chunk57AHBVYKcjs.Schema;
7
+ Object.defineProperty(exports, "Operations", {
8
+ enumerable: true,
9
+ get: function () { return chunk37OP7TSO_cjs.Operations; }
10
+ });
11
+ Object.defineProperty(exports, "Zod", {
12
+ enumerable: true,
13
+ get: function () { return chunk37OP7TSO_cjs.Zod; }
14
+ });
15
+ //# sourceMappingURL=components.cjs.map
15
16
  //# sourceMappingURL=components.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-zod/dist/components.cjs","../src/components/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACPA,8CAAA,CAAA;ADSA;AACE;AACA;AACA;AACF,0JAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-zod/dist/components.cjs","sourcesContent":[null,"export { OperationSchema } from './OperationSchema.tsx'\nexport { Operations } from './Operations.tsx'\nexport { Schema } from './Schema.tsx'\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"components.cjs"}
@@ -1,28 +1,29 @@
1
- import { ReactNode } from 'react';
2
- export { O as Operations } from './Operations-BG26e_MW.cjs';
3
- import '@kubb/oas';
4
- import '@kubb/react/types';
1
+ import { SchemaNames } from '@kubb/plugin-oas/hooks';
2
+ import { Operation } from '@kubb/oas';
3
+ import { KubbNode } from '@kubb/react/types';
4
+ import { Schema } from '@kubb/plugin-oas';
5
+ import { P as PluginZod } from './types-L1fXCZAs.cjs';
6
+ import '@kubb/core';
5
7
 
6
8
  type Props$1 = {
7
- description?: string;
8
- keysToOmit?: string[];
9
+ name: string;
10
+ operations: Array<{
11
+ operation: Operation;
12
+ data: SchemaNames;
13
+ }>;
9
14
  };
10
- declare function OperationSchema({ description, keysToOmit }: Props$1): ReactNode;
11
- declare namespace OperationSchema {
12
- var File: ({}: FileProps$1) => ReactNode;
13
- }
14
- type FileProps$1 = {};
15
+ declare function Operations({ name, operations }: Props$1): KubbNode;
15
16
 
16
17
  type Props = {
18
+ name: string;
19
+ typeName?: string;
20
+ inferTypeName?: string;
21
+ tree: Array<Schema>;
17
22
  description?: string;
18
- withTypeAnnotation?: boolean;
23
+ coercion: PluginZod['resolvedOptions']['coercion'];
24
+ mapper: PluginZod['resolvedOptions']['mapper'];
19
25
  keysToOmit?: string[];
20
26
  };
21
- declare function Schema(props: Props): ReactNode;
22
- declare namespace Schema {
23
- var File: ({}: FileProps) => ReactNode;
24
- var Imports: () => ReactNode;
25
- }
26
- type FileProps = {};
27
+ declare function Zod({ name, typeName, tree, inferTypeName, mapper, coercion, keysToOmit, description }: Props): KubbNode;
27
28
 
28
- export { OperationSchema, Schema };
29
+ export { Operations, Zod };
@@ -1,28 +1,29 @@
1
- import { ReactNode } from 'react';
2
- export { O as Operations } from './Operations-BG26e_MW.js';
3
- import '@kubb/oas';
4
- import '@kubb/react/types';
1
+ import { SchemaNames } from '@kubb/plugin-oas/hooks';
2
+ import { Operation } from '@kubb/oas';
3
+ import { KubbNode } from '@kubb/react/types';
4
+ import { Schema } from '@kubb/plugin-oas';
5
+ import { P as PluginZod } from './types-L1fXCZAs.js';
6
+ import '@kubb/core';
5
7
 
6
8
  type Props$1 = {
7
- description?: string;
8
- keysToOmit?: string[];
9
+ name: string;
10
+ operations: Array<{
11
+ operation: Operation;
12
+ data: SchemaNames;
13
+ }>;
9
14
  };
10
- declare function OperationSchema({ description, keysToOmit }: Props$1): ReactNode;
11
- declare namespace OperationSchema {
12
- var File: ({}: FileProps$1) => ReactNode;
13
- }
14
- type FileProps$1 = {};
15
+ declare function Operations({ name, operations }: Props$1): KubbNode;
15
16
 
16
17
  type Props = {
18
+ name: string;
19
+ typeName?: string;
20
+ inferTypeName?: string;
21
+ tree: Array<Schema>;
17
22
  description?: string;
18
- withTypeAnnotation?: boolean;
23
+ coercion: PluginZod['resolvedOptions']['coercion'];
24
+ mapper: PluginZod['resolvedOptions']['mapper'];
19
25
  keysToOmit?: string[];
20
26
  };
21
- declare function Schema(props: Props): ReactNode;
22
- declare namespace Schema {
23
- var File: ({}: FileProps) => ReactNode;
24
- var Imports: () => ReactNode;
25
- }
26
- type FileProps = {};
27
+ declare function Zod({ name, typeName, tree, inferTypeName, mapper, coercion, keysToOmit, description }: Props): KubbNode;
27
28
 
28
- export { OperationSchema, Schema };
29
+ export { Operations, Zod };
@@ -1,15 +1,3 @@
1
- import {
2
- OperationSchema,
3
- Operations,
4
- Schema,
5
- init_esm_shims
6
- } from "./chunk-CUPQVLRZ.js";
7
-
8
- // src/components/index.ts
9
- init_esm_shims();
10
- export {
11
- OperationSchema,
12
- Operations,
13
- Schema
14
- };
1
+ export { Operations, Zod } from './chunk-SSOO3TXR.js';
2
+ //# sourceMappingURL=components.js.map
15
3
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/index.ts"],"sourcesContent":["export { OperationSchema } from './OperationSchema.tsx'\nexport { Operations } from './Operations.tsx'\nexport { Schema } from './Schema.tsx'\n"],"mappings":";;;;;;;;AAAA;","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var chunkQEYWJ6VH_cjs = require('./chunk-QEYWJ6VH.cjs');
4
+ require('./chunk-37OP7TSO.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "operationsGenerator", {
9
+ enumerable: true,
10
+ get: function () { return chunkQEYWJ6VH_cjs.operationsGenerator; }
11
+ });
12
+ Object.defineProperty(exports, "zodGenerator", {
13
+ enumerable: true,
14
+ get: function () { return chunkQEYWJ6VH_cjs.zodGenerator; }
15
+ });
16
+ //# sourceMappingURL=generators.cjs.map
17
+ //# sourceMappingURL=generators.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
@@ -0,0 +1,10 @@
1
+ import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
+ import { P as PluginZod } from './types-L1fXCZAs.cjs';
3
+ import '@kubb/core';
4
+ import '@kubb/oas';
5
+
6
+ declare const zodGenerator: _kubb_plugin_oas.Generator<PluginZod>;
7
+
8
+ declare const operationsGenerator: _kubb_plugin_oas.Generator<PluginZod>;
9
+
10
+ export { operationsGenerator, zodGenerator };
@@ -0,0 +1,10 @@
1
+ import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
+ import { P as PluginZod } from './types-L1fXCZAs.js';
3
+ import '@kubb/core';
4
+ import '@kubb/oas';
5
+
6
+ declare const zodGenerator: _kubb_plugin_oas.Generator<PluginZod>;
7
+
8
+ declare const operationsGenerator: _kubb_plugin_oas.Generator<PluginZod>;
9
+
10
+ export { operationsGenerator, zodGenerator };
@@ -0,0 +1,4 @@
1
+ export { operationsGenerator, zodGenerator } from './chunk-OOAUU32I.js';
2
+ import './chunk-SSOO3TXR.js';
3
+ //# sourceMappingURL=generators.js.map
4
+ //# sourceMappingURL=generators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
package/dist/index.cjs CHANGED
@@ -1,13 +1,17 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ 'use strict';
2
2
 
3
+ var chunkQEYWJ6VH_cjs = require('./chunk-QEYWJ6VH.cjs');
4
+ require('./chunk-37OP7TSO.cjs');
3
5
 
4
6
 
5
- var _chunk57AHBVYKcjs = require('./chunk-57AHBVYK.cjs');
6
7
 
7
- // src/index.ts
8
- _chunk57AHBVYKcjs.init_cjs_shims.call(void 0, );
9
-
10
-
11
-
12
- exports.pluginZod = _chunk57AHBVYKcjs.pluginZod; exports.pluginZodName = _chunk57AHBVYKcjs.pluginZodName;
8
+ Object.defineProperty(exports, "pluginZod", {
9
+ enumerable: true,
10
+ get: function () { return chunkQEYWJ6VH_cjs.pluginZod; }
11
+ });
12
+ Object.defineProperty(exports, "pluginZodName", {
13
+ enumerable: true,
14
+ get: function () { return chunkQEYWJ6VH_cjs.pluginZodName; }
15
+ });
16
+ //# sourceMappingURL=index.cjs.map
13
17
  //# sourceMappingURL=index.cjs.map