@kubb/plugin-vue-query 3.4.4 → 3.5.0
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/chunk-HUKJLE4A.cjs +424 -0
- package/dist/chunk-HUKJLE4A.cjs.map +1 -0
- package/dist/chunk-VTRFZL5E.js +420 -0
- package/dist/chunk-VTRFZL5E.js.map +1 -0
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{types-B6HlLDzG.d.cts → types-DKq2nW8w.d.cts} +7 -7
- package/dist/{types-B6HlLDzG.d.ts → types-DKq2nW8w.d.ts} +7 -7
- package/package.json +11 -11
- package/src/generators/infiniteQueryGenerator.tsx +10 -3
- package/src/generators/mutationGenerator.tsx +10 -2
- package/src/generators/queryGenerator.tsx +10 -2
- package/src/types.ts +3 -3
- package/dist/chunk-KQSFBSYB.js +0 -386
- package/dist/chunk-KQSFBSYB.js.map +0 -1
- package/dist/chunk-P5FF4CZ7.cjs +0 -390
- package/dist/chunk-P5FF4CZ7.cjs.map +0 -1
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { QueryKey, Client, QueryOptions, Query, MutationKey, Mutation, InfiniteQueryOptions, InfiniteQuery } from './chunk-N6FQE7MO.js';
|
|
2
|
+
import { createReactGenerator } from '@kubb/plugin-oas';
|
|
3
|
+
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks';
|
|
4
|
+
import { getBanner, getFooter } from '@kubb/plugin-oas/utils';
|
|
5
|
+
import { pluginTsName } from '@kubb/plugin-ts';
|
|
6
|
+
import { pluginZodName } from '@kubb/plugin-zod';
|
|
7
|
+
import { useApp, File } from '@kubb/react';
|
|
8
|
+
import { difference } from 'remeda';
|
|
9
|
+
import { jsxs, jsx, Fragment } from '@kubb/react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var queryGenerator = createReactGenerator({
|
|
12
|
+
name: "vue-query",
|
|
13
|
+
Operation({ options, operation }) {
|
|
14
|
+
const {
|
|
15
|
+
plugin: {
|
|
16
|
+
options: { output }
|
|
17
|
+
}
|
|
18
|
+
} = useApp();
|
|
19
|
+
const oas = useOas();
|
|
20
|
+
const { getSchemas, getName, getFile } = useOperationManager();
|
|
21
|
+
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
22
|
+
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
|
|
23
|
+
(method) => operation.method === method
|
|
24
|
+
);
|
|
25
|
+
const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
|
|
26
|
+
const query = {
|
|
27
|
+
name: getName(operation, { type: "function", prefix: "use" }),
|
|
28
|
+
typeName: getName(operation, { type: "type" }),
|
|
29
|
+
file: getFile(operation, { prefix: "use" })
|
|
30
|
+
};
|
|
31
|
+
const client = {
|
|
32
|
+
name: getName(operation, { type: "function" })
|
|
33
|
+
};
|
|
34
|
+
const queryOptions = {
|
|
35
|
+
name: getName(operation, { type: "function", suffix: "QueryOptions" })
|
|
36
|
+
};
|
|
37
|
+
const queryKey = {
|
|
38
|
+
name: getName(operation, { type: "const", suffix: "QueryKey" }),
|
|
39
|
+
typeName: getName(operation, { type: "type", suffix: "QueryKey" })
|
|
40
|
+
};
|
|
41
|
+
const type = {
|
|
42
|
+
file: getFile(operation, { pluginKey: [pluginTsName] }),
|
|
43
|
+
//todo remove type?
|
|
44
|
+
schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
|
|
45
|
+
};
|
|
46
|
+
const zod = {
|
|
47
|
+
file: getFile(operation, { pluginKey: [pluginZodName] }),
|
|
48
|
+
schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
|
|
49
|
+
};
|
|
50
|
+
if (!isQuery || isMutation) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ jsxs(
|
|
54
|
+
File,
|
|
55
|
+
{
|
|
56
|
+
baseName: query.file.baseName,
|
|
57
|
+
path: query.file.path,
|
|
58
|
+
meta: query.file.meta,
|
|
59
|
+
banner: getBanner({ oas, output }),
|
|
60
|
+
footer: getFooter({ oas, output }),
|
|
61
|
+
children: [
|
|
62
|
+
options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
|
|
63
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["unref"], path: "vue" }),
|
|
64
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
|
|
65
|
+
/* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
|
|
66
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
67
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
File.Import,
|
|
70
|
+
{
|
|
71
|
+
name: [
|
|
72
|
+
type.schemas.request?.name,
|
|
73
|
+
type.schemas.response.name,
|
|
74
|
+
type.schemas.pathParams?.name,
|
|
75
|
+
type.schemas.queryParams?.name,
|
|
76
|
+
type.schemas.headerParams?.name,
|
|
77
|
+
...type.schemas.statusCodes?.map((item) => item.name) || []
|
|
78
|
+
].filter(Boolean),
|
|
79
|
+
root: query.file.path,
|
|
80
|
+
path: type.file.path,
|
|
81
|
+
isTypeOnly: true
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
QueryKey,
|
|
86
|
+
{
|
|
87
|
+
name: queryKey.name,
|
|
88
|
+
typeName: queryKey.typeName,
|
|
89
|
+
operation,
|
|
90
|
+
paramsCasing: options.paramsCasing,
|
|
91
|
+
pathParamsType: options.pathParamsType,
|
|
92
|
+
typeSchemas: type.schemas,
|
|
93
|
+
transformer: options.queryKey
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Client,
|
|
98
|
+
{
|
|
99
|
+
name: client.name,
|
|
100
|
+
isExportable: false,
|
|
101
|
+
isIndexable: false,
|
|
102
|
+
baseURL: options.client.baseURL,
|
|
103
|
+
operation,
|
|
104
|
+
typeSchemas: type.schemas,
|
|
105
|
+
zodSchemas: zod.schemas,
|
|
106
|
+
dataReturnType: options.client.dataReturnType,
|
|
107
|
+
paramsCasing: options.paramsCasing,
|
|
108
|
+
paramsType: options.paramsType,
|
|
109
|
+
pathParamsType: options.pathParamsType,
|
|
110
|
+
parser: options.parser
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["queryOptions"], path: importPath }),
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
QueryOptions,
|
|
116
|
+
{
|
|
117
|
+
name: queryOptions.name,
|
|
118
|
+
clientName: client.name,
|
|
119
|
+
queryKeyName: queryKey.name,
|
|
120
|
+
paramsCasing: options.paramsCasing,
|
|
121
|
+
typeSchemas: type.schemas,
|
|
122
|
+
paramsType: options.paramsType,
|
|
123
|
+
pathParamsType: options.pathParamsType,
|
|
124
|
+
dataReturnType: options.client.dataReturnType
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["useQuery"], path: importPath }),
|
|
129
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "QueryObserverOptions", "UseQueryReturnType"], path: importPath, isTypeOnly: true }),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
Query,
|
|
132
|
+
{
|
|
133
|
+
name: query.name,
|
|
134
|
+
queryOptionsName: queryOptions.name,
|
|
135
|
+
typeSchemas: type.schemas,
|
|
136
|
+
paramsCasing: options.paramsCasing,
|
|
137
|
+
paramsType: options.paramsType,
|
|
138
|
+
pathParamsType: options.pathParamsType,
|
|
139
|
+
operation,
|
|
140
|
+
dataReturnType: options.client.dataReturnType,
|
|
141
|
+
queryKeyName: queryKey.name,
|
|
142
|
+
queryKeyTypeName: queryKey.typeName
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
var mutationGenerator = createReactGenerator({
|
|
152
|
+
name: "vue-query",
|
|
153
|
+
Operation({ options, operation }) {
|
|
154
|
+
const {
|
|
155
|
+
plugin: {
|
|
156
|
+
options: { output }
|
|
157
|
+
}
|
|
158
|
+
} = useApp();
|
|
159
|
+
const oas = useOas();
|
|
160
|
+
const { getSchemas, getName, getFile } = useOperationManager();
|
|
161
|
+
const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
|
|
162
|
+
const isMutation = !isQuery && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
|
|
163
|
+
const importPath = options.mutation ? options.mutation.importPath : "@tanstack/vue-query";
|
|
164
|
+
const mutation = {
|
|
165
|
+
name: getName(operation, { type: "function", prefix: "use" }),
|
|
166
|
+
typeName: getName(operation, { type: "type" }),
|
|
167
|
+
file: getFile(operation, { prefix: "use" })
|
|
168
|
+
};
|
|
169
|
+
const type = {
|
|
170
|
+
file: getFile(operation, { pluginKey: [pluginTsName] }),
|
|
171
|
+
//todo remove type?
|
|
172
|
+
schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
|
|
173
|
+
};
|
|
174
|
+
const zod = {
|
|
175
|
+
file: getFile(operation, { pluginKey: [pluginZodName] }),
|
|
176
|
+
schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
|
|
177
|
+
};
|
|
178
|
+
const client = {
|
|
179
|
+
name: getName(operation, { type: "function" })
|
|
180
|
+
};
|
|
181
|
+
const mutationKey = {
|
|
182
|
+
name: getName(operation, { type: "const", suffix: "MutationKey" }),
|
|
183
|
+
typeName: getName(operation, { type: "type", suffix: "MutationKey" })
|
|
184
|
+
};
|
|
185
|
+
if (!isMutation) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
return /* @__PURE__ */ jsxs(
|
|
189
|
+
File,
|
|
190
|
+
{
|
|
191
|
+
baseName: mutation.file.baseName,
|
|
192
|
+
path: mutation.file.path,
|
|
193
|
+
meta: mutation.file.meta,
|
|
194
|
+
banner: getBanner({ oas, output }),
|
|
195
|
+
footer: getFooter({ oas, output }),
|
|
196
|
+
children: [
|
|
197
|
+
options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
|
|
198
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
|
|
199
|
+
/* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
|
|
200
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
File.Import,
|
|
203
|
+
{
|
|
204
|
+
name: [
|
|
205
|
+
type.schemas.request?.name,
|
|
206
|
+
type.schemas.response.name,
|
|
207
|
+
type.schemas.pathParams?.name,
|
|
208
|
+
type.schemas.queryParams?.name,
|
|
209
|
+
type.schemas.headerParams?.name,
|
|
210
|
+
...type.schemas.statusCodes?.map((item) => item.name) || []
|
|
211
|
+
].filter(Boolean),
|
|
212
|
+
root: mutation.file.path,
|
|
213
|
+
path: type.file.path,
|
|
214
|
+
isTypeOnly: true
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
MutationKey,
|
|
219
|
+
{
|
|
220
|
+
name: mutationKey.name,
|
|
221
|
+
typeName: mutationKey.typeName,
|
|
222
|
+
operation,
|
|
223
|
+
pathParamsType: options.pathParamsType,
|
|
224
|
+
paramsCasing: options.paramsCasing,
|
|
225
|
+
typeSchemas: type.schemas,
|
|
226
|
+
transformer: options.mutationKey
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
Client,
|
|
231
|
+
{
|
|
232
|
+
name: client.name,
|
|
233
|
+
isExportable: false,
|
|
234
|
+
isIndexable: false,
|
|
235
|
+
baseURL: options.client.baseURL,
|
|
236
|
+
operation,
|
|
237
|
+
typeSchemas: type.schemas,
|
|
238
|
+
zodSchemas: zod.schemas,
|
|
239
|
+
dataReturnType: options.client.dataReturnType,
|
|
240
|
+
paramsCasing: options.paramsCasing,
|
|
241
|
+
paramsType: options.paramsType,
|
|
242
|
+
pathParamsType: options.pathParamsType,
|
|
243
|
+
parser: options.parser
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
247
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["useMutation"], path: importPath }),
|
|
248
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["MutationObserverOptions"], path: importPath, isTypeOnly: true }),
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
Mutation,
|
|
251
|
+
{
|
|
252
|
+
name: mutation.name,
|
|
253
|
+
clientName: client.name,
|
|
254
|
+
typeName: mutation.typeName,
|
|
255
|
+
typeSchemas: type.schemas,
|
|
256
|
+
operation,
|
|
257
|
+
paramsCasing: options.paramsCasing,
|
|
258
|
+
dataReturnType: options.client.dataReturnType,
|
|
259
|
+
paramsType: options.paramsType,
|
|
260
|
+
pathParamsType: options.pathParamsType,
|
|
261
|
+
mutationKeyName: mutationKey.name
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] })
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
var infiniteQueryGenerator = createReactGenerator({
|
|
271
|
+
name: "vue-infinite-query",
|
|
272
|
+
Operation({ options, operation }) {
|
|
273
|
+
const {
|
|
274
|
+
plugin: {
|
|
275
|
+
options: { output }
|
|
276
|
+
}
|
|
277
|
+
} = useApp();
|
|
278
|
+
const oas = useOas();
|
|
279
|
+
const { getSchemas, getName, getFile } = useOperationManager();
|
|
280
|
+
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
281
|
+
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
|
|
282
|
+
(method) => operation.method === method
|
|
283
|
+
);
|
|
284
|
+
const isInfinite = isQuery && !!options.infinite;
|
|
285
|
+
const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
|
|
286
|
+
const query = {
|
|
287
|
+
name: getName(operation, { type: "function", prefix: "use", suffix: "infinite" }),
|
|
288
|
+
typeName: getName(operation, { type: "type" }),
|
|
289
|
+
file: getFile(operation, { prefix: "use", suffix: "infinite" })
|
|
290
|
+
};
|
|
291
|
+
const client = {
|
|
292
|
+
name: getName(operation, { type: "function" })
|
|
293
|
+
};
|
|
294
|
+
const queryOptions = {
|
|
295
|
+
name: getName(operation, { type: "function", suffix: "InfiniteQueryOptions" })
|
|
296
|
+
};
|
|
297
|
+
const queryKey = {
|
|
298
|
+
name: getName(operation, { type: "const", suffix: "InfiniteQueryKey" }),
|
|
299
|
+
typeName: getName(operation, { type: "type", suffix: "InfiniteQueryKey" })
|
|
300
|
+
};
|
|
301
|
+
const type = {
|
|
302
|
+
file: getFile(operation, { pluginKey: [pluginTsName] }),
|
|
303
|
+
//todo remove type?
|
|
304
|
+
schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: "type" })
|
|
305
|
+
};
|
|
306
|
+
const zod = {
|
|
307
|
+
file: getFile(operation, { pluginKey: [pluginZodName] }),
|
|
308
|
+
schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
|
|
309
|
+
};
|
|
310
|
+
if (!isQuery || isMutation || !isInfinite) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return /* @__PURE__ */ jsxs(
|
|
314
|
+
File,
|
|
315
|
+
{
|
|
316
|
+
baseName: query.file.baseName,
|
|
317
|
+
path: query.file.path,
|
|
318
|
+
meta: query.file.meta,
|
|
319
|
+
banner: getBanner({ oas, output }),
|
|
320
|
+
footer: getFooter({ oas, output }),
|
|
321
|
+
children: [
|
|
322
|
+
options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
|
|
323
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["unref"], path: "vue" }),
|
|
324
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
|
|
325
|
+
/* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
|
|
326
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
327
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
328
|
+
/* @__PURE__ */ jsx(
|
|
329
|
+
File.Import,
|
|
330
|
+
{
|
|
331
|
+
name: [
|
|
332
|
+
type.schemas.request?.name,
|
|
333
|
+
type.schemas.response.name,
|
|
334
|
+
type.schemas.pathParams?.name,
|
|
335
|
+
type.schemas.queryParams?.name,
|
|
336
|
+
type.schemas.headerParams?.name,
|
|
337
|
+
...type.schemas.statusCodes?.map((item) => item.name) || []
|
|
338
|
+
].filter(Boolean),
|
|
339
|
+
root: query.file.path,
|
|
340
|
+
path: type.file.path,
|
|
341
|
+
isTypeOnly: true
|
|
342
|
+
}
|
|
343
|
+
),
|
|
344
|
+
/* @__PURE__ */ jsx(
|
|
345
|
+
QueryKey,
|
|
346
|
+
{
|
|
347
|
+
name: queryKey.name,
|
|
348
|
+
typeName: queryKey.typeName,
|
|
349
|
+
operation,
|
|
350
|
+
paramsCasing: options.paramsCasing,
|
|
351
|
+
pathParamsType: options.pathParamsType,
|
|
352
|
+
typeSchemas: type.schemas,
|
|
353
|
+
transformer: options.queryKey
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ jsx(
|
|
357
|
+
Client,
|
|
358
|
+
{
|
|
359
|
+
name: client.name,
|
|
360
|
+
isExportable: false,
|
|
361
|
+
isIndexable: false,
|
|
362
|
+
baseURL: options.client.baseURL,
|
|
363
|
+
operation,
|
|
364
|
+
typeSchemas: type.schemas,
|
|
365
|
+
zodSchemas: zod.schemas,
|
|
366
|
+
dataReturnType: options.client.dataReturnType,
|
|
367
|
+
paramsCasing: options.paramsCasing,
|
|
368
|
+
paramsType: options.paramsType,
|
|
369
|
+
pathParamsType: options.pathParamsType,
|
|
370
|
+
parser: options.parser
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
374
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["InfiniteData"], isTypeOnly: true, path: importPath }),
|
|
375
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["infiniteQueryOptions"], path: importPath }),
|
|
376
|
+
/* @__PURE__ */ jsx(
|
|
377
|
+
InfiniteQueryOptions,
|
|
378
|
+
{
|
|
379
|
+
name: queryOptions.name,
|
|
380
|
+
clientName: client.name,
|
|
381
|
+
queryKeyName: queryKey.name,
|
|
382
|
+
typeSchemas: type.schemas,
|
|
383
|
+
paramsType: options.paramsType,
|
|
384
|
+
paramsCasing: options.paramsCasing,
|
|
385
|
+
pathParamsType: options.pathParamsType,
|
|
386
|
+
dataReturnType: options.client.dataReturnType,
|
|
387
|
+
cursorParam: options.infinite.cursorParam,
|
|
388
|
+
initialPageParam: options.infinite.initialPageParam,
|
|
389
|
+
queryParam: options.infinite.queryParam
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
] }),
|
|
393
|
+
options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
394
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["useInfiniteQuery"], path: importPath }),
|
|
395
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "InfiniteQueryObserverOptions", "UseInfiniteQueryReturnType"], path: importPath, isTypeOnly: true }),
|
|
396
|
+
/* @__PURE__ */ jsx(
|
|
397
|
+
InfiniteQuery,
|
|
398
|
+
{
|
|
399
|
+
name: query.name,
|
|
400
|
+
queryOptionsName: queryOptions.name,
|
|
401
|
+
typeSchemas: type.schemas,
|
|
402
|
+
paramsCasing: options.paramsCasing,
|
|
403
|
+
paramsType: options.paramsType,
|
|
404
|
+
pathParamsType: options.pathParamsType,
|
|
405
|
+
operation,
|
|
406
|
+
dataReturnType: options.client.dataReturnType,
|
|
407
|
+
queryKeyName: queryKey.name,
|
|
408
|
+
queryKeyTypeName: queryKey.typeName
|
|
409
|
+
}
|
|
410
|
+
)
|
|
411
|
+
] })
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
|
|
419
|
+
//# sourceMappingURL=chunk-VTRFZL5E.js.map
|
|
420
|
+
//# sourceMappingURL=chunk-VTRFZL5E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","difference","pluginTsName","pluginZodName","jsxs","File","getBanner","getFooter","jsx","Fragment"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kB,QAAS,CAAA;AAAA;AAAA;AAC7B,WACF,EAAA;AAAA;AAAA;AAAA,KAEJ;AAAA;AAGN,CAAC","file":"chunk-VTRFZL5E.js","sourcesContent":["import { 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 } = 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 client = {\n name: getName(operation, { type: 'function' }),\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 })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={['unref']} path=\"vue\" />\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\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 <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\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 <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', '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 } = 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 client = {\n name: getName(operation, { type: 'function' }),\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 })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\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 <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\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 {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions']} 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 { 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 } = 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 client = {\n name: getName(operation, { type: 'function' }),\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 })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={['unref']} path=\"vue\" />\n <File.Import name={['MaybeRef']} path=\"vue\" isTypeOnly />\n <File.Import name={'client'} path={options.client.importPath} />\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 <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\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 {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', '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"]}
|
package/dist/components.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Operation } from '@kubb/oas';
|
|
2
2
|
import { OperationSchemas } from '@kubb/plugin-oas';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-DKq2nW8w.cjs';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
package/dist/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Operation } from '@kubb/oas';
|
|
2
2
|
import { OperationSchemas } from '@kubb/plugin-oas';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-DKq2nW8w.js';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
package/dist/generators.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHUKJLE4A_cjs = require('./chunk-HUKJLE4A.cjs');
|
|
4
4
|
require('./chunk-KGJSQLZT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "infiniteQueryGenerator", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkHUKJLE4A_cjs.infiniteQueryGenerator; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "mutationGenerator", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkHUKJLE4A_cjs.mutationGenerator; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "queryGenerator", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkHUKJLE4A_cjs.queryGenerator; }
|
|
19
19
|
});
|
|
20
20
|
//# sourceMappingURL=generators.cjs.map
|
|
21
21
|
//# sourceMappingURL=generators.cjs.map
|
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-
|
|
1
|
+
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-VTRFZL5E.js';
|
|
2
2
|
import './chunk-N6FQE7MO.js';
|
|
3
3
|
//# sourceMappingURL=generators.js.map
|
|
4
4
|
//# sourceMappingURL=generators.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHUKJLE4A_cjs = require('./chunk-HUKJLE4A.cjs');
|
|
4
4
|
var chunkKGJSQLZT_cjs = require('./chunk-KGJSQLZT.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var core = require('@kubb/core');
|
|
@@ -31,7 +31,7 @@ var pluginVueQuery = core.createPlugin((options) => {
|
|
|
31
31
|
paramsCasing,
|
|
32
32
|
mutationKey = chunkKGJSQLZT_cjs.MutationKey.getTransformer,
|
|
33
33
|
queryKey = chunkKGJSQLZT_cjs.QueryKey.getTransformer,
|
|
34
|
-
generators = [
|
|
34
|
+
generators = [chunkHUKJLE4A_cjs.queryGenerator, chunkHUKJLE4A_cjs.infiniteQueryGenerator, chunkHUKJLE4A_cjs.mutationGenerator].filter(Boolean)
|
|
35
35
|
} = options;
|
|
36
36
|
return {
|
|
37
37
|
name: pluginVueQueryName,
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
1
|
+
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-VTRFZL5E.js';
|
|
2
2
|
import { MutationKey, QueryKey } from './chunk-N6FQE7MO.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|