@kubb/plugin-svelte-query 3.5.1 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/chunk-4S7R5Q4P.js +552 -0
  2. package/dist/chunk-4S7R5Q4P.js.map +1 -0
  3. package/dist/{chunk-EE3OWZ2P.js → chunk-KYRMPWIG.js} +16 -8
  4. package/dist/chunk-KYRMPWIG.js.map +1 -0
  5. package/dist/chunk-LWISIPQK.cjs +559 -0
  6. package/dist/chunk-LWISIPQK.cjs.map +1 -0
  7. package/dist/{chunk-5E5RFWUM.cjs → chunk-O6G62ZNB.cjs} +16 -6
  8. package/dist/chunk-O6G62ZNB.cjs.map +1 -0
  9. package/dist/components.cjs +6 -6
  10. package/dist/components.js +1 -1
  11. package/dist/generators.cjs +4 -4
  12. package/dist/generators.js +2 -2
  13. package/dist/index.cjs +5 -5
  14. package/dist/index.js +2 -2
  15. package/package.json +11 -11
  16. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +1 -1
  17. package/src/generators/__snapshots__/clientGetImportPath.ts +1 -1
  18. package/src/generators/__snapshots__/clientPostImportPath.ts +1 -1
  19. package/src/generators/__snapshots__/findByTags.ts +1 -1
  20. package/src/generators/__snapshots__/findByTagsObject.ts +1 -1
  21. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +1 -1
  22. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +1 -1
  23. package/src/generators/__snapshots__/findByTagsWithZod.ts +1 -1
  24. package/src/generators/__snapshots__/postAsQuery.ts +1 -1
  25. package/src/generators/__snapshots__/updatePetById.ts +1 -1
  26. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +1 -1
  27. package/src/generators/mutationGenerator.tsx +27 -17
  28. package/src/generators/queryGenerator.tsx +28 -16
  29. package/dist/chunk-5E5RFWUM.cjs.map +0 -1
  30. package/dist/chunk-7GM4ILPD.cjs +0 -273
  31. package/dist/chunk-7GM4ILPD.cjs.map +0 -1
  32. package/dist/chunk-AKSVF5YB.js +0 -270
  33. package/dist/chunk-AKSVF5YB.js.map +0 -1
  34. package/dist/chunk-EE3OWZ2P.js.map +0 -1
@@ -0,0 +1,559 @@
1
+ 'use strict';
2
+
3
+ var chunkO6G62ZNB_cjs = require('./chunk-O6G62ZNB.cjs');
4
+ var path = require('path');
5
+ var core = require('@kubb/core');
6
+ var transformers = require('@kubb/core/transformers');
7
+ var pluginOas = require('@kubb/plugin-oas');
8
+ var pluginZod = require('@kubb/plugin-zod');
9
+ var hooks = require('@kubb/plugin-oas/hooks');
10
+ var utils = require('@kubb/plugin-oas/utils');
11
+ var pluginTs = require('@kubb/plugin-ts');
12
+ var react = require('@kubb/react');
13
+ var jsxRuntime = require('@kubb/react/jsx-runtime');
14
+ var remeda = require('remeda');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ var path__default = /*#__PURE__*/_interopDefault(path);
19
+
20
+ var clientGenerator = pluginOas.createReactGenerator({
21
+ name: "client",
22
+ Operation({ options, operation }) {
23
+ const {
24
+ plugin: {
25
+ options: { output }
26
+ }
27
+ } = react.useApp();
28
+ const oas = hooks.useOas();
29
+ const { getSchemas, getName, getFile } = hooks.useOperationManager();
30
+ const client = {
31
+ name: getName(operation, { type: "function" }),
32
+ file: getFile(operation)
33
+ };
34
+ const url = {
35
+ name: getName(operation, { type: "function", suffix: "url", prefix: "get" }),
36
+ file: getFile(operation)
37
+ };
38
+ const type = {
39
+ file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
40
+ schemas: getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" })
41
+ };
42
+ const zod = {
43
+ file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
44
+ schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
45
+ };
46
+ return /* @__PURE__ */ jsxRuntime.jsxs(
47
+ react.File,
48
+ {
49
+ baseName: client.file.baseName,
50
+ path: client.file.path,
51
+ meta: client.file.meta,
52
+ banner: utils.getBanner({ oas, output }),
53
+ footer: utils.getFooter({ oas, output }),
54
+ children: [
55
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.importPath }),
56
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.importPath, isTypeOnly: true }),
57
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: client.file.path, path: zod.file.path }),
58
+ /* @__PURE__ */ jsxRuntime.jsx(
59
+ react.File.Import,
60
+ {
61
+ name: [
62
+ type.schemas.request?.name,
63
+ type.schemas.response.name,
64
+ type.schemas.pathParams?.name,
65
+ type.schemas.queryParams?.name,
66
+ type.schemas.headerParams?.name,
67
+ ...type.schemas.statusCodes?.map((item) => item.name) || []
68
+ ].filter(Boolean),
69
+ root: client.file.path,
70
+ path: type.file.path,
71
+ isTypeOnly: true
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsxRuntime.jsx(
75
+ chunkO6G62ZNB_cjs.Url,
76
+ {
77
+ name: url.name,
78
+ baseURL: options.baseURL,
79
+ pathParamsType: options.pathParamsType,
80
+ paramsCasing: options.paramsCasing,
81
+ paramsType: options.paramsType,
82
+ typeSchemas: type.schemas,
83
+ operation
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxRuntime.jsx(
87
+ chunkO6G62ZNB_cjs.Client,
88
+ {
89
+ name: client.name,
90
+ urlName: url.name,
91
+ baseURL: options.baseURL,
92
+ dataReturnType: options.dataReturnType,
93
+ pathParamsType: options.pathParamsType,
94
+ paramsCasing: options.paramsCasing,
95
+ paramsType: options.paramsType,
96
+ typeSchemas: type.schemas,
97
+ operation,
98
+ parser: options.parser,
99
+ zodSchemas: zod.schemas
100
+ }
101
+ )
102
+ ]
103
+ }
104
+ );
105
+ }
106
+ });
107
+ var operationsGenerator = pluginOas.createReactGenerator({
108
+ name: "client",
109
+ Operations({ operations }) {
110
+ const {
111
+ pluginManager,
112
+ plugin: {
113
+ key: pluginKey,
114
+ options: { output }
115
+ }
116
+ } = react.useApp();
117
+ const oas = hooks.useOas();
118
+ const name = "operations";
119
+ const file = pluginManager.getFile({ name, extname: ".ts", pluginKey });
120
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: utils.getBanner({ oas, output }), footer: utils.getFooter({ oas, output }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkO6G62ZNB_cjs.Operations, { name, operations }) });
121
+ }
122
+ });
123
+ var groupedClientGenerator = pluginOas.createReactGenerator({
124
+ name: "groupedClient",
125
+ Operations({ operations }) {
126
+ const {
127
+ pluginManager,
128
+ plugin: { options, key: pluginKey }
129
+ } = react.useApp();
130
+ const oas = hooks.useOas();
131
+ const { getName, getFile, getGroup } = hooks.useOperationManager();
132
+ const controllers = operations.reduce(
133
+ (acc, operation) => {
134
+ if (options.group?.type === "tag") {
135
+ const group = getGroup(operation);
136
+ const name = group?.tag ? options.group?.name?.({ group: transformers.camelCase(group.tag) }) : void 0;
137
+ if (!group?.tag || !name) {
138
+ return acc;
139
+ }
140
+ const file = pluginManager.getFile({
141
+ name,
142
+ extname: ".ts",
143
+ pluginKey,
144
+ options: { group }
145
+ });
146
+ const client = {
147
+ name: getName(operation, { type: "function" }),
148
+ file: getFile(operation)
149
+ };
150
+ const previousFile = acc.find((item) => item.file.path === file.path);
151
+ if (previousFile) {
152
+ previousFile.clients.push(client);
153
+ } else {
154
+ acc.push({ name, file, clients: [client] });
155
+ }
156
+ }
157
+ return acc;
158
+ },
159
+ []
160
+ );
161
+ return controllers.map(({ name, file, clients }) => {
162
+ return /* @__PURE__ */ jsxRuntime.jsxs(
163
+ react.File,
164
+ {
165
+ baseName: file.baseName,
166
+ path: file.path,
167
+ meta: file.meta,
168
+ banner: utils.getBanner({ oas, output: options.output }),
169
+ footer: utils.getFooter({ oas, output: options.output }),
170
+ children: [
171
+ clients.map((client) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [client.name], root: file.path, path: client.file.path }, client.name)),
172
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { export: true, name, children: `return { ${clients.map((client) => client.name).join(", ")} }` }) })
173
+ ]
174
+ },
175
+ file.path
176
+ );
177
+ });
178
+ }
179
+ });
180
+
181
+ // ../plugin-client/src/plugin.ts
182
+ var pluginClientName = "plugin-client";
183
+ core.createPlugin((options) => {
184
+ const {
185
+ output = { path: "clients", barrelType: "named" },
186
+ group,
187
+ exclude = [],
188
+ include,
189
+ override = [],
190
+ transformers: transformers$1 = {},
191
+ dataReturnType = "data",
192
+ pathParamsType = "inline",
193
+ paramsType = "inline",
194
+ operations = false,
195
+ baseURL,
196
+ paramsCasing,
197
+ generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
198
+ parser = "client",
199
+ client = "axios",
200
+ importPath = client === "fetch" ? "@kubb/plugin-client/clients/fetch" : "@kubb/plugin-client/clients/axios"
201
+ } = options;
202
+ return {
203
+ name: pluginClientName,
204
+ options: {
205
+ output,
206
+ group,
207
+ parser,
208
+ dataReturnType,
209
+ importPath,
210
+ paramsType,
211
+ paramsCasing,
212
+ pathParamsType: paramsType === "object" ? "object" : pathParamsType,
213
+ baseURL
214
+ },
215
+ pre: [pluginOas.pluginOasName, parser === "zod" ? pluginZod.pluginZodName : void 0].filter(Boolean),
216
+ resolvePath(baseName, pathMode, options2) {
217
+ const root = path__default.default.resolve(this.config.root, this.config.output.path);
218
+ const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
219
+ if (mode === "single") {
220
+ return path__default.default.resolve(root, output.path);
221
+ }
222
+ if (group && (options2?.group?.path || options2?.group?.tag)) {
223
+ const groupName = group?.name ? group.name : (ctx) => {
224
+ if (group?.type === "path") {
225
+ return `${ctx.group.split("/")[1]}`;
226
+ }
227
+ return `${transformers.camelCase(ctx.group)}Controller`;
228
+ };
229
+ return path__default.default.resolve(
230
+ root,
231
+ output.path,
232
+ groupName({
233
+ group: group.type === "path" ? options2.group.path : options2.group.tag
234
+ }),
235
+ baseName
236
+ );
237
+ }
238
+ return path__default.default.resolve(root, output.path, baseName);
239
+ },
240
+ resolveName(name, type) {
241
+ const resolvedName = transformers.camelCase(name, { isFile: type === "file" });
242
+ if (type) {
243
+ return transformers$1?.name?.(resolvedName, type) || resolvedName;
244
+ }
245
+ return resolvedName;
246
+ },
247
+ async buildStart() {
248
+ const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
249
+ const oas = await swaggerPlugin.context.getOas();
250
+ const root = path__default.default.resolve(this.config.root, this.config.output.path);
251
+ const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
252
+ const baseURL2 = await swaggerPlugin.context.getBaseURL();
253
+ const operationGenerator = new pluginOas.OperationGenerator(
254
+ baseURL2 ? {
255
+ ...this.plugin.options,
256
+ baseURL: baseURL2
257
+ } : this.plugin.options,
258
+ {
259
+ oas,
260
+ pluginManager: this.pluginManager,
261
+ plugin: this.plugin,
262
+ contentType: swaggerPlugin.context.contentType,
263
+ exclude,
264
+ include,
265
+ override,
266
+ mode
267
+ }
268
+ );
269
+ const files = await operationGenerator.build(...generators);
270
+ await this.addFile(...files);
271
+ const barrelFiles = await this.fileManager.getBarrelFiles({
272
+ type: output.barrelType ?? "named",
273
+ root,
274
+ output,
275
+ files: this.fileManager.files,
276
+ meta: {
277
+ pluginKey: this.plugin.key
278
+ },
279
+ logger: this.logger
280
+ });
281
+ await this.addFile(...barrelFiles);
282
+ }
283
+ };
284
+ });
285
+ var queryGenerator = pluginOas.createReactGenerator({
286
+ name: "svelte-query",
287
+ Operation({ options, operation }) {
288
+ const {
289
+ plugin: {
290
+ options: { output }
291
+ },
292
+ pluginManager
293
+ } = react.useApp();
294
+ const oas = hooks.useOas();
295
+ const { getSchemas, getName, getFile } = hooks.useOperationManager();
296
+ const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
297
+ const isMutation = remeda.difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(
298
+ (method) => operation.method === method
299
+ );
300
+ const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
301
+ const query = {
302
+ name: getName(operation, { type: "function", prefix: "create" }),
303
+ typeName: getName(operation, { type: "type" }),
304
+ file: getFile(operation, { prefix: "create" })
305
+ };
306
+ const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
307
+ const client = {
308
+ name: hasClientPlugin ? getName(operation, {
309
+ type: "function",
310
+ pluginKey: [pluginClientName]
311
+ }) : getName(operation, {
312
+ type: "function"
313
+ }),
314
+ file: getFile(operation, { pluginKey: [pluginClientName] })
315
+ };
316
+ const queryOptions = {
317
+ name: getName(operation, { type: "function", suffix: "QueryOptions" })
318
+ };
319
+ const queryKey = {
320
+ name: getName(operation, { type: "const", suffix: "QueryKey" }),
321
+ typeName: getName(operation, { type: "type", suffix: "QueryKey" })
322
+ };
323
+ const type = {
324
+ file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
325
+ //todo remove type?
326
+ schemas: getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" })
327
+ };
328
+ const zod = {
329
+ file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
330
+ schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
331
+ };
332
+ if (!isQuery || isMutation) {
333
+ return null;
334
+ }
335
+ return /* @__PURE__ */ jsxRuntime.jsxs(
336
+ react.File,
337
+ {
338
+ baseName: query.file.baseName,
339
+ path: query.file.path,
340
+ meta: query.file.meta,
341
+ banner: utils.getBanner({ oas, output }),
342
+ footer: utils.getFooter({ oas, output }),
343
+ children: [
344
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
345
+ !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
346
+ !!hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [client.name], root: query.file.path, path: client.file.path }),
347
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
348
+ options.client.dataReturnType === "full" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
349
+ /* @__PURE__ */ jsxRuntime.jsx(
350
+ react.File.Import,
351
+ {
352
+ name: [
353
+ type.schemas.request?.name,
354
+ type.schemas.response.name,
355
+ type.schemas.pathParams?.name,
356
+ type.schemas.queryParams?.name,
357
+ type.schemas.headerParams?.name,
358
+ ...type.schemas.statusCodes?.map((item) => item.name) || []
359
+ ].filter(Boolean),
360
+ root: query.file.path,
361
+ path: type.file.path,
362
+ isTypeOnly: true
363
+ }
364
+ ),
365
+ /* @__PURE__ */ jsxRuntime.jsx(
366
+ chunkO6G62ZNB_cjs.QueryKey,
367
+ {
368
+ name: queryKey.name,
369
+ typeName: queryKey.typeName,
370
+ operation,
371
+ pathParamsType: options.pathParamsType,
372
+ typeSchemas: type.schemas,
373
+ paramsCasing: options.paramsCasing,
374
+ transformer: options.queryKey
375
+ }
376
+ ),
377
+ !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(
378
+ chunkO6G62ZNB_cjs.Client,
379
+ {
380
+ name: client.name,
381
+ baseURL: options.client.baseURL,
382
+ operation,
383
+ typeSchemas: type.schemas,
384
+ zodSchemas: zod.schemas,
385
+ dataReturnType: options.client.dataReturnType,
386
+ paramsCasing: options.paramsCasing,
387
+ paramsType: options.paramsType,
388
+ pathParamsType: options.pathParamsType,
389
+ parser: options.parser
390
+ }
391
+ ),
392
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
393
+ /* @__PURE__ */ jsxRuntime.jsx(
394
+ chunkO6G62ZNB_cjs.QueryOptions,
395
+ {
396
+ name: queryOptions.name,
397
+ clientName: client.name,
398
+ queryKeyName: queryKey.name,
399
+ typeSchemas: type.schemas,
400
+ paramsCasing: options.paramsCasing,
401
+ paramsType: options.paramsType,
402
+ pathParamsType: options.pathParamsType,
403
+ dataReturnType: options.client.dataReturnType
404
+ }
405
+ ),
406
+ options.query && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
407
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery"], path: importPath }),
408
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
409
+ /* @__PURE__ */ jsxRuntime.jsx(
410
+ chunkO6G62ZNB_cjs.Query,
411
+ {
412
+ name: query.name,
413
+ queryOptionsName: queryOptions.name,
414
+ typeSchemas: type.schemas,
415
+ pathParamsType: options.pathParamsType,
416
+ operation,
417
+ paramsCasing: options.paramsCasing,
418
+ paramsType: options.paramsType,
419
+ dataReturnType: options.client.dataReturnType,
420
+ queryKeyName: queryKey.name,
421
+ queryKeyTypeName: queryKey.typeName
422
+ }
423
+ )
424
+ ] })
425
+ ]
426
+ }
427
+ );
428
+ }
429
+ });
430
+ var mutationGenerator = pluginOas.createReactGenerator({
431
+ name: "svelte-query",
432
+ Operation({ options, operation }) {
433
+ const {
434
+ plugin: {
435
+ options: { output }
436
+ },
437
+ pluginManager
438
+ } = react.useApp();
439
+ const oas = hooks.useOas();
440
+ const { getSchemas, getName, getFile } = hooks.useOperationManager();
441
+ const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
442
+ const isMutation = !isQuery && remeda.difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
443
+ const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
444
+ const mutation = {
445
+ name: getName(operation, { type: "function", prefix: "create" }),
446
+ typeName: getName(operation, { type: "type" }),
447
+ file: getFile(operation, { prefix: "create" })
448
+ };
449
+ const type = {
450
+ file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
451
+ //todo remove type?
452
+ schemas: getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" })
453
+ };
454
+ const zod = {
455
+ file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
456
+ schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
457
+ };
458
+ const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
459
+ const client = {
460
+ name: hasClientPlugin ? getName(operation, {
461
+ type: "function",
462
+ pluginKey: [pluginClientName]
463
+ }) : getName(operation, {
464
+ type: "function"
465
+ }),
466
+ file: getFile(operation, { pluginKey: [pluginClientName] })
467
+ };
468
+ const mutationKey = {
469
+ name: getName(operation, { type: "const", suffix: "MutationKey" }),
470
+ typeName: getName(operation, { type: "type", suffix: "MutationKey" })
471
+ };
472
+ if (!isMutation) {
473
+ return null;
474
+ }
475
+ return /* @__PURE__ */ jsxRuntime.jsxs(
476
+ react.File,
477
+ {
478
+ baseName: mutation.file.baseName,
479
+ path: mutation.file.path,
480
+ meta: mutation.file.meta,
481
+ banner: utils.getBanner({ oas, output }),
482
+ footer: utils.getFooter({ oas, output }),
483
+ children: [
484
+ options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
485
+ !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
486
+ !!hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [client.name], root: mutation.file.path, path: client.file.path }),
487
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseConfig", "ResponseErrorConfig"], path: options.client.importPath, isTypeOnly: true }),
488
+ /* @__PURE__ */ jsxRuntime.jsx(
489
+ react.File.Import,
490
+ {
491
+ name: [
492
+ type.schemas.request?.name,
493
+ type.schemas.response.name,
494
+ type.schemas.pathParams?.name,
495
+ type.schemas.queryParams?.name,
496
+ type.schemas.headerParams?.name,
497
+ ...type.schemas.statusCodes?.map((item) => item.name) || []
498
+ ].filter(Boolean),
499
+ root: mutation.file.path,
500
+ path: type.file.path,
501
+ isTypeOnly: true
502
+ }
503
+ ),
504
+ /* @__PURE__ */ jsxRuntime.jsx(
505
+ chunkO6G62ZNB_cjs.MutationKey,
506
+ {
507
+ name: mutationKey.name,
508
+ typeName: mutationKey.typeName,
509
+ operation,
510
+ paramsCasing: options.paramsCasing,
511
+ pathParamsType: options.pathParamsType,
512
+ typeSchemas: type.schemas,
513
+ transformer: options.mutationKey
514
+ }
515
+ ),
516
+ !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(
517
+ chunkO6G62ZNB_cjs.Client,
518
+ {
519
+ name: client.name,
520
+ baseURL: options.client.baseURL,
521
+ operation,
522
+ typeSchemas: type.schemas,
523
+ zodSchemas: zod.schemas,
524
+ dataReturnType: options.client.dataReturnType,
525
+ paramsCasing: options.paramsCasing,
526
+ paramsType: options.paramsType,
527
+ pathParamsType: options.pathParamsType,
528
+ parser: options.parser
529
+ }
530
+ ),
531
+ options.mutation && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
532
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: importPath }),
533
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: importPath, isTypeOnly: true }),
534
+ /* @__PURE__ */ jsxRuntime.jsx(
535
+ chunkO6G62ZNB_cjs.Mutation,
536
+ {
537
+ name: mutation.name,
538
+ clientName: client.name,
539
+ typeName: mutation.typeName,
540
+ typeSchemas: type.schemas,
541
+ operation,
542
+ paramsCasing: options.paramsCasing,
543
+ dataReturnType: options.client.dataReturnType,
544
+ paramsType: options.paramsType,
545
+ pathParamsType: options.pathParamsType,
546
+ mutationKeyName: mutationKey.name
547
+ }
548
+ )
549
+ ] })
550
+ ]
551
+ }
552
+ );
553
+ }
554
+ });
555
+
556
+ exports.mutationGenerator = mutationGenerator;
557
+ exports.queryGenerator = queryGenerator;
558
+ //# sourceMappingURL=chunk-LWISIPQK.cjs.map
559
+ //# sourceMappingURL=chunk-LWISIPQK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../plugin-client/src/generators/clientGenerator.tsx","../../plugin-client/src/generators/operationsGenerator.tsx","../../plugin-client/src/generators/groupedClientGenerator.tsx","../../plugin-client/src/plugin.ts","../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","pluginTsName","pluginZodName","jsxs","File","getBanner","getFooter","jsx","Url","Client","Operations","camelCase","Function","createPlugin","transformers","pluginOasName","options","path","FileManager","PluginManager","baseURL","OperationGenerator","difference","QueryKey","QueryOptions","Fragment","Query","MutationKey","Mutation"],"mappings":";;;;;;;;;;;;;;;;;;;AAUO,IAAM,kBAAkBA,8BAAmC,CAAA;AAAA,EAChE,IAAM,EAAA,QAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO;AAAA;AACpB,QACEC,YAAqB,EAAA;AACzB,IAAA,MAAM,MAAMC,YAAO,EAAA;AACnB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAYC,yBAAoB,EAAA;AAE7D,IAAA,MAAM,MAAS,GAAA;AAAA,MACb,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,MAC7C,IAAA,EAAM,QA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AAAA,cACxB,QAAQ,OAAQ,CAAA;AAAA;AAAA,WAClB;AAAA,UAED,OAAQ,CAAA,QAAA,oBACPN,eAAAA,CAAAsB,qBAAA,EACE,QAAA,EAAA;AAAA,4BAAAlB,cAAAA,CAACH,WAAK,MAAL,EAAA,EAAY,MAAM,CAAC,gBAAgB,CAAG,EAAA,IAAA,EAAM,UAAY,EAAA,CAAA;AAAA,4BACzDG,cAAAA,CAACH,UAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,uBAAA,EAAyB,sBAAsB,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,4BACnGG,cAAAA;AAAA,cAACqB,0BAAA;AAAA,cAAA;AAAA,gBACC,MAAM,QAAS,CAAA,IAAA;AAAA,gBACf,YAAY,MAAO,CAAA,IAAA;AAAA,gBACnB,UAAU,QAAS,CAAA,QAAA;AAAA,gBACnB,aAAa,IAAK,CAAA,OAAA;AAAA,gBAClB,SAAA;AAAA,gBACA,cAAc,OAAQ,CAAA,YAAA;AAAA,gBACtB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,gBAC/B,YAAY,OAAQ,CAAA,UAAA;AAAA,gBACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,gBACxB,iBAAiB,WAAY,CAAA;AAAA;AAAA;AAC/B,WACF,EAAA;AAAA;AAAA;AAAA,KAEJ;AAAA;AAGN,CAAC","file":"chunk-LWISIPQK.cjs","sourcesContent":["import { 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 { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginClient>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\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 return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={'client'} path={options.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={client.file.path} path={zod.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={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, useApp } from '@kubb/react'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { output },\n },\n } = useApp<PluginClient>()\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={getBanner({ oas, output })} footer={getFooter({ oas, output })}>\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import { camelCase } from '@kubb/core/transformers'\nimport type * as KubbFile from '@kubb/fs/types'\n\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function, useApp } from '@kubb/react'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const {\n pluginManager,\n plugin: { options, key: pluginKey },\n } = useApp<PluginClient>()\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n","import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { operationsGenerator } from './generators'\nimport { clientGenerator } from './generators/clientGenerator.tsx'\nimport { groupedClientGenerator } from './generators/groupedClientGenerator.tsx'\nimport type { PluginClient } from './types.ts'\n\nexport const pluginClientName = 'plugin-client' satisfies PluginClient['name']\n\nexport const pluginClient = createPlugin<PluginClient>((options) => {\n const {\n output = { path: 'clients', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dataReturnType = 'data',\n pathParamsType = 'inline',\n paramsType = 'inline',\n operations = false,\n baseURL,\n paramsCasing,\n generators = [clientGenerator, group ? groupedClientGenerator : undefined, operations ? operationsGenerator : undefined].filter(Boolean),\n parser = 'client',\n client = 'axios',\n importPath = client === 'fetch' ? '@kubb/plugin-client/clients/fetch' : '@kubb/plugin-client/clients/axios',\n } = options\n\n return {\n name: pluginClientName,\n options: {\n output,\n group,\n parser,\n dataReturnType,\n importPath,\n paramsType,\n paramsCasing,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType,\n baseURL,\n },\n pre: [pluginOasName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = camelCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const baseURL = await swaggerPlugin.context.getBaseURL()\n\n const operationGenerator = new OperationGenerator(\n baseURL\n ? {\n ...this.plugin.options,\n baseURL,\n }\n : this.plugin.options,\n {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(...generators)\n\n await this.addFile(...files)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\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 { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginSvelteQuery>()\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/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 })}\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 {!hasClientPlugin && <File.Import name={'client'} path={options.client.importPath} />}\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\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}\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}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', '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}\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 { PluginSvelteQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginSvelteQuery>()\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/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 })}\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 {!hasClientPlugin && <File.Import name={'client'} path={options.client.importPath} />}\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\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}\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']} 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"]}