@kubb/plugin-svelte-query 3.0.0-beta.10 → 3.0.0-beta.12

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 (43) hide show
  1. package/dist/{chunk-VO3QBBZG.cjs → chunk-CDRGJAED.cjs} +61 -54
  2. package/dist/chunk-CDRGJAED.cjs.map +1 -0
  3. package/dist/{chunk-NH7LXCFD.js → chunk-JGITTOE5.js} +55 -48
  4. package/dist/chunk-JGITTOE5.js.map +1 -0
  5. package/dist/{chunk-HUR476BL.cjs → chunk-KRGCKSGR.cjs} +22 -10
  6. package/dist/chunk-KRGCKSGR.cjs.map +1 -0
  7. package/dist/{chunk-LSV2AJSI.js → chunk-R6ZVBNG7.js} +22 -10
  8. package/dist/chunk-R6ZVBNG7.js.map +1 -0
  9. package/dist/components.cjs +6 -6
  10. package/dist/components.d.cts +7 -5
  11. package/dist/components.d.ts +7 -5
  12. package/dist/components.js +1 -1
  13. package/dist/generators.cjs +4 -4
  14. package/dist/generators.d.cts +1 -1
  15. package/dist/generators.d.ts +1 -1
  16. package/dist/generators.js +2 -2
  17. package/dist/index.cjs +20 -22
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +19 -21
  22. package/dist/index.js.map +1 -1
  23. package/dist/{types-Cg7Z4H-7.d.cts → types-B9W9aYra.d.cts} +187 -22
  24. package/dist/{types-Cg7Z4H-7.d.ts → types-B9W9aYra.d.ts} +187 -22
  25. package/package.json +11 -11
  26. package/src/components/MutationKey.tsx +11 -5
  27. package/src/components/QueryKey.tsx +17 -7
  28. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +1 -1
  29. package/src/generators/__snapshots__/clientGetImportPath.ts +1 -1
  30. package/src/generators/__snapshots__/findByTags.ts +1 -1
  31. package/src/generators/__snapshots__/findByTagsObject.ts +1 -1
  32. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +1 -1
  33. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +2 -2
  34. package/src/generators/__snapshots__/findByTagsWithZod.ts +1 -1
  35. package/src/generators/__snapshots__/postAsQuery.ts +1 -1
  36. package/src/generators/mutationGenerator.tsx +24 -16
  37. package/src/generators/queryGenerator.tsx +23 -17
  38. package/src/plugin.ts +19 -19
  39. package/src/types.ts +26 -13
  40. package/dist/chunk-HUR476BL.cjs.map +0 -1
  41. package/dist/chunk-LSV2AJSI.js.map +0 -1
  42. package/dist/chunk-NH7LXCFD.js.map +0 -1
  43. package/dist/chunk-VO3QBBZG.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHUR476BL_cjs = require('./chunk-HUR476BL.cjs');
3
+ var chunkKRGCKSGR_cjs = require('./chunk-KRGCKSGR.cjs');
4
4
  var path = require('path');
5
5
  var core = require('@kubb/core');
6
6
  var transformers = require('@kubb/core/transformers');
@@ -57,7 +57,7 @@ var clientGenerator = pluginOas.createReactGenerator({
57
57
  }
58
58
  ),
59
59
  /* @__PURE__ */ jsxRuntime.jsx(
60
- chunkHUR476BL_cjs.Client,
60
+ chunkKRGCKSGR_cjs.Client,
61
61
  {
62
62
  name: client.name,
63
63
  baseURL: options.baseURL,
@@ -84,7 +84,7 @@ var operationsGenerator = pluginOas.createReactGenerator({
84
84
  } = react.useApp();
85
85
  const name = "operations";
86
86
  const file = pluginManager.getFile({ name, extname: ".ts", pluginKey: [pluginClientName] });
87
- return /* @__PURE__ */ jsxRuntime.jsx(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: /* @__PURE__ */ jsxRuntime.jsx(chunkHUR476BL_cjs.Operations, { name, operations }) });
87
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, banner: output?.banner, footer: output?.footer, children: /* @__PURE__ */ jsxRuntime.jsx(chunkKRGCKSGR_cjs.Operations, { name, operations }) });
88
88
  }
89
89
  });
90
90
  var groupedClientGenerator = pluginOas.createReactGenerator({
@@ -147,6 +147,7 @@ core.createPlugin((options) => {
147
147
  pathParamsType = "inline",
148
148
  paramsType = "inline",
149
149
  operations = false,
150
+ baseURL,
150
151
  generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
151
152
  importPath = "@kubb/plugin-client/client",
152
153
  parser = "client"
@@ -161,7 +162,7 @@ core.createPlugin((options) => {
161
162
  importPath,
162
163
  paramsType,
163
164
  pathParamsType: paramsType === "object" ? "object" : pathParamsType,
164
- baseURL: void 0
165
+ baseURL
165
166
  },
166
167
  pre: [pluginOas.pluginOasName, parser === "zod" ? pluginZod.pluginZodName : void 0].filter(Boolean),
167
168
  resolvePath(baseName, pathMode, options2) {
@@ -188,12 +189,12 @@ core.createPlugin((options) => {
188
189
  const oas = await swaggerPlugin.context.getOas();
189
190
  const root = path__default.default.resolve(this.config.root, this.config.output.path);
190
191
  const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
191
- const baseURL = await swaggerPlugin.context.getBaseURL();
192
+ const baseURL2 = await swaggerPlugin.context.getBaseURL();
192
193
  const operationGenerator = new pluginOas.OperationGenerator(
193
- {
194
+ baseURL2 ? {
194
195
  ...this.plugin.options,
195
- baseURL
196
- },
196
+ baseURL: baseURL2
197
+ } : this.plugin.options,
197
198
  {
198
199
  oas,
199
200
  pluginManager: this.pluginManager,
@@ -231,7 +232,7 @@ var queryGenerator = pluginOas.createReactGenerator({
231
232
  } = react.useApp();
232
233
  const { getSchemas, getName, getFile } = hooks.useOperationManager();
233
234
  const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
234
- !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method);
235
+ const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
235
236
  const query = {
236
237
  name: getName(operation, { type: "function", prefix: "create" }),
237
238
  typeName: getName(operation, { type: "type" }),
@@ -256,13 +257,11 @@ var queryGenerator = pluginOas.createReactGenerator({
256
257
  file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
257
258
  schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
258
259
  };
259
- if (!isQuery || typeof options.query === "boolean") {
260
+ if (!isQuery) {
260
261
  return null;
261
262
  }
262
263
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
263
264
  options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
264
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery", "queryOptions"], path: options.query.importPath }),
265
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "WithRequired", "CreateBaseQueryOptions", "CreateQueryResult"], path: options.query.importPath, isTypeOnly: true }),
266
265
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
267
266
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig"], path: options.client.importPath, isTypeOnly: true }),
268
267
  options.client.dataReturnType === "full" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
@@ -283,23 +282,23 @@ var queryGenerator = pluginOas.createReactGenerator({
283
282
  }
284
283
  ),
285
284
  /* @__PURE__ */ jsxRuntime.jsx(
286
- chunkHUR476BL_cjs.QueryKey,
285
+ chunkKRGCKSGR_cjs.QueryKey,
287
286
  {
288
287
  name: queryKey.name,
289
288
  typeName: queryKey.typeName,
290
289
  operation,
291
290
  pathParamsType: options.pathParamsType,
292
291
  typeSchemas: type.schemas,
293
- keysFn: options.query.key
292
+ transformer: options.queryKey
294
293
  }
295
294
  ),
296
295
  /* @__PURE__ */ jsxRuntime.jsx(
297
- chunkHUR476BL_cjs.Client,
296
+ chunkKRGCKSGR_cjs.Client,
298
297
  {
299
298
  name: client.name,
300
299
  isExportable: false,
301
300
  isIndexable: false,
302
- baseURL: options.baseURL,
301
+ baseURL: options.client.baseURL,
303
302
  operation,
304
303
  typeSchemas: type.schemas,
305
304
  zodSchemas: zod.schemas,
@@ -309,8 +308,9 @@ var queryGenerator = pluginOas.createReactGenerator({
309
308
  parser: options.parser
310
309
  }
311
310
  ),
311
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
312
312
  /* @__PURE__ */ jsxRuntime.jsx(
313
- chunkHUR476BL_cjs.QueryOptions,
313
+ chunkKRGCKSGR_cjs.QueryOptions,
314
314
  {
315
315
  name: queryOptions.name,
316
316
  clientName: client.name,
@@ -320,20 +320,24 @@ var queryGenerator = pluginOas.createReactGenerator({
320
320
  pathParamsType: options.pathParamsType
321
321
  }
322
322
  ),
323
- /* @__PURE__ */ jsxRuntime.jsx(
324
- chunkHUR476BL_cjs.Query,
325
- {
326
- name: query.name,
327
- queryOptionsName: queryOptions.name,
328
- typeSchemas: type.schemas,
329
- pathParamsType: options.pathParamsType,
330
- operation,
331
- paramsType: options.paramsType,
332
- dataReturnType: options.client.dataReturnType,
333
- queryKeyName: queryKey.name,
334
- queryKeyTypeName: queryKey.typeName
335
- }
336
- )
323
+ options.query && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
324
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery"], path: importPath }),
325
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
326
+ /* @__PURE__ */ jsxRuntime.jsx(
327
+ chunkKRGCKSGR_cjs.Query,
328
+ {
329
+ name: query.name,
330
+ queryOptionsName: queryOptions.name,
331
+ typeSchemas: type.schemas,
332
+ pathParamsType: options.pathParamsType,
333
+ operation,
334
+ paramsType: options.paramsType,
335
+ dataReturnType: options.client.dataReturnType,
336
+ queryKeyName: queryKey.name,
337
+ queryKeyTypeName: queryKey.typeName
338
+ }
339
+ )
340
+ ] })
337
341
  ] });
338
342
  }
339
343
  });
@@ -348,6 +352,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
348
352
  const { getSchemas, getName, getFile } = hooks.useOperationManager();
349
353
  const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
350
354
  const isMutation = !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method);
355
+ const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
351
356
  const mutation = {
352
357
  name: getName(operation, { type: "function", prefix: "create" }),
353
358
  typeName: getName(operation, { type: "type" }),
@@ -369,13 +374,11 @@ var mutationGenerator = pluginOas.createReactGenerator({
369
374
  name: getName(operation, { type: "const", suffix: "MutationKey" }),
370
375
  typeName: getName(operation, { type: "type", suffix: "MutationKey" })
371
376
  };
372
- if (!isMutation || typeof options.mutation === "boolean") {
377
+ if (!isMutation) {
373
378
  return null;
374
379
  }
375
380
  return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: mutation.file.baseName, path: mutation.file.path, meta: mutation.file.meta, banner: output?.banner, footer: output?.footer, children: [
376
381
  options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
377
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: options.mutation.importPath }),
378
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: options.mutation.importPath, isTypeOnly: true }),
379
382
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
380
383
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
381
384
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -395,23 +398,23 @@ var mutationGenerator = pluginOas.createReactGenerator({
395
398
  }
396
399
  ),
397
400
  /* @__PURE__ */ jsxRuntime.jsx(
398
- chunkHUR476BL_cjs.MutationKey,
401
+ chunkKRGCKSGR_cjs.MutationKey,
399
402
  {
400
403
  name: mutationKey.name,
401
404
  typeName: mutationKey.typeName,
402
405
  operation,
403
406
  pathParamsType: options.pathParamsType,
404
407
  typeSchemas: type.schemas,
405
- keysFn: options.mutation.key
408
+ transformer: options.mutationKey
406
409
  }
407
410
  ),
408
411
  /* @__PURE__ */ jsxRuntime.jsx(
409
- chunkHUR476BL_cjs.Client,
412
+ chunkKRGCKSGR_cjs.Client,
410
413
  {
411
414
  name: client.name,
412
415
  isExportable: false,
413
416
  isIndexable: false,
414
- baseURL: options.baseURL,
417
+ baseURL: options.client.baseURL,
415
418
  operation,
416
419
  typeSchemas: type.schemas,
417
420
  zodSchemas: zod.schemas,
@@ -421,25 +424,29 @@ var mutationGenerator = pluginOas.createReactGenerator({
421
424
  parser: options.parser
422
425
  }
423
426
  ),
424
- /* @__PURE__ */ jsxRuntime.jsx(
425
- chunkHUR476BL_cjs.Mutation,
426
- {
427
- name: mutation.name,
428
- clientName: client.name,
429
- typeName: mutation.typeName,
430
- typeSchemas: type.schemas,
431
- operation,
432
- dataReturnType: options.client.dataReturnType,
433
- paramsType: options.paramsType,
434
- pathParamsType: options.pathParamsType,
435
- mutationKeyName: mutationKey.name
436
- }
437
- )
427
+ options.mutation && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
428
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: importPath }),
429
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: importPath, isTypeOnly: true }),
430
+ /* @__PURE__ */ jsxRuntime.jsx(
431
+ chunkKRGCKSGR_cjs.Mutation,
432
+ {
433
+ name: mutation.name,
434
+ clientName: client.name,
435
+ typeName: mutation.typeName,
436
+ typeSchemas: type.schemas,
437
+ operation,
438
+ dataReturnType: options.client.dataReturnType,
439
+ paramsType: options.paramsType,
440
+ pathParamsType: options.pathParamsType,
441
+ mutationKeyName: mutationKey.name
442
+ }
443
+ )
444
+ ] })
438
445
  ] });
439
446
  }
440
447
  });
441
448
 
442
449
  exports.mutationGenerator = mutationGenerator;
443
450
  exports.queryGenerator = queryGenerator;
444
- //# sourceMappingURL=chunk-VO3QBBZG.cjs.map
445
- //# sourceMappingURL=chunk-VO3QBBZG.cjs.map
451
+ //# sourceMappingURL=chunk-CDRGJAED.cjs.map
452
+ //# sourceMappingURL=chunk-CDRGJAED.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","useOperationManager","pluginTsName","pluginZodName","File","jsx","Client","Operations","camelCase","jsxs","Function","createPlugin","transformers","pluginOasName","options","path","FileManager","PluginManager","baseURL","OperationGenerator","QueryKey","QueryOptions","Fragment","Query","MutationKey","Mutation"],"mappings":";;;;;;;;;;;;;;;;;AAQO,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,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,CA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B,OACF,EAAA;AAAA,KAEJ,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-CDRGJAED.cjs","sourcesContent":["import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { Client } from '../components/Client'\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 { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\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 baseName={client.file.baseName} path={client.file.path} meta={client.file.meta} banner={output?.banner} footer={output?.footer}>\n <File.Import name={'client'} path={options.importPath} />\n <File.Import name={['RequestConfig']} 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 <Client\n name={client.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\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 { pluginClientName } from '@kubb/plugin-client'\nimport { createReactGenerator } from '@kubb/plugin-oas'\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 options: { output },\n },\n } = useApp<PluginClient>()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey: [pluginClientName] })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta} banner={output?.banner} footer={output?.footer}>\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'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\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 },\n } = useApp<PluginClient>()\n const { getName, getFile } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const tag = operation.getTags().at(0)?.name\n const name = tag ? options.group?.name?.({ group: camelCase(tag) }) : undefined\n\n if (!tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey: [pluginClientName],\n options: { tag },\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 key={file.path} baseName={file.baseName} path={file.path} meta={file.meta} banner={options.output?.banner} footer={options.output?.footer}>\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 generators = [clientGenerator, group ? groupedClientGenerator : undefined, operations ? operationsGenerator : undefined].filter(Boolean),\n importPath = '@kubb/plugin-client/client',\n parser = 'client',\n } = options\n\n return {\n name: pluginClientName,\n options: {\n output,\n group,\n parser,\n dataReturnType,\n importPath,\n paramsType,\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 (options?.tag && group?.type === 'tag') {\n const groupName: Group['name'] = group?.name ? group.name : (ctx) => `${ctx.group}Controller`\n\n return path.resolve(root, output.path, groupName({ group: camelCase(options.tag) }), baseName)\n }\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 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 { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\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 } = useApp<PluginSvelteQuery>()\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 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 client = {\n name: getName(operation, { type: 'function', 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) {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig']} 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 transformer={options.queryKey}\n />\n\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\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 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 { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\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 } = useApp<PluginSvelteQuery>()\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 = !isQuery && options.mutation && options.mutation.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 client = {\n name: getName(operation, { type: 'function', 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 baseName={mutation.file.baseName} path={mutation.file.path} meta={mutation.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}\n\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', '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={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\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 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"]}
@@ -1,4 +1,4 @@
1
- import { Client, Operations, QueryKey, QueryOptions, Query, MutationKey, Mutation } from './chunk-LSV2AJSI.js';
1
+ import { Client, Operations, QueryKey, QueryOptions, Query, MutationKey, Mutation } from './chunk-R6ZVBNG7.js';
2
2
  import path from 'node:path';
3
3
  import { createPlugin, FileManager, PluginManager } from '@kubb/core';
4
4
  import { camelCase } from '@kubb/core/transformers';
@@ -7,7 +7,7 @@ import { pluginZodName } from '@kubb/plugin-zod';
7
7
  import { useOperationManager } from '@kubb/plugin-oas/hooks';
8
8
  import { pluginTsName } from '@kubb/plugin-ts';
9
9
  import { useApp, File, Function } from '@kubb/react';
10
- import { jsxs, jsx } from '@kubb/react/jsx-runtime';
10
+ import { jsxs, jsx, Fragment } from '@kubb/react/jsx-runtime';
11
11
 
12
12
  var clientGenerator = createReactGenerator({
13
13
  name: "client",
@@ -141,6 +141,7 @@ createPlugin((options) => {
141
141
  pathParamsType = "inline",
142
142
  paramsType = "inline",
143
143
  operations = false,
144
+ baseURL,
144
145
  generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
145
146
  importPath = "@kubb/plugin-client/client",
146
147
  parser = "client"
@@ -155,7 +156,7 @@ createPlugin((options) => {
155
156
  importPath,
156
157
  paramsType,
157
158
  pathParamsType: paramsType === "object" ? "object" : pathParamsType,
158
- baseURL: void 0
159
+ baseURL
159
160
  },
160
161
  pre: [pluginOasName, parser === "zod" ? pluginZodName : void 0].filter(Boolean),
161
162
  resolvePath(baseName, pathMode, options2) {
@@ -182,12 +183,12 @@ createPlugin((options) => {
182
183
  const oas = await swaggerPlugin.context.getOas();
183
184
  const root = path.resolve(this.config.root, this.config.output.path);
184
185
  const mode = FileManager.getMode(path.resolve(root, output.path));
185
- const baseURL = await swaggerPlugin.context.getBaseURL();
186
+ const baseURL2 = await swaggerPlugin.context.getBaseURL();
186
187
  const operationGenerator = new OperationGenerator(
187
- {
188
+ baseURL2 ? {
188
189
  ...this.plugin.options,
189
- baseURL
190
- },
190
+ baseURL: baseURL2
191
+ } : this.plugin.options,
191
192
  {
192
193
  oas,
193
194
  pluginManager: this.pluginManager,
@@ -225,7 +226,7 @@ var queryGenerator = createReactGenerator({
225
226
  } = useApp();
226
227
  const { getSchemas, getName, getFile } = useOperationManager();
227
228
  const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
228
- !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method);
229
+ const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
229
230
  const query = {
230
231
  name: getName(operation, { type: "function", prefix: "create" }),
231
232
  typeName: getName(operation, { type: "type" }),
@@ -250,13 +251,11 @@ var queryGenerator = createReactGenerator({
250
251
  file: getFile(operation, { pluginKey: [pluginZodName] }),
251
252
  schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
252
253
  };
253
- if (!isQuery || typeof options.query === "boolean") {
254
+ if (!isQuery) {
254
255
  return null;
255
256
  }
256
257
  return /* @__PURE__ */ jsxs(File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
257
258
  options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
258
- /* @__PURE__ */ jsx(File.Import, { name: ["createQuery", "queryOptions"], path: options.query.importPath }),
259
- /* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "WithRequired", "CreateBaseQueryOptions", "CreateQueryResult"], path: options.query.importPath, isTypeOnly: true }),
260
259
  /* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
261
260
  /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig"], path: options.client.importPath, isTypeOnly: true }),
262
261
  options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
@@ -284,7 +283,7 @@ var queryGenerator = createReactGenerator({
284
283
  operation,
285
284
  pathParamsType: options.pathParamsType,
286
285
  typeSchemas: type.schemas,
287
- keysFn: options.query.key
286
+ transformer: options.queryKey
288
287
  }
289
288
  ),
290
289
  /* @__PURE__ */ jsx(
@@ -293,7 +292,7 @@ var queryGenerator = createReactGenerator({
293
292
  name: client.name,
294
293
  isExportable: false,
295
294
  isIndexable: false,
296
- baseURL: options.baseURL,
295
+ baseURL: options.client.baseURL,
297
296
  operation,
298
297
  typeSchemas: type.schemas,
299
298
  zodSchemas: zod.schemas,
@@ -303,6 +302,7 @@ var queryGenerator = createReactGenerator({
303
302
  parser: options.parser
304
303
  }
305
304
  ),
305
+ /* @__PURE__ */ jsx(File.Import, { name: ["queryOptions"], path: importPath }),
306
306
  /* @__PURE__ */ jsx(
307
307
  QueryOptions,
308
308
  {
@@ -314,20 +314,24 @@ var queryGenerator = createReactGenerator({
314
314
  pathParamsType: options.pathParamsType
315
315
  }
316
316
  ),
317
- /* @__PURE__ */ jsx(
318
- Query,
319
- {
320
- name: query.name,
321
- queryOptionsName: queryOptions.name,
322
- typeSchemas: type.schemas,
323
- pathParamsType: options.pathParamsType,
324
- operation,
325
- paramsType: options.paramsType,
326
- dataReturnType: options.client.dataReturnType,
327
- queryKeyName: queryKey.name,
328
- queryKeyTypeName: queryKey.typeName
329
- }
330
- )
317
+ options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
318
+ /* @__PURE__ */ jsx(File.Import, { name: ["createQuery"], path: importPath }),
319
+ /* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
320
+ /* @__PURE__ */ jsx(
321
+ Query,
322
+ {
323
+ name: query.name,
324
+ queryOptionsName: queryOptions.name,
325
+ typeSchemas: type.schemas,
326
+ pathParamsType: options.pathParamsType,
327
+ operation,
328
+ paramsType: options.paramsType,
329
+ dataReturnType: options.client.dataReturnType,
330
+ queryKeyName: queryKey.name,
331
+ queryKeyTypeName: queryKey.typeName
332
+ }
333
+ )
334
+ ] })
331
335
  ] });
332
336
  }
333
337
  });
@@ -342,6 +346,7 @@ var mutationGenerator = createReactGenerator({
342
346
  const { getSchemas, getName, getFile } = useOperationManager();
343
347
  const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
344
348
  const isMutation = !isQuery && options.mutation && options.mutation.methods.some((method) => operation.method === method);
349
+ const importPath = options.mutation ? options.mutation.importPath : "@tanstack/svelte-query";
345
350
  const mutation = {
346
351
  name: getName(operation, { type: "function", prefix: "create" }),
347
352
  typeName: getName(operation, { type: "type" }),
@@ -363,13 +368,11 @@ var mutationGenerator = createReactGenerator({
363
368
  name: getName(operation, { type: "const", suffix: "MutationKey" }),
364
369
  typeName: getName(operation, { type: "type", suffix: "MutationKey" })
365
370
  };
366
- if (!isMutation || typeof options.mutation === "boolean") {
371
+ if (!isMutation) {
367
372
  return null;
368
373
  }
369
374
  return /* @__PURE__ */ jsxs(File, { baseName: mutation.file.baseName, path: mutation.file.path, meta: mutation.file.meta, banner: output?.banner, footer: output?.footer, children: [
370
375
  options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
371
- /* @__PURE__ */ jsx(File.Import, { name: ["createMutation"], path: options.mutation.importPath }),
372
- /* @__PURE__ */ jsx(File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: options.mutation.importPath, isTypeOnly: true }),
373
376
  /* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
374
377
  /* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
375
378
  /* @__PURE__ */ jsx(
@@ -396,7 +399,7 @@ var mutationGenerator = createReactGenerator({
396
399
  operation,
397
400
  pathParamsType: options.pathParamsType,
398
401
  typeSchemas: type.schemas,
399
- keysFn: options.mutation.key
402
+ transformer: options.mutationKey
400
403
  }
401
404
  ),
402
405
  /* @__PURE__ */ jsx(
@@ -405,7 +408,7 @@ var mutationGenerator = createReactGenerator({
405
408
  name: client.name,
406
409
  isExportable: false,
407
410
  isIndexable: false,
408
- baseURL: options.baseURL,
411
+ baseURL: options.client.baseURL,
409
412
  operation,
410
413
  typeSchemas: type.schemas,
411
414
  zodSchemas: zod.schemas,
@@ -415,24 +418,28 @@ var mutationGenerator = createReactGenerator({
415
418
  parser: options.parser
416
419
  }
417
420
  ),
418
- /* @__PURE__ */ jsx(
419
- Mutation,
420
- {
421
- name: mutation.name,
422
- clientName: client.name,
423
- typeName: mutation.typeName,
424
- typeSchemas: type.schemas,
425
- operation,
426
- dataReturnType: options.client.dataReturnType,
427
- paramsType: options.paramsType,
428
- pathParamsType: options.pathParamsType,
429
- mutationKeyName: mutationKey.name
430
- }
431
- )
421
+ options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
422
+ /* @__PURE__ */ jsx(File.Import, { name: ["createMutation"], path: importPath }),
423
+ /* @__PURE__ */ jsx(File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: importPath, isTypeOnly: true }),
424
+ /* @__PURE__ */ jsx(
425
+ Mutation,
426
+ {
427
+ name: mutation.name,
428
+ clientName: client.name,
429
+ typeName: mutation.typeName,
430
+ typeSchemas: type.schemas,
431
+ operation,
432
+ dataReturnType: options.client.dataReturnType,
433
+ paramsType: options.paramsType,
434
+ pathParamsType: options.pathParamsType,
435
+ mutationKeyName: mutationKey.name
436
+ }
437
+ )
438
+ ] })
432
439
  ] });
433
440
  }
434
441
  });
435
442
 
436
443
  export { mutationGenerator, queryGenerator };
437
- //# sourceMappingURL=chunk-NH7LXCFD.js.map
438
- //# sourceMappingURL=chunk-NH7LXCFD.js.map
444
+ //# sourceMappingURL=chunk-JGITTOE5.js.map
445
+ //# sourceMappingURL=chunk-JGITTOE5.js.map