@kubb/plugin-vue-query 5.0.0-beta.30 → 5.0.0-beta.31
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-CIedagno.cjs → components-B6lPYyOP.cjs} +134 -63
- package/dist/components-B6lPYyOP.cjs.map +1 -0
- package/dist/{components-B4IlVmNa.js → components-BZqujNQv.js} +129 -64
- package/dist/components-BZqujNQv.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-ClYptnDj.js → generators-C-3isXzW.js} +18 -75
- package/dist/generators-C-3isXzW.js.map +1 -0
- package/dist/{generators-D7kNtBBo.cjs → generators-QHQkbNnm.cjs} +17 -74
- package/dist/generators-QHQkbNnm.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.js +1 -1
- package/dist/index.cjs +40 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -10
- package/dist/index.js.map +1 -1
- package/extension.yaml +3 -3
- package/package.json +7 -7
- package/src/components/InfiniteQuery.tsx +6 -1
- package/src/components/InfiniteQueryOptions.tsx +15 -18
- package/src/components/Query.tsx +6 -1
- package/src/components/QueryKey.tsx +3 -2
- package/src/components/QueryOptions.tsx +14 -17
- package/src/generators/infiniteQueryGenerator.tsx +19 -22
- package/src/generators/mutationGenerator.tsx +19 -22
- package/src/generators/queryGenerator.tsx +19 -22
- package/src/plugin.ts +4 -16
- package/dist/components-B4IlVmNa.js.map +0 -1
- package/dist/components-CIedagno.cjs.map +0 -1
- package/dist/generators-ClYptnDj.js.map +0 -1
- package/dist/generators-D7kNtBBo.cjs.map +0 -1
|
@@ -335,38 +335,31 @@ var URLPath = class {
|
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
//#endregion
|
|
338
|
-
//#region ../../internals/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
338
|
+
//#region ../../internals/shared/src/operation.ts
|
|
339
|
+
/**
|
|
340
|
+
* Builds the `ResolverFileParams` every operation generator passes to
|
|
341
|
+
* `resolver.resolveFile`: a file named `name`, tagged by the operation's first
|
|
342
|
+
* tag (or `'default'`), at the operation's path. Centralizes the entry object
|
|
343
|
+
* that was repeated at dozens of call sites across the client and query plugins.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```ts
|
|
347
|
+
* resolver.resolveFile(operationFileEntry(node, node.operationId), { root, output, group })
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
function operationFileEntry(node, name, extname = ".ts") {
|
|
351
|
+
return {
|
|
351
352
|
name,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
export: true,
|
|
357
|
-
params: paramsSignature,
|
|
358
|
-
singleLine: true,
|
|
359
|
-
children: `[${keys.join(", ")}] as const`
|
|
360
|
-
})
|
|
361
|
-
});
|
|
353
|
+
extname,
|
|
354
|
+
tag: node.tags[0] ?? "default",
|
|
355
|
+
path: node.path
|
|
356
|
+
};
|
|
362
357
|
}
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region ../../internals/shared/src/operation.ts
|
|
365
358
|
function getOperationLink(node, link) {
|
|
366
359
|
if (!link) return null;
|
|
367
360
|
if (typeof link === "function") return link(node) ?? null;
|
|
368
361
|
if (link === "urlPath") return node.path ? `{@link ${new URLPath(node.path).URL}}` : null;
|
|
369
|
-
return `{@link ${node.path.replaceAll("{", ":").replaceAll("}", "")}}
|
|
362
|
+
return node.path ? `{@link ${node.path.replaceAll("{", ":").replaceAll("}", "")}}` : null;
|
|
370
363
|
}
|
|
371
364
|
function getContentTypeInfo(node) {
|
|
372
365
|
const contentTypes = node.requestBody?.content?.map((e) => e.contentType) ?? [];
|
|
@@ -464,6 +457,33 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
|
|
|
464
457
|
return result;
|
|
465
458
|
}
|
|
466
459
|
//#endregion
|
|
460
|
+
//#region ../../internals/tanstack-query/src/components/MutationKey.tsx
|
|
461
|
+
const declarationPrinter$7 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
462
|
+
const mutationKeyTransformer = ({ node, casing }) => {
|
|
463
|
+
if (!node.path) return [];
|
|
464
|
+
return [`{ url: '${new URLPath(node.path, { casing }).toURLPath()}' }`];
|
|
465
|
+
};
|
|
466
|
+
function MutationKey({ name, paramsCasing, node, transformer }) {
|
|
467
|
+
const paramsNode = _kubb_core.ast.createFunctionParameters({ params: [] });
|
|
468
|
+
const paramsSignature = declarationPrinter$7.print(paramsNode) ?? "";
|
|
469
|
+
const keys = (transformer ?? mutationKeyTransformer)({
|
|
470
|
+
node,
|
|
471
|
+
casing: paramsCasing
|
|
472
|
+
});
|
|
473
|
+
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Source, {
|
|
474
|
+
name,
|
|
475
|
+
isExportable: true,
|
|
476
|
+
isIndexable: true,
|
|
477
|
+
children: /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.Function.Arrow, {
|
|
478
|
+
name,
|
|
479
|
+
export: true,
|
|
480
|
+
params: paramsSignature,
|
|
481
|
+
singleLine: true,
|
|
482
|
+
children: `[${keys.join(", ")}] as const`
|
|
483
|
+
})
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
//#endregion
|
|
467
487
|
//#region ../../internals/tanstack-query/src/utils.ts
|
|
468
488
|
/**
|
|
469
489
|
* Collects the Zod schema import names for an operation (response + request body).
|
|
@@ -577,7 +597,12 @@ function buildQueryKeyParams(node, options) {
|
|
|
577
597
|
params.push(...buildGroupParam("params", node, queryParams, queryGroupType, resolver));
|
|
578
598
|
return _kubb_core.ast.createFunctionParameters({ params });
|
|
579
599
|
}
|
|
580
|
-
|
|
600
|
+
/**
|
|
601
|
+
* Collect the names of the required params (no default) that drive the `enabled`
|
|
602
|
+
* guard. These are exactly the params that should be made optional in the
|
|
603
|
+
* generated signatures so callers can pass `undefined` to reach the disabled state.
|
|
604
|
+
*/
|
|
605
|
+
function getEnabledParamNames(paramsNode) {
|
|
581
606
|
const required = [];
|
|
582
607
|
for (const param of paramsNode.params) if ("kind" in param && param.kind === "ParameterGroup") {
|
|
583
608
|
const group = param;
|
|
@@ -586,10 +611,45 @@ function buildEnabledCheck(paramsNode) {
|
|
|
586
611
|
const fp = param;
|
|
587
612
|
if (!fp.optional && fp.default === void 0) required.push(fp.name);
|
|
588
613
|
}
|
|
589
|
-
return required
|
|
614
|
+
return required;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Return a copy of `paramsNode` with the named params marked optional.
|
|
618
|
+
*
|
|
619
|
+
* Used to align signatures with the `enabled` guard: the guard already disables
|
|
620
|
+
* the query while a param is falsy, so the param should accept `undefined`. The
|
|
621
|
+
* change is type-only — the `queryFn` keeps calling the client with a non-null
|
|
622
|
+
* assertion (see `injectNonNullAssertions`), so the emitted runtime is unchanged.
|
|
623
|
+
*/
|
|
624
|
+
function markParamsOptional(paramsNode, names) {
|
|
625
|
+
if (names.length === 0) return paramsNode;
|
|
626
|
+
const nameSet = new Set(names);
|
|
627
|
+
const params = paramsNode.params.map((param) => {
|
|
628
|
+
if ("kind" in param && param.kind === "ParameterGroup") {
|
|
629
|
+
const group = param;
|
|
630
|
+
return {
|
|
631
|
+
...group,
|
|
632
|
+
properties: group.properties.map((child) => nameSet.has(child.name) ? _kubb_core.ast.createFunctionParameter({
|
|
633
|
+
name: child.name,
|
|
634
|
+
type: child.type,
|
|
635
|
+
rest: child.rest,
|
|
636
|
+
optional: true
|
|
637
|
+
}) : child)
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
const fp = param;
|
|
641
|
+
return nameSet.has(fp.name) ? _kubb_core.ast.createFunctionParameter({
|
|
642
|
+
name: fp.name,
|
|
643
|
+
type: fp.type,
|
|
644
|
+
rest: fp.rest,
|
|
645
|
+
optional: true
|
|
646
|
+
}) : fp;
|
|
647
|
+
});
|
|
648
|
+
return _kubb_core.ast.createFunctionParameters({ params });
|
|
590
649
|
}
|
|
591
650
|
(0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
592
651
|
const queryKeyTransformer = ({ node, casing }) => {
|
|
652
|
+
if (!node.path) return [];
|
|
593
653
|
const path = new URLPath(node.path, { casing });
|
|
594
654
|
const hasQueryParams = getOperationParameters(node).query.length > 0;
|
|
595
655
|
const hasRequestBody = !!node.requestBody?.content?.[0]?.schema;
|
|
@@ -649,11 +709,12 @@ function buildQueryKeyParamsNode(node, options) {
|
|
|
649
709
|
return wrapWithMaybeRefOrGetter(buildQueryKeyParams(node, options));
|
|
650
710
|
}
|
|
651
711
|
function QueryKey({ name, node, tsResolver, paramsCasing, pathParamsType, typeName, transformer }) {
|
|
652
|
-
const
|
|
712
|
+
const baseParamsNode = buildQueryKeyParamsNode(node, {
|
|
653
713
|
pathParamsType,
|
|
654
714
|
paramsCasing,
|
|
655
715
|
resolver: tsResolver
|
|
656
716
|
});
|
|
717
|
+
const paramsNode = markParamsOptional(baseParamsNode, getEnabledParamNames(baseParamsNode));
|
|
657
718
|
const paramsSignature = declarationPrinter$5.print(paramsNode) ?? "";
|
|
658
719
|
const keys = (transformer ?? queryKeyTransformer)({
|
|
659
720
|
node,
|
|
@@ -710,22 +771,22 @@ function QueryOptions({ name, clientName, dataReturnType, node, tsResolver, para
|
|
|
710
771
|
const errorNames = resolveErrorNames(node, tsResolver);
|
|
711
772
|
const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
|
|
712
773
|
const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
|
|
713
|
-
const paramsNode = getQueryOptionsParams(node, {
|
|
714
|
-
paramsType,
|
|
715
|
-
paramsCasing,
|
|
716
|
-
pathParamsType,
|
|
717
|
-
resolver: tsResolver
|
|
718
|
-
});
|
|
719
|
-
const paramsSignature = declarationPrinter$4.print(paramsNode) ?? "";
|
|
720
|
-
const clientCallStr = (callPrinter$4.print(paramsNode) ?? "").replace(/\bconfig\b(?=[^,]*$)/, "{ ...config, signal: config.signal ?? signal }");
|
|
721
774
|
const queryKeyParamsNode = buildQueryKeyParamsNode(node, {
|
|
722
775
|
pathParamsType,
|
|
723
776
|
paramsCasing,
|
|
724
777
|
resolver: tsResolver
|
|
725
778
|
});
|
|
726
779
|
const queryKeyParamsCall = callPrinter$4.print(queryKeyParamsNode) ?? "";
|
|
727
|
-
const
|
|
728
|
-
const enabledText =
|
|
780
|
+
const enabledNames = getEnabledParamNames(queryKeyParamsNode);
|
|
781
|
+
const enabledText = enabledNames.length ? `enabled: () => ${enabledNames.map((n) => `!!toValue(${n})`).join(" && ")},` : "";
|
|
782
|
+
const paramsNode = markParamsOptional(getQueryOptionsParams(node, {
|
|
783
|
+
paramsType,
|
|
784
|
+
paramsCasing,
|
|
785
|
+
pathParamsType,
|
|
786
|
+
resolver: tsResolver
|
|
787
|
+
}), enabledNames);
|
|
788
|
+
const paramsSignature = declarationPrinter$4.print(paramsNode) ?? "";
|
|
789
|
+
const clientCallStr = (callPrinter$4.print(paramsNode) ?? "").replace(/\bconfig\b(?=[^,]*$)/, "{ ...config, signal: config.signal ?? signal }");
|
|
729
790
|
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Source, {
|
|
730
791
|
name,
|
|
731
792
|
isExportable: true,
|
|
@@ -740,7 +801,7 @@ function QueryOptions({ name, clientName, dataReturnType, node, tsResolver, para
|
|
|
740
801
|
${enabledText}
|
|
741
802
|
queryKey,
|
|
742
803
|
queryFn: async ({ signal }) => {
|
|
743
|
-
return ${clientName}(${addToValueCalls$1(clientCallStr)})
|
|
804
|
+
return ${clientName}(${addToValueCalls$1(clientCallStr, enabledNames)})
|
|
744
805
|
},
|
|
745
806
|
})
|
|
746
807
|
`
|
|
@@ -754,15 +815,16 @@ function QueryOptions({ name, clientName, dataReturnType, node, tsResolver, para
|
|
|
754
815
|
* Handles both inline params (`petId, config`) and object shorthand
|
|
755
816
|
* params (`{ petId }, config`) by expanding to `{ petId: toValue(petId) }`.
|
|
756
817
|
*/
|
|
757
|
-
function addToValueCalls$1(callStr) {
|
|
818
|
+
function addToValueCalls$1(callStr, enabledNames = []) {
|
|
819
|
+
const optional = new Set(enabledNames);
|
|
758
820
|
let result = callStr.replace(/\{\s*([\w,\s]+)\s*\}(?=\s*,)/g, (match, inner) => {
|
|
759
821
|
if (inner.includes(":") || inner.includes("...")) return match;
|
|
760
|
-
return `{ ${inner.split(",").map((k) => k.trim()).filter(Boolean).map((k) => `${k}: toValue(${k})`).join(", ")} }`;
|
|
822
|
+
return `{ ${inner.split(",").map((k) => k.trim()).filter(Boolean).map((k) => `${k}: toValue(${optional.has(k) ? `${k}!` : k})`).join(", ")} }`;
|
|
761
823
|
});
|
|
762
824
|
result = result.replace(/(?<![{.:?])\b(\w+)\b(?=\s*,)/g, (match, name) => {
|
|
763
825
|
if (name === "config" || name === "signal" || name === "undefined") return match;
|
|
764
826
|
if (match.includes("toValue(")) return match;
|
|
765
|
-
return `toValue(${name})`;
|
|
827
|
+
return `toValue(${optional.has(name) ? `${name}!` : name})`;
|
|
766
828
|
});
|
|
767
829
|
return result;
|
|
768
830
|
}
|
|
@@ -822,6 +884,7 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
|
|
|
822
884
|
resolver: tsResolver
|
|
823
885
|
});
|
|
824
886
|
const queryKeyParamsCall = callPrinter$3.print(queryKeyParamsNode) ?? "";
|
|
887
|
+
const enabledNames = getEnabledParamNames(queryKeyParamsNode);
|
|
825
888
|
const queryOptionsParamsNode = getQueryOptionsParams(node, {
|
|
826
889
|
paramsType,
|
|
827
890
|
paramsCasing,
|
|
@@ -829,13 +892,13 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
|
|
|
829
892
|
resolver: tsResolver
|
|
830
893
|
});
|
|
831
894
|
const queryOptionsParamsCall = callPrinter$3.print(queryOptionsParamsNode) ?? "";
|
|
832
|
-
const paramsNode = buildInfiniteQueryParamsNode(node, {
|
|
895
|
+
const paramsNode = markParamsOptional(buildInfiniteQueryParamsNode(node, {
|
|
833
896
|
paramsType,
|
|
834
897
|
paramsCasing,
|
|
835
898
|
pathParamsType,
|
|
836
899
|
dataReturnType,
|
|
837
900
|
resolver: tsResolver
|
|
838
|
-
});
|
|
901
|
+
}), enabledNames);
|
|
839
902
|
const paramsSignature = declarationPrinter$3.print(paramsNode) ?? "";
|
|
840
903
|
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Source, {
|
|
841
904
|
name,
|
|
@@ -887,22 +950,22 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
887
950
|
})() : null;
|
|
888
951
|
const queryParamType = queryParam && queryParamsTypeName ? `${queryParamsTypeName}['${queryParam}']` : null;
|
|
889
952
|
const pageParamType = queryParamType ? isInitialPageParamDefined ? `NonNullable<${queryParamType}>` : queryParamType : fallbackPageParamType;
|
|
890
|
-
const paramsNode = getQueryOptionsParams(node, {
|
|
891
|
-
paramsType,
|
|
892
|
-
paramsCasing,
|
|
893
|
-
pathParamsType,
|
|
894
|
-
resolver: tsResolver
|
|
895
|
-
});
|
|
896
|
-
const paramsSignature = declarationPrinter$2.print(paramsNode) ?? "";
|
|
897
|
-
const clientCallStr = (callPrinter$2.print(paramsNode) ?? "").replace(/\bconfig\b(?=[^,]*$)/, "{ ...config, signal: config.signal ?? signal }");
|
|
898
953
|
const queryKeyParamsNode = buildQueryKeyParamsNode(node, {
|
|
899
954
|
pathParamsType,
|
|
900
955
|
paramsCasing,
|
|
901
956
|
resolver: tsResolver
|
|
902
957
|
});
|
|
903
958
|
const queryKeyParamsCall = callPrinter$2.print(queryKeyParamsNode) ?? "";
|
|
904
|
-
const
|
|
905
|
-
const enabledText =
|
|
959
|
+
const enabledNames = getEnabledParamNames(queryKeyParamsNode);
|
|
960
|
+
const enabledText = enabledNames.length ? `enabled: () => ${enabledNames.map((n) => `!!toValue(${n})`).join(" && ")},` : "";
|
|
961
|
+
const paramsNode = markParamsOptional(getQueryOptionsParams(node, {
|
|
962
|
+
paramsType,
|
|
963
|
+
paramsCasing,
|
|
964
|
+
pathParamsType,
|
|
965
|
+
resolver: tsResolver
|
|
966
|
+
}), enabledNames);
|
|
967
|
+
const paramsSignature = declarationPrinter$2.print(paramsNode) ?? "";
|
|
968
|
+
const clientCallStr = (callPrinter$2.print(paramsNode) ?? "").replace(/\bconfig\b(?=[^,]*$)/, "{ ...config, signal: config.signal ?? signal }");
|
|
906
969
|
const hasNewParams = nextParam != null || previousParam != null;
|
|
907
970
|
const [getNextPageParamExpr, getPreviousPageParamExpr] = (() => {
|
|
908
971
|
if (hasNewParams) {
|
|
@@ -938,7 +1001,7 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
938
1001
|
queryKey,
|
|
939
1002
|
queryFn: async ({ signal, pageParam }) => {
|
|
940
1003
|
${infiniteOverrideParams}
|
|
941
|
-
return ${clientName}(${addToValueCalls(clientCallStr)})
|
|
1004
|
+
return ${clientName}(${addToValueCalls(clientCallStr, enabledNames)})
|
|
942
1005
|
},
|
|
943
1006
|
${queryOptionsArr.join(",\n")}
|
|
944
1007
|
})
|
|
@@ -959,7 +1022,7 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
959
1022
|
${enabledText}
|
|
960
1023
|
queryKey,
|
|
961
1024
|
queryFn: async ({ signal }) => {
|
|
962
|
-
return ${clientName}(${addToValueCalls(clientCallStr)})
|
|
1025
|
+
return ${clientName}(${addToValueCalls(clientCallStr, enabledNames)})
|
|
963
1026
|
},
|
|
964
1027
|
${queryOptionsArr.join(",\n")}
|
|
965
1028
|
})
|
|
@@ -967,15 +1030,16 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
967
1030
|
})
|
|
968
1031
|
});
|
|
969
1032
|
}
|
|
970
|
-
function addToValueCalls(callStr) {
|
|
1033
|
+
function addToValueCalls(callStr, enabledNames = []) {
|
|
1034
|
+
const optional = new Set(enabledNames);
|
|
971
1035
|
let result = callStr.replace(/\{\s*([\w,\s]+)\s*\}(?=\s*,)/g, (match, inner) => {
|
|
972
1036
|
if (inner.includes(":") || inner.includes("...")) return match;
|
|
973
|
-
return `{ ${inner.split(",").map((k) => k.trim()).filter(Boolean).map((k) => `${k}: toValue(${k})`).join(", ")} }`;
|
|
1037
|
+
return `{ ${inner.split(",").map((k) => k.trim()).filter(Boolean).map((k) => `${k}: toValue(${optional.has(k) ? `${k}!` : k})`).join(", ")} }`;
|
|
974
1038
|
});
|
|
975
1039
|
result = result.replace(/(?<![{.:?])\b(\w+)\b(?=\s*,)/g, (match, name) => {
|
|
976
1040
|
if (name === "config" || name === "signal" || name === "undefined") return match;
|
|
977
1041
|
if (match.includes("toValue(")) return match;
|
|
978
|
-
return `toValue(${name})`;
|
|
1042
|
+
return `toValue(${optional.has(name) ? `${name}!` : name})`;
|
|
979
1043
|
});
|
|
980
1044
|
return result;
|
|
981
1045
|
}
|
|
@@ -1144,6 +1208,7 @@ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsT
|
|
|
1144
1208
|
resolver: tsResolver
|
|
1145
1209
|
});
|
|
1146
1210
|
const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? "";
|
|
1211
|
+
const enabledNames = getEnabledParamNames(queryKeyParamsNode);
|
|
1147
1212
|
const queryOptionsParamsNode = getQueryOptionsParams(node, {
|
|
1148
1213
|
paramsType,
|
|
1149
1214
|
paramsCasing,
|
|
@@ -1151,13 +1216,13 @@ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsT
|
|
|
1151
1216
|
resolver: tsResolver
|
|
1152
1217
|
});
|
|
1153
1218
|
const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? "";
|
|
1154
|
-
const paramsNode = buildQueryParamsNode(node, {
|
|
1219
|
+
const paramsNode = markParamsOptional(buildQueryParamsNode(node, {
|
|
1155
1220
|
paramsType,
|
|
1156
1221
|
paramsCasing,
|
|
1157
1222
|
pathParamsType,
|
|
1158
1223
|
dataReturnType,
|
|
1159
1224
|
resolver: tsResolver
|
|
1160
|
-
});
|
|
1225
|
+
}), enabledNames);
|
|
1161
1226
|
const paramsSignature = declarationPrinter.print(paramsNode) ?? "";
|
|
1162
1227
|
return /* @__PURE__ */ (0, _kubb_renderer_jsx_jsx_runtime.jsx)(_kubb_renderer_jsx.File.Source, {
|
|
1163
1228
|
name,
|
|
@@ -1260,6 +1325,12 @@ Object.defineProperty(exports, "mutationKeyTransformer", {
|
|
|
1260
1325
|
return mutationKeyTransformer;
|
|
1261
1326
|
}
|
|
1262
1327
|
});
|
|
1328
|
+
Object.defineProperty(exports, "operationFileEntry", {
|
|
1329
|
+
enumerable: true,
|
|
1330
|
+
get: function() {
|
|
1331
|
+
return operationFileEntry;
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1263
1334
|
Object.defineProperty(exports, "queryKeyTransformer", {
|
|
1264
1335
|
enumerable: true,
|
|
1265
1336
|
get: function() {
|
|
@@ -1279,4 +1350,4 @@ Object.defineProperty(exports, "resolveZodSchemaNames", {
|
|
|
1279
1350
|
}
|
|
1280
1351
|
});
|
|
1281
1352
|
|
|
1282
|
-
//# sourceMappingURL=components-
|
|
1353
|
+
//# sourceMappingURL=components-B6lPYyOP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-B6lPYyOP.cjs","names":["#options","#transformParam","#eachParam","ast","declarationPrinter","ast","File","Function","ast","declarationPrinter","ast","declarationPrinter","File","Function","Type","declarationPrinter","callPrinter","ast","File","Function","addToValueCalls","declarationPrinter","callPrinter","ast","File","Function","getComments","declarationPrinter","callPrinter","File","Function","declarationPrinter","callPrinter","ast","File","Function","getComments","ast","File","Function","getComments"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/object.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../../../internals/shared/src/operation.ts","../../../internals/tanstack-query/src/components/MutationKey.tsx","../../../internals/tanstack-query/src/utils.ts","../../../internals/tanstack-query/src/components/QueryKey.tsx","../src/utils.ts","../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/InfiniteQuery.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/Mutation.tsx","../src/components/Query.tsx"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | null {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n 'Array',\n 'Date',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n] as const)\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status') // true\n * isValidVarName('class') // false (reserved word)\n * isValidVarName('42foo') // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n if (!name || reservedWords.has(name as 'valueOf')) {\n return false\n }\n return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n}\n\n/**\n * Returns `name` when it's a syntactically valid JavaScript variable name,\n * otherwise prefixes it with `_` so the result is a valid identifier.\n *\n * Useful for sanitizing OpenAPI schema names or operation IDs that start with\n * a digit (e.g. `409`, `504AccountCancel`) before using them as exported\n * variable, type, or function names.\n *\n * @example\n * ```ts\n * ensureValidVarName('409') // '_409'\n * ensureValidVarName('504AccountCancel') // '_504AccountCancel'\n * ensureValidVarName('Pet') // 'Pet'\n * ensureValidVarName('class') // '_class'\n * ```\n */\nexport function ensureValidVarName(name: string): string {\n if (!name || isValidVarName(name)) {\n return name\n }\n return `_${name}`\n}\n","import { camelCase } from './casing.ts'\nimport { isValidVarName } from './reserved.ts'\n\nexport type URLObject = {\n /**\n * The resolved URL string (Express-style or template literal, depending on context).\n */\n url: string\n /**\n * Extracted path parameters as a key-value map, or `null` when the path has none.\n */\n params: Record<string, string> | null\n}\n\ntype ObjectOptions = {\n /**\n * Controls whether the `url` is rendered as an Express path or a template literal.\n * @default 'path'\n */\n type?: 'path' | 'template'\n /**\n * Optional transform applied to each extracted parameter name.\n */\n replacer?: (pathParam: string) => string\n /**\n * When `true`, the result is serialized to a string expression instead of a plain object.\n */\n stringify?: boolean\n}\n\n/**\n * Supported identifier casing strategies for path parameters.\n */\ntype PathCasing = 'camelcase'\n\ntype Options = {\n /**\n * Casing strategy applied to path parameter names.\n * @default undefined (original identifier preserved)\n */\n casing?: PathCasing\n}\n\n/**\n * Parses and transforms an OpenAPI/Swagger path string into various URL formats.\n *\n * @example\n * const p = new URLPath('/pet/{petId}')\n * p.URL // '/pet/:petId'\n * p.template // '`/pet/${petId}`'\n */\nexport class URLPath {\n /**\n * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.\n */\n path: string\n\n #options: Options\n\n constructor(path: string, options: Options = {}) {\n this.path = path\n this.#options = options\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').URL // '/pet/:petId'\n * ```\n */\n get URL(): string {\n return this.toURLPath()\n }\n\n /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).\n *\n * @example\n * ```ts\n * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true\n * new URLPath('/pet/{petId}').isURL // false\n * ```\n */\n get isURL(): boolean {\n try {\n return !!new URL(this.path).href\n } catch {\n return false\n }\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n *\n * @example\n * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'\n * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'\n */\n get template(): string {\n return this.toTemplateString()\n }\n\n /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').object\n * // { url: '/pet/:petId', params: { petId: 'petId' } }\n * ```\n */\n get object(): URLObject | string {\n return this.toObject()\n }\n\n /** Returns a map of path parameter names, or `null` when the path has no parameters.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').params // { petId: 'petId' }\n * new URLPath('/pet').params // null\n * ```\n */\n get params(): Record<string, string> | null {\n return this.toParamsObject()\n }\n\n #transformParam(raw: string): string {\n const param = isValidVarName(raw) ? raw : camelCase(raw)\n return this.#options.casing === 'camelcase' ? camelCase(param) : param\n }\n\n /**\n * Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.\n */\n #eachParam(fn: (raw: string, param: string) => undefined): undefined {\n for (const match of this.path.matchAll(/\\{([^}]+)\\}/g)) {\n const raw = match[1]!\n fn(raw, this.#transformParam(raw))\n }\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }),\n params: this.toParamsObject(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n * An optional `replacer` can transform each extracted parameter name before interpolation.\n *\n * @example\n * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'\n */\n toTemplateString({ prefix, replacer }: { prefix?: string | null; replacer?: (pathParam: string) => string } = {}): string {\n const parts = this.path.split(/\\{([^}]+)\\}/)\n const result = parts\n .map((part, i) => {\n if (i % 2 === 0) return part\n const param = this.#transformParam(part)\n return `\\${${replacer ? replacer(param) : param}}`\n })\n .join('')\n\n return `\\`${prefix ?? ''}${result}\\``\n }\n\n /**\n * Extracts all `{param}` segments from the path and returns them as a key-value map.\n * An optional `replacer` transforms each parameter name in both key and value positions.\n * Returns `undefined` when no path parameters are found.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}/tag/{tagId}').toParamsObject()\n * // { petId: 'petId', tagId: 'tagId' }\n * ```\n */\n toParamsObject(replacer?: (pathParam: string) => string): Record<string, string> | null {\n const params: Record<string, string> = {}\n\n this.#eachParam((_raw, param) => {\n const key = replacer ? replacer(param) : param\n params[key] = key\n })\n\n return Object.keys(params).length > 0 ? params : null\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'\n * ```\n */\n toURLPath(): string {\n return this.path.replace(/\\{([^}]+)\\}/g, ':$1')\n }\n}\n","import { URLPath } from '@internals/utils'\nimport { ast, type ResolverFileParams } from '@kubb/core'\n\n/**\n * Builds the `ResolverFileParams` every operation generator passes to\n * `resolver.resolveFile`: a file named `name`, tagged by the operation's first\n * tag (or `'default'`), at the operation's path. Centralizes the entry object\n * that was repeated at dozens of call sites across the client and query plugins.\n *\n * @example\n * ```ts\n * resolver.resolveFile(operationFileEntry(node, node.operationId), { root, output, group })\n * ```\n */\nexport function operationFileEntry(node: ast.OperationNode, name: string, extname: ResolverFileParams['extname'] = '.ts'): ResolverFileParams {\n return {\n name,\n extname,\n tag: node.tags[0] ?? 'default',\n path: node.path,\n }\n}\n\nexport type ContentTypeInfo = {\n contentTypes: string[]\n isMultipleContentTypes: boolean\n contentTypeUnion: string\n defaultContentType: string\n hasFormData: boolean\n}\n\nexport type RequestConfigResolver = {\n resolveDataName(node: ast.OperationNode): string\n}\n\nexport type ResponseStatusNameResolver = {\n resolveResponseStatusName(node: ast.OperationNode, statusCode: ast.StatusCode): string\n}\n\nexport type ResponseNameResolver = ResponseStatusNameResolver & {\n resolveResponseName(node: ast.OperationNode): string\n}\n\nexport type OperationTypeNameResolver = RequestConfigResolver &\n ResponseNameResolver & {\n resolvePathParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n resolveQueryParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n resolveHeaderParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n }\n\nexport type OperationCommentLink = 'pathTemplate' | 'urlPath' | false | ((node: ast.OperationNode) => string | undefined)\n\nexport type BuildOperationCommentsOptions = {\n link?: OperationCommentLink\n linkPosition?: 'beforeDeprecated' | 'afterDeprecated'\n splitLines?: boolean\n}\n\ntype ResponseLike = {\n statusCode: ast.StatusCode | number | string\n}\n\nexport type OperationParameterGroups = Record<ast.ParameterNode['in'], Array<ast.ParameterNode>>\n\nexport type ResolveOperationTypeNameOptions = {\n paramsCasing?: 'camelcase'\n responseStatusNames?: boolean | 'error'\n exclude?: ReadonlyArray<string | undefined>\n order?: 'params-first' | 'body-response-first'\n}\n\nfunction getOperationLink(node: ast.OperationNode, link: OperationCommentLink): string | null {\n if (!link) {\n return null\n }\n\n if (typeof link === 'function') {\n return link(node) ?? null\n }\n\n if (link === 'urlPath') {\n return node.path ? `{@link ${new URLPath(node.path).URL}}` : null\n }\n\n return node.path ? `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}` : null\n}\n\nexport function getContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n const contentTypes = node.requestBody?.content?.map((e) => e.contentType) ?? []\n const isMultipleContentTypes = contentTypes.length > 1\n\n return {\n contentTypes,\n isMultipleContentTypes,\n contentTypeUnion: isMultipleContentTypes ? contentTypes.map((ct) => JSON.stringify(ct)).join(' | ') : '',\n defaultContentType: contentTypes[0] ?? 'application/json',\n hasFormData: contentTypes.some((ct) => ct === 'multipart/form-data'),\n }\n}\n\nexport type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n\n/**\n * Derives the default `responseType` for an operation from its primary success response.\n *\n * Returns a value only when that response declares a single non-JSON content type — a binary type\n * (`application/octet-stream`, `application/pdf`, `image/*`, `audio/*`, `video/*`) maps to `'blob'`\n * and other `text/*` maps to `'text'`. Otherwise `undefined`, leaving the runtime client's\n * `Content-Type` auto-detection in charge.\n */\nexport function getResponseType(node: ast.OperationNode): ResponseType | undefined {\n const contentTypes = getPrimarySuccessResponse(node)?.content?.map((entry) => entry.contentType) ?? []\n if (contentTypes.length !== 1) return undefined\n\n const baseType = contentTypes[0]!.split(';')[0]!.trim().toLowerCase()\n if (baseType === 'application/json' || baseType.endsWith('+json') || baseType === 'text/json') return undefined\n if (baseType.startsWith('text/')) return 'text'\n if (baseType === 'application/octet-stream' || baseType === 'application/pdf' || /^(image|audio|video)\\//.test(baseType)) return 'blob'\n return undefined\n}\n\n/**\n * Maps a content type to the PascalCase suffix used to name per-content-type variants\n * (e.g. `application/json` → `Json`, `application/xml` → `Xml`, `multipart/form-data` → `FormData`).\n */\nexport function getContentTypeSuffix(contentType: string): string {\n const baseType = contentType.split(';')[0]!.trim()\n if (baseType === 'application/json') return 'Json'\n if (baseType === 'multipart/form-data') return 'FormData'\n if (baseType === 'application/x-www-form-urlencoded') return 'FormUrlEncoded'\n const subtype = baseType.split('/').pop() ?? baseType\n const parts = subtype.split(/[^a-zA-Z0-9]+/).filter(Boolean)\n if (parts.length === 0) return 'Unknown'\n return parts.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join('')\n}\n\n/**\n * Appends a content-type suffix to a base name, keeping a trailing `Data` segment last\n * (e.g. `AddPetData` + `Json` → `AddPetJsonData`, `AddPetStatus200` + `Xml` → `AddPetStatus200Xml`).\n */\nexport function getPerContentTypeName(baseName: string, suffix: string): string {\n if (baseName.endsWith('Data')) {\n return suffix.endsWith('Data') ? baseName.slice(0, -4) + suffix : `${baseName.slice(0, -4)}${suffix}Data`\n }\n return baseName + suffix\n}\n\nexport type ContentVariantInput = { contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }\nexport type ContentVariant = { name: string; suffix: string; schema: ast.SchemaNode; keysToOmit?: Array<string> | null; contentType: string }\n\n/**\n * Resolves per-content-type variant names for a set of content entries, deduplicating suffix\n * collisions with a numeric counter. Entries without a schema are skipped. The returned `suffix` is\n * the final (possibly counter-augmented) value, so callers can derive parallel names in another\n * namespace (e.g. plugin-faker deriving the matching plugin-ts type name).\n */\nexport function resolveContentTypeVariants(entries: Array<ContentVariantInput>, baseName: string): Array<ContentVariant> {\n const usedNames = new Set<string>()\n return entries\n .filter((entry) => entry.schema)\n .map((entry) => {\n const baseSuffix = getContentTypeSuffix(entry.contentType)\n let suffix = baseSuffix\n let name = getPerContentTypeName(baseName, suffix)\n let counter = 2\n while (usedNames.has(name)) {\n suffix = `${baseSuffix}${counter++}`\n name = getPerContentTypeName(baseName, suffix)\n }\n usedNames.add(name)\n return { name, suffix, schema: entry.schema!, keysToOmit: entry.keysToOmit, contentType: entry.contentType }\n })\n}\n\nexport function buildRequestConfigType(node: ast.OperationNode, resolver: RequestConfigResolver): string {\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n const { isMultipleContentTypes, contentTypeUnion } = getContentTypeInfo(node)\n const configType = requestName ? `Partial<RequestConfig<${requestName}>>` : 'Partial<RequestConfig>'\n const configProps = ['client?: Client', isMultipleContentTypes ? `contentType?: ${contentTypeUnion}` : null].filter(Boolean).join('; ')\n\n return `${configType} & { ${configProps} }`\n}\n\nexport function buildOperationComments(node: ast.OperationNode, options: BuildOperationCommentsOptions = {}): Array<string> {\n const { link = 'pathTemplate', linkPosition = 'afterDeprecated', splitLines = false } = options\n const linkComment = getOperationLink(node, link)\n const comments =\n linkPosition === 'beforeDeprecated'\n ? [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, linkComment, node.deprecated && '@deprecated']\n : [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, node.deprecated && '@deprecated', linkComment]\n\n const filteredComments = comments.filter((comment): comment is string => Boolean(comment))\n\n if (!splitLines) {\n return filteredComments\n }\n\n return filteredComments.flatMap((text) => text.split(/\\r?\\n/).map((line) => line.trim())).filter((comment): comment is string => Boolean(comment))\n}\n\nexport function getOperationParameters(node: ast.OperationNode, options: { paramsCasing?: 'camelcase' } = {}): OperationParameterGroups {\n const params = ast.caseParams(node.parameters, options.paramsCasing)\n\n return {\n path: params.filter((param) => param.in === 'path'),\n query: params.filter((param) => param.in === 'query'),\n header: params.filter((param) => param.in === 'header'),\n cookie: params.filter((param) => param.in === 'cookie'),\n }\n}\n\nexport function getStatusCodeNumber(statusCode: ast.StatusCode | number | string): number | null {\n const code = Number(statusCode)\n\n return Number.isNaN(code) ? null : code\n}\n\nexport function isSuccessStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n const code = getStatusCodeNumber(statusCode)\n\n return code !== null && code >= 200 && code < 300\n}\n\nexport function isErrorStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n const code = getStatusCodeNumber(statusCode)\n\n return code !== null && code >= 400\n}\n\nexport function getSuccessResponses<TResponse extends ResponseLike>(responses: ReadonlyArray<TResponse>): Array<TResponse> {\n return responses.filter((response) => isSuccessStatusCode(response.statusCode))\n}\n\nexport function getOperationSuccessResponses(node: ast.OperationNode): Array<ast.ResponseNode> {\n return getSuccessResponses(node.responses)\n}\n\nexport function getPrimarySuccessResponse(node: ast.OperationNode): ast.ResponseNode | null {\n return getOperationSuccessResponses(node)[0] ?? null\n}\n\nexport function resolveErrorNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses\n .filter((response) => isErrorStatusCode(response.statusCode))\n .map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nexport function resolveSuccessNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses\n .filter((response) => isSuccessStatusCode(response.statusCode))\n .map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nexport function resolveStatusCodeNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses.map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nconst typeNamesByResolver = new WeakMap<OperationTypeNameResolver, Map<string, string[]>>()\n\nexport function resolveOperationTypeNames(\n node: ast.OperationNode,\n resolver: OperationTypeNameResolver,\n options: ResolveOperationTypeNameOptions = {},\n): string[] {\n const cacheKey = `${node.operationId}\\0${options.paramsCasing ?? ''}\\0${options.order ?? ''}\\0${options.responseStatusNames ?? ''}\\0${(options.exclude ?? []).join(',')}`\n let byResolver = typeNamesByResolver.get(resolver)\n if (byResolver) {\n const cached = byResolver.get(cacheKey)\n if (cached) return cached\n } else {\n byResolver = new Map()\n typeNamesByResolver.set(resolver, byResolver)\n }\n\n const { path, query, header } = getOperationParameters(node, { paramsCasing: options.paramsCasing })\n const responseStatusNames =\n options.responseStatusNames === 'error'\n ? resolveErrorNames(node, resolver)\n : options.responseStatusNames === false\n ? []\n : resolveStatusCodeNames(node, resolver)\n const exclude = new Set(options.exclude ?? [])\n const paramNames = [\n ...path.map((param) => resolver.resolvePathParamsName(node, param)),\n ...query.map((param) => resolver.resolveQueryParamsName(node, param)),\n ...header.map((param) => resolver.resolveHeaderParamsName(node, param)),\n ]\n const bodyAndResponseNames = [node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null, resolver.resolveResponseName(node)]\n const names =\n options.order === 'body-response-first'\n ? [...bodyAndResponseNames, ...paramNames, ...responseStatusNames]\n : [...paramNames, ...bodyAndResponseNames, ...responseStatusNames]\n\n const result = names.filter((name): name is string => Boolean(name) && !exclude.has(name as string))\n byResolver.set(cacheKey, result)\n return result\n}\n\nexport function resolveResponseTypes(node: ast.OperationNode, resolver: ResponseNameResolver): Array<[statusCode: number | 'default', typeName: string]> {\n const types: Array<[number | 'default', string]> = []\n\n for (const response of node.responses) {\n if (response.statusCode === 'default') {\n types.push(['default', resolver.resolveResponseName(node)])\n continue\n }\n\n const code = getStatusCodeNumber(response.statusCode)\n if (code === null) {\n continue\n }\n\n types.push([code, isSuccessStatusCode(code) ? resolver.resolveResponseName(node) : resolver.resolveResponseStatusName(node, response.statusCode)])\n }\n\n return types\n}\n\nexport function findSuccessStatusCode(responses: Array<{ statusCode: ast.StatusCode | number | string }>): ast.StatusCode | null {\n for (const response of responses) {\n if (isSuccessStatusCode(response.statusCode)) {\n return response.statusCode as ast.StatusCode\n }\n }\n\n return null\n}\n","import { URLPath } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { Transformer } from '../types.ts'\n\ntype Props = {\n name: string\n node: ast.OperationNode\n paramsCasing: 'camelcase' | undefined\n pathParamsType: 'object' | 'inline'\n transformer: Transformer | null | undefined\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport const mutationKeyTransformer: Transformer = ({ node, casing }) => {\n if (!node.path) return []\n const path = new URLPath(node.path, { casing })\n return [`{ url: '${path.toURLPath()}' }`]\n}\n\nexport function MutationKey({ name, paramsCasing, node, transformer }: Props): KubbReactNode {\n const paramsNode = ast.createFunctionParameters({ params: [] })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const keys = (transformer ?? mutationKeyTransformer)({ node, casing: paramsCasing })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={paramsSignature} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n )\n}\n","import { ast } from '@kubb/core'\nimport type { PluginTs } from '@kubb/plugin-ts'\n\nexport function transformName(name: string, type: string, transformers?: { name?: (name: string, type?: string) => string }): string {\n return transformers?.name?.(name, type) || name\n}\n\ntype OverrideEntry<TOptions> = {\n type: string\n pattern: string | RegExp\n options?: Partial<TOptions>\n}\n\nfunction matchesPattern(node: ast.OperationNode, ov: { type: string; pattern: string | RegExp }): boolean {\n const { type, pattern } = ov\n const matches = (value: string) => (typeof pattern === 'string' ? value === pattern : pattern.test(value))\n if (type === 'operationId') return matches(node.operationId)\n if (type === 'tag') return node.tags.some((t) => matches(t))\n if (type === 'path') return node.path !== undefined && matches(node.path)\n if (type === 'method') return node.method !== undefined && matches(node.method)\n return false\n}\n\n/**\n * Resolves per-operation overrides (first matching override wins).\n *\n * @example\n * ```ts\n * const opts = resolveOperationOverrides(node, override)\n * const queryOpts = 'query' in opts ? opts.query : defaultQuery\n * ```\n */\nexport function resolveOperationOverrides<TOptions>(node: ast.OperationNode, override?: ReadonlyArray<OverrideEntry<TOptions>>): Partial<TOptions> {\n if (!override) return {}\n const match = override.find((ov) => matchesPattern(node, ov))\n return match?.options ?? {}\n}\n\ntype ZodSchemaNameResolverLike = {\n resolveResponseName?: (node: ast.OperationNode) => string | undefined\n resolveDataName?: (node: ast.OperationNode) => string | undefined\n}\n\n/**\n * Collects the Zod schema import names for an operation (response + request body).\n *\n * Returns an empty array when no resolver is provided or the operation has no request body schema.\n */\nexport function resolveZodSchemaNames(node: ast.OperationNode, zodResolver: ZodSchemaNameResolverLike | null | undefined): string[] {\n if (!zodResolver) return []\n return [zodResolver.resolveResponseName?.(node), node.requestBody?.content?.[0]?.schema ? zodResolver.resolveDataName?.(node) : null].filter(\n (n): n is string => Boolean(n),\n )\n}\n\n/**\n * Resolve the type for a single path parameter.\n *\n * - When the resolver's group name differs from the individual param name\n * (e.g. kubbV4) → `GroupName['paramName']` (member access).\n * - When they match (v5 default) → `TypeName` (direct reference).\n */\nexport function resolvePathParamType(node: ast.OperationNode, param: ast.ParameterNode, resolver: PluginTs['resolver']): ast.ParamsTypeNode {\n const individualName = resolver.resolveParamName(node, param)\n const groupName = resolver.resolvePathParamsName(node, param)\n\n if (groupName !== individualName) {\n return ast.createParamsType({ variant: 'member', base: groupName, key: param.name })\n }\n return ast.createParamsType({ variant: 'reference', name: individualName })\n}\n\ntype QueryGroupResult = { type: ast.ParamsTypeNode; optional: boolean } | null\n\n/**\n * Derive a query-params group type from the resolver.\n * Returns `null` when no query params exist or when the group name\n * equals the individual param name (no real group).\n */\nexport function resolveQueryGroupType(node: ast.OperationNode, params: ast.ParameterNode[], resolver: PluginTs['resolver']): QueryGroupResult {\n if (!params.length) return null\n const firstParam = params[0]!\n const groupName = resolver.resolveQueryParamsName(node, firstParam)\n if (groupName === resolver.resolveParamName(node, firstParam)) return null\n return { type: ast.createParamsType({ variant: 'reference', name: groupName }), optional: params.every((p) => !p.required) }\n}\n\n/**\n * Derive a header-params group type from the resolver.\n */\nexport function resolveHeaderGroupType(node: ast.OperationNode, params: ast.ParameterNode[], resolver: PluginTs['resolver']): QueryGroupResult {\n if (!params.length) return null\n const firstParam = params[0]!\n const groupName = resolver.resolveHeaderParamsName(node, firstParam)\n if (groupName === resolver.resolveParamName(node, firstParam)) return null\n return { type: ast.createParamsType({ variant: 'reference', name: groupName }), optional: params.every((p) => !p.required) }\n}\n\n/**\n * Build a single `FunctionParameterNode` for a query or header group.\n */\nexport function buildGroupParam(\n name: string,\n node: ast.OperationNode,\n params: ast.ParameterNode[],\n groupType: QueryGroupResult,\n resolver: PluginTs['resolver'],\n): ast.FunctionParameterNode[] {\n if (groupType) {\n return [ast.createFunctionParameter({ name, type: groupType.type, optional: groupType.optional })]\n }\n if (params.length) {\n const structProps = params.map((p) => ({\n name: p.name,\n type: ast.createParamsType({ variant: 'reference', name: resolver.resolveParamName(node, p) }),\n optional: !p.required,\n }))\n return [\n ast.createFunctionParameter({\n name,\n type: ast.createParamsType({ variant: 'struct', properties: structProps }),\n optional: params.every((p) => !p.required),\n }),\n ]\n }\n return []\n}\n\n/**\n * Build QueryKey params: pathParams + data + queryParams (NO headers, NO config).\n */\nexport function buildQueryKeyParams(\n node: ast.OperationNode,\n options: {\n pathParamsType: 'object' | 'inline'\n paramsCasing: 'camelcase' | undefined\n resolver: PluginTs['resolver']\n },\n): ast.FunctionParametersNode {\n const { pathParamsType, paramsCasing, resolver } = options\n\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n\n const queryGroupType = resolveQueryGroupType(node, queryParams, resolver)\n\n const bodyType = node.requestBody?.content?.[0]?.schema ? ast.createParamsType({ variant: 'reference', name: resolver.resolveDataName(node) }) : null\n const bodyRequired = node.requestBody?.required ?? false\n\n const params: Array<ast.FunctionParameterNode | ast.ParameterGroupNode> = []\n\n // Path params\n if (pathParams.length) {\n const pathChildren = pathParams.map((p) =>\n ast.createFunctionParameter({ name: p.name, type: resolvePathParamType(node, p, resolver), optional: !p.required }),\n )\n params.push({\n kind: 'ParameterGroup',\n properties: pathChildren,\n inline: pathParamsType === 'inline',\n default: pathChildren.every((c) => c.optional) ? '{}' : undefined,\n })\n }\n\n // Request body\n if (bodyType) {\n params.push(ast.createFunctionParameter({ name: 'data', type: bodyType, optional: !bodyRequired }))\n }\n\n // Query params\n params.push(...buildGroupParam('params', node, queryParams, queryGroupType, resolver))\n\n return ast.createFunctionParameters({ params })\n}\n\n/**\n * Collect the names of the required params (no default) that drive the `enabled`\n * guard. These are exactly the params that should be made optional in the\n * generated signatures so callers can pass `undefined` to reach the disabled state.\n */\nexport function getEnabledParamNames(paramsNode: ast.FunctionParametersNode): string[] {\n const required: string[] = []\n for (const param of paramsNode.params) {\n if ('kind' in param && (param as ast.ParameterGroupNode).kind === 'ParameterGroup') {\n const group = param as ast.ParameterGroupNode\n for (const child of group.properties) {\n if (!child.optional && child.default === undefined) {\n required.push(child.name)\n }\n }\n } else {\n const fp = param as ast.FunctionParameterNode\n if (!fp.optional && fp.default === undefined) {\n required.push(fp.name)\n }\n }\n }\n return required\n}\n\n/**\n * Return a copy of `paramsNode` with the named params marked optional.\n *\n * Used to align signatures with the `enabled` guard: the guard already disables\n * the query while a param is falsy, so the param should accept `undefined`. The\n * change is type-only — the `queryFn` keeps calling the client with a non-null\n * assertion (see `injectNonNullAssertions`), so the emitted runtime is unchanged.\n */\nexport function markParamsOptional(paramsNode: ast.FunctionParametersNode, names: ReadonlyArray<string>): ast.FunctionParametersNode {\n if (names.length === 0) return paramsNode\n const nameSet = new Set(names)\n const params = paramsNode.params.map((param) => {\n if ('kind' in param && (param as ast.ParameterGroupNode).kind === 'ParameterGroup') {\n const group = param as ast.ParameterGroupNode\n return {\n ...group,\n properties: group.properties.map((child) =>\n nameSet.has(child.name) ? ast.createFunctionParameter({ name: child.name, type: child.type, rest: child.rest, optional: true }) : child,\n ),\n }\n }\n const fp = param as ast.FunctionParameterNode\n return nameSet.has(fp.name) ? ast.createFunctionParameter({ name: fp.name, type: fp.type, rest: fp.rest, optional: true }) : fp\n })\n return ast.createFunctionParameters({ params })\n}\n\n/**\n * Add a non-null assertion (`!`) to the named params inside a printed client-call\n * string. Bridges the type gap created by `markParamsOptional` while keeping the\n * runtime identical (the `!` is erased at compile time).\n *\n * Handles destructured shorthand groups (`{ petId }` → `{ petId: petId! }`) and\n * standalone identifiers (`params` → `params!`).\n */\nexport function injectNonNullAssertions(callStr: string, names: ReadonlyArray<string>): string {\n if (names.length === 0) return callStr\n const nameSet = new Set(names)\n\n // Step 1: destructured shorthand group `{ petId }` → `{ petId: petId! }`\n let result = callStr.replace(/\\{\\s*([\\w,\\s]+)\\s*\\}(?=\\s*,)/g, (match, inner: string) => {\n if (inner.includes(':') || inner.includes('...')) return match\n const keys = inner\n .split(',')\n .map((k: string) => k.trim())\n .filter(Boolean)\n if (!keys.some((k) => nameSet.has(k))) return match\n const rebuilt = keys.map((k) => (nameSet.has(k) ? `${k}: ${k}!` : k)).join(', ')\n return `{ ${rebuilt} }`\n })\n\n // Step 2: standalone identifiers like `params`, `data`\n result = result.replace(/(?<![{.:?])\\b(\\w+)\\b(?=\\s*,)/g, (match, name: string) => (nameSet.has(name) ? `${name}!` : match))\n\n return result\n}\n","import { getOperationParameters } from '@internals/shared'\nimport { URLPath } from '@internals/utils'\nimport type { ast } from '@kubb/core'\nimport type { PluginTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function, Type } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { Transformer } from '../types.ts'\nimport { buildQueryKeyParams, getEnabledParamNames, markParamsOptional } from '../utils.ts'\n\ntype Props = {\n name: string\n typeName: string\n node: ast.OperationNode\n tsResolver: PluginTs['resolver']\n paramsCasing: 'camelcase' | undefined\n pathParamsType: 'object' | 'inline'\n transformer: Transformer | null | undefined\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport const queryKeyTransformer: Transformer = ({ node, casing }) => {\n if (!node.path) return []\n const path = new URLPath(node.path, { casing })\n const hasQueryParams = getOperationParameters(node).query.length > 0\n const hasRequestBody = !!node.requestBody?.content?.[0]?.schema\n\n return [\n path.toObject({ type: 'path', stringify: true }),\n hasQueryParams ? '...(params ? [params] : [])' : null,\n hasRequestBody ? '...(data ? [data] : [])' : null,\n ].filter(Boolean) as string[]\n}\n\nexport function QueryKey({ name, node, tsResolver, paramsCasing, pathParamsType, typeName, transformer }: Props): KubbReactNode {\n const baseParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const paramsNode = markParamsOptional(baseParamsNode, getEnabledParamNames(baseParamsNode))\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const keys = (transformer ?? queryKeyTransformer)({ node, casing: paramsCasing })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={paramsSignature} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isTypeOnly>\n <Type name={typeName}>{`ReturnType<typeof ${name}>`}</Type>\n </File.Source>\n </>\n )\n}\n","export {\n buildGroupParam,\n buildQueryKeyParams,\n resolveHeaderGroupType,\n resolveOperationOverrides,\n resolvePathParamType,\n resolveQueryGroupType,\n resolveZodSchemaNames,\n} from '@internals/tanstack-query'\nexport {\n buildOperationComments as getComments,\n buildRequestConfigType,\n getContentTypeInfo,\n resolveErrorNames,\n resolveStatusCodeNames,\n resolveSuccessNames,\n} from '@internals/shared'\n\nimport { ast } from '@kubb/core'\n\nexport function printType(typeNode: ast.ParamsTypeNode | undefined): string {\n if (!typeNode) return 'unknown'\n if (typeNode.variant === 'reference') return typeNode.name\n if (typeNode.variant === 'member') return `${typeNode.base}['${typeNode.key}']`\n if (typeNode.variant === 'struct') {\n const parts = typeNode.properties.map((p) => {\n const typeStr = printType(p.type)\n const key = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(p.name) ? p.name : JSON.stringify(p.name)\n return p.optional ? `${key}?: ${typeStr}` : `${key}: ${typeStr}`\n })\n return `{ ${parts.join('; ')} }`\n }\n return 'unknown'\n}\n\nexport function wrapWithMaybeRefOrGetter(paramsNode: ast.FunctionParametersNode, skip?: (name: string) => boolean): ast.FunctionParametersNode {\n const wrappedParams = paramsNode.params.map((param) => {\n if ('kind' in param && (param as ast.ParameterGroupNode).kind === 'ParameterGroup') {\n const group = param as ast.ParameterGroupNode\n return {\n ...group,\n properties: group.properties.map((p) => ({\n ...p,\n type: p.type ? ast.createParamsType({ variant: 'reference', name: `MaybeRefOrGetter<${printType(p.type)}>` }) : p.type,\n })),\n }\n }\n const fp = param as ast.FunctionParameterNode\n if (skip?.(fp.name)) return fp\n return {\n ...fp,\n type: fp.type ? ast.createParamsType({ variant: 'reference', name: `MaybeRefOrGetter<${printType(fp.type)}>` }) : fp.type,\n }\n })\n return ast.createFunctionParameters({ params: wrappedParams })\n}\n","import type { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function, Type } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport { getEnabledParamNames, markParamsOptional, queryKeyTransformer } from '@internals/tanstack-query'\nimport type { Transformer } from '../types.ts'\nimport { buildQueryKeyParams, wrapWithMaybeRefOrGetter } from '../utils.ts'\n\ntype Props = {\n name: string\n typeName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: 'camelcase' | undefined\n pathParamsType: 'object' | 'inline'\n transformer: Transformer | null | undefined\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport function buildQueryKeyParamsNode(\n node: ast.OperationNode,\n options: { pathParamsType: 'object' | 'inline'; paramsCasing: 'camelcase' | undefined; resolver: ResolverTs },\n): ast.FunctionParametersNode {\n return wrapWithMaybeRefOrGetter(buildQueryKeyParams(node, options))\n}\n\nexport function QueryKey({ name, node, tsResolver, paramsCasing, pathParamsType, typeName, transformer }: Props): KubbReactNode {\n const baseParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const paramsNode = markParamsOptional(baseParamsNode, getEnabledParamNames(baseParamsNode))\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const keys = (transformer ?? queryKeyTransformer)({\n node,\n casing: paramsCasing,\n })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={paramsSignature} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n","import { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport { getEnabledParamNames, markParamsOptional } from '@internals/tanstack-query'\nimport type { PluginVueQuery } from '../types.ts'\nimport { resolveErrorNames, resolveSuccessNames, wrapWithMaybeRefOrGetter } from '../utils.ts'\nimport { buildQueryKeyParamsNode } from './QueryKey.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nexport function getQueryOptionsParams(\n node: ast.OperationNode,\n options: {\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n resolver: ResolverTs\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, resolver } = options\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n\n const baseParams = ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [\n ast.createFunctionParameter({\n name: 'config',\n type: ast.createParamsType({\n variant: 'reference',\n name: requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }',\n }),\n default: '{}',\n }),\n ],\n })\n\n return wrapWithMaybeRefOrGetter(baseParams, (name) => name === 'config')\n}\n\nexport function QueryOptions({\n name,\n clientName,\n dataReturnType,\n node,\n tsResolver,\n paramsCasing,\n paramsType,\n pathParamsType,\n queryKeyName,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const errorNames = resolveErrorNames(node, tsResolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const queryKeyParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const enabledNames = getEnabledParamNames(queryKeyParamsNode)\n const enabledText = enabledNames.length ? `enabled: () => ${enabledNames.map((n) => `!!toValue(${n})`).join(' && ')},` : ''\n\n const paramsNode = markParamsOptional(getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver }), enabledNames)\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const rawParamsCall = callPrinter.print(paramsNode) ?? ''\n\n // Transform: wrap non-config params with toValue(), add signal to config\n const clientCallStr = rawParamsCall.replace(/\\bconfig\\b(?=[^,]*$)/, '{ ...config, signal: config.signal ?? signal }')\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParamsCall})\n return queryOptions<${TData}, ${TError}, ${TData}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n return ${clientName}(${addToValueCalls(clientCallStr, enabledNames)})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\n/**\n * Wraps parameter names with `toValue()` in the client call string,\n * except for 'config'-related params (which are already plain objects).\n *\n * Handles both inline params (`petId, config`) and object shorthand\n * params (`{ petId }, config`) by expanding to `{ petId: toValue(petId) }`.\n */\nfunction addToValueCalls(callStr: string, enabledNames: ReadonlyArray<string> = []): string {\n const optional = new Set(enabledNames)\n // Step 1: Transform shorthand object params like { petId } → { petId: toValue(petId) }\n // Params that drive the `enabled` guard are optional, so assert non-null: toValue(petId!)\n let result = callStr.replace(/\\{\\s*([\\w,\\s]+)\\s*\\}(?=\\s*,)/g, (match, inner: string) => {\n // Only transform simple shorthand (no colons, no spread)\n if (inner.includes(':') || inner.includes('...')) return match\n const keys = inner\n .split(',')\n .map((k: string) => k.trim())\n .filter(Boolean)\n const wrapped = keys.map((k: string) => `${k}: toValue(${optional.has(k) ? `${k}!` : k})`).join(', ')\n return `{ ${wrapped} }`\n })\n\n // Step 2: Handle standalone identifiers like `data, params`\n result = result.replace(/(?<![{.:?])\\b(\\w+)\\b(?=\\s*,)/g, (match, name: string) => {\n if (name === 'config' || name === 'signal' || name === 'undefined') return match\n if (match.includes('toValue(')) return match\n return `toValue(${optional.has(name) ? `${name}!` : name})`\n })\n\n return result\n}\n","import { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { Infinite, PluginVueQuery } from '../types.ts'\nimport { getEnabledParamNames, markParamsOptional } from '@internals/tanstack-query'\nimport { getComments, resolveErrorNames, resolveSuccessNames, wrapWithMaybeRefOrGetter } from '../utils.ts'\nimport { buildQueryKeyParamsNode } from './QueryKey.tsx'\nimport { getQueryOptionsParams } from './QueryOptions.tsx'\n\ntype Props = {\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n queryParam?: Infinite['queryParam']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildInfiniteQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n resolver: ResolverTs\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options\n const successNames = resolveSuccessNames(node, resolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : resolver.resolveResponseName(node)\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n const errorNames = resolveErrorNames(node, resolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const optionsParam = ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}\n}`,\n }),\n default: '{}',\n })\n\n const baseParams = ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\n\n return wrapWithMaybeRefOrGetter(baseParams, (name) => name === 'options')\n}\n\nexport function InfiniteQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const errorNames = resolveErrorNames(node, tsResolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n const returnType = `UseInfiniteQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n const enabledNames = getEnabledParamNames(queryKeyParamsNode)\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = markParamsOptional(\n buildInfiniteQueryParamsNode(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver }),\n enabledNames,\n )\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export generics={generics.join(', ')} params={paramsSignature} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = (resolvedOptions && 'queryKey' in resolvedOptions ? toValue(resolvedOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParamsCall})\n\n const query = useInfiniteQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),\n ...resolvedOptions,\n queryKey\n } as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n","import { getOperationParameters } from '@internals/shared'\nimport { getNestedAccessor } from '@internals/utils'\nimport type { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { Infinite, PluginVueQuery } from '../types.ts'\nimport { resolveErrorNames, resolveSuccessNames } from '../utils.ts'\nimport { buildQueryKeyParamsNode } from './QueryKey.tsx'\nimport { getEnabledParamNames, markParamsOptional } from '@internals/tanstack-query'\nimport { getQueryOptionsParams } from './QueryOptions.tsx'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n cursorParam: Infinite['cursorParam']\n nextParam: Infinite['nextParam']\n previousParam: Infinite['previousParam']\n queryParam: Infinite['queryParam']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nexport function InfiniteQueryOptions({\n name,\n clientName,\n initialPageParam,\n cursorParam,\n nextParam,\n previousParam,\n node,\n tsResolver,\n paramsCasing,\n paramsType,\n dataReturnType,\n pathParamsType,\n queryParam,\n queryKeyName,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const queryFnDataType = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const errorNames = resolveErrorNames(node, tsResolver)\n const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const isInitialPageParamDefined = initialPageParam !== undefined && initialPageParam !== null\n const fallbackPageParamType =\n typeof initialPageParam === 'number'\n ? 'number'\n : typeof initialPageParam === 'string'\n ? initialPageParam.includes(' as ')\n ? (() => {\n const parts = initialPageParam.split(' as ')\n return parts[parts.length - 1] ?? 'unknown'\n })()\n : 'string'\n : typeof initialPageParam === 'boolean'\n ? 'boolean'\n : 'unknown'\n\n const rawQueryParams = getOperationParameters(node).query\n const queryParamsTypeName =\n rawQueryParams.length > 0\n ? (() => {\n const groupName = tsResolver.resolveQueryParamsName(node, rawQueryParams[0]!)\n const individualName = tsResolver.resolveParamName(node, rawQueryParams[0]!)\n return groupName !== individualName ? groupName : null\n })()\n : null\n\n const queryParamType = queryParam && queryParamsTypeName ? `${queryParamsTypeName}['${queryParam}']` : null\n const pageParamType = queryParamType ? (isInitialPageParamDefined ? `NonNullable<${queryParamType}>` : queryParamType) : fallbackPageParamType\n\n const queryKeyParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const enabledNames = getEnabledParamNames(queryKeyParamsNode)\n const enabledText = enabledNames.length ? `enabled: () => ${enabledNames.map((n) => `!!toValue(${n})`).join(' && ')},` : ''\n\n const paramsNode = markParamsOptional(getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver }), enabledNames)\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const rawParamsCall = callPrinter.print(paramsNode) ?? ''\n const clientCallStr = rawParamsCall.replace(/\\bconfig\\b(?=[^,]*$)/, '{ ...config, signal: config.signal ?? signal }')\n\n const hasNewParams = nextParam != null || previousParam != null\n\n const [getNextPageParamExpr, getPreviousPageParamExpr] = (() => {\n if (hasNewParams) {\n const nextAccessor = nextParam ? getNestedAccessor(nextParam, 'lastPage') : null\n const prevAccessor = previousParam ? getNestedAccessor(previousParam, 'firstPage') : null\n return [\n nextAccessor ? `getNextPageParam: (lastPage) => ${nextAccessor}` : null,\n prevAccessor ? `getPreviousPageParam: (firstPage) => ${prevAccessor}` : null,\n ] as const\n }\n if (cursorParam) {\n return [`getNextPageParam: (lastPage) => lastPage['${cursorParam}']`, `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']`] as const\n }\n return [\n dataReturnType === 'full'\n ? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1'\n : 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1',\n 'getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1',\n ] as const\n })()\n\n const queryOptionsArr = [\n `initialPageParam: ${typeof initialPageParam === 'string' ? JSON.stringify(initialPageParam) : initialPageParam}`,\n getNextPageParamExpr,\n getPreviousPageParamExpr,\n ].filter(Boolean)\n\n const infiniteOverrideParams =\n queryParam && queryParamsTypeName\n ? `\n params = {\n ...(params ?? {}),\n ['${queryParam}']: pageParam as unknown as ${queryParamsTypeName}['${queryParam}'],\n } as ${queryParamsTypeName}`\n : ''\n\n if (infiniteOverrideParams) {\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParamsCall})\n return infiniteQueryOptions<${queryFnDataType}, ${errorType}, InfiniteData<${queryFnDataType}>, QueryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n ${infiniteOverrideParams}\n return ${clientName}(${addToValueCalls(clientCallStr, enabledNames)})\n },\n ${queryOptionsArr.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n }\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature}>\n {`\n const queryKey = ${queryKeyName}(${queryKeyParamsCall})\n return infiniteQueryOptions<${queryFnDataType}, ${errorType}, InfiniteData<${queryFnDataType}>, QueryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n return ${clientName}(${addToValueCalls(clientCallStr, enabledNames)})\n },\n ${queryOptionsArr.join(',\\n')}\n })\n`}\n </Function>\n </File.Source>\n )\n}\n\nfunction addToValueCalls(callStr: string, enabledNames: ReadonlyArray<string> = []): string {\n const optional = new Set(enabledNames)\n // Step 1: Transform shorthand object params like { petId } → { petId: toValue(petId) }\n // Params that drive the `enabled` guard are optional, so assert non-null: toValue(petId!)\n let result = callStr.replace(/\\{\\s*([\\w,\\s]+)\\s*\\}(?=\\s*,)/g, (match, inner: string) => {\n if (inner.includes(':') || inner.includes('...')) return match\n const keys = inner\n .split(',')\n .map((k: string) => k.trim())\n .filter(Boolean)\n const wrapped = keys.map((k: string) => `${k}: toValue(${optional.has(k) ? `${k}!` : k})`).join(', ')\n return `{ ${wrapped} }`\n })\n\n // Step 2: Handle standalone identifiers like `data, params`\n result = result.replace(/(?<![{.:?])\\b(\\w+)\\b(?=\\s*,)/g, (match, name: string) => {\n if (name === 'config' || name === 'signal' || name === 'undefined') return match\n if (match.includes('toValue(')) return match\n return `toValue(${optional.has(name) ? `${name}!` : name})`\n })\n\n return result\n}\n","import { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { buildRequestConfigType, getComments, resolveErrorNames, resolveSuccessNames, wrapWithMaybeRefOrGetter } from '../utils.ts'\n\ntype Props = {\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\nconst keysPrinter = functionPrinter({ mode: 'keys' })\n\nfunction createMutationArgParams(\n node: ast.OperationNode,\n options: {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n resolver: ResolverTs\n },\n): ast.FunctionParametersNode {\n return ast.createOperationParams(node, {\n paramsType: 'inline',\n pathParamsType: 'inline',\n paramsCasing: options.paramsCasing,\n resolver: options.resolver,\n })\n}\n\nfunction buildMutationParamsNode(\n node: ast.OperationNode,\n options: {\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n resolver: ResolverTs\n },\n): ast.FunctionParametersNode {\n const { paramsCasing, dataReturnType, resolver } = options\n const successNames = resolveSuccessNames(node, resolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : resolver.resolveResponseName(node)\n const errorNames = resolveErrorNames(node, resolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const mutationArgParamsNode = createMutationArgParams(node, { paramsCasing, resolver })\n\n const wrappedParamsNode = wrapWithMaybeRefOrGetter(mutationArgParamsNode)\n const TRequestWrapped = wrappedParamsNode.params.length > 0 ? (declarationPrinter.print(wrappedParamsNode) ?? '') : ''\n\n return ast.createFunctionParameters({\n params: [\n ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n mutation?: MutationObserverOptions<${[TData, TError, TRequestWrapped ? `{${TRequestWrapped}}` : 'undefined', 'TContext'].join(', ')}> & { client?: QueryClient },\n client?: ${buildRequestConfigType(node, resolver)},\n}`,\n }),\n default: '{}',\n }),\n ],\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n mutationKeyName,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const errorNames = resolveErrorNames(node, tsResolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const mutationArgParamsNode = createMutationArgParams(node, {\n paramsCasing,\n resolver: tsResolver,\n })\n const hasMutationParams = mutationArgParamsNode.params.length > 0\n const TRequest = hasMutationParams ? (declarationPrinter.print(mutationArgParamsNode) ?? '') : ''\n const argKeysStr = hasMutationParams ? (keysPrinter.print(mutationArgParamsNode) ?? '') : ''\n\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'undefined', 'TContext'].join(', ')\n\n const mutationKeyParamsNode = ast.createFunctionParameters({ params: [] })\n const mutationKeyParamsCall = callPrinter.print(mutationKeyParamsNode) ?? ''\n\n const clientCallParamsNode = ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver: tsResolver,\n extraParams: [\n ast.createFunctionParameter({\n name: 'config',\n type: ast.createParamsType({\n variant: 'reference',\n name: buildRequestConfigType(node, tsResolver),\n }),\n default: '{}',\n }),\n ],\n })\n const clientCallStr = callPrinter.print(clientCallParamsNode) ?? ''\n\n const paramsNode = buildMutationParamsNode(node, { paramsCasing, dataReturnType, resolver: tsResolver })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature} JSDoc={{ comments: getComments(node) }} generics={['TContext']}>\n {`\n const { mutation = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...mutationOptions } = mutation;\n const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParamsCall})\n\n return useMutation<${generics}>({\n mutationFn: async(${hasMutationParams ? `{ ${argKeysStr} }` : ''}) => {\n return ${clientName}(${clientCallStr})\n },\n mutationKey,\n ...mutationOptions\n }, queryClient)\n `}\n </Function>\n </File.Source>\n )\n}\n","import { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginVueQuery } from '../types.ts'\nimport { getEnabledParamNames, markParamsOptional } from '@internals/tanstack-query'\nimport { getComments, resolveErrorNames, resolveSuccessNames, wrapWithMaybeRefOrGetter } from '../utils.ts'\nimport { buildQueryKeyParamsNode } from './QueryKey.tsx'\nimport { getQueryOptionsParams } from './QueryOptions.tsx'\n\ntype Props = {\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginVueQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']\n resolver: ResolverTs\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options\n const successNames = resolveSuccessNames(node, resolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : resolver.resolveResponseName(node)\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n const errorNames = resolveErrorNames(node, resolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const optionsParam = ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n query?: Partial<UseQueryOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}\n}`,\n }),\n default: '{}',\n })\n\n // Vue-query wraps operation params with MaybeRefOrGetter\n const baseParams = ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\n\n return wrapWithMaybeRefOrGetter(baseParams, (name) => name === 'options')\n}\n\nexport function Query({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const errorNames = resolveErrorNames(node, tsResolver)\n\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n const returnType = `UseQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n const enabledNames = getEnabledParamNames(queryKeyParamsNode)\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = markParamsOptional(\n buildQueryParamsNode(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver }),\n enabledNames,\n )\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export generics={generics.join(', ')} params={paramsSignature} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = (resolvedOptions && 'queryKey' in resolvedOptions ? toValue(resolvedOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParamsCall})\n\n const query = useQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),\n ...resolvedOptions,\n queryKey\n } as unknown as UseQueryOptions<${TData}, ${TError}, TData, ${TData}, TQueryKey>, toValue(queryClient)) as ${returnType}\n\n query.queryKey = queryKey as TQueryKey\n\n return query\n `}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;CAS9D,OARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAEH,CAAC,MAAM,gBAAgB,CAAC,OAAO,QAE3C,CACT,KAAK,MAAM,MAAM;EAEhB,IADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,EACjD,OAAO;EACrB,IAAI,MAAM,KAAK,CAAC,QAAQ,OAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;EAC3E,OAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;GACnD,CACD,KAAK,GAAG,CACR,QAAQ,iBAAiB,GAAG;;;;;;;;;;AAWjC,SAAS,iBAAiB,MAAc,eAAkE;CACxG,MAAM,QAAQ,KAAK,MAAM,iBAAiB;CAC1C,OAAO,MAAM,KAAK,MAAM,MAAM,cAAc,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;AAWtF,SAAgB,UAAU,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;CAClG,IAAI,QACF,OAAO,iBAAiB,OAAO,MAAM,WAAW,UAAU,MAAM,SAAS;EAAE;EAAQ;EAAQ,GAAG,EAAE,CAAC,CAAC;CAGpG,OAAO,gBAAgB,GAAG,OAAO,GAAG,KA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