@kubb/plugin-svelte-query 4.4.1 → 4.5.1

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 (34) hide show
  1. package/dist/{components-Dj8ralvN.cjs → components-CSifi2yW.cjs} +3 -3
  2. package/dist/{components-Dj8ralvN.cjs.map → components-CSifi2yW.cjs.map} +1 -1
  3. package/dist/{components-iwhc-RTI.js → components-D9W_4P34.js} +2 -2
  4. package/dist/{components-iwhc-RTI.js.map → components-D9W_4P34.js.map} +1 -1
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.d.cts +37 -37
  7. package/dist/components.d.ts +37 -37
  8. package/dist/components.js +1 -1
  9. package/dist/{generators-D6whEaa8.js → generators-DX6qs2Fo.js} +195 -153
  10. package/dist/generators-DX6qs2Fo.js.map +1 -0
  11. package/dist/{generators-B0OWxMd3.cjs → generators-Dk290xby.cjs} +196 -153
  12. package/dist/generators-Dk290xby.cjs.map +1 -0
  13. package/dist/generators.cjs +2 -2
  14. package/dist/generators.d.cts +4 -4
  15. package/dist/generators.d.ts +4 -4
  16. package/dist/generators.js +2 -2
  17. package/dist/index.cjs +17 -3
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +15 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/{types-CdqkoZMx.d.ts → types-Clf8TkM_.d.ts} +174 -182
  24. package/dist/{types-ZaeDHSbU.d.cts → types-m6PMgR_-.d.cts} +174 -182
  25. package/package.json +9 -9
  26. package/src/components/QueryKey.tsx +1 -1
  27. package/src/components/index.ts +1 -1
  28. package/src/generators/index.ts +1 -1
  29. package/src/generators/mutationGenerator.tsx +34 -9
  30. package/src/generators/queryGenerator.tsx +35 -11
  31. package/src/plugin.ts +22 -1
  32. package/src/types.ts +4 -3
  33. package/dist/generators-B0OWxMd3.cjs.map +0 -1
  34. package/dist/generators-D6whEaa8.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { a as MutationKey, i as Mutation, n as QueryOptions, r as QueryKey, t as Query } from "./components-iwhc-RTI.js";
2
- import { createReactGenerator } from "@kubb/plugin-oas";
1
+ import { a as MutationKey, i as Mutation, n as QueryOptions, r as QueryKey, t as Query } from "./components-D9W_4P34.js";
2
+ import path from "node:path";
3
+ import { pluginClientName } from "@kubb/plugin-client";
3
4
  import { pluginTsName } from "@kubb/plugin-ts";
4
5
  import { pluginZodName } from "@kubb/plugin-zod";
5
6
  import { Client } from "@kubb/plugin-client/components";
6
7
  import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
7
8
  import { File } from "@kubb/react-fabric";
8
9
  import { Fragment, jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
9
- import { usePlugin, usePluginManager } from "@kubb/core/hooks";
10
- import { pluginClientName } from "@kubb/plugin-client";
10
+ import { usePluginManager } from "@kubb/core/hooks";
11
+ import { createReactGenerator } from "@kubb/plugin-oas/generators";
11
12
  import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
12
13
  import { difference } from "remeda";
13
14
 
14
- //#region src/generators/queryGenerator.tsx
15
- const queryGenerator = createReactGenerator({
15
+ //#region src/generators/mutationGenerator.tsx
16
+ const mutationGenerator = createReactGenerator({
16
17
  name: "svelte-query",
17
- Operation({ options, operation }) {
18
- const { options: { output } } = usePlugin();
18
+ Operation({ config, operation, generator, plugin }) {
19
+ const { options, options: { output } } = plugin;
19
20
  const pluginManager = usePluginManager();
20
21
  const oas = useOas();
21
- const { getSchemas, getName, getFile } = useOperationManager();
22
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
23
- const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
24
- const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
25
- const query = {
22
+ const { getSchemas, getName, getFile } = useOperationManager(generator);
23
+ const isMutation = !(!!options.query && options.query?.methods.some((method) => operation.method === method)) && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
24
+ const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
25
+ const mutation = {
26
26
  name: getName(operation, {
27
27
  type: "function",
28
28
  prefix: "create"
@@ -30,6 +30,20 @@ const queryGenerator = createReactGenerator({
30
30
  typeName: getName(operation, { type: "type" }),
31
31
  file: getFile(operation, { prefix: "create" })
32
32
  };
33
+ const type = {
34
+ file: getFile(operation, { pluginKey: [pluginTsName] }),
35
+ schemas: getSchemas(operation, {
36
+ pluginKey: [pluginTsName],
37
+ type: "type"
38
+ })
39
+ };
40
+ const zod = {
41
+ file: getFile(operation, { pluginKey: [pluginZodName] }),
42
+ schemas: getSchemas(operation, {
43
+ pluginKey: [pluginZodName],
44
+ type: "function"
45
+ })
46
+ };
33
47
  const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
34
48
  const client = {
35
49
  name: hasClientPlugin ? getName(operation, {
@@ -38,39 +52,21 @@ const queryGenerator = createReactGenerator({
38
52
  }) : getName(operation, { type: "function" }),
39
53
  file: getFile(operation, { pluginKey: [pluginClientName] })
40
54
  };
41
- const queryOptions = { name: getName(operation, {
42
- type: "function",
43
- suffix: "QueryOptions"
44
- }) };
45
- const queryKey = {
55
+ const mutationKey = {
46
56
  name: getName(operation, {
47
57
  type: "const",
48
- suffix: "QueryKey"
58
+ suffix: "MutationKey"
49
59
  }),
50
60
  typeName: getName(operation, {
51
61
  type: "type",
52
- suffix: "QueryKey"
53
- })
54
- };
55
- const type = {
56
- file: getFile(operation, { pluginKey: [pluginTsName] }),
57
- schemas: getSchemas(operation, {
58
- pluginKey: [pluginTsName],
59
- type: "type"
60
- })
61
- };
62
- const zod = {
63
- file: getFile(operation, { pluginKey: [pluginZodName] }),
64
- schemas: getSchemas(operation, {
65
- pluginKey: [pluginZodName],
66
- type: "function"
62
+ suffix: "MutationKey"
67
63
  })
68
64
  };
69
- if (!isQuery || isMutation) return null;
65
+ if (!isMutation) return null;
70
66
  return /* @__PURE__ */ jsxs(File, {
71
- baseName: query.file.baseName,
72
- path: query.file.path,
73
- meta: query.file.meta,
67
+ baseName: mutation.file.baseName,
68
+ path: mutation.file.path,
69
+ meta: mutation.file.meta,
74
70
  banner: getBanner({
75
71
  oas,
76
72
  output,
@@ -83,28 +79,48 @@ const queryGenerator = createReactGenerator({
83
79
  children: [
84
80
  options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, {
85
81
  name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
86
- root: query.file.path,
82
+ root: mutation.file.path,
87
83
  path: zod.file.path
88
84
  }),
89
- /* @__PURE__ */ jsx(File.Import, {
90
- name: "fetch",
91
- path: options.client.importPath
92
- }),
85
+ options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsx(File.Import, {
87
+ name: "fetch",
88
+ path: options.client.importPath
89
+ }),
90
+ /* @__PURE__ */ jsx(File.Import, {
91
+ name: ["RequestConfig", "ResponseErrorConfig"],
92
+ path: options.client.importPath,
93
+ isTypeOnly: true
94
+ }),
95
+ options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
96
+ name: ["ResponseConfig"],
97
+ path: options.client.importPath,
98
+ isTypeOnly: true
99
+ })
100
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
101
+ /* @__PURE__ */ jsx(File.Import, {
102
+ name: "fetch",
103
+ root: mutation.file.path,
104
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts")
105
+ }),
106
+ /* @__PURE__ */ jsx(File.Import, {
107
+ name: ["RequestConfig", "ResponseErrorConfig"],
108
+ root: mutation.file.path,
109
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
110
+ isTypeOnly: true
111
+ }),
112
+ options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
113
+ name: ["ResponseConfig"],
114
+ root: mutation.file.path,
115
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
116
+ isTypeOnly: true
117
+ })
118
+ ] }),
93
119
  !!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
94
120
  name: [client.name],
95
- root: query.file.path,
121
+ root: mutation.file.path,
96
122
  path: client.file.path
97
123
  }),
98
- /* @__PURE__ */ jsx(File.Import, {
99
- name: ["RequestConfig", "ResponseErrorConfig"],
100
- path: options.client.importPath,
101
- isTypeOnly: true
102
- }),
103
- options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
104
- name: ["ResponseConfig"],
105
- path: options.client.importPath,
106
- isTypeOnly: true
107
- }),
108
124
  /* @__PURE__ */ jsx(File.Import, {
109
125
  name: [
110
126
  type.schemas.request?.name,
@@ -114,18 +130,18 @@ const queryGenerator = createReactGenerator({
114
130
  type.schemas.headerParams?.name,
115
131
  ...type.schemas.statusCodes?.map((item) => item.name) || []
116
132
  ].filter(Boolean),
117
- root: query.file.path,
133
+ root: mutation.file.path,
118
134
  path: type.file.path,
119
135
  isTypeOnly: true
120
136
  }),
121
- /* @__PURE__ */ jsx(QueryKey, {
122
- name: queryKey.name,
123
- typeName: queryKey.typeName,
137
+ /* @__PURE__ */ jsx(MutationKey, {
138
+ name: mutationKey.name,
139
+ typeName: mutationKey.typeName,
124
140
  operation,
141
+ paramsCasing: options.paramsCasing,
125
142
  pathParamsType: options.pathParamsType,
126
143
  typeSchemas: type.schemas,
127
- paramsCasing: options.paramsCasing,
128
- transformer: options.queryKey
144
+ transformer: options.mutationKey
129
145
  }),
130
146
  !hasClientPlugin && /* @__PURE__ */ jsx(Client, {
131
147
  name: client.name,
@@ -133,52 +149,37 @@ const queryGenerator = createReactGenerator({
133
149
  operation,
134
150
  typeSchemas: type.schemas,
135
151
  zodSchemas: zod.schemas,
136
- dataReturnType: options.client.dataReturnType,
152
+ dataReturnType: options.client.dataReturnType || "data",
137
153
  paramsCasing: options.paramsCasing,
138
154
  paramsType: options.paramsType,
139
155
  pathParamsType: options.pathParamsType,
140
156
  parser: options.parser
141
157
  }),
142
- /* @__PURE__ */ jsx(File.Import, {
143
- name: ["queryOptions"],
144
- path: importPath
145
- }),
146
- /* @__PURE__ */ jsx(QueryOptions, {
147
- name: queryOptions.name,
148
- clientName: client.name,
149
- queryKeyName: queryKey.name,
150
- typeSchemas: type.schemas,
151
- paramsCasing: options.paramsCasing,
152
- paramsType: options.paramsType,
153
- pathParamsType: options.pathParamsType,
154
- dataReturnType: options.client.dataReturnType
155
- }),
156
- options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
158
+ options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
157
159
  /* @__PURE__ */ jsx(File.Import, {
158
- name: ["createQuery"],
160
+ name: ["createMutation"],
159
161
  path: importPath
160
162
  }),
161
163
  /* @__PURE__ */ jsx(File.Import, {
162
164
  name: [
163
- "QueryKey",
164
- "QueryClient",
165
- "CreateBaseQueryOptions",
166
- "CreateQueryResult"
165
+ "CreateMutationOptions",
166
+ "CreateMutationResult",
167
+ "QueryClient"
167
168
  ],
168
169
  path: importPath,
169
170
  isTypeOnly: true
170
171
  }),
171
- /* @__PURE__ */ jsx(Query, {
172
- name: query.name,
173
- queryOptionsName: queryOptions.name,
172
+ /* @__PURE__ */ jsx(Mutation, {
173
+ name: mutation.name,
174
+ clientName: client.name,
175
+ typeName: mutation.typeName,
174
176
  typeSchemas: type.schemas,
175
- pathParamsType: options.pathParamsType,
176
177
  operation,
177
178
  paramsCasing: options.paramsCasing,
179
+ dataReturnType: options.client.dataReturnType || "data",
178
180
  paramsType: options.paramsType,
179
- dataReturnType: options.client.dataReturnType,
180
- queryKeyName: queryKey.name,
181
- queryKeyTypeName: queryKey.typeName
181
+ pathParamsType: options.pathParamsType,
182
+ mutationKeyName: mutationKey.name
182
183
  })
183
184
  ] })
184
185
  ]
@@ -187,17 +188,18 @@ const queryGenerator = createReactGenerator({
187
188
  });
188
189
 
189
190
  //#endregion
190
- //#region src/generators/mutationGenerator.tsx
191
- const mutationGenerator = createReactGenerator({
191
+ //#region src/generators/queryGenerator.tsx
192
+ const queryGenerator = createReactGenerator({
192
193
  name: "svelte-query",
193
- Operation({ options, operation }) {
194
- const { options: { output } } = usePlugin();
194
+ Operation({ config, operation, generator, plugin }) {
195
+ const { options, options: { output } } = plugin;
195
196
  const pluginManager = usePluginManager();
196
197
  const oas = useOas();
197
- const { getSchemas, getName, getFile } = useOperationManager();
198
- const isMutation = !(!!options.query && options.query?.methods.some((method) => operation.method === method)) && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
199
- const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
200
- const mutation = {
198
+ const { getSchemas, getName, getFile } = useOperationManager(generator);
199
+ const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
200
+ const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
201
+ const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
202
+ const query = {
201
203
  name: getName(operation, {
202
204
  type: "function",
203
205
  prefix: "create"
@@ -205,20 +207,6 @@ const mutationGenerator = createReactGenerator({
205
207
  typeName: getName(operation, { type: "type" }),
206
208
  file: getFile(operation, { prefix: "create" })
207
209
  };
208
- const type = {
209
- file: getFile(operation, { pluginKey: [pluginTsName] }),
210
- schemas: getSchemas(operation, {
211
- pluginKey: [pluginTsName],
212
- type: "type"
213
- })
214
- };
215
- const zod = {
216
- file: getFile(operation, { pluginKey: [pluginZodName] }),
217
- schemas: getSchemas(operation, {
218
- pluginKey: [pluginZodName],
219
- type: "function"
220
- })
221
- };
222
210
  const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
223
211
  const client = {
224
212
  name: hasClientPlugin ? getName(operation, {
@@ -227,21 +215,39 @@ const mutationGenerator = createReactGenerator({
227
215
  }) : getName(operation, { type: "function" }),
228
216
  file: getFile(operation, { pluginKey: [pluginClientName] })
229
217
  };
230
- const mutationKey = {
218
+ const queryOptions = { name: getName(operation, {
219
+ type: "function",
220
+ suffix: "QueryOptions"
221
+ }) };
222
+ const queryKey = {
231
223
  name: getName(operation, {
232
224
  type: "const",
233
- suffix: "MutationKey"
225
+ suffix: "QueryKey"
234
226
  }),
235
227
  typeName: getName(operation, {
236
228
  type: "type",
237
- suffix: "MutationKey"
229
+ suffix: "QueryKey"
238
230
  })
239
231
  };
240
- if (!isMutation) return null;
232
+ const type = {
233
+ file: getFile(operation, { pluginKey: [pluginTsName] }),
234
+ schemas: getSchemas(operation, {
235
+ pluginKey: [pluginTsName],
236
+ type: "type"
237
+ })
238
+ };
239
+ const zod = {
240
+ file: getFile(operation, { pluginKey: [pluginZodName] }),
241
+ schemas: getSchemas(operation, {
242
+ pluginKey: [pluginZodName],
243
+ type: "function"
244
+ })
245
+ };
246
+ if (!isQuery || isMutation) return null;
241
247
  return /* @__PURE__ */ jsxs(File, {
242
- baseName: mutation.file.baseName,
243
- path: mutation.file.path,
244
- meta: mutation.file.meta,
248
+ baseName: query.file.baseName,
249
+ path: query.file.path,
250
+ meta: query.file.meta,
245
251
  banner: getBanner({
246
252
  oas,
247
253
  output,
@@ -254,27 +260,48 @@ const mutationGenerator = createReactGenerator({
254
260
  children: [
255
261
  options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, {
256
262
  name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
257
- root: mutation.file.path,
263
+ root: query.file.path,
258
264
  path: zod.file.path
259
265
  }),
260
- /* @__PURE__ */ jsx(File.Import, {
261
- name: "fetch",
262
- path: options.client.importPath
263
- }),
266
+ options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
267
+ /* @__PURE__ */ jsx(File.Import, {
268
+ name: "fetch",
269
+ path: options.client.importPath
270
+ }),
271
+ /* @__PURE__ */ jsx(File.Import, {
272
+ name: ["RequestConfig", "ResponseErrorConfig"],
273
+ path: options.client.importPath,
274
+ isTypeOnly: true
275
+ }),
276
+ options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
277
+ name: ["ResponseConfig"],
278
+ path: options.client.importPath,
279
+ isTypeOnly: true
280
+ })
281
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
282
+ /* @__PURE__ */ jsx(File.Import, {
283
+ name: "fetch",
284
+ root: query.file.path,
285
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts")
286
+ }),
287
+ /* @__PURE__ */ jsx(File.Import, {
288
+ name: ["RequestConfig", "ResponseErrorConfig"],
289
+ root: query.file.path,
290
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
291
+ isTypeOnly: true
292
+ }),
293
+ options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
294
+ name: ["ResponseConfig"],
295
+ root: query.file.path,
296
+ path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
297
+ isTypeOnly: true
298
+ })
299
+ ] }),
264
300
  !!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
265
301
  name: [client.name],
266
- root: mutation.file.path,
302
+ root: query.file.path,
267
303
  path: client.file.path
268
304
  }),
269
- /* @__PURE__ */ jsx(File.Import, {
270
- name: [
271
- "RequestConfig",
272
- "ResponseConfig",
273
- "ResponseErrorConfig"
274
- ],
275
- path: options.client.importPath,
276
- isTypeOnly: true
277
- }),
278
305
  /* @__PURE__ */ jsx(File.Import, {
279
306
  name: [
280
307
  type.schemas.request?.name,
@@ -284,18 +311,18 @@ const mutationGenerator = createReactGenerator({
284
311
  type.schemas.headerParams?.name,
285
312
  ...type.schemas.statusCodes?.map((item) => item.name) || []
286
313
  ].filter(Boolean),
287
- root: mutation.file.path,
314
+ root: query.file.path,
288
315
  path: type.file.path,
289
316
  isTypeOnly: true
290
317
  }),
291
- /* @__PURE__ */ jsx(MutationKey, {
292
- name: mutationKey.name,
293
- typeName: mutationKey.typeName,
318
+ /* @__PURE__ */ jsx(QueryKey, {
319
+ name: queryKey.name,
320
+ typeName: queryKey.typeName,
294
321
  operation,
295
- paramsCasing: options.paramsCasing,
296
322
  pathParamsType: options.pathParamsType,
297
323
  typeSchemas: type.schemas,
298
- transformer: options.mutationKey
324
+ paramsCasing: options.paramsCasing,
325
+ transformer: options.queryKey
299
326
  }),
300
327
  !hasClientPlugin && /* @__PURE__ */ jsx(Client, {
301
328
  name: client.name,
@@ -303,37 +330,52 @@ const mutationGenerator = createReactGenerator({
303
330
  operation,
304
331
  typeSchemas: type.schemas,
305
332
  zodSchemas: zod.schemas,
306
- dataReturnType: options.client.dataReturnType,
333
+ dataReturnType: options.client.dataReturnType || "data",
307
334
  paramsCasing: options.paramsCasing,
308
335
  paramsType: options.paramsType,
309
336
  pathParamsType: options.pathParamsType,
310
337
  parser: options.parser
311
338
  }),
312
- options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
339
+ /* @__PURE__ */ jsx(File.Import, {
340
+ name: ["queryOptions"],
341
+ path: importPath
342
+ }),
343
+ /* @__PURE__ */ jsx(QueryOptions, {
344
+ name: queryOptions.name,
345
+ clientName: client.name,
346
+ queryKeyName: queryKey.name,
347
+ typeSchemas: type.schemas,
348
+ paramsCasing: options.paramsCasing,
349
+ paramsType: options.paramsType,
350
+ pathParamsType: options.pathParamsType,
351
+ dataReturnType: options.client.dataReturnType || "data"
352
+ }),
353
+ options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
313
354
  /* @__PURE__ */ jsx(File.Import, {
314
- name: ["createMutation"],
355
+ name: ["createQuery"],
315
356
  path: importPath
316
357
  }),
317
358
  /* @__PURE__ */ jsx(File.Import, {
318
359
  name: [
319
- "CreateMutationOptions",
320
- "CreateMutationResult",
321
- "QueryClient"
360
+ "QueryKey",
361
+ "QueryClient",
362
+ "CreateBaseQueryOptions",
363
+ "CreateQueryResult"
322
364
  ],
323
365
  path: importPath,
324
366
  isTypeOnly: true
325
367
  }),
326
- /* @__PURE__ */ jsx(Mutation, {
327
- name: mutation.name,
328
- clientName: client.name,
329
- typeName: mutation.typeName,
368
+ /* @__PURE__ */ jsx(Query, {
369
+ name: query.name,
370
+ queryOptionsName: queryOptions.name,
330
371
  typeSchemas: type.schemas,
372
+ pathParamsType: options.pathParamsType,
331
373
  operation,
332
374
  paramsCasing: options.paramsCasing,
333
- dataReturnType: options.client.dataReturnType,
334
375
  paramsType: options.paramsType,
335
- pathParamsType: options.pathParamsType,
336
- mutationKeyName: mutationKey.name
376
+ dataReturnType: options.client.dataReturnType || "data",
377
+ queryKeyName: queryKey.name,
378
+ queryKeyTypeName: queryKey.typeName
337
379
  })
338
380
  ] })
339
381
  ]
@@ -342,5 +384,5 @@ const mutationGenerator = createReactGenerator({
342
384
  });
343
385
 
344
386
  //#endregion
345
- export { queryGenerator as n, mutationGenerator as t };
346
- //# sourceMappingURL=generators-D6whEaa8.js.map
387
+ export { mutationGenerator as n, queryGenerator as t };
388
+ //# sourceMappingURL=generators-DX6qs2Fo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-DX6qs2Fo.js","names":[],"sources":["../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\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 } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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/svelte-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\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 {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} 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 </>\n ) : (\n <>\n <File.Import name={'fetch'} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\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\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\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 || 'data'}\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={['createMutation']} path={importPath} />\n <File.Import name={['CreateMutationOptions', 'CreateMutationResult', '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 || 'data'}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\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 } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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/svelte-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\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 {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} 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 </>\n ) : (\n <>\n <File.Import name={'fetch'} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\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 || 'data'}\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 typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'CreateBaseQueryOptions', 'CreateQueryResult']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n operation={operation}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,oBAAoB,qBAAwC;CACvE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,oBAAoB,UAAU;EAGvE,MAAM,aACJ,EAFc,CAAC,CAAC,QAAQ,SAAS,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO,KAGrG,WAAW,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MAAM,WAAW,UAAU,WAAW,OAAO;EAExJ,MAAM,aAAa,QAAQ,WAAW,QAAQ,SAAS,aAA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