@kubb/plugin-swr 5.0.0-alpha.34 → 5.0.0-alpha.35

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 (41) hide show
  1. package/dist/components-BJSzUg7M.cjs +955 -0
  2. package/dist/components-BJSzUg7M.cjs.map +1 -0
  3. package/dist/components-JQ2KRFCa.js +877 -0
  4. package/dist/components-JQ2KRFCa.js.map +1 -0
  5. package/dist/components.cjs +1 -1
  6. package/dist/components.d.ts +77 -37
  7. package/dist/components.js +1 -1
  8. package/dist/generators-17ulS9mu.cjs +537 -0
  9. package/dist/generators-17ulS9mu.cjs.map +1 -0
  10. package/dist/generators-Cl7nr-FB.js +526 -0
  11. package/dist/generators-Cl7nr-FB.js.map +1 -0
  12. package/dist/generators.cjs +1 -1
  13. package/dist/generators.d.ts +4 -4
  14. package/dist/generators.js +1 -1
  15. package/dist/index.cjs +132 -110
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.ts +22 -2
  18. package/dist/index.js +132 -110
  19. package/dist/index.js.map +1 -1
  20. package/dist/{types-BVDtH9S7.d.ts → types-FA5mH9Ch.d.ts} +46 -90
  21. package/package.json +7 -11
  22. package/src/components/Mutation.tsx +165 -170
  23. package/src/components/MutationKey.tsx +50 -1
  24. package/src/components/Query.tsx +122 -126
  25. package/src/components/QueryKey.tsx +65 -1
  26. package/src/components/QueryOptions.tsx +38 -93
  27. package/src/generators/mutationGenerator.tsx +194 -117
  28. package/src/generators/queryGenerator.tsx +205 -139
  29. package/src/plugin.ts +117 -152
  30. package/src/resolvers/resolverSwr.ts +26 -0
  31. package/src/resolvers/resolverSwrLegacy.ts +17 -0
  32. package/src/types.ts +55 -18
  33. package/src/utils.ts +209 -0
  34. package/dist/components-DaCTPplv.js +0 -756
  35. package/dist/components-DaCTPplv.js.map +0 -1
  36. package/dist/components-Qs8_faOt.cjs +0 -834
  37. package/dist/components-Qs8_faOt.cjs.map +0 -1
  38. package/dist/generators-0YayIrse.js +0 -400
  39. package/dist/generators-0YayIrse.js.map +0 -1
  40. package/dist/generators-Bd4rCa3l.cjs +0 -411
  41. package/dist/generators-Bd4rCa3l.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-JQ2KRFCa.js","names":["#options","#transformParam","#eachParam","declarationPrinter","callPrinter","getParams","Function","declarationPrinter","getParams","getTransformer","Function","declarationPrinter","callPrinter","getParams","Function","declarationPrinter","callPrinter","Function","Function"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../src/utils.ts","../src/components/Mutation.tsx","../src/components/MutationKey.tsx","../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/Query.tsx"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\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 * Prefixes `word` with `_` when it is a reserved JavaScript/Java identifier or starts with a digit.\n *\n * @example\n * ```ts\n * transformReservedWord('class') // '_class'\n * transformReservedWord('42foo') // '_42foo'\n * transformReservedWord('status') // 'status'\n * ```\n */\nexport function transformReservedWord(word: string): string {\n const firstChar = word.charCodeAt(0)\n if (word && (reservedWords.has(word as 'valueOf') || (firstChar >= 48 && firstChar <= 57))) {\n return `_${word}`\n }\n return word\n}\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 try {\n new Function(`var ${name}`)\n } catch {\n return false\n }\n return true\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 `undefined` when the path has none.\n */\n params?: Record<string, string>\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 `undefined` when the path has no parameters.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').params // { petId: 'petId' }\n * new URLPath('/pet').params // undefined\n * ```\n */\n get params(): Record<string, string> | undefined {\n return this.getParams()\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) => void): void {\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.getParams(),\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; 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}').getParams()\n * // { petId: 'petId', tagId: 'tagId' }\n * ```\n */\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\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 : undefined\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 { ast } from '@kubb/core'\nimport type { PluginTs } from '@kubb/plugin-ts'\nimport type { PluginSwr } from './types.ts'\n\n/**\n * Apply the user-provided `transformers.name` function (if any) to a resolved name.\n * Mirrors the old `createPlugin` `resolveName` lifecycle that applied transformers\n * after resolving the full name (base + suffix).\n */\nexport function transformName(name: string, type: string, transformers?: PluginSwr['resolvedOptions']['transformers']): string {\n return transformers?.name?.(name, type) || name\n}\n\n/**\n * Build JSDoc comment lines from an OperationNode.\n */\nexport function getComments(node: ast.OperationNode): Array<string> {\n return [\n node.description && `@description ${node.description}`,\n node.summary && `@summary ${node.summary}`,\n node.deprecated && '@deprecated',\n `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}`,\n ].filter((x): x is string => Boolean(x))\n}\n\n/**\n * Resolve error type names from operation responses.\n */\nexport function resolveErrorNames(node: ast.OperationNode, tsResolver: PluginTs['resolver']): string[] {\n return node.responses\n .filter((r) => {\n const code = Number.parseInt(r.statusCode, 10)\n return code >= 400 || r.statusCode === 'default'\n })\n .map((r) => tsResolver.resolveResponseStatusName(node, r.statusCode))\n}\n\n/**\n * Resolve all status code type names from operation responses (for imports).\n */\nexport function resolveStatusCodeNames(node: ast.OperationNode, tsResolver: PluginTs['resolver']): string[] {\n return node.responses.map((r) => tsResolver.resolveResponseStatusName(node, r.statusCode))\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 } | undefined\n\n/**\n * Derive a query-params group type from the resolver.\n * Returns `undefined` 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 undefined\n const firstParam = params[0]!\n const groupName = resolver.resolveQueryParamsName(node, firstParam)\n if (groupName === resolver.resolveParamName(node, firstParam)) return undefined\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 undefined\n const firstParam = params[0]!\n const groupName = resolver.resolveHeaderParamsName(node, firstParam)\n if (groupName === resolver.resolveParamName(node, firstParam)) return undefined\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?.schema ? ast.createParamsType({ variant: 'reference', name: resolver.resolveDataName(node) }) : undefined\n const bodyRequired = node.requestBody?.required ?? false\n\n const params: Array<ast.FunctionParameterNode | ast.ParameterGroupNode> = []\n\n // Path params\n if (pathParams.length) {\n const pathChildren = pathParams.map((p) =>\n ast.createFunctionParameter({ name: p.name, type: resolvePathParamType(node, p, resolver), optional: !p.required }),\n )\n params.push({\n kind: 'ParameterGroup',\n properties: pathChildren,\n inline: pathParamsType === 'inline',\n default: pathChildren.every((c) => c.optional) ? '{}' : undefined,\n })\n }\n\n // Request body\n if (bodyType) {\n params.push(ast.createFunctionParameter({ name: 'data', type: bodyType, optional: !bodyRequired }))\n }\n\n // Query params\n params.push(...buildGroupParam('params', node, queryParams, queryGroupType, resolver))\n\n return ast.createFunctionParameters({ params })\n}\n\n/**\n * Build mutation arg params for paramsToTrigger mode.\n * Contains pathParams + data + queryParams + headers (all flattened, for type alias).\n */\nexport function buildMutationArgParams(\n node: ast.OperationNode,\n options: {\n paramsCasing: 'camelcase' | undefined\n resolver: PluginTs['resolver']\n },\n): ast.FunctionParametersNode {\n const { 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 const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const queryGroupType = resolveQueryGroupType(node, queryParams, resolver)\n const headerGroupType = resolveHeaderGroupType(node, headerParams, resolver)\n\n const bodyType = node.requestBody?.schema ? ast.createParamsType({ variant: 'reference', name: resolver.resolveDataName(node) }) : undefined\n const bodyRequired = node.requestBody?.required ?? false\n\n const params: Array<ast.FunctionParameterNode | ast.ParameterGroupNode> = []\n\n // Path params (individual entries)\n for (const p of pathParams) {\n params.push(ast.createFunctionParameter({ name: p.name, type: resolvePathParamType(node, p, resolver), optional: !p.required }))\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 // Header params\n params.push(...buildGroupParam('headers', node, headerParams, headerGroupType, resolver))\n\n return ast.createFunctionParameters({ params })\n}\n","import { 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 { PluginSwr } from '../types.ts'\nimport {\n buildGroupParam,\n buildMutationArgParams,\n getComments,\n resolveErrorNames,\n resolveHeaderGroupType,\n resolvePathParamType,\n resolveQueryGroupType,\n} from '../utils.ts'\n\ntype Props = {\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n mutationKeyTypeName: string\n node: ast.OperationNode\n tsResolver: PluginTs['resolver']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n /**\n * When true, mutation parameters are passed via trigger() instead of as hook arguments\n * @default false\n */\n paramsToTrigger?: boolean\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\nconst keysPrinter = functionPrinter({ mode: 'keys' })\n\n/**\n * Default mutation hook params (paramsToTrigger=false):\n * pathParams + queryParams + headers + options (NO data — it comes via useSWRMutation arg)\n */\nfunction getParams(\n node: ast.OperationNode,\n options: {\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n resolver: PluginTs['resolver']\n mutationKeyTypeName: string\n },\n): ast.FunctionParametersNode {\n const { paramsCasing, pathParamsType, dataReturnType, resolver, mutationKeyTypeName } = options\n\n const responseName = resolver.resolveResponseName(node)\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\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 const TExtraArg = requestName || 'never'\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 const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const queryGroupType = resolveQueryGroupType(node, queryParams, resolver)\n const headerGroupType = resolveHeaderGroupType(node, headerParams, resolver)\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 // Query params\n params.push(...buildGroupParam('params', node, queryParams, queryGroupType, resolver))\n\n // Header params\n params.push(...buildGroupParam('headers', node, headerParams, headerGroupType, resolver))\n\n // Options\n params.push(\n ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n mutation?: SWRMutationConfiguration<${TData}, ${TError}, ${mutationKeyTypeName} | null, ${TExtraArg}> & { throwOnError?: boolean },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'},\n shouldFetch?: boolean,\n}`,\n }),\n default: '{}',\n }),\n )\n\n return ast.createFunctionParameters({ params })\n}\n\n/**\n * Trigger-mode params (paramsToTrigger=true): just `options`\n */\nfunction getTriggerParams(\n node: ast.OperationNode,\n options: {\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n resolver: PluginTs['resolver']\n mutationKeyTypeName: string\n mutationArgTypeName: string\n },\n): ast.FunctionParametersNode {\n const { dataReturnType, resolver, mutationKeyTypeName, mutationArgTypeName } = options\n\n const responseName = resolver.resolveResponseName(node)\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\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 return ast.createFunctionParameters({\n params: [\n ast.createFunctionParameter({\n name: 'options',\n type: ast.createParamsType({\n variant: 'reference',\n name: `{\n mutation?: SWRMutationConfiguration<${TData}, ${TError}, ${mutationKeyTypeName} | null, ${mutationArgTypeName}> & { throwOnError?: boolean },\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'},\n shouldFetch?: boolean,\n}`,\n }),\n default: '{}',\n }),\n ],\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n mutationKeyName,\n mutationKeyTypeName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n node,\n tsResolver,\n paramsToTrigger = false,\n}: Props): KubbReactNode {\n const responseName = tsResolver.resolveResponseName(node)\n const requestName = node.requestBody?.schema ? tsResolver.resolveDataName(node) : undefined\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 // Client call params (path + body + query + headers + config)\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: requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }',\n }),\n default: '{}',\n }),\n ],\n })\n const clientCallStr = callPrinter.print(clientCallParamsNode) ?? ''\n\n // paramsToTrigger mode\n if (paramsToTrigger) {\n const mutationArgTypeName = `${mutationKeyTypeName.replace('MutationKey', '')}MutationArg`\n\n const mutationArgParamsNode = buildMutationArgParams(node, { paramsCasing, resolver: tsResolver })\n const hasMutationParams = mutationArgParamsNode.params.length > 0\n\n // Declaration for the type alias\n const mutationArgDeclaration = hasMutationParams ? (declarationPrinter.print(mutationArgParamsNode) ?? '') : ''\n\n // Destructured keys for the arg in the callback\n const argKeysStr = hasMutationParams ? (keysPrinter.print(mutationArgParamsNode) ?? '') : ''\n\n const paramsNode = getTriggerParams(node, { dataReturnType, resolver: tsResolver, mutationKeyTypeName, mutationArgTypeName })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n const generics = [TData, TError, `${mutationKeyTypeName} | null`, mutationArgTypeName].filter(Boolean)\n\n return (\n <>\n <File.Source name={mutationArgTypeName} isExportable isIndexable isTypeOnly>\n <Type name={mutationArgTypeName} export>\n {hasMutationParams ? `{${mutationArgDeclaration}}` : 'never'}\n </Type>\n </File.Source>\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={paramsSignature}\n JSDoc={{\n comments: getComments(node),\n }}\n >\n {`\n const { mutation: mutationOptions, client: config = {}, shouldFetch = true } = options ?? {}\n const mutationKey = ${mutationKeyName}()\n\n return useSWRMutation<${generics.join(', ')}>(\n shouldFetch ? mutationKey : null,\n async (_url${hasMutationParams ? `, { arg: { ${argKeysStr} } }` : ''}) => {\n return ${clientName}(${clientCallStr})\n },\n mutationOptions\n )\n `}\n </Function>\n </File.Source>\n </>\n )\n }\n\n // Default behavior (paramsToTrigger=false)\n const generics = [TData, TError, `${mutationKeyTypeName} | null`, requestName].filter(Boolean)\n\n const paramsNode = getParams(node, { paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver, mutationKeyTypeName })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={paramsSignature}\n JSDoc={{\n comments: getComments(node),\n }}\n >\n {`\n const { mutation: mutationOptions, client: config = {}, shouldFetch = true } = options ?? {}\n const mutationKey = ${mutationKeyName}()\n\n return useSWRMutation<${generics.join(', ')}>(\n shouldFetch ? mutationKey : null,\n async (_url${requestName ? ', { arg: data }' : ''}) => {\n return ${clientName}(${clientCallStr})\n },\n mutationOptions\n )\n `}\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@internals/utils'\nimport { ast } from '@kubb/core'\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'\n\ntype Props = {\n name: string\n typeName: string\n node: ast.OperationNode\n paramsCasing: 'camelcase' | undefined\n pathParamsType: 'object' | 'inline'\n transformer: Transformer | undefined\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nfunction getParams(): ast.FunctionParametersNode {\n return ast.createFunctionParameters({ params: [] })\n}\n\nconst getTransformer: Transformer = ({ node, casing }) => {\n const path = new URLPath(node.path, { casing })\n return [`{ url: '${path.toURLPath()}' }`]\n}\n\nexport function MutationKey({ name, paramsCasing, node, typeName, transformer = getTransformer }: Props): KubbReactNode {\n const paramsNode = getParams()\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const keys = transformer({ 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} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nMutationKey.getParams = getParams\nMutationKey.getTransformer = getTransformer\n","import { 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 | undefined\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction getParams(\n node: ast.OperationNode,\n options: { pathParamsType: 'object' | 'inline'; paramsCasing: 'camelcase' | undefined; resolver: PluginTs['resolver'] },\n): ast.FunctionParametersNode {\n return buildQueryKeyParams(node, options)\n}\n\nconst getTransformer: Transformer = ({ node, casing }) => {\n const path = new URLPath(node.path, { casing })\n const hasQueryParams = node.parameters.some((p) => p.in === 'query')\n const hasRequestBody = !!node.requestBody?.schema\n\n return [\n path.toObject({ type: 'path', stringify: true }),\n hasQueryParams ? '...(params ? [params] : [])' : undefined,\n hasRequestBody ? '...(data ? [data] : [])' : undefined,\n ].filter(Boolean) as string[]\n}\n\nexport function QueryKey({ name, node, tsResolver, paramsCasing, pathParamsType, typeName, transformer = getTransformer }: Props): KubbReactNode {\n const paramsNode = getParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const keys = transformer({ 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} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nQueryKey.getParams = getParams\nQueryKey.getTransformer = getTransformer\nQueryKey.callPrinter = callPrinter\n","import { ast } from '@kubb/core'\nimport type { PluginTs } 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 { PluginSwr } from '../types.ts'\n\ntype Props = {\n name: string\n clientName: string\n node: ast.OperationNode\n tsResolver: PluginTs['resolver']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nexport function getQueryOptionsParams(\n node: ast.OperationNode,\n options: {\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n resolver: PluginTs['resolver']\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, resolver } = options\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\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({ name, clientName, node, tsResolver, paramsCasing, paramsType, pathParamsType }: Props): KubbReactNode {\n const paramsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n const paramsCall = callPrinter.print(paramsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={paramsSignature}>\n {`\n return {\n fetcher: async () => {\n return ${clientName}(${paramsCall})\n },\n }\n `}\n </Function>\n </File.Source>\n )\n}\n","import { ast } from '@kubb/core'\nimport type { PluginTs } 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 { PluginSwr } from '../types.ts'\nimport { buildGroupParam, getComments, resolveErrorNames, resolvePathParamType, resolveQueryGroupType } from '../utils.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { getQueryOptionsParams } from './QueryOptions.tsx'\n\ntype Props = {\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n node: ast.OperationNode\n tsResolver: PluginTs['resolver']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\nconst callPrinter = functionPrinter({ mode: 'call' })\n\nfunction getParams(\n node: ast.OperationNode,\n options: {\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n resolver: PluginTs['resolver']\n },\n): ast.FunctionParametersNode {\n const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options\n\n const responseName = resolver.resolveResponseName(node)\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\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?: Parameters<typeof useSWR<${TData}, ${TError}>>[2],\n client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'},\n shouldFetch?: boolean,\n immutable?: boolean\n}`,\n }),\n default: '{}',\n })\n\n if (paramsType === 'object') {\n // Use createOperationParams for the grouped params (path + body + query + headers),\n // but replace the config param with SWR's options param\n const baseParams = ast.createOperationParams(node, {\n paramsType: 'object',\n pathParamsType: 'object',\n paramsCasing,\n resolver,\n extraParams: [],\n })\n\n return ast.createFunctionParameters({\n params: [...baseParams.params, optionsParam],\n })\n }\n\n // Inline params: build path + body + query (NO headers for query hooks) + options\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 const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const queryGroupType = resolveQueryGroupType(node, queryParams, resolver)\n\n const bodyType = node.requestBody?.schema ? ast.createParamsType({ variant: 'reference', name: resolver.resolveDataName(node) }) : undefined\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 // 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 // Header params (included for the query hook params, consistent with old behavior)\n const headerGroupType = node.parameters.some((p) => p.in === 'header')\n ? (() => {\n const hParams = casedParams.filter((p) => p.in === 'header')\n const firstParam = hParams[0]!\n const groupName = resolver.resolveHeaderParamsName(node, firstParam)\n const individualName = resolver.resolveParamName(node, firstParam)\n if (groupName !== individualName) {\n return { type: ast.createParamsType({ variant: 'reference', name: groupName }), optional: hParams.every((p) => !p.required) }\n }\n return undefined\n })()\n : undefined\n params.push(...buildGroupParam('headers', node, headerParams, headerGroupType, resolver))\n\n // SWR options\n params.push(optionsParam)\n\n return ast.createFunctionParameters({ params })\n}\n\nexport function Query({\n name,\n node,\n tsResolver,\n queryKeyName,\n queryKeyTypeName,\n queryOptionsName,\n dataReturnType,\n paramsType,\n paramsCasing,\n pathParamsType,\n}: Props): KubbReactNode {\n const responseName = 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 generics = [TData, TError, `${queryKeyTypeName} | null`]\n\n const queryKeyParamsNode = QueryKey.getParams(node, { pathParamsType, paramsCasing, resolver: tsResolver })\n const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''\n\n const paramsNode = getParams(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })\n const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={paramsSignature}\n JSDoc={{\n comments: getComments(node),\n }}\n >\n {`\n const { query: queryOptions, client: config = {}, shouldFetch = true, immutable } = options ?? {}\n\n const queryKey = ${queryKeyName}(${queryKeyParamsCall})\n\n return useSWR<${generics.join(', ')}>(\n shouldFetch ? queryKey : null,\n {\n ...${queryOptionsName}(${queryOptionsParamsCall}),\n ...(immutable ? {\n revalidateIfStale: false,\n revalidateOnFocus: false,\n revalidateOnReconnect: false\n } : { }),\n ...queryOptions\n }\n )\n `}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,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Ac,UAAU;EAAY,CAAC;CAC3G,MAAM,qBAAqB,YAAY,MAAM,mBAAmB,IAAI;CAEpE,MAAM,aAAa,UAAU,MAAM;EAAE;EAAY;EAAc;EAAgB;EAAgB,UAAU;EAAY,CAAC;CACtH,MAAM,kBAAkB,mBAAmB,MAAM,WAAW,IAAI;CAEhE,MAAM,yBAAyB,sBAAsB,MAAM;EAAE;EAAY;EAAc;EAAgB,UAAU;EAAY,CAAC;CAC9H,MAAM,yBAAyB,YAAY,MAAM,uBAAuB,IAAI;AAE5E,QACE,oBAAC,KAAK,QAAN;EAAmB;EAAM,cAAA;EAAa,aAAA;YACpC,oBAACC,YAAD;GACQ;GACN,QAAA;GACA,QAAQ;GACR,OAAO,EACL,UAAU,YAAY,KAAK,EAC5B;aAEA;;;0BAGiB,aAAa,GAAG,mBAAmB;;uBAEtC,SAAS,KAAK,KAAK,CAAC;;;eAG5B,iBAAiB,GAAG,uBAAuB;;;;;;;;;;GAUzC,CAAA;EACC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_components = require("./components-Qs8_faOt.cjs");
2
+ const require_components = require("./components-BJSzUg7M.cjs");
3
3
  exports.Mutation = require_components.Mutation;
4
4
  exports.MutationKey = require_components.MutationKey;
5
5
  exports.Query = require_components.Query;
@@ -1,22 +1,18 @@
1
1
  import { t as __name } from "./chunk--u3MIqq1.js";
2
- import { i as MutationKey, n as PluginSwr, r as QueryKey } from "./types-BVDtH9S7.js";
3
- import { FunctionParams } from "@kubb/core";
4
- import { OperationSchemas } from "@kubb/plugin-oas";
5
- import { Operation } from "@kubb/oas";
2
+ import { n as PluginSwr, r as Transformer } from "./types-FA5mH9Ch.js";
3
+ import { ast } from "@kubb/core";
4
+ import { PluginTs } from "@kubb/plugin-ts";
6
5
  import { KubbReactNode } from "@kubb/renderer-jsx/types";
7
6
 
8
7
  //#region src/components/Mutation.d.ts
9
- type Props$2 = {
10
- /**
11
- * Name of the function
12
- */
8
+ type Props$4 = {
13
9
  name: string;
14
10
  typeName: string;
15
11
  clientName: string;
16
12
  mutationKeyName: string;
17
13
  mutationKeyTypeName: string;
18
- typeSchemas: OperationSchemas;
19
- operation: Operation;
14
+ node: ast.OperationNode;
15
+ tsResolver: PluginTs['resolver'];
20
16
  paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
21
17
  paramsType: PluginSwr['resolvedOptions']['paramsType'];
22
18
  dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType'];
@@ -36,71 +32,115 @@ declare function Mutation({
36
32
  paramsCasing,
37
33
  pathParamsType,
38
34
  dataReturnType,
39
- typeSchemas,
40
- operation,
35
+ node,
36
+ tsResolver,
41
37
  paramsToTrigger
42
- }: Props$2): KubbReactNode;
38
+ }: Props$4): KubbReactNode;
39
+ //#endregion
40
+ //#region src/components/MutationKey.d.ts
41
+ type Props$3 = {
42
+ name: string;
43
+ typeName: string;
44
+ node: ast.OperationNode;
45
+ paramsCasing: 'camelcase' | undefined;
46
+ pathParamsType: 'object' | 'inline';
47
+ transformer: Transformer | undefined;
48
+ };
49
+ declare function MutationKey({
50
+ name,
51
+ paramsCasing,
52
+ node,
53
+ typeName,
54
+ transformer
55
+ }: Props$3): KubbReactNode;
56
+ declare namespace MutationKey {
57
+ var getParams: () => ast.FunctionParametersNode;
58
+ var getTransformer: Transformer;
59
+ }
43
60
  //#endregion
44
61
  //#region src/components/Query.d.ts
45
- type Props$1 = {
46
- /**
47
- * Name of the function
48
- */
62
+ type Props$2 = {
49
63
  name: string;
50
64
  queryOptionsName: string;
51
65
  queryKeyName: string;
52
66
  queryKeyTypeName: string;
53
- typeSchemas: OperationSchemas;
67
+ node: ast.OperationNode;
68
+ tsResolver: PluginTs['resolver'];
54
69
  paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
55
70
  paramsType: PluginSwr['resolvedOptions']['paramsType'];
56
71
  pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
57
72
  dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType'];
58
- operation: Operation;
59
73
  };
60
74
  declare function Query({
61
75
  name,
62
- typeSchemas,
76
+ node,
77
+ tsResolver,
63
78
  queryKeyName,
64
79
  queryKeyTypeName,
65
80
  queryOptionsName,
66
- operation,
67
81
  dataReturnType,
68
82
  paramsType,
69
83
  paramsCasing,
70
84
  pathParamsType
85
+ }: Props$2): KubbReactNode;
86
+ //#endregion
87
+ //#region src/components/QueryKey.d.ts
88
+ type Props$1 = {
89
+ name: string;
90
+ typeName: string;
91
+ node: ast.OperationNode;
92
+ tsResolver: PluginTs['resolver'];
93
+ paramsCasing: 'camelcase' | undefined;
94
+ pathParamsType: 'object' | 'inline';
95
+ transformer: Transformer | undefined;
96
+ };
97
+ declare function QueryKey({
98
+ name,
99
+ node,
100
+ tsResolver,
101
+ paramsCasing,
102
+ pathParamsType,
103
+ typeName,
104
+ transformer
71
105
  }: Props$1): KubbReactNode;
106
+ declare namespace QueryKey {
107
+ var getParams: (node: ast.OperationNode, options: {
108
+ pathParamsType: "object" | "inline";
109
+ paramsCasing: "camelcase" | undefined;
110
+ resolver: PluginTs["resolver"];
111
+ }) => ast.FunctionParametersNode;
112
+ var getTransformer: Transformer;
113
+ var callPrinter: {
114
+ name: "functionParameters";
115
+ options: {
116
+ mode: "declaration" | "call" | "keys" | "values";
117
+ transformName?: (name: string) => string;
118
+ transformType?: (type: string) => string;
119
+ };
120
+ transform: (node: ast.FunctionParamNode) => string | null | undefined;
121
+ print: (node: ast.FunctionParamNode) => string | null | undefined;
122
+ };
123
+ }
72
124
  //#endregion
73
125
  //#region src/components/QueryOptions.d.ts
74
126
  type Props = {
75
127
  name: string;
76
128
  clientName: string;
77
- typeSchemas: OperationSchemas;
129
+ node: ast.OperationNode;
130
+ tsResolver: PluginTs['resolver'];
78
131
  paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
79
132
  paramsType: PluginSwr['resolvedOptions']['paramsType'];
80
133
  pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
81
134
  };
82
- type GetParamsProps = {
83
- paramsType: PluginSwr['resolvedOptions']['paramsType'];
84
- paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
85
- pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
86
- typeSchemas: OperationSchemas;
87
- };
88
135
  declare function QueryOptions({
89
136
  name,
90
137
  clientName,
91
- typeSchemas,
138
+ node,
139
+ tsResolver,
92
140
  paramsCasing,
93
141
  paramsType,
94
142
  pathParamsType
95
143
  }: Props): KubbReactNode;
96
- declare namespace QueryOptions {
97
- var getParams: ({
98
- paramsType,
99
- paramsCasing,
100
- pathParamsType,
101
- typeSchemas
102
- }: GetParamsProps) => FunctionParams;
103
- }
104
144
  //#endregion
105
145
  export { Mutation, MutationKey, Query, QueryKey, QueryOptions };
106
146
  //# sourceMappingURL=components.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as MutationKey, i as QueryKey, n as QueryOptions, r as Mutation, t as Query } from "./components-DaCTPplv.js";
1
+ import { a as Mutation, i as MutationKey, n as QueryOptions, r as QueryKey, t as Query } from "./components-JQ2KRFCa.js";
2
2
  export { Mutation, MutationKey, Query, QueryKey, QueryOptions };