@kubb/plugin-zod 5.7.0 → 5.7.2

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/docs/options.md CHANGED
@@ -42,11 +42,11 @@ Module the generated files import `z` from. Point it at your own module to re-ex
42
42
 
43
43
  Exports a type alias next to each schema, so you do not need `@kubb/plugin-ts`. The type takes the PascalCase schema name plus `SchemaType`, so `petSchema` gets `PetSchemaType`.
44
44
 
45
- | | |
46
- | -------- | ------------------------ |
47
- | Type | `boolean \| 'direction'` |
48
- | Required | `false` |
49
- | Default | `false` |
45
+ | | |
46
+ | -------- | -------------------- |
47
+ | Type | `boolean \| 'codec'` |
48
+ | Required | `false` |
49
+ | Default | `false` |
50
50
 
51
51
  ::field-group
52
52
 
@@ -58,8 +58,8 @@ Default value. Emits no type aliases.
58
58
  Emits `z.infer<typeof schema>` for every schema.
59
59
  :::
60
60
 
61
- :::field{name="'direction'"}
62
- Emits `z.input<typeof schema>` for request schemas (bodies and params) and `z.output<typeof schema>` for response schemas. Use it with codecs, where a request takes the domain value (a `Date`) that the schema encodes and a response returns the decoded value.
61
+ :::field{name="'codec'"}
62
+ Emits `z.input<typeof schema>` for request schemas (bodies and params) and `z.output<typeof schema>` for response schemas. Use it with codecs, where a request takes the domain value (a `Date`) that the schema encodes and a response returns the decoded value. Clients and query hooks then take their operation types from these aliases instead of `@kubb/plugin-ts`. `'direction'` still works as a deprecated name for `'codec'`.
63
63
  :::
64
64
 
65
65
  ::
@@ -68,13 +68,13 @@ Emits `z.input<typeof schema>` for request schemas (bodies and params) and `z.ou
68
68
  export type PetSchemaType = z.infer<typeof petSchema>
69
69
  ```
70
70
 
71
- With `'direction'`, request types read the schema's input:
71
+ With `'codec'`, request types read the schema's input:
72
72
 
73
73
  ```typescript
74
74
  export type PutEventBodySchemaType = z.input<typeof putEventBodySchema>
75
75
  ```
76
76
 
77
- Pair `'direction'` with `validator: { request: 'zod', params: 'zod' }` in [`@kubb/plugin-fetch`](https://kubb.dev/extensions/kubb-labs/plugin-fetch/options#validator) or [`@kubb/plugin-axios`](https://kubb.dev/extensions/kubb-labs/plugin-axios/options#validator). Without request validation, the client sends the domain value unencoded.
77
+ Pair `'codec'` with `validator: { request: 'zod', params: 'zod' }` in [`@kubb/plugin-fetch`](https://kubb.dev/extensions/kubb-labs/plugin-fetch/options#validator) or [`@kubb/plugin-axios`](https://kubb.dev/extensions/kubb-labs/plugin-axios/options#validator). Without request validation, the client sends the domain value unencoded.
78
78
 
79
79
  It also writes a `ResponsesSchema` for each operation (one schema per status code) and its inferred type. [`@kubb/plugin-fetch`](https://kubb.dev/extensions/kubb-labs/plugin-fetch) and [`@kubb/plugin-axios`](https://kubb.dev/extensions/kubb-labs/plugin-axios) key their `RequestResult` on it when `@kubb/plugin-ts` is absent.
80
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-zod",
3
- "version": "5.7.0",
3
+ "version": "5.7.2",
4
4
  "description": "Generate Zod validation schemas with Kubb for runtime data parsing and type safety. Pairs with @kubb/plugin-ts for end-to-end type coverage.",
5
5
  "keywords": [
6
6
  "code-generation",
@@ -71,11 +71,11 @@
71
71
  "devDependencies": {
72
72
  "@internals/shared": "0.0.0",
73
73
  "@internals/utils": "0.0.0",
74
- "kubb": "^5.13.0",
74
+ "kubb": "^5.14.0",
75
75
  "zod": "^4.6.7"
76
76
  },
77
77
  "peerDependencies": {
78
- "kubb": "^5.13.0",
78
+ "kubb": "^5.14.0",
79
79
  "zod": "^4.0.0"
80
80
  },
81
81
  "peerDependenciesMeta": {