{"version":3,"file":"index.cjs","names":["ast","ast","ast","ast","isNonNullable","generate","casing","text","getEnumNames","casing","factory.createEnumDeclaration","text","File","getEnumNames","ast.schema.is","text","factory","createRequire","Diagnostics","factory.createUnionDeclaration","factory.print","factory.createRaw","createPrinter","factory.createTypeReferenceNode","factory.createUrlTemplateType","factory.dateOrStringNode","ast.schema.getLiterals","factory.constToTypeNode","ast.schema.narrow","ast.schema.is","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.buildMemberNodes","factory.createArrayDeclaration","factory.buildTupleNode","factory.buildPropertyType","factory.createPropertySignature","factory.appendJSDocToNode","factory.buildIndexSignatures","factory.createOmitDeclaration","factory.wrapNullableOptional","factory.createTypeDeclaration","TypeDeclaration","ast.schema.narrow","getEnumNames","File","ast.mediaType.getBase","ast.mediaType.getKind","ast.mediaType.isJson","ast.http.groupParameters","ast.http.requestBody.getSchema","ast.http.getRequestGroups","ast.http.status.isSuccess","ast.mediaType.isStream","defineGenerator","jsxRenderer","ast.schema.narrow","File","ast.http.groupParameters","ast.http.responses.getImportedNames","ast.http.responses.getUnion","createResolver","casing","resolverCasedFile","resolverOperationParams","resolverOperationResponse","operationKey","defineExtension","Resolver"],"sources":["../../../internals/utils/src/reserved.ts","../../../internals/utils/src/strings.ts","../../../internals/ast/src/http/requestBody.ts","../../../internals/ast/src/http/status.ts","../../../internals/ast/src/http/responses.ts","../../../internals/ast/src/http/index.ts","../../../internals/ast/src/mediaType.ts","../../../internals/ast/src/schema.ts","../src/factory.ts","../src/components/Enum.tsx","../src/utils.ts","../src/printers/printerTs.ts","../src/components/Type.tsx","../../../internals/shared/src/operation.ts","../../../internals/shared/src/resolver.ts","../src/generators/typeGenerator.tsx","../kubb-extension.json","../package.json","../src/resolvers/resolverTs.ts","../src/plugin.ts","../src/printers/functionParams.ts","../src/printers/functionPrinter.ts"],"sourcesContent":["/**\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  'await',\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 isIdentifier(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\n/**\n * Returns `true` when `name` is syntactically a valid identifier, ignoring reserved words.\n *\n * Reserved words and globals (`class`, `name`, `Date`, …) are valid as bare object-literal keys\n * even though they are not valid variable names, so use this (not {@link isValidVarName}) when\n * deciding whether an object key needs quoting.\n *\n * @example\n * ```ts\n * isIdentifier('name')   // true\n * isIdentifier('x-total')// false\n * ```\n */\nexport function isIdentifier(name: string): boolean {\n  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n}\n","import { text } from '@kubb/kit'\n\n// `\\p{`, `\\P{` or `\\u{` behind an odd number of backslashes, or a character outside the BMP: both need the `u` flag.\nconst NEEDS_UNICODE = /(?<!\\\\)(?:\\\\\\\\)*\\\\[pPu]\\{|[\\u{10000}-\\u{10FFFF}]/u\n// Escapes the `u` flag accepts. `\\-` only counts inside a class.\nconst KEPT_ESCAPE = /[A-Za-z0-9^$\\\\.*+?()[\\]{}|/]/\n\n/**\n * Drops the backslash from escapes that the `u` flag rejects: an escaped punctuation character that is\n * not a syntax character, and `\\-` outside a class. Both match the same character without the backslash.\n */\nfunction dropIdentityEscapes(pattern: string): string {\n  let inClass = false\n\n  return pattern.replace(/\\\\(.)|[[\\]]/gs, (match, escaped?: string) => {\n    if (escaped === undefined) {\n      inClass = match === '['\n      return match\n    }\n\n    return KEPT_ESCAPE.test(escaped) || (escaped === '-' && inClass) ? match : escaped\n  })\n}\n\n/**\n * Builds the `RegExp` for a pattern, adding the `u` flag when it uses `\\p{...}`, `\\P{...}` or `\\u{...}`, or\n * holds a character outside the BMP. A pattern that is not valid under `u` keeps the flags it came with.\n */\nfunction toRegExp(pattern: string, flags: string | undefined): RegExp {\n  if (flags?.includes('u') || !NEEDS_UNICODE.test(pattern)) return new RegExp(pattern, flags)\n\n  try {\n    return new RegExp(dropIdentityEscapes(pattern), `${flags ?? ''}u`)\n  } catch {\n    return new RegExp(pattern, flags)\n  }\n}\n\n/**\n * Converts a pattern string into a `new RegExp(...)` constructor call or a regex literal string.\n * Inline flags expressed as a `^(?im)` prefix are extracted and applied to the resulting expression.\n * Pass `null` as the second argument to emit a `/pattern/flags` literal instead.\n *\n * @example\n * ```ts\n * toRegExpString('^(?im)foo')       // 'new RegExp(\"^foo\", \"im\")'\n * toRegExpString('^(?im)foo', null) // '/^foo/im'\n * ```\n */\nexport function toRegExpString(pattern: string, func: string | null = 'RegExp'): string {\n  const raw = text.unquote(pattern)\n\n  const match = raw.match(/^\\^(\\(\\?([igmsuy]+)\\))/i)\n  const replacementTarget = match?.[1] ?? ''\n  const matchedFlags = match?.[2]\n  const cleaned = raw\n    .replace(/^\\\\?\\//, '')\n    .replace(/\\\\?\\/$/, '')\n    .replace(replacementTarget, '')\n\n  const { source, flags } = toRegExp(cleaned, matchedFlags)\n\n  if (func === null) return `/${source}/${flags}`\n\n  return `new ${func}(${JSON.stringify(source)}${flags ? `, ${JSON.stringify(flags)}` : ''})`\n}\n\n/**\n * Renders a dotted path or string array as an optional-chaining accessor expression rooted at\n * `accessor`. Returns `null` for an empty path.\n *\n * @example\n * ```ts\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // \"lastPage?.['pagination']?.['next']?.['id']\"\n * ```\n */\nexport function getNestedAccessor(param: string | Array<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/**\n * Escapes an `@` at the start of a line, so a multi-line description can't start a new JSDoc tag.\n * Editors render `\\@` as `@` in hovers.\n *\n * @example\n * ```ts\n * jsDocEscape('intro\\n@example value') // 'intro\\n\\\\@example value'\n * ```\n */\nexport function jsDocEscape(input: unknown): string {\n  return `${input}`.replace(/^(\\s*)@/gm, '$1\\\\@')\n}\n","import type { OperationNode, SchemaNode } from '@kubb/ast'\n\n/** The schema of the first request body entry, else `undefined` when the operation takes no body. */\nexport function getSchema(node: Pick<OperationNode, 'requestBody'>): SchemaNode | undefined {\n  return node.requestBody?.content?.[0]?.schema\n}\n","import type { ResponseNode, StatusCode } from '@kubb/ast'\n\ntype StatusInput = StatusCode | number | (string & {}) | Pick<ResponseNode, 'statusCode'>\n\nconst classByRange = new Map([\n  ['1xx', 1],\n  ['2xx', 2],\n  ['3xx', 3],\n  ['4xx', 4],\n  ['5xx', 5],\n])\n\n/** The class digit of a status code or range: `2` for `201` and `2xx`, `null` for `default`. */\nfunction statusClass(input: StatusInput): number | null {\n  const statusCode = typeof input === 'object' ? input.statusCode : input\n  const rangeClass = classByRange.get(String(statusCode))\n  if (rangeClass) return rangeClass\n  const code = Number(statusCode)\n  return Number.isNaN(code) ? null : Math.floor(code / 100)\n}\n\nexport { statusClass as getClass }\n\nexport function isSuccess(statusCode: StatusInput): boolean {\n  return statusClass(statusCode) === 2\n}\n\nexport function isError(statusCode: StatusInput): boolean {\n  const code = statusClass(statusCode)\n  return code !== null && code >= 4\n}\n\n/** One concrete code for a status or range: `200` for `2xx` and `default`, the code itself otherwise. */\nexport function toCode(input: StatusInput): number {\n  const statusCode = typeof input === 'object' ? input.statusCode : input\n  const code = Number(statusCode)\n  return Number.isNaN(code) ? (statusClass(statusCode) ?? 2) * 100 : code\n}\n","import { ast, type HttpOperationNode, type OperationNode, type ResponseNode, type SchemaNode } from '@kubb/ast'\nimport { isError, isSuccess } from './status.ts'\n\n/** The `4xx` and `5xx` responses, ranges included. */\nexport function filterError(node: Pick<HttpOperationNode, 'responses'>): Array<ResponseNode> {\n  return node.responses.filter((response) => isError(response.statusCode))\n}\n\n/** The ref names the response bodies import, in order, with repeats. */\nexport function getImportedNames(responses: ReadonlyArray<ResponseNode>): Array<string> {\n  return responses.flatMap((response) => (response.content ?? []).flatMap((entry) => (entry.schema ? ast.graph.getImportedNames(entry.schema) : [])))\n}\n\nexport function filterSuccess(node: Pick<HttpOperationNode, 'responses'>): Array<ResponseNode> {\n  return node.responses.filter((response) => isSuccess(response.statusCode))\n}\n\n/** The success response a client returns: one with a body first, then an exact code over a `2xx` range. */\nexport function findPrimary(node: Pick<HttpOperationNode, 'responses'>): ResponseNode | null {\n  const responses = filterSuccess(node)\n  const withBody = responses.filter((response) => response.content?.some((entry) => entry.contentType))\n  const candidates = withBody.length ? withBody : responses\n  return candidates.find((response) => !Number.isNaN(Number(response.statusCode))) ?? candidates[0] ?? null\n}\n\n/** A union of refs to the success responses with a body, else every response with a body, else `null`. */\nexport function getUnion<TNode extends Pick<OperationNode, 'responses'>>(\n  node: TNode,\n  resolver: { response: { status(node: TNode, statusCode: ResponseNode['statusCode']): string } },\n): SchemaNode | null {\n  const withSchema = node.responses.filter((response) => response.content?.some((entry) => entry.schema))\n  const success = withSchema.filter((response) => isSuccess(response.statusCode))\n  const responses = success.length > 0 ? success : withSchema\n  if (responses.length === 0) return null\n\n  return ast.factory.createSchema({\n    type: 'union',\n    members: responses.map((response) => ast.factory.createSchema({ type: 'ref', name: resolver.response.status(node, response.statusCode) })),\n  })\n}\n","import { ast, type HttpOperationNode, type InputServer, type ParameterNode } from '@kubb/ast'\n\nexport const isOperation = ast.http.isOperation\nexport * as requestBody from './requestBody.ts'\nexport * as responses from './responses.ts'\nexport * as status from './status.ts'\n\n/** The server's URL when it is absolute and has no template variables, else `undefined`. */\nexport function getBaseURL(server: InputServer | undefined): string | undefined {\n  if (!server || server.variables || server.url.includes('{') || !server.url.includes('://')) return undefined\n  return URL.canParse(server.url) ? server.url : undefined\n}\n\n/** Computes once per key; generators visit the same node many times. */\nfunction cached<TKey extends object, TValue>(store: WeakMap<TKey, TValue>, key: TKey, compute: () => TValue): TValue {\n  if (!store.has(key)) store.set(key, compute())\n  return store.get(key)!\n}\n\ntype ParameterGroups = Record<'path' | 'query' | 'header' | 'cookie', Array<ParameterNode>>\n\n// Every plugin's generator visits the same node, so the groups are built once per node.\nconst parametersByNode = new WeakMap<Pick<HttpOperationNode, 'parameters'>, ParameterGroups>()\n\n/** The operation's parameters by location, with a `querystring` parameter in `query`. A repeated name keeps its first parameter. */\nexport function groupParameters(node: Pick<HttpOperationNode, 'parameters'>): ParameterGroups {\n  return cached(parametersByNode, node, () => {\n    const group = (...locations: Array<ParameterNode['in']>) => {\n      const seen = new Set<string>()\n      return locations.flatMap((location) =>\n        node.parameters.filter((param) => {\n          if (param.in !== location || seen.has(param.name)) return false\n          seen.add(param.name)\n          return true\n        }),\n      )\n    }\n    // A `querystring` parameter left whole, such as a JSON one, is sent as the query string, so it joins the query group.\n    return { path: group('path'), query: group('query', 'querystring'), header: group('header'), cookie: group('cookie') }\n  })\n}\n\nexport type RequestGroups = {\n  path: boolean\n  query: boolean\n  body: boolean\n  headers: boolean\n  cookies: boolean\n  /** `cookies` is never required: a browser sends its cookies itself. */\n  required: { path: boolean; query: boolean; headers: boolean; body: boolean }\n  /** No group holds a required member. */\n  isOptional: boolean\n  contentTypes: Array<string>\n  /** More than one body media type has a schema, so a caller must pick one. */\n  hasContentTypeChoice: boolean\n}\n\nconst requestGroupsByNode = new WeakMap<Pick<HttpOperationNode, 'parameters' | 'requestBody'>, RequestGroups>()\n\n/** Which request groups are present, which hold a required member, and the body's media types. Built once per operation. */\nexport function getRequestGroups(node: Pick<HttpOperationNode, 'parameters' | 'requestBody'>): RequestGroups {\n  return cached(requestGroupsByNode, node, () => {\n    const { path, query, header, cookie } = groupParameters(node)\n    const content = node.requestBody?.content ?? []\n    const body = Boolean(content[0]?.schema)\n    const required = {\n      path: path.some((param) => param.required),\n      query: query.some((param) => param.required),\n      headers: header.some((param) => param.required),\n      body: body && node.requestBody?.required === true,\n    }\n\n    return {\n      path: path.length > 0,\n      query: query.length > 0,\n      body,\n      headers: header.length > 0,\n      cookies: cookie.length > 0,\n      required,\n      isOptional: !required.path && !required.query && !required.headers && !required.body,\n      contentTypes: content.map((entry) => entry.contentType),\n      hasContentTypeChoice: content.filter((entry) => entry.schema).length > 1,\n    }\n  })\n}\n","import { ast, type ContentNode, type SchemaNode } from '@kubb/ast'\n\ntype MediaTypeInput = string | { contentType: string }\n\nconst streamMediaTypes = new Set(['application/jsonl', 'application/x-ndjson', 'application/json-seq', 'text/event-stream'])\n\nexport const getBase = ast.mediaType.getBase\nexport const isJson = ast.mediaType.isJson\n\n/** Whether the media type is a stream of items: SSE, JSON Lines, or a `+json-seq` sequence. */\nexport function isStream(mediaType: MediaTypeInput): boolean {\n  const baseType = getBase(mediaType)\n  return streamMediaTypes.has(baseType) || (baseType.startsWith('application/') && baseType.endsWith('+json-seq'))\n}\n\ntype ContentEntry = { contentType: string; schema?: Pick<SchemaNode, 'type'> | null; stream?: ContentNode['stream'] }\n\nconst formKinds: Record<string, 'form' | 'urlencoded'> = { 'multipart/form-data': 'form', 'application/x-www-form-urlencoded': 'urlencoded' }\n\n/** How a client reads or sends a content entry, or `null` for another media type. A `blob` schema is `binary`. */\nexport function getKind(entry: string | ContentEntry): 'json' | 'form' | 'urlencoded' | 'text' | 'binary' | 'eventStream' | 'lineStream' | null {\n  const content = typeof entry === 'string' ? { contentType: entry } : entry\n  const baseType = getBase(content)\n  if (!baseType) return null\n  if (baseType === 'text/event-stream') return 'eventStream'\n  // `multipart/mixed` with an `itemSchema` also has `stream`, but it is a stream of parts, not of JSON values.\n  if (content.stream && isStream(content)) return 'lineStream'\n  if (isJson(baseType)) return 'json'\n  if (formKinds[baseType]) return formKinds[baseType]\n  if (content.schema?.type === 'blob') return 'binary'\n  if (baseType.startsWith('text/')) return 'text'\n  if (baseType === 'application/octet-stream' || baseType === 'application/pdf' || /^(image|audio|video)\\//.test(baseType)) return 'binary'\n  return null\n}\n","import { ast, type NumberSchemaNode } from '@kubb/ast'\n\nexport type IsOptions = ast.schema.IsOptions\nexport type SchemaFollow = ast.schema.SchemaFollow\nexport type SchemaKind = ast.schema.SchemaKind\n\nexport const applyOptionality = ast.schema.applyOptionality\nexport const types = ast.schema.types\nexport const narrow = ast.schema.narrow\nexport const find = ast.schema.find\nexport const getEmbeddedJson = ast.schema.getEmbeddedJson\nexport const is = ast.schema.is\nexport const getLiterals = ast.schema.getLiterals\nexport const inferDiscriminator = ast.schema.inferDiscriminator\nexport const findProperties = ast.schema.findProperties\n\n// Integer formats whose whole range is a safe integer. The 64-bit ranges are not, so they never become a bound.\nconst integerFormatRanges: Record<string, [min: number, max: number]> = {\n  int8: [-(2 ** 7), 2 ** 7 - 1],\n  uint8: [0, 2 ** 8 - 1],\n  int16: [-(2 ** 15), 2 ** 15 - 1],\n  uint16: [0, 2 ** 16 - 1],\n  int32: [-(2 ** 31), 2 ** 31 - 1],\n  uint32: [0, 2 ** 32 - 1],\n}\n\n/**\n * The tightest inclusive bounds of a number schema. An exclusive bound moves to the next point of `step` (`1` for an\n * integer), an integer bound rounds inward, and an integer bound past `Number.MAX_SAFE_INTEGER` is left out, since it\n * prints as a rounded or invalid literal. A number node also applies its `int8` to `uint32` format range and `multipleOf`.\n */\nexport function getNumberBounds({\n  min,\n  max,\n  exclusive,\n  type,\n  format,\n  multipleOf,\n  integer = type === 'integer' || type === 'bigint',\n  step,\n}: Pick<NumberSchemaNode, 'min' | 'max' | 'exclusive'> &\n  Partial<Pick<NumberSchemaNode, 'type' | 'format' | 'multipleOf'>> & { integer?: boolean; step?: number }): {\n  min?: number\n  max?: number\n  multipleOf?: number\n} {\n  const range = integer && format ? integerFormatRanges[format] : undefined\n  const grid = step ?? (integer ? 1 : undefined)\n  const above = (bound: number) => (grid ? (Math.floor(bound / grid) + 1) * grid : bound)\n  const below = (bound: number) => (grid ? (Math.ceil(bound / grid) - 1) * grid : bound)\n  const tightest = (pick: (...bounds: Array<number>) => number, bounds: Array<number | undefined>) => {\n    const usable = bounds.filter((bound): bound is number => bound !== undefined && (!integer || Number.isSafeInteger(bound)))\n    return usable.length ? pick(...usable) : undefined\n  }\n  const lower = tightest(Math.max, [\n    min !== undefined && integer ? Math.ceil(min) : min,\n    exclusive?.min === undefined ? undefined : above(exclusive.min),\n    range?.[0],\n  ])\n  const upper = tightest(Math.min, [\n    max !== undefined && integer ? Math.floor(max) : max,\n    exclusive?.max === undefined ? undefined : below(exclusive.max),\n    range?.[1],\n  ])\n  const keepsStep = multipleOf !== undefined && (!integer || Number.isSafeInteger(multipleOf))\n  return {\n    ...(lower !== undefined ? { min: lower } : {}),\n    ...(upper !== undefined ? { max: upper } : {}),\n    ...(keepsStep ? { multipleOf } : {}),\n  }\n}\n","import { ast } from '@internals/ast'\nimport { casing, text } from '@kubb/kit'\nimport { generate } from 'yuku-codegen'\n\n/**\n * A TS-ESTree node, the AST shape `yuku-codegen` prints. Nodes built here carry no source positions.\n */\nexport type TsNode = { type: string; [key: string]: unknown }\n\nfunction isNumber(value: unknown): value is number {\n  return typeof value === 'number' && !Number.isNaN(value)\n}\n\nexport function isNonNullable<T>(value: T | null | undefined): value is T {\n  return value !== null && value !== undefined\n}\n\n/**\n * Prints `node` as TypeScript source with single quotes and two-space indentation.\n */\nexport function print(node: TsNode): string {\n  return generate(node as unknown as Parameters<typeof generate>[0], { quotes: 'single' }).code\n}\n\n/**\n * Wraps already printed TypeScript, such as a user override result, so it can sit inside a node tree.\n * Parentheses keep a union or function type intact when it lands inside an array or intersection.\n */\nexport function createRaw(text: string): TsNode {\n  const name = { type: 'TSTypeReference', typeName: identifier(text), typeArguments: null }\n  return /[|&?]|=>/.test(text) ? { type: 'TSParenthesizedType', typeAnnotation: name } : name\n}\n\nfunction identifier(name: string): TsNode {\n  return { type: 'Identifier', name }\n}\n\nfunction literal(value: string | number | boolean): TsNode {\n  return { type: 'Literal', value }\n}\n\nfunction createLiteralType(value: string | number | boolean): TsNode {\n  return { type: 'TSLiteralType', literal: literal(value) }\n}\n\n/**\n * Whether `name` can be written as a bare property name instead of a quoted string.\n */\nfunction isValidIdentifier(name: string): boolean {\n  return /^[\\p{ID_Start}$_][\\p{ID_Continue}$‌‍]*$/u.test(name)\n}\n\n/**\n * A property or enum member name, quoted when it is not a valid identifier.\n */\nfunction propertyName(name: string): TsNode {\n  return isValidIdentifier(name) ? identifier(name) : literal(name)\n}\n\n/**\n * Creates a TypeScript intersection type.\n * Returns the single type if only one is provided. `yuku-codegen` adds the parentheses a union member needs.\n */\nexport function createIntersectionDeclaration({ nodes, withParentheses }: { nodes: Array<TsNode>; withParentheses?: boolean }): TsNode | null {\n  if (!nodes.length) {\n    return null\n  }\n\n  if (nodes.length === 1) {\n    return nodes[0] || null\n  }\n\n  const node = { type: 'TSIntersectionType', types: nodes }\n\n  return withParentheses ? { type: 'TSParenthesizedType', typeAnnotation: node } : node\n}\n\n/**\n * Creates a TypeScript array type.\n * Use `arrayType: 'array'` for bracket syntax (`T[]`), or `'generic'` for `Array<T>`.\n *\n * @example Array bracket syntax\n * `createArrayDeclaration({ nodes: [string], arrayType: 'array' }) // → string[]`\n *\n * @example Generic Array syntax\n * `createArrayDeclaration({ nodes: [string], arrayType: 'generic' }) // → Array<string>`\n */\nexport function createArrayDeclaration({ nodes, arrayType = 'array' }: { nodes: Array<TsNode>; arrayType?: 'array' | 'generic' }): TsNode {\n  if (!nodes.length) {\n    return { type: 'TSTupleType', elementTypes: [] }\n  }\n\n  const node = nodes.length === 1 ? nodes[0]! : { type: 'TSUnionType', types: nodes }\n\n  return arrayType === 'generic' ? createTypeReferenceNode('Array', [node]) : { type: 'TSArrayType', elementType: node }\n}\n\n/**\n * Minimum nodes length of 2\n * @example Union type example\n * `string | number`\n */\nexport function createUnionDeclaration({ nodes, withParentheses }: { nodes: Array<TsNode>; withParentheses?: boolean }): TsNode {\n  if (!nodes.length) {\n    return keywordTypeNodes.any\n  }\n\n  if (nodes.length === 1) {\n    return nodes[0]!\n  }\n\n  const node = { type: 'TSUnionType', types: nodes }\n\n  return withParentheses ? { type: 'TSParenthesizedType', typeAnnotation: node } : node\n}\n\n/**\n * Creates a TypeScript property signature for object/interface members.\n * Supports optional markers, readonly modifiers, and type annotations.\n */\nexport function createPropertySignature({\n  readOnly,\n  name,\n  questionToken,\n  type,\n}: {\n  readOnly?: boolean\n  name: string\n  questionToken?: boolean\n  type?: TsNode\n}): TsNode {\n  return {\n    type: 'TSPropertySignature',\n    key: propertyName(name),\n    computed: false,\n    optional: !!questionToken,\n    readonly: !!readOnly,\n    static: false,\n    typeAnnotation: type ? { type: 'TSTypeAnnotation', typeAnnotation: type } : null,\n  }\n}\n\n/**\n * Attaches a JSDoc block built from `comments` to `node`, dropping empty comments.\n */\nexport function appendJSDocToNode<TNode extends TsNode>({ node, comments }: { node: TNode; comments: Array<string | undefined> }): TNode {\n  const lines = comments.filter(Boolean).flatMap((comment = '') => comment.split(/\\r?\\n/))\n\n  if (!lines.length) {\n    return node\n  }\n\n  // `yuku-codegen` prints the comment text as is, so a `*/` inside it would end the block early\n  const value = `*\\n${lines.map((line) => ` * ${line.replaceAll('*/', '*\\\\/')}`.trimEnd()).join('\\n')}\\n `\n\n  return { ...node, comments: [{ type: 'Block', value, position: 'before', sameLine: false }] }\n}\n\n/**\n * Creates a TypeScript type literal (anonymous object type) with one member per line.\n */\nexport function createTypeLiteralNode(members: Array<TsNode>): TsNode {\n  return { type: 'TSTypeLiteral', members }\n}\n\n/**\n * Creates a TypeScript type reference (e.g., `Array<string>`, `Record<K, V>`).\n */\nexport function createTypeReferenceNode(name: string, typeArguments?: Array<TsNode>): TsNode {\n  return {\n    type: 'TSTypeReference',\n    typeName: identifier(name),\n    typeArguments: typeArguments?.length ? { type: 'TSTypeParameterInstantiation', params: typeArguments } : null,\n  }\n}\n\nfunction exportNamed(declaration: TsNode, exportKind: 'type' | 'value'): TsNode {\n  return { type: 'ExportNamedDeclaration', declaration, specifiers: [], source: null, attributes: [], exportKind }\n}\n\n/**\n * Prints a TypeScript type declaration as either a type alias or interface.\n * Uses interface syntax only when requested and the type is an object literal, and attaches JSDoc comments.\n */\nexport function createTypeDeclaration({\n  syntax,\n  isExportable,\n  comments,\n  name,\n  type,\n}: {\n  syntax: 'type' | 'interface'\n  comments: Array<string | undefined>\n  isExportable?: boolean\n  name: string\n  type: TsNode\n}): string {\n  const declaration =\n    syntax === 'interface' && type.type === 'TSTypeLiteral'\n      ? {\n          type: 'TSInterfaceDeclaration',\n          declare: false,\n          id: identifier(name),\n          typeParameters: null,\n          extends: [],\n          body: { type: 'TSInterfaceBody', body: type.members },\n        }\n      : { type: 'TSTypeAliasDeclaration', declare: false, id: identifier(name), typeParameters: null, typeAnnotation: type }\n\n  return print(appendJSDocToNode({ node: isExportable ? exportNamed(declaration, 'type') : declaration, comments }))\n}\n\n/**\n * Converts an enum member value to a literal. Numbers become numeric literals unless `asNumber` is `false`,\n * which emits the string form.\n */\nfunction valueToExpression(value: string | number | boolean, asNumber = isNumber(value)): TsNode {\n  return literal(typeof value === 'boolean' || (asNumber && isNumber(value)) ? value : value.toString())\n}\n\n/**\n * Apply casing transformation to enum keys\n */\nfunction applyEnumKeyCasing(key: string, keyCasing: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none' = 'none'): string {\n  if (keyCasing === 'none') {\n    return key\n  }\n  if (keyCasing === 'screamingSnakeCase') {\n    return casing.screamingSnake(key)\n  }\n  if (keyCasing === 'snakeCase') {\n    return casing.snake(key)\n  }\n  if (keyCasing === 'pascalCase') {\n    return casing.pascal(key)\n  }\n  if (keyCasing === 'camelCase') {\n    return casing.camel(key)\n  }\n  return key\n}\n\n/**\n * Creates a TypeScript enum declaration or equivalent construct in various formats.\n * Returns a tuple of [name declaration, type declaration] - the name declaration may be undefined for certain types.\n *\n * @example\n * ```ts\n * const [name, type] = createEnumDeclaration({\n *   type: 'enum',\n *   name: 'petType',\n *   typeName: 'PetType',\n *   enums: [['cat', 'cat', 'A cat'], ['dog', 'dog']],\n * })\n * ```\n */\nexport function createEnumDeclaration({\n  type = 'enum',\n  name,\n  typeName,\n  enums,\n  enumKeyCasing = 'none',\n}: {\n  /**\n   * Choose to use `enum`, `asConst`, `constEnum`, or `literal` for enums.\n   * - `enum`: TypeScript enum\n   * - `asConst`: const object asserted with `as const` (the caller decides the const name casing)\n   * - `constEnum`: const enum\n   * - `literal`: literal union type\n   * @default `'enum'`\n   */\n  type?: 'enum' | 'asConst' | 'constEnum' | 'literal' | 'inlineLiteral'\n  /**\n   * Enum name in camelCase.\n   */\n  name: string\n  /**\n   * Enum name in PascalCase.\n   */\n  typeName: string\n  enums: Array<[key: string | number, value: string | number | boolean, description?: string]>\n  /**\n   * Choose the casing for enum key names.\n   * @default 'none'\n   */\n  enumKeyCasing?: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none'\n}): [name: string | undefined, type: string] {\n  const typeAlias = (annotation: TsNode) => createTypeDeclaration({ syntax: 'type', isExportable: true, name: typeName, comments: [], type: annotation })\n\n  if (type === 'literal' || type === 'inlineLiteral') {\n    const members = enums\n      .map(([_key, value]) => (isNonNullable(value) ? { type: 'TSLiteralType', literal: valueToExpression(value) } : undefined))\n      .filter(isNonNullable)\n\n    return [undefined, typeAlias(members.length ? createUnionDeclaration({ nodes: members }) : keywordTypeNodes.never)]\n  }\n\n  if (type === 'enum' || type === 'constEnum') {\n    const members = enums\n      .map(([key, value, description]) => {\n        const initializer = valueToExpression(value, Number.parseInt(value.toString(), 10) === value)\n        const memberName = isNumber(Number.parseInt(key.toString(), 10)) ? `${typeName}_${key}` : key?.toString()\n        if (memberName === undefined) return undefined\n\n        const id = propertyName(applyEnumKeyCasing(memberName, enumKeyCasing))\n        return appendJSDocToNode({ node: { type: 'TSEnumMember', id, initializer }, comments: [description] })\n      })\n      .filter(isNonNullable)\n\n    const declaration = {\n      type: 'TSEnumDeclaration',\n      declare: false,\n      const: type === 'constEnum',\n      id: identifier(typeName),\n      body: { type: 'TSEnumBody', members },\n    }\n\n    return [undefined, print(exportNamed(declaration, 'value'))]\n  }\n\n  // used when using `as const` instead of an TypeScript enum.\n  // name is already cased by the caller (camelCase or pascalCase, driven by enum.constCasing).\n  // typeName carries the typeSuffix for the type alias, so we use name for the const identifier.\n  const identifierName = name\n\n  // When there are no enum items (empty or all-null enum), don't generate a runtime const.\n  // Return undefined for nameNode so the barrel won't try to export a non-existent symbol.\n  // Use `never` as the type alias to keep references valid without creating a broken const.\n  if (enums.length === 0) {\n    return [undefined, typeAlias(keywordTypeNodes.never)]\n  }\n\n  // `yuku-codegen` prints object literals on one line, so each property prints on its own and the lines join here\n  const properties = enums\n    .map(([key, value, description]) => {\n      if (key === null || key === undefined) return undefined\n\n      const property = {\n        type: 'Property',\n        kind: 'init',\n        key: propertyName(applyEnumKeyCasing(key.toString(), enumKeyCasing)),\n        value: valueToExpression(value),\n        computed: false,\n        method: false,\n        shorthand: false,\n      }\n      return print(appendJSDocToNode({ node: property, comments: [description] }))\n    })\n    .filter(isNonNullable)\n\n  const query = { type: 'TSTypeQuery', exprName: identifier(identifierName), typeArguments: null }\n\n  return [\n    `export const ${identifierName} = {\\n${properties.map((property) => text.indent({ text: property })).join(',\\n')},\\n} as const;`,\n    typeAlias({\n      type: 'TSIndexedAccessType',\n      objectType: { type: 'TSParenthesizedType', typeAnnotation: query },\n      indexType: { type: 'TSTypeOperator', operator: 'keyof', typeAnnotation: query },\n    }),\n  ]\n}\n\n/**\n * Creates a TypeScript `Omit<T, Keys>` type reference.\n * Optionally wraps the type in `NonNullable<T>` if `nonNullable` is true.\n */\nexport function createOmitDeclaration({ keys, type, nonNullable }: { keys: Array<string> | string; type: TsNode; nonNullable?: boolean }): TsNode {\n  const node = nonNullable ? createTypeReferenceNode('NonNullable', [type]) : type\n\n  return createTypeReferenceNode('Omit', [node, createUnionDeclaration({ nodes: [keys].flat().map(createLiteralType) })])\n}\n\n/**\n * TypeScript keyword types for common primitive types.\n */\nexport const keywordTypeNodes = {\n  any: { type: 'TSAnyKeyword' },\n  unknown: { type: 'TSUnknownKeyword' },\n  void: { type: 'TSVoidKeyword' },\n  number: { type: 'TSNumberKeyword' },\n  integer: { type: 'TSNumberKeyword' },\n  bigint: { type: 'TSBigIntKeyword' },\n  object: { type: 'TSObjectKeyword' },\n  string: { type: 'TSStringKeyword' },\n  boolean: { type: 'TSBooleanKeyword' },\n  undefined: { type: 'TSUndefinedKeyword' },\n  null: { type: 'TSNullKeyword' },\n  never: { type: 'TSNeverKeyword' },\n} as const satisfies Record<string, TsNode>\n\n/**\n * Converts an OAS-style path (e.g. `/pets/{petId}`) or an Express-style path\n * (e.g. `/pets/:petId`) to a TypeScript template literal type\n * like `` `/pets/${string}` ``.\n */\nexport function createUrlTemplateType(path: string): TsNode {\n  // normalized Express `:param` → OAS `{param}` so a single regex handles both.\n  const normalized = path.replace(/:([^/]+)/g, '{$1}')\n\n  if (!normalized.includes('{')) {\n    return createLiteralType(normalized)\n  }\n\n  const segments = normalized.split(/\\{[^}]+\\}/)\n  // `yuku-codegen` escapes the cooked text itself when no raw text is given\n  const quasis = segments.map((cooked, i) => ({ type: 'TemplateElement', value: { cooked }, tail: i === segments.length - 1 }))\n\n  return { type: 'TSTemplateLiteralType', quasis, types: segments.slice(1).map(() => keywordTypeNodes.string) }\n}\n\n// ─── Printer helpers ──────────────────────────────────────────────────────────\n\n/**\n * Converts a const value to a literal type, preserving nested arrays and objects.\n */\nexport function constToTypeNode(value: unknown, format?: 'string' | 'number' | 'boolean'): TsNode {\n  if (value === null) return keywordTypeNodes.null\n  if (Array.isArray(value)) {\n    return { type: 'TSTupleType', elementTypes: value.map((item) => constToTypeNode(item)) }\n  }\n  if (typeof value === 'object') {\n    return createTypeLiteralNode(Object.entries(value).map(([name, item]) => createPropertySignature({ name, type: constToTypeNode(item) })))\n  }\n  if ((format ?? typeof value) === 'boolean') {\n    return createLiteralType(value === true)\n  }\n  return createLiteralType((format ?? typeof value) === 'number' && typeof value === 'number' ? value : String(value))\n}\n\n/**\n * Returns a `Date` reference type when `representation` is `'date'`, otherwise falls back to `string`.\n */\nexport function dateOrStringNode(node: { representation?: string }): TsNode {\n  return node.representation === 'date' ? createTypeReferenceNode('Date') : keywordTypeNodes.string\n}\n\n/**\n * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.\n */\nexport function buildMemberNodes(members: Array<ast.SchemaNode> | undefined, print: (node: ast.SchemaNode) => TsNode | null | undefined): Array<TsNode> {\n  return (members ?? []).map(print).filter(isNonNullable)\n}\n\n/**\n * Builds a TypeScript tuple type from an array schema's `items`,\n * applying min/max slice and optional/rest element rules.\n */\nexport function buildTupleNode(node: ast.ArraySchemaNode, print: (node: ast.SchemaNode) => TsNode | null | undefined): TsNode {\n  let items = (node.items ?? []).map(print).filter(isNonNullable)\n\n  const restNode = node.rest ? (print(node.rest) ?? undefined) : undefined\n  const { min, max } = node\n\n  if (max !== undefined) {\n    items = items.slice(0, max)\n    if (items.length < max && restNode) {\n      items = [...items, ...Array(max - items.length).fill(restNode)]\n    }\n  }\n\n  if (min !== undefined) {\n    items = items.map((item, i) => (i >= min ? { type: 'TSOptionalType', typeAnnotation: item } : item))\n  }\n\n  if (max === undefined && restNode) {\n    items.push({ type: 'TSRestType', typeAnnotation: { type: 'TSArrayType', elementType: restNode } })\n  }\n\n  return { type: 'TSTupleType', elementTypes: items }\n}\n\n/**\n * Appends `| null` and then `| undefined` to a type when requested.\n */\nexport function wrapNullableOptional(type: TsNode, nullable: boolean, addsUndefined: boolean): TsNode {\n  const withNullable = nullable ? createUnionDeclaration({ nodes: [type, keywordTypeNodes.null] }) : type\n  return addsUndefined ? createUnionDeclaration({ nodes: [withNullable, keywordTypeNodes.undefined] }) : withNullable\n}\n\n/**\n * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.\n */\nexport function buildPropertyType(\n  schema: ast.SchemaNode,\n  baseType: TsNode,\n  optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined',\n  optional?: boolean,\n): TsNode {\n  const addsUndefined = optionalType === 'undefined' || optionalType === 'questionTokenAndUndefined'\n  const meta = ast.ref.mergeSchema(schema)\n\n  return wrapNullableOptional(baseType, !!meta.nullable, addsUndefined && !!(optional || meta.nullish || meta.optional))\n}\n\n/**\n * Creates a TypeScript index signature for `additionalProperties` and `patternProperties` on an\n * object schema node. TypeScript allows only one string index signature and its value must be\n * assignable from every named property, so both keywords collapse into a single signature: the\n * union of all value types (deduplicated), or `unknown` when the object also has fixed properties.\n * The key regex of `patternProperties` cannot be expressed by an index signature and is dropped.\n */\nexport function buildIndexSignatures(\n  node: { additionalProperties?: ast.SchemaNode | boolean; patternProperties?: Record<string, ast.SchemaNode> },\n  propertyCount: number,\n  printNode: (node: ast.SchemaNode) => TsNode | null | undefined,\n): Array<TsNode> {\n  const valueTypes: Array<TsNode> = []\n\n  if (node.additionalProperties && node.additionalProperties !== true) {\n    valueTypes.push(printNode(node.additionalProperties) ?? keywordTypeNodes.unknown)\n  } else if (node.additionalProperties === true) {\n    valueTypes.push(keywordTypeNodes.unknown)\n  }\n\n  for (const schema of Object.values(node.patternProperties ?? {})) {\n    const patternType = printNode(schema) ?? keywordTypeNodes.unknown\n    valueTypes.push(schema.nullable ? createUnionDeclaration({ nodes: [patternType, keywordTypeNodes.null] }) : patternType)\n  }\n\n  if (valueTypes.length === 0) return []\n\n  // Deduplicate by printed text, since equal types are separate node objects\n  const distinct = [...new Map(valueTypes.map((type) => [print(type), type])).values()]\n  const valueType = propertyCount > 0 ? keywordTypeNodes.unknown : createUnionDeclaration({ nodes: distinct })\n\n  return [\n    {\n      type: 'TSIndexSignature',\n      parameters: [{ type: 'Identifier', name: 'key', typeAnnotation: { type: 'TSTypeAnnotation', typeAnnotation: keywordTypeNodes.string } }],\n      typeAnnotation: { type: 'TSTypeAnnotation', typeAnnotation: valueType },\n      readonly: false,\n      static: false,\n      accessibility: null,\n    },\n  ]\n}\n","import type { ast } from '@internals/ast'\nimport { ensureValidVarName } from '@internals/utils'\nimport { casing, text } from '@kubb/kit'\nimport { File } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\n\ntype EnumOptions = PluginTs['resolvedOptions']['enum']\n\ntype Props = {\n  node: ast.EnumSchemaNode\n  enum: EnumOptions\n  resolver: ResolverTs\n  key?: string | number | null\n}\n\n/**\n * Resolves the runtime identifier name and the TypeScript type name for an enum schema node.\n *\n * The raw `node.name` may be a YAML key such as `\"enumNames.Type\"` which is not a\n * valid TypeScript identifier. The resolver normalizes it. For inline enum properties the adapter\n * already emits a PascalCase+suffix name, so resolution is typically a no-op.\n *\n * When `constCasing` is `'pascalCase'` and `typeSuffix` is empty, the const and the type\n * resolve to the same name, which TypeScript merges into a single value+type declaration.\n */\nexport function getEnumNames({ node, enum: enumOptions, resolver }: { node: ast.EnumSchemaNode; enum: EnumOptions; resolver: ResolverTs }): {\n  enumName: string\n  typeName: string\n} {\n  const resolved = resolver.name(node.name!)\n  const enumName = enumOptions.constCasing === 'pascalCase' ? resolved : ensureValidVarName(casing.camel(node.name!))\n  const typeName = enumOptions.type === 'asConst' ? resolver.enum.keyName(node, enumOptions.typeSuffix) : resolved\n\n  return { enumName, typeName }\n}\n\n/**\n * Renders the enum declaration(s) for a single named `EnumSchemaNode`.\n *\n * Depending on `enum.type` this may emit:\n * - A runtime object (`asConst`) plus a `typeof` type alias\n * - A `const enum` or plain `enum` declaration (`constEnum` / `enum`)\n * - A union literal type alias (`literal`)\n *\n * The emitted `File.Source` nodes carry the resolved names so that the barrel\n * index picks up the correct export identifiers.\n */\nexport function Enum({ node, enum: enumOptions, resolver }: Props): KubbReactNode {\n  const { enumName, typeName } = getEnumNames({ node, enum: enumOptions, resolver })\n\n  const [nameNode, typeNode] = factory.createEnumDeclaration({\n    name: enumName,\n    typeName,\n    enums: (node.namedEnumValues?.map((v) => [text.unquote(v.name.toString()), v.value, v.description]) ??\n      node.enumValues?.filter((v): v is NonNullable<typeof v> => v !== null && v !== undefined).map((v) => [text.unquote(v.toString()), v]) ??\n      []) as Array<[string | number, string | number | boolean, string?]>,\n    type: enumOptions.type,\n    enumKeyCasing: enumOptions.keyCasing,\n  })\n\n  // When the const and the type share a name (pascalCase const + empty typeSuffix) they merge into\n  // one declaration. The const carries the barrel export, so keep the type alias in the file but out\n  // of the barrel to avoid re-exporting the name a second time as `export type { … }`.\n  const namesMerge = !!nameNode && enumName === typeName\n\n  return (\n    <>\n      {nameNode && (\n        <File.Source name={enumName} pointer={node.pointer} isExportable isIndexable isTypeOnly={false}>\n          {nameNode}\n        </File.Source>\n      )}\n      <File.Source\n        name={typeName}\n        pointer={node.pointer}\n        isIndexable={!namesMerge}\n        isExportable={!namesMerge && enumOptions.type !== 'inlineLiteral'}\n        isTypeOnly={['asConst', 'literal', undefined].includes(enumOptions.type)}\n      >\n        {typeNode}\n      </File.Source>\n    </>\n  )\n}\n","import { ast } from '@internals/ast'\nimport { jsDocEscape } from '@internals/utils'\nimport { text } from '@kubb/kit'\nimport { getEnumNames } from './components/Enum.tsx'\nimport type { PluginTs, ResolverTs } from './types.ts'\n\n/**\n * Renames inline enum declarations and their uses together.\n */\nexport function resolveInlineEnumNames({\n  node,\n  owner,\n  resolver,\n  enumOptions,\n}: {\n  node: ast.SchemaNode\n  owner: string\n  resolver: ResolverTs\n  enumOptions: PluginTs['resolvedOptions']['enum']\n}): ast.SchemaNode {\n  return ast.node.transform(node, {\n    schema(child) {\n      if (child === node || child.type !== 'enum' || !child.name) return\n      const name = resolver.resolveName({\n        key: ['enum', owner, child.pointer ?? child.name],\n        name: child.name,\n        normalize: (value) => {\n          // An `asConst` enum emits a value and a type alias, and the name has to be free as both.\n          const { enumName, typeName } = getEnumNames({ node: { ...child, name: value }, enum: enumOptions, resolver })\n          return enumOptions.type === 'literal' ? [typeName] : [enumName, typeName]\n        },\n      })\n      return name === child.name ? undefined : { ...child, name }\n    },\n  })\n}\n\n/**\n * Resolves the type name an enum schema is referenced by. An enum emitted as a `const` object\n * with a `typeSuffix` uses its suffixed key alias (e.g. `StatusKey`); every other schema uses its\n * plain resolved name.\n */\ntype EnumTypeNameProps = {\n  resolver: ResolverTs\n  name: string\n  enumOptions: { type?: string; typeSuffix?: string } | undefined\n  isEnum: boolean\n}\n\nexport function enumTypeName({ resolver, name, enumOptions, isEnum }: EnumTypeNameProps): string {\n  return isEnum && enumOptions?.type === 'asConst' && enumOptions.typeSuffix ? resolver.enum.keyName({ name }, enumOptions.typeSuffix) : resolver.name(name)\n}\n\n/**\n * Tells whether a `const` (single-value enum) should render as a bare literal type (`'active'`)\n * rather than a named enum reference or a runtime enum declaration.\n *\n * The parser folds `const` into a single-value enum node. The adapter decides which schemas are\n * named enums and lists them in `enumSchemaNames`, and references to those names get suffixed (for\n * example `StatusKey`). A const renders as a literal only when the adapter has not registered it as\n * a named enum, which keeps the declaration and its references in sync across adapter versions.\n */\nexport function isInlineConstEnum(node: ast.EnumSchemaNode, enumSchemaNames?: ReadonlySet<string>): boolean {\n  return ast.schema.is(node, 'const') && !(node.name && enumSchemaNames?.has(node.name))\n}\n\nfunction isSchemaOptional(schema: ast.SchemaNode): boolean {\n  return Boolean(('optional' in schema && schema.optional) || ('nullish' in schema && schema.nullish))\n}\n\nfunction formatExample(value: unknown): string {\n  if (value === null || typeof value !== 'object') {\n    return String(value)\n  }\n\n  const rendered = JSON.stringify(value) ?? String(value)\n  return rendered.replaceAll('*/', '*\\\\/')\n}\n\n/**\n * Collects JSDoc annotation strings for a schema node.\n *\n * Only uses official JSDoc tags from https://jsdoc.app/: `@description`, `@deprecated`, `@minimum`, `@maximum`, `@minLength`,\n * `@maxLength`, `@pattern`, `@default`, `@example`, `@see` and `@type`.\n */\nexport function buildPropertyJSDocComments(schema: ast.SchemaNode, optional?: boolean): Array<string | undefined> {\n  const meta = ast.ref.mergeSchema(schema)\n\n  const isArray = meta?.primitive === 'array'\n  // An object's `min`/`max` count properties, which no JSDoc tag describes.\n  const isObject = meta?.type === 'object'\n  const isNumeric = meta?.primitive === 'number' || meta?.primitive === 'integer' || meta?.primitive === 'bigint'\n\n  const hasDescription = meta && 'description' in meta && meta.description\n\n  const formatComment =\n    meta && 'format' in meta && meta.format\n      ? hasDescription\n        ? // Empty line between description and format\n          [' ', `Format: \\`${meta.format}\\``]\n        : ['@description', `Format: \\`${meta.format}\\``]\n      : []\n\n  // OAS 3.1 carries schema examples as an `examples` array, one `@example` line each.\n  const exampleValues = meta?.examples ?? []\n\n  const comments = [\n    hasDescription ? `@description ${jsDocEscape(meta.description)}` : null,\n    ...formatComment,\n    meta && 'deprecated' in meta && meta.deprecated ? '@deprecated' : null,\n    // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength\n    !isArray && !isObject && meta && 'min' in meta && meta.min !== undefined ? `@${isNumeric ? 'minimum' : 'minLength'} ${meta.min}` : null,\n    !isArray && !isObject && meta && 'max' in meta && meta.max !== undefined ? `@${isNumeric ? 'maximum' : 'maxLength'} ${meta.max}` : null,\n    meta && 'pattern' in meta && meta.pattern ? `@pattern ${meta.pattern}` : null,\n    meta && 'default' in meta && meta.default !== undefined\n      ? `@default ${'primitive' in meta && meta.primitive === 'string' && typeof meta.default === 'string' ? text.quote(meta.default) : formatExample(meta.default)}`\n      : null,\n    ...exampleValues.map((example) => `@example ${formatExample(example)}`),\n    meta?.externalDocs ? `@see ${jsDocEscape([meta.externalDocs.url, meta.externalDocs.description].filter(Boolean).join(' '))}` : null,\n  ].filter(Boolean)\n\n  // `@type` merely repeats the TypeScript type already sitting next to the property, so it only\n  // earns its place inside a comment block that exists for another reason. Bare, it would just\n  // add bytes with no information a reader can't already see in the signature.\n  const typeTag =\n    // A binary schema's primitive is `string`, which would contradict its `Blob` type.\n    comments.length && !ast.schema.is(schema, 'binary', { follow: ['ref', 'array'] }) && meta && 'primitive' in meta && meta.primitive\n      ? [`@type ${meta.primitive}`, (optional ?? isSchemaOptional(schema)) ? ' | undefined' : null].filter(Boolean).join('')\n      : null\n\n  return [...comments, typeTag].filter(Boolean)\n}\n\n/**\n * The example values. With `serialized`, each `serializedValue` is added as a `<caption>Serialized</caption>` example.\n */\nexport function getExampleValues(examples: Array<ast.ExampleNode> | undefined, serialized = false): Array<unknown> | undefined {\n  const values = (examples ?? []).flatMap((example) => [\n    ...(example.value !== undefined ? [example.value] : []),\n    ...(serialized && example.serializedValue !== undefined ? [`<caption>Serialized</caption> ${jsDocEscape(example.serializedValue)}`] : []),\n  ])\n  return values.length > 0 ? values : undefined\n}\n\n/**\n * The JSDoc lines of a response type: `@summary`, and one `@see` per link, such as `@see getPet: getPet({ petId: $response.body#/id })`.\n */\nexport function buildResponseComments(response: ast.ResponseNode): Array<string> {\n  const links = Object.entries(response.links ?? {}).map(([name, link]) => {\n    const values = { ...link.parameters, ...(link.requestBody !== undefined ? { body: link.requestBody } : {}) }\n    const args = Object.entries(values).map(([key, value]) => `${key}: ${formatExample(value)}`)\n    return `@see ${jsDocEscape(`${name}: ${link.operationId ?? link.operationRef ?? ''}(${args.length ? `{ ${args.join(', ')} }` : ''})`)}`\n  })\n  return [...(response.summary ? [`@summary ${jsDocEscape(response.summary)}`] : []), ...links]\n}\n\ntype BuildParamsSchemaOptions = {\n  params: Array<ast.ParameterNode>\n  /**\n   * Adds each serialized example to `examples` as a `<caption>Serialized</caption>` JSDoc line.\n   * Leave it off when `examples` must hold values, such as for mocks.\n   */\n  serializedExamples?: boolean\n}\n\n/**\n * Builds the object schema for one parameter group or a response's headers. Each entry embeds its own schema and JSDoc,\n * so the group is the only type these entries are exported as.\n */\nexport function buildParams({ params, serializedExamples }: BuildParamsSchemaOptions): ast.SchemaNode {\n  const pointer = params[0]?.pointer\n  return ast.factory.createSchema({\n    type: 'object',\n    // The group points at the `parameters` list or `headers` map that declares its first parameter.\n    pointer: pointer?.slice(0, pointer.lastIndexOf('/')),\n    properties: params.map((param) =>\n      ast.factory.createProperty({\n        name: param.name,\n        required: param.required,\n        schema: ast.factory.createSchema({\n          ...param.schema,\n          optional: !param.required,\n          deprecated: param.deprecated || param.schema.deprecated,\n          examples: getExampleValues(param.examples, serializedExamples) ?? param.schema.examples,\n        }),\n      }),\n    ),\n  })\n}\n","import { ast } from '@internals/ast'\nimport { createRequire } from 'node:module'\nimport { createPrinter, Diagnostics } from '@kubb/kit'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { buildPropertyJSDocComments, enumTypeName, isInlineConstEnum } from '../utils.ts'\n\nconst { isNonNullable } = factory\n\nconst requireModule = createRequire(import.meta.url)\n\n/**\n * Loads `@kubb/parser-ts` on first use. It is an optional peer dependency: only a deprecated `printer.nodes`\n * handler that returns a TypeScript compiler node needs it. Loads synchronously because node handlers are synchronous.\n */\nexport function loadParserTs(load = () => requireModule('@kubb/parser-ts') as typeof import('@kubb/parser-ts')): typeof import('@kubb/parser-ts') {\n  try {\n    return load()\n  } catch (error) {\n    // Node says \"Cannot find module '@kubb/parser-ts'\" and Yarn PnP \"... tried to access @kubb/parser-ts ...\"; later lines hold the require stack\n    if ((error as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND' || !(error as Error).message.split('\\n')[0]!.includes('@kubb/parser-ts')) throw error\n    throw new Diagnostics.Error({\n      code: Diagnostics.code.missingDependency,\n      severity: 'error',\n      message: 'Missing dependency: @kubb/parser-ts. A `printer.nodes` handler returned a TypeScript compiler node, and printing it needs @kubb/parser-ts.',\n      help: 'Run `npm i -D @kubb/parser-ts` in the project, or return a string from the handler.',\n      plugin: 'plugin-ts',\n    })\n  }\n}\n\n/**\n * Partial map of node-type overrides for the TypeScript printer.\n *\n * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`). The function\n * replaces the built-in handler for that node type and returns the TypeScript type as a string.\n * Use `this.transform` to recurse into nested schema nodes, and `this.options` to read printer options.\n *\n * @example Override the `date` handler\n * ```ts\n * pluginTs({\n *   printer: {\n *     nodes: {\n *       date(node) {\n *         return 'Date'\n *       },\n *     },\n *   },\n * })\n * ```\n */\nexport type PrinterTsNodes = ast.PrinterPartial<string | DeprecatedTsNode, PrinterTsOptions>\n\n/** @deprecated A TypeScript compiler node returned by an override. Return a string; removed in the next major. */\ntype DeprecatedTsNode = { readonly kind: number }\n\nexport type PrinterTsOptions = {\n  /**\n   * Mark parameters as optional with `?` or `| undefined`.\n   * - `'questionToken'` adds `?` to properties\n   * - `'undefined'` adds `| undefined` to types\n   *\n   * @default `'questionToken'`\n   */\n  optionalType: PluginTs['resolvedOptions']['optionalType']\n  /**\n   * Array representation style.\n   * - `'array'` uses bracket notation (`T[]`)\n   * - `'generic'` uses generic syntax (`Array<T>`)\n   *\n   * @default `'array'`\n   */\n  arrayType: PluginTs['resolvedOptions']['arrayType']\n  /**\n   * Grouped enum settings. The printer emits references to enums, not the enum declarations, so only\n   * `type` (the output format) and `typeSuffix` (the enum key reference suffix) matter here.\n   * `constCasing` and `keyCasing` are ignored.\n   */\n  enum: PluginTs['resolvedOptions']['enum']\n  /**\n   * Syntax for generated declarations.\n   * - `'type'` generates type aliases\n   * - `'interface'` generates interface declarations\n   *\n   * @default `'type'`\n   */\n  syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n  /**\n   * Exported name for the type declaration.\n   * When omitted, returns only the raw type node.\n   */\n  name?: string\n\n  /**\n   * JSDoc comment to attach to the generated type.\n   */\n  description?: string\n  /**\n   * `@example` values for the generated type, such as a media type's `examples`. Replaces the schema's own.\n   */\n  examples?: Array<unknown>\n  /**\n   * JSDoc lines put before the schema's own, such as a response's `@summary`.\n   */\n  comments?: Array<string>\n  /**\n   * Properties to exclude using `Omit<Type, Keys>`.\n   * Forces type alias syntax regardless of `syntaxType` setting.\n   */\n  keysToOmit?: Array<string> | null\n  /**\n   * Transforms raw schema names into valid TypeScript identifiers.\n   */\n  resolver: ResolverTs\n  /**\n   * Schema names that represent enums for suffixed key references.\n   */\n  enumSchemaNames?: ReadonlySet<string>\n  /**\n   * Custom handler map for node type overrides.\n   */\n  nodes?: PrinterTsNodes\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → a TS-ESTree node, printed to a type string or a full declaration string.\n */\nexport type PrinterTsFactory = ast.PrinterFactoryOptions<'typescript', PrinterTsOptions, factory.TsNode, string>\n\ntype PrinterTs = PrinterTsFactory\n\ntype HandlerContext = { transform: (node: ast.SchemaNode) => factory.TsNode | null }\n\n// Adds the `| null` of an OpenAPI 3.0 `nullable: true` set on an array item or union member itself.\nfunction printNullable(node: ast.SchemaNode, print: (node: ast.SchemaNode) => factory.TsNode | null | undefined): factory.TsNode | null | undefined {\n  const type = print(node)\n  return type && node.nullable ? factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] }) : type\n}\n\n/**\n * Adapts user overrides, which work in strings, to the node-based printer: `this.transform` hands them printed\n * strings and their result is wrapped back into a node. A deprecated compiler node prints through `@kubb/parser-ts`.\n */\nfunction toNodeHandlers(nodes: PrinterTsNodes | undefined): ast.PrinterPartial<factory.TsNode, PrinterTsOptions> {\n  return Object.fromEntries(\n    Object.entries(nodes ?? {}).map(([type, handler]) => [\n      type,\n      function (this: HandlerContext, node: ast.SchemaNode) {\n        const transform = (child: ast.SchemaNode) => {\n          const output = this.transform(child)\n          return output ? factory.print(output) : null\n        }\n        const result = (handler as (this: unknown, node: ast.SchemaNode) => string | DeprecatedTsNode | null | undefined).call({ ...this, transform }, node)\n        if (result === null || result === undefined) return result\n        return factory.createRaw(\n          typeof result === 'string'\n            ? result\n            : loadParserTs()\n                .parserTs()\n                .print(result as never)\n                .trimEnd(),\n        )\n      },\n    ]),\n  )\n}\n\n/**\n * TypeScript type printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST node into TypeScript source:\n * - **`printer.print(node)`** — when `options.name` is set, returns a full\n *   `type Name = …` or `interface Name { … }` declaration.\n *   Without `name`, returns the type for the schema, such as `string | null`.\n *\n * Dispatches on `node.type` to the appropriate handler in `nodes`. Options are closed\n * over per printer instance, so each call to `printerTs(options)` produces an independent printer.\n *\n * @example Raw type node (no `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enum: { type: 'inlineLiteral' } })\n * const type = printer.print(schemaNode) // 'string | null'\n * ```\n *\n * @example Full declaration (with `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enum: { type: 'inlineLiteral' }, typeName: 'MyType' })\n * const declaration = printer.print(schemaNode) // 'export type MyType = …'\n * ```\n */\nexport const printerTs = createPrinter<PrinterTs>((options) => {\n  const addsUndefined = options.optionalType === 'undefined' || options.optionalType === 'questionTokenAndUndefined'\n\n  return {\n    name: 'typescript',\n    options,\n    nodes: {\n      any: () => factory.keywordTypeNodes.any,\n      unknown: () => factory.keywordTypeNodes.unknown,\n      void: () => factory.keywordTypeNodes.void,\n      never: () => factory.keywordTypeNodes.never,\n      boolean: () => factory.keywordTypeNodes.boolean,\n      null: () => factory.keywordTypeNodes.null,\n      blob: () => factory.createTypeReferenceNode('Blob'),\n      string: () => factory.keywordTypeNodes.string,\n      uuid: () => factory.keywordTypeNodes.string,\n      email: () => factory.keywordTypeNodes.string,\n      url: (node) => {\n        if (node.path) {\n          return factory.createUrlTemplateType(node.path)\n        }\n        return factory.keywordTypeNodes.string\n      },\n      ipv4: () => factory.keywordTypeNodes.string,\n      ipv6: () => factory.keywordTypeNodes.string,\n      datetime: () => factory.keywordTypeNodes.string,\n      number: () => factory.keywordTypeNodes.number,\n      integer: () => factory.keywordTypeNodes.number,\n      bigint: () => factory.keywordTypeNodes.bigint,\n      date: factory.dateOrStringNode,\n      time: factory.dateOrStringNode,\n      ref(node) {\n        if (!node.name) {\n          return null\n        }\n        // `node.name` may have been overridden (e.g. by the single-member allOf flatten using the\n        // property-derived child name), so resolve the target through `ast.ref.getName` instead.\n        const refName = ast.ref.getName(node)\n        if (!refName) {\n          return null\n        }\n\n        // When a Key suffix is configured, enum refs must use the suffixed name (e.g. `StatusKey`)\n        // so the reference matches what the enum file actually exports.\n        const name = node.ref\n          ? enumTypeName({\n              resolver: this.options.resolver,\n              name: refName,\n              enumOptions: this.options.enum,\n              isEnum: !!this.options.enumSchemaNames?.has(refName),\n            })\n          : refName\n\n        return factory.createTypeReferenceNode(name)\n      },\n      enum(node) {\n        const values = ast.schema.getLiterals(node)\n\n        if (values.some((value) => value !== null && typeof value === 'object')) {\n          return factory.createUnionDeclaration({ nodes: values.map((value) => factory.constToTypeNode(value)) })\n        }\n\n        // A `const` (single-value enum) the adapter did not register as a named enum emits the bare\n        // literal regardless of `enum.type`, matching how its references resolve.\n        if (this.options.enum.type === 'inlineLiteral' || !node.name || isInlineConstEnum(node, this.options.enumSchemaNames)) {\n          const literalNodes = values\n            .filter((v): v is string | number | boolean => v !== null && v !== undefined)\n            .map((value) => factory.constToTypeNode(value, typeof value as 'string' | 'number' | 'boolean'))\n            .filter(isNonNullable)\n\n          return factory.createUnionDeclaration({ nodes: literalNodes })\n        }\n\n        const resolvedName = enumTypeName({ resolver: this.options.resolver, name: node.name, enumOptions: this.options.enum, isEnum: true })\n\n        return factory.createTypeReferenceNode(resolvedName)\n      },\n      union(node) {\n        const members = node.members ?? []\n\n        const hasStringLiteral = members.some((m) => {\n          const enumNode = ast.schema.narrow(m, ast.schema.types.enum)\n          return enumNode?.primitive === 'string'\n        })\n        const hasPlainString = members.some((m) => ast.schema.is(m, 'string'))\n\n        if (hasStringLiteral && hasPlainString) {\n          const memberNodes = members\n            .map((m) => {\n              const print = (node: ast.SchemaNode) =>\n                ast.schema.is(node, 'string')\n                  ? factory.createIntersectionDeclaration({ nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])] })\n                  : this.transform(node)\n\n              return printNullable(m, print)\n            })\n            .filter(isNonNullable)\n\n          return factory.createUnionDeclaration({ nodes: memberNodes })\n        }\n\n        return factory.createUnionDeclaration({ nodes: factory.buildMemberNodes(members, (member) => printNullable(member, this.transform)) })\n      },\n      intersection(node) {\n        return factory.createIntersectionDeclaration({ nodes: factory.buildMemberNodes(node.members, this.transform) })\n      },\n      array(node) {\n        const itemNodes = (node.items ?? []).map((item) => printNullable(item, this.transform)).filter(isNonNullable)\n\n        return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType })\n      },\n      tuple(node) {\n        return factory.buildTupleNode(node, (item) => printNullable(item, this.transform))\n      },\n      object(node) {\n        const { transform, options } = this\n\n        const keySchema = node.propertyNames && ast.ref.mergeSchema(node.propertyNames)\n        if (\n          !node.properties.length &&\n          !Object.keys(node.patternProperties ?? {}).length &&\n          node.propertyNames &&\n          keySchema?.type === 'enum' &&\n          node.additionalProperties !== false\n        ) {\n          const keyType = transform(node.propertyNames) ?? factory.keywordTypeNodes.string\n          const valueSchema = typeof node.additionalProperties === 'object' ? node.additionalProperties : ast.factory.createSchema({ type: 'unknown' })\n          const valueType = factory.buildPropertyType(valueSchema, transform(valueSchema) ?? factory.keywordTypeNodes.unknown, options.optionalType, false)\n\n          return factory.createTypeReferenceNode('Partial', [factory.createTypeReferenceNode('Record', [keyType, valueType])])\n        }\n\n        const addsQuestionToken = options.optionalType === 'questionToken' || options.optionalType === 'questionTokenAndUndefined'\n\n        const propertyNodes: Array<factory.TsNode> = node.properties.map((property) => {\n          const { name } = property\n          const output = transform(property.schema)\n          const baseType = output ?? factory.keywordTypeNodes.unknown\n          const optional = !property.required || !!property.schema.optional || !!property.schema.nullish\n          const type = factory.buildPropertyType(property.schema, baseType, options.optionalType, optional)\n          const propMeta = ast.ref.mergeSchema(property.schema)\n\n          const propertyNode = factory.createPropertySignature({\n            questionToken: optional ? addsQuestionToken : false,\n            name,\n            type,\n            readOnly: propMeta?.readOnly,\n          })\n\n          // A binary property is a file part of a form upload, where only a `File` carries a filename.\n          const binaryRemark = ast.schema.is(property.schema, 'binary', { follow: ['ref', 'array'] })\n            ? '@remarks Pass a `File` to send its filename. A plain `Blob` is sent with the filename `blob`.'\n            : undefined\n          const comments = [...buildPropertyJSDocComments(property.schema, optional), binaryRemark]\n\n          return factory.appendJSDocToNode({ node: propertyNode, comments })\n        })\n\n        const allElements = [...propertyNodes, ...factory.buildIndexSignatures(node, propertyNodes.length, transform)]\n\n        if (!allElements.length) {\n          return factory.keywordTypeNodes.object\n        }\n\n        return factory.createTypeLiteralNode(allElements)\n      },\n      ...toNodeHandlers(options.nodes),\n    },\n    print(node) {\n      const { name, syntaxType = 'type', description, examples, comments = [], keysToOmit } = this.options\n\n      const transformed = this.transform(node)\n      if (!transformed) return null\n\n      // For ref nodes, structural metadata lives on node.schema rather than the ref node itself.\n      const meta = ast.ref.mergeSchema(node)\n\n      // Without name, apply modifiers inline and return.\n      if (!name) {\n        const omitted = keysToOmit?.length ? factory.createOmitDeclaration({ keys: keysToOmit, type: transformed, nonNullable: true }) : transformed\n        return factory.print(factory.wrapNullableOptional(omitted, !!meta.nullable, !!(meta.nullish || meta.optional) && addsUndefined))\n      }\n\n      // When keysToOmit is present, wrap with Omit first, then apply nullable/optional\n      // modifiers so they are not swallowed by NonNullable inside createOmitDeclaration.\n      const inner = (() => {\n        const omitted = keysToOmit?.length ? factory.createOmitDeclaration({ keys: keysToOmit, type: transformed, nonNullable: true }) : transformed\n        // For named type declarations (type aliases), optional/nullish always produces | undefined\n        // regardless of optionalType — the questionToken ? modifier only applies to object properties.\n        return factory.wrapNullableOptional(omitted, !!meta.nullable, !!(meta.nullish || meta.optional))\n      })()\n\n      const useTypeGeneration = syntaxType === 'type' || !!keysToOmit?.length\n\n      return factory.createTypeDeclaration({\n        name,\n        isExportable: true,\n        type: inner,\n        syntax: useTypeGeneration ? 'type' : 'interface',\n        comments: [\n          ...comments,\n          ...buildPropertyJSDocComments({\n            ...meta,\n            description,\n            examples: examples?.length ? examples : meta.examples,\n          }),\n        ],\n      })\n    },\n  }\n})\n","import { ast } from '@internals/ast'\nimport { File, Type as TypeDeclaration } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx'\nimport { printerTs, type PrinterTsFactory } from '../printers/printerTs.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { isInlineConstEnum } from '../utils.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n  name: string\n  node: ast.SchemaNode\n  /**\n   * Pre-configured printer instance created by the generator.\n   * Created with `printerTs({ ..., nodes: options.printer?.nodes })`.\n   */\n  printer: ast.Printer<PrinterTsFactory>\n  enum: PluginTs['resolvedOptions']['enum']\n  resolver: ResolverTs\n  /**\n   * Marks the source inline, so importing files absorb the type. Set by `pluginTs({ operations: 'inline' })`.\n   */\n  inline?: boolean\n}\n\nexport function Type({ name, node, printer, enum: enumOptions, resolver, inline }: Props): KubbReactNode {\n  if (inline) {\n    // An inline type has no file to declare its enums in, so they print as literal unions.\n    const withoutEnums = ast.node.transform(node, { schema: (n) => (n.type === ast.schema.types.enum && n.name ? { ...n, name: undefined } : undefined) })\n    // Property JSDoc would repeat in every file that absorbs the type; the schema files keep theirs.\n    const expression = printerTs({ ...printer.options, name: undefined })\n      .print(withoutEnums)\n      ?.replace(/\\/\\*\\*[\\s\\S]*?\\*\\/\\s*/g, '')\n    if (!expression) return\n\n    // The file is never written. The body becomes the inline expression and keeps its imports in use.\n    return (\n      <TypeDeclaration export name={name} inline>\n        {expression}\n      </TypeDeclaration>\n    )\n  }\n\n  const enumSchemaNodes = ast.node.collect<ast.EnumSchemaNode>(node, {\n    schema(n): ast.EnumSchemaNode | undefined {\n      const enumNode = ast.schema.narrow(n, ast.schema.types.enum)\n      // Skip an inline `const` (single-value enum the adapter did not register): it renders as a\n      // literal, so it gets no runtime enum declaration.\n      if (enumNode?.name && !isInlineConstEnum(enumNode, printer.options.enumSchemaNames)) return enumNode\n    },\n  })\n\n  const output = printer.print(node)\n  const printerImports = printer.drainImports()\n\n  if (!output) {\n    return\n  }\n\n  const enums = [...new Map(enumSchemaNodes.map((n) => [n.name, n])).values()].map((node) => {\n    return {\n      node,\n      ...getEnumNames({ node, enum: enumOptions, resolver }),\n    }\n  })\n\n  // Skip enum exports when using inlineLiteral\n  const shouldExportEnums = enumOptions.type !== 'inlineLiteral'\n  const shouldExportType = enumOptions.type === 'inlineLiteral' || enums.every((item) => item.typeName !== name)\n\n  return (\n    <>\n      {shouldExportEnums && enums.map(({ node }) => <Enum key={node.name} node={node} enum={enumOptions} resolver={resolver} />)}\n      {shouldExportType && (\n        <>\n          {printerImports.map((imp) => (\n            <File.Import key={[name, imp.path, imp.name].join('-')} {...imp} />\n          ))}\n          <File.Source name={name} pointer={node.pointer} isTypeOnly isExportable isIndexable>\n            {output}\n          </File.Source>\n        </>\n      )}\n    </>\n  )\n}\n","import { ast } from '@internals/ast'\nimport { jsDocEscape } from '@internals/utils'\nimport { type Group, type Memo, type Output, type Resolver, type ResolverFileParams } from '@kubb/kit'\n\n/**\n * Builds the `ResolverFileParams` every operation generator passes to\n * `resolver.file`: a file named `name`, tagged by the operation's first\n * tag (or `'default'`), at the operation's path. Centralizes the entry object\n * that was repeated at dozens of call sites across the client and query plugins.\n *\n * @example\n * ```ts\n * resolver.file(operationFileEntry(node, node.operationId), { root, output, group })\n * ```\n */\nexport function operationFileEntry(node: ast.OperationNode, name: string, extname: ResolverFileParams['extname'] = '.ts'): ResolverFileParams {\n  return {\n    name,\n    extname,\n    tag: node.tags[0] ?? 'default',\n    path: node.path,\n  }\n}\n\n/**\n * Resolves the file a schema-emitting plugin (`plugin-ts`, `plugin-zod`, `plugin-faker`) writes\n * `node` to, cached in `ctx.memo` under the resolver's plugin name and the\n * operation. The plugin itself and every plugin that imports from it call this, so they all get\n * the same path.\n *\n * When that path matches the file of a component schema in `ctx.schemas`, ignoring case, the file name\n * gets an `Operation` suffix: operation `point` goes to `PointOperation.ts` next to schema `Point.ts`.\n * Otherwise the two merge into one file, or overwrite each other on a case-insensitive file system.\n * Only the file name changes. The declarations keep their names.\n *\n * @example Resolve `plugin-ts`'s file for the current operation\n * ```ts\n * const fileTs = resolveOperationFile({ ctx, node, resolver: tsResolver, root, output })\n * ```\n */\nexport function resolveOperationFile(options: {\n  ctx: { memo: Memo; schemas: ReadonlyArray<ast.SchemaNode> }\n  node: ast.OperationNode\n  resolver: Pick<Resolver, 'file' | 'pluginName'>\n  root: string\n  output: Output\n  group?: Group | null\n}): ast.FileNode {\n  const { ctx, node, resolver, root, output } = options\n  const { memo } = ctx\n  const location = { root, output, group: options.group ?? undefined }\n\n  return memo(`${resolver.pluginName}:operationFile:${node.operationId}`, () => {\n    const schemaPaths = memo(\n      `${resolver.pluginName}:schemaFilePaths`,\n      () =>\n        new Set(ctx.schemas.flatMap((schema) => (schema.name ? [resolver.file({ name: schema.name, extname: '.ts', ...location }).path.toLowerCase()] : []))),\n    )\n    let file = resolver.file({ ...operationFileEntry(node, node.operationId), ...location })\n\n    for (let name = `${node.operationId}Operation`; schemaPaths.has(file.path.toLowerCase()); name += 'Operation') {\n      const next = resolver.file({ ...operationFileEntry(node, name), ...location })\n      // A single-file output holds every declaration on purpose, so a new name changes nothing.\n      if (next.path === file.path) break\n      file = next\n    }\n\n    return file\n  })\n}\n\nexport type ContentTypeInfo = {\n  contentTypes: string[]\n  isMultipleContentTypes: boolean\n  contentTypeUnion: string\n  defaultContentType: string\n  hasFormData: boolean\n}\n\nexport type RequestConfigResolver = {\n  response: {\n    body(node: ast.OperationNode): string\n  }\n}\n\nexport type ResponseStatusNameResolver = {\n  response: {\n    status(node: ast.OperationNode, statusCode: ast.StatusCode): string\n  }\n}\n\nexport type ResponseNameResolver = ResponseStatusNameResolver & {\n  response: {\n    response(node: ast.OperationNode): string\n  }\n}\n\nexport type OperationTypeNameResolver = RequestConfigResolver &\n  ResponseNameResolver & {\n    param: {\n      path(node: ast.OperationNode, param: ast.ParameterNode): string\n      query(node: ast.OperationNode, param: ast.ParameterNode): string\n      headers(node: ast.OperationNode, param: ast.ParameterNode): string\n      cookies(node: ast.OperationNode, param: ast.ParameterNode): string\n    }\n  }\n\nexport type BuildOperationCommentsOptions = {\n  splitLines?: boolean\n}\n\nexport type ResolveOperationTypeNameOptions = {\n  responseStatusNames?: boolean | 'error'\n  exclude?: ReadonlyArray<string | undefined>\n  order?: 'params-first' | 'body-response-first'\n  /**\n   * Include the individual `Path`/`Query`/`Headers` group type names. Set to `false` for clients\n   * that reference the grouped `Options` type instead of the per-group types.\n   */\n  includeParams?: boolean\n}\n\n/**\n * The operation's method and path as plain text, such as `` `GET /pet/{petId}` ``. A path is not a valid `{@link}` target.\n */\nfunction getOperationRequestLine(node: ast.OperationNode): string | null {\n  return ast.http.isOperation(node) && node.path ? `\\`${node.method.toUpperCase()} ${node.path}\\`` : null\n}\n\n/**\n * Derives the shared `ContentTypeInfo` shape from a list of content types, tracking whether several\n * are present and the union, default, and form-data flags the client uses to pick one.\n */\nfunction buildContentTypeInfo(contentTypes: string[]): ContentTypeInfo {\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 getContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n  return buildContentTypeInfo(ast.http.getRequestGroups(node).contentTypes)\n}\n\n/**\n * The request-body counterpart for the primary success response: the content types it documents and\n * whether several are present, so the client can let a caller pick which one to accept.\n */\nexport function getResponseContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n  return buildContentTypeInfo(ast.http.responses.findPrimary(node)?.content?.map((e) => e.contentType) ?? [])\n}\n\n/** How an operation streams its success responses, as {@link getStream} returns it. */\nexport type ResponseStream = {\n  /** `event` for a whole typed event, `data` for a typed payload, `line` for a JSON Lines value. */\n  shape: 'event' | 'data' | 'line' | null\n  /** Whether events keep `data` as text: all of them, the named ones, or none. */\n  textEvents: boolean | Array<string>\n  /** Whether the primary success response offers `text/event-stream`. */\n  hasEventStream: boolean\n  /** Whether a success response offers a stream next to other content types. */\n  hasVariant: boolean\n}\n\nconst isText = (schema: ast.SchemaNode | null | undefined) => !!schema && ast.schema.is(schema, 'text', { follow: ['ref'] })\n\nfunction getTextEvents(entry: ast.ContentNode, shape: ResponseStream['shape']): ResponseStream['textEvents'] {\n  if (shape === 'data') return isText(entry.stream?.schema ?? entry.schema)\n  if (shape !== 'event' || !entry.stream?.schema) return false\n\n  const item = ast.ref.getSchema(entry.stream.schema)\n  const events = ast.schema.narrow(item, 'union')?.members ?? [item]\n  // A discriminator makes each event an intersection of its `$ref` and the pinned `event`, so every part is read.\n  const propertySchemas = (event: ast.SchemaNode, propertyName: string) => ast.schema.findProperties({ node: event, propertyName }).map(({ schema }) => schema)\n  const textEvents = events.filter((event) => {\n    const dataSchemas = propertySchemas(event, 'data')\n    return dataSchemas.length > 0 && dataSchemas.every(isText)\n  })\n  if (textEvents.length === events.length) return events.length > 0\n\n  const eventNames = textEvents.map((event) => propertySchemas(event, 'event').flatMap((schema) => ast.schema.getLiterals(ast.ref.getSchema(schema))))\n  // An event without a fixed name cannot be told apart from the others.\n  if (!eventNames.length || eventNames.some((values) => !values.length)) return false\n  return [...new Set(eventNames.flat().map(String))]\n}\n\n/** How an operation streams its success responses, or `null` when none offers a stream. */\nexport function getStream(node: Pick<ast.HttpOperationNode, 'responses'>): ResponseStream | null {\n  const entries = ast.http.responses.findPrimary(node)?.content ?? []\n  const entry = entries.length === 1 ? entries[0] : undefined\n  const kind = entry ? ast.mediaType.getKind(entry) : null\n  const shape = kind === 'eventStream' ? (entry?.stream?.shape ?? 'data') : kind === 'lineStream' ? 'line' : null\n  // Next to another type, a stream without a schema gets no typed variant, so it keeps the plain call.\n  const hasEventStream = entries.some((item) => ast.mediaType.getKind(item) === 'eventStream' && (entries.length === 1 || !!item.schema))\n  const hasVariant = ast.http.responses.filterSuccess(node).some((response) => {\n    const variants = (response.content ?? []).filter((item) => item.schema)\n    return variants.length > 1 && variants.some(ast.mediaType.isStream)\n  })\n  if (!shape && !hasEventStream && !hasVariant) return null\n\n  return { shape, textEvents: entry ? getTextEvents(entry, shape) : false, hasEventStream, hasVariant }\n}\n\ntype ResponseType = 'blob' | 'text' | 'stream'\n\ntype ResponseContentEntry = { contentType: string; schema?: ast.SchemaNode | null; stream?: ast.ContentNode['stream'] }\n\nconst responseTypes: Partial<Record<NonNullable<ReturnType<typeof ast.mediaType.getKind>>, ResponseType>> = {\n  eventStream: 'stream',\n  lineStream: 'stream',\n  binary: 'blob',\n  text: 'text',\n}\n\n/**\n * Maps a content type to the PascalCase suffix used to name per-content-type variants\n * (e.g. `application/json` → `Json`, `application/xml` → `Xml`, `multipart/form-data` → `FormData`).\n */\nfunction getContentTypeSuffix(contentType: string): string {\n  // Keeps the original case, unlike ast.mediaType.getBase, so generated names stay stable.\n  const baseType = contentType.split(';')[0]!.trim()\n  if (baseType === 'application/json') return 'Json'\n  if (baseType === 'multipart/form-data') return 'FormData'\n  if (baseType === 'application/x-www-form-urlencoded') return 'FormUrlEncoded'\n  const subtype = baseType.split('/').pop() ?? baseType\n  const parts = subtype.split(/[^a-zA-Z0-9]+/).filter(Boolean)\n  if (parts.length === 0) return 'Unknown'\n  return parts.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join('')\n}\n\n/**\n * Appends a content-type suffix to a base name, keeping a trailing `Data` segment last\n * (e.g. `AddPetData` + `Json` → `AddPetJsonData`, `AddPetStatus200` + `Xml` → `AddPetStatus200Xml`).\n */\nexport function getPerContentTypeName(baseName: string, suffix: string): string {\n  if (baseName.endsWith('Data')) {\n    return suffix.endsWith('Data') ? baseName.slice(0, -4) + suffix : `${baseName.slice(0, -4)}${suffix}Data`\n  }\n  return baseName + suffix\n}\n\nexport type ContentVariantInput = { contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }\nexport type ContentVariant = { name: string; suffix: string; schema: ast.SchemaNode; keysToOmit?: Array<string> | null; contentType: string }\n\n/**\n * Returns the entry with the schema of the value the client returns: `string` for a body read as text, such as `Pet` on\n * `application/xml`, and `blob` for `image/*`, `audio/*`, `video/*`, PDF, and octet-stream. A binary schema elsewhere is a `Blob`\n * only through `parseAs: 'blob'`, which needs every entry in `entries` binary. JSON, vendor (`application/vnd.*`), stream,\n * schemaless, and wildcard entries keep their schema. `entries` is the response's full list of content types.\n */\nexport function toResponseContent<T extends ContentVariantInput & ResponseContentEntry>(entry: T, entries: ReadonlyArray<ResponseContentEntry> = [entry]): T {\n  const { contentType, schema } = entry\n  if (!schema || entry.stream) return entry\n\n  const baseType = ast.mediaType.getBase(contentType)\n  const resolved = ast.ref.getSchema(schema)\n  if (ast.mediaType.getKind(baseType) === 'binary') {\n    return resolved.type === 'blob' ? entry : { ...entry, schema: ast.factory.createSchema({ type: 'blob' }), keysToOmit: null }\n  }\n  const isPlainMediaType = Boolean(baseType) && !ast.mediaType.isJson(baseType) && !baseType.includes('*')\n  if (resolved.type === 'blob') {\n    // shortcut: an error response never gets `parseAs`, so a lone binary schema there reads as text too but stays `Blob`.\n    const readsAsText = isPlainMediaType && !entries.every((item) => item.schema?.type === 'blob')\n    return readsAsText ? { ...entry, schema: ast.factory.createSchema({ type: 'string' }), keysToOmit: null } : entry\n  }\n  if (resolved.primitive === 'string') return entry\n\n  const kind = ast.mediaType.getKind(entry)\n  const responseType = kind ? responseTypes[kind] : undefined\n  // A response without a body, such as a 405, has no schema to read. Only `text/*` is always text.\n  if (responseType !== 'text' && (resolved.type === 'unknown' || resolved.type === 'any' || resolved.type === 'void')) return entry\n  const isVendorJson = /^[^/]+\\/vnd\\./.test(baseType) && !/(xml|yaml|yml|csv)$/.test(baseType)\n  const isText = responseType === 'text' || (!responseType && isPlainMediaType && !isVendorJson)\n\n  return isText ? { ...entry, schema: ast.factory.createSchema({ type: 'string' }), keysToOmit: null } : entry\n}\n\n/**\n * Resolves per-content-type variant names for a set of content entries, deduplicating suffix\n * collisions with a numeric counter. Entries without a schema are skipped. The returned `suffix` is\n * the final (possibly counter-augmented) value, so callers can derive parallel names in another\n * namespace (e.g. plugin-faker deriving the matching plugin-ts type name).\n */\nexport function resolveContentTypeVariants(entries: Array<ContentVariantInput>, baseName: string): Array<ContentVariant> {\n  const usedNames = new Set<string>()\n  return entries\n    .filter((entry) => entry.schema)\n    .map((entry) => {\n      const baseSuffix = getContentTypeSuffix(entry.contentType)\n      let suffix = baseSuffix\n      let name = getPerContentTypeName(baseName, suffix)\n      let counter = 2\n      while (usedNames.has(name)) {\n        suffix = `${baseSuffix}${counter++}`\n        name = getPerContentTypeName(baseName, suffix)\n      }\n      usedNames.add(name)\n      return { name, suffix, schema: entry.schema!, keysToOmit: entry.keysToOmit, contentType: entry.contentType }\n    })\n}\n\n/**\n * Builds the `client?:` option type shared by the generated query hooks (`useQuery`,\n * `useInfiniteQuery`, `useSWR`, ...): `RequestConfig` minus what the\n * hook fills in, which is every request group and `throwOnError`. Unlike {@link buildRequestConfigType},\n * it never narrows `contentType`: query hooks wrap GET operations, which carry no request body to select\n * a content type for.\n */\nexport function buildClientOptionType(options: { omit?: Array<string> } = {}): string {\n  const keys = [...requestGroupOrder, 'url', ...(options.omit ?? []), 'throwOnError']\n  return `Partial<Omit<RequestConfig, ${keys.map((key) => `'${key}'`).join(' | ')}>>`\n}\n\n/**\n * The `client?:` option type of a mutation hook. When the operation has a request content type choice,\n * the mutation variables carry `contentType`, so the config leaves it out. Otherwise the ambiguous side is\n * narrowed to the operation's media types; a single-type side has nothing to pick, so it stays baked in the\n * generated call.\n */\nexport function buildRequestConfigType(node: ast.OperationNode): string {\n  if (ast.http.getRequestGroups(node).hasContentTypeChoice) {\n    return buildClientOptionType({ omit: ['contentType'] })\n  }\n\n  const request = getContentTypeInfo(node)\n  const response = getResponseContentTypeInfo(node)\n  const members = [\n    request.isMultipleContentTypes ? `request?: ${request.contentTypeUnion}` : null,\n    response.isMultipleContentTypes ? `response?: ${response.contentTypeUnion}` : null,\n  ].filter(Boolean)\n\n  const base = buildClientOptionType()\n  return members.length ? `${base} & { contentType?: { ${members.join('; ')} } }` : base\n}\n\n/** The grouped request options, in the order generated signatures and calls list them. */\nexport const requestGroupOrder = ['path', 'query', 'body', 'headers', 'cookies'] as const\n\nexport type RequestOptionsNameResolver = RequestConfigResolver & {\n  response: {\n    options(node: ast.OperationNode): string\n  }\n}\n\n/**\n * Builds the grouped `{ path, query, body, headers, cookies }` parameter for a generated client\n * function, typed from the operation's `Options` (minus `url`). Only the groups the\n * operation actually has are destructured. The trailing `config` parameter carries the\n * runtime `RequestConfig` overrides plus `client`.\n */\nexport function buildRequestParamsSignature(\n  node: ast.OperationNode,\n  resolver: RequestOptionsNameResolver,\n  options: { isConfigurable?: boolean } = {},\n): { signature: string; groups: ast.http.RequestGroups; names: Array<(typeof requestGroupOrder)[number]> } {\n  const { isConfigurable = true } = options\n  const groups = ast.http.getRequestGroups(node)\n\n  const names = requestGroupOrder.filter((key) => groups[key])\n\n  // These callers never carry the `contentType` that several media types require.\n  const optionsType = groups.hasContentTypeChoice\n    ? `Pick<${resolver.response.options(node)}, ${names.map((name) => `'${name}'`).join(' | ')}>`\n    : resolver.response.options(node)\n  const firstParam = names.length > 0 ? `{ ${names.join(', ')} }: ${optionsType}${groups.isOptional ? ' = {}' : ''}` : null\n  const configParam = isConfigurable ? `config: ${buildRequestConfigType(node)} = {}` : null\n\n  return {\n    signature: [firstParam, configParam].filter(Boolean).join(', '),\n    groups,\n    names,\n  }\n}\n\nexport function buildOperationComments(node: ast.OperationNode, options: BuildOperationCommentsOptions = {}): Array<string> {\n  const { splitLines = false } = options\n  // The request line leads: free text after a block tag would belong to that tag.\n  const comments = [\n    getOperationRequestLine(node),\n    node.description && `@description ${node.description}`,\n    node.summary && `@summary ${node.summary}`,\n    node.deprecated && '@deprecated',\n    node.externalDocs && `@see ${jsDocEscape([node.externalDocs.url, node.externalDocs.description].filter(Boolean).join(' '))}`,\n  ]\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\n/**\n * Casts a call argument to the client's parameter type; a `'plain'` client is non-generic.\n */\nexport function castToClientOptions(callArg: string, clientName: string, returnType: 'full' | 'data' | 'plain' = 'full'): string {\n  return `${callArg} as Parameters<typeof ${clientName}${returnType === 'plain' ? '' : '<true>'}>[0]`\n}\n\n/**\n * Builds the combined `{ body, path, query, headers, cookies }` options object schema for an operation,\n * referencing the already-resolved body and grouped param names. `cookies` appears only on an operation\n * with a cookie parameter, and stays optional because a browser sends its cookies itself. Shared by `@kubb/plugin-ts`'s\n * `Options` type and `@kubb/plugin-zod`'s inferred options schema, so both printers emit the same shape from the same inputs.\n * `primitive: 'object'` is a no-op for the TS printer and tells the Zod printer to emit `z.object(…)` rather\n * than a record.\n */\nexport function buildOptionsSchema(node: ast.OperationNode, resolver: OperationTypeNameResolver, { pairContentTypes = false } = {}): ast.SchemaNode {\n  const { path, query, header, cookie } = ast.http.groupParameters(node)\n  const hasBody = Boolean(ast.http.requestBody.getSchema(node))\n  const createNever = () => ast.factory.createSchema({ type: 'never', primitive: undefined, optional: true })\n  const groups = [\n    { name: 'path', params: path, resolve: resolver.param.path },\n    { name: 'query', params: query, resolve: resolver.param.query },\n    { name: 'headers', params: header, resolve: resolver.param.headers },\n    { name: 'cookies', params: cookie, resolve: resolver.param.cookies },\n  ] as const\n\n  const createOptions = (body: ast.SchemaNode, extra: Array<ast.PropertyNode> = []) =>\n    // NOTE(v5-stable): the fields were renamed from the legacy beta shape\n    // (`data`/`pathParams`/`queryParams`/`headerParams`) to `body`/`path`/`query`/`headers` so the\n    // type matches the runtime client. Drop this note once v5 leaves beta.\n    ast.factory.createSchema({\n      type: 'object',\n      primitive: 'object',\n      deprecated: node.deprecated,\n      properties: [\n        ast.factory.createProperty({ name: 'body', required: hasBody && node.requestBody?.required === true, schema: body }),\n        ...groups\n          .filter(({ name, params }) => name !== 'cookies' || params.length > 0)\n          .map(({ name, params, resolve }) => {\n            const required = name !== 'cookies' && params.some((param) => param.required)\n\n            return ast.factory.createProperty({\n              name,\n              required,\n              schema:\n                params.length > 0\n                  ? ast.factory.createSchema({ type: 'ref', name: resolve.call(resolver.param, node, params[0]!), optional: !required })\n                  : createNever(),\n            })\n          }),\n        ...extra,\n      ],\n    })\n\n  const variants =\n    pairContentTypes && ast.http.getRequestGroups(node).hasContentTypeChoice\n      ? resolveContentTypeVariants(node.requestBody?.content ?? [], resolver.response.body(node))\n      : []\n  if (variants.length < 2) {\n    return createOptions(hasBody ? ast.factory.createSchema({ type: 'ref', name: resolver.response.body(node) }) : createNever())\n  }\n\n  // The first media type is the runtime default, so only the others must pass `contentType`. A bare string sets the\n  // request content type at runtime, so it is accepted next to the `{ request }` form.\n  return ast.factory.createSchema({\n    type: 'union',\n    members: variants.map((variant, index) => {\n      const contentType = ast.factory.createSchema({ type: 'enum', enumValues: [variant.contentType] })\n\n      return createOptions(ast.factory.createSchema({ type: 'ref', name: variant.name }), [\n        ast.factory.createProperty({\n          name: 'contentType',\n          required: index > 0,\n          schema: ast.factory.createSchema({\n            type: 'union',\n            members: [\n              contentType,\n              ast.factory.createSchema({\n                type: 'object',\n                primitive: 'object',\n                properties: [ast.factory.createProperty({ name: 'request', required: true, schema: contentType })],\n              }),\n            ],\n          }),\n        }),\n      ])\n    }),\n  })\n}\n\n/**\n * The schema a status occupies in the `<Name>Responses` record. A status that documents several\n * content types becomes a `{ contentType; data }` union so the runtime can surface the negotiated type\n * on `result.parsed`, while the standalone `<Name>StatusNNN` alias stays the plain body union that the\n * query hooks and `result.data` use. With `streamData`, the stream variant of a 2xx status holds that schema, since the\n * client returns its body unread.\n */\nfunction buildResponseRecordEntry(\n  node: ast.OperationNode,\n  res: ast.ResponseNode,\n  resolver: ResponseStatusNameResolver,\n  streamData: ast.SchemaNode | undefined,\n): ast.SchemaNode {\n  const statusName = resolver.response.status(node, res.statusCode)\n  const variants = (res.content ?? []).filter((entry) => entry.schema)\n  if (variants.length <= 1) {\n    return ast.factory.createSchema({ type: 'ref', name: statusName })\n  }\n\n  return ast.factory.createSchema({\n    type: 'union',\n    members: resolveContentTypeVariants(variants, statusName).map((variant) =>\n      ast.factory.createSchema({\n        type: 'object',\n        primitive: 'object',\n        properties: [\n          ast.factory.createProperty({\n            name: 'contentType',\n            required: true,\n            // The runtime reports the bare media type, without parameters such as `charset` or `profile`.\n            schema: ast.factory.createSchema({ type: 'enum', enumValues: [ast.mediaType.getBase(variant)] }),\n          }),\n          ast.factory.createProperty({\n            name: 'data',\n            required: true,\n            schema:\n              streamData && ast.http.status.isSuccess(res) && ast.mediaType.isStream(variant)\n                ? streamData\n                : ast.factory.createSchema({ type: 'ref', name: variant.name }),\n          }),\n        ],\n      }),\n    ),\n  })\n}\n\n/**\n * Builds the per-status `<Name>Responses` record for an operation, referencing the already-resolved\n * `<Name>StatusNNN` names. Shared by `@kubb/plugin-ts`'s `Responses` type and `@kubb/plugin-zod`'s\n * inferred responses schema, so both emit the same shape from the same inputs.\n *\n * Always emits the keyed record, even when an operation declares no responses. An operation with no\n * responses renders as an empty object, which keeps every consumer's import (for example the axios\n * SDK's `RequestResult<XResponses>`) resolvable instead of pointing at a missing export.\n *\n * `streamData` is the type of a stream variant's `data`, such as a `ReadableStream<Uint8Array>` reference.\n */\nexport function buildResponses(\n  node: ast.OperationNode,\n  resolver: ResponseStatusNameResolver,\n  { streamData }: { streamData?: ast.SchemaNode } = {},\n): ast.SchemaNode {\n  return ast.factory.createSchema({\n    type: 'object',\n    primitive: 'object',\n    properties: node.responses.map((res) =>\n      ast.factory.createProperty({\n        name: String(res.statusCode),\n        required: true,\n        schema: buildResponseRecordEntry(node, res, resolver, streamData),\n      }),\n    ),\n  })\n}\n\nexport function resolveErrorNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return ast.http.responses.filterError(node).map((response) => resolver.response.status(node, response.statusCode))\n}\n\nexport function resolveSuccessNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return ast.http.responses.filterSuccess(node).map((response) => resolver.response.status(node, response.statusCode))\n}\n\nexport function resolveStatusCodeNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return node.responses.map((response) => resolver.response.status(node, response.statusCode))\n}\n\n/**\n * Lists the type names an operation's types file declares, computed once per resolver and `options` so every\n * dependent reads the same list.\n */\nexport function resolveOperationTypeNames(\n  node: ast.OperationNode,\n  resolver: OperationTypeNameResolver & Pick<Resolver, 'memo'>,\n  options: ResolveOperationTypeNameOptions = {},\n): string[] {\n  const key = `${node.operationId}\\0${options.order ?? ''}\\0${options.responseStatusNames ?? ''}\\0${options.includeParams === false ? 'noparams' : ''}\\0${(options.exclude ?? []).join(',')}`\n  return resolver.memo(`operationTypeNames:${key}`, () => {\n    const { path, query, header, cookie } = ast.http.groupParameters(node)\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      options.includeParams === false\n        ? []\n        : [\n            ...path.map((param) => resolver.param.path(node, param)),\n            ...query.map((param) => resolver.param.query(node, param)),\n            ...header.map((param) => resolver.param.headers(node, param)),\n            ...cookie.map((param) => resolver.param.cookies(node, param)),\n          ]\n    const bodyAndResponseNames = [ast.http.requestBody.getSchema(node) ? resolver.response.body(node) : null, resolver.response.response(node)]\n    const names =\n      options.order === 'body-response-first'\n        ? [...bodyAndResponseNames, ...paramNames, ...responseStatusNames]\n        : [...paramNames, ...bodyAndResponseNames, ...responseStatusNames]\n\n    return names.filter((name): name is string => Boolean(name) && !exclude.has(name as string))\n  })\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.response.response(node)])\n      continue\n    }\n\n    const code = Number(response.statusCode)\n    if (Number.isNaN(code)) {\n      continue\n    }\n\n    types.push([code, ast.http.status.isSuccess(code) ? resolver.response.response(node) : resolver.response.status(node, response.statusCode)])\n  }\n\n  return types\n}\n\n/**\n * One object schema for a list of parameters or response headers, with each schema inline.\n */\nexport function buildParamsSchema(params: Array<ast.ParameterNode>): ast.SchemaNode {\n  return ast.factory.createSchema({\n    type: 'object',\n    // `primitive: 'object'` makes a printer emit an object schema and not a record.\n    primitive: 'object',\n    properties: params.map((param) => ast.factory.createProperty({ name: param.name, required: param.required, schema: param.schema })),\n  })\n}\n\n/**\n * One object schema for the parameters of an operation, where each key points at the const of\n * that parameter. The const already has its optional wrapper, so every key is required here.\n */\nexport function buildParamRefsSchema({\n  node,\n  params,\n  resolver,\n}: {\n  node: ast.OperationNode\n  params: Array<ast.ParameterNode>\n  resolver: { param: { name(node: ast.OperationNode, param: ast.ParameterNode): string } }\n}): ast.SchemaNode {\n  return ast.factory.createSchema({\n    type: 'object',\n    primitive: 'object',\n    properties: params.map((param) =>\n      ast.factory.createProperty({\n        name: param.name,\n        required: true,\n        schema: ast.factory.createSchema({ type: 'ref', name: resolver.param.name(node, param) }),\n      }),\n    ),\n  })\n}\n\ntype SchemaEntry = { schema: ast.SchemaNode; name: string; keysToOmit?: Array<string> | null }\n\n/**\n * The schemas a name with several content types needs: one per content type, then the union of\n * them under `baseName`.\n */\nexport function buildContentTypeEntries(\n  entries: Array<ContentVariantInput>,\n  baseName: string,\n  decorate: (schema: ast.SchemaNode) => ast.SchemaNode = (schema) => schema,\n): Array<SchemaEntry> {\n  const variants = resolveContentTypeVariants(entries, baseName)\n  const union = ast.factory.createSchema({\n    type: 'union',\n    members: variants.map((variant) => ast.factory.createSchema({ type: 'ref', name: variant.name })),\n  })\n\n  return [\n    ...variants.map((variant) => ({ schema: decorate(variant.schema), name: variant.name, keysToOmit: variant.keysToOmit })),\n    { schema: union, name: baseName },\n  ]\n}\n\n/**\n * The schema behind a response or error name: a union of the per-status schemas. Returns `null`\n * when a response is a `$ref` to a component whose name is already `name`, which would declare it twice.\n */\nexport function buildResponseUnionSchema({\n  node,\n  responses,\n  name,\n  resolver,\n  fallbackUnknown,\n}: {\n  node: ast.OperationNode\n  responses: Array<ast.ResponseNode>\n  name: string\n  resolver: { name(name: string): string; response: { status(node: ast.OperationNode, statusCode: ast.StatusCode): string } }\n  /**\n   * Print an unknown schema when no response has one, so the name still resolves.\n   */\n  fallbackUnknown: boolean\n}): ast.SchemaNode | null {\n  const importedNames = new Set(ast.http.responses.getImportedNames(responses).map((refName) => resolver.name(refName)))\n  if (importedNames.has(name)) return null\n\n  const members = responses.map((res) => ast.factory.createSchema({ type: 'ref', name: resolver.response.status(node, res.statusCode) }))\n  if (members.length === 0) return fallbackUnknown ? ast.factory.createSchema({ type: 'unknown' }) : null\n\n  return members.length === 1 ? members[0]! : ast.factory.createSchema({ type: 'union', members })\n}\n","import { ast } from '@internals/ast'\nimport { ensureValidVarName } from '@internals/utils'\nimport { casing } from '@kubb/kit'\nimport type { GeneratorContext, Resolver } from '@kubb/kit'\n\n/**\n * The shared top-level `name` of the operation plugins, computed once per operation name and build.\n */\nexport function resolveOperationName(this: Resolver, name: string): string {\n  return this.memo(`operation:${name}`, () => ensureValidVarName(casing.camel(name)))\n}\n\ntype SchemaIndexContext = Pick<GeneratorContext, 'memo' | 'schemas'>\n\n/**\n * Names of the schemas in a circular reference chain, computed once per build.\n */\nexport function getCircularNames(ctx: SchemaIndexContext): ReadonlySet<string> {\n  return ctx.memo('circularNames:set', () => ast.graph.getCircularNames(ctx.schemas))\n}\n\n/**\n * Names of the schemas whose type is `enum`, computed once per build.\n */\nexport function getEnumNames(ctx: SchemaIndexContext): ReadonlySet<string> {\n  return ctx.memo('enumNames:set', () => new Set(ctx.schemas.flatMap((schema) => (schema.type === 'enum' && schema.name ? [schema.name] : []))))\n}\n\ndeclare global {\n  namespace Kubb {\n    interface MemoRegistry {\n      operation: string\n      file: ast.FileNode['baseName']\n      operationTypeNames: Array<string>\n    }\n  }\n}\n","import { ast } from '@internals/ast'\nimport { buildOptionsSchema, buildResponses, getEnumNames, resolveContentTypeVariants, resolveOperationFile, toResponseContent } from '@internals/shared'\nimport { defineGenerator } from '@kubb/kit'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Type } from '../components/Type.tsx'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types'\nimport { buildParams, buildResponseComments, enumTypeName, getExampleValues, isInlineConstEnum, resolveInlineEnumNames } from '../utils.ts'\n\n/**\n * Built-in generator for `@kubb/plugin-ts`. Emits one TypeScript file per\n * schema in the spec plus per-operation request, response, and parameter\n * types. Drop-replace with a custom `Generator<PluginTs>` to change how\n * TypeScript output is produced.\n */\nexport const typeGenerator = defineGenerator<PluginTs>({\n  name: 'typescript',\n  renderer: jsxRenderer,\n  schema(node, ctx) {\n    const { enum: enumOptions, syntaxType, optionalType, arrayType, output, group, printer } = ctx.options\n    const { config, resolver, root } = ctx\n\n    if (enumOptions.type !== 'inlineLiteral') node = resolveInlineEnumNames({ node, owner: node.name ?? '', resolver, enumOptions })\n    if (!node.name) {\n      return\n    }\n    // Enum schema names, so the ref handler and the imports\n    // name callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n    const enumSchemaNames = getEnumNames(ctx)\n    const importName = (schemaName: string) => enumTypeName({ resolver, name: schemaName, enumOptions, isEnum: enumSchemaNames.has(schemaName) })\n\n    const imports = resolver.imports({ node, root, output, group: group ?? undefined, name: importName })\n\n    const enumNode = ast.schema.narrow(node, ast.schema.types.enum)\n    // An inline `const` (single-value enum the adapter did not register) renders as a literal type,\n    // so it keeps its plain name instead of the suffixed enum-key name.\n    const isEnumSchema = !!enumNode && !isInlineConstEnum(enumNode, enumSchemaNames)\n\n    const meta = {\n      name: enumOptions.type === 'asConst' && isEnumSchema ? resolver.enum.keyName(node, enumOptions.typeSuffix) : resolver.name(node.name),\n      file: resolver.file({ name: node.name, extname: '.ts', root, output, group: group ?? undefined }),\n    } as const\n\n    const schemaPrinter = printerTs({\n      optionalType,\n      arrayType,\n      enum: enumOptions,\n      name: meta.name,\n      syntaxType,\n      description: node.description,\n      resolver,\n      enumSchemaNames,\n      nodes: printer?.nodes,\n    })\n\n    return (\n      <File\n        baseName={meta.file.baseName}\n        path={meta.file.path}\n        meta={meta.file.meta}\n        banner={resolver.default.banner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n        footer={resolver.default.footer(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n      >\n        {imports.map((imp) => (\n          <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n        ))}\n        <Type name={meta.name} node={node} enum={enumOptions} resolver={resolver} printer={schemaPrinter} />\n      </File>\n    )\n  },\n  operation(node, ctx) {\n    const { enum: enumOptions, optionalType, arrayType, syntaxType, group, output, printer, operations } = ctx.options\n    const { config, resolver, root } = ctx\n    const inline = operations === 'inline'\n\n    const meta = {\n      file: resolveOperationFile({ ctx, node, resolver, root, output, group }),\n    } as const\n\n    // Enum schema names, so the ref handler and the imports\n    // name callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n    const enumSchemaNames = getEnumNames(ctx)\n    const importName = (schemaName: string) => enumTypeName({ resolver, name: schemaName, enumOptions, isEnum: enumSchemaNames.has(schemaName) })\n    const inlinePrinter = inline\n      ? printerTs({ optionalType, arrayType, enum: enumOptions, syntaxType, resolver, enumSchemaNames, nodes: printer?.nodes })\n      : null\n\n    function renderSchemaType({\n      schema,\n      name,\n      keysToOmit,\n      examples,\n      comments,\n    }: {\n      schema: ast.SchemaNode | null\n      name: string\n      keysToOmit?: Array<string> | null\n      examples?: Array<ast.ExampleNode>\n      comments?: Array<string>\n    }) {\n      if (!schema) return null\n      if (!inline && enumOptions.type !== 'inlineLiteral') schema = resolveInlineEnumNames({ node: schema, owner: node.operationId, resolver, enumOptions })\n\n      const imports = resolver.imports({ node: schema, root, output, group: group ?? undefined, name: importName })\n\n      const schemaPrinter = printerTs({\n        optionalType,\n        arrayType,\n        enum: enumOptions,\n        name,\n        syntaxType,\n        description: schema.description,\n        examples: getExampleValues(examples, true),\n        comments,\n        keysToOmit,\n        resolver,\n        enumSchemaNames,\n        nodes: printer?.nodes,\n      })\n\n      return (\n        <>\n          {imports.map((imp) => (\n            <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n          ))}\n          <Type name={name} node={schema} enum={enumOptions} resolver={resolver} printer={schemaPrinter} inline={inline} />\n        </>\n      )\n    }\n\n    /**\n     * Emits an individual type per content type plus a plain union alias under `baseName`. Shared by\n     * the request body and multi-content-type responses. The response record discriminates these\n     * variants by content type in {@link buildResponses}; the standalone alias stays a plain union so\n     * query hooks and `result.data` keep the bare body.\n     */\n    function buildContentTypeVariants(\n      entries: Array<{ contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null; examples?: Array<ast.ExampleNode> }>,\n      baseName: string,\n      pointer: string | undefined,\n      { decorate, comments }: { decorate?: (schema: ast.SchemaNode) => ast.SchemaNode; comments?: Array<string> },\n    ) {\n      const variants = resolveContentTypeVariants(entries, baseName)\n      // Inline, content types that print the same type would repeat it in the union (`Order | Order`).\n      const keys = variants.map((variant) => (inlinePrinter ? `${inlinePrinter.print(variant.schema)}:${variant.keysToOmit ?? ''}` : variant.name))\n      const members = variants.filter((_, index) => keys.indexOf(keys[index]!) === index)\n      const unionSchema = ast.factory.createSchema({\n        type: 'union',\n        pointer,\n        members: members.map((variant) => ast.factory.createSchema({ type: 'ref', name: variant.name })),\n      })\n      return (\n        <>\n          {variants.map((variant) =>\n            renderSchemaType({\n              schema: decorate ? decorate(variant.schema) : variant.schema,\n              name: variant.name,\n              keysToOmit: variant.keysToOmit,\n              examples: entries.find((entry) => entry.contentType === variant.contentType)?.examples,\n            }),\n          )}\n          {renderSchemaType({ schema: unionSchema, name: baseName, comments })}\n        </>\n      )\n    }\n\n    const { path, query, header, cookie } = ast.http.groupParameters(node)\n\n    const paramGroupTypes = (\n      [\n        [path, resolver.param.path],\n        [query, resolver.param.query],\n        [header, resolver.param.headers],\n        [cookie, resolver.param.cookies],\n      ] as const\n    ).map(\n      ([params, resolveName]) =>\n        params.length > 0 &&\n        renderSchemaType({ schema: buildParams({ params, serializedExamples: true }), name: resolveName.call(resolver.param, node, params[0]!) }),\n    )\n\n    const requestBodyContent = node.requestBody?.content ?? []\n\n    function buildRequestType() {\n      if (requestBodyContent.length === 0) return null\n      if (requestBodyContent.length === 1) {\n        const entry = requestBodyContent[0]!\n        if (!entry.schema) return null\n        return renderSchemaType({\n          schema: {\n            ...entry.schema,\n            pointer: node.requestBody!.pointer ?? entry.schema.pointer,\n            description: node.requestBody!.description ?? entry.schema.description,\n          },\n          name: resolver.response.body(node),\n          keysToOmit: entry.keysToOmit,\n          examples: entry.examples,\n        })\n      }\n      // Multiple content types — generate individual types + union alias\n      return buildContentTypeVariants(requestBodyContent, resolver.response.body(node), node.requestBody!.pointer, {\n        decorate: (schema) => ({ ...schema, description: node.requestBody!.description ?? schema.description }),\n      })\n    }\n\n    const requestType = buildRequestType()\n\n    const responseTypes = node.responses.map((res) => {\n      const content = (res.content ?? []).map((entry, _, content) => toResponseContent(entry, content))\n      const variants = content.filter((entry) => entry.schema)\n      // Multiple content types for a single status code — generate per-variant types + a plain union.\n      // The `<Name>Responses` record discriminates them by content type (see buildResponses).\n      if (variants.length > 1) {\n        return buildContentTypeVariants(variants, resolver.response.status(node, res.statusCode), res.pointer, { comments: buildResponseComments(res) })\n      }\n      const primary = variants[0] ?? content[0]\n      return renderSchemaType({\n        schema: primary?.schema ? { ...primary.schema, pointer: res.pointer ?? primary.schema.pointer } : ast.factory.createSchema({ type: 'unknown' }),\n        name: resolver.response.status(node, res.statusCode),\n        keysToOmit: primary?.keysToOmit,\n        examples: primary?.examples,\n        comments: buildResponseComments(res),\n      })\n    })\n\n    const responseHeaderTypes = node.responses.map((res) =>\n      res.headers?.length\n        ? renderSchemaType({ schema: buildParams({ params: res.headers, serializedExamples: true }), name: resolver.response.headers(node, res.statusCode) })\n        : null,\n    )\n\n    const optionsType = renderSchemaType({\n      schema: buildOptionsSchema(node, resolver, { pairContentTypes: true }),\n      name: resolver.response.options(node),\n    })\n\n    const responsesType = renderSchemaType({\n      // A stream variant next to another content type comes back as the unread body, as the client's `SuccessVariant` types it.\n      schema: buildResponses(node, resolver, { streamData: ast.factory.createSchema({ type: 'ref', name: 'ReadableStream<Uint8Array>' }) }),\n      name: resolver.response.responses(node),\n    })\n\n    function buildResponseType() {\n      const hasSchema = (res: ast.ResponseNode) => (res.content ?? []).some((entry) => entry.schema)\n      const responseName = resolver.response.response(node)\n\n      const responsesWithSchema = node.responses.filter(hasSchema)\n      const importedNames = new Set(ast.http.responses.getImportedNames(responsesWithSchema).map(importName))\n\n      if (importedNames.has(responseName)) {\n        return null\n      }\n\n      return renderSchemaType({\n        schema: {\n          ...(ast.http.responses.getUnion(node, resolver) ?? ast.factory.createSchema({ type: 'unknown' })),\n          description: 'Union of all possible responses',\n        },\n        name: responseName,\n      })\n    }\n\n    const responseType = buildResponseType()\n\n    return (\n      <File\n        baseName={meta.file.baseName}\n        path={meta.file.path}\n        meta={meta.file.meta}\n        banner={resolver.default.banner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n        footer={resolver.default.footer(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n      >\n        {paramGroupTypes}\n        {responseTypes}\n        {responseHeaderTypes}\n        {requestType}\n        {optionsType}\n        {responsesType}\n        {responseType}\n      </File>\n    )\n  },\n})\n","","","import { ensureValidVarName } from '@internals/utils'\nimport { casing, createResolver, operationKey, resolverCasedFile, resolverOperationParams, resolverOperationResponse } from '@kubb/kit'\nimport type { PluginTs } from '../types.ts'\n\n/**\n * Default resolver used by `@kubb/plugin-ts`. Decides the names and file paths\n * for generated TypeScript types. Other plugins should read the build's resolver\n * through `ctx.getResolver(pluginTsName)` to share its name allocations.\n *\n * The `default` helpers are supplied by `createResolver`. This plugin overrides the top-level `name`\n * to use PascalCase for value and type names and `file` to write PascalCase file paths (dotted names\n * become `/`-joined), and groups the operation-specific naming under the `param`, `response`, and\n * `enum` namespaces.\n *\n * @example Resolve a type and file name\n * ```ts\n * import { resolverTs } from '@kubb/plugin-ts'\n *\n * resolverTs.name('list pets')                     // 'ListPets'\n * resolverTs.response.status(node, 200)            // 'ListPetsStatus200'\n * ```\n */\nexport const resolverTs = createResolver<PluginTs>({\n  pluginName: 'plugin-ts',\n  name(name) {\n    return this.memo(`name:${name}`, () => ensureValidVarName(casing.pascal(name)))\n  },\n  ...resolverCasedFile(casing.pascal),\n  ...resolverOperationParams,\n  response: {\n    ...resolverOperationResponse.response,\n    options(node) {\n      const name = this.name(`${node.operationId} Options`)\n      return this.resolveName({ key: operationKey(node, 'response', 'options'), name })\n    },\n  },\n  enum: {\n    keyName(node, enumTypeSuffix = 'key') {\n      return `${this.name(node.name ?? '')}${enumTypeSuffix}`\n    },\n  },\n})\n","import { addGenerator, defineExtension, Resolver, setMacros, setResolver } from '@kubb/kit'\nimport { compatibility } from '../kubb-extension.json'\nimport { version } from '../package.json'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport type { PluginTs } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-ts`. Used for driver lookups and\n * cross-plugin dependency references.\n */\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\n/**\n * Generates TypeScript `type` aliases and `interface` declarations from an\n * OpenAPI spec. The foundation that every other Kubb plugin builds on:\n * clients, query hooks, mocks, and validators all reference the names this\n * plugin produces.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb/config'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n *   input: './petStore.yaml',\n *   output: { path: './src/gen' },\n *   plugins: [\n *     pluginTs({\n *       output: { path: './types' },\n *       enum: { type: 'asConst' },\n *       optionalType: 'questionTokenAndUndefined',\n *     }),\n *   ],\n * })\n * ```\n */\nexport const pluginTs = defineExtension<PluginTs>({\n  kind: 'plugin',\n  meta: { name: pluginTsName, version, compatibility },\n  setup(options) {\n    const {\n      output = { path: 'types', barrel: { type: 'named' } },\n      group,\n      exclude = [],\n      include,\n      override = [],\n      enum: enumOptions = {},\n      optionalType = 'questionToken',\n      arrayType = 'array',\n      syntaxType = 'type',\n      operations = 'export',\n      printer,\n      resolver: userResolver,\n      macros: userMacros,\n    } = options\n\n    const resolvedEnum = {\n      type: enumOptions.type ?? 'asConst',\n      constCasing: enumOptions.constCasing ?? 'camelCase',\n      typeSuffix: enumOptions.typeSuffix ?? 'Key',\n      keyCasing: enumOptions.keyCasing ?? 'none',\n    }\n\n    setResolver(userResolver ? Resolver.merge(resolverTs, ...[userResolver].flat()) : resolverTs)\n    if (userMacros?.length) {\n      setMacros(userMacros)\n    }\n    addGenerator(typeGenerator)\n\n    return {\n      output,\n      exclude,\n      include,\n      override,\n      optionalType,\n      group: group ?? null,\n      arrayType,\n      enum: resolvedEnum,\n      syntaxType,\n      operations,\n      printer,\n    }\n  },\n})\n\nexport default pluginTs\n","/**\n * A type expression used as a function parameter type annotation.\n *\n * - a plain `string` is a type reference rendered as-is, e.g. `'string'`, `'QueryParams'`, `'Partial<Config>'`\n * - a {@link TypeLiteralNode} is an inline anonymous type, e.g. `{ petId: string; name?: string }`\n * - an {@link IndexedAccessTypeNode} is a single field accessed from a named type, e.g. `PathParams['petId']`\n */\nexport type TypeExpression = string | TypeLiteralNode | IndexedAccessTypeNode\n\n/**\n * An inline anonymous object type grouping named fields.\n * Renders as `{ key: Type; other?: OtherType }`.\n */\nexport type TypeLiteralNode = {\n  kind: 'TypeLiteral'\n  /**\n   * Members of the object type, rendered in order.\n   */\n  members: Array<{\n    /**\n     * Member key.\n     */\n    name: string\n    /**\n     * Member type expression.\n     */\n    type: TypeExpression\n    /**\n     * Whether the member is optional, rendered with `?`.\n     */\n    optional?: boolean\n  }>\n}\n\n/**\n * A single field accessed from a named group type. Renders as `target['key']`.\n */\nexport type IndexedAccessTypeNode = {\n  kind: 'IndexedAccessType'\n  /**\n   * Name of the type being indexed, e.g. `'GetPetPathParams'`.\n   */\n  target: string\n  /**\n   * Field key to access, e.g. `'petId'`.\n   */\n  key: string\n}\n\n/**\n * An object destructuring binding, used as the name of a grouped function parameter.\n * Renders as `{ id, name }` or `{ id: renamed }` when `propertyName` differs.\n */\nexport type ObjectBindingPatternNode = {\n  kind: 'ObjectBindingPattern'\n  /**\n   * Bound elements, rendered in order.\n   */\n  elements: Array<{\n    /**\n     * Local binding name.\n     */\n    name: string\n    /**\n     * Source key when it differs from the binding name, rendered as `propertyName: name`.\n     */\n    propertyName?: string\n  }>\n}\n\n/**\n * One function parameter.\n *\n * A simple parameter has a `string` name. A destructured group has an\n * {@link ObjectBindingPatternNode} name paired with a {@link TypeLiteralNode} type.\n *\n * @example Required parameter\n * `name: Type`\n *\n * @example Optional parameter\n * `name?: Type`\n *\n * @example Parameter with default value\n * `name: Type = defaultValue`\n *\n * @example Rest parameter\n * `...name: Type[]`\n *\n * @example Destructured group\n * `{ id, name? }: { id: string; name?: string } = {}`\n */\nexport type FunctionParameterNode = {\n  kind: 'FunctionParameter'\n  /**\n   * Parameter name, or an {@link ObjectBindingPatternNode} for a destructured group.\n   */\n  name: string | ObjectBindingPatternNode\n  /**\n   * Type annotation as a {@link TypeExpression}. Omit for untyped output.\n   */\n  type?: TypeExpression\n  /**\n   * Whether the parameter is optional, rendered with `?`.\n   */\n  optional?: boolean\n  /**\n   * Default value, written verbatim after `=`. Commonly `'{}'` for a destructured group.\n   */\n  default?: string\n  /**\n   * When `true` the parameter is emitted as a rest parameter, e.g. `...name: Type[]`.\n   */\n  rest?: boolean\n}\n\n/**\n * A complete function parameter list.\n *\n * Printers are responsible for sorting (`required` → `optional` → `defaulted`).\n */\nexport type FunctionParametersNode = {\n  kind: 'FunctionParameters'\n  /**\n   * Ordered parameter nodes.\n   */\n  params: ReadonlyArray<FunctionParameterNode>\n}\n\n/**\n * Narrows a {@link TypeExpression} to a {@link TypeLiteralNode}.\n */\nexport function isTypeLiteral(type: TypeExpression): type is TypeLiteralNode {\n  return typeof type !== 'string' && type.kind === 'TypeLiteral'\n}\n\n/**\n * Narrows a {@link TypeExpression} to an {@link IndexedAccessTypeNode}.\n */\nexport function isIndexedAccessType(type: TypeExpression): type is IndexedAccessTypeNode {\n  return typeof type !== 'string' && type.kind === 'IndexedAccessType'\n}\n\n/**\n * Creates a {@link TypeLiteralNode} representing an inline anonymous object type.\n *\n * @example\n * ```ts\n * createTypeLiteral({ members: [{ name: 'petId', type: 'string', optional: false }] })\n * // { petId: string }\n * ```\n */\nexport function createTypeLiteral(props: Omit<TypeLiteralNode, 'kind'>): TypeLiteralNode {\n  return { kind: 'TypeLiteral', ...props }\n}\n\n/**\n * Creates an {@link IndexedAccessTypeNode} representing a single field accessed from a named type.\n *\n * @example\n * ```ts\n * createIndexedAccessType({ target: 'DeletePetPathParams', key: 'petId' })\n * // DeletePetPathParams['petId']\n * ```\n */\nexport function createIndexedAccessType(props: Omit<IndexedAccessTypeNode, 'kind'>): IndexedAccessTypeNode {\n  return { kind: 'IndexedAccessType', ...props }\n}\n\n/**\n * Creates an {@link ObjectBindingPatternNode} for a destructured parameter binding.\n *\n * @example\n * ```ts\n * createObjectBindingPattern({ elements: [{ name: 'id' }, { name: 'name' }] })\n * // { id, name }\n * ```\n */\nexport function createObjectBindingPattern(props: Omit<ObjectBindingPatternNode, 'kind'>): ObjectBindingPatternNode {\n  return { kind: 'ObjectBindingPattern', ...props }\n}\n\n/**\n * Plain property descriptor for a destructured group built by {@link createFunctionParameter}.\n */\ntype FunctionParameterProperty = {\n  name: string\n  type: TypeExpression\n  optional?: boolean\n}\n\ntype FunctionParameterInput =\n  | { name: string | ObjectBindingPatternNode; type?: TypeExpression; optional?: boolean; default?: string; rest?: boolean }\n  | { properties: Array<FunctionParameterProperty>; optional?: boolean; default?: string }\n\n/**\n * Creates a {@link FunctionParameterNode}. `optional` defaults to `false`.\n * Passing `properties` builds a destructured group: an {@link ObjectBindingPatternNode} name\n * paired with a {@link TypeLiteralNode} type.\n *\n * @example Optional param\n * ```ts\n * createFunctionParameter({ name: 'params', type: 'QueryParams', optional: true })\n * // → params?: QueryParams\n * ```\n *\n * @example Destructured group\n * ```ts\n * createFunctionParameter({ properties: [{ name: 'id', type: 'string' }, { name: 'name', type: 'string', optional: true }], default: '{}' })\n * // → { id, name }: { id: string; name?: string } = {}\n * ```\n */\nexport function createFunctionParameter(input: FunctionParameterInput): FunctionParameterNode {\n  if ('properties' in input) {\n    return {\n      kind: 'FunctionParameter',\n      name: createObjectBindingPattern({ elements: input.properties.map((p) => ({ name: p.name })) }),\n      type: createTypeLiteral({ members: input.properties.map((p) => ({ name: p.name, type: p.type, optional: p.optional ?? false })) }),\n      optional: input.optional ?? false,\n      ...(input.default !== undefined ? { default: input.default } : {}),\n    }\n  }\n  return { kind: 'FunctionParameter', optional: false, ...input }\n}\n\n/**\n * Creates a {@link FunctionParametersNode} from an ordered list of parameters.\n *\n * @example\n * ```ts\n * const empty = createFunctionParameters()\n * // { params: [] }\n * ```\n */\nexport function createFunctionParameters(props: Partial<Omit<FunctionParametersNode, 'kind'>> = {}): FunctionParametersNode {\n  return { kind: 'FunctionParameters', params: [], ...props }\n}\n","/**\n * Ordering priority for function parameters: lower = sorted earlier.\n */\nconst PARAM_RANK = { required: 0, optional: 1, withDefault: 2, rest: 3 } as const\n\nimport { isIndexedAccessType, isTypeLiteral } from './functionParams.ts'\nimport type { FunctionParameterNode, FunctionParametersNode, ObjectBindingPatternNode, TypeExpression } from './functionParams.ts'\n\n/**\n * Renders a {@link TypeExpression} to its TypeScript source.\n *\n * - a `string` is a type reference, returned as-is\n * - an `IndexedAccessType` becomes `objectType['indexType']`\n * - a `TypeLiteral` becomes `{ key: Type; key?: Type }`\n *\n * `transformType` is applied once to the fully rendered type, matching how the\n * printer wrapped reference types before the `ts.factory` model.\n */\nexport function renderType(type: TypeExpression, transformType?: (type: string) => string): string {\n  const rendered = renderTypeExpression(type)\n  return transformType ? transformType(rendered) : rendered\n}\n\n/**\n * Renders an object-type key, quoting it as a string literal when it is not a valid\n * identifier so `{ 'content-type': string }` stays valid TypeScript.\n */\nfunction renderKey(name: string): string {\n  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name) ? name : JSON.stringify(name)\n}\n\nfunction renderMembers(members: Array<{ key: string; type: string; optional?: boolean }>): string {\n  return `{ ${members.map((member) => `${renderKey(member.key)}${member.optional ? '?' : ''}: ${member.type}`).join('; ')} }`\n}\n\nfunction renderTypeExpression(type: TypeExpression): string {\n  if (typeof type === 'string') return type\n  if (isIndexedAccessType(type)) return `${type.target}['${type.key}']`\n\n  return renderMembers(type.members.map((member) => ({ key: member.name, type: renderTypeExpression(member.type), optional: member.optional })))\n}\n\nexport type FunctionPrinterOptions = {\n  /**\n   * Rendering modes supported by `functionPrinter`.\n   *\n   * | Mode          | Output example                    | Use case                       |\n   * |---------------|-----------------------------------|--------------------------------|\n   * | `declaration` | `id: string, config: Config = {}` | Function parameter declaration |\n   * | `call`        | `id, { method, url }`             | Function call arguments        |\n   */\n  mode: 'declaration' | 'call'\n  /**\n   * Optional transformation applied to every parameter name before printing.\n   */\n  transformName?: (name: string) => string\n  /**\n   * Optional transformation applied to every type string before printing.\n   */\n  transformType?: (type: string) => string\n}\n\nfunction groupMembers(param: FunctionParameterNode): ReadonlyArray<{ name: string; optional?: boolean }> | null {\n  if (typeof param.name === 'string') return null\n  return param.type && isTypeLiteral(param.type) ? param.type.members : []\n}\n\nfunction rank(param: FunctionParameterNode): number {\n  if (param.rest) return PARAM_RANK.rest\n  if (param.default) return PARAM_RANK.withDefault\n  const members = groupMembers(param)\n  if (members) return members.every((m) => m.optional) ? PARAM_RANK.optional : PARAM_RANK.required\n  return param.optional ? PARAM_RANK.optional : PARAM_RANK.required\n}\n\n/**\n * Orders a destructured group's binding elements and type members together,\n * required fields first, matching how grouped children were sorted before.\n */\ntype GroupMember = { name: string; propertyName?: string; type?: TypeExpression; optional?: boolean }\n\nfunction sortedGroupMembers(name: ObjectBindingPatternNode, type: TypeExpression | undefined): Array<GroupMember> {\n  const members = type && isTypeLiteral(type) ? type.members : []\n  const memberRank = (optional?: boolean) => (optional ? PARAM_RANK.optional : PARAM_RANK.required)\n  return name.elements\n    .map((element, index) => ({\n      name: element.name,\n      propertyName: element.propertyName,\n      type: members[index]?.type,\n      optional: members[index]?.optional,\n    }))\n    .toSorted((a, b) => memberRank(a.optional) - memberRank(b.optional))\n}\n\n/**\n * Renders one binding element: the local name, prefixed with its source key when the\n * binding renames the property, as in `{ petId: id }`.\n */\nfunction renderBindingMember(member: GroupMember, transformName?: (name: string) => string): string {\n  const local = transformName ? transformName(member.name) : member.name\n  return member.propertyName ? `${member.propertyName}: ${local}` : local\n}\n\n/**\n * Renders the type annotation of a destructured group. An inline object type is\n * rendered from the already-sorted members so its key order matches the binding;\n * a reference type is rendered as-is.\n */\nfunction renderGroupType(type: TypeExpression | undefined, sorted: Array<GroupMember>, transformType?: (type: string) => string): string | undefined {\n  if (!type) return undefined\n  if (!isTypeLiteral(type)) return renderType(type)\n\n  const typed = sorted.filter((member) => member.type !== undefined)\n  if (!typed.length) return undefined\n  return renderMembers(\n    typed.map((member) => ({ key: member.propertyName ?? member.name, type: renderType(member.type!, transformType), optional: member.optional })),\n  )\n}\n\nfunction printParameter(node: FunctionParameterNode, options: FunctionPrinterOptions): string {\n  const { mode, transformName, transformType } = options\n  const bindingName = node.name\n\n  if (mode === 'call') {\n    if (typeof bindingName !== 'string') {\n      const keys = sortedGroupMembers(bindingName, node.type)\n        .map((member) => renderBindingMember(member))\n        .join(', ')\n      return `{ ${keys} }`\n    }\n    const name = transformName ? transformName(bindingName) : bindingName\n    return node.rest ? `...${name}` : name\n  }\n\n  if (typeof bindingName !== 'string') {\n    const sorted = sortedGroupMembers(bindingName, node.type)\n    const binding = `{ ${sorted.map((member) => renderBindingMember(member, transformName)).join(', ')} }`\n    const allOptional = sorted.every((member) => member.optional)\n    const type = renderGroupType(node.type, sorted, transformType)\n    if (type) {\n      if (allOptional) return `${binding}: ${type} = ${node.default ?? '{}'}`\n      return node.default ? `${binding}: ${type} = ${node.default}` : `${binding}: ${type}`\n    }\n    return node.default ? `${binding} = ${node.default}` : binding\n  }\n\n  const name = transformName ? transformName(bindingName) : bindingName\n  const type = node.type ? renderType(node.type, transformType) : undefined\n\n  if (node.rest) {\n    return type ? `...${name}: ${type}` : `...${name}`\n  }\n  if (type) {\n    if (node.optional) return `${name}?: ${type}`\n    return node.default ? `${name}: ${type} = ${node.default}` : `${name}: ${type}`\n  }\n  return node.default ? `${name} = ${node.default}` : name\n}\n\n/**\n * Default function-signature printer. Renders a parameter list in one of two modes:\n * `declaration` for the function signature and `call` for the call arguments.\n *\n * @example\n * ```ts\n * const printer = functionPrinter({ mode: 'declaration' })\n *\n * const sig = createFunctionParameters({\n *   params: [\n *     createFunctionParameter({ name: 'petId', type: 'string', optional: false }),\n *     createFunctionParameter({ name: 'config', type: 'Config', optional: false, default: '{}' }),\n *   ],\n * })\n *\n * printer.print(sig)  // → \"petId: string, config: Config = {}\"\n * ```\n */\nexport function functionPrinter(options: FunctionPrinterOptions) {\n  return {\n    name: 'functionParameters' as const,\n    options,\n    print(node: FunctionParametersNode): string {\n      // `toSorted` is a stable sort, so equal-rank params keep their declared order.\n      return node.params\n        .toSorted((a, b) => rank(a) - rank(b))\n        .map((p) => printParameter(p, options))\n        .filter(Boolean)\n        .join(', ')\n    },\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAU;;;;;;;;;;;AAYV,SAAgB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