@kubb/plugin-svelte-query 4.12.2 → 4.12.4

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.
@@ -25,29 +25,29 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- const require_components = require('./components-CwRgvykU.cjs');
28
+ const require_components = require('./components-CfOYtoxN.cjs');
29
29
  let node_path = require("node:path");
30
30
  node_path = __toESM(node_path);
31
- let __kubb_plugin_client = require("@kubb/plugin-client");
32
- let __kubb_plugin_ts = require("@kubb/plugin-ts");
33
- let __kubb_plugin_zod = require("@kubb/plugin-zod");
34
- let __kubb_plugin_client_components = require("@kubb/plugin-client/components");
35
- let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
36
- let __kubb_react_fabric = require("@kubb/react-fabric");
37
- let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
38
- let __kubb_core_hooks = require("@kubb/core/hooks");
39
- let __kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
40
- let __kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
31
+ let _kubb_plugin_client = require("@kubb/plugin-client");
32
+ let _kubb_plugin_ts = require("@kubb/plugin-ts");
33
+ let _kubb_plugin_zod = require("@kubb/plugin-zod");
34
+ let _kubb_plugin_client_components = require("@kubb/plugin-client/components");
35
+ let _kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
36
+ let _kubb_react_fabric = require("@kubb/react-fabric");
37
+ let _kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
38
+ let _kubb_core_hooks = require("@kubb/core/hooks");
39
+ let _kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
40
+ let _kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
41
41
  let remeda = require("remeda");
42
42
 
43
43
  //#region src/generators/mutationGenerator.tsx
44
- const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
44
+ const mutationGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
45
45
  name: "svelte-query",
46
46
  Operation({ config, operation, generator, plugin }) {
47
47
  const { options, options: { output } } = plugin;
48
- const pluginManager = (0, __kubb_core_hooks.usePluginManager)();
49
- const oas = (0, __kubb_plugin_oas_hooks.useOas)();
50
- const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)(generator);
48
+ const pluginManager = (0, _kubb_core_hooks.usePluginManager)();
49
+ const oas = (0, _kubb_plugin_oas_hooks.useOas)();
50
+ const { getSchemas, getName, getFile } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
51
51
  const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method);
52
52
  const isMutation = options.mutation !== false && !isQuery && (0, remeda.difference)(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
53
53
  const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
@@ -60,26 +60,26 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
60
60
  file: getFile(operation, { prefix: "create" })
61
61
  };
62
62
  const type = {
63
- file: getFile(operation, { pluginKey: [__kubb_plugin_ts.pluginTsName] }),
63
+ file: getFile(operation, { pluginKey: [_kubb_plugin_ts.pluginTsName] }),
64
64
  schemas: getSchemas(operation, {
65
- pluginKey: [__kubb_plugin_ts.pluginTsName],
65
+ pluginKey: [_kubb_plugin_ts.pluginTsName],
66
66
  type: "type"
67
67
  })
68
68
  };
69
69
  const zod = {
70
- file: getFile(operation, { pluginKey: [__kubb_plugin_zod.pluginZodName] }),
70
+ file: getFile(operation, { pluginKey: [_kubb_plugin_zod.pluginZodName] }),
71
71
  schemas: getSchemas(operation, {
72
- pluginKey: [__kubb_plugin_zod.pluginZodName],
72
+ pluginKey: [_kubb_plugin_zod.pluginZodName],
73
73
  type: "function"
74
74
  })
75
75
  };
76
- const shouldUseClientPlugin = !!pluginManager.getPluginByKey([__kubb_plugin_client.pluginClientName]) && options.client.clientType !== "class";
76
+ const shouldUseClientPlugin = !!pluginManager.getPluginByKey([_kubb_plugin_client.pluginClientName]) && options.client.clientType !== "class";
77
77
  const client = {
78
78
  name: shouldUseClientPlugin ? getName(operation, {
79
79
  type: "function",
80
- pluginKey: [__kubb_plugin_client.pluginClientName]
80
+ pluginKey: [_kubb_plugin_client.pluginClientName]
81
81
  }) : getName(operation, { type: "function" }),
82
- file: getFile(operation, { pluginKey: [__kubb_plugin_client.pluginClientName] })
82
+ file: getFile(operation, { pluginKey: [_kubb_plugin_client.pluginClientName] })
83
83
  };
84
84
  const mutationKey = {
85
85
  name: getName(operation, {
@@ -92,70 +92,70 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
92
92
  })
93
93
  };
94
94
  if (!isMutation) return null;
95
- return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
95
+ return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
96
96
  baseName: mutation.file.baseName,
97
97
  path: mutation.file.path,
98
98
  meta: mutation.file.meta,
99
- banner: (0, __kubb_plugin_oas_utils.getBanner)({
99
+ banner: (0, _kubb_plugin_oas_utils.getBanner)({
100
100
  oas,
101
101
  output,
102
102
  config: pluginManager.config
103
103
  }),
104
- footer: (0, __kubb_plugin_oas_utils.getFooter)({
104
+ footer: (0, _kubb_plugin_oas_utils.getFooter)({
105
105
  oas,
106
106
  output
107
107
  }),
108
108
  children: [
109
- options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
109
+ options.parser === "zod" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
110
110
  name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
111
111
  root: mutation.file.path,
112
112
  path: zod.file.path
113
113
  }),
114
- options.client.importPath ? /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
115
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
114
+ options.client.importPath ? /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
115
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
116
116
  name: "fetch",
117
117
  path: options.client.importPath
118
118
  }),
119
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
119
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
120
120
  name: ["RequestConfig", "ResponseErrorConfig"],
121
121
  path: options.client.importPath,
122
122
  isTypeOnly: true
123
123
  }),
124
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
124
+ options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
125
125
  name: ["ResponseConfig"],
126
126
  path: options.client.importPath,
127
127
  isTypeOnly: true
128
128
  })
129
- ] }) : /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
130
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
129
+ ] }) : /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
130
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
131
131
  name: ["fetch"],
132
132
  root: mutation.file.path,
133
133
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts")
134
134
  }),
135
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
135
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
136
136
  name: ["RequestConfig", "ResponseErrorConfig"],
137
137
  root: mutation.file.path,
138
138
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
139
139
  isTypeOnly: true
140
140
  }),
141
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
141
+ options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
142
142
  name: ["ResponseConfig"],
143
143
  root: mutation.file.path,
144
144
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
145
145
  isTypeOnly: true
146
146
  })
147
147
  ] }),
148
- shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
148
+ shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
149
149
  name: [client.name],
150
150
  root: mutation.file.path,
151
151
  path: client.file.path
152
152
  }),
153
- !shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
153
+ !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
154
154
  name: ["buildFormData"],
155
155
  root: mutation.file.path,
156
156
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/config.ts")
157
157
  }),
158
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
158
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
159
159
  name: [
160
160
  type.schemas.request?.name,
161
161
  type.schemas.response.name,
@@ -168,7 +168,7 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
168
168
  path: type.file.path,
169
169
  isTypeOnly: true
170
170
  }),
171
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.MutationKey, {
171
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.MutationKey, {
172
172
  name: mutationKey.name,
173
173
  typeName: mutationKey.typeName,
174
174
  operation,
@@ -177,7 +177,7 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
177
177
  typeSchemas: type.schemas,
178
178
  transformer: options.mutationKey
179
179
  }),
180
- !shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
180
+ !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_plugin_client_components.Client, {
181
181
  name: client.name,
182
182
  baseURL: options.client.baseURL,
183
183
  operation,
@@ -189,12 +189,12 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
189
189
  pathParamsType: options.pathParamsType,
190
190
  parser: options.parser
191
191
  }),
192
- options.mutation && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
193
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
192
+ options.mutation && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
193
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
194
194
  name: ["createMutation"],
195
195
  path: importPath
196
196
  }),
197
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
197
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
198
198
  name: [
199
199
  "CreateMutationOptions",
200
200
  "CreateMutationResult",
@@ -203,7 +203,7 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
203
203
  path: importPath,
204
204
  isTypeOnly: true
205
205
  }),
206
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Mutation, {
206
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.Mutation, {
207
207
  name: mutation.name,
208
208
  clientName: client.name,
209
209
  typeName: mutation.typeName,
@@ -223,13 +223,13 @@ const mutationGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)
223
223
 
224
224
  //#endregion
225
225
  //#region src/generators/queryGenerator.tsx
226
- const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
226
+ const queryGenerator = (0, _kubb_plugin_oas_generators.createReactGenerator)({
227
227
  name: "svelte-query",
228
228
  Operation({ config, operation, generator, plugin }) {
229
229
  const { options, options: { output } } = plugin;
230
- const pluginManager = (0, __kubb_core_hooks.usePluginManager)();
231
- const oas = (0, __kubb_plugin_oas_hooks.useOas)();
232
- const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)(generator);
230
+ const pluginManager = (0, _kubb_core_hooks.usePluginManager)();
231
+ const oas = (0, _kubb_plugin_oas_hooks.useOas)();
232
+ const { getSchemas, getName, getFile } = (0, _kubb_plugin_oas_hooks.useOperationManager)(generator);
233
233
  const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
234
234
  const isMutation = (0, remeda.difference)(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
235
235
  const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
@@ -241,13 +241,13 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
241
241
  typeName: getName(operation, { type: "type" }),
242
242
  file: getFile(operation, { prefix: "create" })
243
243
  };
244
- const shouldUseClientPlugin = !!pluginManager.getPluginByKey([__kubb_plugin_client.pluginClientName]) && options.client.clientType !== "class";
244
+ const shouldUseClientPlugin = !!pluginManager.getPluginByKey([_kubb_plugin_client.pluginClientName]) && options.client.clientType !== "class";
245
245
  const client = {
246
246
  name: shouldUseClientPlugin ? getName(operation, {
247
247
  type: "function",
248
- pluginKey: [__kubb_plugin_client.pluginClientName]
248
+ pluginKey: [_kubb_plugin_client.pluginClientName]
249
249
  }) : getName(operation, { type: "function" }),
250
- file: getFile(operation, { pluginKey: [__kubb_plugin_client.pluginClientName] })
250
+ file: getFile(operation, { pluginKey: [_kubb_plugin_client.pluginClientName] })
251
251
  };
252
252
  const queryOptions = { name: getName(operation, {
253
253
  type: "function",
@@ -264,84 +264,84 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
264
264
  })
265
265
  };
266
266
  const type = {
267
- file: getFile(operation, { pluginKey: [__kubb_plugin_ts.pluginTsName] }),
267
+ file: getFile(operation, { pluginKey: [_kubb_plugin_ts.pluginTsName] }),
268
268
  schemas: getSchemas(operation, {
269
- pluginKey: [__kubb_plugin_ts.pluginTsName],
269
+ pluginKey: [_kubb_plugin_ts.pluginTsName],
270
270
  type: "type"
271
271
  })
272
272
  };
273
273
  const zod = {
274
- file: getFile(operation, { pluginKey: [__kubb_plugin_zod.pluginZodName] }),
274
+ file: getFile(operation, { pluginKey: [_kubb_plugin_zod.pluginZodName] }),
275
275
  schemas: getSchemas(operation, {
276
- pluginKey: [__kubb_plugin_zod.pluginZodName],
276
+ pluginKey: [_kubb_plugin_zod.pluginZodName],
277
277
  type: "function"
278
278
  })
279
279
  };
280
280
  if (!isQuery || isMutation) return null;
281
- return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric.File, {
281
+ return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
282
282
  baseName: query.file.baseName,
283
283
  path: query.file.path,
284
284
  meta: query.file.meta,
285
- banner: (0, __kubb_plugin_oas_utils.getBanner)({
285
+ banner: (0, _kubb_plugin_oas_utils.getBanner)({
286
286
  oas,
287
287
  output,
288
288
  config: pluginManager.config
289
289
  }),
290
- footer: (0, __kubb_plugin_oas_utils.getFooter)({
290
+ footer: (0, _kubb_plugin_oas_utils.getFooter)({
291
291
  oas,
292
292
  output
293
293
  }),
294
294
  children: [
295
- options.parser === "zod" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
295
+ options.parser === "zod" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
296
296
  name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean),
297
297
  root: query.file.path,
298
298
  path: zod.file.path
299
299
  }),
300
- options.client.importPath ? /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
301
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
300
+ options.client.importPath ? /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
301
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
302
302
  name: "fetch",
303
303
  path: options.client.importPath
304
304
  }),
305
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
305
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
306
306
  name: ["RequestConfig", "ResponseErrorConfig"],
307
307
  path: options.client.importPath,
308
308
  isTypeOnly: true
309
309
  }),
310
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
310
+ options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
311
311
  name: ["ResponseConfig"],
312
312
  path: options.client.importPath,
313
313
  isTypeOnly: true
314
314
  })
315
- ] }) : /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
316
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
315
+ ] }) : /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
316
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
317
317
  name: ["fetch"],
318
318
  root: query.file.path,
319
319
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts")
320
320
  }),
321
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
321
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
322
322
  name: ["RequestConfig", "ResponseErrorConfig"],
323
323
  root: query.file.path,
324
324
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
325
325
  isTypeOnly: true
326
326
  }),
327
- options.client.dataReturnType === "full" && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
327
+ options.client.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
328
328
  name: ["ResponseConfig"],
329
329
  root: query.file.path,
330
330
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/fetch.ts"),
331
331
  isTypeOnly: true
332
332
  })
333
333
  ] }),
334
- shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
334
+ shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
335
335
  name: [client.name],
336
336
  root: query.file.path,
337
337
  path: client.file.path
338
338
  }),
339
- !shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
339
+ !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
340
340
  name: ["buildFormData"],
341
341
  root: query.file.path,
342
342
  path: node_path.default.resolve(config.root, config.output.path, ".kubb/config.ts")
343
343
  }),
344
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
344
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
345
345
  name: [
346
346
  type.schemas.request?.name,
347
347
  type.schemas.response.name,
@@ -354,7 +354,7 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
354
354
  path: type.file.path,
355
355
  isTypeOnly: true
356
356
  }),
357
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryKey, {
357
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryKey, {
358
358
  name: queryKey.name,
359
359
  typeName: queryKey.typeName,
360
360
  operation,
@@ -363,7 +363,7 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
363
363
  paramsCasing: options.paramsCasing,
364
364
  transformer: options.queryKey
365
365
  }),
366
- !shouldUseClientPlugin && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_plugin_client_components.Client, {
366
+ !shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_plugin_client_components.Client, {
367
367
  name: client.name,
368
368
  baseURL: options.client.baseURL,
369
369
  operation,
@@ -375,11 +375,11 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
375
375
  pathParamsType: options.pathParamsType,
376
376
  parser: options.parser
377
377
  }),
378
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
378
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
379
379
  name: ["queryOptions"],
380
380
  path: importPath
381
381
  }),
382
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryOptions, {
382
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.QueryOptions, {
383
383
  name: queryOptions.name,
384
384
  clientName: client.name,
385
385
  queryKeyName: queryKey.name,
@@ -389,12 +389,12 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
389
389
  pathParamsType: options.pathParamsType,
390
390
  dataReturnType: options.client.dataReturnType || "data"
391
391
  }),
392
- options.query && /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsxs)(__kubb_react_fabric_jsx_runtime.Fragment, { children: [
393
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
392
+ options.query && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [
393
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
394
394
  name: ["createQuery"],
395
395
  path: importPath
396
396
  }),
397
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(__kubb_react_fabric.File.Import, {
397
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
398
398
  name: [
399
399
  "QueryKey",
400
400
  "QueryClient",
@@ -404,7 +404,7 @@ const queryGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
404
404
  path: importPath,
405
405
  isTypeOnly: true
406
406
  }),
407
- /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(require_components.Query, {
407
+ /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(require_components.Query, {
408
408
  name: query.name,
409
409
  queryOptionsName: queryOptions.name,
410
410
  typeSchemas: type.schemas,
@@ -441,4 +441,4 @@ Object.defineProperty(exports, 'queryGenerator', {
441
441
  return queryGenerator;
442
442
  }
443
443
  });
444
- //# sourceMappingURL=generators-B2wubEts.cjs.map
444
+ //# sourceMappingURL=generators-ByXJj_yX.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generators-B2wubEts.cjs","names":["pluginTsName","pluginZodName","pluginClientName","File","path","MutationKey","Client","Mutation","pluginClientName","pluginTsName","pluginZodName","File","path","QueryKey","Client","QueryOptions","Query"],"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 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 : '@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 // 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 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/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.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/fetch.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && (\n <File.Import name={['buildFormData']} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.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={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 {!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.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 // 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 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, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [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: 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/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && (\n <File.Import name={['buildFormData']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.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\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 {!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.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,2EAA4D;CACvE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW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,QAAQ;KACtB,aAAa,QAAQ;MACrB;IAED,CAAC,yBACA,yDAACC;KACC,MAAM,OAAO;KACb,SAAS,QAAQ,OAAO;KACb;KACX,aAAa,KAAK;KAClB,YAAY,IAAI;KAChB,gBAAgB,QAAQ,OAAO,kBAAkB;KACjD,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,QAAQ,QAAQ;MAChB;IAEJ,yDAACH,yBAAK;KAAO,MAAM,CAAC,eAAe;KAAE,MAAM;MAAc;IACzD,yDAACI;KACC,MAAM,aAAa;KACnB,YAAY,OAAO;KACnB,cAAc,SAAS;KACvB,aAAa,KAAK;KAClB,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD;IACD,QAAQ,SACP;KACE,yDAACJ,yBAAK;MAAO,MAAM,CAAC,cAAc;MAAE,MAAM;OAAc;KACxD,yDAACA,yBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAA0B;OAAoB;MAAE,MAAM;MAAY;OAAa;KAC9H,yDAACK;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,gBAAgB,QAAQ;MACb;MACX,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
1
+ {"version":3,"file":"generators-ByXJj_yX.cjs","names":["pluginTsName","pluginZodName","pluginClientName","File","path","MutationKey","Client","Mutation","pluginClientName","pluginTsName","pluginZodName","File","path","QueryKey","Client","QueryOptions","Query"],"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 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 : '@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 // 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 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/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.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/fetch.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && (\n <File.Import name={['buildFormData']} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.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={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 {!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.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 // 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 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, {\n pluginKey: [pluginTsName],\n type: 'type',\n }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, {\n pluginKey: [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: 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/fetch.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n {shouldUseClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n {!shouldUseClientPlugin && (\n <File.Import name={['buildFormData']} root={query.file.path} path={path.resolve(config.root, config.output.path, '.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\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 {!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.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,0EAA4D;CACvE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,wDAAkC;EAExC,MAAM,0CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,4DAAgC,UAAU;EAEvE,MAAM,UAAU,CAAC,CAAC,QAAQ,SAAS,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO;EACvG,MAAM,aACJ,QAAQ,aAAa,SACrB,CAAC,kCACU,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,aAAa;EAEpE,MAAM,WAAW;GACf,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAU,CAAC;GAChE,UAAU,QAAQ,WAAW,EAAE,MAAM,QAAQ,CAAC;GAC9C,MAAM,QAAQ,WAAW,EAAE,QAAQ,UAAU,CAAC;GAC/C;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAACA,6BAAa,EAAE,CAAC;GAEvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAACA,6BAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;EAED,MA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B,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
@@ -1,4 +1,4 @@
1
- const require_generators = require('./generators-B2wubEts.cjs');
1
+ const require_generators = require('./generators-ByXJj_yX.cjs');
2
2
 
3
3
  exports.mutationGenerator = require_generators.mutationGenerator;
4
4
  exports.queryGenerator = require_generators.queryGenerator;