@kubb/plugin-vue-query 5.0.0-beta.25 → 5.0.0-beta.28
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/{components-CpTXuQiK.js → components-B4IlVmNa.js} +24 -9
- package/dist/components-B4IlVmNa.js.map +1 -0
- package/dist/{components-CeZrYaZj.cjs → components-CIedagno.cjs} +24 -9
- package/dist/components-CIedagno.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-Cb5_nhMY.js → generators-ClYptnDj.js} +47 -23
- package/dist/generators-ClYptnDj.js.map +1 -0
- package/dist/{generators-BSMwPpbh.cjs → generators-D7kNtBBo.cjs} +47 -23
- package/dist/generators-D7kNtBBo.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/extension.yaml +5 -5
- package/package.json +7 -7
- package/src/components/InfiniteQuery.tsx +5 -3
- package/src/components/InfiniteQueryOptions.tsx +3 -2
- package/src/components/Mutation.tsx +5 -3
- package/src/components/Query.tsx +5 -3
- package/src/components/QueryOptions.tsx +3 -2
- package/src/generators/infiniteQueryGenerator.tsx +6 -6
- package/src/generators/mutationGenerator.tsx +6 -6
- package/src/generators/queryGenerator.tsx +6 -6
- package/src/plugin.ts +3 -3
- package/src/utils.ts +8 -1
- package/dist/components-CeZrYaZj.cjs.map +0 -1
- package/dist/components-CpTXuQiK.js.map +0 -1
- package/dist/generators-BSMwPpbh.cjs.map +0 -1
- package/dist/generators-Cb5_nhMY.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_components = require("./components-
|
|
1
|
+
const require_components = require("./components-CIedagno.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_components.__toESM(node_path);
|
|
4
4
|
let _kubb_core = require("@kubb/core");
|
|
@@ -99,11 +99,19 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
99
99
|
meta: meta.file.meta,
|
|
100
100
|
banner: resolver.resolveBanner(ctx.meta, {
|
|
101
101
|
output,
|
|
102
|
-
config
|
|
102
|
+
config,
|
|
103
|
+
file: {
|
|
104
|
+
path: meta.file.path,
|
|
105
|
+
baseName: meta.file.baseName
|
|
106
|
+
}
|
|
103
107
|
}),
|
|
104
108
|
footer: resolver.resolveFooter(ctx.meta, {
|
|
105
109
|
output,
|
|
106
|
-
config
|
|
110
|
+
config,
|
|
111
|
+
file: {
|
|
112
|
+
path: meta.file.path,
|
|
113
|
+
baseName: meta.file.baseName
|
|
114
|
+
}
|
|
107
115
|
}),
|
|
108
116
|
children: [
|
|
109
117
|
fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -113,7 +121,7 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
113
121
|
}),
|
|
114
122
|
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
115
123
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
116
|
-
name: "
|
|
124
|
+
name: "client",
|
|
117
125
|
path: clientOptions.importPath
|
|
118
126
|
}),
|
|
119
127
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -132,9 +140,9 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
132
140
|
})
|
|
133
141
|
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
134
142
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
135
|
-
name: ["
|
|
143
|
+
name: ["client"],
|
|
136
144
|
root: meta.file.path,
|
|
137
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
145
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
138
146
|
}),
|
|
139
147
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
140
148
|
name: [
|
|
@@ -143,13 +151,13 @@ const infiniteQueryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
143
151
|
"ResponseErrorConfig"
|
|
144
152
|
],
|
|
145
153
|
root: meta.file.path,
|
|
146
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
154
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
147
155
|
isTypeOnly: true
|
|
148
156
|
}),
|
|
149
157
|
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
150
158
|
name: ["ResponseConfig"],
|
|
151
159
|
root: meta.file.path,
|
|
152
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
160
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
153
161
|
isTypeOnly: true
|
|
154
162
|
})
|
|
155
163
|
] }),
|
|
@@ -338,11 +346,19 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
338
346
|
meta: meta.file.meta,
|
|
339
347
|
banner: resolver.resolveBanner(ctx.meta, {
|
|
340
348
|
output,
|
|
341
|
-
config
|
|
349
|
+
config,
|
|
350
|
+
file: {
|
|
351
|
+
path: meta.file.path,
|
|
352
|
+
baseName: meta.file.baseName
|
|
353
|
+
}
|
|
342
354
|
}),
|
|
343
355
|
footer: resolver.resolveFooter(ctx.meta, {
|
|
344
356
|
output,
|
|
345
|
-
config
|
|
357
|
+
config,
|
|
358
|
+
file: {
|
|
359
|
+
path: meta.file.path,
|
|
360
|
+
baseName: meta.file.baseName
|
|
361
|
+
}
|
|
346
362
|
}),
|
|
347
363
|
children: [
|
|
348
364
|
fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -352,7 +368,7 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
352
368
|
}),
|
|
353
369
|
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
354
370
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
355
|
-
name: "
|
|
371
|
+
name: "client",
|
|
356
372
|
path: clientOptions.importPath
|
|
357
373
|
}),
|
|
358
374
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -371,9 +387,9 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
371
387
|
})
|
|
372
388
|
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
373
389
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
374
|
-
name: ["
|
|
390
|
+
name: ["client"],
|
|
375
391
|
root: meta.file.path,
|
|
376
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
392
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
377
393
|
}),
|
|
378
394
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
379
395
|
name: [
|
|
@@ -382,13 +398,13 @@ const mutationGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
382
398
|
"ResponseErrorConfig"
|
|
383
399
|
],
|
|
384
400
|
root: meta.file.path,
|
|
385
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
401
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
386
402
|
isTypeOnly: true
|
|
387
403
|
}),
|
|
388
404
|
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
389
405
|
name: ["ResponseConfig"],
|
|
390
406
|
root: meta.file.path,
|
|
391
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
407
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
392
408
|
isTypeOnly: true
|
|
393
409
|
})
|
|
394
410
|
] }),
|
|
@@ -544,11 +560,19 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
544
560
|
meta: meta.file.meta,
|
|
545
561
|
banner: resolver.resolveBanner(ctx.meta, {
|
|
546
562
|
output,
|
|
547
|
-
config
|
|
563
|
+
config,
|
|
564
|
+
file: {
|
|
565
|
+
path: meta.file.path,
|
|
566
|
+
baseName: meta.file.baseName
|
|
567
|
+
}
|
|
548
568
|
}),
|
|
549
569
|
footer: resolver.resolveFooter(ctx.meta, {
|
|
550
570
|
output,
|
|
551
|
-
config
|
|
571
|
+
config,
|
|
572
|
+
file: {
|
|
573
|
+
path: meta.file.path,
|
|
574
|
+
baseName: meta.file.baseName
|
|
575
|
+
}
|
|
552
576
|
}),
|
|
553
577
|
children: [
|
|
554
578
|
fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -558,7 +582,7 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
558
582
|
}),
|
|
559
583
|
clientOptions.importPath ? /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
560
584
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
561
|
-
name: "
|
|
585
|
+
name: "client",
|
|
562
586
|
path: clientOptions.importPath
|
|
563
587
|
}),
|
|
564
588
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
@@ -577,9 +601,9 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
577
601
|
})
|
|
578
602
|
] }) : /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsxs)(_kubb_renderer_jsx_jsx_runtime.Fragment, { children: [
|
|
579
603
|
!shouldUseClientPlugin && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
580
|
-
name: ["
|
|
604
|
+
name: ["client"],
|
|
581
605
|
root: meta.file.path,
|
|
582
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
606
|
+
path: node_path.default.resolve(root, ".kubb/client.ts")
|
|
583
607
|
}),
|
|
584
608
|
/* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
585
609
|
name: [
|
|
@@ -588,13 +612,13 @@ const queryGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
588
612
|
"ResponseErrorConfig"
|
|
589
613
|
],
|
|
590
614
|
root: meta.file.path,
|
|
591
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
615
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
592
616
|
isTypeOnly: true
|
|
593
617
|
}),
|
|
594
618
|
clientOptions.dataReturnType === "full" && /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Import, {
|
|
595
619
|
name: ["ResponseConfig"],
|
|
596
620
|
root: meta.file.path,
|
|
597
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
621
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
598
622
|
isTypeOnly: true
|
|
599
623
|
})
|
|
600
624
|
] }),
|
|
@@ -711,4 +735,4 @@ Object.defineProperty(exports, "queryGenerator", {
|
|
|
711
735
|
}
|
|
712
736
|
});
|
|
713
737
|
|
|
714
|
-
//# sourceMappingURL=generators-
|
|
738
|
+
//# sourceMappingURL=generators-D7kNtBBo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-D7kNtBBo.cjs","names":["jsxRendererSync","pluginTsName","getOperationParameters","resolveOperationTypeNames","pluginZodName","resolveZodSchemaNames","pluginClientName","File","path","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery","jsxRendererSync","pluginTsName","resolveOperationTypeNames","pluginZodName","resolveZodSchemaNames","pluginClientName","File","path","MutationKey","Client","Mutation","jsxRendererSync","pluginTsName","resolveOperationTypeNames","pluginZodName","resolveZodSchemaNames","pluginClientName","File","path","QueryKey","Client","QueryOptions","Query"],"sources":["../src/generators/infiniteQueryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { getOperationParameters, resolveOperationTypeNames } from '@internals/shared'\nimport { resolveZodSchemaNames } from '@internals/tanstack-query'\nimport { defineGenerator } from '@kubb/core'\nimport { Client, pluginClientName } from '@kubb/plugin-client'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRendererSync } from '@kubb/renderer-jsx'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\n/**\n * Built-in generator for `useInfiniteQuery` composables. Enabled when\n * `pluginVueQuery({ infinite: { ... } })`. Emits one `useFooInfiniteQuery`\n * composable per query operation, wiring the configured cursor path into\n * TanStack Query's cursor-based pagination.\n */\nexport const infiniteQueryGenerator = defineGenerator<PluginVueQuery>({\n name: 'vue-query-infinite',\n renderer: jsxRendererSync,\n operation(node, ctx) {\n const { config, driver, resolver, root } = ctx\n const { output, query, mutation, infinite, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs) return null\n const tsResolver = driver.getResolver(pluginTsName)\n\n const isQuery = query === false || (!!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase()))\n const isMutation =\n mutation !== false &&\n !isQuery &&\n difference(mutation ? mutation.methods : [], query ? query.methods : []).some((method) => node.method.toLowerCase() === method.toLowerCase())\n const infiniteOptions = infinite && typeof infinite === 'object' ? infinite : null\n\n if (!isQuery || isMutation || !infiniteOptions) return null\n\n // Validate queryParam exists in operation's query parameters\n const normalizeKey = (key: string) => key.replace(/\\?$/, '')\n const queryParamKeys = getOperationParameters(node).query.map((p) => p.name)\n const hasQueryParam = infiniteOptions.queryParam ? queryParamKeys.some((k) => normalizeKey(k) === infiniteOptions.queryParam) : false\n // cursorParam validation against response schema keys is skipped in v5 (complex schema inspection)\n const hasCursorParam = !infiniteOptions.cursorParam || true\n\n if (!hasQueryParam || !hasCursorParam) return null\n\n const importPath = query ? query.importPath : '@tanstack/vue-query'\n\n const queryName = resolver.resolveInfiniteQueryName(node)\n const queryOptionsName = resolver.resolveInfiniteQueryOptionsName(node)\n const queryKeyName = resolver.resolveInfiniteQueryKeyName(node)\n const queryKeyTypeName = resolver.resolveInfiniteQueryKeyTypeName(node)\n const clientBaseName = resolver.resolveInfiniteClientName(node)\n\n const meta = {\n file: resolver.resolveFile(\n { name: queryName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group: group ?? undefined },\n ),\n fileTs: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group ?? undefined },\n ),\n }\n\n const importedTypeNames = resolveOperationTypeNames(node, tsResolver, {\n paramsCasing,\n exclude: [queryKeyTypeName],\n order: 'body-response-first',\n })\n\n const pluginZod = parser === 'zod' ? driver.getPlugin(pluginZodName) : null\n const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null\n const fileZod = zodResolver\n ? zodResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginZod?.options?.output ?? output, group: pluginZod?.options?.group ?? undefined },\n )\n : null\n const zodSchemaNames = resolveZodSchemaNames(node, zodResolver)\n\n const clientPlugin = driver.getPlugin(pluginClientName)\n const hasClientPlugin = clientPlugin?.name === pluginClientName\n const shouldUseClientPlugin = hasClientPlugin && clientOptions.clientType !== 'class'\n const clientResolver = shouldUseClientPlugin ? driver.getResolver(pluginClientName) : null\n\n const clientFile = shouldUseClientPlugin\n ? clientResolver?.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: clientPlugin?.options?.output ?? output,\n group: clientPlugin?.options?.group ?? undefined,\n },\n )\n : null\n\n const resolvedClientName = shouldUseClientPlugin ? (clientResolver?.resolveName(node.operationId) ?? clientBaseName) : clientBaseName\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n {fileZod && zodSchemaNames.length > 0 && <File.Import name={zodSchemaNames} root={meta.file.path} path={fileZod.path} />}\n {clientOptions.importPath ? (\n <>\n {!shouldUseClientPlugin && <File.Import name={'client'} path={clientOptions.importPath} />}\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={clientOptions.importPath} isTypeOnly />\n {clientOptions.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={clientOptions.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n {!shouldUseClientPlugin && <File.Import name={['client']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/client.ts')}\n isTypeOnly\n />\n {clientOptions.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {shouldUseClientPlugin && clientFile && <File.Import name={[resolvedClientName]} root={meta.file.path} path={clientFile.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames))} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n\n <QueryKey\n name={queryKeyName}\n typeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n pathParamsType={pathParamsType}\n paramsCasing={paramsCasing}\n transformer={ctx.options.queryKey}\n />\n\n {!shouldUseClientPlugin && (\n <Client\n name={resolvedClientName}\n baseURL={clientOptions.baseURL}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsCasing={clientOptions.paramsCasing || paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n parser={parser}\n node={node}\n tsResolver={tsResolver}\n zodResolver={zodResolver}\n />\n )}\n\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n\n <InfiniteQueryOptions\n name={queryOptionsName}\n clientName={resolvedClientName}\n queryKeyName={queryKeyName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n cursorParam={infiniteOptions.cursorParam}\n nextParam={infiniteOptions.nextParam}\n previousParam={infiniteOptions.previousParam}\n initialPageParam={infiniteOptions.initialPageParam}\n queryParam={infiniteOptions.queryParam}\n />\n\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'UseInfiniteQueryOptions', 'UseInfiniteQueryReturnType']} path={importPath} isTypeOnly />\n\n <InfiniteQuery\n name={queryName}\n queryOptionsName={queryOptionsName}\n queryKeyName={queryKeyName}\n queryKeyTypeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n initialPageParam={infiniteOptions.initialPageParam}\n queryParam={infiniteOptions.queryParam}\n />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { resolveOperationTypeNames } from '@internals/shared'\nimport { resolveZodSchemaNames } from '@internals/tanstack-query'\nimport { defineGenerator } from '@kubb/core'\nimport { Client, pluginClientName } from '@kubb/plugin-client'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRendererSync } from '@kubb/renderer-jsx'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\n/**\n * Built-in generator for `useMutation` composables. Emits one\n * `useFooMutation` composable per POST/PUT/DELETE operation (configurable\n * via `mutation.methods`) plus the matching `fooMutationKey` helper.\n */\nexport const mutationGenerator = defineGenerator<PluginVueQuery>({\n name: 'vue-query-mutation',\n renderer: jsxRendererSync,\n operation(node, ctx) {\n const { config, driver, resolver, root } = ctx\n const { output, query, mutation, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs) return null\n const tsResolver = driver.getResolver(pluginTsName)\n\n const isQuery = query === false || (!!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase()))\n const isMutation =\n mutation !== false &&\n !isQuery &&\n difference(mutation ? mutation.methods : [], query ? query.methods : []).some((method) => node.method.toLowerCase() === method.toLowerCase())\n\n if (!isMutation) return null\n\n const importPath = mutation ? mutation.importPath : '@tanstack/vue-query'\n\n const mutationHookName = resolver.resolveMutationName(node)\n const mutationTypeName = resolver.resolveMutationTypeName(node)\n const mutationKeyName = resolver.resolveMutationKeyName(node)\n const clientName = resolver.resolveClientName(node)\n\n const meta = {\n file: resolver.resolveFile(\n { name: mutationHookName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group: group ?? undefined },\n ),\n fileTs: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group ?? undefined },\n ),\n }\n\n const importedTypeNames = resolveOperationTypeNames(node, tsResolver, { paramsCasing, order: 'body-response-first' })\n\n const pluginZod = parser === 'zod' ? driver.getPlugin(pluginZodName) : null\n const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null\n const fileZod = zodResolver\n ? zodResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginZod?.options?.output ?? output, group: pluginZod?.options?.group ?? undefined },\n )\n : null\n const zodSchemaNames = resolveZodSchemaNames(node, zodResolver)\n\n const clientPlugin = driver.getPlugin(pluginClientName)\n const hasClientPlugin = clientPlugin?.name === pluginClientName\n const shouldUseClientPlugin = hasClientPlugin && clientOptions.clientType !== 'class'\n const clientResolver = shouldUseClientPlugin ? driver.getResolver(pluginClientName) : null\n\n const clientFile = shouldUseClientPlugin\n ? clientResolver?.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: clientPlugin?.options?.output ?? output,\n group: clientPlugin?.options?.group ?? undefined,\n },\n )\n : null\n\n const resolvedClientName = shouldUseClientPlugin ? (clientResolver?.resolveName(node.operationId) ?? clientName) : clientName\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n {fileZod && zodSchemaNames.length > 0 && <File.Import name={zodSchemaNames} root={meta.file.path} path={fileZod.path} />}\n {clientOptions.importPath ? (\n <>\n {!shouldUseClientPlugin && <File.Import name={'client'} path={clientOptions.importPath} />}\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={clientOptions.importPath} isTypeOnly />\n {clientOptions.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={clientOptions.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n {!shouldUseClientPlugin && <File.Import name={['client']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/client.ts')}\n isTypeOnly\n />\n {clientOptions.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {shouldUseClientPlugin && clientFile && <File.Import name={[resolvedClientName]} root={meta.file.path} path={clientFile.path} />}\n {!shouldUseClientPlugin && node.requestBody?.content?.some((e) => e.contentType === 'multipart/form-data') && (\n <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />\n )}\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames))} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n\n <MutationKey name={mutationKeyName} node={node} pathParamsType={pathParamsType} paramsCasing={paramsCasing} transformer={ctx.options.mutationKey} />\n\n {!shouldUseClientPlugin && (\n <Client\n name={resolvedClientName}\n baseURL={clientOptions.baseURL}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsCasing={clientOptions.paramsCasing || paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n parser={parser}\n node={node}\n tsResolver={tsResolver}\n zodResolver={zodResolver}\n />\n )}\n\n {mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutationHookName}\n clientName={resolvedClientName}\n typeName={mutationTypeName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n mutationKeyName={mutationKeyName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { resolveOperationTypeNames } from '@internals/shared'\nimport { resolveZodSchemaNames } from '@internals/tanstack-query'\nimport { defineGenerator } from '@kubb/core'\nimport { Client, pluginClientName } from '@kubb/plugin-client'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRendererSync } from '@kubb/renderer-jsx'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\n/**\n * Built-in generator for `useQuery` composables. Emits one `useFooQuery`\n * composable per GET operation (configurable via `query.methods`) plus the\n * matching `fooQueryKey` / `fooQueryOptions` helpers.\n */\nexport const queryGenerator = defineGenerator<PluginVueQuery>({\n name: 'vue-query',\n renderer: jsxRendererSync,\n operation(node, ctx) {\n const { config, driver, resolver, root } = ctx\n const { output, query, mutation, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs) return null\n const tsResolver = driver.getResolver(pluginTsName)\n\n const isQuery = query === false || (!!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase()))\n const isMutation =\n mutation !== false &&\n !isQuery &&\n difference(mutation ? mutation.methods : [], query ? query.methods : []).some((method) => node.method.toLowerCase() === method.toLowerCase())\n\n if (!isQuery || isMutation) return null\n\n const importPath = query ? query.importPath : '@tanstack/vue-query'\n\n const queryName = resolver.resolveQueryName(node)\n const queryOptionsName = resolver.resolveQueryOptionsName(node)\n const queryKeyName = resolver.resolveQueryKeyName(node)\n const queryKeyTypeName = resolver.resolveQueryKeyTypeName(node)\n const clientName = resolver.resolveClientName(node)\n\n const meta = {\n file: resolver.resolveFile(\n { name: queryName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group: group ?? undefined },\n ),\n fileTs: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group ?? undefined },\n ),\n }\n\n const importedTypeNames = resolveOperationTypeNames(node, tsResolver, {\n paramsCasing,\n exclude: [queryKeyTypeName],\n order: 'body-response-first',\n })\n\n const pluginZod = parser === 'zod' ? driver.getPlugin(pluginZodName) : null\n const zodResolver = pluginZod ? driver.getResolver(pluginZodName) : null\n const fileZod = zodResolver\n ? zodResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginZod?.options?.output ?? output, group: pluginZod?.options?.group ?? undefined },\n )\n : null\n const zodSchemaNames = resolveZodSchemaNames(node, zodResolver)\n\n const clientPlugin = driver.getPlugin(pluginClientName)\n const hasClientPlugin = clientPlugin?.name === pluginClientName\n const shouldUseClientPlugin = hasClientPlugin && clientOptions.clientType !== 'class'\n const clientResolver = shouldUseClientPlugin ? driver.getResolver(pluginClientName) : null\n\n const clientFile = shouldUseClientPlugin\n ? clientResolver?.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: clientPlugin?.options?.output ?? output,\n group: clientPlugin?.options?.group ?? undefined,\n },\n )\n : null\n\n const resolvedClientName = shouldUseClientPlugin ? (clientResolver?.resolveName(node.operationId) ?? clientName) : clientName\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n {fileZod && zodSchemaNames.length > 0 && <File.Import name={zodSchemaNames} root={meta.file.path} path={fileZod.path} />}\n {clientOptions.importPath ? (\n <>\n {!shouldUseClientPlugin && <File.Import name={'client'} path={clientOptions.importPath} />}\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={clientOptions.importPath} isTypeOnly />\n {clientOptions.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={clientOptions.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n {!shouldUseClientPlugin && <File.Import name={['client']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/client.ts')}\n isTypeOnly\n />\n {clientOptions.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/client.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {shouldUseClientPlugin && clientFile && <File.Import name={[resolvedClientName]} root={meta.file.path} path={clientFile.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames))} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n\n <QueryKey\n name={queryKeyName}\n typeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n pathParamsType={pathParamsType}\n paramsCasing={paramsCasing}\n transformer={ctx.options.queryKey}\n />\n\n {!shouldUseClientPlugin && (\n <Client\n name={resolvedClientName}\n baseURL={clientOptions.baseURL}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsCasing={clientOptions.paramsCasing || paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n parser={parser}\n node={node}\n tsResolver={tsResolver}\n zodResolver={zodResolver}\n />\n )}\n\n <File.Import name={['queryOptions']} path={importPath} />\n\n <QueryOptions\n name={queryOptionsName}\n clientName={resolvedClientName}\n queryKeyName={queryKeyName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n />\n\n {query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'UseQueryOptions', 'UseQueryReturnType']} path={importPath} isTypeOnly />\n <Query\n name={queryName}\n queryOptionsName={queryOptionsName}\n queryKeyName={queryKeyName}\n queryKeyTypeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAa,0BAAA,GAAA,WAAA,iBAAyD;CACpE,MAAM;CACN,UAAUA,mBAAAA;CACV,UAAU,MAAM,KAAK;EACnB,MAAM,EAAE,QAAQ,QAAQ,UAAU,SAAS;EAC3C,MAAM,EAAE,QAAQ,OAAO,UAAU,UAAU,cAAc,YAAY,gBAAgB,QAAQ,QAAQ,eAAe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M,MAAM,KAAK,OAAO;KAAM,YAAA;KAAa,CAAA;IAGxH,iBAAA,GAAA,+BAAA,KAACE,mBAAAA,UAAD;KACE,MAAM;KACN,UAAU;KACJ;KACM;KACI;KACF;KACd,aAAa,IAAI,QAAQ;KACzB,CAAA;IAED,CAAC,yBACA,iBAAA,GAAA,+BAAA,KAACC,oBAAAA,QAAD;KACE,MAAM;KACN,SAAS,cAAc;KACvB,gBAAgB,cAAc,kBAAkB;KAChD,cAAc,cAAc,gBAAgB;KAChC;KACI;KACR;KACF;KACM;KACC;KACb,CAAA;IAGJ,iBAAA,GAAA,+BAAA,KAACH,mBAAAA,KAAK,QAAN;KAAa,MAAM,CAAC,eAAe;KAAE,MAAM;KAAc,CAAA;IAEzD,iBAAA,GAAA,+BAAA,KAACI,mBAAAA,cAAD;KACE,MAAM;KACN,YAAY;KACE;KACR;KACM;KACE;KACF;KACI;KAChB,gBAAgB,cAAc,kBAAkB;KAChD,CAAA;IAED,SACC,iBAAA,GAAA,+BAAA,MAAA,+BAAA,UAAA,EAAA,UAAA;KACE,iBAAA,GAAA,+BAAA,KAACJ,mBAAAA,KAAK,QAAN;MAAa,MAAM,CAAC,WAAW;MAAE,MAAM;MAAc,CAAA;KACrD,iBAAA,GAAA,+BAAA,KAACA,mBAAAA,KAAK,QAAN;MAAa,MAAM;OAAC;OAAY;OAAe;OAAmB;OAAqB;MAAE,MAAM;MAAY,YAAA;MAAa,CAAA;KACxH,iBAAA,GAAA,+BAAA,KAACK,mBAAAA,OAAD;MACE,MAAM;MACY;MACJ;MACI;MACZ;MACM;MACE;MACF;MACI;MAChB,gBAAgB,cAAc,kBAAkB;MAChD,CAAA;KACD,EAAA,CAAA;IAEA;;;CAGZ,CAAC"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generators = require("./generators-
|
|
2
|
+
const require_generators = require("./generators-D7kNtBBo.cjs");
|
|
3
3
|
exports.infiniteQueryGenerator = require_generators.infiniteQueryGenerator;
|
|
4
4
|
exports.mutationGenerator = require_generators.mutationGenerator;
|
|
5
5
|
exports.queryGenerator = require_generators.queryGenerator;
|
package/dist/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-
|
|
1
|
+
import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-ClYptnDj.js";
|
|
2
2
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_components = require("./components-
|
|
6
|
-
const require_generators = require("./generators-
|
|
5
|
+
const require_components = require("./components-CIedagno.cjs");
|
|
6
|
+
const require_generators = require("./generators-D7kNtBBo.cjs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_components.__toESM(node_path, 1);
|
|
9
9
|
let _kubb_core = require("@kubb/core");
|
|
@@ -197,10 +197,10 @@ const pluginVueQuery = (0, _kubb_core.definePlugin)((options) => {
|
|
|
197
197
|
const root = node_path.default.resolve(ctx.config.root, ctx.config.output.path);
|
|
198
198
|
const hasClientPlugin = !!ctx.config.plugins?.some((p) => p.name === _kubb_plugin_client.pluginClientName);
|
|
199
199
|
if (client?.bundle && !hasClientPlugin && !clientImportPath) ctx.injectFile({
|
|
200
|
-
baseName: "
|
|
201
|
-
path: node_path.default.resolve(root, ".kubb/
|
|
200
|
+
baseName: "client.ts",
|
|
201
|
+
path: node_path.default.resolve(root, ".kubb/client.ts"),
|
|
202
202
|
sources: [_kubb_core.ast.createSource({
|
|
203
|
-
name: "
|
|
203
|
+
name: "client",
|
|
204
204
|
nodes: [_kubb_core.ast.createText(clientName === "fetch" ? _kubb_plugin_client_templates_clients_fetch_source.source : _kubb_plugin_client_templates_clients_axios_source.source)],
|
|
205
205
|
isExportable: true,
|
|
206
206
|
isIndexable: true
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["camelCase","mutationKeyTransformer","queryKeyTransformer","queryGenerator","infiniteQueryGenerator","mutationGenerator","camelCase","pluginTsName","pluginZodName","path","pluginClientName","ast","fetchClientSource","axiosClientSource","configSource"],"sources":["../src/resolvers/resolverVueQuery.ts","../src/plugin.ts"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginVueQuery } from '../types.ts'\n\nfunction capitalize(name: string): string {\n return `${name.charAt(0).toUpperCase()}${name.slice(1)}`\n}\n\n/**\n * Default resolver used by `@kubb/plugin-vue-query`. Decides the names and\n * file paths for every generated TanStack Query composable (`useFooQuery`,\n * `useFooMutation`, `useFooInfiniteQuery`) and its companion helpers.\n *\n * Functions and files use camelCase; composables get the `use` prefix.\n *\n * @example Resolve composable and helper names\n * ```ts\n * import { resolverVueQuery } from '@kubb/plugin-vue-query'\n *\n * resolverVueQuery.resolveQueryName(operationNode) // 'useGetPetById'\n * resolverVueQuery.resolveQueryKeyName(operationNode) // 'getPetByIdQueryKey'\n * resolverVueQuery.resolveQueryOptionsName(operationNode) // 'getPetByIdQueryOptions'\n * ```\n */\nexport const resolverVueQuery = defineResolver<PluginVueQuery>(() => ({\n name: 'default',\n pluginName: 'plugin-vue-query',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveInfiniteQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}Infinite`\n },\n resolveMutationName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}QueryOptions`\n },\n resolveInfiniteQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryOptions`\n },\n resolveQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}QueryKey`\n },\n resolveInfiniteQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryKey`\n },\n resolveMutationKeyName(node) {\n return `${this.resolveName(node.operationId)}MutationKey`\n },\n resolveQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}QueryKey`\n },\n resolveInfiniteQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}InfiniteQueryKey`\n },\n resolveMutationTypeName(node) {\n return capitalize(this.resolveName(node.operationId))\n },\n resolveClientName(node) {\n return this.resolveName(node.operationId)\n },\n resolveInfiniteClientName(node) {\n return `${this.resolveName(node.operationId)}Infinite`\n },\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { mutationKeyTransformer } from '@internals/tanstack-query'\nimport { queryKeyTransformer } from '@internals/tanstack-query'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport { resolverVueQuery } from './resolvers/resolverVueQuery.ts'\nimport type { PluginVueQuery } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-vue-query`. Used for driver lookups\n * and cross-plugin dependency references.\n */\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\n/**\n * Generates one TanStack Query composable per OpenAPI operation for Vue's\n * Composition API. Queries become `useFooQuery` (and optionally\n * `useFooInfiniteQuery`); mutations become `useFooMutation`. Each composable\n * is fully typed end to end.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n * import { pluginVueQuery } from '@kubb/plugin-vue-query'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginTs(),\n * pluginVueQuery({\n * output: { path: './hooks' },\n * }),\n * ],\n * })\n * ```\n */\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite = false,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n mutationKey = mutationKeyTransformer,\n queryKey = queryKeyTransformer,\n paramsCasing,\n client,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const selectedGenerators =\n options.generators ??\n [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter((generator): generator is NonNullable<typeof generator> => Boolean(generator))\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : null\n\n return {\n name: pluginVueQueryName,\n options,\n dependencies: [pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter((dependency): dependency is string => Boolean(dependency)),\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...resolverVueQuery, ...userResolver } : resolverVueQuery\n\n ctx.setOptions({\n output,\n client: {\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n paramsCasing,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['get'],\n ...query,\n },\n mutationKey,\n mutation:\n mutation === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['post', 'put', 'patch', 'delete'],\n ...mutation,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: null,\n nextParam: null,\n previousParam: null,\n ...infinite,\n }\n : false,\n parser,\n paramsType,\n pathParamsType,\n paramsCasing,\n group: groupConfig,\n exclude,\n include,\n override,\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n\n for (const gen of selectedGenerators) {\n ctx.addGenerator(gen)\n }\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const hasClientPlugin = !!ctx.config.plugins?.some((p) => (p as { name?: string }).name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n ast.createSource({\n name: 'fetch',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n\nexport default pluginVueQuery\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,SAAS,WAAW,MAAsB;CACxC,OAAO,GAAG,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;;;;;;;;;;;;;;AAmBxD,MAAa,oBAAA,GAAA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A,OAAa,CAAC;KACrC,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACF,CAAC;KAGP;EACF;EACD"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["camelCase","mutationKeyTransformer","queryKeyTransformer","queryGenerator","infiniteQueryGenerator","mutationGenerator","camelCase","pluginTsName","pluginZodName","path","pluginClientName","ast","fetchClientSource","axiosClientSource","configSource"],"sources":["../src/resolvers/resolverVueQuery.ts","../src/plugin.ts"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginVueQuery } from '../types.ts'\n\nfunction capitalize(name: string): string {\n return `${name.charAt(0).toUpperCase()}${name.slice(1)}`\n}\n\n/**\n * Default resolver used by `@kubb/plugin-vue-query`. Decides the names and\n * file paths for every generated TanStack Query composable (`useFooQuery`,\n * `useFooMutation`, `useFooInfiniteQuery`) and its companion helpers.\n *\n * Functions and files use camelCase; composables get the `use` prefix.\n *\n * @example Resolve composable and helper names\n * ```ts\n * import { resolverVueQuery } from '@kubb/plugin-vue-query'\n *\n * resolverVueQuery.resolveQueryName(operationNode) // 'useGetPetById'\n * resolverVueQuery.resolveQueryKeyName(operationNode) // 'getPetByIdQueryKey'\n * resolverVueQuery.resolveQueryOptionsName(operationNode) // 'getPetByIdQueryOptions'\n * ```\n */\nexport const resolverVueQuery = defineResolver<PluginVueQuery>(() => ({\n name: 'default',\n pluginName: 'plugin-vue-query',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveInfiniteQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}Infinite`\n },\n resolveMutationName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}QueryOptions`\n },\n resolveInfiniteQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryOptions`\n },\n resolveQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}QueryKey`\n },\n resolveInfiniteQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryKey`\n },\n resolveMutationKeyName(node) {\n return `${this.resolveName(node.operationId)}MutationKey`\n },\n resolveQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}QueryKey`\n },\n resolveInfiniteQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}InfiniteQueryKey`\n },\n resolveMutationTypeName(node) {\n return capitalize(this.resolveName(node.operationId))\n },\n resolveClientName(node) {\n return this.resolveName(node.operationId)\n },\n resolveInfiniteClientName(node) {\n return `${this.resolveName(node.operationId)}Infinite`\n },\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { mutationKeyTransformer } from '@internals/tanstack-query'\nimport { queryKeyTransformer } from '@internals/tanstack-query'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport { resolverVueQuery } from './resolvers/resolverVueQuery.ts'\nimport type { PluginVueQuery } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-vue-query`. Used for driver lookups\n * and cross-plugin dependency references.\n */\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\n/**\n * Generates one TanStack Query composable per OpenAPI operation for Vue's\n * Composition API. Queries become `useFooQuery` (and optionally\n * `useFooInfiniteQuery`); mutations become `useFooMutation`. Each composable\n * is fully typed end to end.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n * import { pluginVueQuery } from '@kubb/plugin-vue-query'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginTs(),\n * pluginVueQuery({\n * output: { path: './hooks' },\n * }),\n * ],\n * })\n * ```\n */\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite = false,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n mutationKey = mutationKeyTransformer,\n queryKey = queryKeyTransformer,\n paramsCasing,\n client,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const selectedGenerators =\n options.generators ??\n [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter((generator): generator is NonNullable<typeof generator> => Boolean(generator))\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : null\n\n return {\n name: pluginVueQueryName,\n options,\n dependencies: [pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter((dependency): dependency is string => Boolean(dependency)),\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...resolverVueQuery, ...userResolver } : resolverVueQuery\n\n ctx.setOptions({\n output,\n client: {\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n paramsCasing,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['get'],\n ...query,\n },\n mutationKey,\n mutation:\n mutation === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['post', 'put', 'patch', 'delete'],\n ...mutation,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: null,\n nextParam: null,\n previousParam: null,\n ...infinite,\n }\n : false,\n parser,\n paramsType,\n pathParamsType,\n paramsCasing,\n group: groupConfig,\n exclude,\n include,\n override,\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n\n for (const gen of selectedGenerators) {\n ctx.addGenerator(gen)\n }\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const hasClientPlugin = !!ctx.config.plugins?.some((p) => (p as { name?: string }).name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'client.ts',\n path: path.resolve(root, '.kubb/client.ts'),\n sources: [\n ast.createSource({\n name: 'client',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n\nexport default pluginVueQuery\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,SAAS,WAAW,MAAsB;CACxC,OAAO,GAAG,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;;;;;;;;;;;;;;AAmBxD,MAAa,oBAAA,GAAA,WAAA,uBAAyD;CACpE,MAAM;CACN,YAAY;CACZ,QAAQ,MAAM,MAAM;EAClB,OAAOA,m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"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
|
-
import { f as mutationKeyTransformer, p as camelCase, s as queryKeyTransformer } from "./components-
|
|
3
|
-
import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-
|
|
2
|
+
import { f as mutationKeyTransformer, p as camelCase, s as queryKeyTransformer } from "./components-B4IlVmNa.js";
|
|
3
|
+
import { n as mutationGenerator, r as infiniteQueryGenerator, t as queryGenerator } from "./generators-ClYptnDj.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { ast, definePlugin, defineResolver } from "@kubb/core";
|
|
6
6
|
import { pluginClientName } from "@kubb/plugin-client";
|
|
@@ -193,10 +193,10 @@ const pluginVueQuery = definePlugin((options) => {
|
|
|
193
193
|
const root = path.resolve(ctx.config.root, ctx.config.output.path);
|
|
194
194
|
const hasClientPlugin = !!ctx.config.plugins?.some((p) => p.name === pluginClientName);
|
|
195
195
|
if (client?.bundle && !hasClientPlugin && !clientImportPath) ctx.injectFile({
|
|
196
|
-
baseName: "
|
|
197
|
-
path: path.resolve(root, ".kubb/
|
|
196
|
+
baseName: "client.ts",
|
|
197
|
+
path: path.resolve(root, ".kubb/client.ts"),
|
|
198
198
|
sources: [ast.createSource({
|
|
199
|
-
name: "
|
|
199
|
+
name: "client",
|
|
200
200
|
nodes: [ast.createText(clientName === "fetch" ? source$1 : source)],
|
|
201
201
|
isExportable: true,
|
|
202
202
|
isIndexable: true
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["fetchClientSource","axiosClientSource","configSource"],"sources":["../src/resolvers/resolverVueQuery.ts","../src/plugin.ts"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginVueQuery } from '../types.ts'\n\nfunction capitalize(name: string): string {\n return `${name.charAt(0).toUpperCase()}${name.slice(1)}`\n}\n\n/**\n * Default resolver used by `@kubb/plugin-vue-query`. Decides the names and\n * file paths for every generated TanStack Query composable (`useFooQuery`,\n * `useFooMutation`, `useFooInfiniteQuery`) and its companion helpers.\n *\n * Functions and files use camelCase; composables get the `use` prefix.\n *\n * @example Resolve composable and helper names\n * ```ts\n * import { resolverVueQuery } from '@kubb/plugin-vue-query'\n *\n * resolverVueQuery.resolveQueryName(operationNode) // 'useGetPetById'\n * resolverVueQuery.resolveQueryKeyName(operationNode) // 'getPetByIdQueryKey'\n * resolverVueQuery.resolveQueryOptionsName(operationNode) // 'getPetByIdQueryOptions'\n * ```\n */\nexport const resolverVueQuery = defineResolver<PluginVueQuery>(() => ({\n name: 'default',\n pluginName: 'plugin-vue-query',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveInfiniteQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}Infinite`\n },\n resolveMutationName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}QueryOptions`\n },\n resolveInfiniteQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryOptions`\n },\n resolveQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}QueryKey`\n },\n resolveInfiniteQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryKey`\n },\n resolveMutationKeyName(node) {\n return `${this.resolveName(node.operationId)}MutationKey`\n },\n resolveQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}QueryKey`\n },\n resolveInfiniteQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}InfiniteQueryKey`\n },\n resolveMutationTypeName(node) {\n return capitalize(this.resolveName(node.operationId))\n },\n resolveClientName(node) {\n return this.resolveName(node.operationId)\n },\n resolveInfiniteClientName(node) {\n return `${this.resolveName(node.operationId)}Infinite`\n },\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { mutationKeyTransformer } from '@internals/tanstack-query'\nimport { queryKeyTransformer } from '@internals/tanstack-query'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport { resolverVueQuery } from './resolvers/resolverVueQuery.ts'\nimport type { PluginVueQuery } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-vue-query`. Used for driver lookups\n * and cross-plugin dependency references.\n */\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\n/**\n * Generates one TanStack Query composable per OpenAPI operation for Vue's\n * Composition API. Queries become `useFooQuery` (and optionally\n * `useFooInfiniteQuery`); mutations become `useFooMutation`. Each composable\n * is fully typed end to end.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n * import { pluginVueQuery } from '@kubb/plugin-vue-query'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginTs(),\n * pluginVueQuery({\n * output: { path: './hooks' },\n * }),\n * ],\n * })\n * ```\n */\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite = false,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n mutationKey = mutationKeyTransformer,\n queryKey = queryKeyTransformer,\n paramsCasing,\n client,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const selectedGenerators =\n options.generators ??\n [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter((generator): generator is NonNullable<typeof generator> => Boolean(generator))\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : null\n\n return {\n name: pluginVueQueryName,\n options,\n dependencies: [pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter((dependency): dependency is string => Boolean(dependency)),\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...resolverVueQuery, ...userResolver } : resolverVueQuery\n\n ctx.setOptions({\n output,\n client: {\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n paramsCasing,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['get'],\n ...query,\n },\n mutationKey,\n mutation:\n mutation === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['post', 'put', 'patch', 'delete'],\n ...mutation,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: null,\n nextParam: null,\n previousParam: null,\n ...infinite,\n }\n : false,\n parser,\n paramsType,\n pathParamsType,\n paramsCasing,\n group: groupConfig,\n exclude,\n include,\n override,\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n\n for (const gen of selectedGenerators) {\n ctx.addGenerator(gen)\n }\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const hasClientPlugin = !!ctx.config.plugins?.some((p) => (p as { name?: string }).name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n ast.createSource({\n name: 'fetch',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n\nexport default pluginVueQuery\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,WAAW,MAAsB;CACxC,OAAO,GAAG,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;;;;;;;;;;;;;;AAmBxD,MAAa,mBAAmB,sBAAsC;CACpE,MAAM;CACN,YAAY;CACZ,QAAQ,MAAM,MAAM;EAClB,OAAO,UAAU,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC;;CAErD,YAAY,MAAM;EAChB,OAAO,KAAK,QAAQ,MAAM,WAAW;;CAEvC,gBAAgB,MAAM,MAAM;EAC1B,OAAO,KAAK,QAAQ,MAAM,KAAK;;CAEjC,iBAAiB,MAAM;EACrB,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE7D,yBAAyB,MAAM;EAC7B,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC,CAAC;;CAE9D,oBAAoB,MAAM;EACxB,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE7D,wBAAwB,MAAM;EAC5B,OAA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AI,OAAO,OAAO,KAAK;GAClE,MAAM,kBAAkB,CAAC,CAAC,IAAI,OAAO,SAAS,MAAM,MAAO,EAAwB,SAAS,iBAAiB;GAE7G,IAAI,QAAQ,UAAU,CAAC,mBAAmB,CAAC,kBACzC,IAAI,WAAW;IACb,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,iBAAiB;IAC1C,SAAS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAW,eAAe,UAAUA,WAAoBC,OAAkB,CAAC;KACvF,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACF,CAAC;GAGJ,IAAI,CAAC,iBACH,IAAI,WAAW;IACb,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,kBAAkB;IAC3C,SAAS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAWC,SAAa,CAAC;KACrC,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACF,CAAC;KAGP;EACF;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["fetchClientSource","axiosClientSource","configSource"],"sources":["../src/resolvers/resolverVueQuery.ts","../src/plugin.ts"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginVueQuery } from '../types.ts'\n\nfunction capitalize(name: string): string {\n return `${name.charAt(0).toUpperCase()}${name.slice(1)}`\n}\n\n/**\n * Default resolver used by `@kubb/plugin-vue-query`. Decides the names and\n * file paths for every generated TanStack Query composable (`useFooQuery`,\n * `useFooMutation`, `useFooInfiniteQuery`) and its companion helpers.\n *\n * Functions and files use camelCase; composables get the `use` prefix.\n *\n * @example Resolve composable and helper names\n * ```ts\n * import { resolverVueQuery } from '@kubb/plugin-vue-query'\n *\n * resolverVueQuery.resolveQueryName(operationNode) // 'useGetPetById'\n * resolverVueQuery.resolveQueryKeyName(operationNode) // 'getPetByIdQueryKey'\n * resolverVueQuery.resolveQueryOptionsName(operationNode) // 'getPetByIdQueryOptions'\n * ```\n */\nexport const resolverVueQuery = defineResolver<PluginVueQuery>(() => ({\n name: 'default',\n pluginName: 'plugin-vue-query',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveInfiniteQueryName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}Infinite`\n },\n resolveMutationName(node) {\n return `use${capitalize(this.resolveName(node.operationId))}`\n },\n resolveQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}QueryOptions`\n },\n resolveInfiniteQueryOptionsName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryOptions`\n },\n resolveQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}QueryKey`\n },\n resolveInfiniteQueryKeyName(node) {\n return `${this.resolveName(node.operationId)}InfiniteQueryKey`\n },\n resolveMutationKeyName(node) {\n return `${this.resolveName(node.operationId)}MutationKey`\n },\n resolveQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}QueryKey`\n },\n resolveInfiniteQueryKeyTypeName(node) {\n return `${capitalize(this.resolveName(node.operationId))}InfiniteQueryKey`\n },\n resolveMutationTypeName(node) {\n return capitalize(this.resolveName(node.operationId))\n },\n resolveClientName(node) {\n return this.resolveName(node.operationId)\n },\n resolveInfiniteClientName(node) {\n return `${this.resolveName(node.operationId)}Infinite`\n },\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { mutationKeyTransformer } from '@internals/tanstack-query'\nimport { queryKeyTransformer } from '@internals/tanstack-query'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport { resolverVueQuery } from './resolvers/resolverVueQuery.ts'\nimport type { PluginVueQuery } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-vue-query`. Used for driver lookups\n * and cross-plugin dependency references.\n */\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\n/**\n * Generates one TanStack Query composable per OpenAPI operation for Vue's\n * Composition API. Queries become `useFooQuery` (and optionally\n * `useFooInfiniteQuery`); mutations become `useFooMutation`. Each composable\n * is fully typed end to end.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n * import { pluginVueQuery } from '@kubb/plugin-vue-query'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginTs(),\n * pluginVueQuery({\n * output: { path: './hooks' },\n * }),\n * ],\n * })\n * ```\n */\nexport const pluginVueQuery = definePlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite = false,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutation = {},\n query = {},\n mutationKey = mutationKeyTransformer,\n queryKey = queryKeyTransformer,\n paramsCasing,\n client,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const selectedGenerators =\n options.generators ??\n [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter((generator): generator is NonNullable<typeof generator> => Boolean(generator))\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : null\n\n return {\n name: pluginVueQueryName,\n options,\n dependencies: [pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter((dependency): dependency is string => Boolean(dependency)),\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...resolverVueQuery, ...userResolver } : resolverVueQuery\n\n ctx.setOptions({\n output,\n client: {\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n paramsCasing,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['get'],\n ...query,\n },\n mutationKey,\n mutation:\n mutation === false\n ? false\n : {\n importPath: '@tanstack/vue-query',\n methods: ['post', 'put', 'patch', 'delete'],\n ...mutation,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: null,\n nextParam: null,\n previousParam: null,\n ...infinite,\n }\n : false,\n parser,\n paramsType,\n pathParamsType,\n paramsCasing,\n group: groupConfig,\n exclude,\n include,\n override,\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n\n for (const gen of selectedGenerators) {\n ctx.addGenerator(gen)\n }\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const hasClientPlugin = !!ctx.config.plugins?.some((p) => (p as { name?: string }).name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'client.ts',\n path: path.resolve(root, '.kubb/client.ts'),\n sources: [\n ast.createSource({\n name: 'client',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n\nexport default pluginVueQuery\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,WAAW,MAAsB;CACxC,OAAO,GAAG,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;;;;;;;;;;;;;;AAmBxD,MAAa,mBAAmB,sBAAsC;CACpE,MAAM;CACN,YAAY;CACZ,QAAQ,MAAM,MAAM;EAClB,OAAO,UAAU,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC;;CAErD,YAAY,MAAM;EAChB,OAAO,KAAK,QAAQ,MAAM,WAAW;;CAEvC,gBAAgB,MAAM,MAAM;EAC1B,OAAO,KAAK,QAAQ,MAAM,KAAK;;CAEjC,iBAAiB,MAAM;EACrB,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE7D,yBAAyB,MAAM;EAC7B,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC,CAAC;;CAE9D,oBAAoB,MAAM;EACxB,OAAO,MAAM,WAAW,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE7D,wBAAwB,MAAM;EAC5B,OAAO,GAAG,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE/C,gCAAgC,MAAM;EACpC,OAAO,GAAG,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE/C,oBAAoB,MAAM;EACxB,OAAO,GAAG,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE/C,4BAA4B,MAAM;EAChC,OAAO,GAAG,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE/C,uBAAuB,MAAM;EAC3B,OAAO,GAAG,KAAK,YAAY,KAAK,YAAY,CAAC;;CAE/C,wBAAwB,MAAM;EAC5B,OAAO,GAAG,WAAW,KAAK,YAAY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IAAI,CAAC,iBACH,IAAI,WAAW;IACb,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,kBAAkB;IAC3C,SAAS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAWC,SAAa,CAAC;KACrC,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACF,CAAC;KAGP;EACF;EACD"}
|
package/extension.yaml
CHANGED
|
@@ -428,7 +428,7 @@ options:
|
|
|
428
428
|
Without `importPath`:
|
|
429
429
|
|
|
430
430
|
- `bundle: false` (default) — generated code imports from `@kubb/plugin-client/clients/{axios|fetch}`.
|
|
431
|
-
- `bundle: true` — Kubb writes `.kubb/
|
|
431
|
+
- `bundle: true` — Kubb writes `.kubb/client.ts` and generated code imports from there.
|
|
432
432
|
- title: Required exports
|
|
433
433
|
body: |
|
|
434
434
|
The module pointed to by `importPath` must satisfy the same shape as the built-in client. At minimum:
|
|
@@ -440,7 +440,7 @@ options:
|
|
|
440
440
|
When used together with a query plugin (`@kubb/plugin-react-query`, `@kubb/plugin-vue-query`), it must also export a `Client` type alias.
|
|
441
441
|
- title: How generated files import it
|
|
442
442
|
body: |
|
|
443
|
-
Generated code imports the client as a default import and the runtime types as named type imports:
|
|
443
|
+
Generated code imports the client as a default import (bound to the local name `client`) and the runtime types as named type imports:
|
|
444
444
|
codeBlock:
|
|
445
445
|
lang: typescript
|
|
446
446
|
code: |
|
|
@@ -602,7 +602,7 @@ options:
|
|
|
602
602
|
Copies the HTTP client runtime into the generated output, so the consuming app does not need `@kubb/plugin-client` installed at runtime.
|
|
603
603
|
|
|
604
604
|
- `false` (default) — generated files import from `@kubb/plugin-client/clients/{client}`. Smaller diff, but the package must be a runtime dependency.
|
|
605
|
-
- `true` — Kubb writes a `.kubb/
|
|
605
|
+
- `true` — Kubb writes a `.kubb/client.ts` file with the client implementation. Generated code imports from that local file and the project no longer pulls `@kubb/plugin-client` at runtime.
|
|
606
606
|
- Setting `client.importPath` overrides both behaviors and uses your custom client instead.
|
|
607
607
|
examples:
|
|
608
608
|
- name: Bundle the runtime
|
|
@@ -701,7 +701,7 @@ options:
|
|
|
701
701
|
// ...mapped back to the original API name internally
|
|
702
702
|
const pet_id = petId
|
|
703
703
|
|
|
704
|
-
return
|
|
704
|
+
return client({
|
|
705
705
|
method: 'DELETE',
|
|
706
706
|
url: `/pet/${pet_id}`,
|
|
707
707
|
...config,
|
|
@@ -724,7 +724,7 @@ options:
|
|
|
724
724
|
headers?: DeletePetHeaderParams,
|
|
725
725
|
config: Partial<RequestConfig> = {},
|
|
726
726
|
) {
|
|
727
|
-
return
|
|
727
|
+
return client({
|
|
728
728
|
method: 'DELETE',
|
|
729
729
|
url: `/pet/${pet_id}`,
|
|
730
730
|
...config,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-vue-query",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.28",
|
|
4
4
|
"description": "Generate type-safe TanStack Query (Vue Query) composables from your OpenAPI specification. Covers useQuery, useMutation, useInfiniteQuery, and queryOptions with Vue 3 Composition API support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-generation",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"registry": "https://registry.npmjs.org/"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@kubb/core": "5.0.0-beta.
|
|
74
|
-
"@kubb/renderer-jsx": "5.0.0-beta.
|
|
73
|
+
"@kubb/core": "5.0.0-beta.28",
|
|
74
|
+
"@kubb/renderer-jsx": "5.0.0-beta.28",
|
|
75
75
|
"remeda": "^2.34.1",
|
|
76
|
-
"@kubb/plugin-client": "5.0.0-beta.
|
|
77
|
-
"@kubb/plugin-ts": "5.0.0-beta.
|
|
78
|
-
"@kubb/plugin-zod": "5.0.0-beta.
|
|
76
|
+
"@kubb/plugin-client": "5.0.0-beta.28",
|
|
77
|
+
"@kubb/plugin-ts": "5.0.0-beta.28",
|
|
78
|
+
"@kubb/plugin-zod": "5.0.0-beta.28"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@internals/shared": "0.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@internals/utils": "0.0.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@kubb/renderer-jsx": "5.0.0-beta.
|
|
86
|
+
"@kubb/renderer-jsx": "5.0.0-beta.28"
|
|
87
87
|
},
|
|
88
88
|
"size-limit": [
|
|
89
89
|
{
|
|
@@ -4,7 +4,7 @@ import { functionPrinter } from '@kubb/plugin-ts'
|
|
|
4
4
|
import { File, Function } from '@kubb/renderer-jsx'
|
|
5
5
|
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
6
6
|
import type { Infinite, PluginVueQuery } from '../types.ts'
|
|
7
|
-
import { getComments, resolveErrorNames, wrapWithMaybeRefOrGetter } from '../utils.ts'
|
|
7
|
+
import { getComments, resolveErrorNames, resolveSuccessNames, wrapWithMaybeRefOrGetter } from '../utils.ts'
|
|
8
8
|
import { buildQueryKeyParamsNode } from './QueryKey.tsx'
|
|
9
9
|
import { getQueryOptionsParams } from './QueryOptions.tsx'
|
|
10
10
|
|
|
@@ -37,7 +37,8 @@ function buildInfiniteQueryParamsNode(
|
|
|
37
37
|
},
|
|
38
38
|
): ast.FunctionParametersNode {
|
|
39
39
|
const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options
|
|
40
|
-
const
|
|
40
|
+
const successNames = resolveSuccessNames(node, resolver)
|
|
41
|
+
const responseName = successNames.length > 0 ? successNames.join(' | ') : resolver.resolveResponseName(node)
|
|
41
42
|
const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null
|
|
42
43
|
const errorNames = resolveErrorNames(node, resolver)
|
|
43
44
|
|
|
@@ -79,7 +80,8 @@ export function InfiniteQuery({
|
|
|
79
80
|
node,
|
|
80
81
|
tsResolver,
|
|
81
82
|
}: Props): KubbReactNode {
|
|
82
|
-
const
|
|
83
|
+
const successNames = resolveSuccessNames(node, tsResolver)
|
|
84
|
+
const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)
|
|
83
85
|
const errorNames = resolveErrorNames(node, tsResolver)
|
|
84
86
|
|
|
85
87
|
const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`
|
|
@@ -6,7 +6,7 @@ import { functionPrinter } from '@kubb/plugin-ts'
|
|
|
6
6
|
import { File, Function } from '@kubb/renderer-jsx'
|
|
7
7
|
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
8
8
|
import type { Infinite, PluginVueQuery } from '../types.ts'
|
|
9
|
-
import { resolveErrorNames } from '../utils.ts'
|
|
9
|
+
import { resolveErrorNames, resolveSuccessNames } from '../utils.ts'
|
|
10
10
|
import { buildQueryKeyParamsNode } from './QueryKey.tsx'
|
|
11
11
|
import { buildEnabledCheck } from '@internals/tanstack-query'
|
|
12
12
|
import { getQueryOptionsParams } from './QueryOptions.tsx'
|
|
@@ -47,7 +47,8 @@ export function InfiniteQueryOptions({
|
|
|
47
47
|
queryParam,
|
|
48
48
|
queryKeyName,
|
|
49
49
|
}: Props): KubbReactNode {
|
|
50
|
-
const
|
|
50
|
+
const successNames = resolveSuccessNames(node, tsResolver)
|
|
51
|
+
const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)
|
|
51
52
|
const queryFnDataType = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`
|
|
52
53
|
const errorNames = resolveErrorNames(node, tsResolver)
|
|
53
54
|
const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`
|