@kubb/plugin-react-query 5.0.0-beta.25 → 5.0.0-beta.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{components-C91DnOOV.js → components-CDmg-RPi.js} +32 -13
  2. package/dist/components-CDmg-RPi.js.map +1 -0
  3. package/dist/{components-C1_zAoAO.cjs → components-MPBTffPl.cjs} +32 -13
  4. package/dist/components-MPBTffPl.cjs.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.js +1 -1
  7. package/dist/{generators-9srJC_zb.js → generators-Bma51Uar.js} +87 -39
  8. package/dist/generators-Bma51Uar.js.map +1 -0
  9. package/dist/{generators-DS3JH1hR.cjs → generators-BtsWNz-6.cjs} +87 -39
  10. package/dist/generators-BtsWNz-6.cjs.map +1 -0
  11. package/dist/generators.cjs +1 -1
  12. package/dist/generators.js +1 -1
  13. package/dist/index.cjs +5 -5
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +5 -5
  16. package/dist/index.js.map +1 -1
  17. package/extension.yaml +5 -5
  18. package/package.json +7 -7
  19. package/src/components/InfiniteQuery.tsx +3 -2
  20. package/src/components/InfiniteQueryOptions.tsx +3 -2
  21. package/src/components/Mutation.tsx +5 -3
  22. package/src/components/MutationOptions.tsx +3 -2
  23. package/src/components/Query.tsx +5 -3
  24. package/src/components/QueryOptions.tsx +3 -2
  25. package/src/components/SuspenseInfiniteQuery.tsx +3 -2
  26. package/src/components/SuspenseInfiniteQueryOptions.tsx +3 -2
  27. package/src/components/SuspenseQuery.tsx +5 -3
  28. package/src/generators/hookOptionsGenerator.tsx +2 -2
  29. package/src/generators/infiniteQueryGenerator.tsx +6 -6
  30. package/src/generators/mutationGenerator.tsx +6 -6
  31. package/src/generators/queryGenerator.tsx +6 -6
  32. package/src/generators/suspenseInfiniteQueryGenerator.tsx +6 -6
  33. package/src/generators/suspenseQueryGenerator.tsx +6 -6
  34. package/src/plugin.ts +3 -3
  35. package/src/utils.ts +8 -1
  36. package/dist/components-C1_zAoAO.cjs.map +0 -1
  37. package/dist/components-C91DnOOV.js.map +0 -1
  38. package/dist/generators-9srJC_zb.js.map +0 -1
  39. package/dist/generators-DS3JH1hR.cjs.map +0 -1
@@ -389,6 +389,10 @@ function getStatusCodeNumber(statusCode) {
389
389
  const code = Number(statusCode);
390
390
  return Number.isNaN(code) ? null : code;
391
391
  }
392
+ function isSuccessStatusCode(statusCode) {
393
+ const code = getStatusCodeNumber(statusCode);
394
+ return code !== null && code >= 200 && code < 300;
395
+ }
392
396
  function isErrorStatusCode(statusCode) {
393
397
  const code = getStatusCodeNumber(statusCode);
394
398
  return code !== null && code >= 400;
@@ -396,6 +400,9 @@ function isErrorStatusCode(statusCode) {
396
400
  function resolveErrorNames(node, resolver) {
397
401
  return node.responses.filter((response) => isErrorStatusCode(response.statusCode)).map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
398
402
  }
403
+ function resolveSuccessNames(node, resolver) {
404
+ return node.responses.filter((response) => isSuccessStatusCode(response.statusCode)).map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
405
+ }
399
406
  function resolveStatusCodeNames(node, resolver) {
400
407
  return node.responses.map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
401
408
  }
@@ -648,7 +655,8 @@ function getQueryOptionsParams(node, options) {
648
655
  });
649
656
  }
650
657
  function QueryOptions({ name, clientName, dataReturnType, node, tsResolver, paramsCasing, paramsType, pathParamsType, queryKeyName }) {
651
- const responseName = tsResolver.resolveResponseName(node);
658
+ const successNames = resolveSuccessNames(node, tsResolver);
659
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
652
660
  const errorNames = resolveErrorNames(node, tsResolver);
653
661
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
654
662
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -716,7 +724,8 @@ function buildInfiniteQueryParamsNode(node, options) {
716
724
  });
717
725
  }
718
726
  function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, initialPageParam, queryParam, customOptions }) {
719
- const responseName = tsResolver.resolveResponseName(node);
727
+ const successNames = resolveSuccessNames(node, tsResolver);
728
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
720
729
  const errorNames = resolveErrorNames(node, tsResolver);
721
730
  const responseType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
722
731
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -797,7 +806,8 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
797
806
  const declarationPrinter$6 = functionPrinter({ mode: "declaration" });
798
807
  const callPrinter$6 = functionPrinter({ mode: "call" });
799
808
  function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, nextParam, previousParam, node, tsResolver, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName }) {
800
- const responseName = tsResolver.resolveResponseName(node);
809
+ const successNames = resolveSuccessNames(node, tsResolver);
810
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
801
811
  const queryFnDataType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
802
812
  const errorNames = resolveErrorNames(node, tsResolver);
803
813
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -909,7 +919,8 @@ function buildMutationConfigParamsNode(node, resolver) {
909
919
  })] });
910
920
  }
911
921
  function MutationOptions({ name, clientName, dataReturnType, node, tsResolver, paramsCasing, paramsType, pathParamsType, mutationKeyName }) {
912
- const responseName = tsResolver.resolveResponseName(node);
922
+ const successNames = resolveSuccessNames(node, tsResolver);
923
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
913
924
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
914
925
  const errorNames = resolveErrorNames(node, tsResolver);
915
926
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -974,7 +985,8 @@ function createMutationArgParams(node, options) {
974
985
  }
975
986
  function buildMutationParamsNode(node, options) {
976
987
  const { paramsCasing, dataReturnType, resolver } = options;
977
- const responseName = resolver.resolveResponseName(node);
988
+ const successNames = resolveSuccessNames(node, resolver);
989
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
978
990
  const errorNames = resolveErrorNames(node, resolver);
979
991
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
980
992
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1002,7 +1014,8 @@ function buildMutationParamsNode(node, options) {
1002
1014
  })] });
1003
1015
  }
1004
1016
  function Mutation({ name, mutationOptionsName, paramsCasing, dataReturnType, node, tsResolver, mutationKeyName, customOptions }) {
1005
- const responseName = tsResolver.resolveResponseName(node);
1017
+ const successNames = resolveSuccessNames(node, tsResolver);
1018
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1006
1019
  const errorNames = resolveErrorNames(node, tsResolver);
1007
1020
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1008
1021
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1059,7 +1072,8 @@ const declarationPrinter$3 = functionPrinter({ mode: "declaration" });
1059
1072
  const callPrinter$3 = functionPrinter({ mode: "call" });
1060
1073
  function buildQueryParamsNode(node, options) {
1061
1074
  const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options;
1062
- const responseName = resolver.resolveResponseName(node);
1075
+ const successNames = resolveSuccessNames(node, resolver);
1076
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
1063
1077
  const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null;
1064
1078
  const errorNames = resolveErrorNames(node, resolver);
1065
1079
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
@@ -1090,7 +1104,8 @@ function buildQueryParamsNode(node, options) {
1090
1104
  });
1091
1105
  }
1092
1106
  function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions }) {
1093
- const responseName = tsResolver.resolveResponseName(node);
1107
+ const successNames = resolveSuccessNames(node, tsResolver);
1108
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1094
1109
  const errorNames = resolveErrorNames(node, tsResolver);
1095
1110
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1096
1111
  const returnType = `UseQueryResult<TData, ${`ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`}> & { queryKey: TQueryKey }`;
@@ -1177,7 +1192,8 @@ function buildSuspenseInfiniteQueryParamsNode(node, options) {
1177
1192
  });
1178
1193
  }
1179
1194
  function SuspenseInfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions, initialPageParam, queryParam }) {
1180
- const responseName = tsResolver.resolveResponseName(node);
1195
+ const successNames = resolveSuccessNames(node, tsResolver);
1196
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1181
1197
  const errorNames = resolveErrorNames(node, tsResolver);
1182
1198
  const responseType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1183
1199
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1258,7 +1274,8 @@ function SuspenseInfiniteQuery({ name, queryKeyTypeName, queryOptionsName, query
1258
1274
  const declarationPrinter$1 = functionPrinter({ mode: "declaration" });
1259
1275
  const callPrinter$1 = functionPrinter({ mode: "call" });
1260
1276
  function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, nextParam, previousParam, node, tsResolver, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName }) {
1261
- const responseName = tsResolver.resolveResponseName(node);
1277
+ const successNames = resolveSuccessNames(node, tsResolver);
1278
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1262
1279
  const queryFnDataType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1263
1280
  const errorNames = resolveErrorNames(node, tsResolver);
1264
1281
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1360,7 +1377,8 @@ const declarationPrinter = functionPrinter({ mode: "declaration" });
1360
1377
  const callPrinter = functionPrinter({ mode: "call" });
1361
1378
  function buildSuspenseQueryParamsNode(node, options) {
1362
1379
  const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options;
1363
- const responseName = resolver.resolveResponseName(node);
1380
+ const successNames = resolveSuccessNames(node, resolver);
1381
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
1364
1382
  const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null;
1365
1383
  const errorNames = resolveErrorNames(node, resolver);
1366
1384
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
@@ -1390,7 +1408,8 @@ function buildSuspenseQueryParamsNode(node, options) {
1390
1408
  });
1391
1409
  }
1392
1410
  function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions }) {
1393
- const responseName = tsResolver.resolveResponseName(node);
1411
+ const successNames = resolveSuccessNames(node, tsResolver);
1412
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1394
1413
  const errorNames = resolveErrorNames(node, tsResolver);
1395
1414
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1396
1415
  const returnType = `UseSuspenseQueryResult<TData, ${`ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`}> & { queryKey: TQueryKey }`;
@@ -1449,4 +1468,4 @@ function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
1449
1468
  //#endregion
1450
1469
  export { mutationKeyTransformer as _, Mutation as a, InfiniteQuery as c, queryKeyTransformer as d, resolveOperationOverrides as f, MutationKey as g, resolveOperationTypeNames as h, Query as i, QueryOptions as l, getOperationParameters as m, SuspenseInfiniteQueryOptions as n, MutationOptions as o, resolveZodSchemaNames as p, SuspenseInfiniteQuery as r, InfiniteQueryOptions as s, SuspenseQuery as t, QueryKey as u, camelCase as v };
1451
1470
 
1452
- //# sourceMappingURL=components-C91DnOOV.js.map
1471
+ //# sourceMappingURL=components-CDmg-RPi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-CDmg-RPi.js","names":["#options","#transformParam","#eachParam","declarationPrinter","declarationPrinter","declarationPrinter","callPrinter","declarationPrinter","callPrinter","getComments","declarationPrinter","callPrinter","declarationPrinter","callPrinter","declarationPrinter","callPrinter","getComments","declarationPrinter","callPrinter","getComments","declarationPrinter","callPrinter","getComments","declarationPrinter","callPrinter","getComments"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/object.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../../../internals/tanstack-query/src/components/MutationKey.tsx","../../../internals/shared/src/operation.ts","../../../internals/tanstack-query/src/utils.ts","../../../internals/tanstack-query/src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/InfiniteQuery.tsx","../src/components/InfiniteQueryOptions.tsx","../src/components/MutationOptions.tsx","../src/components/Mutation.tsx","../src/components/Query.tsx","../src/components/SuspenseInfiniteQuery.tsx","../src/components/SuspenseInfiniteQueryOptions.tsx","../src/components/SuspenseQuery.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 } 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 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 { URLPath } from '@internals/utils'\nimport { ast } from '@kubb/core'\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 `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}`\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 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 { 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 matches(node.path)\n if (type === 'method') return 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\nexport function buildEnabledCheck(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.join(' && ')\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 } 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 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 paramsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\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","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 { buildEnabledCheck } from '@internals/tanstack-query'\nimport type { PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\n\ntype Props = {\n name: string\n clientName: string\n queryKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['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 return 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\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 paramsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\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 queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const enabledSource = buildEnabledCheck(queryKeyParamsNode)\n const enabledText = enabledSource ? `enabled: !!(${enabledSource}),` : ''\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}, typeof queryKey>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n return ${clientName}(${clientCallStr})\n },\n })\n`}\n </Function>\n </File.Source>\n )\n}\n","import { getOperationParameters } from '@internals/shared'\nimport { 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, PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, getComments, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n initialPageParam: Infinite['initialPageParam']\n queryParam?: Infinite['queryParam']\n customOptions: PluginReactQuery['resolvedOptions']['customOptions']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildInfiniteQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n resolver: ResolverTs\n pageParamGeneric: string\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, resolver, pageParamGeneric } = options\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n\n const optionsParam = ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n query?: Partial<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, ${pageParamGeneric}>> & { client?: QueryClient },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}\n}`,\n }),\n default: '{}',\n })\n\n return ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\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 initialPageParam,\n queryParam,\n customOptions,\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 responseType = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\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 returnType = 'UseInfiniteQueryResult<TData, TError> & { queryKey: TQueryKey }'\n const generics = [\n `TQueryFnData = ${responseType}`,\n `TError = ${errorType}`,\n 'TData = InfiniteData<TQueryFnData>',\n `TQueryKey extends QueryKey = ${queryKeyTypeName}`,\n `TPageParam = ${pageParamType}`,\n ]\n\n const queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = buildInfiniteQueryParamsNode(node, {\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n resolver: tsResolver,\n pageParamGeneric: 'TPageParam',\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} returnType={undefined} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = resolvedOptions?.queryKey ?? ${queryKeyName}(${queryKeyParamsCall})\n ${customOptions ? `const customOptions = ${customOptions.name}({ hookName: '${name}', operationId: '${node.operationId}' })` : ''}\n\n const query = useInfiniteQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),${customOptions ? '\\n...customOptions,' : ''}\n ...resolvedOptions,\n queryKey,\n } as unknown as InfiniteQueryObserverOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 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, PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\nimport { buildEnabledCheck } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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 paramsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\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 queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const enabledSource = buildEnabledCheck(queryKeyParamsNode)\n const enabledText = enabledSource ? `enabled: !!(${enabledSource}),` : ''\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}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n ${infiniteOverrideParams}\n return ${clientName}(${clientCallStr})\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}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n return ${clientName}(${clientCallStr})\n },\n ${queryOptionsArr.join(',\\n')}\n })\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 { PluginReactQuery } from '../types.ts'\nimport { buildRequestConfigType, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\n\ntype Props = {\n name: string\n clientName: string\n mutationKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\nconst keysPrinter = functionPrinter({ mode: 'keys' })\n\nexport function buildMutationConfigParamsNode(node: ast.OperationNode, resolver: ResolverTs): ast.FunctionParametersNode {\n return ast.createFunctionParameters({\n params: [\n ast.createFunctionParameter({\n name: 'config',\n type: ast.createParamsType({\n variant: 'reference',\n name: buildRequestConfigType(node, resolver),\n }),\n default: '{}',\n }),\n ],\n })\n}\n\nexport function MutationOptions({\n name,\n clientName,\n dataReturnType,\n node,\n tsResolver,\n paramsCasing,\n paramsType,\n pathParamsType,\n mutationKeyName,\n}: Props): KubbReactNode {\n const successNames = resolveSuccessNames(node, tsResolver)\n const responseName = successNames.length > 0 ? successNames.join(' | ') : tsResolver.resolveResponseName(node)\n const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\n const errorNames = resolveErrorNames(node, tsResolver)\n const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`\n\n const configParamsNode = buildMutationConfigParamsNode(node, tsResolver)\n const paramsSignature = declarationPrinter.print(configParamsNode) ?? ''\n\n const mutationArgParamsNode = ast.createOperationParams(node, {\n paramsType: 'inline',\n pathParamsType: 'inline',\n paramsCasing,\n resolver: tsResolver,\n })\n const hasMutationParams = mutationArgParamsNode.params.length > 0\n\n const TRequest = hasMutationParams ? (declarationPrinter.print(mutationArgParamsNode) ?? '') : ''\n const argKeysStr = hasMutationParams ? (keysPrinter.print(mutationArgParamsNode) ?? '') : ''\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 return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature} generics={['TContext = unknown']}>\n {`\n const mutationKey = ${mutationKeyName}()\n return mutationOptions<${TData}, ${TError}, ${TRequest ? `{${TRequest}}` : 'undefined'}, TContext>({\n mutationKey,\n mutationFn: async(${hasMutationParams ? `{ ${argKeysStr} }` : '_'}) => {\n return ${clientName}(${clientCallStr})\n },\n })\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 { PluginReactQuery } from '../types.ts'\nimport { buildRequestConfigType, getComments, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\nimport { buildMutationConfigParamsNode } from './MutationOptions.tsx'\n\ntype Props = {\n name: string\n typeName: string\n mutationOptionsName: string\n mutationKeyName: string\n node: ast.OperationNode\n tsResolver: ResolverTs\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n customOptions: PluginReactQuery['resolvedOptions']['customOptions']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction createMutationArgParams(\n node: ast.OperationNode,\n options: {\n paramsCasing: PluginReactQuery['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: PluginReactQuery['resolvedOptions']['paramsCasing']\n dataReturnType: PluginReactQuery['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, {\n paramsCasing,\n resolver,\n })\n const TRequest = mutationArgParamsNode.params.length > 0 ? (declarationPrinter.print(mutationArgParamsNode) ?? '') : ''\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'undefined', 'TContext'].join(', ')\n\n return ast.createFunctionParameters({\n params: [\n ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n mutation?: UseMutationOptions<${generics}> & { client?: QueryClient },\n client?: ${buildRequestConfigType(node, resolver)},\n}`,\n }),\n default: '{}',\n }),\n ],\n })\n}\n\nexport function Mutation({ name, mutationOptionsName, paramsCasing, dataReturnType, node, tsResolver, mutationKeyName, customOptions }: 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 TRequest = mutationArgParamsNode.params.length > 0 ? (declarationPrinter.print(mutationArgParamsNode) ?? '') : ''\n const generics = [TData, TError, TRequest ? `{${TRequest}}` : 'undefined', 'TContext'].join(', ')\n const returnType = `UseMutationResult<${generics}>`\n\n const mutationOptionsConfigNode = buildMutationConfigParamsNode(node, tsResolver)\n const mutationOptionsParamsCall = callPrinter.print(mutationOptionsConfigNode) ?? ''\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}()\n\n const baseOptions = ${mutationOptionsName}(${mutationOptionsParamsCall}) as UseMutationOptions<${generics}>\n ${customOptions ? `const customOptions = ${customOptions.name}({ hookName: '${name}', operationId: '${node.operationId}' }) as UseMutationOptions<${generics}>` : ''}\n\n return useMutation<${generics}>({\n ...baseOptions,${customOptions ? '\\n...customOptions,' : ''}\n mutationKey,\n ...mutationOptions,\n }, queryClient) as ${returnType}\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 { PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, getComments, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n customOptions: PluginReactQuery['resolvedOptions']['customOptions']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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<QueryObserverOptions<${[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 return ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\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 customOptions,\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 = `UseQueryResult<${'TData'}, ${TError}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = buildQueryParamsNode(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver })\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} returnType={undefined} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = resolvedOptions?.queryKey ?? ${queryKeyName}(${queryKeyParamsCall})\n ${customOptions ? `const customOptions = ${customOptions.name}({ hookName: '${name}', operationId: '${node.operationId}' })` : ''}\n\n const query = useQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),${customOptions ? '\\n...customOptions,' : ''}\n ...resolvedOptions,\n queryKey,\n } as unknown as QueryObserverOptions, 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 { 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, PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, getComments, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n customOptions: PluginReactQuery['resolvedOptions']['customOptions']\n initialPageParam: Infinite['initialPageParam']\n queryParam?: Infinite['queryParam']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildSuspenseInfiniteQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n resolver: ResolverTs\n pageParamGeneric: string\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, resolver, pageParamGeneric } = options\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n\n const optionsParam = ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n query?: Partial<UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, ${pageParamGeneric}>> & { client?: QueryClient },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}\n}`,\n }),\n default: '{}',\n })\n\n return ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\n}\n\nexport function SuspenseInfiniteQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n customOptions,\n initialPageParam,\n queryParam,\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 responseType = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`\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 returnType = 'UseSuspenseInfiniteQueryResult<TData, TError> & { queryKey: TQueryKey }'\n const generics = [\n `TQueryFnData = ${responseType}`,\n `TError = ${errorType}`,\n 'TData = InfiniteData<TQueryFnData>',\n `TQueryKey extends QueryKey = ${queryKeyTypeName}`,\n `TPageParam = ${pageParamType}`,\n ]\n\n const queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = buildSuspenseInfiniteQueryParamsNode(node, {\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n resolver: tsResolver,\n pageParamGeneric: 'TPageParam',\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} returnType={undefined} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = resolvedOptions?.queryKey ?? ${queryKeyName}(${queryKeyParamsCall})\n ${customOptions ? `const customOptions = ${customOptions.name}({ hookName: '${name}', operationId: '${node.operationId}' })` : ''}\n\n const query = useSuspenseInfiniteQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),${customOptions ? '\\n...customOptions,' : ''}\n ...resolvedOptions,\n queryKey,\n } as unknown as UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, 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, PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\nimport { buildEnabledCheck } 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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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 SuspenseInfiniteQueryOptions({\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 paramsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\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 queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const enabledSource = buildEnabledCheck(queryKeyParamsNode)\n const enabledText = enabledSource ? `enabled: !!(${enabledSource}),` : ''\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}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal, pageParam }) => {\n ${infiniteOverrideParams}\n return ${clientName}(${clientCallStr})\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}>, typeof queryKey, ${pageParamType}>({\n ${enabledText}\n queryKey,\n queryFn: async ({ signal }) => {\n return ${clientName}(${clientCallStr})\n },\n ${queryOptionsArr.join(',\\n')}\n })\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 { PluginReactQuery } from '../types.ts'\nimport { buildQueryKeyParams, getComments, resolveErrorNames, resolveSuccessNames } from '../utils.ts'\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: PluginReactQuery['resolvedOptions']['paramsCasing']\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']\n customOptions: PluginReactQuery['resolvedOptions']['customOptions']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction buildSuspenseQueryParamsNode(\n node: ast.OperationNode,\n options: {\n paramsType: PluginReactQuery['resolvedOptions']['paramsType']\n paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing']\n pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']\n dataReturnType: PluginReactQuery['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<UseSuspenseQueryOptions<${[TData, TError, 'TData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}\n}`,\n }),\n default: '{}',\n })\n\n return ast.createOperationParams(node, {\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',\n paramsCasing,\n resolver,\n extraParams: [optionsParam],\n })\n}\n\nexport function SuspenseQuery({\n name,\n queryKeyTypeName,\n queryOptionsName,\n queryKeyName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n customOptions,\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 = `UseSuspenseQueryResult<${'TData'}, ${TError}> & { queryKey: TQueryKey }`\n const generics = [`TData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]\n\n const queryKeyParamsNode = buildQueryKeyParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n const paramsNode = buildSuspenseQueryParamsNode(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver })\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} returnType={undefined} JSDoc={{ comments: getComments(node) }}>\n {`\n const { query: queryConfig = {}, client: config = {} } = options ?? {}\n const { client: queryClient, ...resolvedOptions } = queryConfig\n const queryKey = resolvedOptions?.queryKey ?? ${queryKeyName}(${queryKeyParamsCall})\n ${customOptions ? `const customOptions = ${customOptions.name}({ hookName: '${name}', operationId: '${node.operationId}' })` : ''}\n\n const query = useSuspenseQuery({\n ...${queryOptionsName}(${queryOptionsParamsCall}),${customOptions ? '\\n...customOptions,' : ''}\n ...resolvedOptions,\n queryKey,\n } as unknown as UseSuspenseQueryOptions, 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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,yBAAyB,YAAY,MAAM,uBAAuB,IAAI;CAE5E,MAAM,aAAa,6BAA6B,MAAM;EAAE;EAAY;EAAc;EAAgB;EAAgB,UAAU;EAAY,CAAC;CACzI,MAAM,kBAAkB,mBAAmB,MAAM,WAAW,IAAI;CAEhE,OACE,oBAAC,KAAK,QAAN;EAAmB;EAAM,cAAA;EAAa,aAAA;YACpC,oBAAC,UAAD;GAAgB;GAAM,QAAA;GAAO,UAAU,SAAS,KAAK,KAAK;GAAE,QAAQ;GAAiB,YAAY,KAAA;GAAW,OAAO,EAAE,UAAUC,uBAAY,KAAK,EAAE;aAC/I;;;uDAG8C,aAAa,GAAG,mBAAmB;SACjF,gBAAgB,yBAAyB,cAAc,KAAK,gBAAgB,KAAK,mBAAmB,KAAK,YAAY,QAAQ,GAAG;;;aAG5H,iBAAiB,GAAG,uBAAuB,IAAI,gBAAgB,wBAAwB,GAAG;;;kEAGrC,WAAW;;;;;;GAM5D,CAAA;EACC,CAAA"}
@@ -414,6 +414,10 @@ function getStatusCodeNumber(statusCode) {
414
414
  const code = Number(statusCode);
415
415
  return Number.isNaN(code) ? null : code;
416
416
  }
417
+ function isSuccessStatusCode(statusCode) {
418
+ const code = getStatusCodeNumber(statusCode);
419
+ return code !== null && code >= 200 && code < 300;
420
+ }
417
421
  function isErrorStatusCode(statusCode) {
418
422
  const code = getStatusCodeNumber(statusCode);
419
423
  return code !== null && code >= 400;
@@ -421,6 +425,9 @@ function isErrorStatusCode(statusCode) {
421
425
  function resolveErrorNames(node, resolver) {
422
426
  return node.responses.filter((response) => isErrorStatusCode(response.statusCode)).map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
423
427
  }
428
+ function resolveSuccessNames(node, resolver) {
429
+ return node.responses.filter((response) => isSuccessStatusCode(response.statusCode)).map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
430
+ }
424
431
  function resolveStatusCodeNames(node, resolver) {
425
432
  return node.responses.map((response) => resolver.resolveResponseStatusName(node, response.statusCode));
426
433
  }
@@ -673,7 +680,8 @@ function getQueryOptionsParams(node, options) {
673
680
  });
674
681
  }
675
682
  function QueryOptions({ name, clientName, dataReturnType, node, tsResolver, paramsCasing, paramsType, pathParamsType, queryKeyName }) {
676
- const responseName = tsResolver.resolveResponseName(node);
683
+ const successNames = resolveSuccessNames(node, tsResolver);
684
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
677
685
  const errorNames = resolveErrorNames(node, tsResolver);
678
686
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
679
687
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -741,7 +749,8 @@ function buildInfiniteQueryParamsNode(node, options) {
741
749
  });
742
750
  }
743
751
  function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, initialPageParam, queryParam, customOptions }) {
744
- const responseName = tsResolver.resolveResponseName(node);
752
+ const successNames = resolveSuccessNames(node, tsResolver);
753
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
745
754
  const errorNames = resolveErrorNames(node, tsResolver);
746
755
  const responseType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
747
756
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -822,7 +831,8 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
822
831
  const declarationPrinter$6 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
823
832
  const callPrinter$6 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "call" });
824
833
  function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, nextParam, previousParam, node, tsResolver, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName }) {
825
- const responseName = tsResolver.resolveResponseName(node);
834
+ const successNames = resolveSuccessNames(node, tsResolver);
835
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
826
836
  const queryFnDataType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
827
837
  const errorNames = resolveErrorNames(node, tsResolver);
828
838
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -934,7 +944,8 @@ function buildMutationConfigParamsNode(node, resolver) {
934
944
  })] });
935
945
  }
936
946
  function MutationOptions({ name, clientName, dataReturnType, node, tsResolver, paramsCasing, paramsType, pathParamsType, mutationKeyName }) {
937
- const responseName = tsResolver.resolveResponseName(node);
947
+ const successNames = resolveSuccessNames(node, tsResolver);
948
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
938
949
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
939
950
  const errorNames = resolveErrorNames(node, tsResolver);
940
951
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -999,7 +1010,8 @@ function createMutationArgParams(node, options) {
999
1010
  }
1000
1011
  function buildMutationParamsNode(node, options) {
1001
1012
  const { paramsCasing, dataReturnType, resolver } = options;
1002
- const responseName = resolver.resolveResponseName(node);
1013
+ const successNames = resolveSuccessNames(node, resolver);
1014
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
1003
1015
  const errorNames = resolveErrorNames(node, resolver);
1004
1016
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1005
1017
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1027,7 +1039,8 @@ function buildMutationParamsNode(node, options) {
1027
1039
  })] });
1028
1040
  }
1029
1041
  function Mutation({ name, mutationOptionsName, paramsCasing, dataReturnType, node, tsResolver, mutationKeyName, customOptions }) {
1030
- const responseName = tsResolver.resolveResponseName(node);
1042
+ const successNames = resolveSuccessNames(node, tsResolver);
1043
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1031
1044
  const errorNames = resolveErrorNames(node, tsResolver);
1032
1045
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1033
1046
  const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1084,7 +1097,8 @@ const declarationPrinter$3 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "decla
1084
1097
  const callPrinter$3 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "call" });
1085
1098
  function buildQueryParamsNode(node, options) {
1086
1099
  const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options;
1087
- const responseName = resolver.resolveResponseName(node);
1100
+ const successNames = resolveSuccessNames(node, resolver);
1101
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
1088
1102
  const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null;
1089
1103
  const errorNames = resolveErrorNames(node, resolver);
1090
1104
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
@@ -1115,7 +1129,8 @@ function buildQueryParamsNode(node, options) {
1115
1129
  });
1116
1130
  }
1117
1131
  function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions }) {
1118
- const responseName = tsResolver.resolveResponseName(node);
1132
+ const successNames = resolveSuccessNames(node, tsResolver);
1133
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1119
1134
  const errorNames = resolveErrorNames(node, tsResolver);
1120
1135
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1121
1136
  const returnType = `UseQueryResult<TData, ${`ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`}> & { queryKey: TQueryKey }`;
@@ -1202,7 +1217,8 @@ function buildSuspenseInfiniteQueryParamsNode(node, options) {
1202
1217
  });
1203
1218
  }
1204
1219
  function SuspenseInfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions, initialPageParam, queryParam }) {
1205
- const responseName = tsResolver.resolveResponseName(node);
1220
+ const successNames = resolveSuccessNames(node, tsResolver);
1221
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1206
1222
  const errorNames = resolveErrorNames(node, tsResolver);
1207
1223
  const responseType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1208
1224
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1283,7 +1299,8 @@ function SuspenseInfiniteQuery({ name, queryKeyTypeName, queryOptionsName, query
1283
1299
  const declarationPrinter$1 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
1284
1300
  const callPrinter$1 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "call" });
1285
1301
  function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, nextParam, previousParam, node, tsResolver, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName }) {
1286
- const responseName = tsResolver.resolveResponseName(node);
1302
+ const successNames = resolveSuccessNames(node, tsResolver);
1303
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1287
1304
  const queryFnDataType = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1288
1305
  const errorNames = resolveErrorNames(node, tsResolver);
1289
1306
  const errorType = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`;
@@ -1385,7 +1402,8 @@ const declarationPrinter = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declara
1385
1402
  const callPrinter = (0, _kubb_plugin_ts.functionPrinter)({ mode: "call" });
1386
1403
  function buildSuspenseQueryParamsNode(node, options) {
1387
1404
  const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options;
1388
- const responseName = resolver.resolveResponseName(node);
1405
+ const successNames = resolveSuccessNames(node, resolver);
1406
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : resolver.resolveResponseName(node);
1389
1407
  const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null;
1390
1408
  const errorNames = resolveErrorNames(node, resolver);
1391
1409
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
@@ -1415,7 +1433,8 @@ function buildSuspenseQueryParamsNode(node, options) {
1415
1433
  });
1416
1434
  }
1417
1435
  function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, node, tsResolver, customOptions }) {
1418
- const responseName = tsResolver.resolveResponseName(node);
1436
+ const successNames = resolveSuccessNames(node, tsResolver);
1437
+ const responseName = successNames.length > 0 ? successNames.join(" | ") : tsResolver.resolveResponseName(node);
1419
1438
  const errorNames = resolveErrorNames(node, tsResolver);
1420
1439
  const TData = dataReturnType === "data" ? responseName : `ResponseConfig<${responseName}>`;
1421
1440
  const returnType = `UseSuspenseQueryResult<TData, ${`ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(" | ") : "Error"}>`}> & { queryKey: TQueryKey }`;
@@ -1593,4 +1612,4 @@ Object.defineProperty(exports, "resolveZodSchemaNames", {
1593
1612
  }
1594
1613
  });
1595
1614
 
1596
- //# sourceMappingURL=components-C1_zAoAO.cjs.map
1615
+ //# sourceMappingURL=components-MPBTffPl.cjs.map