@kubb/plugin-zod 4.29.0 → 4.31.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.
Files changed (73) hide show
  1. package/dist/components.d.ts +4 -4
  2. package/dist/generators.d.ts +4 -4
  3. package/dist/index.cjs +2 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +2 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/templates/ToZod.source.d.ts +1 -1
  9. package/dist/{types-36d5YOmB.d.ts → types-B-1DRHH9.d.ts} +10 -1
  10. package/dist/{types-Di6cBRev.d.ts → types-Cfvq128m.d.ts} +10 -1
  11. package/package.json +9 -8
  12. package/src/plugin.ts +2 -0
  13. package/src/types.ts +9 -0
  14. package/src/generators/__snapshots__/anyof.ts +0 -15
  15. package/src/generators/__snapshots__/coercion.ts +0 -15
  16. package/src/generators/__snapshots__/coercionDates.ts +0 -15
  17. package/src/generators/__snapshots__/coercionNumbers.ts +0 -15
  18. package/src/generators/__snapshots__/coercionStrings.ts +0 -15
  19. package/src/generators/__snapshots__/createItemUnionWithReadOnly.ts +0 -34
  20. package/src/generators/__snapshots__/createItemUnionWithReadOnly_wrapOutput.ts +0 -34
  21. package/src/generators/__snapshots__/createPet.ts +0 -22
  22. package/src/generators/__snapshots__/createPetWithUnknownTypeAny.ts +0 -13
  23. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +0 -22
  24. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput.ts +0 -29
  25. package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown_wrapOutput_entire_.ts +0 -30
  26. package/src/generators/__snapshots__/createPet_wrapOutput.ts +0 -29
  27. package/src/generators/__snapshots__/deletePet.ts +0 -22
  28. package/src/generators/__snapshots__/deletePet_wrapOutput.ts +0 -22
  29. package/src/generators/__snapshots__/discriminator.ts +0 -36
  30. package/src/generators/__snapshots__/enumBooleanLiteral.ts +0 -7
  31. package/src/generators/__snapshots__/enumNamesType.ts +0 -7
  32. package/src/generators/__snapshots__/enumNullable.ts +0 -7
  33. package/src/generators/__snapshots__/enumSingleLiteral.ts +0 -7
  34. package/src/generators/__snapshots__/enumVarNamesType.ts +0 -7
  35. package/src/generators/__snapshots__/example.ts +0 -9
  36. package/src/generators/__snapshots__/exclusiveNumbers.ts +0 -14
  37. package/src/generators/__snapshots__/getPets.ts +0 -22
  38. package/src/generators/__snapshots__/getPetsWithQueryFilter_wrapOutput_all_.ts +0 -101
  39. package/src/generators/__snapshots__/getPets_wrapOutput.ts +0 -29
  40. package/src/generators/__snapshots__/imageNullable.ts +0 -7
  41. package/src/generators/__snapshots__/mixedValueTypeConst.ts +0 -14
  42. package/src/generators/__snapshots__/nullable.ts +0 -11
  43. package/src/generators/__snapshots__/nullableString.ts +0 -7
  44. package/src/generators/__snapshots__/nullableStringUuid.ts +0 -7
  45. package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +0 -7
  46. package/src/generators/__snapshots__/numberValueConst.ts +0 -14
  47. package/src/generators/__snapshots__/oneof.ts +0 -14
  48. package/src/generators/__snapshots__/operations.ts +0 -106
  49. package/src/generators/__snapshots__/optionalPetInfer.ts +0 -13
  50. package/src/generators/__snapshots__/optionalPetTyped.ts +0 -12
  51. package/src/generators/__snapshots__/order.ts +0 -14
  52. package/src/generators/__snapshots__/orderDateTyeString.ts +0 -10
  53. package/src/generators/__snapshots__/orderDateTypeFalse.ts +0 -14
  54. package/src/generators/__snapshots__/orderDateTypeString.ts +0 -14
  55. package/src/generators/__snapshots__/pet.ts +0 -15
  56. package/src/generators/__snapshots__/petArray.ts +0 -14
  57. package/src/generators/__snapshots__/petCoercion.ts +0 -15
  58. package/src/generators/__snapshots__/petTupleObject.ts +0 -14
  59. package/src/generators/__snapshots__/petV4.ts +0 -15
  60. package/src/generators/__snapshots__/petV4Guid.ts +0 -15
  61. package/src/generators/__snapshots__/petWithMapper.ts +0 -15
  62. package/src/generators/__snapshots__/pets.ts +0 -14
  63. package/src/generators/__snapshots__/queryAllDefaulted.ts +0 -19
  64. package/src/generators/__snapshots__/queryAllDefaulted_wrapOutput.ts +0 -19
  65. package/src/generators/__snapshots__/recursive.ts +0 -10
  66. package/src/generators/__snapshots__/showPetById.ts +0 -22
  67. package/src/generators/__snapshots__/showPetById_wrapOutput.ts +0 -29
  68. package/src/generators/__snapshots__/stringValueConst.ts +0 -14
  69. package/src/generators/__snapshots__/toy.ts +0 -13
  70. package/src/generators/__snapshots__/unionWithReadOnly.ts +0 -28
  71. package/src/generators/__snapshots__/updateItemUnionWithReadOnly.ts +0 -34
  72. package/src/generators/__snapshots__/updateItemUnionWithReadOnly_wrapOutput.ts +0 -34
  73. package/src/generators/__snapshots__/uuidSchema.ts +0 -7
@@ -1,15 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const pet = z.object({
8
- id: z.bigint(),
9
- name: z.string().email(),
10
- date: z.optional(z.date()),
11
- uuid: z.optional(z.string().uuid()),
12
- email: z.optional(z.string().email()),
13
- pattern: z.optional(z.string().regex(/^[a-zA-Z0-9]{3}$/)),
14
- tag: z.optional(z.string().min(5).max(100)),
15
- })
@@ -1,14 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
- import { ToZod } from './test/.kubb/ToZod'
7
-
8
- export const pets = z.array(
9
- z.object({
10
- id: z.bigint(),
11
- name: z.string(),
12
- tag: z.optional(z.string()),
13
- }),
14
- ) as unknown as ToZod<Pets>
@@ -1,19 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const getThingsQueryParams = z.object({
8
- limit: z.coerce.number().int().min(1).max(100).default(100).describe('Maximum number of things to return'),
9
- skip: z.coerce.number().int().min(0).default(0).describe('Number of things to skip'),
10
- })
11
-
12
- /**
13
- * @description A list of things
14
- */
15
- export const getThings200 = z.object({
16
- items: z.array(z.lazy(() => thing)),
17
- })
18
-
19
- export const getThingsQueryResponse = z.lazy(() => getThings200)
@@ -1,19 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import { z } from '@hono/zod-openapi'
6
-
7
- export const getThingsQueryParams = z.object({
8
- limit: z.coerce.number().int().min(1).max(100).default(100).describe('Maximum number of things to return'),
9
- skip: z.coerce.number().int().min(0).default(0).describe('Number of things to skip'),
10
- })
11
-
12
- /**
13
- * @description A list of things
14
- */
15
- export const getThings200 = z.object({
16
- items: z.array(z.lazy(() => thing)),
17
- })
18
-
19
- export const getThingsQueryResponse = z.lazy(() => getThings200)
@@ -1,10 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const example = z.object({
8
- name: z.string(),
9
- children: z.array(z.lazy(() => example)),
10
- })
@@ -1,22 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const showPetByIdPathParams = z.object({
8
- petId: z.string().describe('The id of the pet to retrieve'),
9
- testId: z.string().describe('The id of the pet to retrieve'),
10
- })
11
-
12
- /**
13
- * @description Expected response to a valid request
14
- */
15
- export const showPetById200 = z.lazy(() => pet)
16
-
17
- /**
18
- * @description unexpected error
19
- */
20
- export const showPetByIdError = z.lazy(() => error)
21
-
22
- export const showPetByIdQueryResponse = z.lazy(() => showPetById200)
@@ -1,29 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import { z } from '@hono/zod-openapi'
6
-
7
- export const showPetByIdPathParams = z.object({
8
- petId: z.string().describe('The id of the pet to retrieve'),
9
- testId: z.string().describe('The id of the pet to retrieve'),
10
- })
11
-
12
- /**
13
- * @description Expected response to a valid request
14
- */
15
- export const showPetById200 = z.lazy(() => pet)
16
-
17
- /**
18
- * @description unexpected error
19
- */
20
- export const showPetByIdError = z
21
- .lazy(() => error)
22
- .openapi({
23
- examples: [
24
- { sample: { summary: 'A sample error', value: { code: 1, message: 'A sample error message' } } },
25
- { other_example: { summary: 'Another sample error', value: { code: 2, message: 'A totally specific message' } } },
26
- ],
27
- })
28
-
29
- export const showPetByIdQueryResponse = z.lazy(() => showPetById200)
@@ -1,14 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- /**
8
- * @description its value is equal to the value of the keyword
9
- */
10
- export const stringValueConst = z
11
- .object({
12
- foobar: z.literal('foobar'),
13
- })
14
- .describe('its value is equal to the value of the keyword')
@@ -1,13 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const toy = z
8
- .object({
9
- id: z.string().uuid(),
10
- name: z.optional(z.string()),
11
- description: z.string().nullish(),
12
- })
13
- .nullable()
@@ -1,28 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const item = z.union([
8
- z
9
- .lazy(() => itemTypeA)
10
- .and(
11
- z.object({
12
- id: z.optional(z.number().int()),
13
- type: z.literal('typeA'),
14
- name: z.string(),
15
- createdAt: z.optional(z.date()),
16
- }),
17
- ),
18
- z
19
- .lazy(() => itemTypeB)
20
- .and(
21
- z.object({
22
- id: z.optional(z.number().int()),
23
- type: z.literal('typeB'),
24
- name: z.string(),
25
- createdAt: z.optional(z.date()),
26
- }),
27
- ),
28
- ])
@@ -1,34 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- /**
8
- * @description Success
9
- */
10
- export const updateItem200 = z.lazy(() => item)
11
-
12
- /**
13
- * @description Item to update
14
- */
15
- export const updateItemMutationRequest = z.union([
16
- z
17
- .lazy(() => itemTypeA)
18
- .and(
19
- z.object({
20
- name: z.string(),
21
- type: z.literal('typeA'),
22
- }),
23
- ),
24
- z
25
- .lazy(() => itemTypeB)
26
- .and(
27
- z.object({
28
- name: z.string(),
29
- type: z.literal('typeB'),
30
- }),
31
- ),
32
- ])
33
-
34
- export const updateItemMutationResponse = z.lazy(() => updateItem200)
@@ -1,34 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import { z } from '@hono/zod-openapi'
6
-
7
- /**
8
- * @description Success
9
- */
10
- export const updateItem200 = z.lazy(() => item)
11
-
12
- /**
13
- * @description Item to update
14
- */
15
- export const updateItemMutationRequest = z.union([
16
- z
17
- .lazy(() => itemTypeA)
18
- .and(
19
- z.object({
20
- name: z.string(),
21
- type: z.literal('typeA'),
22
- }),
23
- ),
24
- z
25
- .lazy(() => itemTypeB)
26
- .and(
27
- z.object({
28
- name: z.string(),
29
- type: z.literal('typeB'),
30
- }),
31
- ),
32
- ])
33
-
34
- export const updateItemMutationResponse = z.lazy(() => updateItem200)
@@ -1,7 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import * as z from 'zod'
6
-
7
- export const uuidSchema = z.string().uuid()