@kubb/plugin-vue-query 3.16.2 → 3.16.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 (39) hide show
  1. package/dist/components-ClNrCCre.cjs +873 -0
  2. package/dist/components-ClNrCCre.cjs.map +1 -0
  3. package/dist/components-D8lYnxao.js +803 -0
  4. package/dist/components-D8lYnxao.js.map +1 -0
  5. package/dist/components.cjs +9 -36
  6. package/dist/components.d.cts +266 -124
  7. package/dist/components.d.ts +266 -124
  8. package/dist/components.js +3 -3
  9. package/dist/generators-DIB6YtRr.js +556 -0
  10. package/dist/generators-DIB6YtRr.js.map +1 -0
  11. package/dist/generators-DIZQUvkg.cjs +573 -0
  12. package/dist/generators-DIZQUvkg.cjs.map +1 -0
  13. package/dist/generators.cjs +5 -20
  14. package/dist/generators.d.cts +12 -12
  15. package/dist/generators.d.ts +12 -12
  16. package/dist/generators.js +4 -4
  17. package/dist/index.cjs +118 -143
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6 -8
  20. package/dist/index.d.ts +6 -8
  21. package/dist/index.js +118 -137
  22. package/dist/index.js.map +1 -1
  23. package/dist/types-DPDni0p-.d.ts +1385 -0
  24. package/dist/types-UcJcIqHK.d.cts +1385 -0
  25. package/package.json +23 -28
  26. package/dist/chunk-5RO5VZAJ.js +0 -444
  27. package/dist/chunk-5RO5VZAJ.js.map +0 -1
  28. package/dist/chunk-BBSHBY5N.cjs +0 -448
  29. package/dist/chunk-BBSHBY5N.cjs.map +0 -1
  30. package/dist/chunk-KHEXOVSW.js +0 -726
  31. package/dist/chunk-KHEXOVSW.js.map +0 -1
  32. package/dist/chunk-ZR7DRLPY.cjs +0 -734
  33. package/dist/chunk-ZR7DRLPY.cjs.map +0 -1
  34. package/dist/components.cjs.map +0 -1
  35. package/dist/components.js.map +0 -1
  36. package/dist/generators.cjs.map +0 -1
  37. package/dist/generators.js.map +0 -1
  38. package/dist/types-CDzVWC17.d.cts +0 -164
  39. package/dist/types-CDzVWC17.d.ts +0 -164
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-vue-query",
3
- "version": "3.16.2",
3
+ "version": "3.16.3",
4
4
  "description": "Vue Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for Vue.js applications.",
5
5
  "keywords": [
6
6
  "vue-query",
@@ -29,25 +29,21 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "import": "./dist/index.js",
32
- "require": "./dist/index.cjs",
33
- "default": "./dist/index.cjs"
34
- },
35
- "./generators": {
36
- "import": "./dist/generators.js",
37
- "require": "./dist/generators.cjs",
38
- "default": "./dist/generators.cjs"
32
+ "require": "./dist/index.cjs"
39
33
  },
40
34
  "./components": {
41
35
  "import": "./dist/components.js",
42
- "require": "./dist/components.cjs",
43
- "default": "./dist/components.cjs"
36
+ "require": "./dist/components.cjs"
37
+ },
38
+ "./generators": {
39
+ "import": "./dist/generators.js",
40
+ "require": "./dist/generators.cjs"
44
41
  },
45
- "./package.json": "./package.json",
46
- "./*": "./*"
42
+ "./package.json": "./package.json"
47
43
  },
48
- "main": "dist/index.cjs",
49
- "module": "dist/index.js",
50
- "types": "./dist/index.d.ts",
44
+ "main": "./dist/index.cjs",
45
+ "module": "./dist/index.js",
46
+ "types": "./dist/index.d.cts",
51
47
  "typesVersions": {
52
48
  "*": {
53
49
  "components": [
@@ -66,21 +62,20 @@
66
62
  ],
67
63
  "dependencies": {
68
64
  "remeda": "^2.30.0",
69
- "@kubb/core": "3.16.2",
70
- "@kubb/oas": "3.16.2",
71
- "@kubb/plugin-client": "3.16.2",
72
- "@kubb/plugin-oas": "3.16.2",
73
- "@kubb/plugin-ts": "3.16.2",
74
- "@kubb/plugin-zod": "3.16.2",
75
- "@kubb/react": "3.16.2"
65
+ "@kubb/core": "3.16.3",
66
+ "@kubb/oas": "3.16.3",
67
+ "@kubb/plugin-client": "3.16.3",
68
+ "@kubb/plugin-oas": "3.16.3",
69
+ "@kubb/plugin-ts": "3.16.3",
70
+ "@kubb/plugin-zod": "3.16.3",
71
+ "@kubb/react": "3.16.3"
76
72
  },
77
73
  "devDependencies": {
78
74
  "@types/react": "^18.3.23",
79
75
  "react": "^18.3.1",
80
- "tsup": "^8.5.0",
76
+ "tsdown": "^0.14.1",
81
77
  "typescript": "^5.9.2",
82
- "@kubb/config-ts": "3.16.2",
83
- "@kubb/config-tsup": "3.16.2"
78
+ "@kubb/config-ts": "3.16.3"
84
79
  },
85
80
  "peerDependencies": {
86
81
  "@kubb/react": "^3.0.0"
@@ -93,13 +88,13 @@
93
88
  "registry": "https://registry.npmjs.org/"
94
89
  },
95
90
  "scripts": {
96
- "build": "tsup",
91
+ "build": "tsdown",
97
92
  "clean": "npx rimraf ./dist",
98
93
  "lint": "bun biome lint .",
99
- "lint:fix": "bun biome lint--fix --unsafe .",
94
+ "lint:fix": "bun biome lint --fix --unsafe .",
100
95
  "release": "pnpm publish --no-git-check",
101
96
  "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
102
- "start": "tsup --watch",
97
+ "start": "tsdown --watch",
103
98
  "test": "vitest --passWithNoTests",
104
99
  "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
105
100
  }
@@ -1,444 +0,0 @@
1
- import { QueryKey, QueryOptions, Query, MutationKey, Mutation, InfiniteQueryOptions, InfiniteQuery } from './chunk-KHEXOVSW.js';
2
- import { pluginClientName } from '@kubb/plugin-client';
3
- import { Client } from '@kubb/plugin-client/components';
4
- import { createReactGenerator } from '@kubb/plugin-oas';
5
- import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks';
6
- import { getFooter, getBanner } from '@kubb/plugin-oas/utils';
7
- import { pluginTsName } from '@kubb/plugin-ts';
8
- import { pluginZodName } from '@kubb/plugin-zod';
9
- import { useApp, File } from '@kubb/react';
10
- import { difference } from 'remeda';
11
- import { jsxs, jsx, Fragment } from '@kubb/react/jsx-runtime';
12
-
13
- var queryGenerator = createReactGenerator({
14
- name: "vue-query",
15
- Operation({ options, operation }) {
16
- const {
17
- plugin: {
18
- options: { output }
19
- },
20
- pluginManager
21
- } = useApp();
22
- const oas = useOas();
23
- const { getSchemas, getName, getFile } = useOperationManager();
24
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
25
- const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
26
- (method) => operation.method === method
27
- );
28
- const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
29
- const query = {
30
- name: getName(operation, { type: "function", prefix: "use" }),
31
- typeName: getName(operation, { type: "type" }),
32
- file: getFile(operation, { prefix: "use" })
33
- };
34
- const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
35
- const client = {
36
- name: hasClientPlugin ? getName(operation, {
37
- type: "function",
38
- pluginKey: [pluginClientName]
39
- }) : getName(operation, {
40
- type: "function"
41
- }),
42
- file: getFile(operation, { pluginKey: [pluginClientName] })
43
- };
44
- const queryOptions = {
45
- name: getName(operation, { type: "function", suffix: "QueryOptions" })
46
- };
47
- const queryKey = {
48
- name: getName(operation, { type: "const", suffix: "QueryKey" }),
49
- typeName: getName(operation, { type: "type", suffix: "QueryKey" })
50
- };
51
- const type = {
52
- file: getFile(operation, { pluginKey: [pluginTsName] }),
53
- //todo remove type?
54
- schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
55
- };
56
- const zod = {
57
- file: getFile(operation, { pluginKey: [pluginZodName] }),
58
- schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
59
- };
60
- if (!isQuery || isMutation) {
61
- return null;
62
- }
63
- return /* @__PURE__ */ jsxs(
64
- File,
65
- {
66
- baseName: query.file.baseName,
67
- path: query.file.path,
68
- meta: query.file.meta,
69
- banner: getBanner({ oas, output, config: pluginManager.config }),
70
- footer: getFooter({ oas, output }),
71
- children: [
72
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean), root: query.file.path, path: zod.file.path }),
73
- /* @__PURE__ */ jsx(File.Import, { name: ["toValue"], path: "vue" }),
74
- /* @__PURE__ */ jsx(File.Import, { name: ["MaybeRefOrGetter"], path: "vue", isTypeOnly: true }),
75
- /* @__PURE__ */ jsx(File.Import, { name: "fetch", path: options.client.importPath }),
76
- !!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, { name: [client.name], root: query.file.path, path: client.file.path }),
77
- /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
78
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
79
- /* @__PURE__ */ jsx(
80
- File.Import,
81
- {
82
- name: [
83
- type.schemas.request?.name,
84
- type.schemas.response.name,
85
- type.schemas.pathParams?.name,
86
- type.schemas.queryParams?.name,
87
- type.schemas.headerParams?.name,
88
- ...type.schemas.statusCodes?.map((item) => item.name) || []
89
- ].filter(Boolean),
90
- root: query.file.path,
91
- path: type.file.path,
92
- isTypeOnly: true
93
- }
94
- ),
95
- /* @__PURE__ */ jsx(
96
- QueryKey,
97
- {
98
- name: queryKey.name,
99
- typeName: queryKey.typeName,
100
- operation,
101
- paramsCasing: options.paramsCasing,
102
- pathParamsType: options.pathParamsType,
103
- typeSchemas: type.schemas,
104
- transformer: options.queryKey
105
- }
106
- ),
107
- !hasClientPlugin && /* @__PURE__ */ jsx(
108
- Client,
109
- {
110
- name: client.name,
111
- baseURL: options.client.baseURL,
112
- operation,
113
- typeSchemas: type.schemas,
114
- zodSchemas: zod.schemas,
115
- dataReturnType: options.client.dataReturnType,
116
- paramsCasing: options.paramsCasing,
117
- paramsType: options.paramsType,
118
- pathParamsType: options.pathParamsType,
119
- parser: options.parser
120
- }
121
- ),
122
- /* @__PURE__ */ jsx(File.Import, { name: ["queryOptions"], path: importPath }),
123
- /* @__PURE__ */ jsx(
124
- QueryOptions,
125
- {
126
- name: queryOptions.name,
127
- clientName: client.name,
128
- queryKeyName: queryKey.name,
129
- paramsCasing: options.paramsCasing,
130
- typeSchemas: type.schemas,
131
- paramsType: options.paramsType,
132
- pathParamsType: options.pathParamsType,
133
- dataReturnType: options.client.dataReturnType
134
- }
135
- ),
136
- options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
137
- /* @__PURE__ */ jsx(File.Import, { name: ["useQuery"], path: importPath }),
138
- /* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "QueryClient", "QueryObserverOptions", "UseQueryReturnType"], path: importPath, isTypeOnly: true }),
139
- /* @__PURE__ */ jsx(
140
- Query,
141
- {
142
- name: query.name,
143
- queryOptionsName: queryOptions.name,
144
- typeSchemas: type.schemas,
145
- paramsCasing: options.paramsCasing,
146
- paramsType: options.paramsType,
147
- pathParamsType: options.pathParamsType,
148
- operation,
149
- dataReturnType: options.client.dataReturnType,
150
- queryKeyName: queryKey.name,
151
- queryKeyTypeName: queryKey.typeName
152
- }
153
- )
154
- ] })
155
- ]
156
- }
157
- );
158
- }
159
- });
160
- var mutationGenerator = createReactGenerator({
161
- name: "vue-query",
162
- Operation({ options, operation }) {
163
- const {
164
- plugin: {
165
- options: { output }
166
- },
167
- pluginManager
168
- } = useApp();
169
- const oas = useOas();
170
- const { getSchemas, getName, getFile } = useOperationManager();
171
- const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
172
- const isMutation = !isQuery && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
173
- const importPath = options.mutation ? options.mutation.importPath : "@tanstack/vue-query";
174
- const mutation = {
175
- name: getName(operation, { type: "function", prefix: "use" }),
176
- typeName: getName(operation, { type: "type" }),
177
- file: getFile(operation, { prefix: "use" })
178
- };
179
- const type = {
180
- file: getFile(operation, { pluginKey: [pluginTsName] }),
181
- //todo remove type?
182
- schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
183
- };
184
- const zod = {
185
- file: getFile(operation, { pluginKey: [pluginZodName] }),
186
- schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
187
- };
188
- const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
189
- const client = {
190
- name: hasClientPlugin ? getName(operation, {
191
- type: "function",
192
- pluginKey: [pluginClientName]
193
- }) : getName(operation, {
194
- type: "function"
195
- }),
196
- file: getFile(operation, { pluginKey: [pluginClientName] })
197
- };
198
- const mutationKey = {
199
- name: getName(operation, { type: "const", suffix: "MutationKey" }),
200
- typeName: getName(operation, { type: "type", suffix: "MutationKey" })
201
- };
202
- if (!isMutation) {
203
- return null;
204
- }
205
- return /* @__PURE__ */ jsxs(
206
- File,
207
- {
208
- baseName: mutation.file.baseName,
209
- path: mutation.file.path,
210
- meta: mutation.file.meta,
211
- banner: getBanner({ oas, output, config: pluginManager.config }),
212
- footer: getFooter({ oas, output }),
213
- children: [
214
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean), root: mutation.file.path, path: zod.file.path }),
215
- /* @__PURE__ */ jsx(File.Import, { name: ["MaybeRefOrGetter"], path: "vue", isTypeOnly: true }),
216
- /* @__PURE__ */ jsx(File.Import, { name: "fetch", path: options.client.importPath }),
217
- !!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, { name: [client.name], root: mutation.file.path, path: client.file.path }),
218
- /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
219
- /* @__PURE__ */ jsx(
220
- File.Import,
221
- {
222
- name: [
223
- type.schemas.request?.name,
224
- type.schemas.response.name,
225
- type.schemas.pathParams?.name,
226
- type.schemas.queryParams?.name,
227
- type.schemas.headerParams?.name,
228
- ...type.schemas.statusCodes?.map((item) => item.name) || []
229
- ].filter(Boolean),
230
- root: mutation.file.path,
231
- path: type.file.path,
232
- isTypeOnly: true
233
- }
234
- ),
235
- /* @__PURE__ */ jsx(
236
- MutationKey,
237
- {
238
- name: mutationKey.name,
239
- typeName: mutationKey.typeName,
240
- operation,
241
- pathParamsType: options.pathParamsType,
242
- paramsCasing: options.paramsCasing,
243
- typeSchemas: type.schemas,
244
- transformer: options.mutationKey
245
- }
246
- ),
247
- !hasClientPlugin && /* @__PURE__ */ jsx(
248
- Client,
249
- {
250
- name: client.name,
251
- baseURL: options.client.baseURL,
252
- operation,
253
- typeSchemas: type.schemas,
254
- zodSchemas: zod.schemas,
255
- dataReturnType: options.client.dataReturnType,
256
- paramsCasing: options.paramsCasing,
257
- paramsType: options.paramsType,
258
- pathParamsType: options.pathParamsType,
259
- parser: options.parser
260
- }
261
- ),
262
- options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
263
- /* @__PURE__ */ jsx(File.Import, { name: ["useMutation"], path: importPath }),
264
- /* @__PURE__ */ jsx(File.Import, { name: ["MutationObserverOptions", "QueryClient"], path: importPath, isTypeOnly: true }),
265
- /* @__PURE__ */ jsx(
266
- Mutation,
267
- {
268
- name: mutation.name,
269
- clientName: client.name,
270
- typeName: mutation.typeName,
271
- typeSchemas: type.schemas,
272
- operation,
273
- paramsCasing: options.paramsCasing,
274
- dataReturnType: options.client.dataReturnType,
275
- paramsType: options.paramsType,
276
- pathParamsType: options.pathParamsType,
277
- mutationKeyName: mutationKey.name
278
- }
279
- )
280
- ] })
281
- ]
282
- }
283
- );
284
- }
285
- });
286
- var infiniteQueryGenerator = createReactGenerator({
287
- name: "vue-infinite-query",
288
- Operation({ options, operation }) {
289
- const {
290
- plugin: {
291
- options: { output }
292
- },
293
- pluginManager
294
- } = useApp();
295
- const oas = useOas();
296
- const { getSchemas, getName, getFile } = useOperationManager();
297
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
298
- const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
299
- (method) => operation.method === method
300
- );
301
- const isInfinite = isQuery && !!options.infinite;
302
- const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
303
- const query = {
304
- name: getName(operation, { type: "function", prefix: "use", suffix: "infinite" }),
305
- typeName: getName(operation, { type: "type" }),
306
- file: getFile(operation, { prefix: "use", suffix: "infinite" })
307
- };
308
- const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
309
- const client = {
310
- name: hasClientPlugin ? getName(operation, {
311
- type: "function",
312
- pluginKey: [pluginClientName]
313
- }) : getName(operation, {
314
- type: "function",
315
- suffix: "infinite"
316
- }),
317
- file: getFile(operation, { pluginKey: [pluginClientName] })
318
- };
319
- const queryOptions = {
320
- name: getName(operation, { type: "function", suffix: "InfiniteQueryOptions" })
321
- };
322
- const queryKey = {
323
- name: getName(operation, { type: "const", suffix: "InfiniteQueryKey" }),
324
- typeName: getName(operation, { type: "type", suffix: "InfiniteQueryKey" })
325
- };
326
- const type = {
327
- file: getFile(operation, { pluginKey: [pluginTsName] }),
328
- //todo remove type?
329
- schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
330
- };
331
- const zod = {
332
- file: getFile(operation, { pluginKey: [pluginZodName] }),
333
- schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
334
- };
335
- if (!isQuery || isMutation || !isInfinite) {
336
- return null;
337
- }
338
- return /* @__PURE__ */ jsxs(
339
- File,
340
- {
341
- baseName: query.file.baseName,
342
- path: query.file.path,
343
- meta: query.file.meta,
344
- banner: getBanner({ oas, output, config: pluginManager.config }),
345
- footer: getFooter({ oas, output }),
346
- children: [
347
- options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean), root: query.file.path, path: zod.file.path }),
348
- /* @__PURE__ */ jsx(File.Import, { name: ["toValue"], path: "vue" }),
349
- /* @__PURE__ */ jsx(File.Import, { name: ["MaybeRefOrGetter"], path: "vue", isTypeOnly: true }),
350
- /* @__PURE__ */ jsx(File.Import, { name: "fetch", path: options.client.importPath }),
351
- hasClientPlugin && /* @__PURE__ */ jsx(File.Import, { name: [client.name], root: query.file.path, path: client.file.path }),
352
- /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
353
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
354
- /* @__PURE__ */ jsx(
355
- File.Import,
356
- {
357
- name: [
358
- type.schemas.request?.name,
359
- type.schemas.response.name,
360
- type.schemas.pathParams?.name,
361
- type.schemas.queryParams?.name,
362
- type.schemas.headerParams?.name,
363
- ...type.schemas.statusCodes?.map((item) => item.name) || []
364
- ].filter(Boolean),
365
- root: query.file.path,
366
- path: type.file.path,
367
- isTypeOnly: true
368
- }
369
- ),
370
- /* @__PURE__ */ jsx(
371
- QueryKey,
372
- {
373
- name: queryKey.name,
374
- typeName: queryKey.typeName,
375
- operation,
376
- paramsCasing: options.paramsCasing,
377
- pathParamsType: options.pathParamsType,
378
- typeSchemas: type.schemas,
379
- transformer: options.queryKey
380
- }
381
- ),
382
- !hasClientPlugin && /* @__PURE__ */ jsx(
383
- Client,
384
- {
385
- name: client.name,
386
- baseURL: options.client.baseURL,
387
- operation,
388
- typeSchemas: type.schemas,
389
- zodSchemas: zod.schemas,
390
- dataReturnType: options.client.dataReturnType,
391
- paramsCasing: options.paramsCasing,
392
- paramsType: options.paramsType,
393
- pathParamsType: options.pathParamsType,
394
- parser: options.parser
395
- }
396
- ),
397
- options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
398
- /* @__PURE__ */ jsx(File.Import, { name: ["InfiniteData"], isTypeOnly: true, path: importPath }),
399
- /* @__PURE__ */ jsx(File.Import, { name: ["infiniteQueryOptions"], path: importPath }),
400
- /* @__PURE__ */ jsx(
401
- InfiniteQueryOptions,
402
- {
403
- name: queryOptions.name,
404
- clientName: client.name,
405
- queryKeyName: queryKey.name,
406
- typeSchemas: type.schemas,
407
- paramsType: options.paramsType,
408
- paramsCasing: options.paramsCasing,
409
- pathParamsType: options.pathParamsType,
410
- dataReturnType: options.client.dataReturnType,
411
- cursorParam: options.infinite.cursorParam,
412
- initialPageParam: options.infinite.initialPageParam,
413
- queryParam: options.infinite.queryParam
414
- }
415
- )
416
- ] }),
417
- options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
418
- /* @__PURE__ */ jsx(File.Import, { name: ["useInfiniteQuery"], path: importPath }),
419
- /* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "QueryClient", "InfiniteQueryObserverOptions", "UseInfiniteQueryReturnType"], path: importPath, isTypeOnly: true }),
420
- /* @__PURE__ */ jsx(
421
- InfiniteQuery,
422
- {
423
- name: query.name,
424
- queryOptionsName: queryOptions.name,
425
- typeSchemas: type.schemas,
426
- paramsCasing: options.paramsCasing,
427
- paramsType: options.paramsType,
428
- pathParamsType: options.pathParamsType,
429
- operation,
430
- dataReturnType: options.client.dataReturnType,
431
- queryKeyName: queryKey.name,
432
- queryKeyTypeName: queryKey.typeName
433
- }
434
- )
435
- ] })
436
- ]
437
- }
438
- );
439
- }
440
- });
441
-
442
- export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
443
- //# sourceMappingURL=chunk-5RO5VZAJ.js.map
444
- //# sourceMappingURL=chunk-5RO5VZAJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","difference","pluginTsName","pluginZodName","pluginClientName","jsxs","File","getBanner","getFooter","jsx","Client","Fragment"],"mappings":";;;;;;;;;;;;AAYO,IAAM,iBAAiB,oBAAqC,CAAA;AAAA,EACjE,IAAM,EAAA,WAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAA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AA,EAAe,gCAAgC,4BAA4B,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,4BAC3IG,GAAAA;AAAA,cAAC,aAAA;AAAA,cAAA;AAAA,gBACC,MAAM,KAAM,CAAA,IAAA;AAAA,gBACZ,kBAAkB,YAAa,CAAA,IAAA;AAAA,gBAC/B,aAAa,IAAK,CAAA,OAAA;AAAA,gBAClB,cAAc,OAAQ,CAAA,YAAA;AAAA,gBACtB,YAAY,OAAQ,CAAA,UAAA;AAAA,gBACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,gBACxB,SAAA;AAAA,gBACA,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,gBAC/B,cAAc,QAAS,CAAA,IAAA;AAAA,gBACvB,kBAAkB,QAAS,CAAA;AAAA;AAAA;AAC7B,WACF,EAAA;AAAA;AAAA;AAAA,KAEJ;AAAA;AAGN,CAAC","file":"chunk-5RO5VZAJ.js","sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryReturnType']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/vue-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-infinite-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const isInfinite = isQuery && !!options.infinite\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'infinite' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'InfiniteQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'InfiniteQueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation || !isInfinite) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.infinite && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n {options.infinite && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryReturnType']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"]}