@kubb/plugin-swr 5.0.0-alpha.34 → 5.0.0-alpha.35

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 (41) hide show
  1. package/dist/components-BJSzUg7M.cjs +955 -0
  2. package/dist/components-BJSzUg7M.cjs.map +1 -0
  3. package/dist/components-JQ2KRFCa.js +877 -0
  4. package/dist/components-JQ2KRFCa.js.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.d.ts +77 -37
  7. package/dist/components.js +1 -1
  8. package/dist/generators-17ulS9mu.cjs +537 -0
  9. package/dist/generators-17ulS9mu.cjs.map +1 -0
  10. package/dist/generators-Cl7nr-FB.js +526 -0
  11. package/dist/generators-Cl7nr-FB.js.map +1 -0
  12. package/dist/generators.cjs +1 -1
  13. package/dist/generators.d.ts +4 -4
  14. package/dist/generators.js +1 -1
  15. package/dist/index.cjs +132 -110
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.ts +22 -2
  18. package/dist/index.js +132 -110
  19. package/dist/index.js.map +1 -1
  20. package/dist/{types-BVDtH9S7.d.ts → types-FA5mH9Ch.d.ts} +46 -90
  21. package/package.json +7 -11
  22. package/src/components/Mutation.tsx +165 -170
  23. package/src/components/MutationKey.tsx +50 -1
  24. package/src/components/Query.tsx +122 -126
  25. package/src/components/QueryKey.tsx +65 -1
  26. package/src/components/QueryOptions.tsx +38 -93
  27. package/src/generators/mutationGenerator.tsx +194 -117
  28. package/src/generators/queryGenerator.tsx +205 -139
  29. package/src/plugin.ts +117 -152
  30. package/src/resolvers/resolverSwr.ts +26 -0
  31. package/src/resolvers/resolverSwrLegacy.ts +17 -0
  32. package/src/types.ts +55 -18
  33. package/src/utils.ts +209 -0
  34. package/dist/components-DaCTPplv.js +0 -756
  35. package/dist/components-DaCTPplv.js.map +0 -1
  36. package/dist/components-Qs8_faOt.cjs +0 -834
  37. package/dist/components-Qs8_faOt.cjs.map +0 -1
  38. package/dist/generators-0YayIrse.js +0 -400
  39. package/dist/generators-0YayIrse.js.map +0 -1
  40. package/dist/generators-Bd4rCa3l.cjs +0 -411
  41. package/dist/generators-Bd4rCa3l.cjs.map +0 -1
@@ -1,411 +0,0 @@
1
- const require_components = require("./components-Qs8_faOt.cjs");
2
- let node_path = require("node:path");
3
- node_path = require_components.__toESM(node_path);
4
- let _kubb_plugin_client = require("@kubb/plugin-client");
5
- let _kubb_plugin_ts = require("@kubb/plugin-ts");
6
- let _kubb_plugin_zod = require("@kubb/plugin-zod");
7
- let _kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
8
- let _kubb_renderer_jsx = require("@kubb/renderer-jsx");
9
- let _kubb_renderer_jsx_jsx_runtime = require("@kubb/renderer-jsx/jsx-runtime");
10
- let _kubb_core_hooks = require("@kubb/core/hooks");
11
- let _kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
12
- let _kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
13
- let remeda = require("remeda");
14
- //#region src/generators/mutationGenerator.tsx
15
- const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
16
- name: "swr-mutation",
17
- Operation({ config, operation, generator, plugin }) {
18
- const { options, options: { output } } = plugin;
19
- const driver = (0, _kubb_core_hooks.useDriver)();
20
- const root = node_path.default.resolve(config.root, config.output.path);
21
- const oas = (0, _kubb_plugin_oas_hooks.useOas)();
22
- const { getSchemas, getName, getFile } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
23
- const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
24
- const isMutation = options.mutation !== false && !isQuery && (0, remeda.difference)(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
25
- const importPath = options.mutation ? options.mutation.importPath : "swr";
26
- const mutation = {
27
- name: getName(operation, {
28
- type: "function",
29
- prefix: "use"
30
- }),
31
- typeName: getName(operation, { type: "type" }),
32
- file: getFile(operation, { prefix: "use" })
33
- };
34
- const type = {
35
- file: getFile(operation, { pluginName: _kubb_plugin_ts.pluginTsName }),
36
- schemas: getSchemas(operation, {
37
- pluginName: _kubb_plugin_ts.pluginTsName,
38
- type: "type"
39
- })
40
- };
41
- const zod = {
42
- file: getFile(operation, { pluginName: _kubb_plugin_zod.pluginZodName }),
43
- schemas: getSchemas(operation, {
44
- pluginName: _kubb_plugin_zod.pluginZodName,
45
- type: "function"
46
- })
47
- };
48
- const shouldUseClientPlugin = !!driver.getPlugin(_kubb_plugin_client.pluginClientName) && options.client.clientType !== "class";
49
- const client = {
50
- name: shouldUseClientPlugin ? getName(operation, {
51
- type: "function",
52
- pluginName: _kubb_plugin_client.pluginClientName
53
- }) : getName(operation, { type: "function" }),
54
- file: getFile(operation, { pluginName: _kubb_plugin_client.pluginClientName })
55
- };
56
- const mutationKey = {
57
- name: getName(operation, {
58
- type: "const",
59
- suffix: "MutationKey"
60
- }),
61
- typeName: getName(operation, {
62
- type: "type",
63
- suffix: "MutationKey"
64
- })
65
- };
66
- if (!isMutation) return null;
67
- return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
68
- baseName: mutation.file.baseName,
69
- path: mutation.file.path,
70
- meta: mutation.file.meta,
71
- banner: (0, _kubb_plugin_oas_utils.getBanner)({
72
- oas,
73
- output,
74
- config: driver.config
75
- }),
76
- footer: (0, _kubb_plugin_oas_utils.getFooter)({
77
- oas,
78
- output
79
- }),
80
- children: [
81
- options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
82
- name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
83
- root: mutation.file.path,
84
- path: zod.file.path
85
- }),
86
- options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
87
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
88
- name: "fetch",
89
- path: options.client.importPath
90
- }),
91
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
92
- name: [
93
- "Client",
94
- "RequestConfig",
95
- "ResponseErrorConfig"
96
- ],
97
- path: options.client.importPath,
98
- isTypeOnly: true
99
- }),
100
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
101
- name: ["ResponseConfig"],
102
- path: options.client.importPath,
103
- isTypeOnly: true
104
- })
105
- ] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
106
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
107
- name: ["fetch"],
108
- root: mutation.file.path,
109
- path: node_path.default.resolve(root, ".kubb/fetch.ts")
110
- }),
111
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
112
- name: [
113
- "Client",
114
- "RequestConfig",
115
- "ResponseErrorConfig"
116
- ],
117
- root: mutation.file.path,
118
- path: node_path.default.resolve(root, ".kubb/fetch.ts"),
119
- isTypeOnly: true
120
- }),
121
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
122
- name: ["ResponseConfig"],
123
- root: mutation.file.path,
124
- path: node_path.default.resolve(root, ".kubb/fetch.ts"),
125
- isTypeOnly: true
126
- })
127
- ] }),
128
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
129
- name: "useSWRMutation",
130
- path: importPath
131
- }),
132
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
133
- name: ["SWRMutationConfiguration", "SWRMutationResponse"],
134
- path: importPath,
135
- isTypeOnly: true
136
- }),
137
- shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
138
- name: [client.name],
139
- root: mutation.file.path,
140
- path: client.file.path
141
- }),
142
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
143
- name: ["buildFormData"],
144
- root: mutation.file.path,
145
- path: node_path.default.resolve(root, ".kubb/config.ts")
146
- }),
147
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
148
- name: [
149
- type.schemas.request?.name,
150
- type.schemas.response.name,
151
- type.schemas.pathParams?.name,
152
- type.schemas.queryParams?.name,
153
- type.schemas.headerParams?.name,
154
- ...type.schemas.statusCodes?.map((item) => item.name) || []
155
- ].filter(Boolean),
156
- root: mutation.file.path,
157
- path: type.file.path,
158
- isTypeOnly: true
159
- }),
160
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.MutationKey, {
161
- name: mutationKey.name,
162
- typeName: mutationKey.typeName,
163
- operation,
164
- pathParamsType: options.pathParamsType,
165
- typeSchemas: type.schemas,
166
- paramsCasing: options.paramsCasing,
167
- transformer: options.mutationKey
168
- }),
169
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
170
- name: client.name,
171
- baseURL: options.client.baseURL,
172
- operation,
173
- typeSchemas: type.schemas,
174
- zodSchemas: zod.schemas,
175
- dataReturnType: options.client.dataReturnType || "data",
176
- paramsCasing: options.client?.paramsCasing || options.paramsCasing,
177
- paramsType: options.paramsType,
178
- pathParamsType: options.pathParamsType,
179
- parser: options.parser
180
- }),
181
- options.mutation && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.Mutation, {
182
- name: mutation.name,
183
- clientName: client.name,
184
- typeName: mutation.typeName,
185
- typeSchemas: type.schemas,
186
- operation,
187
- dataReturnType: options.client.dataReturnType || "data",
188
- paramsType: options.paramsType,
189
- paramsCasing: options.paramsCasing,
190
- pathParamsType: options.pathParamsType,
191
- mutationKeyName: mutationKey.name,
192
- mutationKeyTypeName: mutationKey.typeName,
193
- paramsToTrigger: options.mutation.paramsToTrigger
194
- })
195
- ]
196
- });
197
- }
198
- });
199
- //#endregion
200
- //#region src/generators/queryGenerator.tsx
201
- const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
202
- name: "swr-query",
203
- Operation({ config, operation, generator, plugin }) {
204
- const { options, options: { output } } = plugin;
205
- const driver = (0, _kubb_core_hooks.useDriver)();
206
- const root = node_path.default.resolve(config.root, config.output.path);
207
- const oas = (0, _kubb_plugin_oas_hooks.useOas)();
208
- const { getSchemas, getName, getFile } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
209
- const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
210
- const isMutation = (0, remeda.difference)(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
211
- const importPath = options.query ? options.query.importPath : "swr/mutation";
212
- const query = {
213
- name: getName(operation, {
214
- type: "function",
215
- prefix: "use"
216
- }),
217
- typeName: getName(operation, { type: "type" }),
218
- file: getFile(operation, { prefix: "use" })
219
- };
220
- const shouldUseClientPlugin = !!driver.getPlugin(_kubb_plugin_client.pluginClientName) && options.client.clientType !== "class";
221
- const client = {
222
- name: shouldUseClientPlugin ? getName(operation, {
223
- type: "function",
224
- pluginName: _kubb_plugin_client.pluginClientName
225
- }) : getName(operation, { type: "function" }),
226
- file: getFile(operation, { pluginName: _kubb_plugin_client.pluginClientName })
227
- };
228
- const queryOptions = { name: getName(operation, {
229
- type: "function",
230
- suffix: "QueryOptions"
231
- }) };
232
- const queryKey = {
233
- name: getName(operation, {
234
- type: "const",
235
- suffix: "QueryKey"
236
- }),
237
- typeName: getName(operation, {
238
- type: "type",
239
- suffix: "QueryKey"
240
- })
241
- };
242
- const type = {
243
- file: getFile(operation, { pluginName: _kubb_plugin_ts.pluginTsName }),
244
- schemas: getSchemas(operation, {
245
- pluginName: _kubb_plugin_ts.pluginTsName,
246
- type: "type"
247
- })
248
- };
249
- const zod = {
250
- file: getFile(operation, { pluginName: _kubb_plugin_zod.pluginZodName }),
251
- schemas: getSchemas(operation, {
252
- pluginName: _kubb_plugin_zod.pluginZodName,
253
- type: "function"
254
- })
255
- };
256
- if (!isQuery || isMutation) return null;
257
- return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx.File, {
258
- baseName: query.file.baseName,
259
- path: query.file.path,
260
- meta: query.file.meta,
261
- banner: (0, _kubb_plugin_oas_utils.getBanner)({
262
- oas,
263
- output,
264
- config: driver.config
265
- }),
266
- footer: (0, _kubb_plugin_oas_utils.getFooter)({
267
- oas,
268
- output
269
- }),
270
- children: [
271
- options.parser === "zod" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
272
- name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
273
- root: query.file.path,
274
- path: zod.file.path
275
- }),
276
- options.client.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
277
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
278
- name: "fetch",
279
- path: options.client.importPath
280
- }),
281
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
282
- name: [
283
- "Client",
284
- "RequestConfig",
285
- "ResponseErrorConfig"
286
- ],
287
- path: options.client.importPath,
288
- isTypeOnly: true
289
- }),
290
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
291
- name: ["ResponseConfig"],
292
- path: options.client.importPath,
293
- isTypeOnly: true
294
- })
295
- ] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
296
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
297
- name: ["fetch"],
298
- root: query.file.path,
299
- path: node_path.default.resolve(root, ".kubb/fetch.ts")
300
- }),
301
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
302
- name: [
303
- "Client",
304
- "RequestConfig",
305
- "ResponseErrorConfig"
306
- ],
307
- root: query.file.path,
308
- path: node_path.default.resolve(root, ".kubb/fetch.ts"),
309
- isTypeOnly: true
310
- }),
311
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
312
- name: ["ResponseConfig"],
313
- root: query.file.path,
314
- path: node_path.default.resolve(root, ".kubb/fetch.ts"),
315
- isTypeOnly: true
316
- })
317
- ] }),
318
- shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
319
- name: [client.name],
320
- root: query.file.path,
321
- path: client.file.path
322
- }),
323
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
324
- name: ["buildFormData"],
325
- root: query.file.path,
326
- path: node_path.default.resolve(root, ".kubb/config.ts")
327
- }),
328
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
329
- name: [
330
- type.schemas.request?.name,
331
- type.schemas.response.name,
332
- type.schemas.pathParams?.name,
333
- type.schemas.queryParams?.name,
334
- type.schemas.headerParams?.name,
335
- ...type.schemas.statusCodes?.map((item) => item.name) || []
336
- ].filter(Boolean),
337
- root: query.file.path,
338
- path: type.file.path,
339
- isTypeOnly: true
340
- }),
341
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryKey, {
342
- name: queryKey.name,
343
- typeName: queryKey.typeName,
344
- operation,
345
- pathParamsType: options.pathParamsType,
346
- typeSchemas: type.schemas,
347
- paramsCasing: options.paramsCasing,
348
- transformer: options.queryKey
349
- }),
350
- !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_plugin_client.ClientLegacy, {
351
- name: client.name,
352
- baseURL: options.client.baseURL,
353
- operation,
354
- typeSchemas: type.schemas,
355
- zodSchemas: zod.schemas,
356
- dataReturnType: options.client.dataReturnType || "data",
357
- paramsCasing: options.client.paramsCasing || options.paramsCasing,
358
- paramsType: options.paramsType,
359
- pathParamsType: options.pathParamsType,
360
- parser: options.parser
361
- }),
362
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.QueryOptions, {
363
- name: queryOptions.name,
364
- clientName: client.name,
365
- typeSchemas: type.schemas,
366
- paramsType: options.paramsType,
367
- paramsCasing: options.paramsCasing,
368
- pathParamsType: options.pathParamsType
369
- }),
370
- options.query && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
371
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
372
- name: "useSWR",
373
- path: importPath
374
- }),
375
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
376
- name: ["SWRResponse"],
377
- path: importPath,
378
- isTypeOnly: true
379
- }),
380
- /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(require_components.Query, {
381
- name: query.name,
382
- queryOptionsName: queryOptions.name,
383
- typeSchemas: type.schemas,
384
- paramsType: options.paramsType,
385
- pathParamsType: options.pathParamsType,
386
- operation,
387
- dataReturnType: options.client.dataReturnType || "data",
388
- queryKeyName: queryKey.name,
389
- paramsCasing: options.paramsCasing,
390
- queryKeyTypeName: queryKey.typeName
391
- })
392
- ] })
393
- ]
394
- });
395
- }
396
- });
397
- //#endregion
398
- Object.defineProperty(exports, "mutationGenerator", {
399
- enumerable: true,
400
- get: function() {
401
- return mutationGenerator;
402
- }
403
- });
404
- Object.defineProperty(exports, "queryGenerator", {
405
- enumerable: true,
406
- get: function() {
407
- return queryGenerator;
408
- }
409
- });
410
-
411
- //# sourceMappingURL=generators-Bd4rCa3l.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-Bd4rCa3l.cjs","names":["path","pluginTsName","pluginZodName","pluginClientName","File","MutationKey","Client","Mutation","path","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","Query"],"sources":["../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { useDriver } from '@kubb/core/hooks'\nimport { ClientLegacy as Client, pluginClientName } from '@kubb/plugin-client'\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/renderer-jsx'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSwr } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSwr>({\n name: 'swr-mutation',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const driver = useDriver()\n const root = path.resolve(config.root, config.output.path)\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 options.mutation !== false &&\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 : 'swr'\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, { pluginName: pluginTsName }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginName: pluginTsName, type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, { pluginName: pluginZodName, type: 'function' }),\n }\n\n const hasClientPlugin = !!driver.getPlugin(pluginClientName)\n // Class-based clients are not compatible with query hooks, so we generate inline clients\n const shouldUseClientPlugin = hasClientPlugin && options.client.clientType !== 'class'\n const client = {\n name: shouldUseClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginName: pluginClientName,\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginName: 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: driver.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 {!shouldUseClientPlugin && <File.Import name={'fetch'} path={options.client.importPath} />}\n <File.Import name={['Client', '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 {!shouldUseClientPlugin && <File.Import name={['fetch']} root={mutation.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={mutation.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name=\"useSWRMutation\" path={importPath} />\n <File.Import name={['SWRMutationConfiguration', 'SWRMutationResponse']} path={importPath} isTypeOnly />\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={mutation.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\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 pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.mutationKey}\n />\n\n {!shouldUseClientPlugin && (\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.client?.paramsCasing || options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n mutationKeyTypeName={mutationKey.typeName}\n paramsToTrigger={options.mutation.paramsToTrigger}\n />\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { useDriver } from '@kubb/core/hooks'\nimport { ClientLegacy as Client, pluginClientName } from '@kubb/plugin-client'\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/renderer-jsx'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSwr } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSwr>({\n name: 'swr-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const driver = useDriver()\n const root = path.resolve(config.root, config.output.path)\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 : 'swr/mutation'\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 = !!driver.getPlugin(pluginClientName)\n // Class-based clients are not compatible with query hooks, so we generate inline clients\n const shouldUseClientPlugin = hasClientPlugin && options.client.clientType !== 'class'\n const client = {\n name: shouldUseClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginName: pluginClientName,\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginName: pluginClientName }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\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, { pluginName: pluginTsName }),\n //todo remove type?\n schemas: getSchemas(operation, {\n pluginName: pluginTsName,\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginName: pluginZodName }),\n schemas: getSchemas(operation, {\n pluginName: pluginZodName,\n type: 'function',\n }),\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: driver.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 {!shouldUseClientPlugin && <File.Import name={'fetch'} path={options.client.importPath} />}\n <File.Import name={['Client', '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 {!shouldUseClientPlugin && <File.Import name={['fetch']} root={query.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={query.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\n\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 pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n {!shouldUseClientPlugin && (\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.client.paramsCasing || options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n />\n {options.query && (\n <>\n <File.Import name=\"useSWR\" path={importPath} />\n <File.Import name={['SWRResponse']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n paramsCasing={options.paramsCasing}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,qBAAA,GAAA,4BAAA,sBAAoD;CAC/D,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,UAAA,GAAA,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