@kubb/plugin-react-query 5.0.0-beta.80 → 5.0.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,161 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
2
  import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ast } from "@kubb/core";
3
- //#region ../../internals/client/src/types.d.ts
4
- /**
5
- * Validator applied to request and response bodies using schemas from `@kubb/plugin-zod`.
6
- * - `false`: no validation.
7
- * - `'zod'`: validates the success (2xx) response body, and the error body when a non-2xx call does
8
- * not throw (`throwOnError: false`).
9
- * - `{ request?: 'zod'; response?: 'zod' }`: opt in per direction. `request` validates the request
10
- * body and query parameters before the call; `response` validates the success response body and,
11
- * on the non-throw path, the error body.
12
- */
13
- type ValidatorOptions = false | 'zod' | {
14
- request?: 'zod';
15
- response?: 'zod';
16
- };
17
- /**
18
- * How the class-based SDK groups operations.
19
- * - `'tag'`: one class per tag, optionally composed into a root client.
20
- * - `'flat'`: one class with every operation as a direct method.
21
- */
22
- type Mode = 'tag' | 'flat';
23
- /**
24
- * The resolver shared by the client plugins. Functions and files use camelCase; URL helpers get
25
- * a `get<Operation>Url` name.
26
- */
27
- type ResolverClient = Resolver & {
28
- /**
29
- * Resolves the function name for a raw operation name.
30
- *
31
- * @example
32
- * `resolver.resolveName('show pet by id') // -> 'showPetById'`
33
- */
34
- resolveName(this: ResolverClient, name: string): string;
35
- /**
36
- * Resolves the output file name for a generated client module.
37
- */
38
- resolvePathName(this: ResolverClient, name: string, type?: 'file' | 'function' | 'type' | 'const'): string;
39
- /**
40
- * Resolves the generated class name for class-based clients.
41
- */
42
- resolveClassName(this: ResolverClient, name: string): string;
43
- /**
44
- * Resolves the generated class name for a tag-based client group. The default appends a
45
- * `Client` suffix (tag `pet` becomes `PetClient`) so the class never collides with the schema
46
- * model of the same name in the barrel.
47
- *
48
- * @example
49
- * `resolver.resolveGroupName('pet') // -> 'PetClient'`
50
- */
51
- resolveGroupName(this: ResolverClient, name: string): string;
52
- /**
53
- * Resolves the property name a tag client is exposed under on the composed root SDK
54
- * (`new PetStore(config).pet`).
55
- */
56
- resolveClientPropertyName(this: ResolverClient, name: string): string;
57
- };
58
- /**
59
- * The shared options surface for the client plugins. Deliberately small: there is one
60
- * response contract and one grouped options object. Each plugin extends this with its own
61
- * `transport` field.
62
- */
63
- type Options$1 = OutputOptions & {
64
- /**
65
- * Skip operations matching at least one entry in the list.
66
- */
67
- exclude?: Array<Exclude>;
68
- /**
69
- * Restrict generation to operations matching at least one entry in the list.
70
- */
71
- include?: Array<Include>;
72
- /**
73
- * Apply a different options object to operations matching a pattern.
74
- */
75
- override?: Array<Override<ResolvedOptions$1>>;
76
- /**
77
- * Base URL prepended to every request. When omitted, falls back to the adapter's server URL.
78
- */
79
- baseURL?: string;
80
- /**
81
- * Validate request and response bodies with schemas from `@kubb/plugin-zod`.
82
- *
83
- * @default false
84
- */
85
- validator?: ValidatorOptions;
86
- /**
87
- * Generates a class-based SDK instead of the standalone functions. Each tag client is an instance
88
- * class whose constructor takes a client config and builds its own client, so every environment is
89
- * a separate instance. Leave `sdk` unset to keep the standalone per-operation functions (the
90
- * default), which is also what query plugins consume.
91
- *
92
- * @example Instance class per tag
93
- * ```ts
94
- * pluginFetch({ sdk: {} })
95
- * // const api = new PetClient({ baseURL: 'https://api.example.com' })
96
- * // await api.getPetById({ path: { petId: 1 } })
97
- * ```
98
- * @example Composed root that instantiates every tag client from one config
99
- * ```ts
100
- * pluginFetch({ sdk: { name: 'petStore' } })
101
- * // class PetStore {
102
- * // readonly pet: PetClient
103
- * // readonly store: StoreClient
104
- * // constructor(config = {}) { ... }
105
- * // }
106
- * // const api = new PetStore({ baseURL })
107
- * // await api.pet.getPetById({ path: { petId: 1 } })
108
- * ```
109
- * @example Flat class with every operation as a direct method
110
- * ```ts
111
- * pluginFetch({ sdk: { name: 'petStore', mode: 'flat' } })
112
- * // const api = new PetStore({ baseURL })
113
- * // await api.getPetById({ path: { petId: 1 } })
114
- * ```
115
- */
116
- sdk?: {
117
- /**
118
- * How the SDK groups operations.
119
- * - `'tag'`: one class per tag. With `name`, a composed root instantiates every tag client.
120
- * - `'flat'`: one class named by `name`, with every operation as a direct method.
121
- *
122
- * @default 'tag'
123
- */
124
- mode?: Mode;
125
- /**
126
- * Name of the generated entry point, also the file name. With `mode: 'tag'` it emits a
127
- * composed root class that instantiates every tag client from one shared config. With
128
- * `mode: 'flat'` it names the single class.
129
- */
130
- name?: string;
131
- };
132
- /**
133
- * Override how names and file paths are built. Methods you omit fall back to the default resolver.
134
- */
135
- resolver?: Partial<ResolverClient> & ThisType<ResolverClient>;
136
- /**
137
- * Macros applied to each operation node before code is printed.
138
- */
139
- macros?: Array<ast.Macro>;
140
- };
141
- /**
142
- * The resolved options after defaults are applied.
143
- */
144
- type ResolvedOptions$1 = {
145
- output: Output;
146
- exclude: Array<Exclude>;
147
- include: Array<Include> | undefined;
148
- override: Array<Override<ResolvedOptions$1>>;
149
- group: Group | null;
150
- baseURL: Options$1['baseURL'];
151
- validator: NonNullable<Options$1['validator']>;
152
- sdk: {
153
- mode: Mode;
154
- name: string | undefined;
155
- } | undefined;
156
- resolver: ResolverClient;
157
- };
158
- //#endregion
159
3
  //#region ../../internals/client/src/resolveClient.d.ts
160
4
  /**
161
5
  * Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
@@ -343,7 +187,7 @@ type Mutation = {
343
187
  * HTTP methods treated as mutations. Operations using these methods produce
344
188
  * `useMutation`-style hooks.
345
189
  *
346
- * @default ['post', 'put', 'delete']
190
+ * @default ['post', 'put', 'patch', 'delete']
347
191
  */
348
192
  methods?: Array<string>;
349
193
  /**
@@ -387,8 +231,8 @@ type Infinite = {
387
231
  };
388
232
  type CustomOptions = {
389
233
  /**
390
- * Module specifier of your custom-options hook. Imported as
391
- * `import ${name} from '${importPath}'`.
234
+ * Module specifier of your custom-options hook. Imported as a named import,
235
+ * `import { ${name} } from '${importPath}'`.
392
236
  */
393
237
  importPath: string;
394
238
  /**
@@ -430,7 +274,7 @@ type Options = OutputOptions & {
430
274
  override?: Array<Override<ResolvedOptions>>;
431
275
  /**
432
276
  * Enables `useInfiniteQuery` hooks for cursor- or page-based pagination.
433
- * Pass an object to configure how the cursor is read; pass `false` to skip.
277
+ * Pass an object to configure how the cursor is read, or pass `false` to skip.
434
278
  *
435
279
  * @default false
436
280
  */
@@ -465,12 +309,6 @@ type Options = OutputOptions & {
465
309
  * `HookOptions` type so the wrapper stays in sync with generated hooks.
466
310
  */
467
311
  customOptions?: CustomOptions;
468
- /**
469
- * Validator applied to response bodies before they reach the caller.
470
- * - `'client'` — no validation. Trusts the API.
471
- * - `'zod'` — pipes responses through schemas from `@kubb/plugin-zod`.
472
- */
473
- validator?: Options$1['validator'];
474
312
  /**
475
313
  * Override how hook names and file paths are built. Methods you omit fall
476
314
  * back to the default `resolverReactQuery`.
@@ -509,9 +347,8 @@ type ResolvedOptions = {
509
347
  * The resolved contract client the generators import and call.
510
348
  */
511
349
  client: ResolvedClient;
512
- validator: NonNullable<Options['validator']>;
513
350
  /**
514
- * Only used for infinite
351
+ * Resolved infinite query configuration, or `false` when infinite queries are disabled.
515
352
  */
516
353
  infinite: NonNullable<Infinite> | false;
517
354
  suspense: Suspense | false;
@@ -540,8 +377,8 @@ declare global {
540
377
  declare const pluginReactQueryName = "plugin-react-query";
541
378
  /**
542
379
  * Generates one TanStack Query hook per OpenAPI operation for React. Queries
543
- * become `useFooQuery`/`useFooSuspenseQuery`/`useFooInfiniteQuery`; mutations
544
- * become `useFooMutation`. Each hook is fully typed: query keys, input
380
+ * become `useFoo`, with `useFooSuspense` and `useFooInfinite` variants.
381
+ * Mutations become `useFoo`. Each hook is fully typed: query keys, input
545
382
  * variables, response data, and error shape all come from the spec.
546
383
  *
547
384
  * @example
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@ import "./rolldown-runtime-C0LytTxp.js";
2
2
  import path from "node:path";
3
3
  import { ast, defineGenerator, definePlugin, defineResolver } from "@kubb/core";
4
4
  import { createFunctionParameter, createFunctionParameters, createObjectBindingPattern, createTypeLiteral, functionPrinter, pluginTsName } from "@kubb/plugin-ts";
5
- import { pluginZodName } from "@kubb/plugin-zod";
6
5
  import { File, Function, Type, jsxRenderer } from "@kubb/renderer-jsx";
7
6
  import { Fragment, jsx, jsxs } from "@kubb/renderer-jsx/jsx-runtime";
8
7
  import fs from "node:fs";
@@ -530,16 +529,6 @@ function createGroupConfig(group) {
530
529
  };
531
530
  }
532
531
  //#endregion
533
- //#region ../../internals/client/src/builders/validatorOptions.ts
534
- /**
535
- * Returns `true` when any direction of the validator uses zod (used for dependency checks).
536
- */
537
- function isValidatorEnabled(validator) {
538
- if (!validator) return false;
539
- if (validator === "zod") return true;
540
- return Boolean(validator.request || validator.response);
541
- }
542
- //#endregion
543
532
  //#region ../../internals/client/src/resolveClient.ts
544
533
  /**
545
534
  * Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
@@ -782,51 +771,6 @@ function resolveOperationOverrides(node, override) {
782
771
  return override.find((ov) => matchesPattern(node, ov))?.options ?? {};
783
772
  }
784
773
  /**
785
- * Returns `'zod'` when response-direction parsing is enabled.
786
- * The string shorthand `'zod'` also enables response parsing.
787
- */
788
- function resolveResponseParser(parser) {
789
- if (!parser) return null;
790
- if (parser === "zod") return "zod";
791
- return parser.response ?? null;
792
- }
793
- /**
794
- * Returns `'zod'` when request body parsing is enabled.
795
- * The string shorthand `'zod'` also enables request body parsing (existing behavior).
796
- */
797
- function resolveRequestParser(parser) {
798
- if (!parser) return null;
799
- if (parser === "zod") return "zod";
800
- return parser.request ?? null;
801
- }
802
- /**
803
- * Returns `'zod'` when query-params parsing is enabled.
804
- * Only the object form `{ request: 'zod' }` enables this. `parser: 'zod'` does not.
805
- */
806
- function resolveQueryParamsParser(parser) {
807
- if (!parser || parser === "zod") return null;
808
- return parser.request ?? null;
809
- }
810
- /**
811
- * Collects the Zod schema import names for an operation based on the active parser directions.
812
- *
813
- * - `parser: 'zod'`: response and request body names (backward-compatible behavior).
814
- * - `parser: { request: 'zod' }`: request body and query params names.
815
- * - `parser: { response: 'zod' }`: response name only.
816
- * - `parser: { request: 'zod', response: 'zod' }`: all three.
817
- *
818
- * Returns an empty array when no resolver is provided or `parser` is falsy.
819
- */
820
- function resolveZodSchemaNames(node, zodResolver, parser) {
821
- if (!zodResolver || !parser) return [];
822
- const { query: queryParams } = getOperationParameters(node, { paramsCasing: "original" });
823
- return [
824
- resolveResponseParser(parser) === "zod" ? zodResolver.resolveResponseName?.(node) : null,
825
- resolveRequestParser(parser) === "zod" && node.requestBody?.content?.[0]?.schema ? zodResolver.resolveDataName?.(node) : null,
826
- resolveQueryParamsParser(parser) === "zod" && queryParams.length > 0 ? zodResolver.resolveQueryParamsName?.(node, queryParams[0]) : null
827
- ].filter((n) => Boolean(n));
828
- }
829
- /**
830
774
  * Build QueryKey params as the grouped `{ path, query, body }` object (NO headers, NO config),
831
775
  * typed from the operation's `RequestConfig` minus `url`. The query key transformer reads the
832
776
  * grouped `path`/`query`/`body` bindings.
@@ -1816,7 +1760,7 @@ const infiniteQueryGenerator = defineGenerator({
1816
1760
  operation(node, ctx) {
1817
1761
  if (!ast.isHttpOperationNode(node)) return null;
1818
1762
  const { config, driver, resolver, root } = ctx;
1819
- const { output, query, mutation, infinite, validator, client, group, customOptions, hooks } = ctx.options;
1763
+ const { output, query, mutation, infinite, client, group, customOptions, hooks } = ctx.options;
1820
1764
  const pluginTs = driver.getPlugin(pluginTsName);
1821
1765
  if (!pluginTs) return null;
1822
1766
  const tsResolver = driver.getResolver(pluginTsName);
@@ -1866,14 +1810,6 @@ const infiniteQueryGenerator = defineGenerator({
1866
1810
  includeParams: false
1867
1811
  })
1868
1812
  ].filter((name) => Boolean(name));
1869
- const pluginZod = isValidatorEnabled(validator) ? driver.getPlugin(pluginZodName) : null;
1870
- const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null;
1871
- const fileZod = zodResolver ? zodResolver.resolveFile(operationFileEntry(node, node.operationId), {
1872
- root,
1873
- output: pluginZod?.options?.output ?? output,
1874
- group: pluginZod?.options?.group ?? void 0
1875
- }) : null;
1876
- const zodSchemaNames = resolveZodSchemaNames(node, zodResolver, validator);
1877
1813
  const calledClientName = contractOp.name;
1878
1814
  return /* @__PURE__ */ jsxs(File, {
1879
1815
  baseName: meta.file.baseName,
@@ -1896,11 +1832,6 @@ const infiniteQueryGenerator = defineGenerator({
1896
1832
  }
1897
1833
  }),
1898
1834
  children: [
1899
- fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
1900
- name: zodSchemaNames,
1901
- root: meta.file.path,
1902
- path: fileZod.path
1903
- }),
1904
1835
  /* @__PURE__ */ jsx(File.Import, {
1905
1836
  name: [contractOp.name],
1906
1837
  root: meta.file.path,
@@ -1994,7 +1925,7 @@ const mutationGenerator = defineGenerator({
1994
1925
  operation(node, ctx) {
1995
1926
  if (!ast.isHttpOperationNode(node)) return null;
1996
1927
  const { config, driver, resolver, root } = ctx;
1997
- const { output, query, mutation, validator, client, group, customOptions, hooks } = ctx.options;
1928
+ const { output, query, mutation, client, group, customOptions, hooks } = ctx.options;
1998
1929
  const pluginTs = driver.getPlugin(pluginTsName);
1999
1930
  if (!pluginTs) return null;
2000
1931
  const tsResolver = driver.getResolver(pluginTsName);
@@ -2030,14 +1961,6 @@ const mutationGenerator = defineGenerator({
2030
1961
  order: "body-response-first",
2031
1962
  includeParams: false
2032
1963
  })].filter((name) => Boolean(name));
2033
- const pluginZod = isValidatorEnabled(validator) ? driver.getPlugin(pluginZodName) : null;
2034
- const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null;
2035
- const fileZod = zodResolver ? zodResolver.resolveFile(operationFileEntry(node, node.operationId), {
2036
- root,
2037
- output: pluginZod?.options?.output ?? output,
2038
- group: pluginZod?.options?.group ?? void 0
2039
- }) : null;
2040
- const zodSchemaNames = resolveZodSchemaNames(node, zodResolver, validator);
2041
1964
  const calledClientName = contractOp.name;
2042
1965
  return /* @__PURE__ */ jsxs(File, {
2043
1966
  baseName: meta.file.baseName,
@@ -2060,11 +1983,6 @@ const mutationGenerator = defineGenerator({
2060
1983
  }
2061
1984
  }),
2062
1985
  children: [
2063
- fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
2064
- name: zodSchemaNames,
2065
- root: meta.file.path,
2066
- path: fileZod.path
2067
- }),
2068
1986
  /* @__PURE__ */ jsx(File.Import, {
2069
1987
  name: [contractOp.name],
2070
1988
  root: meta.file.path,
@@ -2143,7 +2061,7 @@ const queryGenerator = defineGenerator({
2143
2061
  operation(node, ctx) {
2144
2062
  if (!ast.isHttpOperationNode(node)) return null;
2145
2063
  const { config, driver, resolver, root } = ctx;
2146
- const { output, query, mutation, validator, client, group, customOptions, hooks } = ctx.options;
2064
+ const { output, query, mutation, client, group, customOptions, hooks } = ctx.options;
2147
2065
  const pluginTs = driver.getPlugin(pluginTsName);
2148
2066
  if (!pluginTs) return null;
2149
2067
  const tsResolver = driver.getResolver(pluginTsName);
@@ -2181,14 +2099,6 @@ const queryGenerator = defineGenerator({
2181
2099
  order: "body-response-first",
2182
2100
  includeParams: false
2183
2101
  })].filter((name) => Boolean(name));
2184
- const pluginZod = isValidatorEnabled(validator) ? driver.getPlugin(pluginZodName) : null;
2185
- const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null;
2186
- const fileZod = zodResolver ? zodResolver.resolveFile(operationFileEntry(node, node.operationId), {
2187
- root,
2188
- output: pluginZod?.options?.output ?? output,
2189
- group: pluginZod?.options?.group ?? void 0
2190
- }) : null;
2191
- const zodSchemaNames = resolveZodSchemaNames(node, zodResolver, validator);
2192
2102
  const calledClientName = contractOp.name;
2193
2103
  return /* @__PURE__ */ jsxs(File, {
2194
2104
  baseName: meta.file.baseName,
@@ -2211,11 +2121,6 @@ const queryGenerator = defineGenerator({
2211
2121
  }
2212
2122
  }),
2213
2123
  children: [
2214
- fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
2215
- name: zodSchemaNames,
2216
- root: meta.file.path,
2217
- path: fileZod.path
2218
- }),
2219
2124
  /* @__PURE__ */ jsx(File.Import, {
2220
2125
  name: [contractOp.name],
2221
2126
  root: meta.file.path,
@@ -2289,7 +2194,7 @@ const queryGenerator = defineGenerator({
2289
2194
  /**
2290
2195
  * Built-in generator for `useSuspenseInfiniteQuery` hooks. Enabled when both
2291
2196
  * `suspense` and `infinite` are configured. Combines suspense semantics with
2292
- * cursor-based pagination — handlers throw promises while loading and pull
2197
+ * cursor-based pagination. Handlers throw promises while loading and pull
2293
2198
  * additional pages on demand.
2294
2199
  */
2295
2200
  const suspenseInfiniteQueryGenerator = defineGenerator({
@@ -2298,7 +2203,7 @@ const suspenseInfiniteQueryGenerator = defineGenerator({
2298
2203
  operation(node, ctx) {
2299
2204
  if (!ast.isHttpOperationNode(node)) return null;
2300
2205
  const { config, driver, resolver, root } = ctx;
2301
- const { output, query, mutation, infinite, suspense, validator, client, group, customOptions, hooks } = ctx.options;
2206
+ const { output, query, mutation, infinite, suspense, client, group, customOptions, hooks } = ctx.options;
2302
2207
  const pluginTs = driver.getPlugin(pluginTsName);
2303
2208
  if (!pluginTs) return null;
2304
2209
  const tsResolver = driver.getResolver(pluginTsName);
@@ -2348,14 +2253,6 @@ const suspenseInfiniteQueryGenerator = defineGenerator({
2348
2253
  includeParams: false
2349
2254
  })
2350
2255
  ].filter((name) => Boolean(name));
2351
- const pluginZod = isValidatorEnabled(validator) ? driver.getPlugin(pluginZodName) : null;
2352
- const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null;
2353
- const fileZod = zodResolver ? zodResolver.resolveFile(operationFileEntry(node, node.operationId), {
2354
- root,
2355
- output: pluginZod?.options?.output ?? output,
2356
- group: pluginZod?.options?.group ?? void 0
2357
- }) : null;
2358
- const zodSchemaNames = resolveZodSchemaNames(node, zodResolver, validator);
2359
2256
  const calledClientName = contractOp.name;
2360
2257
  return /* @__PURE__ */ jsxs(File, {
2361
2258
  baseName: meta.file.baseName,
@@ -2378,11 +2275,6 @@ const suspenseInfiniteQueryGenerator = defineGenerator({
2378
2275
  }
2379
2276
  }),
2380
2277
  children: [
2381
- fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
2382
- name: zodSchemaNames,
2383
- root: meta.file.path,
2384
- path: fileZod.path
2385
- }),
2386
2278
  /* @__PURE__ */ jsx(File.Import, {
2387
2279
  name: [contractOp.name],
2388
2280
  root: meta.file.path,
@@ -2477,7 +2369,7 @@ const suspenseQueryGenerator = defineGenerator({
2477
2369
  operation(node, ctx) {
2478
2370
  if (!ast.isHttpOperationNode(node)) return null;
2479
2371
  const { config, driver, resolver, root } = ctx;
2480
- const { output, query, mutation, suspense, validator, client, group, customOptions, hooks } = ctx.options;
2372
+ const { output, query, mutation, suspense, client, group, customOptions, hooks } = ctx.options;
2481
2373
  const pluginTs = driver.getPlugin(pluginTsName);
2482
2374
  if (!pluginTs) return null;
2483
2375
  const tsResolver = driver.getResolver(pluginTsName);
@@ -2515,14 +2407,6 @@ const suspenseQueryGenerator = defineGenerator({
2515
2407
  order: "body-response-first",
2516
2408
  includeParams: false
2517
2409
  })].filter((name) => Boolean(name));
2518
- const pluginZod = isValidatorEnabled(validator) ? driver.getPlugin(pluginZodName) : null;
2519
- const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null;
2520
- const fileZod = zodResolver ? zodResolver.resolveFile(operationFileEntry(node, node.operationId), {
2521
- root,
2522
- output: pluginZod?.options?.output ?? output,
2523
- group: pluginZod?.options?.group ?? void 0
2524
- }) : null;
2525
- const zodSchemaNames = resolveZodSchemaNames(node, zodResolver, validator);
2526
2410
  const calledClientName = contractOp.name;
2527
2411
  return /* @__PURE__ */ jsxs(File, {
2528
2412
  baseName: meta.file.baseName,
@@ -2545,11 +2429,6 @@ const suspenseQueryGenerator = defineGenerator({
2545
2429
  }
2546
2430
  }),
2547
2431
  children: [
2548
- fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
2549
- name: zodSchemaNames,
2550
- root: meta.file.path,
2551
- path: fileZod.path
2552
- }),
2553
2432
  /* @__PURE__ */ jsx(File.Import, {
2554
2433
  name: [contractOp.name],
2555
2434
  root: meta.file.path,
@@ -2742,8 +2621,8 @@ const resolverReactQuery = defineResolver(() => ({
2742
2621
  const pluginReactQueryName = "plugin-react-query";
2743
2622
  /**
2744
2623
  * Generates one TanStack Query hook per OpenAPI operation for React. Queries
2745
- * become `useFooQuery`/`useFooSuspenseQuery`/`useFooInfiniteQuery`; mutations
2746
- * become `useFooMutation`. Each hook is fully typed: query keys, input
2624
+ * become `useFoo`, with `useFooSuspense` and `useFooInfinite` variants.
2625
+ * Mutations become `useFoo`. Each hook is fully typed: query keys, input
2747
2626
  * variables, response data, and error shape all come from the spec.
2748
2627
  *
2749
2628
  * @example
@@ -2769,7 +2648,7 @@ const pluginReactQuery = definePlugin((options) => {
2769
2648
  const { output = {
2770
2649
  path: "hooks",
2771
2650
  barrel: { type: "named" }
2772
- }, group, exclude = [], include, override = [], validator = false, suspense = {}, infinite = false, mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, customOptions, hooks = false, client, resolver: userResolver, macros: userMacros } = options;
2651
+ }, group, exclude = [], include, override = [], suspense = {}, infinite = false, mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, customOptions, hooks = false, client, resolver: userResolver, macros: userMacros } = options;
2773
2652
  const selectedGenerators = [
2774
2653
  queryGenerator,
2775
2654
  suspenseQueryGenerator,
@@ -2783,7 +2662,7 @@ const pluginReactQuery = definePlugin((options) => {
2783
2662
  return {
2784
2663
  name: pluginReactQueryName,
2785
2664
  options,
2786
- dependencies: [pluginTsName, isValidatorEnabled(validator) ? pluginZodName : void 0].filter((dependency) => Boolean(dependency)),
2665
+ dependencies: [pluginTsName],
2787
2666
  hooks: { "kubb:plugin:setup"(ctx) {
2788
2667
  const resolver = userResolver ? {
2789
2668
  ...resolverReactQuery,
@@ -2832,7 +2711,6 @@ const pluginReactQuery = definePlugin((options) => {
2832
2711
  ...customOptions
2833
2712
  } : null,
2834
2713
  hooks,
2835
- validator,
2836
2714
  group: groupConfig,
2837
2715
  exclude,
2838
2716
  include,