···11+---
22+'@hey-api/openapi-ts': minor
33+---
44+55+refactor(plugin): add `DefinePlugin` utility types
66+77+### Updated Plugin API
88+99+Please refer to the [custom plugin](https://heyapi.dev/openapi-ts/plugins/custom) tutorial for the latest guide.
+26
.changeset/quick-hotels-knock.md
···11+---
22+'@hey-api/openapi-ts': minor
33+---
44+55+feat(sdk): update `validator` option
66+77+### Updated `sdk.validator` option
88+99+Clients can now validate both request and response data. As a result, passing a boolean or string to `validator` will control both of these options. To preserve the previous behavior, set `validator.request` to `false` and `validator.response` to your previous configuration.
1010+1111+```js
1212+export default {
1313+ input: 'https://get.heyapi.dev/hey-api/backend',
1414+ output: 'src/client',
1515+ plugins: [
1616+ // ...other plugins
1717+ {
1818+ name: '@hey-api/sdk',
1919+ validator: {
2020+ request: false,
2121+ response: true,
2222+ },
2323+ },
2424+ ],
2525+};
2626+```
···27272828This config option is deprecated and will be removed.
29293030+## v0.77.0
3131+3232+### Updated `sdk.validator` option
3333+3434+Clients can now validate both request and response data. As a result, passing a boolean or string to `validator` will control both of these options. To preserve the previous behavior, set `validator.request` to `false` and `validator.response` to your previous configuration.
3535+3636+```js
3737+export default {
3838+ input: 'https://get.heyapi.dev/hey-api/backend',
3939+ output: 'src/client',
4040+ plugins: [
4141+ // ...other plugins
4242+ {
4343+ name: '@hey-api/sdk',
4444+ validator: true, // [!code --]
4545+ validator: {
4646+ // [!code ++]
4747+ request: false, // [!code ++]
4848+ response: true, // [!code ++]
4949+ }, // [!code ++]
5050+ },
5151+ ],
5252+};
5353+```
5454+5555+### Updated Plugin API
5656+5757+Please refer to the [custom plugin](/openapi-ts/plugins/custom) tutorial for the latest guide.
5858+3059## v0.76.0
31603261### Single Valibot schema per request
+78
docs/openapi-ts/output/sdk.md
···146146147147:::
148148149149+## Validators
150150+151151+There are two ways to configure validators. If you only want to add validators to your SDKs, set `sdk.validator` to a validator plugin name. This will implicitly add the selected plugin with default values.
152152+153153+For a more granular approach, add a validator plugin and set `sdk.validator` to the plugin name or `true` to automatically select a plugin. Until you customize the validator plugin, both approaches will produce the same default output.
154154+155155+::: code-group
156156+157157+```js [sdk]
158158+export default {
159159+ input: 'https://get.heyapi.dev/hey-api/backend',
160160+ output: 'src/client',
161161+ plugins: [
162162+ {
163163+ name: '@hey-api/sdk',
164164+ validator: 'zod', // [!code ++]
165165+ },
166166+ ],
167167+};
168168+```
169169+170170+```js [validator]
171171+export default {
172172+ input: 'https://get.heyapi.dev/hey-api/backend',
173173+ output: 'src/client',
174174+ plugins: [
175175+ {
176176+ name: '@hey-api/sdk',
177177+ validator: true, // or 'zod' // [!code ++]
178178+ },
179179+ {
180180+ name: 'zod', // [!code ++]
181181+ // other options
182182+ },
183183+ ],
184184+};
185185+```
186186+187187+:::
188188+189189+You can choose to validate only requests or responses.
190190+191191+::: code-group
192192+193193+```js [requests]
194194+export default {
195195+ input: 'https://get.heyapi.dev/hey-api/backend',
196196+ output: 'src/client',
197197+ plugins: [
198198+ {
199199+ name: '@hey-api/sdk',
200200+ validator: {
201201+ request: 'zod', // [!code ++]
202202+ },
203203+ },
204204+ ],
205205+};
206206+```
207207+208208+```js [responses]
209209+export default {
210210+ input: 'https://get.heyapi.dev/hey-api/backend',
211211+ output: 'src/client',
212212+ plugins: [
213213+ {
214214+ name: '@hey-api/sdk',
215215+ validator: {
216216+ response: 'zod', // [!code ++]
217217+ },
218218+ },
219219+ ],
220220+};
221221+```
222222+223223+:::
224224+225225+Learn more about available validators on the [Validators](/openapi-ts/validators) page.
226226+149227<!--@include: ../../examples.md-->
150228<!--@include: ../../sponsors.md-->
+16-22
docs/openapi-ts/plugins/custom.md
···19192020```ts [index.ts]
2121export { defaultConfig, defineConfig } from './config';
2222-export type { Config } from './types';
2222+export type { MyPlugin } from './types';
2323```
24242525:::
···3131::: code-group
32323333```ts [types.d.ts]
3434-export interface Config {
3434+import type { DefinePlugin } from '@hey-api/openapi-ts';
3535+3636+export type Config = {
3537 /**
3638 * Plugin name. Must be unique.
3739 */
···4850 * @default false
4951 */
5052 myOption?: boolean;
5151-}
5353+};
5454+5555+export type MyPlugin = DefinePlugin<Config>;
5256```
53575458:::
55595660## Configuration
57615858-::: tip
5959-Reserved fields are prefixed with an underscore and are not exposed to the user.
6060-:::
6161-6262-`config.ts` contains the runtime configuration for your plugin. It must implement the `Config` interface we created above and define `handler()` and `handlerLegacy()` functions from the `Plugin.Config` interface.
6262+`config.ts` contains the runtime configuration for your plugin. It must implement the `MyPlugin` interface we created above and define the `handler()` function from the `MyPlugin['Config']` interface.
63636464::: code-group
65656666```ts [config.ts]
6767-import type { Plugin } from '@hey-api/openapi-ts';
6767+import { definePluginConfig } from '@hey-api/openapi-ts';
68686969import { handler } from './plugin';
7070-import type { Config } from './types';
7070+import type { MyPlugin } from './types';
71717272-export const defaultConfig: Plugin.Config<Config> = {
7272+export const defaultConfig: MyPlugin['Config'] = {
7373 config: {
7474 myOption: false, // implements default value from types
7575 },
7676 dependencies: ['@hey-api/typescript'],
7777 handler,
7878- handlerLegacy: () => {},
7978 name: 'my-plugin',
8079 output: 'my-plugin',
8180};
···8382/**
8483 * Type helper for `my-plugin` plugin, returns {@link Plugin.Config} object
8584 */
8686-export const defineConfig: Plugin.DefineConfig<Config> = (config) => ({
8787- ...defaultConfig,
8888- ...config,
8989-});
8585+export const defineConfig = definePluginConfig(defaultConfig);
9086```
91879288:::
···106102::: code-group
107103108104```ts [plugin.ts]
109109-import type { Plugin } from '@hey-api/openapi-ts';
105105+import type { MyPlugin } from './types';
110106111111-import type { Config } from './types';
112112-113113-export const handler: Plugin.Handler<Config> = ({ plugin }) => {
107107+export const handler: MyPlugin['Handler'] = ({ plugin }) => {
114108 // create an output file. it will not be
115109 // generated until it contains nodes
116110 const file = plugin.createFile({
···149143150144:::
151145152152-### Legacy
146146+### Legacy Handler
153147154154-Notice we defined `handlerLegacy` in our `config.ts` file. This method is responsible for generating the actual output when using the legacy parser. We do not recommend implementing this method unless you must use the legacy parser. You can use one of our [`plugin-legacy.ts`](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/%40hey-api/typescript/plugin-legacy.ts) files as an inspiration for potential implementation.
148148+You can also define an optional `handlerLegacy` function in `config.ts`. This method is responsible for generating the output when using the legacy parser. We do not recommend implementing this method unless you must use the legacy parser. You can use one of our [`plugin-legacy.ts`](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/%40hey-api/typescript/plugin-legacy.ts) files as an inspiration for potential implementation.
155149156150## Usage
157151
+3-2
docs/openapi-ts/plugins/valibot.md
···45454646### SDKs
47474848-To automatically validate response data in your SDKs, set `sdk.validator` to `true`.
4848+To add data validators to your SDKs, set `sdk.validator` to `true`.
49495050```js
5151export default {
···6262};
6363```
64646565+Learn more about data validators in your SDKs on the [SDKs](/openapi-ts/output/sdk#validators) page.
6666+6567## Output
66686769The Valibot plugin will generate the following artifacts, depending on the input specification.
···7880 bar: v.optional(v.union([v.number(), v.null()])),
7981 }),
8082 ),
8181- headers: v.optional(v.never()),
8283 path: v.object({
8384 baz: v.string(),
8485 }),
+3-2
docs/openapi-ts/plugins/zod.md
···45454646### SDKs
47474848-To automatically validate response data in your SDKs, set `sdk.validator` to `true`.
4848+To add data validators to your SDKs, set `sdk.validator` to `true`.
49495050```js
5151export default {
···6262};
6363```
64646565+Learn more about data validators in your SDKs on the [SDKs](/openapi-ts/output/sdk#validators) page.
6666+6567## Output
66686769The Zod plugin will generate the following artifacts, depending on the input specification.
···7880 bar: z.union([z.number(), z.null()]).optional(),
7981 })
8082 .optional(),
8181- headers: z.never().optional(),
8283 path: z.object({
8384 baz: z.string(),
8485 }),
+5-38
docs/openapi-ts/validators.md
···991010Whatever your reason to use validators might be, you can rest assured that you're working with the correct data.
11111212+## Features
1313+1414+- seamless integration with `@hey-api/openapi-ts` ecosystem
1515+- schemas for requests, responses, and reusable definitions
1616+1217## Options
13181419Hey API natively supports the following validators.
···2227- [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span>
23282429Don't see your validator? Let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
2525-2626-## Installation
2727-2828-There are two ways to generate validators. If you only need response validation in your SDKs, set `sdk.validator` to the desired value. For a more granular approach, add your validator to plugins and set `sdk.validator` to `true`.
2929-3030-::: code-group
3131-3232-```js [sdk]
3333-export default {
3434- input: 'https://get.heyapi.dev/hey-api/backend',
3535- output: 'src/client',
3636- plugins: [
3737- {
3838- name: '@hey-api/sdk',
3939- validator: 'zod', // [!code ++]
4040- },
4141- ],
4242-};
4343-```
4444-4545-```js [validator]
4646-export default {
4747- input: 'https://get.heyapi.dev/hey-api/backend',
4848- output: 'src/client',
4949- plugins: [
5050- {
5151- name: '@hey-api/sdk',
5252- validator: true, // [!code ++]
5353- },
5454- {
5555- name: 'zod', // [!code ++]
5656- // other options
5757- },
5858- ],
5959-};
6060-```
6161-6262-:::
63306431<!--@include: ../examples.md-->
6532<!--@include: ../sponsors.md-->
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···9797 */
9898 querySerializer?: QuerySerializer | QuerySerializerOptions;
9999 /**
100100+ * A function validating request data. This is useful if you want to ensure
101101+ * the request conforms to the desired shape, so it can be safely sent to
102102+ * the server.
103103+ */
104104+ requestValidator?: (data: unknown) => Promise<unknown>;
105105+ /**
100106 * A function transforming response data before it's returned. This is useful
101107 * for post-processing data, e.g. converting ISO strings into Date objects.
102108 */
···9797 */
9898 querySerializer?: QuerySerializer | QuerySerializerOptions;
9999 /**
100100+ * A function validating request data. This is useful if you want to ensure
101101+ * the request conforms to the desired shape, so it can be safely sent to
102102+ * the server.
103103+ */
104104+ requestValidator?: (data: unknown) => Promise<unknown>;
105105+ /**
100106 * A function transforming response data before it's returned. This is useful
101107 * for post-processing data, e.g. converting ISO strings into Date objects.
102108 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···77import type { ImportExportItemObject } from '../compiler/utils';
88import type { Client } from '../plugins/@hey-api/client-core/types';
99import { getClientPlugin } from '../plugins/@hey-api/client-core/utils';
1010-import type { Plugin } from '../plugins/types';
1010+import type { DefinePlugin } from '../plugins/types';
1111import type { Config } from '../types/config';
1212import { ensureDirSync, relativeModulePath } from './utils';
1313···9595 tsConfig,
9696}: {
9797 outputPath: string;
9898- plugin: Plugin.Config<Client.Config & { name: any }>;
9898+ plugin: DefinePlugin<Client.Config & { name: string }>['Config'];
9999 tsConfig: ts.ParsedCommandLine | null;
100100}): void => {
101101 // copy Hey API clients to output
+1-1
packages/openapi-ts/src/generate/files.ts
···77import { type ImportExportItemObject, tsNodeToString } from '../compiler/utils';
88import type { IR } from '../ir/types';
99import { ensureValidIdentifier } from '../openApi/shared/utils/identifier';
1010-import type { StringCase } from '../types/config';
1010+import type { StringCase } from '../types/case';
1111import { stringCase } from '../utils/stringCase';
1212import { ensureDirSync } from './utils';
1313
···116116export { clientPluginHandler } from './plugins/@hey-api/client-core/plugin';
117117export type { Client } from './plugins/@hey-api/client-core/types';
118118export { definePluginConfig } from './plugins/shared/utils/config';
119119-export type { Plugin } from './plugins/types';
119119+export type { DefinePlugin, Plugin } from './plugins/types';
120120export type { UserConfig } from './types/config';
121121export type { LegacyIR } from './types/types';
122122export { utils } from './utils/exports';
+3-3
packages/openapi-ts/src/initConfigs.ts
···33import { loadConfig } from 'c12';
4455import { getLogs } from './getLogs';
66-import type { UserPlugins } from './plugins';
77-import { defaultPluginConfigs } from './plugins';
66+import { defaultPluginConfigs } from './plugins/config';
87import type {
98 AnyPluginName,
109 PluginContext,
···1918export const defaultPlugins = [
2019 '@hey-api/typescript',
2120 '@hey-api/sdk',
2222-] as const satisfies ReadonlyArray<UserPlugins['name']>;
2121+] as const satisfies ReadonlyArray<PluginNames>;
23222423const defaultWatch: Config['input']['watch'] = {
2524 enabled: false,
···194193 return result;
195194 },
196195 };
196196+ // @ts-expect-error
197197 plugin.resolveConfig(plugin, context);
198198 }
199199
+12-16
packages/openapi-ts/src/ir/context.ts
···11import path from 'node:path';
2233import { TypeScriptFile } from '../generate/files';
44+import type { PluginConfigMap } from '../plugins/config';
45import { PluginInstance } from '../plugins/shared/utils/instance';
55-import type { Config, StringCase } from '../types/config';
66+import type { PluginNames } from '../plugins/types';
77+import type { StringCase } from '../types/case';
88+import type { Config } from '../types/config';
69import type { Files } from '../types/utils';
710import { resolveRef } from '../utils/ref';
811import type { IR } from './types';
9121010-// Helper type to extract the original config type from Plugin.Config and ensure it satisfies BaseConfig
1111-type ExtractConfig<T> = T extends { config: infer C }
1212- ? C & { name: string }
1313- : never;
1414-1515-// Helper type to map plugin names to their specific PluginInstance types
1616-type PluginInstanceMap = {
1717- [K in keyof Config['plugins']]?: PluginInstance<
1818- ExtractConfig<Config['plugins'][K]>
1919- >;
2020-};
2121-2213export interface ContextFile {
2314 /**
2415 * Should the exports from this file be re-exported in the index barrel file?
···6051 * registered through the `registerPlugin` method and can be accessed by
6152 * their configured name from the config.
6253 */
6363- public plugins: PluginInstanceMap = {};
5454+ public plugins: Partial<
5555+ Record<PluginNames, PluginInstance<PluginConfigMap[keyof PluginConfigMap]>>
5656+ > = {};
6457 /**
6558 * Resolved specification from `input`.
6659 */
···120113 * @param name Plugin name.
121114 * @returns Registered plugin instance.
122115 */
123123- private registerPlugin(name: keyof Config['plugins']): PluginInstance {
116116+ private registerPlugin<T extends PluginNames>(
117117+ name: T,
118118+ ): PluginInstance<PluginConfigMap[T]> {
124119 const plugin = this.config.plugins[name]!;
125120 const instance = new PluginInstance({
126126- config: plugin.config,
121121+ api: plugin.api,
122122+ config: plugin.config as any,
127123 context: this as any,
128124 dependencies: plugin.dependencies ?? [],
129125 handler: plugin.handler,
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientAxiosPlugin } from './types';
···8585 */
8686 querySerializer?: QuerySerializer | QuerySerializerOptions;
8787 /**
8888+ * A function validating request data. This is useful if you want to ensure
8989+ * the request conforms to the desired shape, so it can be safely sent to
9090+ * the server.
9191+ */
9292+ requestValidator?: (data: unknown) => Promise<unknown>;
9393+ /**
8894 * A function transforming response data before it's returned. This is useful
8995 * for post-processing data, e.g. converting ISO strings into Date objects.
9096 */
···11-import type { Plugin } from '../../types';
22-import type { Config as ClientAxiosConfig } from '../client-axios';
33-import type { Config as ClientFetchConfig } from '../client-fetch';
44-import type { Config as ClientNextConfig } from '../client-next';
55-import type { Config as ClientNuxtConfig } from '../client-nuxt';
66-77-export type PluginHandler<ReturnType = void> = Plugin.Handler<
88- ClientAxiosConfig | ClientFetchConfig | ClientNextConfig | ClientNuxtConfig,
99- ReturnType
1010->;
11+import type { HeyApiClientAxiosPlugin } from '../client-axios';
22+import type { HeyApiClientFetchPlugin } from '../client-fetch';
33+import type { HeyApiClientNextPlugin } from '../client-next';
44+import type { HeyApiClientNuxtPlugin } from '../client-nuxt';
1151212-export type PluginInstance = Plugin.Instance<
1313- ClientAxiosConfig | ClientFetchConfig | ClientNextConfig | ClientNuxtConfig
1414->;
66+export type PluginHandler =
77+ | HeyApiClientAxiosPlugin['Handler']
88+ | HeyApiClientFetchPlugin['Handler']
99+ | HeyApiClientNextPlugin['Handler']
1010+ | HeyApiClientNuxtPlugin['Handler'];
15111612/**
1713 * Public Client API.
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientFetchPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientNextPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientNuxtPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientLegacyAngularPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientLegacyAxiosPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientLegacyFetchPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientLegacyNodePlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiClientLegacyXhrPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiSchemasPlugin } from './types';
···22import type { OpenApiV2_0_XTypes } from '../../../openApi/2.0.x';
33import type { OpenApiV3_0_XTypes } from '../../../openApi/3.0.x';
44import type { OpenApiV3_1_XTypes } from '../../../openApi/3.1.x';
55-import type { Plugin } from '../../types';
55+import type { DefinePlugin, Plugin } from '../../types';
6677-export interface Config extends Plugin.Name<'@hey-api/schemas'> {
77+export type Config = Plugin.Name<'@hey-api/schemas'> & {
88 /**
99 * Should the exports from the generated files be re-exported in the index
1010 * barrel file?
···4545 * @default 'json'
4646 */
4747 type?: 'form' | 'json';
4848-}
4848+};
4949+5050+export type HeyApiSchemasPlugin = DefinePlugin<Config>;
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiSdkPlugin } from './types';
···11import type { IR } from '../../../ir/types';
22import type { Operation } from '../../../types/client';
33import type {
44+ DefinePlugin,
45 Plugin,
56 PluginClientNames,
67 PluginValidatorNames,
78} from '../../types';
8999-export interface Config extends Plugin.Name<'@hey-api/sdk'> {
1010+export type Config = Plugin.Name<'@hey-api/sdk'> & {
1011 /**
1112 * Group operation methods into classes? When enabled, you can select which
1213 * classes to export with `sdk.include` and/or transform their names with
···114115 */
115116 transformer?: '@hey-api/transformers' | boolean;
116117 /**
117117- * Validate response data against schema before returning. This is useful
118118- * if you want to ensure the response conforms to a desired shape. However,
119119- * validation adds runtime overhead, so it's not recommended to use unless
120120- * absolutely necessary.
118118+ * Validate request and/or response data against schema before returning.
119119+ * This is useful if you want to ensure the request and/or response conforms
120120+ * to a desired shape. However, validation adds runtime overhead, so it's
121121+ * not recommended to use unless absolutely necessary.
122122+ *
123123+ * You can customize the validator output through its plugin. You can also
124124+ * set `validator` to `true` to automatically choose the validator from your
125125+ * defined plugins.
126126+ *
127127+ * You can enable/disable validation for requests and responses separately
128128+ * by setting `validator` to an object `{ request, response }`.
121129 *
122130 * Ensure you have declared the selected library as a dependency to avoid
123123- * errors. You can customize the selected validator output through its
124124- * plugin. You can also set `validator` to `true` to automatically choose
125125- * the validator from your defined plugins.
131131+ * errors.
126132 *
127133 * @default false
128134 */
129129- validator?: PluginValidatorNames | boolean;
135135+ validator?:
136136+ | PluginValidatorNames
137137+ | boolean
138138+ | {
139139+ /**
140140+ * Validate request data against schema before sending.
141141+ *
142142+ * Can be a validator plugin name or boolean (true to auto-select, false
143143+ * to disable).
144144+ *
145145+ * @default false
146146+ */
147147+ request?: PluginValidatorNames | boolean;
148148+ /**
149149+ * Validate response data against schema before returning.
150150+ *
151151+ * Can be a validator plugin name or boolean (true to auto-select, false
152152+ * to disable).
153153+ *
154154+ * @default false
155155+ */
156156+ response?: PluginValidatorNames | boolean;
157157+ };
130158131159 // DEPRECATED OPTIONS BELOW
132160···150178 * @default 'body'
151179 */
152180 response?: 'body' | 'response';
153153-}
181181+};
182182+183183+export type ResolvedConfig = Plugin.Name<'@hey-api/sdk'> & {
184184+ /**
185185+ * Group operation methods into classes? When enabled, you can select which
186186+ * classes to export with `sdk.include` and/or transform their names with
187187+ * `sdk.classNameBuilder`.
188188+ *
189189+ * Note that by enabling this option, your SDKs will **NOT**
190190+ * support {@link https://developer.mozilla.org/docs/Glossary/Tree_shaking tree-shaking}.
191191+ * For this reason, it is disabled by default.
192192+ *
193193+ * @default false
194194+ */
195195+ asClass: boolean;
196196+ /**
197197+ * Should the generated functions contain auth mechanisms? You may want to
198198+ * disable this option if you're handling auth yourself or defining it
199199+ * globally on the client and want to reduce the size of generated code.
200200+ *
201201+ * @default true
202202+ */
203203+ auth: boolean;
204204+ /**
205205+ * Customize the generated class names. The name variable is obtained from
206206+ * your OpenAPI specification tags or `instance` value.
207207+ *
208208+ * This option has no effect if `sdk.asClass` is `false`.
209209+ */
210210+ classNameBuilder: string | ((name: string) => string);
211211+ /**
212212+ * How should we structure your SDK? By default, we try to infer the ideal
213213+ * structure using `operationId` keywords. If you prefer a flatter structure,
214214+ * you can set `classStructure` to `off` to disable this behavior.
215215+ *
216216+ * @default 'auto'
217217+ */
218218+ classStructure: 'auto' | 'off';
219219+ /**
220220+ * Use an internal client instance to send HTTP requests? This is useful if
221221+ * you don't want to manually pass the client to each SDK function.
222222+ *
223223+ * You can customize the selected client output through its plugin. You can
224224+ * also set `client` to `true` to automatically choose the client from your
225225+ * defined plugins. If we can't detect a client plugin when using `true`, we
226226+ * will default to `@hey-api/client-fetch`.
227227+ *
228228+ * @default true
229229+ */
230230+ client: PluginClientNames | false;
231231+ /**
232232+ * Should the exports from the generated files be re-exported in the index
233233+ * barrel file?
234234+ *
235235+ * @default true
236236+ */
237237+ exportFromIndex: boolean;
238238+ /**
239239+ * Include only service classes with names matching regular expression
240240+ *
241241+ * This option has no effect if `sdk.asClass` is `false`.
242242+ */
243243+ include: string | undefined;
244244+ /**
245245+ * Set `instance` to create an instantiable SDK. Using `true` will use the
246246+ * default instance name; in practice, you want to define your own by passing
247247+ * a string value.
248248+ *
249249+ * @default false
250250+ */
251251+ instance: string | boolean;
252252+ /**
253253+ * Customise the name of methods within the service. By default,
254254+ * {@link IR.OperationObject.id} or {@link Operation.name} is used.
255255+ */
256256+ methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
257257+ // TODO: parser - rename operationId option to something like inferId?: boolean
258258+ /**
259259+ * Use operation ID to generate operation names?
260260+ *
261261+ * @default true
262262+ */
263263+ operationId: boolean;
264264+ /**
265265+ * Name of the generated file.
266266+ *
267267+ * @default 'sdk'
268268+ */
269269+ output: string;
270270+ /**
271271+ * **This feature works only with the Fetch client**
272272+ *
273273+ * Should we return only data or multiple fields (data, error, response, etc.)?
274274+ *
275275+ * @default 'fields'
276276+ */
277277+ responseStyle: 'data' | 'fields';
278278+ /**
279279+ * Transform response data before returning. This is useful if you want to
280280+ * convert for example ISO strings into Date objects. However, transformation
281281+ * adds runtime overhead, so it's not recommended to use unless necessary.
282282+ *
283283+ * You can customize the selected transformer output through its plugin. You
284284+ * can also set `transformer` to `true` to automatically choose the
285285+ * transformer from your defined plugins.
286286+ *
287287+ * @default false
288288+ */
289289+ transformer: '@hey-api/transformers' | false;
290290+ /**
291291+ * Validate request and/or response data against schema before returning.
292292+ * This is useful if you want to ensure the request and/or response conforms
293293+ * to a desired shape. However, validation adds runtime overhead, so it's
294294+ * not recommended to use unless absolutely necessary.
295295+ */
296296+ validator: {
297297+ /**
298298+ * The validator plugin to use for request validation, or false to disable.
299299+ *
300300+ * @default false
301301+ */
302302+ request: PluginValidatorNames | false;
303303+ /**
304304+ * The validator plugin to use for response validation, or false to disable.
305305+ *
306306+ * @default false
307307+ */
308308+ response: PluginValidatorNames | false;
309309+ };
310310+311311+ // DEPRECATED OPTIONS BELOW
312312+313313+ /**
314314+ * **This feature works only with the legacy parser**
315315+ *
316316+ * Filter endpoints to be included in the generated SDK. The provided
317317+ * string should be a regular expression where matched results will be
318318+ * included in the output. The input pattern this string will be tested
319319+ * against is `{method} {path}`. For example, you can match
320320+ * `POST /api/v1/foo` with `^POST /api/v1/foo$`.
321321+ *
322322+ * @deprecated
323323+ */
324324+ // eslint-disable-next-line typescript-sort-keys/interface
325325+ filter?: string;
326326+ /**
327327+ * Define shape of returned value from service calls
328328+ *
329329+ * @deprecated
330330+ * @default 'body'
331331+ */
332332+ response: 'body' | 'response';
333333+};
334334+335335+export type HeyApiSdkPlugin = DefinePlugin<Config, ResolvedConfig>;
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiTransformersPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { HeyApiTypeScriptPlugin } from './types';
···11-import type { StringCase } from '../../../types/config';
22-import type { Plugin } from '../../types';
11+import type { StringCase } from '../../../types/case';
22+import type { DefinePlugin, Plugin } from '../../types';
3344-export interface Config extends Plugin.Name<'@hey-api/typescript'> {
44+export type Config = Plugin.Name<'@hey-api/typescript'> & {
55 /**
66 * By default, enums are generated as TypeScript types. In addition to that,
77 * you can choose to generate them as JavaScript objects, TypeScript enums,
···107107 * @default false
108108 */
109109 tree?: boolean;
110110-}
110110+};
111111+112112+export type HeyApiTypeScriptPlugin = DefinePlugin<Config>;
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { TanStackAngularQueryPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { TanStackReactQueryPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { TanStackSolidQueryPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { TanStackSvelteQueryPlugin } from './types';
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { TanStackVueQueryPlugin } from './types';
···11-import type { StringCase } from '../../../types/config';
22-import type { Plugin } from '../../types';
11+import type { StringCase } from '../../../types/case';
22+import type { DefinePlugin, Plugin } from '../../types';
3344-export interface Config extends Plugin.Name<'@tanstack/vue-query'> {
44+export type Config = Plugin.Name<'@tanstack/vue-query'> & {
55 /**
66 * The casing convention to use for generated names.
77 *
···9191 enabled?: boolean;
9292 name?: string | ((name: string) => string);
9393 };
9494-}
9494+};
95959696-export interface ResolvedConfig extends Plugin.Name<'@tanstack/vue-query'> {
9696+export type ResolvedConfig = Plugin.Name<'@tanstack/vue-query'> & {
9797 /**
9898 * The casing convention to use for generated names.
9999 *
···168168 enabled: boolean;
169169 name: string | ((name: string) => string);
170170 };
171171-}
171171+};
172172+173173+export type TanStackVueQueryPlugin = DefinePlugin<Config, ResolvedConfig>;
+93
packages/openapi-ts/src/plugins/config.ts
···11+import type { HeyApiClientAxiosPlugin } from './@hey-api/client-axios';
22+import { defaultConfig as heyApiClientAxios } from './@hey-api/client-axios';
33+import type { HeyApiClientFetchPlugin } from './@hey-api/client-fetch';
44+import { defaultConfig as heyApiClientFetch } from './@hey-api/client-fetch';
55+import type { HeyApiClientNextPlugin } from './@hey-api/client-next';
66+import { defaultConfig as heyApiClientNext } from './@hey-api/client-next';
77+import type { HeyApiClientNuxtPlugin } from './@hey-api/client-nuxt';
88+import { defaultConfig as heyApiClientNuxt } from './@hey-api/client-nuxt';
99+import type { HeyApiClientLegacyAngularPlugin } from './@hey-api/legacy-angular';
1010+import { defaultConfig as heyApiLegacyAngular } from './@hey-api/legacy-angular';
1111+import type { HeyApiClientLegacyAxiosPlugin } from './@hey-api/legacy-axios';
1212+import { defaultConfig as heyApiLegacyAxios } from './@hey-api/legacy-axios';
1313+import type { HeyApiClientLegacyFetchPlugin } from './@hey-api/legacy-fetch';
1414+import { defaultConfig as heyApiLegacyFetch } from './@hey-api/legacy-fetch';
1515+import type { HeyApiClientLegacyNodePlugin } from './@hey-api/legacy-node';
1616+import { defaultConfig as heyApiLegacyNode } from './@hey-api/legacy-node';
1717+import type { HeyApiClientLegacyXhrPlugin } from './@hey-api/legacy-xhr';
1818+import { defaultConfig as heyApiLegacyXhr } from './@hey-api/legacy-xhr';
1919+import type { HeyApiSchemasPlugin } from './@hey-api/schemas';
2020+import { defaultConfig as heyApiSchemas } from './@hey-api/schemas';
2121+import type { HeyApiSdkPlugin } from './@hey-api/sdk';
2222+import { defaultConfig as heyApiSdk } from './@hey-api/sdk';
2323+import type { HeyApiTransformersPlugin } from './@hey-api/transformers';
2424+import { defaultConfig as heyApiTransformers } from './@hey-api/transformers';
2525+import type { HeyApiTypeScriptPlugin } from './@hey-api/typescript';
2626+import { defaultConfig as heyApiTypeScript } from './@hey-api/typescript';
2727+import type { TanStackAngularQueryPlugin } from './@tanstack/angular-query-experimental';
2828+import { defaultConfig as tanStackAngularQuery } from './@tanstack/angular-query-experimental';
2929+import type { TanStackReactQueryPlugin } from './@tanstack/react-query';
3030+import { defaultConfig as tanStackReactQuery } from './@tanstack/react-query';
3131+import type { TanStackSolidQueryPlugin } from './@tanstack/solid-query';
3232+import { defaultConfig as tanStackSolidQuery } from './@tanstack/solid-query';
3333+import type { TanStackSvelteQueryPlugin } from './@tanstack/svelte-query';
3434+import { defaultConfig as tanStackSvelteQuery } from './@tanstack/svelte-query';
3535+import type { TanStackVueQueryPlugin } from './@tanstack/vue-query';
3636+import { defaultConfig as tanStackVueQuery } from './@tanstack/vue-query';
3737+import type { FastifyPlugin } from './fastify';
3838+import { defaultConfig as fastify } from './fastify';
3939+import type { Plugin, PluginNames } from './types';
4040+import type { ValibotPlugin } from './valibot';
4141+import { defaultConfig as valibot } from './valibot';
4242+import type { ZodPlugin } from './zod';
4343+import { defaultConfig as zod } from './zod';
4444+4545+export interface PluginConfigMap {
4646+ '@hey-api/client-axios': HeyApiClientAxiosPlugin['Types'];
4747+ '@hey-api/client-fetch': HeyApiClientFetchPlugin['Types'];
4848+ '@hey-api/client-next': HeyApiClientNextPlugin['Types'];
4949+ '@hey-api/client-nuxt': HeyApiClientNuxtPlugin['Types'];
5050+ '@hey-api/schemas': HeyApiSchemasPlugin['Types'];
5151+ '@hey-api/sdk': HeyApiSdkPlugin['Types'];
5252+ '@hey-api/transformers': HeyApiTransformersPlugin['Types'];
5353+ '@hey-api/typescript': HeyApiTypeScriptPlugin['Types'];
5454+ '@tanstack/angular-query-experimental': TanStackAngularQueryPlugin['Types'];
5555+ '@tanstack/react-query': TanStackReactQueryPlugin['Types'];
5656+ '@tanstack/solid-query': TanStackSolidQueryPlugin['Types'];
5757+ '@tanstack/svelte-query': TanStackSvelteQueryPlugin['Types'];
5858+ '@tanstack/vue-query': TanStackVueQueryPlugin['Types'];
5959+ fastify: FastifyPlugin['Types'];
6060+ 'legacy/angular': HeyApiClientLegacyAngularPlugin['Types'];
6161+ 'legacy/axios': HeyApiClientLegacyAxiosPlugin['Types'];
6262+ 'legacy/fetch': HeyApiClientLegacyFetchPlugin['Types'];
6363+ 'legacy/node': HeyApiClientLegacyNodePlugin['Types'];
6464+ 'legacy/xhr': HeyApiClientLegacyXhrPlugin['Types'];
6565+ valibot: ValibotPlugin['Types'];
6666+ zod: ZodPlugin['Types'];
6767+}
6868+6969+export const defaultPluginConfigs: {
7070+ [K in PluginNames]: Plugin.Config<PluginConfigMap[K]>;
7171+} = {
7272+ '@hey-api/client-axios': heyApiClientAxios,
7373+ '@hey-api/client-fetch': heyApiClientFetch,
7474+ '@hey-api/client-next': heyApiClientNext,
7575+ '@hey-api/client-nuxt': heyApiClientNuxt,
7676+ '@hey-api/schemas': heyApiSchemas,
7777+ '@hey-api/sdk': heyApiSdk,
7878+ '@hey-api/transformers': heyApiTransformers,
7979+ '@hey-api/typescript': heyApiTypeScript,
8080+ '@tanstack/angular-query-experimental': tanStackAngularQuery,
8181+ '@tanstack/react-query': tanStackReactQuery,
8282+ '@tanstack/solid-query': tanStackSolidQuery,
8383+ '@tanstack/svelte-query': tanStackSvelteQuery,
8484+ '@tanstack/vue-query': tanStackVueQuery,
8585+ fastify,
8686+ 'legacy/angular': heyApiLegacyAngular,
8787+ 'legacy/axios': heyApiLegacyAxios,
8888+ 'legacy/fetch': heyApiLegacyFetch,
8989+ 'legacy/node': heyApiLegacyNode,
9090+ 'legacy/xhr': heyApiLegacyXhr,
9191+ valibot,
9292+ zod,
9393+};
+2-4
packages/openapi-ts/src/plugins/fastify/config.ts
···11import { definePluginConfig } from '../shared/utils/config';
22-import type { Plugin } from '../types';
32import { handler } from './plugin';
44-import type { Config } from './types';
33+import type { FastifyPlugin } from './types';
5466-export const defaultConfig: Plugin.Config<Config> = {
55+export const defaultConfig: FastifyPlugin['Config'] = {
76 config: {
87 exportFromIndex: false,
98 },
109 dependencies: ['@hey-api/typescript'],
1110 handler,
1212- handlerLegacy: () => {},
1311 name: 'fastify',
1412 output: 'fastify',
1513};
+1-1
packages/openapi-ts/src/plugins/fastify/index.ts
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { FastifyPlugin } from './types';
+2-3
packages/openapi-ts/src/plugins/fastify/plugin.ts
···66import type { IR } from '../../ir/types';
77import { typesId } from '../@hey-api/typescript/ref';
88import { operationIrRef } from '../shared/utils/ref';
99-import type { Plugin } from '../types';
1010-import type { Config } from './types';
99+import type { FastifyPlugin } from './types';
11101211const fastifyId = 'fastify';
1312···207206 return routeHandler;
208207};
209208210210-export const handler: Plugin.Handler<Config> = ({ plugin }) => {
209209+export const handler: FastifyPlugin['Handler'] = ({ plugin }) => {
211210 const file = plugin.createFile({
212211 id: fastifyId,
213212 path: plugin.output,
···11-import type { Plugin } from '../types';
11+import type { DefinePlugin, Plugin } from '../types';
2233-export interface Config extends Plugin.Name<'fastify'> {
33+export type Config = Plugin.Name<'fastify'> & {
44 /**
55 * Should the exports from the generated files be re-exported in the index
66 * barrel file?
···1414 * @default 'fastify'
1515 */
1616 output?: string;
1717-}
1717+};
1818+1919+export type FastifyPlugin = DefinePlugin<Config>;
-154
packages/openapi-ts/src/plugins/index.ts
···11-import {
22- type Config as HeyApiClientAxios,
33- defaultConfig as heyApiClientAxios,
44-} from './@hey-api/client-axios';
55-import {
66- type Config as HeyApiClientFetch,
77- defaultConfig as heyApiClientFetch,
88-} from './@hey-api/client-fetch';
99-import {
1010- type Config as HeyApiClientNext,
1111- defaultConfig as heyApiClientNext,
1212-} from './@hey-api/client-next';
1313-import {
1414- type Config as HeyApiClientNuxt,
1515- defaultConfig as heyApiClientNuxt,
1616-} from './@hey-api/client-nuxt';
1717-import {
1818- type Config as HeyApiLegacyAngular,
1919- defaultConfig as heyApiLegacyAngular,
2020-} from './@hey-api/legacy-angular';
2121-import {
2222- type Config as HeyApiLegacyAxios,
2323- defaultConfig as heyApiLegacyAxios,
2424-} from './@hey-api/legacy-axios';
2525-import {
2626- type Config as HeyApiLegacyFetch,
2727- defaultConfig as heyApiLegacyFetch,
2828-} from './@hey-api/legacy-fetch';
2929-import {
3030- type Config as HeyApiLegacyNode,
3131- defaultConfig as heyApiLegacyNode,
3232-} from './@hey-api/legacy-node';
3333-import {
3434- type Config as HeyApiLegacyXhr,
3535- defaultConfig as heyApiLegacyXhr,
3636-} from './@hey-api/legacy-xhr';
3737-import {
3838- type Config as HeyApiSchemas,
3939- defaultConfig as heyApiSchemas,
4040-} from './@hey-api/schemas';
4141-import {
4242- type Config as HeyApiSdk,
4343- defaultConfig as heyApiSdk,
4444-} from './@hey-api/sdk';
4545-import {
4646- type Config as HeyApiTransformers,
4747- defaultConfig as heyApiTransformers,
4848-} from './@hey-api/transformers';
4949-import {
5050- type Config as HeyApiTypeScript,
5151- defaultConfig as heyApiTypeScript,
5252-} from './@hey-api/typescript';
5353-import {
5454- type Config as TanStackAngularQueryExperimental,
5555- defaultConfig as tanStackAngularQueryExperimental,
5656-} from './@tanstack/angular-query-experimental';
5757-import {
5858- type Config as TanStackReactQuery,
5959- defaultConfig as tanStackReactQuery,
6060-} from './@tanstack/react-query';
6161-import {
6262- type Config as TanStackSolidQuery,
6363- defaultConfig as tanStackSolidQuery,
6464-} from './@tanstack/solid-query';
6565-import {
6666- type Config as TanStackSvelteQuery,
6767- defaultConfig as tanStackSvelteQuery,
6868-} from './@tanstack/svelte-query';
6969-import {
7070- type Config as TanStackVueQuery,
7171- defaultConfig as tanStackVueQuery,
7272-} from './@tanstack/vue-query';
7373-import { type Config as Fastify, defaultConfig as fastify } from './fastify';
7474-import type { Plugin, PluginNames } from './types';
7575-import { type Config as Valibot, defaultConfig as valibot } from './valibot';
7676-import { type Config as Zod, defaultConfig as zod } from './zod';
7777-7878-/**
7979- * User-facing plugin types.
8080- */
8181-export type UserPlugins =
8282- | Plugin.UserConfig<HeyApiClientAxios>
8383- | Plugin.UserConfig<HeyApiClientFetch>
8484- | Plugin.UserConfig<HeyApiClientNext>
8585- | Plugin.UserConfig<HeyApiClientNuxt>
8686- | Plugin.UserConfig<HeyApiLegacyAngular>
8787- | Plugin.UserConfig<HeyApiLegacyAxios>
8888- | Plugin.UserConfig<HeyApiLegacyFetch>
8989- | Plugin.UserConfig<HeyApiLegacyNode>
9090- | Plugin.UserConfig<HeyApiLegacyXhr>
9191- | Plugin.UserConfig<HeyApiSchemas>
9292- | Plugin.UserConfig<HeyApiSdk>
9393- | Plugin.UserConfig<HeyApiTransformers>
9494- | Plugin.UserConfig<HeyApiTypeScript>
9595- | Plugin.UserConfig<TanStackAngularQueryExperimental>
9696- | Plugin.UserConfig<TanStackReactQuery>
9797- | Plugin.UserConfig<TanStackSolidQuery>
9898- | Plugin.UserConfig<TanStackSvelteQuery>
9999- | Plugin.UserConfig<TanStackVueQuery>
100100- | Plugin.UserConfig<Fastify>
101101- | Plugin.UserConfig<Valibot>
102102- | Plugin.UserConfig<Zod>;
103103-104104-/**
105105- * Internal plugin types.
106106- */
107107-export type ClientPlugins =
108108- | Plugin.Config<HeyApiClientAxios>
109109- | Plugin.Config<HeyApiClientFetch>
110110- | Plugin.Config<HeyApiClientNext>
111111- | Plugin.Config<HeyApiClientNuxt>
112112- | Plugin.Config<HeyApiLegacyAngular>
113113- | Plugin.Config<HeyApiLegacyAxios>
114114- | Plugin.Config<HeyApiLegacyFetch>
115115- | Plugin.Config<HeyApiLegacyNode>
116116- | Plugin.Config<HeyApiLegacyXhr>
117117- | Plugin.Config<HeyApiSchemas>
118118- | Plugin.Config<HeyApiSdk>
119119- | Plugin.Config<HeyApiTransformers>
120120- | Plugin.Config<HeyApiTypeScript>
121121- | Plugin.Config<TanStackAngularQueryExperimental>
122122- | Plugin.Config<TanStackReactQuery>
123123- | Plugin.Config<TanStackSolidQuery>
124124- | Plugin.Config<TanStackSvelteQuery>
125125- | Plugin.Config<TanStackVueQuery>
126126- | Plugin.Config<Fastify>
127127- | Plugin.Config<Valibot>
128128- | Plugin.Config<Zod>;
129129-130130-export const defaultPluginConfigs: {
131131- [K in PluginNames]: any;
132132-} = {
133133- '@hey-api/client-axios': heyApiClientAxios,
134134- '@hey-api/client-fetch': heyApiClientFetch,
135135- '@hey-api/client-next': heyApiClientNext,
136136- '@hey-api/client-nuxt': heyApiClientNuxt,
137137- '@hey-api/schemas': heyApiSchemas,
138138- '@hey-api/sdk': heyApiSdk,
139139- '@hey-api/transformers': heyApiTransformers,
140140- '@hey-api/typescript': heyApiTypeScript,
141141- '@tanstack/angular-query-experimental': tanStackAngularQueryExperimental,
142142- '@tanstack/react-query': tanStackReactQuery,
143143- '@tanstack/solid-query': tanStackSolidQuery,
144144- '@tanstack/svelte-query': tanStackSvelteQuery,
145145- '@tanstack/vue-query': tanStackVueQuery,
146146- fastify,
147147- 'legacy/angular': heyApiLegacyAngular,
148148- 'legacy/axios': heyApiLegacyAxios,
149149- 'legacy/fetch': heyApiLegacyFetch,
150150- 'legacy/node': heyApiLegacyNode,
151151- 'legacy/xhr': heyApiLegacyXhr,
152152- valibot,
153153- zod,
154154-};
···11-import type { Config, StringCase } from '../../../types/config';
11+import type { StringCase } from '../../../types/case';
22+import type { Config } from '../../../types/config';
23import { irRef } from '../../../utils/ref';
34import { stringCase } from '../../../utils/stringCase';
45
+67-65
packages/openapi-ts/src/plugins/types.d.ts
···6868 }) => ObjectType<T>;
6969}
70707171-export interface BaseConfig {
7171+type BaseApi = Record<string, unknown>;
7272+7373+type BaseConfig = {
7274 /**
7375 * Should the exports from the plugin's file be re-exported in the index
7476 * barrel file?
···7678 exportFromIndex?: boolean;
7779 name: AnyPluginName;
7880 output?: string;
7979-}
8080-8181-interface Meta<
8282- Config extends BaseConfig,
8383- ResolvedConfig extends BaseConfig = Config,
8484-> {
8585- /**
8686- * Dependency plugins will be always processed, regardless of whether user
8787- * explicitly defines them in their `plugins` config.
8888- */
8989- dependencies?: ReadonlyArray<AnyPluginName>;
9090- /**
9191- * Resolves static configuration values into their runtime equivalents. For
9292- * example, when `validator` is set to `true`, it figures out which plugin
9393- * should be used for validation.
9494- */
9595- resolveConfig?: (
9696- plugin: Omit<Plugin.Config<Config, ResolvedConfig>, 'dependencies'> & {
9797- dependencies: Set<AnyPluginName>;
9898- },
9999- context: PluginContext,
100100- ) => void;
101101- /**
102102- * Optional tags can be used to help with deciding plugin order and resolving
103103- * plugin configuration options.
104104- */
105105- tags?: ReadonlyArray<PluginTag>;
106106-}
8181+};
1078210883/**
10984 * Public Plugin API.
11085 */
11186export namespace Plugin {
112112- export type Config<
113113- Config extends BaseConfig,
114114- ResolvedConfig extends BaseConfig = Config,
115115- > = Pick<Config, 'name' | 'output'> &
116116- Meta<Config, ResolvedConfig> & {
117117- config: Omit<Config, 'name' | 'output'>;
118118- handler: Plugin.Handler<
119119- Omit<ResolvedConfig, 'name'> & {
120120- name: any;
121121- }
122122- >;
123123- handlerLegacy: Plugin.LegacyHandler<
124124- Omit<ResolvedConfig, 'name'> & {
125125- name: any;
126126- }
127127- >;
128128- };
8787+ export type Config<T extends Types> = Pick<T, 'api'> & {
8888+ config: Omit<T['config'], 'name' | 'output'>;
8989+ /**
9090+ * Dependency plugins will be always processed, regardless of whether user
9191+ * explicitly defines them in their `plugins` config.
9292+ */
9393+ dependencies?: ReadonlyArray<AnyPluginName>;
9494+ handler: Handler<T>;
9595+ handlerLegacy?: LegacyHandler<T>;
9696+ name: T['config']['name'];
9797+ output: NonNullable<T['config']['output']>;
9898+ /**
9999+ * Resolves static configuration values into their runtime equivalents. For
100100+ * example, when `validator` is set to `true`, it figures out which plugin
101101+ * should be used for validation.
102102+ */
103103+ resolveConfig?: (
104104+ plugin: Omit<Plugin.Config<T>, 'dependencies'> & {
105105+ dependencies: Set<AnyPluginName>;
106106+ },
107107+ context: PluginContext,
108108+ ) => void;
109109+ /**
110110+ * Optional tags can be used to help with deciding plugin order and resolving
111111+ * plugin configuration options.
112112+ */
113113+ tags?: ReadonlyArray<PluginTag>;
114114+ };
115115+116116+ export type ConfigWithName<T extends Types> = Omit<Config<T>, 'config'> & {
117117+ config: Omit<T['config'], 'output'>;
118118+ };
129119130120 /** @deprecated - use `definePluginConfig()` instead */
131121 export type DefineConfig<
132122 Config extends BaseConfig,
133123 ResolvedConfig extends BaseConfig = Config,
134134- > = (config?: Plugin.UserConfig<Omit<Config, 'name'>>) => Omit<
124124+ > = (config?: UserConfig<Omit<Config, 'name'>>) => Omit<
135125 Plugin.Config<Config, ResolvedConfig>,
136126 'name'
137127 > & {
···144134 name: any;
145135 };
146136137137+ export interface Name<Name extends PluginNames> {
138138+ name: Name;
139139+ }
140140+141141+ export type Types<
142142+ Config extends BaseConfig = BaseConfig,
143143+ ResolvedConfig extends BaseConfig = Config,
144144+ Api extends BaseApi = never,
145145+ > = ([Api] extends [never] ? { api?: BaseApi } : { api: Api }) & {
146146+ config: Config;
147147+ resolvedConfig: ResolvedConfig;
148148+ };
149149+147150 /**
148148- * Plugin implementation for experimental parser.
151151+ * Users cannot modify output file path to avoid risk of conflicts.
149152 */
150150- export type Handler<Config extends BaseConfig, ReturnType = void> = (args: {
151151- plugin: Plugin.Instance<Config>;
152152- }) => ReturnType;
153153+ export type UserConfig<Config extends BaseConfig> = Omit<Config, 'output'>;
154154+}
153155154154- export type Instance<Config extends BaseConfig> = PluginInstance<Config>;
155155-156156+export type DefinePlugin<
157157+ Config extends BaseConfig = BaseConfig,
158158+ ResolvedConfig extends BaseConfig = Config,
159159+ Api extends BaseApi = never,
160160+> = {
161161+ Config: Plugin.Config<Plugin.Types<Config, ResolvedConfig, Api>>;
162162+ Handler: (args: {
163163+ plugin: PluginInstance<Plugin.Types<Config, ResolvedConfig, Api>>;
164164+ }) => void;
165165+ Instance: PluginInstance<Plugin.Types<Config, ResolvedConfig, Api>>;
156166 /**
157167 * Plugin implementation for legacy parser.
158168 *
159169 * @deprecated
160170 */
161161- export type LegacyHandler<Config extends BaseConfig> = (args: {
171171+ LegacyHandler: (args: {
162172 client: LegacyClient;
163173 files: Files;
164174 openApi: LegacyOpenApi;
165165- plugin: Plugin.Instance<Config>;
175175+ plugin: PluginInstance<Plugin.Types<Config, ResolvedConfig, Api>>;
166176 }) => void;
167167-168168- export interface Name<Name extends PluginNames> {
169169- name: Name;
170170- }
171171-172172- /**
173173- * Users cannot modify output file path to avoid risk of conflicts.
174174- */
175175- export type UserConfig<Config extends BaseConfig> = Omit<Config, 'output'>;
176176-}
177177+ Types: Plugin.Types<Config, ResolvedConfig, Api>;
178178+};
···11export { defaultConfig, defineConfig } from './config';
22-export type { Config } from './types';
22+export type { ValibotPlugin } from './types';
···11import type { TypeScriptFile } from '../generate/files';
2233-export type ExtractWithDiscriminator<T, Discriminator> = T extends Discriminator
44- ? T
55- : never;
66-77-/**
88- * Accepts an array of elements union and attempts to extract only objects.
99- * For example, Array<string | number | { id: string }> would result in
1010- * Array<{ id: string }>.
1111- */
1212-export type ExtractArrayOfObjects<T, Discriminator> =
1313- T extends Array<infer U>
1414- ? Array<ExtractWithDiscriminator<U, Discriminator>>
1515- : T extends ReadonlyArray<infer U>
1616- ? ReadonlyArray<ExtractWithDiscriminator<U, Discriminator>>
1717- : never;
1818-193export type Files = Record<string, TypeScriptFile>;
2020-2121-/**
2222- * Transforms an array of objects into an optional object map.
2323- * For example, Array<{ id: string }> would result in
2424- * { [key: string]?: { id: string } }
2525- */
2626-export type ArrayOfObjectsToObjectMap<
2727- T extends ReadonlyArray<Record<string, any>>,
2828- D extends keyof T[number],
2929-> = {
3030- [K in T[number][D]]?: Extract<T[number], Record<D, K>>;
3131-};
···11import { describe, expect, it } from 'vitest';
2233-import type { StringCase } from '../../types/config';
33+import type { StringCase } from '../../types/case';
44import { stringCase } from '../stringCase';
5566const cases: ReadonlyArray<StringCase> = [
+1-1
packages/openapi-ts/src/utils/stringCase.ts
···11-import type { StringCase } from '../types/config';
11+import type { StringCase } from '../types/case';
2233const uppercaseRegExp = /[\p{Lu}]/u;
44const lowercaseRegExp = /[\p{Ll}]/u;