@kubb/plugin-svelte-query 3.10.10 → 3.10.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.
@@ -1,303 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkIJWEKMDG_cjs = require('./chunk-IJWEKMDG.cjs');
4
- var path = require('path');
5
- var core = require('@kubb/core');
6
- var transformers = require('@kubb/core/transformers');
3
+ var chunkOLAYM2GV_cjs = require('./chunk-OLAYM2GV.cjs');
4
+ var pluginClient = require('@kubb/plugin-client');
5
+ var components = require('@kubb/plugin-client/components');
7
6
  var pluginOas = require('@kubb/plugin-oas');
8
- var pluginZod = require('@kubb/plugin-zod');
9
7
  var hooks = require('@kubb/plugin-oas/hooks');
10
8
  var utils = require('@kubb/plugin-oas/utils');
11
9
  var pluginTs = require('@kubb/plugin-ts');
10
+ var pluginZod = require('@kubb/plugin-zod');
12
11
  var react = require('@kubb/react');
13
- var jsxRuntime = require('@kubb/react/jsx-runtime');
14
12
  var remeda = require('remeda');
13
+ var jsxRuntime = require('@kubb/react/jsx-runtime');
15
14
 
16
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
-
18
- var path__default = /*#__PURE__*/_interopDefault(path);
19
-
20
- var clientGenerator = pluginOas.createReactGenerator({
21
- name: "client",
22
- Operation({ options, operation }) {
23
- const {
24
- plugin: {
25
- options: { output, urlType }
26
- },
27
- pluginManager
28
- } = react.useApp();
29
- const oas = hooks.useOas();
30
- const { getSchemas, getName, getFile } = hooks.useOperationManager();
31
- const client = {
32
- name: getName(operation, { type: "function" }),
33
- file: getFile(operation)
34
- };
35
- const url = {
36
- name: getName(operation, { type: "function", suffix: "url", prefix: "get" }),
37
- file: getFile(operation)
38
- };
39
- const type = {
40
- file: getFile(operation, { pluginKey: [pluginTs.pluginTsName] }),
41
- schemas: getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" })
42
- };
43
- const zod = {
44
- file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
45
- schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
46
- };
47
- return /* @__PURE__ */ jsxRuntime.jsxs(
48
- react.File,
49
- {
50
- baseName: client.file.baseName,
51
- path: client.file.path,
52
- meta: client.file.meta,
53
- banner: utils.getBanner({ oas, output, config: pluginManager.config }),
54
- footer: utils.getFooter({ oas, output }),
55
- children: [
56
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.importPath }),
57
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseErrorConfig"], path: options.importPath, isTypeOnly: true }),
58
- options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean), root: client.file.path, path: zod.file.path }),
59
- /* @__PURE__ */ jsxRuntime.jsx(
60
- react.File.Import,
61
- {
62
- name: [
63
- type.schemas.request?.name,
64
- type.schemas.response.name,
65
- type.schemas.pathParams?.name,
66
- type.schemas.queryParams?.name,
67
- type.schemas.headerParams?.name,
68
- ...type.schemas.statusCodes?.map((item) => item.name) || []
69
- ].filter(Boolean),
70
- root: client.file.path,
71
- path: type.file.path,
72
- isTypeOnly: true
73
- }
74
- ),
75
- /* @__PURE__ */ jsxRuntime.jsx(
76
- chunkIJWEKMDG_cjs.Url,
77
- {
78
- name: url.name,
79
- baseURL: options.baseURL,
80
- pathParamsType: options.pathParamsType,
81
- paramsCasing: options.paramsCasing,
82
- paramsType: options.paramsType,
83
- typeSchemas: type.schemas,
84
- operation,
85
- isIndexable: urlType === "export",
86
- isExportable: urlType === "export"
87
- }
88
- ),
89
- /* @__PURE__ */ jsxRuntime.jsx(
90
- chunkIJWEKMDG_cjs.Client,
91
- {
92
- name: client.name,
93
- urlName: url.name,
94
- baseURL: options.baseURL,
95
- dataReturnType: options.dataReturnType,
96
- pathParamsType: options.pathParamsType,
97
- paramsCasing: options.paramsCasing,
98
- paramsType: options.paramsType,
99
- typeSchemas: type.schemas,
100
- operation,
101
- parser: options.parser,
102
- zodSchemas: zod.schemas
103
- }
104
- )
105
- ]
106
- }
107
- );
108
- }
109
- });
110
- var operationsGenerator = pluginOas.createReactGenerator({
111
- name: "client",
112
- Operations({ operations }) {
113
- const {
114
- pluginManager,
115
- plugin: {
116
- key: pluginKey,
117
- options: { output }
118
- }
119
- } = react.useApp();
120
- const oas = hooks.useOas();
121
- const name = "operations";
122
- const file = pluginManager.getFile({ name, extname: ".ts", pluginKey });
123
- return /* @__PURE__ */ jsxRuntime.jsx(
124
- react.File,
125
- {
126
- baseName: file.baseName,
127
- path: file.path,
128
- meta: file.meta,
129
- banner: utils.getBanner({ oas, output, config: pluginManager.config }),
130
- footer: utils.getFooter({ oas, output }),
131
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkIJWEKMDG_cjs.Operations, { name, operations })
132
- }
133
- );
134
- }
135
- });
136
- var groupedClientGenerator = pluginOas.createReactGenerator({
137
- name: "groupedClient",
138
- Operations({ operations }) {
139
- const {
140
- pluginManager,
141
- plugin: { options, key: pluginKey }
142
- } = react.useApp();
143
- const oas = hooks.useOas();
144
- const { getName, getFile, getGroup } = hooks.useOperationManager();
145
- const controllers = operations.reduce(
146
- (acc, operation) => {
147
- if (options.group?.type === "tag") {
148
- const group = getGroup(operation);
149
- const name = group?.tag ? options.group?.name?.({ group: transformers.camelCase(group.tag) }) : void 0;
150
- if (!group?.tag || !name) {
151
- return acc;
152
- }
153
- const file = pluginManager.getFile({
154
- name,
155
- extname: ".ts",
156
- pluginKey,
157
- options: { group }
158
- });
159
- const client = {
160
- name: getName(operation, { type: "function" }),
161
- file: getFile(operation)
162
- };
163
- const previousFile = acc.find((item) => item.file.path === file.path);
164
- if (previousFile) {
165
- previousFile.clients.push(client);
166
- } else {
167
- acc.push({ name, file, clients: [client] });
168
- }
169
- }
170
- return acc;
171
- },
172
- []
173
- );
174
- return controllers.map(({ name, file, clients }) => {
175
- return /* @__PURE__ */ jsxRuntime.jsxs(
176
- react.File,
177
- {
178
- baseName: file.baseName,
179
- path: file.path,
180
- meta: file.meta,
181
- banner: utils.getBanner({ oas, output: options.output, config: pluginManager.config }),
182
- footer: utils.getFooter({ oas, output: options.output }),
183
- children: [
184
- clients.map((client) => /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [client.name], root: file.path, path: client.file.path }, client.name)),
185
- /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { export: true, name, children: `return { ${clients.map((client) => client.name).join(", ")} }` }) })
186
- ]
187
- },
188
- file.path
189
- );
190
- });
191
- }
192
- });
193
-
194
- // ../plugin-client/src/plugin.ts
195
- var pluginClientName = "plugin-client";
196
- core.createPlugin((options) => {
197
- const {
198
- output = { path: "clients", barrelType: "named" },
199
- group,
200
- urlType = false,
201
- exclude = [],
202
- include,
203
- override = [],
204
- transformers: transformers$1 = {},
205
- dataReturnType = "data",
206
- paramsType = "inline",
207
- pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline",
208
- operations = false,
209
- baseURL,
210
- paramsCasing,
211
- generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
212
- parser = "client",
213
- client = "axios",
214
- importPath = client === "fetch" ? "@kubb/plugin-client/clients/fetch" : "@kubb/plugin-client/clients/axios",
215
- contentType
216
- } = options;
217
- return {
218
- name: pluginClientName,
219
- options: {
220
- output,
221
- group,
222
- parser,
223
- dataReturnType,
224
- importPath,
225
- paramsType,
226
- paramsCasing,
227
- pathParamsType,
228
- baseURL,
229
- urlType
230
- },
231
- pre: [pluginOas.pluginOasName, parser === "zod" ? pluginZod.pluginZodName : void 0].filter(Boolean),
232
- resolvePath(baseName, pathMode, options2) {
233
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
234
- const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
235
- if (mode === "single") {
236
- return path__default.default.resolve(root, output.path);
237
- }
238
- if (group && (options2?.group?.path || options2?.group?.tag)) {
239
- const groupName = group?.name ? group.name : (ctx) => {
240
- if (group?.type === "path") {
241
- return `${ctx.group.split("/")[1]}`;
242
- }
243
- return `${transformers.camelCase(ctx.group)}Controller`;
244
- };
245
- return path__default.default.resolve(
246
- root,
247
- output.path,
248
- groupName({
249
- group: group.type === "path" ? options2.group.path : options2.group.tag
250
- }),
251
- baseName
252
- );
253
- }
254
- return path__default.default.resolve(root, output.path, baseName);
255
- },
256
- resolveName(name, type) {
257
- const resolvedName = transformers.camelCase(name, { isFile: type === "file" });
258
- if (type) {
259
- return transformers$1?.name?.(resolvedName, type) || resolvedName;
260
- }
261
- return resolvedName;
262
- },
263
- async buildStart() {
264
- const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
265
- const oas = await swaggerPlugin.context.getOas();
266
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
267
- const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
268
- const baseURL2 = await swaggerPlugin.context.getBaseURL();
269
- const operationGenerator = new pluginOas.OperationGenerator(
270
- baseURL2 ? {
271
- ...this.plugin.options,
272
- baseURL: baseURL2
273
- } : this.plugin.options,
274
- {
275
- oas,
276
- pluginManager: this.pluginManager,
277
- plugin: this.plugin,
278
- contentType,
279
- exclude,
280
- include,
281
- override,
282
- mode
283
- }
284
- );
285
- const files = await operationGenerator.build(...generators);
286
- await this.addFile(...files);
287
- const barrelFiles = await this.fileManager.getBarrelFiles({
288
- type: output.barrelType ?? "named",
289
- root,
290
- output,
291
- files: this.fileManager.files,
292
- meta: {
293
- pluginKey: this.plugin.key
294
- },
295
- logger: this.logger
296
- });
297
- await this.addFile(...barrelFiles);
298
- }
299
- };
300
- });
301
15
  var queryGenerator = pluginOas.createReactGenerator({
302
16
  name: "svelte-query",
303
17
  Operation({ options, operation }) {
@@ -319,15 +33,15 @@ var queryGenerator = pluginOas.createReactGenerator({
319
33
  typeName: getName(operation, { type: "type" }),
320
34
  file: getFile(operation, { prefix: "create" })
321
35
  };
322
- const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
36
+ const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClient.pluginClientName]);
323
37
  const client = {
324
38
  name: hasClientPlugin ? getName(operation, {
325
39
  type: "function",
326
- pluginKey: [pluginClientName]
40
+ pluginKey: [pluginClient.pluginClientName]
327
41
  }) : getName(operation, {
328
42
  type: "function"
329
43
  }),
330
- file: getFile(operation, { pluginKey: [pluginClientName] })
44
+ file: getFile(operation, { pluginKey: [pluginClient.pluginClientName] })
331
45
  };
332
46
  const queryOptions = {
333
47
  name: getName(operation, { type: "function", suffix: "QueryOptions" })
@@ -379,7 +93,7 @@ var queryGenerator = pluginOas.createReactGenerator({
379
93
  }
380
94
  ),
381
95
  /* @__PURE__ */ jsxRuntime.jsx(
382
- chunkIJWEKMDG_cjs.QueryKey,
96
+ chunkOLAYM2GV_cjs.QueryKey,
383
97
  {
384
98
  name: queryKey.name,
385
99
  typeName: queryKey.typeName,
@@ -391,7 +105,7 @@ var queryGenerator = pluginOas.createReactGenerator({
391
105
  }
392
106
  ),
393
107
  !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(
394
- chunkIJWEKMDG_cjs.Client,
108
+ components.Client,
395
109
  {
396
110
  name: client.name,
397
111
  baseURL: options.client.baseURL,
@@ -407,7 +121,7 @@ var queryGenerator = pluginOas.createReactGenerator({
407
121
  ),
408
122
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
409
123
  /* @__PURE__ */ jsxRuntime.jsx(
410
- chunkIJWEKMDG_cjs.QueryOptions,
124
+ chunkOLAYM2GV_cjs.QueryOptions,
411
125
  {
412
126
  name: queryOptions.name,
413
127
  clientName: client.name,
@@ -423,7 +137,7 @@ var queryGenerator = pluginOas.createReactGenerator({
423
137
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery"], path: importPath }),
424
138
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "QueryClient", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
425
139
  /* @__PURE__ */ jsxRuntime.jsx(
426
- chunkIJWEKMDG_cjs.Query,
140
+ chunkOLAYM2GV_cjs.Query,
427
141
  {
428
142
  name: query.name,
429
143
  queryOptionsName: queryOptions.name,
@@ -471,15 +185,15 @@ var mutationGenerator = pluginOas.createReactGenerator({
471
185
  file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
472
186
  schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
473
187
  };
474
- const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
188
+ const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClient.pluginClientName]);
475
189
  const client = {
476
190
  name: hasClientPlugin ? getName(operation, {
477
191
  type: "function",
478
- pluginKey: [pluginClientName]
192
+ pluginKey: [pluginClient.pluginClientName]
479
193
  }) : getName(operation, {
480
194
  type: "function"
481
195
  }),
482
- file: getFile(operation, { pluginKey: [pluginClientName] })
196
+ file: getFile(operation, { pluginKey: [pluginClient.pluginClientName] })
483
197
  };
484
198
  const mutationKey = {
485
199
  name: getName(operation, { type: "const", suffix: "MutationKey" }),
@@ -518,7 +232,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
518
232
  }
519
233
  ),
520
234
  /* @__PURE__ */ jsxRuntime.jsx(
521
- chunkIJWEKMDG_cjs.MutationKey,
235
+ chunkOLAYM2GV_cjs.MutationKey,
522
236
  {
523
237
  name: mutationKey.name,
524
238
  typeName: mutationKey.typeName,
@@ -530,7 +244,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
530
244
  }
531
245
  ),
532
246
  !hasClientPlugin && /* @__PURE__ */ jsxRuntime.jsx(
533
- chunkIJWEKMDG_cjs.Client,
247
+ components.Client,
534
248
  {
535
249
  name: client.name,
536
250
  baseURL: options.client.baseURL,
@@ -548,7 +262,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
548
262
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: importPath }),
549
263
  /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult", "QueryClient"], path: importPath, isTypeOnly: true }),
550
264
  /* @__PURE__ */ jsxRuntime.jsx(
551
- chunkIJWEKMDG_cjs.Mutation,
265
+ chunkOLAYM2GV_cjs.Mutation,
552
266
  {
553
267
  name: mutation.name,
554
268
  clientName: client.name,
@@ -571,5 +285,5 @@ var mutationGenerator = pluginOas.createReactGenerator({
571
285
 
572
286
  exports.mutationGenerator = mutationGenerator;
573
287
  exports.queryGenerator = queryGenerator;
574
- //# sourceMappingURL=chunk-HY3VHHFC.cjs.map
575
- //# sourceMappingURL=chunk-HY3VHHFC.cjs.map
288
+ //# sourceMappingURL=chunk-VA4UHKD4.cjs.map
289
+ //# sourceMappingURL=chunk-VA4UHKD4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx"],"names":["createReactGenerator","useApp","useOas","useOperationManager","difference","pluginClientName","pluginTsName","pluginZodName","jsxs","File","getBanner","getFooter","jsx","QueryKey","Client","QueryOptions","Fragment","Query","MutationKey","Mutation"],"mappings":";;;;;;;;;;;;;;AAYO,IAAM,iBAAiBA,8BAAwC,CAAA;AAAA,EACpE,IAAM,EAAA,cAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO;AAAA,OACpB;AAAA,MACA;AAAA,QACEC,YAA0B,EAAA;AAC9B,IAAA,MAAM,MAAMC,YAAO,EAAA;AACnB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAYC,y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Aa,IAAK,CAAA,OAAA;AAAA,cAClB,YAAY,GAAI,CAAA,OAAA;AAAA,cAChB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,cAC/B,cAAc,OAAQ,CAAA,YAAA;AAAA,cACtB,YAAY,OAAQ,CAAA,UAAA;AAAA,cACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,cACxB,QAAQ,OAAQ,CAAA;AAAA;AAAA,WAClB;AAAA,UAED,OAAQ,CAAA,QAAA,oBACPN,eAAAA,CAAAQ,qBAAA,EACE,QAAA,EAAA;AAAA,4BAAAJ,cAAAA,CAACH,WAAK,MAAL,EAAA,EAAY,MAAM,CAAC,gBAAgB,CAAG,EAAA,IAAA,EAAM,UAAY,EAAA,CAAA;AAAA,4BACzDG,cAAAA,CAACH,UAAK,CAAA,MAAA,EAAL,EAAY,IAAM,EAAA,CAAC,uBAAyB,EAAA,sBAAA,EAAwB,aAAa,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,4BAClHG,cAAAA;AAAA,cAACO,0BAAA;AAAA,cAAA;AAAA,gBACC,MAAM,QAAS,CAAA,IAAA;AAAA,gBACf,YAAY,MAAO,CAAA,IAAA;AAAA,gBACnB,UAAU,QAAS,CAAA,QAAA;AAAA,gBACnB,aAAa,IAAK,CAAA,OAAA;AAAA,gBAClB,SAAA;AAAA,gBACA,cAAc,OAAQ,CAAA,YAAA;AAAA,gBACtB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,gBAC/B,YAAY,OAAQ,CAAA,UAAA;AAAA,gBACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,gBACxB,iBAAiB,WAAY,CAAA;AAAA;AAAA;AAC/B,WACF,EAAA;AAAA;AAAA;AAAA,KAEJ;AAAA;AAGN,CAAC","file":"chunk-VA4UHKD4.cjs","sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginSvelteQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/svelte-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, 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 <File.Import name={'client'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', '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}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginSvelteQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/svelte-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, 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 <File.Import name={'client'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <>\n <File.Import name={['createMutation']} path={importPath} />\n <File.Import name={['CreateMutationOptions', 'CreateMutationResult', '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}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n"]}
@@ -1,28 +1,28 @@
1
1
  'use strict';
2
2
 
3
- var chunkIJWEKMDG_cjs = require('./chunk-IJWEKMDG.cjs');
3
+ var chunkOLAYM2GV_cjs = require('./chunk-OLAYM2GV.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Mutation", {
8
8
  enumerable: true,
9
- get: function () { return chunkIJWEKMDG_cjs.Mutation; }
9
+ get: function () { return chunkOLAYM2GV_cjs.Mutation; }
10
10
  });
11
11
  Object.defineProperty(exports, "MutationKey", {
12
12
  enumerable: true,
13
- get: function () { return chunkIJWEKMDG_cjs.MutationKey; }
13
+ get: function () { return chunkOLAYM2GV_cjs.MutationKey; }
14
14
  });
15
15
  Object.defineProperty(exports, "Query", {
16
16
  enumerable: true,
17
- get: function () { return chunkIJWEKMDG_cjs.Query; }
17
+ get: function () { return chunkOLAYM2GV_cjs.Query; }
18
18
  });
19
19
  Object.defineProperty(exports, "QueryKey", {
20
20
  enumerable: true,
21
- get: function () { return chunkIJWEKMDG_cjs.QueryKey; }
21
+ get: function () { return chunkOLAYM2GV_cjs.QueryKey; }
22
22
  });
23
23
  Object.defineProperty(exports, "QueryOptions", {
24
24
  enumerable: true,
25
- get: function () { return chunkIJWEKMDG_cjs.QueryOptions; }
25
+ get: function () { return chunkOLAYM2GV_cjs.QueryOptions; }
26
26
  });
27
27
  //# sourceMappingURL=components.cjs.map
28
28
  //# sourceMappingURL=components.cjs.map
@@ -1,9 +1,10 @@
1
1
  import { Operation } from '@kubb/oas';
2
2
  import { OperationSchemas } from '@kubb/plugin-oas';
3
3
  import { ReactNode } from 'react';
4
- import { P as PluginSvelteQuery, T as Transformer } from './types-CokhhoBC.cjs';
4
+ import { P as PluginSvelteQuery, T as Transformer } from './types-BIWbWacf.cjs';
5
5
  import { FunctionParams } from '@kubb/react';
6
6
  import '@kubb/core';
7
+ import '@kubb/plugin-client';
7
8
 
8
9
  type Props$4 = {
9
10
  /**
@@ -1,9 +1,10 @@
1
1
  import { Operation } from '@kubb/oas';
2
2
  import { OperationSchemas } from '@kubb/plugin-oas';
3
3
  import { ReactNode } from 'react';
4
- import { P as PluginSvelteQuery, T as Transformer } from './types-CokhhoBC.js';
4
+ import { P as PluginSvelteQuery, T as Transformer } from './types-BIWbWacf.js';
5
5
  import { FunctionParams } from '@kubb/react';
6
6
  import '@kubb/core';
7
+ import '@kubb/plugin-client';
7
8
 
8
9
  type Props$4 = {
9
10
  /**
@@ -1,3 +1,3 @@
1
- export { Mutation, MutationKey, Query, QueryKey, QueryOptions } from './chunk-N5VUHGCS.js';
1
+ export { Mutation, MutationKey, Query, QueryKey, QueryOptions } from './chunk-6NYLQXQV.js';
2
2
  //# sourceMappingURL=components.js.map
3
3
  //# sourceMappingURL=components.js.map
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkHY3VHHFC_cjs = require('./chunk-HY3VHHFC.cjs');
4
- require('./chunk-IJWEKMDG.cjs');
3
+ var chunkVA4UHKD4_cjs = require('./chunk-VA4UHKD4.cjs');
4
+ require('./chunk-OLAYM2GV.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "mutationGenerator", {
9
9
  enumerable: true,
10
- get: function () { return chunkHY3VHHFC_cjs.mutationGenerator; }
10
+ get: function () { return chunkVA4UHKD4_cjs.mutationGenerator; }
11
11
  });
12
12
  Object.defineProperty(exports, "queryGenerator", {
13
13
  enumerable: true,
14
- get: function () { return chunkHY3VHHFC_cjs.queryGenerator; }
14
+ get: function () { return chunkVA4UHKD4_cjs.queryGenerator; }
15
15
  });
16
16
  //# sourceMappingURL=generators.cjs.map
17
17
  //# sourceMappingURL=generators.cjs.map
@@ -1,7 +1,8 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginSvelteQuery } from './types-CokhhoBC.cjs';
2
+ import { P as PluginSvelteQuery } from './types-BIWbWacf.cjs';
3
3
  import '@kubb/core';
4
4
  import '@kubb/oas';
5
+ import '@kubb/plugin-client';
5
6
 
6
7
  declare const queryGenerator: _kubb_plugin_oas.Generator<PluginSvelteQuery>;
7
8
 
@@ -1,7 +1,8 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginSvelteQuery } from './types-CokhhoBC.js';
2
+ import { P as PluginSvelteQuery } from './types-BIWbWacf.js';
3
3
  import '@kubb/core';
4
4
  import '@kubb/oas';
5
+ import '@kubb/plugin-client';
5
6
 
6
7
  declare const queryGenerator: _kubb_plugin_oas.Generator<PluginSvelteQuery>;
7
8
 
@@ -1,4 +1,4 @@
1
- export { mutationGenerator, queryGenerator } from './chunk-H5ZI2I6P.js';
2
- import './chunk-N5VUHGCS.js';
1
+ export { mutationGenerator, queryGenerator } from './chunk-JAAPF7JO.js';
2
+ import './chunk-6NYLQXQV.js';
3
3
  //# sourceMappingURL=generators.js.map
4
4
  //# sourceMappingURL=generators.js.map
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkHY3VHHFC_cjs = require('./chunk-HY3VHHFC.cjs');
4
- var chunkIJWEKMDG_cjs = require('./chunk-IJWEKMDG.cjs');
3
+ var chunkVA4UHKD4_cjs = require('./chunk-VA4UHKD4.cjs');
4
+ var chunkOLAYM2GV_cjs = require('./chunk-OLAYM2GV.cjs');
5
5
  var path = require('path');
6
6
  var core = require('@kubb/core');
7
7
  var transformers = require('@kubb/core/transformers');
@@ -28,9 +28,9 @@ var pluginSvelteQuery = core.createPlugin((options) => {
28
28
  mutation = {},
29
29
  query = {},
30
30
  paramsCasing,
31
- mutationKey = chunkIJWEKMDG_cjs.MutationKey.getTransformer,
32
- queryKey = chunkIJWEKMDG_cjs.QueryKey.getTransformer,
33
- generators = [chunkHY3VHHFC_cjs.queryGenerator, chunkHY3VHHFC_cjs.mutationGenerator].filter(Boolean),
31
+ mutationKey = chunkOLAYM2GV_cjs.MutationKey.getTransformer,
32
+ queryKey = chunkOLAYM2GV_cjs.QueryKey.getTransformer,
33
+ generators = [chunkVA4UHKD4_cjs.queryGenerator, chunkVA4UHKD4_cjs.mutationGenerator].filter(Boolean),
34
34
  contentType
35
35
  } = options;
36
36
  return {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginSvelteQuery } from './types-CokhhoBC.cjs';
2
+ import { O as Options, P as PluginSvelteQuery } from './types-BIWbWacf.cjs';
3
3
  import '@kubb/oas';
4
+ import '@kubb/plugin-client';
4
5
  import '@kubb/plugin-oas';
5
6
 
6
7
  declare const pluginSvelteQueryName = "plugin-svelte-query";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginSvelteQuery } from './types-CokhhoBC.js';
2
+ import { O as Options, P as PluginSvelteQuery } from './types-BIWbWacf.js';
3
3
  import '@kubb/oas';
4
+ import '@kubb/plugin-client';
4
5
  import '@kubb/plugin-oas';
5
6
 
6
7
  declare const pluginSvelteQueryName = "plugin-svelte-query";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { queryGenerator, mutationGenerator } from './chunk-H5ZI2I6P.js';
2
- import { MutationKey, QueryKey } from './chunk-N5VUHGCS.js';
3
- import path from 'node:path';
1
+ import { queryGenerator, mutationGenerator } from './chunk-JAAPF7JO.js';
2
+ import { MutationKey, QueryKey } from './chunk-6NYLQXQV.js';
3
+ import path from 'path';
4
4
  import { createPlugin, PluginManager, FileManager } from '@kubb/core';
5
5
  import { camelCase, pascalCase } from '@kubb/core/transformers';
6
6
  import { pluginOasName, OperationGenerator } from '@kubb/plugin-oas';