@kubb/plugin-vue-query 5.0.0-alpha.9 → 5.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +1 -3
  3. package/dist/components-D1UhYFgY.js +1277 -0
  4. package/dist/components-D1UhYFgY.js.map +1 -0
  5. package/dist/components-qfOFRSoM.cjs +1367 -0
  6. package/dist/components-qfOFRSoM.cjs.map +1 -0
  7. package/dist/components.cjs +1 -1
  8. package/dist/components.d.ts +118 -109
  9. package/dist/components.js +1 -1
  10. package/dist/generators-C4gs_P1i.cjs +726 -0
  11. package/dist/generators-C4gs_P1i.cjs.map +1 -0
  12. package/dist/generators-CbnIVBgY.js +709 -0
  13. package/dist/generators-CbnIVBgY.js.map +1 -0
  14. package/dist/generators.cjs +1 -1
  15. package/dist/generators.d.ts +5 -501
  16. package/dist/generators.js +1 -1
  17. package/dist/index.cjs +106 -121
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +102 -121
  21. package/dist/index.js.map +1 -1
  22. package/dist/types-nVDTfuS1.d.ts +194 -0
  23. package/package.json +61 -64
  24. package/src/components/InfiniteQuery.tsx +104 -153
  25. package/src/components/InfiniteQueryOptions.tsx +122 -162
  26. package/src/components/Mutation.tsx +110 -136
  27. package/src/components/Query.tsx +102 -151
  28. package/src/components/QueryKey.tsx +68 -58
  29. package/src/components/QueryOptions.tsx +147 -139
  30. package/src/generators/infiniteQueryGenerator.tsx +165 -170
  31. package/src/generators/mutationGenerator.tsx +117 -124
  32. package/src/generators/queryGenerator.tsx +138 -136
  33. package/src/index.ts +1 -1
  34. package/src/plugin.ts +124 -175
  35. package/src/resolvers/resolverVueQuery.ts +19 -0
  36. package/src/types.ts +68 -48
  37. package/src/utils.ts +37 -0
  38. package/dist/components-Yjoe78Y7.cjs +0 -1119
  39. package/dist/components-Yjoe78Y7.cjs.map +0 -1
  40. package/dist/components-_AMBl0g-.js +0 -1029
  41. package/dist/components-_AMBl0g-.js.map +0 -1
  42. package/dist/generators-CR34GjVu.js +0 -661
  43. package/dist/generators-CR34GjVu.js.map +0 -1
  44. package/dist/generators-DH8VkK1q.cjs +0 -678
  45. package/dist/generators-DH8VkK1q.cjs.map +0 -1
  46. package/dist/types-CgDFUvfZ.d.ts +0 -211
@@ -1,661 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { a as InfiniteQuery, i as InfiniteQueryOptions, n as Mutation, o as QueryOptions, r as MutationKey, s as QueryKey, t as Query } from "./components-_AMBl0g-.js";
3
- import path from "node:path";
4
- import { pluginClientName } from "@kubb/plugin-client";
5
- import { pluginTsName } from "@kubb/plugin-ts";
6
- import { pluginZodName } from "@kubb/plugin-zod";
7
- import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
8
- import { File } from "@kubb/react-fabric";
9
- import { Fragment, jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
10
- import { Client } from "@kubb/plugin-client/components";
11
- import { usePluginDriver } from "@kubb/core/hooks";
12
- import { createReactGenerator } from "@kubb/plugin-oas/generators";
13
- import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
14
- import { difference } from "remeda";
15
- //#region src/generators/infiniteQueryGenerator.tsx
16
- const infiniteQueryGenerator = createReactGenerator({
17
- name: "vue-infinite-query",
18
- Operation({ config, operation, generator, plugin }) {
19
- const { options, options: { output } } = plugin;
20
- const driver = usePluginDriver();
21
- const oas = useOas();
22
- const { getSchemas, getName, getFile } = useOperationManager(generator);
23
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
24
- const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
25
- const isInfinite = isQuery && !!options.infinite;
26
- const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
27
- const query = {
28
- name: getName(operation, {
29
- type: "function",
30
- prefix: "use",
31
- suffix: "infinite"
32
- }),
33
- typeName: getName(operation, { type: "type" }),
34
- file: getFile(operation, {
35
- prefix: "use",
36
- suffix: "infinite"
37
- })
38
- };
39
- const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
40
- const client = {
41
- name: shouldUseClientPlugin ? getName(operation, {
42
- type: "function",
43
- pluginName: pluginClientName
44
- }) : getName(operation, {
45
- type: "function",
46
- suffix: "infinite"
47
- }),
48
- file: getFile(operation, { pluginName: pluginClientName })
49
- };
50
- const queryOptions = { name: getName(operation, {
51
- type: "function",
52
- suffix: "InfiniteQueryOptions"
53
- }) };
54
- const queryKey = {
55
- name: getName(operation, {
56
- type: "const",
57
- suffix: "InfiniteQueryKey"
58
- }),
59
- typeName: getName(operation, {
60
- type: "type",
61
- suffix: "InfiniteQueryKey"
62
- })
63
- };
64
- const type = {
65
- file: getFile(operation, { pluginName: pluginTsName }),
66
- schemas: getSchemas(operation, {
67
- pluginName: pluginTsName,
68
- type: "type"
69
- })
70
- };
71
- const zod = {
72
- file: getFile(operation, { pluginName: pluginZodName }),
73
- schemas: getSchemas(operation, {
74
- pluginName: pluginZodName,
75
- type: "function"
76
- })
77
- };
78
- if (!isQuery || isMutation || !isInfinite) return null;
79
- return /* @__PURE__ */ jsxs(File, {
80
- baseName: query.file.baseName,
81
- path: query.file.path,
82
- meta: query.file.meta,
83
- banner: getBanner({
84
- oas,
85
- output,
86
- config: driver.config
87
- }),
88
- footer: getFooter({
89
- oas,
90
- output
91
- }),
92
- children: [
93
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, {
94
- name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
95
- root: query.file.path,
96
- path: zod.file.path
97
- }),
98
- options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
99
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
100
- name: "fetch",
101
- path: options.client.importPath
102
- }),
103
- /* @__PURE__ */ jsx(File.Import, {
104
- name: [
105
- "Client",
106
- "RequestConfig",
107
- "ResponseErrorConfig"
108
- ],
109
- path: options.client.importPath,
110
- isTypeOnly: true
111
- }),
112
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
113
- name: ["ResponseConfig"],
114
- path: options.client.importPath,
115
- isTypeOnly: true
116
- })
117
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
118
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
119
- name: ["fetch"],
120
- root: query.file.path,
121
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts")
122
- }),
123
- /* @__PURE__ */ jsx(File.Import, {
124
- name: [
125
- "Client",
126
- "RequestConfig",
127
- "ResponseErrorConfig"
128
- ],
129
- root: query.file.path,
130
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
131
- isTypeOnly: true
132
- }),
133
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
134
- name: ["ResponseConfig"],
135
- root: query.file.path,
136
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
137
- isTypeOnly: true
138
- })
139
- ] }),
140
- /* @__PURE__ */ jsx(File.Import, {
141
- name: ["toValue"],
142
- path: "vue"
143
- }),
144
- /* @__PURE__ */ jsx(File.Import, {
145
- name: ["MaybeRefOrGetter"],
146
- path: "vue",
147
- isTypeOnly: true
148
- }),
149
- shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
150
- name: [client.name],
151
- root: query.file.path,
152
- path: client.file.path
153
- }),
154
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
155
- name: ["buildFormData"],
156
- root: query.file.path,
157
- path: path.resolve(config.root, config.output.path, ".kubb/config.ts")
158
- }),
159
- /* @__PURE__ */ jsx(File.Import, {
160
- name: [
161
- type.schemas.request?.name,
162
- type.schemas.response.name,
163
- type.schemas.pathParams?.name,
164
- type.schemas.queryParams?.name,
165
- type.schemas.headerParams?.name,
166
- ...type.schemas.statusCodes?.map((item) => item.name) || []
167
- ].filter(Boolean),
168
- root: query.file.path,
169
- path: type.file.path,
170
- isTypeOnly: true
171
- }),
172
- /* @__PURE__ */ jsx(QueryKey, {
173
- name: queryKey.name,
174
- typeName: queryKey.typeName,
175
- operation,
176
- paramsCasing: options.paramsCasing,
177
- pathParamsType: options.pathParamsType,
178
- typeSchemas: type.schemas,
179
- transformer: options.queryKey
180
- }),
181
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(Client, {
182
- name: client.name,
183
- baseURL: options.client.baseURL,
184
- operation,
185
- typeSchemas: type.schemas,
186
- zodSchemas: zod.schemas,
187
- dataReturnType: options.client.dataReturnType || "data",
188
- paramsCasing: options.client?.paramsCasing || options.paramsCasing,
189
- paramsType: options.paramsType,
190
- pathParamsType: options.pathParamsType,
191
- parser: options.parser
192
- }),
193
- options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
194
- /* @__PURE__ */ jsx(File.Import, {
195
- name: ["InfiniteData"],
196
- isTypeOnly: true,
197
- path: importPath
198
- }),
199
- /* @__PURE__ */ jsx(File.Import, {
200
- name: ["infiniteQueryOptions"],
201
- path: importPath
202
- }),
203
- /* @__PURE__ */ jsx(InfiniteQueryOptions, {
204
- name: queryOptions.name,
205
- clientName: client.name,
206
- queryKeyName: queryKey.name,
207
- typeSchemas: type.schemas,
208
- paramsType: options.paramsType,
209
- paramsCasing: options.paramsCasing,
210
- pathParamsType: options.pathParamsType,
211
- dataReturnType: options.client.dataReturnType || "data",
212
- cursorParam: options.infinite.cursorParam,
213
- nextParam: options.infinite.nextParam,
214
- previousParam: options.infinite.previousParam,
215
- initialPageParam: options.infinite.initialPageParam,
216
- queryParam: options.infinite.queryParam
217
- })
218
- ] }),
219
- options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
220
- /* @__PURE__ */ jsx(File.Import, {
221
- name: ["useInfiniteQuery"],
222
- path: importPath
223
- }),
224
- /* @__PURE__ */ jsx(File.Import, {
225
- name: [
226
- "QueryKey",
227
- "QueryClient",
228
- "UseInfiniteQueryOptions",
229
- "UseInfiniteQueryReturnType"
230
- ],
231
- path: importPath,
232
- isTypeOnly: true
233
- }),
234
- /* @__PURE__ */ jsx(InfiniteQuery, {
235
- name: query.name,
236
- queryOptionsName: queryOptions.name,
237
- typeSchemas: type.schemas,
238
- paramsCasing: options.paramsCasing,
239
- paramsType: options.paramsType,
240
- pathParamsType: options.pathParamsType,
241
- operation,
242
- dataReturnType: options.client.dataReturnType || "data",
243
- queryKeyName: queryKey.name,
244
- queryKeyTypeName: queryKey.typeName
245
- })
246
- ] })
247
- ]
248
- });
249
- }
250
- });
251
- //#endregion
252
- //#region src/generators/mutationGenerator.tsx
253
- const mutationGenerator = createReactGenerator({
254
- name: "vue-query",
255
- Operation({ config, operation, generator, plugin }) {
256
- const { options, options: { output } } = plugin;
257
- const driver = usePluginDriver();
258
- const oas = useOas();
259
- const { getSchemas, getName, getFile } = useOperationManager(generator);
260
- const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
261
- const isMutation = options.mutation !== false && !isQuery && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
262
- const importPath = options.mutation ? options.mutation.importPath : "@tanstack/vue-query";
263
- const mutation = {
264
- name: getName(operation, {
265
- type: "function",
266
- prefix: "use"
267
- }),
268
- typeName: getName(operation, { type: "type" }),
269
- file: getFile(operation, { prefix: "use" })
270
- };
271
- const type = {
272
- file: getFile(operation, { pluginName: pluginTsName }),
273
- schemas: getSchemas(operation, {
274
- pluginName: pluginTsName,
275
- type: "type"
276
- })
277
- };
278
- const zod = {
279
- file: getFile(operation, { pluginName: pluginZodName }),
280
- schemas: getSchemas(operation, {
281
- pluginName: pluginZodName,
282
- type: "function"
283
- })
284
- };
285
- const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
286
- const client = {
287
- name: shouldUseClientPlugin ? getName(operation, {
288
- type: "function",
289
- pluginName: pluginClientName
290
- }) : getName(operation, { type: "function" }),
291
- file: getFile(operation, { pluginName: pluginClientName })
292
- };
293
- const mutationKey = {
294
- name: getName(operation, {
295
- type: "const",
296
- suffix: "MutationKey"
297
- }),
298
- typeName: getName(operation, {
299
- type: "type",
300
- suffix: "MutationKey"
301
- })
302
- };
303
- if (!isMutation) return null;
304
- return /* @__PURE__ */ jsxs(File, {
305
- baseName: mutation.file.baseName,
306
- path: mutation.file.path,
307
- meta: mutation.file.meta,
308
- banner: getBanner({
309
- oas,
310
- output,
311
- config: driver.config
312
- }),
313
- footer: getFooter({
314
- oas,
315
- output
316
- }),
317
- children: [
318
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, {
319
- name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
320
- root: mutation.file.path,
321
- path: zod.file.path
322
- }),
323
- options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
324
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
325
- name: "fetch",
326
- path: options.client.importPath
327
- }),
328
- /* @__PURE__ */ jsx(File.Import, {
329
- name: [
330
- "Client",
331
- "RequestConfig",
332
- "ResponseErrorConfig"
333
- ],
334
- path: options.client.importPath,
335
- isTypeOnly: true
336
- }),
337
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
338
- name: ["ResponseConfig"],
339
- path: options.client.importPath,
340
- isTypeOnly: true
341
- })
342
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
343
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
344
- name: ["fetch"],
345
- root: mutation.file.path,
346
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts")
347
- }),
348
- /* @__PURE__ */ jsx(File.Import, {
349
- name: [
350
- "Client",
351
- "RequestConfig",
352
- "ResponseErrorConfig"
353
- ],
354
- root: mutation.file.path,
355
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
356
- isTypeOnly: true
357
- }),
358
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
359
- name: ["ResponseConfig"],
360
- root: mutation.file.path,
361
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
362
- isTypeOnly: true
363
- })
364
- ] }),
365
- /* @__PURE__ */ jsx(File.Import, {
366
- name: ["MaybeRefOrGetter"],
367
- path: "vue",
368
- isTypeOnly: true
369
- }),
370
- shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
371
- name: [client.name],
372
- root: mutation.file.path,
373
- path: client.file.path
374
- }),
375
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
376
- name: ["buildFormData"],
377
- root: mutation.file.path,
378
- path: path.resolve(config.root, config.output.path, ".kubb/config.ts")
379
- }),
380
- /* @__PURE__ */ jsx(File.Import, {
381
- name: [
382
- type.schemas.request?.name,
383
- type.schemas.response.name,
384
- type.schemas.pathParams?.name,
385
- type.schemas.queryParams?.name,
386
- type.schemas.headerParams?.name,
387
- ...type.schemas.statusCodes?.map((item) => item.name) || []
388
- ].filter(Boolean),
389
- root: mutation.file.path,
390
- path: type.file.path,
391
- isTypeOnly: true
392
- }),
393
- /* @__PURE__ */ jsx(MutationKey, {
394
- name: mutationKey.name,
395
- typeName: mutationKey.typeName,
396
- operation,
397
- pathParamsType: options.pathParamsType,
398
- paramsCasing: options.paramsCasing,
399
- typeSchemas: type.schemas,
400
- transformer: options.mutationKey
401
- }),
402
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(Client, {
403
- name: client.name,
404
- baseURL: options.client.baseURL,
405
- operation,
406
- typeSchemas: type.schemas,
407
- zodSchemas: zod.schemas,
408
- dataReturnType: options.client.dataReturnType || "data",
409
- paramsCasing: options.client?.paramsCasing || options.paramsCasing,
410
- paramsType: options.paramsType,
411
- pathParamsType: options.pathParamsType,
412
- parser: options.parser
413
- }),
414
- options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
415
- /* @__PURE__ */ jsx(File.Import, {
416
- name: ["useMutation"],
417
- path: importPath
418
- }),
419
- /* @__PURE__ */ jsx(File.Import, {
420
- name: ["MutationObserverOptions", "QueryClient"],
421
- path: importPath,
422
- isTypeOnly: true
423
- }),
424
- /* @__PURE__ */ jsx(Mutation, {
425
- name: mutation.name,
426
- clientName: client.name,
427
- typeName: mutation.typeName,
428
- typeSchemas: type.schemas,
429
- operation,
430
- paramsCasing: options.paramsCasing,
431
- dataReturnType: options.client.dataReturnType || "data",
432
- paramsType: options.paramsType,
433
- pathParamsType: options.pathParamsType,
434
- mutationKeyName: mutationKey.name
435
- })
436
- ] })
437
- ]
438
- });
439
- }
440
- });
441
- //#endregion
442
- //#region src/generators/queryGenerator.tsx
443
- const queryGenerator = createReactGenerator({
444
- name: "vue-query",
445
- Operation({ config, operation, generator, plugin }) {
446
- const { options, options: { output } } = plugin;
447
- const driver = usePluginDriver();
448
- const oas = useOas();
449
- const { getSchemas, getName, getFile } = useOperationManager(generator);
450
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
451
- const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
452
- const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
453
- const query = {
454
- name: getName(operation, {
455
- type: "function",
456
- prefix: "use"
457
- }),
458
- typeName: getName(operation, { type: "type" }),
459
- file: getFile(operation, { prefix: "use" })
460
- };
461
- const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
462
- const client = {
463
- name: shouldUseClientPlugin ? getName(operation, {
464
- type: "function",
465
- pluginName: pluginClientName
466
- }) : getName(operation, { type: "function" }),
467
- file: getFile(operation, { pluginName: pluginClientName })
468
- };
469
- const queryOptions = { name: getName(operation, {
470
- type: "function",
471
- suffix: "QueryOptions"
472
- }) };
473
- const queryKey = {
474
- name: getName(operation, {
475
- type: "const",
476
- suffix: "QueryKey"
477
- }),
478
- typeName: getName(operation, {
479
- type: "type",
480
- suffix: "QueryKey"
481
- })
482
- };
483
- const type = {
484
- file: getFile(operation, { pluginName: pluginTsName }),
485
- schemas: getSchemas(operation, {
486
- pluginName: pluginTsName,
487
- type: "type"
488
- })
489
- };
490
- const zod = {
491
- file: getFile(operation, { pluginName: pluginZodName }),
492
- schemas: getSchemas(operation, {
493
- pluginName: pluginZodName,
494
- type: "function"
495
- })
496
- };
497
- if (!isQuery || isMutation) return null;
498
- return /* @__PURE__ */ jsxs(File, {
499
- baseName: query.file.baseName,
500
- path: query.file.path,
501
- meta: query.file.meta,
502
- banner: getBanner({
503
- oas,
504
- output,
505
- config: driver.config
506
- }),
507
- footer: getFooter({
508
- oas,
509
- output
510
- }),
511
- children: [
512
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, {
513
- name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
514
- root: query.file.path,
515
- path: zod.file.path
516
- }),
517
- options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
518
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
519
- name: "fetch",
520
- path: options.client.importPath
521
- }),
522
- /* @__PURE__ */ jsx(File.Import, {
523
- name: [
524
- "Client",
525
- "RequestConfig",
526
- "ResponseErrorConfig"
527
- ],
528
- path: options.client.importPath,
529
- isTypeOnly: true
530
- }),
531
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
532
- name: ["ResponseConfig"],
533
- path: options.client.importPath,
534
- isTypeOnly: true
535
- })
536
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
537
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
538
- name: ["fetch"],
539
- root: query.file.path,
540
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts")
541
- }),
542
- /* @__PURE__ */ jsx(File.Import, {
543
- name: [
544
- "Client",
545
- "RequestConfig",
546
- "ResponseErrorConfig"
547
- ],
548
- root: query.file.path,
549
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
550
- isTypeOnly: true
551
- }),
552
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
553
- name: ["ResponseConfig"],
554
- root: query.file.path,
555
- path: path.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
556
- isTypeOnly: true
557
- })
558
- ] }),
559
- /* @__PURE__ */ jsx(File.Import, {
560
- name: ["toValue"],
561
- path: "vue"
562
- }),
563
- /* @__PURE__ */ jsx(File.Import, {
564
- name: ["MaybeRefOrGetter"],
565
- path: "vue",
566
- isTypeOnly: true
567
- }),
568
- shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
569
- name: [client.name],
570
- root: query.file.path,
571
- path: client.file.path
572
- }),
573
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
574
- name: ["buildFormData"],
575
- root: query.file.path,
576
- path: path.resolve(config.root, config.output.path, ".kubb/config.ts")
577
- }),
578
- /* @__PURE__ */ jsx(File.Import, {
579
- name: [
580
- type.schemas.request?.name,
581
- type.schemas.response.name,
582
- type.schemas.pathParams?.name,
583
- type.schemas.queryParams?.name,
584
- type.schemas.headerParams?.name,
585
- ...type.schemas.statusCodes?.map((item) => item.name) || []
586
- ].filter(Boolean),
587
- root: query.file.path,
588
- path: type.file.path,
589
- isTypeOnly: true
590
- }),
591
- /* @__PURE__ */ jsx(QueryKey, {
592
- name: queryKey.name,
593
- typeName: queryKey.typeName,
594
- operation,
595
- paramsCasing: options.paramsCasing,
596
- pathParamsType: options.pathParamsType,
597
- typeSchemas: type.schemas,
598
- transformer: options.queryKey
599
- }),
600
- !shouldUseClientPlugin && /* @__PURE__ */ jsx(Client, {
601
- name: client.name,
602
- baseURL: options.client.baseURL,
603
- operation,
604
- typeSchemas: type.schemas,
605
- zodSchemas: zod.schemas,
606
- dataReturnType: options.client.dataReturnType || "data",
607
- paramsCasing: options.client?.paramsCasing || options.paramsCasing,
608
- paramsType: options.paramsType,
609
- pathParamsType: options.pathParamsType,
610
- parser: options.parser
611
- }),
612
- /* @__PURE__ */ jsx(File.Import, {
613
- name: ["queryOptions"],
614
- path: importPath
615
- }),
616
- /* @__PURE__ */ jsx(QueryOptions, {
617
- name: queryOptions.name,
618
- clientName: client.name,
619
- queryKeyName: queryKey.name,
620
- paramsCasing: options.paramsCasing,
621
- typeSchemas: type.schemas,
622
- paramsType: options.paramsType,
623
- pathParamsType: options.pathParamsType,
624
- dataReturnType: options.client.dataReturnType || "data"
625
- }),
626
- options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
627
- /* @__PURE__ */ jsx(File.Import, {
628
- name: ["useQuery"],
629
- path: importPath
630
- }),
631
- /* @__PURE__ */ jsx(File.Import, {
632
- name: [
633
- "QueryKey",
634
- "QueryClient",
635
- "UseQueryOptions",
636
- "UseQueryReturnType"
637
- ],
638
- path: importPath,
639
- isTypeOnly: true
640
- }),
641
- /* @__PURE__ */ jsx(Query, {
642
- name: query.name,
643
- queryOptionsName: queryOptions.name,
644
- typeSchemas: type.schemas,
645
- paramsCasing: options.paramsCasing,
646
- paramsType: options.paramsType,
647
- pathParamsType: options.pathParamsType,
648
- operation,
649
- dataReturnType: options.client.dataReturnType || "data",
650
- queryKeyName: queryKey.name,
651
- queryKeyTypeName: queryKey.typeName
652
- })
653
- ] })
654
- ]
655
- });
656
- }
657
- });
658
- //#endregion
659
- export { mutationGenerator as n, infiniteQueryGenerator as r, queryGenerator as t };
660
-
661
- //# sourceMappingURL=generators-CR34GjVu.js.map