@kubb/plugin-svelte-query 3.0.0-beta.8 → 3.0.0
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.
- package/dist/{chunk-IYE4XII3.cjs → chunk-CDRGJAED.cjs} +71 -56
- package/dist/chunk-CDRGJAED.cjs.map +1 -0
- package/dist/{chunk-STYJ2DL3.js → chunk-JGITTOE5.js} +65 -50
- package/dist/chunk-JGITTOE5.js.map +1 -0
- package/dist/{chunk-WAAKXO6O.cjs → chunk-KRGCKSGR.cjs} +145 -29
- package/dist/chunk-KRGCKSGR.cjs.map +1 -0
- package/dist/{chunk-B7GVNGYU.js → chunk-R6ZVBNG7.js} +145 -29
- package/dist/chunk-R6ZVBNG7.js.map +1 -0
- package/dist/components.cjs +6 -6
- package/dist/components.d.cts +17 -10
- package/dist/components.d.ts +17 -10
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +23 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -23
- package/dist/index.js.map +1 -1
- package/dist/types-B9W9aYra.d.cts +365 -0
- package/dist/types-B9W9aYra.d.ts +365 -0
- package/package.json +13 -13
- package/src/components/Mutation.tsx +7 -3
- package/src/components/MutationKey.tsx +11 -5
- package/src/components/Query.tsx +62 -6
- package/src/components/QueryKey.tsx +17 -7
- package/src/components/QueryOptions.tsx +47 -7
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +1 -1
- package/src/generators/__snapshots__/clientGetImportPath.ts +1 -1
- package/src/generators/__snapshots__/findByTags.ts +1 -1
- package/src/generators/__snapshots__/findByTagsObject.ts +60 -0
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +1 -1
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +2 -2
- package/src/generators/__snapshots__/findByTagsWithZod.ts +1 -1
- package/src/generators/__snapshots__/postAsQuery.ts +1 -1
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +1 -3
- package/src/generators/mutationGenerator.tsx +25 -16
- package/src/generators/queryGenerator.tsx +25 -17
- package/src/plugin.ts +22 -21
- package/src/types.ts +35 -14
- package/dist/chunk-B7GVNGYU.js.map +0 -1
- package/dist/chunk-IYE4XII3.cjs.map +0 -1
- package/dist/chunk-STYJ2DL3.js.map +0 -1
- package/dist/chunk-WAAKXO6O.cjs.map +0 -1
- package/dist/types-CvXX_phR.d.cts +0 -184
- package/dist/types-CvXX_phR.d.ts +0 -184
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var transformers = require('@kubb/core/transformers');
|
|
3
|
+
var chunkKRGCKSGR_cjs = require('./chunk-KRGCKSGR.cjs');
|
|
5
4
|
var path = require('path');
|
|
6
5
|
var core = require('@kubb/core');
|
|
6
|
+
var transformers = require('@kubb/core/transformers');
|
|
7
7
|
var pluginOas = require('@kubb/plugin-oas');
|
|
8
8
|
var pluginZod = require('@kubb/plugin-zod');
|
|
9
9
|
var hooks = require('@kubb/plugin-oas/hooks');
|
|
@@ -57,12 +57,13 @@ var clientGenerator = pluginOas.createReactGenerator({
|
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
59
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
-
|
|
60
|
+
chunkKRGCKSGR_cjs.Client,
|
|
61
61
|
{
|
|
62
62
|
name: client.name,
|
|
63
63
|
baseURL: options.baseURL,
|
|
64
64
|
dataReturnType: options.dataReturnType,
|
|
65
65
|
pathParamsType: options.pathParamsType,
|
|
66
|
+
paramsType: options.paramsType,
|
|
66
67
|
typeSchemas: type.schemas,
|
|
67
68
|
operation,
|
|
68
69
|
parser: options.parser,
|
|
@@ -83,7 +84,7 @@ var operationsGenerator = pluginOas.createReactGenerator({
|
|
|
83
84
|
} = react.useApp();
|
|
84
85
|
const name = "operations";
|
|
85
86
|
const file = pluginManager.getFile({ name, extname: ".ts", pluginKey: [pluginClientName] });
|
|
86
|
-
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(
|
|
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 }) });
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
var groupedClientGenerator = pluginOas.createReactGenerator({
|
|
@@ -141,10 +142,12 @@ core.createPlugin((options) => {
|
|
|
141
142
|
exclude = [],
|
|
142
143
|
include,
|
|
143
144
|
override = [],
|
|
144
|
-
transformers:
|
|
145
|
+
transformers: transformers$1 = {},
|
|
145
146
|
dataReturnType = "data",
|
|
146
147
|
pathParamsType = "inline",
|
|
148
|
+
paramsType = "inline",
|
|
147
149
|
operations = false,
|
|
150
|
+
baseURL,
|
|
148
151
|
generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
|
|
149
152
|
importPath = "@kubb/plugin-client/client",
|
|
150
153
|
parser = "client"
|
|
@@ -157,8 +160,9 @@ core.createPlugin((options) => {
|
|
|
157
160
|
parser,
|
|
158
161
|
dataReturnType,
|
|
159
162
|
importPath,
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
paramsType,
|
|
164
|
+
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
165
|
+
baseURL
|
|
162
166
|
},
|
|
163
167
|
pre: [pluginOas.pluginOasName, parser === "zod" ? pluginZod.pluginZodName : void 0].filter(Boolean),
|
|
164
168
|
resolvePath(baseName, pathMode, options2) {
|
|
@@ -176,7 +180,7 @@ core.createPlugin((options) => {
|
|
|
176
180
|
resolveName(name, type) {
|
|
177
181
|
const resolvedName = transformers.camelCase(name, { isFile: type === "file" });
|
|
178
182
|
if (type) {
|
|
179
|
-
return
|
|
183
|
+
return transformers$1?.name?.(resolvedName, type) || resolvedName;
|
|
180
184
|
}
|
|
181
185
|
return resolvedName;
|
|
182
186
|
},
|
|
@@ -185,12 +189,12 @@ core.createPlugin((options) => {
|
|
|
185
189
|
const oas = await swaggerPlugin.context.getOas();
|
|
186
190
|
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
187
191
|
const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
188
|
-
const
|
|
192
|
+
const baseURL2 = await swaggerPlugin.context.getBaseURL();
|
|
189
193
|
const operationGenerator = new pluginOas.OperationGenerator(
|
|
190
|
-
{
|
|
194
|
+
baseURL2 ? {
|
|
191
195
|
...this.plugin.options,
|
|
192
|
-
baseURL
|
|
193
|
-
},
|
|
196
|
+
baseURL: baseURL2
|
|
197
|
+
} : this.plugin.options,
|
|
194
198
|
{
|
|
195
199
|
oas,
|
|
196
200
|
pluginManager: this.pluginManager,
|
|
@@ -228,7 +232,7 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
228
232
|
} = react.useApp();
|
|
229
233
|
const { getSchemas, getName, getFile } = hooks.useOperationManager();
|
|
230
234
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
231
|
-
|
|
235
|
+
const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
|
|
232
236
|
const query = {
|
|
233
237
|
name: getName(operation, { type: "function", prefix: "create" }),
|
|
234
238
|
typeName: getName(operation, { type: "type" }),
|
|
@@ -253,13 +257,11 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
253
257
|
file: getFile(operation, { pluginKey: [pluginZod.pluginZodName] }),
|
|
254
258
|
schemas: getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" })
|
|
255
259
|
};
|
|
256
|
-
if (!isQuery
|
|
260
|
+
if (!isQuery) {
|
|
257
261
|
return null;
|
|
258
262
|
}
|
|
259
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: [
|
|
260
264
|
options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
|
|
261
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery", "queryOptions"], path: options.query.importPath }),
|
|
262
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "WithRequired", "CreateBaseQueryOptions", "CreateQueryResult"], path: options.query.importPath, isTypeOnly: true }),
|
|
263
265
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
|
|
264
266
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
265
267
|
options.client.dataReturnType === "full" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
@@ -280,54 +282,62 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
280
282
|
}
|
|
281
283
|
),
|
|
282
284
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
283
|
-
|
|
285
|
+
chunkKRGCKSGR_cjs.QueryKey,
|
|
284
286
|
{
|
|
285
287
|
name: queryKey.name,
|
|
286
288
|
typeName: queryKey.typeName,
|
|
287
289
|
operation,
|
|
288
290
|
pathParamsType: options.pathParamsType,
|
|
289
291
|
typeSchemas: type.schemas,
|
|
290
|
-
|
|
292
|
+
transformer: options.queryKey
|
|
291
293
|
}
|
|
292
294
|
),
|
|
293
295
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
294
|
-
|
|
296
|
+
chunkKRGCKSGR_cjs.Client,
|
|
295
297
|
{
|
|
296
298
|
name: client.name,
|
|
297
299
|
isExportable: false,
|
|
298
300
|
isIndexable: false,
|
|
299
|
-
baseURL: options.baseURL,
|
|
301
|
+
baseURL: options.client.baseURL,
|
|
300
302
|
operation,
|
|
301
303
|
typeSchemas: type.schemas,
|
|
302
304
|
zodSchemas: zod.schemas,
|
|
303
305
|
dataReturnType: options.client.dataReturnType,
|
|
306
|
+
paramsType: options.paramsType,
|
|
304
307
|
pathParamsType: options.pathParamsType,
|
|
305
308
|
parser: options.parser
|
|
306
309
|
}
|
|
307
310
|
),
|
|
311
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
|
|
308
312
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
309
|
-
|
|
313
|
+
chunkKRGCKSGR_cjs.QueryOptions,
|
|
310
314
|
{
|
|
311
315
|
name: queryOptions.name,
|
|
312
316
|
clientName: client.name,
|
|
313
317
|
queryKeyName: queryKey.name,
|
|
314
318
|
typeSchemas: type.schemas,
|
|
319
|
+
paramsType: options.paramsType,
|
|
315
320
|
pathParamsType: options.pathParamsType
|
|
316
321
|
}
|
|
317
322
|
),
|
|
318
|
-
/* @__PURE__ */ jsxRuntime.
|
|
319
|
-
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
+
] })
|
|
331
341
|
] });
|
|
332
342
|
}
|
|
333
343
|
});
|
|
@@ -342,6 +352,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
342
352
|
const { getSchemas, getName, getFile } = hooks.useOperationManager();
|
|
343
353
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
344
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";
|
|
345
356
|
const mutation = {
|
|
346
357
|
name: getName(operation, { type: "function", prefix: "create" }),
|
|
347
358
|
typeName: getName(operation, { type: "type" }),
|
|
@@ -363,13 +374,11 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
363
374
|
name: getName(operation, { type: "const", suffix: "MutationKey" }),
|
|
364
375
|
typeName: getName(operation, { type: "type", suffix: "MutationKey" })
|
|
365
376
|
};
|
|
366
|
-
if (!isMutation
|
|
377
|
+
if (!isMutation) {
|
|
367
378
|
return null;
|
|
368
379
|
}
|
|
369
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: [
|
|
370
381
|
options.parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
|
|
371
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: options.mutation.importPath }),
|
|
372
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: options.mutation.importPath, isTypeOnly: true }),
|
|
373
382
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
|
|
374
383
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["RequestConfig", "ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
375
384
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -389,49 +398,55 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
389
398
|
}
|
|
390
399
|
),
|
|
391
400
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
392
|
-
|
|
401
|
+
chunkKRGCKSGR_cjs.MutationKey,
|
|
393
402
|
{
|
|
394
403
|
name: mutationKey.name,
|
|
395
404
|
typeName: mutationKey.typeName,
|
|
396
405
|
operation,
|
|
397
406
|
pathParamsType: options.pathParamsType,
|
|
398
407
|
typeSchemas: type.schemas,
|
|
399
|
-
|
|
408
|
+
transformer: options.mutationKey
|
|
400
409
|
}
|
|
401
410
|
),
|
|
402
411
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
403
|
-
|
|
412
|
+
chunkKRGCKSGR_cjs.Client,
|
|
404
413
|
{
|
|
405
414
|
name: client.name,
|
|
406
415
|
isExportable: false,
|
|
407
416
|
isIndexable: false,
|
|
408
|
-
baseURL: options.baseURL,
|
|
417
|
+
baseURL: options.client.baseURL,
|
|
409
418
|
operation,
|
|
410
419
|
typeSchemas: type.schemas,
|
|
411
420
|
zodSchemas: zod.schemas,
|
|
412
421
|
dataReturnType: options.client.dataReturnType,
|
|
422
|
+
paramsType: options.paramsType,
|
|
413
423
|
pathParamsType: options.pathParamsType,
|
|
414
424
|
parser: options.parser
|
|
415
425
|
}
|
|
416
426
|
),
|
|
417
|
-
/* @__PURE__ */ jsxRuntime.
|
|
418
|
-
|
|
419
|
-
{
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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
|
+
] })
|
|
430
445
|
] });
|
|
431
446
|
}
|
|
432
447
|
});
|
|
433
448
|
|
|
434
449
|
exports.mutationGenerator = mutationGenerator;
|
|
435
450
|
exports.queryGenerator = queryGenerator;
|
|
436
|
-
//# sourceMappingURL=chunk-
|
|
437
|
-
//# sourceMappingURL=chunk-
|
|
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,CAAA;AAAA,MAC7C,IAAA,EAAM,QAAQ,SAAS;AAAA,KACzB;AAEA,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAACC,qBAAY,GAAG,CAAA;AAAA,MACtD,OAAA,EAAS,UAAW,CAAA,SAAA,EAAW,EAAE,SAAA,EAAW,CAACA,qBAAY,CAAA,EAAG,IAAM,EAAA,MAAA,EAAQ;AAAA,KAC5E;AAEA,IAAA,MAAM,GAAM,GAAA;AAAA,MACV,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAACC,uBAAa,GAAG,CAAA;AAAA,MACvD,OAAA,EAAS,UAAW,CAAA,SAAA,EAAW,EAAE,SAAA,EAAW,CAACA,uBAAa,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY;AAAA,KACjF;AAEA,IAAA,uCACGC,UAAK,EAAA,EAAA,QAAA,EAAU,OAAO,IAAK,C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D,WAAK,MAAL,EAAA,EAAY,MAAM,CAAC,gBAAgB,CAAG,EAAA,IAAA,EAAM,UAAY,EAAA,CAAA;AAAA,wBACzDC,cAAAA,CAACD,UAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,uBAAA,EAAyB,sBAAsB,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,wBACnGC,cAAAA;AAAA,UAACoB,0BAAA;AAAA,UAAA;AAAA,YACC,MAAM,QAAS,CAAA,IAAA;AAAA,YACf,YAAY,MAAO,CAAA,IAAA;AAAA,YACnB,UAAU,QAAS,CAAA,QAAA;AAAA,YACnB,aAAa,IAAK,CAAA,OAAA;AAAA,YAClB,SAAA;AAAA,YACA,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,YAC/B,YAAY,OAAQ,CAAA,UAAA;AAAA,YACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,YACxB,iBAAiB,WAAY,CAAA;AAAA;AAAA;AAC/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,13 +1,13 @@
|
|
|
1
|
-
import { Client, Operations, QueryKey, QueryOptions, Query, MutationKey, Mutation } from './chunk-
|
|
2
|
-
import { camelCase } from '@kubb/core/transformers';
|
|
1
|
+
import { Client, Operations, QueryKey, QueryOptions, Query, MutationKey, Mutation } from './chunk-R6ZVBNG7.js';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
4
|
+
import { camelCase } from '@kubb/core/transformers';
|
|
5
5
|
import { createReactGenerator, pluginOasName, OperationGenerator } from '@kubb/plugin-oas';
|
|
6
6
|
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",
|
|
@@ -57,6 +57,7 @@ var clientGenerator = createReactGenerator({
|
|
|
57
57
|
baseURL: options.baseURL,
|
|
58
58
|
dataReturnType: options.dataReturnType,
|
|
59
59
|
pathParamsType: options.pathParamsType,
|
|
60
|
+
paramsType: options.paramsType,
|
|
60
61
|
typeSchemas: type.schemas,
|
|
61
62
|
operation,
|
|
62
63
|
parser: options.parser,
|
|
@@ -135,10 +136,12 @@ createPlugin((options) => {
|
|
|
135
136
|
exclude = [],
|
|
136
137
|
include,
|
|
137
138
|
override = [],
|
|
138
|
-
transformers
|
|
139
|
+
transformers = {},
|
|
139
140
|
dataReturnType = "data",
|
|
140
141
|
pathParamsType = "inline",
|
|
142
|
+
paramsType = "inline",
|
|
141
143
|
operations = false,
|
|
144
|
+
baseURL,
|
|
142
145
|
generators = [clientGenerator, group ? groupedClientGenerator : void 0, operations ? operationsGenerator : void 0].filter(Boolean),
|
|
143
146
|
importPath = "@kubb/plugin-client/client",
|
|
144
147
|
parser = "client"
|
|
@@ -151,8 +154,9 @@ createPlugin((options) => {
|
|
|
151
154
|
parser,
|
|
152
155
|
dataReturnType,
|
|
153
156
|
importPath,
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
paramsType,
|
|
158
|
+
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
159
|
+
baseURL
|
|
156
160
|
},
|
|
157
161
|
pre: [pluginOasName, parser === "zod" ? pluginZodName : void 0].filter(Boolean),
|
|
158
162
|
resolvePath(baseName, pathMode, options2) {
|
|
@@ -170,7 +174,7 @@ createPlugin((options) => {
|
|
|
170
174
|
resolveName(name, type) {
|
|
171
175
|
const resolvedName = camelCase(name, { isFile: type === "file" });
|
|
172
176
|
if (type) {
|
|
173
|
-
return
|
|
177
|
+
return transformers?.name?.(resolvedName, type) || resolvedName;
|
|
174
178
|
}
|
|
175
179
|
return resolvedName;
|
|
176
180
|
},
|
|
@@ -179,12 +183,12 @@ createPlugin((options) => {
|
|
|
179
183
|
const oas = await swaggerPlugin.context.getOas();
|
|
180
184
|
const root = path.resolve(this.config.root, this.config.output.path);
|
|
181
185
|
const mode = FileManager.getMode(path.resolve(root, output.path));
|
|
182
|
-
const
|
|
186
|
+
const baseURL2 = await swaggerPlugin.context.getBaseURL();
|
|
183
187
|
const operationGenerator = new OperationGenerator(
|
|
184
|
-
{
|
|
188
|
+
baseURL2 ? {
|
|
185
189
|
...this.plugin.options,
|
|
186
|
-
baseURL
|
|
187
|
-
},
|
|
190
|
+
baseURL: baseURL2
|
|
191
|
+
} : this.plugin.options,
|
|
188
192
|
{
|
|
189
193
|
oas,
|
|
190
194
|
pluginManager: this.pluginManager,
|
|
@@ -222,7 +226,7 @@ var queryGenerator = createReactGenerator({
|
|
|
222
226
|
} = useApp();
|
|
223
227
|
const { getSchemas, getName, getFile } = useOperationManager();
|
|
224
228
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
225
|
-
|
|
229
|
+
const importPath = options.query ? options.query.importPath : "@tanstack/svelte-query";
|
|
226
230
|
const query = {
|
|
227
231
|
name: getName(operation, { type: "function", prefix: "create" }),
|
|
228
232
|
typeName: getName(operation, { type: "type" }),
|
|
@@ -247,13 +251,11 @@ var queryGenerator = createReactGenerator({
|
|
|
247
251
|
file: getFile(operation, { pluginKey: [pluginZodName] }),
|
|
248
252
|
schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: "function" })
|
|
249
253
|
};
|
|
250
|
-
if (!isQuery
|
|
254
|
+
if (!isQuery) {
|
|
251
255
|
return null;
|
|
252
256
|
}
|
|
253
257
|
return /* @__PURE__ */ jsxs(File, { baseName: query.file.baseName, path: query.file.path, meta: query.file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
254
258
|
options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: query.file.path, path: zod.file.path }),
|
|
255
|
-
/* @__PURE__ */ jsx(File.Import, { name: ["createQuery", "queryOptions"], path: options.query.importPath }),
|
|
256
|
-
/* @__PURE__ */ jsx(File.Import, { name: ["QueryKey", "WithRequired", "CreateBaseQueryOptions", "CreateQueryResult"], path: options.query.importPath, isTypeOnly: true }),
|
|
257
259
|
/* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
|
|
258
260
|
/* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
259
261
|
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
@@ -281,7 +283,7 @@ var queryGenerator = createReactGenerator({
|
|
|
281
283
|
operation,
|
|
282
284
|
pathParamsType: options.pathParamsType,
|
|
283
285
|
typeSchemas: type.schemas,
|
|
284
|
-
|
|
286
|
+
transformer: options.queryKey
|
|
285
287
|
}
|
|
286
288
|
),
|
|
287
289
|
/* @__PURE__ */ jsx(
|
|
@@ -290,15 +292,17 @@ var queryGenerator = createReactGenerator({
|
|
|
290
292
|
name: client.name,
|
|
291
293
|
isExportable: false,
|
|
292
294
|
isIndexable: false,
|
|
293
|
-
baseURL: options.baseURL,
|
|
295
|
+
baseURL: options.client.baseURL,
|
|
294
296
|
operation,
|
|
295
297
|
typeSchemas: type.schemas,
|
|
296
298
|
zodSchemas: zod.schemas,
|
|
297
299
|
dataReturnType: options.client.dataReturnType,
|
|
300
|
+
paramsType: options.paramsType,
|
|
298
301
|
pathParamsType: options.pathParamsType,
|
|
299
302
|
parser: options.parser
|
|
300
303
|
}
|
|
301
304
|
),
|
|
305
|
+
/* @__PURE__ */ jsx(File.Import, { name: ["queryOptions"], path: importPath }),
|
|
302
306
|
/* @__PURE__ */ jsx(
|
|
303
307
|
QueryOptions,
|
|
304
308
|
{
|
|
@@ -306,22 +310,28 @@ var queryGenerator = createReactGenerator({
|
|
|
306
310
|
clientName: client.name,
|
|
307
311
|
queryKeyName: queryKey.name,
|
|
308
312
|
typeSchemas: type.schemas,
|
|
313
|
+
paramsType: options.paramsType,
|
|
309
314
|
pathParamsType: options.pathParamsType
|
|
310
315
|
}
|
|
311
316
|
),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
|
|
314
|
-
{
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
+
] })
|
|
325
335
|
] });
|
|
326
336
|
}
|
|
327
337
|
});
|
|
@@ -336,6 +346,7 @@ var mutationGenerator = createReactGenerator({
|
|
|
336
346
|
const { getSchemas, getName, getFile } = useOperationManager();
|
|
337
347
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
338
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";
|
|
339
350
|
const mutation = {
|
|
340
351
|
name: getName(operation, { type: "function", prefix: "create" }),
|
|
341
352
|
typeName: getName(operation, { type: "type" }),
|
|
@@ -357,13 +368,11 @@ var mutationGenerator = createReactGenerator({
|
|
|
357
368
|
name: getName(operation, { type: "const", suffix: "MutationKey" }),
|
|
358
369
|
typeName: getName(operation, { type: "type", suffix: "MutationKey" })
|
|
359
370
|
};
|
|
360
|
-
if (!isMutation
|
|
371
|
+
if (!isMutation) {
|
|
361
372
|
return null;
|
|
362
373
|
}
|
|
363
374
|
return /* @__PURE__ */ jsxs(File, { baseName: mutation.file.baseName, path: mutation.file.path, meta: mutation.file.meta, banner: output?.banner, footer: output?.footer, children: [
|
|
364
375
|
options.parser === "zod" && /* @__PURE__ */ jsx(File.Import, { name: [zod.schemas.response.name], root: mutation.file.path, path: zod.file.path }),
|
|
365
|
-
/* @__PURE__ */ jsx(File.Import, { name: ["createMutation"], path: options.mutation.importPath }),
|
|
366
|
-
/* @__PURE__ */ jsx(File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: options.mutation.importPath, isTypeOnly: true }),
|
|
367
376
|
/* @__PURE__ */ jsx(File.Import, { name: "client", path: options.client.importPath }),
|
|
368
377
|
/* @__PURE__ */ jsx(File.Import, { name: ["RequestConfig", "ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
369
378
|
/* @__PURE__ */ jsx(
|
|
@@ -390,7 +399,7 @@ var mutationGenerator = createReactGenerator({
|
|
|
390
399
|
operation,
|
|
391
400
|
pathParamsType: options.pathParamsType,
|
|
392
401
|
typeSchemas: type.schemas,
|
|
393
|
-
|
|
402
|
+
transformer: options.mutationKey
|
|
394
403
|
}
|
|
395
404
|
),
|
|
396
405
|
/* @__PURE__ */ jsx(
|
|
@@ -399,32 +408,38 @@ var mutationGenerator = createReactGenerator({
|
|
|
399
408
|
name: client.name,
|
|
400
409
|
isExportable: false,
|
|
401
410
|
isIndexable: false,
|
|
402
|
-
baseURL: options.baseURL,
|
|
411
|
+
baseURL: options.client.baseURL,
|
|
403
412
|
operation,
|
|
404
413
|
typeSchemas: type.schemas,
|
|
405
414
|
zodSchemas: zod.schemas,
|
|
406
415
|
dataReturnType: options.client.dataReturnType,
|
|
416
|
+
paramsType: options.paramsType,
|
|
407
417
|
pathParamsType: options.pathParamsType,
|
|
408
418
|
parser: options.parser
|
|
409
419
|
}
|
|
410
420
|
),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
|
|
413
|
-
{
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
+
] })
|
|
424
439
|
] });
|
|
425
440
|
}
|
|
426
441
|
});
|
|
427
442
|
|
|
428
443
|
export { mutationGenerator, queryGenerator };
|
|
429
|
-
//# sourceMappingURL=chunk-
|
|
430
|
-
//# sourceMappingURL=chunk-
|
|
444
|
+
//# sourceMappingURL=chunk-JGITTOE5.js.map
|
|
445
|
+
//# sourceMappingURL=chunk-JGITTOE5.js.map
|