@kubb/plugin-ts 5.0.0-alpha.22 → 5.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index.cjs +1668 -49
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +466 -4
  4. package/dist/index.js +1641 -52
  5. package/dist/index.js.map +1 -1
  6. package/package.json +3 -42
  7. package/src/components/Enum.tsx +1 -1
  8. package/src/components/Type.tsx +3 -5
  9. package/src/generators/typeGenerator.tsx +10 -22
  10. package/src/generators/typeGeneratorLegacy.tsx +28 -38
  11. package/src/index.ts +13 -1
  12. package/src/plugin.ts +42 -23
  13. package/src/presets.ts +16 -34
  14. package/src/printers/functionPrinter.ts +194 -0
  15. package/src/printers/printerTs.ts +6 -6
  16. package/src/resolvers/resolverTs.ts +10 -47
  17. package/src/resolvers/resolverTsLegacy.ts +4 -31
  18. package/src/types.ts +85 -225
  19. package/src/utils.ts +103 -0
  20. package/dist/Type-Bf8raoQX.cjs +0 -124
  21. package/dist/Type-Bf8raoQX.cjs.map +0 -1
  22. package/dist/Type-BpXxT4l_.js +0 -113
  23. package/dist/Type-BpXxT4l_.js.map +0 -1
  24. package/dist/builderTs-COUg3xtQ.cjs +0 -135
  25. package/dist/builderTs-COUg3xtQ.cjs.map +0 -1
  26. package/dist/builderTs-DPpkJKd1.js +0 -131
  27. package/dist/builderTs-DPpkJKd1.js.map +0 -1
  28. package/dist/builders.cjs +0 -3
  29. package/dist/builders.d.ts +0 -23
  30. package/dist/builders.js +0 -2
  31. package/dist/casing-BJHFg-zZ.js +0 -84
  32. package/dist/casing-BJHFg-zZ.js.map +0 -1
  33. package/dist/casing-DHfdqpLi.cjs +0 -107
  34. package/dist/casing-DHfdqpLi.cjs.map +0 -1
  35. package/dist/chunk-ByKO4r7w.cjs +0 -38
  36. package/dist/components.cjs +0 -4
  37. package/dist/components.d.ts +0 -71
  38. package/dist/components.js +0 -2
  39. package/dist/generators-DFDut8o-.js +0 -555
  40. package/dist/generators-DFDut8o-.js.map +0 -1
  41. package/dist/generators-DKd7MYbx.cjs +0 -567
  42. package/dist/generators-DKd7MYbx.cjs.map +0 -1
  43. package/dist/generators.cjs +0 -4
  44. package/dist/generators.d.ts +0 -12
  45. package/dist/generators.js +0 -2
  46. package/dist/printerTs-BcHudagv.cjs +0 -594
  47. package/dist/printerTs-BcHudagv.cjs.map +0 -1
  48. package/dist/printerTs-CMBCOuqd.js +0 -558
  49. package/dist/printerTs-CMBCOuqd.js.map +0 -1
  50. package/dist/printers.cjs +0 -3
  51. package/dist/printers.d.ts +0 -81
  52. package/dist/printers.js +0 -2
  53. package/dist/resolverTsLegacy-CPiqqsO6.js +0 -185
  54. package/dist/resolverTsLegacy-CPiqqsO6.js.map +0 -1
  55. package/dist/resolverTsLegacy-CuR9XbKk.cjs +0 -196
  56. package/dist/resolverTsLegacy-CuR9XbKk.cjs.map +0 -1
  57. package/dist/resolvers.cjs +0 -4
  58. package/dist/resolvers.d.ts +0 -52
  59. package/dist/resolvers.js +0 -2
  60. package/dist/types-CRtcZOCz.d.ts +0 -374
  61. package/src/builders/builderTs.ts +0 -107
  62. package/src/builders/index.ts +0 -1
  63. package/src/components/index.ts +0 -2
  64. package/src/generators/index.ts +0 -2
  65. package/src/printers/index.ts +0 -1
  66. package/src/resolvers/index.ts +0 -2
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getPreset","getCorePreset","getPreset"],"sources":["../src/presets.ts","../src/plugin.ts"],"sourcesContent":["import type { Visitor } from '@kubb/ast/types'\nimport { type CompatibilityPreset, definePreset, definePresets, type Generator, getPreset as getCorePreset } from '@kubb/core'\nimport { typeGenerator, typeGeneratorLegacy } from './generators/index.ts'\nimport { resolverTs, resolverTsLegacy } from './resolvers/index.ts'\nimport type { PluginTs, ResolverTs } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-ts`.\n *\n * - `default` — uses `resolverTs` and `typeGenerator` (current naming conventions).\n * - `kubbV4` — uses `resolverTsLegacy` and `typeGeneratorLegacy` (Kubb v4 naming conventions).\n */\nexport const presets = definePresets<ResolverTs>({\n default: definePreset('default', { resolvers: [resolverTs], generators: [typeGenerator] }),\n kubbV4: definePreset('kubbV4', { resolvers: [resolverTsLegacy], generators: [typeGeneratorLegacy] }),\n})\n\ntype GetPresetOptions = {\n resolvers: Array<ResolverTs>\n transformers: Array<Visitor>\n generators: Array<Generator<PluginTs>>\n}\n\n/**\n * Resolves a compatibility preset for `plugin-ts`, merging user-supplied resolvers,\n * transformers, and generators on top of the built-in preset defaults.\n *\n * `resolverTs` is always prepended to the resolver list as the baseline.\n *\n * @example\n * ```ts\n * const preset = getPreset('kubbV4', { resolvers: [], transformers: [], generators: [] })\n * ```\n */\nexport function getPreset(preset: CompatibilityPreset, { resolvers, transformers, generators }: GetPresetOptions) {\n return getCorePreset({\n preset,\n presets,\n resolvers: [resolverTs, ...(resolvers ?? [])],\n transformers,\n generators,\n })\n}\n","import path from 'node:path'\nimport { walk } from '@kubb/ast'\nimport { createPlugin, getBarrelFiles, renderOperation, renderSchema } from '@kubb/core'\nimport { getPreset } from './presets.ts'\nimport type { PluginTs } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-ts`, used to identify the plugin in driver lookups and warnings.\n */\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\n/**\n * The `@kubb/plugin-ts` plugin factory.\n *\n * Generates TypeScript type declarations from an OpenAPI/AST `RootNode`.\n * Walks schemas and operations, delegates rendering to the active generators,\n * and writes barrel files based on `output.barrelType`.\n *\n * @example\n * ```ts\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * plugins: [pluginTs({ output: { path: 'types' }, enumType: 'asConst' })],\n * })\n * ```\n */\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumTypeSuffix = 'Key',\n enumKeyCasing = 'none',\n optionalType = 'questionToken',\n arrayType = 'array',\n syntaxType = 'type',\n paramsCasing,\n compatibilityPreset = 'default',\n resolvers: userResolvers = [],\n transformers: userTransformers = [],\n generators: userGenerators = [],\n } = options\n\n const { resolver, transformers, generators } = getPreset(compatibilityPreset, {\n resolvers: userResolvers,\n transformers: userTransformers,\n generators: userGenerators,\n })\n\n let resolveNameWarning = false\n let resolvePathWarning = false\n\n return {\n name: pluginTsName,\n options: {\n output,\n optionalType,\n group,\n arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n resolver,\n transformers,\n },\n resolvePath(baseName, pathMode, options) {\n if (!resolvePathWarning) {\n this.driver.events.emit('warn', 'Do not use resolvePath for pluginTs, use resolverTs.resolvePath instead')\n resolvePathWarning = true\n }\n\n return resolver.resolvePath(\n { baseName, pathMode, tag: options?.group?.tag, path: options?.group?.path },\n { root: path.resolve(this.config.root, this.config.output.path), output, group },\n )\n },\n resolveName(name, type) {\n if (!resolveNameWarning) {\n this.driver.events.emit('warn', 'Do not use resolveName for pluginTs, use resolverTs.default instead')\n resolveNameWarning = true\n }\n\n return resolver.default(name, type)\n },\n async install() {\n const { config, fabric, plugin, adapter, rootNode, driver, openInStudio } = this\n\n const root = path.resolve(config.root, config.output.path)\n\n if (!adapter) {\n throw new Error('Plugin cannot work without adapter being set')\n }\n\n await openInStudio({ ast: true })\n\n await walk(rootNode, {\n depth: 'shallow',\n async schema(schemaNode) {\n const writeTasks = generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderSchema(schemaNode, {\n options,\n adapter,\n config,\n fabric,\n Component: generator.Schema,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n async operation(operationNode) {\n const writeTasks = generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderOperation(operationNode, {\n options,\n adapter,\n config,\n fabric,\n Component: generator.Operation,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n })\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAa,UAAU,cAA0B;CAC/C,SAAS,aAAa,WAAW;EAAE,WAAW,CAAC,WAAW;EAAE,YAAY,CAAC,cAAc;EAAE,CAAC;CAC1F,QAAQ,aAAa,UAAU;EAAE,WAAW,CAAC,iBAAiB;EAAE,YAAY,CAAC,oBAAoB;EAAE,CAAC;CACrG,CAAC;;;;;;;;;;;;AAmBF,SAAgBA,YAAU,QAA6B,EAAE,WAAW,cAAc,cAAgC;AAChH,QAAOC,UAAc;EACnB;EACA;EACA,WAAW,CAAC,YAAY,GAAI,aAAa,EAAE,CAAE;EAC7C;EACA;EACD,CAAC;;;;;;;;AChCJ,MAAa,eAAe;;;;;;;;;;;;;;;;;AAkB5B,MAAa,WAAW,cAAwB,YAAY;CAC1D,MAAM,EACJ,SAAS;EAAE,MAAM;EAAS,YAAY;EAAS,EAC/C,OACA,UAAU,EAAE,EACZ,SACA,WAAW,EAAE,EACb,WAAW,WACX,iBAAiB,OACjB,gBAAgB,QAChB,eAAe,iBACf,YAAY,SACZ,aAAa,QACb,cACA,sBAAsB,WACtB,WAAW,gBAAgB,EAAE,EAC7B,cAAc,mBAAmB,EAAE,EACnC,YAAY,iBAAiB,EAAE,KAC7B;CAEJ,MAAM,EAAE,UAAU,cAAc,eAAeC,YAAU,qBAAqB;EAC5E,WAAW;EACX,cAAc;EACd,YAAY;EACb,CAAC;CAEF,IAAI,qBAAqB;CACzB,IAAI,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WAAW,IAAI,OAAO,cAAc;AACrD,UAAI,UAAU,SAAS,WAAW,UAAU,YAAY,KAAK;OAC3D,MAAM,UAAU,SAAS,eAAe,eAAe;QAAE,SAAS,OAAO;QAAS;QAAS;QAAS;QAAU,CAAC;AAE/G,WAAI,YAAY,KACd;AAGF,aAAM,gBAAgB,eAAe;QACnC;QACA;QACA;QACA;QACA,WAAW,UAAU;QACrB;QACA;QACD,CAAC;;OAEJ;AAEF,WAAM,QAAQ,IAAI,WAAW;;IAEhC,CAAC;GAEF,MAAM,cAAc,MAAM,eAAe,KAAK,OAAO,OAAO;IAC1D,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,YAAY,KAAK,OAAO,MACzB;IACF,CAAC;AAEF,SAAM,KAAK,WAAW,GAAG,YAAY;;EAExC;EACD"}
1
+ {"version":3,"file":"index.js","names":["factory.createEnumDeclaration","factory.createLiteralTypeNode","factory.createTrue","factory.createFalse","factory.createPrefixUnaryExpression","factory.createNumericLiteral","factory.createStringLiteral","factory.createTypeReferenceNode","factory.createIdentifier","factory.createOptionalTypeNode","factory.createRestTypeNode","factory.createArrayTypeNode","factory.createTupleTypeNode","factory.createUnionDeclaration","factory.createIndexSignature","factory.createUrlTemplateType","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.createArrayDeclaration","factory.createPropertySignature","factory.appendJSDocToNode","factory.createTypeDeclaration","factory.createOmitDeclaration"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/string.ts","../../../internals/utils/src/object.ts","../src/constants.ts","../src/factory.ts","../src/components/Enum.tsx","../src/printers/printerTs.ts","../src/components/Type.tsx","../src/utils.ts","../src/generators/typeGenerator.tsx","../src/resolvers/resolverTs.ts","../src/resolvers/resolverTsLegacy.ts","../src/generators/typeGeneratorLegacy.tsx","../src/presets.ts","../src/plugin.ts","../src/printers/functionPrinter.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Returns a masked version of a string, showing only the first and last few characters.\n * Useful for logging sensitive values (tokens, keys) without exposing the full value.\n *\n * @example\n * maskString('KUBB_STUDIO-abc123-xyz789') // 'KUBB_STUDIO-…789'\n */\nexport function maskString(value: string, start = 8, end = 4): string {\n if (value.length <= start + end) return value\n return `${value.slice(0, start)}…${value.slice(-end)}`\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Strips functions, symbols, and `undefined` values from plugin options for safe JSON transport.\n *\n * @example\n * ```ts\n * serializePluginOptions({ output: './src', onWrite: () => {} })\n * // { output: './src' } (function stripped)\n * ```\n */\nexport function serializePluginOptions<TOptions extends object>(options: TOptions): TOptions {\n if (options === null || options === undefined) return {} as TOptions\n if (typeof options !== 'object') return options\n if (Array.isArray(options)) return options.map(serializePluginOptions) as unknown as TOptions\n\n const serialized: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' || typeof value === 'symbol' || value === undefined) continue\n serialized[key] = value !== null && typeof value === 'object' ? serializePluginOptions(value as object) : value\n }\n return serialized as TOptions\n}\n\n/**\n * Strips all `undefined` values from an object recursively by round-tripping through JSON.\n * Useful for clean inline snapshot assertions that only show fields with actual values.\n *\n * @example\n * toSnapshot({ kind: 'Schema', name: undefined, type: 'string' })\n * // { kind: 'Schema', type: 'string' }\n */\nexport function toSnapshot<T>(value: T): T {\n return JSON.parse(JSON.stringify(value))\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | null {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","import type { PluginTs } from './types.ts'\n\ntype OptionalType = PluginTs['resolvedOptions']['optionalType']\ntype EnumType = PluginTs['resolvedOptions']['enumType']\n\n/**\n * `optionalType` values that cause a property's type to include `| undefined`.\n */\nexport const OPTIONAL_ADDS_UNDEFINED = new Set<OptionalType>(['undefined', 'questionTokenAndUndefined'] as const)\n\n/**\n * `optionalType` values that render the property key with a `?` token.\n */\nexport const OPTIONAL_ADDS_QUESTION_TOKEN = new Set<OptionalType>(['questionToken', 'questionTokenAndUndefined'] as const)\n\n/**\n * `enumType` values that append a `Key` suffix to the generated enum type alias.\n */\nexport const ENUM_TYPES_WITH_KEY_SUFFIX = new Set<EnumType>(['asConst', 'asPascalConst'] as const)\n\n/**\n * `enumType` values that require a runtime value declaration (object, enum, or literal).\n */\nexport const ENUM_TYPES_WITH_RUNTIME_VALUE = new Set<EnumType | undefined>(['enum', 'asConst', 'asPascalConst', 'constEnum', 'literal', undefined] as const)\n\n/**\n * `enumType` values whose type declaration is type-only (no runtime value emitted for the type alias).\n */\nexport const ENUM_TYPES_WITH_TYPE_ONLY = new Set<EnumType | undefined>(['asConst', 'asPascalConst', 'literal', undefined] as const)\n","import { camelCase, pascalCase, screamingSnakeCase, snakeCase } from '@internals/utils'\nimport { isNumber, sortBy } from 'remeda'\nimport ts from 'typescript'\n\nconst { SyntaxKind, factory } = ts\n\n// https://ts-ast-viewer.com/\n\nexport const modifiers = {\n async: factory.createModifier(ts.SyntaxKind.AsyncKeyword),\n export: factory.createModifier(ts.SyntaxKind.ExportKeyword),\n const: factory.createModifier(ts.SyntaxKind.ConstKeyword),\n static: factory.createModifier(ts.SyntaxKind.StaticKeyword),\n} as const\n\nexport const syntaxKind = {\n union: SyntaxKind.UnionType as 192,\n literalType: SyntaxKind.LiteralType,\n stringLiteral: SyntaxKind.StringLiteral,\n} as const\n\nfunction isValidIdentifier(str: string): boolean {\n if (!str.length || str.trim() !== str) {\n return false\n }\n const node = ts.parseIsolatedEntityName(str, ts.ScriptTarget.Latest)\n\n return !!node && node.kind === ts.SyntaxKind.Identifier && ts.identifierToKeywordKind(node.kind as unknown as ts.Identifier) === undefined\n}\n\nfunction propertyName(name: string | ts.PropertyName): ts.PropertyName {\n if (typeof name === 'string') {\n const isValid = isValidIdentifier(name)\n return isValid ? factory.createIdentifier(name) : factory.createStringLiteral(name)\n }\n return name\n}\n\nconst questionToken = factory.createToken(ts.SyntaxKind.QuestionToken)\n\nexport function createQuestionToken(token?: boolean | ts.QuestionToken) {\n if (!token) {\n return undefined\n }\n if (token === true) {\n return questionToken\n }\n return token\n}\n\nexport function createIntersectionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode | 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 = factory.createIntersectionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\nexport function createArrayDeclaration({ nodes, arrayType = 'array' }: { nodes: Array<ts.TypeNode>; arrayType?: 'array' | 'generic' }): ts.TypeNode | null {\n if (!nodes.length) {\n return factory.createTupleTypeNode([])\n }\n\n if (nodes.length === 1) {\n const node = nodes[0]\n if (!node) {\n return null\n }\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [node])\n }\n return factory.createArrayTypeNode(node)\n }\n\n // For union types (multiple nodes), respect arrayType preference\n const unionType = factory.createUnionTypeNode(nodes)\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [unionType])\n }\n // For array syntax with unions, we need parentheses: (string | number)[]\n return factory.createArrayTypeNode(factory.createParenthesizedType(unionType))\n}\n\n/**\n * Minimum nodes length of 2\n * @example `string | number`\n */\nexport function createUnionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode {\n if (!nodes.length) {\n return keywordTypeNodes.any\n }\n\n if (nodes.length === 1) {\n return nodes[0] as ts.TypeNode\n }\n\n const node = factory.createUnionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\nexport function createPropertySignature({\n readOnly,\n modifiers = [],\n name,\n questionToken,\n type,\n}: {\n readOnly?: boolean\n modifiers?: Array<ts.Modifier>\n name: ts.PropertyName | string\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n}) {\n return factory.createPropertySignature(\n [...modifiers, readOnly ? factory.createToken(ts.SyntaxKind.ReadonlyKeyword) : undefined].filter(Boolean),\n propertyName(name),\n createQuestionToken(questionToken),\n type,\n )\n}\n\nexport function createParameterSignature(\n name: string | ts.BindingName,\n {\n modifiers,\n dotDotDotToken,\n questionToken,\n type,\n initializer,\n }: {\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n dotDotDotToken?: ts.DotDotDotToken\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n initializer?: ts.Expression\n },\n): ts.ParameterDeclaration {\n return factory.createParameterDeclaration(modifiers, dotDotDotToken, name, createQuestionToken(questionToken), type, initializer)\n}\n\nexport function createJSDoc({ comments }: { comments: string[] }) {\n if (!comments.length) {\n return null\n }\n return factory.createJSDocComment(\n factory.createNodeArray(\n comments.map((comment, i) => {\n if (i === comments.length - 1) {\n return factory.createJSDocText(comment)\n }\n\n return factory.createJSDocText(`${comment}\\n`)\n }),\n ),\n )\n}\n\n/**\n * @link https://github.com/microsoft/TypeScript/issues/44151\n */\nexport function appendJSDocToNode<TNode extends ts.Node>({ node, comments }: { node: TNode; comments: Array<string | undefined> }) {\n const filteredComments = comments.filter(Boolean)\n\n if (!filteredComments.length) {\n return node\n }\n\n const text = filteredComments.reduce((acc = '', comment = '') => {\n return `${acc}\\n * ${comment.replaceAll('*/', '*\\\\/')}`\n }, '*')\n\n // Use the node directly instead of spreading to avoid creating Unknown nodes\n // TypeScript's addSyntheticLeadingComment accepts the node as-is\n return ts.addSyntheticLeadingComment(node, ts.SyntaxKind.MultiLineCommentTrivia, `${text || '*'}\\n`, true)\n}\n\nexport function createIndexSignature(\n type: ts.TypeNode,\n {\n modifiers,\n indexName = 'key',\n indexType = factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n }: {\n indexName?: string\n indexType?: ts.TypeNode\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n } = {},\n) {\n return factory.createIndexSignature(modifiers, [createParameterSignature(indexName, { type: indexType })], type)\n}\n\nexport function createTypeAliasDeclaration({\n modifiers,\n name,\n typeParameters,\n type,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n type: ts.TypeNode\n}) {\n return factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type)\n}\n\nexport function createInterfaceDeclaration({\n modifiers,\n name,\n typeParameters,\n members,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n members: Array<ts.TypeElement>\n}) {\n return factory.createInterfaceDeclaration(modifiers, name, typeParameters, undefined, members)\n}\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 | ts.Identifier\n type: ts.TypeNode\n}) {\n if (syntax === 'interface' && 'members' in type) {\n const node = createInterfaceDeclaration({\n members: type.members as Array<ts.TypeElement>,\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n }\n\n const node = createTypeAliasDeclaration({\n type,\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n}\n\nexport function createNamespaceDeclaration({ statements, name }: { name: string; statements: ts.Statement[] }) {\n return factory.createModuleDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(name),\n factory.createModuleBlock(statements),\n ts.NodeFlags.Namespace,\n )\n}\n\n/**\n * In { propertyName: string; name?: string } is `name` being used to make the type more unique when multiple same names are used.\n * @example `import { Pet as Cat } from './Pet'`\n */\nexport function createImportDeclaration({\n name,\n path,\n isTypeOnly = false,\n isNameSpace = false,\n}: {\n name: string | Array<string | { propertyName: string; name?: string }>\n path: string\n isTypeOnly?: boolean\n isNameSpace?: boolean\n}) {\n if (!Array.isArray(name)) {\n let importPropertyName: ts.Identifier | undefined = factory.createIdentifier(name)\n let importName: ts.NamedImportBindings | undefined\n\n if (isNameSpace) {\n importPropertyName = undefined\n importName = factory.createNamespaceImport(factory.createIdentifier(name))\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, importPropertyName, importName),\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the imports alphabetically for consistent output across platforms\n const sortedName = sortBy(name, [(item) => (typeof item === 'object' ? item.propertyName : item), 'asc'])\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(\n isTypeOnly,\n undefined,\n factory.createNamedImports(\n sortedName.map((item) => {\n if (typeof item === 'object') {\n const obj = item as { propertyName: string; name?: string }\n if (obj.name) {\n return factory.createImportSpecifier(false, factory.createIdentifier(obj.propertyName), factory.createIdentifier(obj.name))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(obj.propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n }),\n ),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\nexport function createExportDeclaration({\n path,\n asAlias,\n isTypeOnly = false,\n name,\n}: {\n path: string\n asAlias?: boolean\n isTypeOnly?: boolean\n name?: string | Array<ts.Identifier | string>\n}) {\n if (name && !Array.isArray(name) && !asAlias) {\n console.warn(`When using name as string, asAlias should be true ${name}`)\n }\n\n if (!Array.isArray(name)) {\n const parsedName = name?.match(/^\\d/) ? `_${name?.slice(1)}` : name\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n asAlias && parsedName ? factory.createNamespaceExport(factory.createIdentifier(parsedName)) : undefined,\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the exports alphabetically for consistent output across platforms\n const sortedName = sortBy(name, [(propertyName) => (typeof propertyName === 'string' ? propertyName : propertyName.text), 'asc'])\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n factory.createNamedExports(\n sortedName.map((propertyName) => {\n return factory.createExportSpecifier(false, undefined, typeof propertyName === 'string' ? factory.createIdentifier(propertyName) : propertyName)\n }),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\n/**\n * Apply casing transformation to enum keys\n */\nfunction applyEnumKeyCasing(key: string, casing: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none' = 'none'): string {\n if (casing === 'none') {\n return key\n }\n if (casing === 'screamingSnakeCase') {\n return screamingSnakeCase(key)\n }\n if (casing === 'snakeCase') {\n return snakeCase(key)\n }\n if (casing === 'pascalCase') {\n return pascalCase(key)\n }\n if (casing === 'camelCase') {\n return camelCase(key)\n }\n return key\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`, `asPascalConst`, `constEnum`, or `literal` for enums.\n * - `enum`: TypeScript enum\n * - `asConst`: const with camelCase name (e.g., `petType`)\n * - `asPascalConst`: const with PascalCase name (e.g., `PetType`)\n * - `constEnum`: const enum\n * - `literal`: literal union type\n * @default `'enum'`\n */\n type?: 'enum' | 'asConst' | 'asPascalConst' | '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: [key: string | number, value: string | number | boolean][]\n /**\n * Choose the casing for enum key names.\n * @default 'none'\n */\n enumKeyCasing?: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none'\n}): [name: ts.Node | undefined, type: ts.Node] {\n if (type === 'literal' || type === 'inlineLiteral') {\n return [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createUnionTypeNode(\n enums\n .map(([_key, value]) => {\n if (isNumber(value)) {\n if (value < 0) {\n return factory.createLiteralTypeNode(\n factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))),\n )\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value?.toString()))\n }\n\n if (typeof value === 'boolean') {\n return factory.createLiteralTypeNode(value ? factory.createTrue() : factory.createFalse())\n }\n if (value) {\n return factory.createLiteralTypeNode(factory.createStringLiteral(value.toString()))\n }\n\n return undefined\n })\n .filter(Boolean),\n ),\n ),\n ]\n }\n\n if (type === 'enum' || type === 'constEnum') {\n return [\n undefined,\n factory.createEnumDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword), type === 'constEnum' ? factory.createToken(ts.SyntaxKind.ConstKeyword) : undefined].filter(Boolean),\n factory.createIdentifier(typeName),\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n const isExactNumber = Number.parseInt(value.toString(), 10) === value\n\n if (isExactNumber && isNumber(Number.parseInt(value.toString(), 10))) {\n if ((value as number) < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value as number)))\n } else {\n initializer = factory.createNumericLiteral(value as number)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (isNumber(Number.parseInt(key.toString(), 10))) {\n const casingKey = applyEnumKeyCasing(`${typeName}_${key}`, enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter(Boolean),\n ),\n ]\n }\n\n // used when using `as const` instead of an TypeScript enum.\n // name is already PascalCase for asPascalConst and camelCase for asConst (set in Type.tsx)\n // typeName has the Key suffix for 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 [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n ),\n ]\n }\n\n return [\n factory.createVariableStatement(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createVariableDeclarationList(\n [\n factory.createVariableDeclaration(\n factory.createIdentifier(identifierName),\n undefined,\n undefined,\n factory.createAsExpression(\n factory.createObjectLiteralExpression(\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n\n if (isNumber(value)) {\n // Error: Negative numbers should be created in combination with createPrefixUnaryExpression factory.\n // The method createNumericLiteral only accepts positive numbers\n // or those combined with createPrefixUnaryExpression.\n // Therefore, we need to ensure that the number is not negative.\n if (value < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value)))\n } else {\n initializer = factory.createNumericLiteral(value)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createPropertyAssignment(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter(Boolean),\n true,\n ),\n factory.createTypeReferenceNode(factory.createIdentifier('const'), undefined),\n ),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n ),\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createIndexedAccessTypeNode(\n factory.createParenthesizedType(factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n factory.createTypeOperatorNode(ts.SyntaxKind.KeyOfKeyword, factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n ),\n ),\n ]\n}\n\nexport function createOmitDeclaration({ keys, type, nonNullable }: { keys: Array<string> | string; type: ts.TypeNode; nonNullable?: boolean }) {\n const node = nonNullable ? factory.createTypeReferenceNode(factory.createIdentifier('NonNullable'), [type]) : type\n\n if (Array.isArray(keys)) {\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [\n node,\n factory.createUnionTypeNode(\n keys.map((key) => {\n return factory.createLiteralTypeNode(factory.createStringLiteral(key))\n }),\n ),\n ])\n }\n\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [node, factory.createLiteralTypeNode(factory.createStringLiteral(keys))])\n}\n\nexport const keywordTypeNodes = {\n any: factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),\n unknown: factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword),\n void: factory.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword),\n number: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n integer: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n bigint: factory.createKeywordTypeNode(ts.SyntaxKind.BigIntKeyword),\n object: factory.createKeywordTypeNode(ts.SyntaxKind.ObjectKeyword),\n string: factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n boolean: factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),\n undefined: factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword),\n null: factory.createLiteralTypeNode(factory.createToken(ts.SyntaxKind.NullKeyword)),\n never: factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n} as const\n\n/**\n * Converts a path like '/pet/{petId}/uploadImage' to a template literal type\n * like `/pet/${string}/uploadImage`\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): ts.TypeNode {\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 factory.createLiteralTypeNode(factory.createStringLiteral(normalized))\n }\n\n const segments = normalized.split(/(\\{[^}]+\\})/)\n const parts: string[] = []\n const parameterIndices: number[] = []\n\n segments.forEach((segment) => {\n if (segment.startsWith('{') && segment.endsWith('}')) {\n parameterIndices.push(parts.length)\n parts.push(segment)\n } else if (segment) {\n parts.push(segment)\n }\n })\n\n const head = ts.factory.createTemplateHead(parts[0] || '')\n const templateSpans: ts.TemplateLiteralTypeSpan[] = []\n\n parameterIndices.forEach((paramIndex, i) => {\n const isLast = i === parameterIndices.length - 1\n const nextPart = parts[paramIndex + 1] || ''\n const literal = isLast ? ts.factory.createTemplateTail(nextPart) : ts.factory.createTemplateMiddle(nextPart)\n templateSpans.push(ts.factory.createTemplateLiteralTypeSpan(keywordTypeNodes.string, literal))\n })\n\n return ts.factory.createTemplateLiteralType(head, templateSpans)\n}\n\nexport const createTypeLiteralNode = factory.createTypeLiteralNode\n\nexport const createTypeReferenceNode = factory.createTypeReferenceNode\nexport const createNumericLiteral = factory.createNumericLiteral\nexport const createStringLiteral = factory.createStringLiteral\n\nexport const createArrayTypeNode = factory.createArrayTypeNode\nexport const createParenthesizedType = factory.createParenthesizedType\n\nexport const createLiteralTypeNode = factory.createLiteralTypeNode\nexport const createNull = factory.createNull\nexport const createIdentifier = factory.createIdentifier\n\nexport const createOptionalTypeNode = factory.createOptionalTypeNode\nexport const createTupleTypeNode = factory.createTupleTypeNode\nexport const createRestTypeNode = factory.createRestTypeNode\nexport const createTrue = factory.createTrue\nexport const createFalse = factory.createFalse\nexport const createIndexedAccessTypeNode = factory.createIndexedAccessTypeNode\nexport const createTypeOperatorNode = factory.createTypeOperatorNode\nexport const createPrefixUnaryExpression = factory.createPrefixUnaryExpression\n\nexport { SyntaxKind }\n","import { camelCase, trimQuotes } from '@internals/utils'\nimport type { EnumSchemaNode } from '@kubb/ast/types'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, ENUM_TYPES_WITH_RUNTIME_VALUE, ENUM_TYPES_WITH_TYPE_ONLY } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\n\ntype Props = {\n node: EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\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\n * properties the adapter already emits a PascalCase+suffix name so resolution is typically a no-op.\n */\nexport function getEnumNames({\n node,\n enumType,\n enumTypeSuffix,\n resolver,\n}: {\n node: EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n resolver: ResolverTs\n}): {\n enumName: string\n typeName: string\n /**\n * The PascalCase name that `$ref` importers will use to reference this enum type.\n * For `asConst`/`asPascalConst` this differs from `typeName` (which has a `Key` suffix).\n */\n refName: string\n} {\n const resolved = resolver.default(node.name!, 'type')\n const enumName = enumType === 'asPascalConst' ? resolved : camelCase(node.name!)\n const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolved\n\n return { enumName, typeName, refName: resolved }\n}\n\n/**\n * Renders the enum declaration(s) for a single named `EnumSchemaNode`.\n *\n * Depending on `enumType` this may emit:\n * - A runtime object (`asConst` / `asPascalConst`) 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, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): FabricReactNode {\n const { enumName, typeName } = getEnumNames({ node, enumType, enumTypeSuffix, resolver })\n\n const [nameNode, typeNode] = factory.createEnumDeclaration({\n name: enumName,\n typeName,\n enums: (node.namedEnumValues?.map((v) => [trimQuotes(v.name.toString()), v.value]) ??\n node.enumValues?.filter((v): v is NonNullable<typeof v> => v !== null && v !== undefined).map((v) => [trimQuotes(v.toString()), v]) ??\n []) as unknown as Array<[string, string]>,\n type: enumType,\n enumKeyCasing,\n })\n\n return (\n <>\n {nameNode && (\n <File.Source name={enumName} isExportable isIndexable isTypeOnly={false}>\n {safePrint(nameNode)}\n </File.Source>\n )}\n <File.Source name={typeName} isIndexable isExportable={ENUM_TYPES_WITH_RUNTIME_VALUE.has(enumType)} isTypeOnly={ENUM_TYPES_WITH_TYPE_ONLY.has(enumType)}>\n {safePrint(typeNode)}\n </File.Source>\n </>\n )\n}\n","import { jsStringEscape, stringify } from '@internals/utils'\nimport { isStringType, narrowSchema, schemaTypes } from '@kubb/ast'\nimport type { ArraySchemaNode, SchemaNode } from '@kubb/ast/types'\nimport type { PrinterFactoryOptions } from '@kubb/core'\nimport { definePrinter } from '@kubb/core'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport type ts from 'typescript'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, OPTIONAL_ADDS_QUESTION_TOKEN, OPTIONAL_ADDS_UNDEFINED } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\n\ntype TsOptions = {\n /**\n * @default `'questionToken'`\n */\n optionalType: PluginTs['resolvedOptions']['optionalType']\n /**\n * @default `'array'`\n */\n arrayType: PluginTs['resolvedOptions']['arrayType']\n /**\n * @default `'inlineLiteral'`\n */\n enumType: PluginTs['resolvedOptions']['enumType']\n /**\n * Suffix appended to the generated type alias name when `enumType` is `asConst` or `asPascalConst`.\n *\n * @default `'Key'`\n */\n enumTypeSuffix?: PluginTs['resolvedOptions']['enumTypeSuffix']\n /**\n * Controls whether a `type` alias or `interface` declaration is emitted.\n * @default `'type'`\n */\n syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n /**\n * When set, `printer.print(node)` produces a full `type Name = …` declaration.\n * When omitted, `printer.print(node)` returns the raw type node.\n */\n name?: string\n\n /**\n * JSDoc `@description` comment added to the generated type or interface declaration.\n */\n description?: string\n /**\n * Property keys to exclude from the generated type via `Omit<Type, Keys>`.\n * Forces type-alias syntax even when `syntaxType` is `'interface'`.\n */\n keysToOmit?: Array<string>\n /**\n * Resolver used to transform raw schema names into valid TypeScript identifiers.\n */\n resolver: ResolverTs\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).\n */\ntype TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode, string>\n\n/**\n * Converts a primitive const value to a TypeScript literal type node.\n * Handles negative numbers via a prefix unary expression.\n */\nfunction constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {\n if (format === 'boolean') {\n return factory.createLiteralTypeNode(value === true ? factory.createTrue() : factory.createFalse())\n }\n if (format === 'number' && typeof value === 'number') {\n if (value < 0) {\n return factory.createLiteralTypeNode(factory.createPrefixUnaryExpression(factory.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))))\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value))\n }\n return factory.createLiteralTypeNode(factory.createStringLiteral(String(value)))\n}\n\n/**\n * Returns a `Date` reference type node when `representation` is `'date'`, otherwise falls back to `string`.\n */\nfunction dateOrStringNode(node: { representation?: string }): ts.TypeNode {\n return node.representation === 'date' ? factory.createTypeReferenceNode(factory.createIdentifier('Date')) : factory.keywordTypeNodes.string\n}\n\n/**\n * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.\n */\nfunction buildMemberNodes(members: Array<SchemaNode> | undefined, print: (node: SchemaNode) => ts.TypeNode | null | undefined): Array<ts.TypeNode> {\n return (members ?? []).map(print).filter(Boolean)\n}\n\n/**\n * Builds a TypeScript tuple type node from an array schema's `items`,\n * applying min/max slice and optional/rest element rules.\n */\nfunction buildTupleNode(node: ArraySchemaNode, print: (node: SchemaNode) => ts.TypeNode | null | undefined): ts.TypeNode | undefined {\n let items = (node.items ?? []).map(print).filter(Boolean)\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 ? factory.createOptionalTypeNode(item) : item))\n }\n\n if (max === undefined && restNode) {\n items.push(factory.createRestTypeNode(factory.createArrayTypeNode(restNode)))\n }\n\n return factory.createTupleTypeNode(items)\n}\n\n/**\n * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.\n */\nfunction buildPropertyType(schema: SchemaNode, baseType: ts.TypeNode, optionalType: TsOptions['optionalType']): ts.TypeNode {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)\n\n let type = baseType\n\n if (schema.nullable) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })\n }\n\n if ((schema.nullish || schema.optional) && addsUndefined) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })\n }\n\n return type\n}\n\n/**\n * Collects JSDoc annotation strings (description, deprecated, min/max, pattern, default, example, type) for a schema node.\n */\nfunction buildPropertyJSDocComments(schema: SchemaNode): Array<string | undefined> {\n const isArray = schema.type === 'array'\n\n return [\n 'description' in schema && schema.description ? `@description ${jsStringEscape(schema.description)}` : undefined,\n 'deprecated' in schema && schema.deprecated ? '@deprecated' : undefined,\n // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength\n !isArray && 'min' in schema && schema.min !== undefined ? `@minLength ${schema.min}` : undefined,\n !isArray && 'max' in schema && schema.max !== undefined ? `@maxLength ${schema.max}` : undefined,\n 'pattern' in schema && schema.pattern ? `@pattern ${schema.pattern}` : undefined,\n 'default' in schema && schema.default !== undefined\n ? `@default ${'primitive' in schema && schema.primitive === 'string' ? stringify(schema.default as string) : schema.default}`\n : undefined,\n 'example' in schema && schema.example !== undefined ? `@example ${schema.example}` : undefined,\n 'primitive' in schema && schema.primitive\n ? [`@type ${schema.primitive || 'unknown'}`, 'optional' in schema && schema.optional ? ' | undefined' : undefined].filter(Boolean).join('')\n : undefined,\n ]\n}\n\n/**\n * Creates TypeScript index signatures for `additionalProperties` and `patternProperties` on an object schema node.\n */\nfunction buildIndexSignatures(\n node: { additionalProperties?: SchemaNode | boolean; patternProperties?: Record<string, SchemaNode> },\n propertyCount: number,\n print: (node: SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeElement> {\n const elements: Array<ts.TypeElement> = []\n\n if (node.additionalProperties && node.additionalProperties !== true) {\n const additionalType = print(node.additionalProperties) ?? factory.keywordTypeNodes.unknown\n\n elements.push(factory.createIndexSignature(propertyCount > 0 ? factory.keywordTypeNodes.unknown : additionalType))\n } else if (node.additionalProperties === true) {\n elements.push(factory.createIndexSignature(factory.keywordTypeNodes.unknown))\n }\n\n if (node.patternProperties) {\n const first = Object.values(node.patternProperties)[0]\n if (first) {\n let patternType = print(first) ?? factory.keywordTypeNodes.unknown\n\n if (first.nullable) {\n patternType = factory.createUnionDeclaration({ nodes: [patternType, factory.keywordTypeNodes.null] })\n }\n elements.push(factory.createIndexSignature(patternType))\n }\n }\n\n return elements\n}\n\n/**\n * TypeScript type printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST node into a TypeScript AST node:\n * - **`printer.print(node)`** — when `options.typeName` is set, returns a full\n * `type Name = …` or `interface Name { … }` declaration (`ts.Node`).\n * Without `typeName`, returns the raw `ts.TypeNode` for the schema.\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', enumType: 'inlineLiteral' })\n * const typeNode = printer.print(schemaNode) // ts.TypeNode\n * ```\n *\n * @example Full declaration (with `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral', typeName: 'MyType' })\n * const declaration = printer.print(schemaNode) // ts.TypeAliasDeclaration | ts.InterfaceDeclaration\n * ```\n */\nexport const printerTs = definePrinter<TsPrinter>((options) => {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(options.optionalType)\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 datetime: () => factory.keywordTypeNodes.string,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n bigint: () => factory.keywordTypeNodes.bigint,\n date: dateOrStringNode,\n time: dateOrStringNode,\n ref(node) {\n if (!node.name) {\n return undefined\n }\n // Parser-generated refs (with $ref) carry raw schema names that need resolving.\n // Use the canonical name from the $ref path — node.name may have been overridden\n // (e.g. by single-member allOf flatten using the property-derived child name).\n // Inline refs (without $ref) from utils already carry resolved type names.\n const refName = node.ref ? (node.ref.split('/').at(-1) ?? node.name) : node.name\n const name = node.ref ? this.options.resolver.default(refName, 'type') : refName\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n enum(node) {\n const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n\n if (this.options.enumType === 'inlineLiteral' || !node.name) {\n const literalNodes = values\n .filter((v): v is string | number | boolean => v !== null)\n .map((value) => constToTypeNode(value, typeof value as 'string' | 'number' | 'boolean'))\n .filter(Boolean)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined\n }\n\n const resolvedName =\n ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) && this.options.enumTypeSuffix\n ? this.options.resolver.resolveEnumKeyName(node as unknown as SchemaNode, this.options.enumTypeSuffix)\n : this.options.resolver.default(node.name, 'type')\n\n return factory.createTypeReferenceNode(resolvedName, undefined)\n },\n union(node) {\n const members = node.members ?? []\n\n const hasStringLiteral = members.some((m) => {\n const enumNode = narrowSchema(m, schemaTypes.enum)\n return enumNode?.primitive === 'string'\n })\n const hasPlainString = members.some((m) => isStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const memberNodes = members\n .map((m) => {\n if (isStringType(m)) {\n return factory.createIntersectionDeclaration({\n nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],\n withParentheses: true,\n })\n }\n\n return this.transform(m)\n })\n .filter(Boolean)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: memberNodes }) ?? undefined\n }\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: buildMemberNodes(members, this.transform) }) ?? undefined\n },\n intersection(node) {\n return factory.createIntersectionDeclaration({ withParentheses: true, nodes: buildMemberNodes(node.members, this.transform) }) ?? undefined\n },\n array(node) {\n const itemNodes = (node.items ?? []).map((item) => this.transform(item)).filter(Boolean)\n\n return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? undefined\n },\n tuple(node) {\n return buildTupleNode(node, this.transform)\n },\n object(node) {\n const { transform, options } = this\n\n const addsQuestionToken = OPTIONAL_ADDS_QUESTION_TOKEN.has(options.optionalType)\n\n const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {\n const baseType = transform(prop.schema) ?? factory.keywordTypeNodes.unknown\n const type = buildPropertyType(prop.schema, baseType, options.optionalType)\n\n const propertyNode = factory.createPropertySignature({\n questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,\n name: prop.name,\n type,\n readOnly: prop.schema.readOnly,\n })\n\n return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })\n })\n\n const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, transform)]\n\n if (!allElements.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(allElements)\n },\n },\n print(node) {\n let type = this.transform(node)\n\n if (!type) {\n return null\n }\n\n // Apply top-level nullable / optional union modifiers.\n if (node.nullable) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })\n }\n\n if ((node.nullish || node.optional) && addsUndefined) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })\n }\n\n // Without name, return the type node as-is (no declaration wrapping).\n const { name, syntaxType = 'type', description, keysToOmit } = this.options\n if (!name) {\n return safePrint(type)\n }\n\n const useTypeGeneration = syntaxType === 'type' || type.kind === factory.syntaxKind.union || !!keysToOmit?.length\n\n const typeNode = factory.createTypeDeclaration({\n name,\n isExportable: true,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n syntax: useTypeGeneration ? 'type' : 'interface',\n comments: [\n node?.title ? jsStringEscape(node.title) : undefined,\n description ? `@description ${jsStringEscape(description)}` : undefined,\n node?.deprecated ? '@deprecated' : undefined,\n node && 'min' in node && node.min !== undefined ? `@minLength ${node.min}` : undefined,\n node && 'max' in node && node.max !== undefined ? `@maxLength ${node.max}` : undefined,\n node && 'pattern' in node && node.pattern ? `@pattern ${node.pattern}` : undefined,\n node?.default ? `@default ${node.default}` : undefined,\n node?.example ? `@example ${node.example}` : undefined,\n ],\n })\n\n return safePrint(typeNode)\n },\n }\n})\n","import { collect, narrowSchema, schemaTypes } from '@kubb/ast'\nimport type { EnumSchemaNode, SchemaNode } from '@kubb/ast/types'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n name: string\n node: SchemaNode\n optionalType: PluginTs['resolvedOptions']['optionalType']\n arrayType: PluginTs['resolvedOptions']['arrayType']\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n syntaxType: PluginTs['resolvedOptions']['syntaxType']\n resolver: PluginTs['resolver']\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Type({\n name,\n node,\n keysToOmit,\n optionalType,\n arrayType,\n syntaxType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n description,\n resolver,\n}: Props): FabricReactNode {\n const resolvedDescription = description || node?.description\n const enumSchemaNodes = collect<EnumSchemaNode>(node, {\n schema(n): EnumSchemaNode | undefined {\n const enumNode = narrowSchema(n, schemaTypes.enum)\n if (enumNode?.name) return enumNode\n },\n })\n\n const printer = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name,\n syntaxType,\n description: resolvedDescription,\n keysToOmit,\n resolver,\n })\n const output = printer.print(node)\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, enumType, enumTypeSuffix, resolver }),\n }\n })\n\n // Skip enum exports when using inlineLiteral\n const shouldExportEnums = enumType !== 'inlineLiteral'\n const shouldExportType = enumType === 'inlineLiteral' || enums.every((item) => item.typeName !== name)\n\n return (\n <>\n {shouldExportEnums &&\n enums.map(({ node }) => <Enum node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />)}\n {shouldExportType && (\n <File.Source name={name} isTypeOnly isExportable isIndexable>\n {output}\n </File.Source>\n )}\n </>\n )\n}\n","import { createProperty, createSchema } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport type { ResolverTs } from './types.ts'\n\ntype BuildParamsSchemaOptions = {\n params: Array<ParameterNode>\n node: OperationNode\n resolver: ResolverTs\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\nexport function buildParams({ params, node, resolver }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n required: param.required,\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n }),\n }),\n ),\n })\n}\n\nexport function buildData({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n return createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody?.schema\n ? createSchema({ type: 'ref', name: resolver.resolveDataName(node), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n required: pathParams.length > 0,\n schema: pathParams.length > 0 ? buildParams({ params: pathParams, node, resolver }) : createSchema({ type: 'never' }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParams({ params: queryParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParams({ params: headerParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'url',\n required: true,\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\nexport function buildResponses({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n createProperty({\n name: String(res.statusCode),\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) }),\n }),\n ),\n })\n}\n\nexport function buildResponseUnion({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n","import path from 'node:path'\nimport { caseParams, composeTransformers, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport type { PluginTs } from '../types'\nimport { buildData, buildResponses, buildResponseUnion } from '../utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const file = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const params = caseParams(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const transformedNode = transform(schemaNode, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n node={transformedNode}\n description={description}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n />\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n node: param.schema,\n name: resolver.resolveParamName(node, param),\n }),\n )\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: node.requestBody.schema,\n name: resolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n const responseTypes = node.responses.map((res) =>\n renderSchemaType({\n node: res.schema,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const dataType = renderSchemaType({\n node: buildData({ node: { ...node, parameters: params }, resolver }),\n name: resolver.resolveRequestConfigName(node),\n })\n\n const responsesType = renderSchemaType({\n node: buildResponses({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const responseType = renderSchemaType({\n node: buildResponseUnion({ node, resolver }),\n name: resolver.resolveResponseName(node),\n description: 'Union of all possible responses',\n })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {paramTypes}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n if (!node.name) {\n return\n }\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(node, schemaTypes.enum)\n\n const name = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveName(node.name)\n\n const type = {\n name,\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),\n } as const\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n node={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n />\n </File>\n )\n },\n})\n","import { pascalCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\n\nfunction resolveName(name: string, type?: 'file' | 'function' | 'type' | 'const'): string {\n return pascalCase(name, { isFile: type === 'file' })\n}\n\n/**\n * Resolver for `@kubb/plugin-ts` that provides the default naming and path-resolution\n * helpers used by the plugin. Import this in other plugins to resolve the exact names and\n * paths that `plugin-ts` generates without hardcoding the conventions.\n *\n * The `default` method is automatically injected by `defineResolver` — it uses `camelCase`\n * for identifiers/files and `pascalCase` for type names.\n *\n * @example\n * ```ts\n * import { resolver } from '@kubb/plugin-ts'\n *\n * resolver.default('list pets', 'type') // → 'ListPets'\n * resolver.resolveName('list pets status 200') // → 'ListPetsStatus200'\n * resolver.resolvePathName('list pets', 'file') // → 'listPets'\n * ```\n */\nexport const resolverTs = defineResolver<PluginTs>(() => {\n return {\n name: 'default',\n pluginName: 'plugin-ts',\n default(name, type) {\n return resolveName(name, type)\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveParamName(node, param) {\n return this.resolveName(`${node.operationId} ${param.in} ${param.name}`)\n },\n resolveResponseStatusName(node, statusCode) {\n return this.resolveName(`${node.operationId} Status ${statusCode}`)\n },\n resolveDataName(node) {\n return this.resolveName(`${node.operationId} Data`)\n },\n resolveRequestConfigName(node) {\n return this.resolveName(`${node.operationId} RequestConfig`)\n },\n resolveResponsesName(node) {\n return this.resolveName(`${node.operationId} Responses`)\n },\n resolveResponseName(node) {\n return this.resolveName(`${node.operationId} Response`)\n },\n resolveEnumKeyName(node, enumTypeSuffix = 'key') {\n return `${this.resolveName(node.name ?? '')}${enumTypeSuffix}`\n },\n resolvePathParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n resolveQueryParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n resolveHeaderParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n }\n})\n","import { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\nimport { resolverTs } from './resolverTs.ts'\n\n/**\n * Legacy resolver for `@kubb/plugin-ts` that reproduces the naming conventions\n * used before the v2 resolver refactor. Enable via `compatibilityPreset: 'kubbV4'`\n * (or by composing this resolver manually).\n *\n * Key differences from the default resolver:\n * - Response status types: `<OperationId><StatusCode>` (e.g. `CreatePets201`) instead of `<OperationId>Status201`\n * - Default/error responses: `<OperationId>Error` instead of `<OperationId>StatusDefault`\n * - Request body: `<OperationId>MutationRequest` (non-GET) / `<OperationId>QueryRequest` (GET)\n * - Combined responses type: `<OperationId>Mutation` / `<OperationId>Query`\n * - Response union: `<OperationId>MutationResponse` / `<OperationId>QueryResponse`\n *\n * @example\n * ```ts\n * import { resolverTsLegacy } from '@kubb/plugin-ts'\n *\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 201) // → 'CreatePets201'\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 'default') // → 'CreatePetsError'\n * resolverTsLegacy.resolveDataTypedName(node) // → 'CreatePetsMutationRequest' (POST)\n * resolverTsLegacy.resolveResponsesTypedName(node) // → 'CreatePetsMutation' (POST)\n * resolverTsLegacy.resolveResponseTypedName(node) // → 'CreatePetsMutationResponse' (POST)\n * ```\n */\nexport const resolverTsLegacy = defineResolver<PluginTs>(() => {\n return {\n ...resolverTs,\n pluginName: 'plugin-ts',\n resolveResponseStatusName(node, statusCode) {\n if (statusCode === 'default') {\n return this.resolveName(`${node.operationId} Error`)\n }\n return this.resolveName(`${node.operationId} ${statusCode}`)\n },\n resolveDataName(node) {\n const suffix = node.method === 'GET' ? 'QueryRequest' : 'MutationRequest'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponsesName(node) {\n const suffix = node.method === 'GET' ? 'Query' : 'Mutation'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponseName(node) {\n const suffix = node.method === 'GET' ? 'QueryResponse' : 'MutationResponse'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolvePathParamsName(node, _param) {\n return this.resolveName(`${node.operationId} PathParams`)\n },\n resolveQueryParamsName(node, _param) {\n return this.resolveName(`${node.operationId} QueryParams`)\n },\n resolveHeaderParamsName(node, _param) {\n return this.resolveName(`${node.operationId} HeaderParams`)\n },\n }\n})\n","import path from 'node:path'\nimport { pascalCase } from '@internals/utils'\nimport { caseParams, composeTransformers, createProperty, createSchema, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport { resolverTsLegacy } from '../resolvers/resolverTsLegacy.ts'\nimport type { PluginTs, ResolverTs } from '../types'\n\ntype BuildGroupedParamsSchemaOptions = {\n params: Array<ParameterNode>\n parentName?: string\n}\n\nfunction buildGroupedParamsSchema({ params, parentName }: BuildGroupedParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) => {\n let schema = param.schema\n if (narrowSchema(schema, 'enum') && !schema.name && parentName) {\n schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }\n }\n return createProperty({\n name: param.name,\n required: param.required,\n schema,\n })\n }),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\nfunction buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const isGet = node.method.toLowerCase() === 'get'\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n const errorResponses = node.responses.filter((res) => res.statusCode === 'default' || Number(res.statusCode) >= 400)\n\n const responseSchema =\n successResponses.length > 0\n ? successResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const errorsSchema =\n errorResponses.length > 0\n ? errorResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, errorResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: errorResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const properties = [createProperty({ name: 'Response', required: true, schema: responseSchema })]\n\n if (!isGet && node.requestBody?.schema) {\n properties.push(\n createProperty({\n name: 'Request',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveDataName(node) }),\n }),\n )\n }\n\n const queryParam = node.parameters.find((p) => p.in === 'query')\n if (queryParam) {\n properties.push(\n createProperty({\n name: 'QueryParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsName(node, queryParam) }),\n }),\n )\n }\n\n const pathParam = node.parameters.find((p) => p.in === 'path')\n if (pathParam) {\n properties.push(\n createProperty({\n name: 'PathParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsName(node, pathParam) }),\n }),\n )\n }\n\n const headerParam = node.parameters.find((p) => p.in === 'header')\n if (headerParam) {\n properties.push(\n createProperty({\n name: 'HeaderParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsName(node, headerParam) }),\n }),\n )\n }\n\n properties.push(createProperty({ name: 'Errors', required: true, schema: errorsSchema }))\n\n return createSchema({ type: 'object', properties })\n}\n\nfunction buildLegacyResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n\n if (successResponses.length === 0) {\n return createSchema({ type: 'any' })\n }\n\n if (successResponses.length === 1) {\n return createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n }\n\n return createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n\nfunction nameUnnamedEnums(node: SchemaNode, parentName: string): SchemaNode {\n return transform(node, {\n schema(n) {\n const enumNode = narrowSchema(n, 'enum')\n if (enumNode && !enumNode.name) {\n return { ...enumNode, name: pascalCase([parentName, 'enum'].join(' ')) }\n }\n return undefined\n },\n property(p) {\n const enumNode = narrowSchema(p.schema, 'enum')\n if (enumNode && !enumNode.name) {\n return {\n ...p,\n schema: { ...enumNode, name: pascalCase([parentName, p.name, 'enum'].join(' ')) },\n }\n }\n return undefined\n },\n })\n}\n\nexport const typeGeneratorLegacy = defineGenerator<PluginTs>({\n name: 'typescript-legacy',\n type: 'react',\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const file = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n const params = caseParams(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const transformedNode = transform(schemaNode, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n node={transformedNode}\n description={description}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n />\n </>\n )\n }\n\n const pathParams = params.filter((p) => p.in === 'path')\n const queryParams = params.filter((p) => p.in === 'query')\n const headerParams = params.filter((p) => p.in === 'header')\n\n const responseTypes = node.responses.map((res) => {\n const responseName = resolver.resolveResponseStatusName(node, res.statusCode)\n const baseResponseName = resolverTsLegacy.resolveResponseStatusName(node, res.statusCode)\n\n return renderSchemaType({\n node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,\n name: responseName,\n description: res.description,\n keysToOmit: res.keysToOmit,\n })\n })\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: nameUnnamedEnums(node.requestBody.schema, resolverTsLegacy.resolveDataName(node)),\n name: resolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n const legacyParamTypes = [\n pathParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: pathParams, parentName: resolverTsLegacy.resolvePathParamsName(node, pathParams[0]!) }),\n name: resolver.resolvePathParamsName(node, pathParams[0]!),\n })\n : null,\n queryParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: queryParams, parentName: resolverTsLegacy.resolveQueryParamsName(node, queryParams[0]!) }),\n name: resolver.resolveQueryParamsName(node, queryParams[0]!),\n })\n : null,\n headerParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: headerParams, parentName: resolverTsLegacy.resolveHeaderParamsName(node, headerParams[0]!) }),\n name: resolver.resolveHeaderParamsName(node, headerParams[0]!),\n })\n : null,\n ]\n\n const legacyResponsesType = renderSchemaType({\n node: buildLegacyResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const legacyResponseType = renderSchemaType({\n node: buildLegacyResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {legacyParamTypes}\n {responseTypes}\n {requestType}\n {legacyResponseType}\n {legacyResponsesType}\n </File>\n )\n },\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n if (!node.name) {\n return\n }\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(node, schemaTypes.enum)\n\n const name = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveName(node.name)\n\n const type = {\n name,\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),\n } as const\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n node={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n />\n </File>\n )\n },\n})\n","import { definePresets } from '@kubb/core'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { typeGeneratorLegacy } from './generators/typeGeneratorLegacy.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport { resolverTsLegacy } from './resolvers/resolverTsLegacy.ts'\nimport type { ResolverTs } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-ts`.\n *\n * - `default` — uses `resolverTs` and `typeGenerator` (current naming conventions).\n * - `kubbV4` — uses `resolverTsLegacy` and `typeGeneratorLegacy` (Kubb v4 naming conventions).\n */\nexport const presets = definePresets<ResolverTs>({\n default: {\n name: 'default',\n resolvers: [resolverTs],\n generators: [typeGenerator],\n },\n kubbV4: {\n name: 'kubbV4',\n resolvers: [resolverTsLegacy],\n generators: [typeGeneratorLegacy],\n },\n})\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { walk } from '@kubb/ast'\nimport { createPlugin, type Group, getBarrelFiles, getPreset, renderOperation, renderSchema } from '@kubb/core'\nimport { presets } from './presets.ts'\nimport type { PluginTs } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-ts`, used to identify the plugin in driver lookups and warnings.\n */\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\n/**\n * The `@kubb/plugin-ts` plugin factory.\n *\n * Generates TypeScript type declarations from an OpenAPI/AST `RootNode`.\n * Walks schemas and operations, delegates rendering to the active generators,\n * and writes barrel files based on `output.barrelType`.\n *\n * @example\n * ```ts\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * plugins: [pluginTs({ output: { path: 'types' }, enumType: 'asConst' })],\n * })\n * ```\n */\nexport const pluginTs = createPlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumTypeSuffix = 'Key',\n enumKeyCasing = 'none',\n optionalType = 'questionToken',\n arrayType = 'array',\n syntaxType = 'type',\n paramsCasing,\n compatibilityPreset = 'default',\n resolvers: userResolvers = [],\n transformers: userTransformers = [],\n generators: userGenerators = [],\n } = options\n\n const preset = getPreset({\n preset: compatibilityPreset,\n presets: presets,\n resolvers: userResolvers,\n transformers: userTransformers,\n generators: userGenerators,\n })\n\n let resolveNameWarning = false\n let resolvePathWarning = false\n\n return {\n name: pluginTsName,\n get resolver() {\n return preset.resolver\n },\n get options() {\n return {\n output,\n optionalType,\n group: group\n ? ({\n ...options.group,\n name: (ctx) => {\n if (options.group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } as Group)\n : undefined,\n arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n transformers: preset.transformers,\n }\n },\n resolvePath(baseName, pathMode, options) {\n if (!resolvePathWarning) {\n this.events.emit('warn', 'Do not use resolvePath for pluginTs, use resolverTs.resolvePath instead')\n resolvePathWarning = true\n }\n\n return this.plugin.resolver.resolvePath(\n { baseName, pathMode, tag: options?.group?.tag, path: options?.group?.path },\n { root: path.resolve(this.config.root, this.config.output.path), output, group: this.plugin.options.group },\n )\n },\n resolveName(name, type) {\n if (!resolveNameWarning) {\n this.events.emit('warn', 'Do not use resolveName for pluginTs, use resolverTs.default instead')\n resolveNameWarning = true\n }\n\n return this.plugin.resolver.default(name, type)\n },\n async install() {\n const { config, fabric, plugin, adapter, rootNode, driver, openInStudio, resolver } = this\n\n const root = path.resolve(config.root, config.output.path)\n\n if (!adapter) {\n throw new Error('Plugin cannot work without adapter being set')\n }\n\n await openInStudio({ ast: true })\n\n await walk(rootNode, {\n depth: 'shallow',\n async schema(schemaNode) {\n const writeTasks = preset.generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderSchema(schemaNode, {\n options,\n resolver,\n adapter,\n config,\n fabric,\n Component: generator.Schema,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n async operation(operationNode) {\n const writeTasks = preset.generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderOperation(operationNode, {\n options,\n resolver,\n adapter,\n config,\n fabric,\n Component: generator.Operation,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n })\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n","import type { PrinterFactoryOptions } from '@kubb/ast'\nimport { createPrinterFactory } from '@kubb/ast'\nimport type { FunctionNode, FunctionNodeType, FunctionParameterNode, FunctionParametersNode, ParameterGroupNode, TypeNode } from '@kubb/ast/types'\n\n/**\n * Maps each function-printer handler key to its concrete node type.\n */\nexport type FunctionNodeByType = {\n functionParameter: FunctionParameterNode\n parameterGroup: ParameterGroupNode\n functionParameters: FunctionParametersNode\n type: TypeNode\n}\n\nconst kindToHandlerKey = {\n FunctionParameter: 'functionParameter',\n ParameterGroup: 'parameterGroup',\n FunctionParameters: 'functionParameters',\n Type: 'type',\n} satisfies Record<string, FunctionNodeType>\n\n/**\n * Creates a function-parameter printer factory.\n *\n * Uses `createPrinterFactory` and dispatches handlers by `node.kind`\n * (for function nodes) rather than by `node.type` (for schema nodes).\n */\nexport const defineFunctionPrinter = createPrinterFactory<FunctionNode, FunctionNodeType, FunctionNodeByType>((node) => kindToHandlerKey[node.kind])\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 * | `keys` | `{ id, config }` | Key names only (destructuring) |\n * | `values` | `{ id: id, config: config }` | Key/value object entries |\n */\n mode: 'declaration' | 'call' | 'keys' | 'values'\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\ntype DefaultPrinter = PrinterFactoryOptions<'functionParameters', FunctionPrinterOptions, string>\n\nfunction rank(param: FunctionParameterNode | ParameterGroupNode): number {\n if (param.kind === 'ParameterGroup') {\n if (param.default) return 2\n const isOptional = param.optional ?? param.properties.every((p) => p.optional || p.default !== undefined)\n return isOptional ? 1 : 0\n }\n if (param.rest) return 3\n if (param.default) return 2\n return param.optional ? 1 : 0\n}\n\nfunction sortParams(params: ReadonlyArray<FunctionParameterNode | ParameterGroupNode>): Array<FunctionParameterNode | ParameterGroupNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\nfunction sortChildParams(params: Array<FunctionParameterNode>): Array<FunctionParameterNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\n/**\n * Default function-signature printer.\n * Covers the four standard output modes used across Kubb plugins.\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 const functionPrinter = defineFunctionPrinter<DefaultPrinter>((options) => ({\n name: 'functionParameters',\n options,\n nodes: {\n type(node) {\n if (node.variant === 'member') {\n return `${node.base}['${node.key}']`\n }\n if (node.variant === 'struct') {\n const parts = node.properties.map((p) => {\n const typeStr = this.transform(p.type)\n return p.optional ? `${p.name}?: ${typeStr}` : `${p.name}: ${typeStr}`\n })\n return `{ ${parts.join('; ')} }`\n }\n if (node.variant === 'reference') {\n return node.name\n }\n return null\n },\n functionParameter(node) {\n const { mode, transformName, transformType } = this.options\n const name = transformName ? transformName(node.name) : node.name\n\n const rawType = node.type ? this.transform(node.type) : undefined\n const type = rawType != null && transformType ? transformType(rawType) : rawType\n\n if (mode === 'keys' || mode === 'values') {\n return node.rest ? `...${name}` : name\n }\n\n if (mode === 'call') {\n return node.rest ? `...${name}` : name\n }\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 parameterGroup(node) {\n const { mode, transformName, transformType } = this.options\n const sorted = sortChildParams(node.properties)\n const isOptional = node.optional ?? sorted.every((p) => p.optional || p.default !== undefined)\n\n if (node.inline) {\n return sorted\n .map((p) => this.transform(p))\n .filter(Boolean)\n .join(', ')\n }\n\n if (mode === 'keys' || mode === 'values') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n if (mode === 'call') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n const names = sorted.map((p) => {\n const n = transformName ? transformName(p.name) : p.name\n\n return n\n })\n\n const nameStr = names.length ? `{ ${names.join(', ')} }` : undefined\n if (!nameStr) return null\n\n let typeAnnotation: string | undefined = node.type ? (this.transform(node.type) ?? undefined) : undefined\n if (!typeAnnotation) {\n const typeParts = sorted\n .filter((p) => p.type)\n .map((p) => {\n const rawT = p.type ? this.transform(p.type) : undefined\n const t = rawT != null && transformType ? transformType(rawT) : rawT\n return p.optional || p.default !== undefined ? `${p.name}?: ${t}` : `${p.name}: ${t}`\n })\n typeAnnotation = typeParts.length ? `{ ${typeParts.join('; ')} }` : undefined\n }\n\n if (typeAnnotation) {\n if (isOptional) return `${nameStr}: ${typeAnnotation} = ${node.default ?? '{}'}`\n return node.default ? `${nameStr}: ${typeAnnotation} = ${node.default}` : `${nameStr}: ${typeAnnotation}`\n }\n\n return node.default ? `${nameStr} = ${node.default}` : nameStr\n },\n functionParameters(node) {\n const sorted = sortParams(node.params)\n\n return sorted\n .map((p) => this.transform(p))\n .filter(Boolean)\n .join(', ')\n },\n },\n}))\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,CACjD,QAAO;AACrB,MAAI,MAAM,KAAK,CAAC,OAAQ,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa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  "name": "@kubb/plugin-ts",
3
- "version": "5.0.0-alpha.22",
3
+ "version": "5.0.0-alpha.23",
4
4
  "description": "TypeScript code generation plugin for Kubb, transforming OpenAPI schemas into TypeScript interfaces, types, and utility functions.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -31,48 +31,9 @@
31
31
  "import": "./dist/index.js",
32
32
  "require": "./dist/index.cjs"
33
33
  },
34
- "./builders": {
35
- "import": "./dist/builders.js",
36
- "require": "./dist/builders.cjs"
37
- },
38
- "./components": {
39
- "import": "./dist/components.js",
40
- "require": "./dist/components.cjs"
41
- },
42
- "./generators": {
43
- "import": "./dist/generators.js",
44
- "require": "./dist/generators.cjs"
45
- },
46
- "./printers": {
47
- "import": "./dist/printers.js",
48
- "require": "./dist/printers.cjs"
49
- },
50
- "./resolvers": {
51
- "import": "./dist/resolvers.js",
52
- "require": "./dist/resolvers.cjs"
53
- },
54
34
  "./package.json": "./package.json"
55
35
  },
56
36
  "types": "./dist/index.d.ts",
57
- "typesVersions": {
58
- "*": {
59
- "components": [
60
- "./dist/components.d.ts"
61
- ],
62
- "generators": [
63
- "./dist/generators.d.ts"
64
- ],
65
- "resolvers": [
66
- "./dist/resolvers.d.ts"
67
- ],
68
- "builders": [
69
- "./dist/builders.d.ts"
70
- ],
71
- "printers": [
72
- "./dist/printers.d.ts"
73
- ]
74
- }
75
- },
76
37
  "files": [
77
38
  "src",
78
39
  "dist",
@@ -92,8 +53,8 @@
92
53
  "@kubb/react-fabric": "0.15.1",
93
54
  "remeda": "^2.33.6",
94
55
  "typescript": "5.9.3",
95
- "@kubb/ast": "5.0.0-alpha.22",
96
- "@kubb/core": "5.0.0-alpha.22"
56
+ "@kubb/ast": "5.0.0-alpha.23",
57
+ "@kubb/core": "5.0.0-alpha.23"
97
58
  },
98
59
  "peerDependencies": {
99
60
  "@kubb/react-fabric": "0.15.1"
@@ -43,7 +43,7 @@ export function getEnumNames({
43
43
  } {
44
44
  const resolved = resolver.default(node.name!, 'type')
45
45
  const enumName = enumType === 'asPascalConst' ? resolved : camelCase(node.name!)
46
- const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) ? resolver.resolveEnumKeyTypedName(node, enumTypeSuffix) : resolved
46
+ const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolved
47
47
 
48
48
  return { enumName, typeName, refName: resolved }
49
49
  }
@@ -8,7 +8,6 @@ import { Enum, getEnumNames } from './Enum.tsx'
8
8
 
9
9
  type Props = {
10
10
  name: string
11
- typedName: string
12
11
  node: SchemaNode
13
12
  optionalType: PluginTs['resolvedOptions']['optionalType']
14
13
  arrayType: PluginTs['resolvedOptions']['arrayType']
@@ -16,14 +15,13 @@ type Props = {
16
15
  enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']
17
16
  enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']
18
17
  syntaxType: PluginTs['resolvedOptions']['syntaxType']
19
- resolver: PluginTs['resolvedOptions']['resolver']
18
+ resolver: PluginTs['resolver']
20
19
  description?: string
21
20
  keysToOmit?: string[]
22
21
  }
23
22
 
24
23
  export function Type({
25
24
  name,
26
- typedName,
27
25
  node,
28
26
  keysToOmit,
29
27
  optionalType,
@@ -48,7 +46,7 @@ export function Type({
48
46
  arrayType,
49
47
  enumType,
50
48
  enumTypeSuffix,
51
- typeName: name,
49
+ name,
52
50
  syntaxType,
53
51
  description: resolvedDescription,
54
52
  keysToOmit,
@@ -76,7 +74,7 @@ export function Type({
76
74
  {shouldExportEnums &&
77
75
  enums.map(({ node }) => <Enum node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />)}
78
76
  {shouldExportType && (
79
- <File.Source name={typedName} isTypeOnly isExportable isIndexable>
77
+ <File.Source name={name} isTypeOnly isExportable isIndexable>
80
78
  {output}
81
79
  </File.Source>
82
80
  )}
@@ -3,16 +3,16 @@ import { caseParams, composeTransformers, narrowSchema, schemaTypes, transform }
3
3
  import type { SchemaNode } from '@kubb/ast/types'
4
4
  import { defineGenerator, getMode } from '@kubb/core'
5
5
  import { File } from '@kubb/react-fabric'
6
- import { builderTs } from '../builders/builderTs.ts'
7
6
  import { Type } from '../components/Type.tsx'
8
7
  import { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'
9
8
  import type { PluginTs } from '../types'
9
+ import { buildData, buildResponses, buildResponseUnion } from '../utils.ts'
10
10
 
11
11
  export const typeGenerator = defineGenerator<PluginTs>({
12
12
  name: 'typescript',
13
13
  type: 'react',
14
- Operation({ node, adapter, options, config }) {
15
- const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, resolver, transformers = [] } = options
14
+ Operation({ node, adapter, options, config, resolver }) {
15
+ const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options
16
16
 
17
17
  const root = path.resolve(config.root, config.output.path)
18
18
  const mode = getMode(path.resolve(root, output.path))
@@ -24,13 +24,11 @@ export const typeGenerator = defineGenerator<PluginTs>({
24
24
  function renderSchemaType({
25
25
  node: schemaNode,
26
26
  name,
27
- typedName,
28
27
  description,
29
28
  keysToOmit,
30
29
  }: {
31
30
  node: SchemaNode | null
32
31
  name: string
33
- typedName: string
34
32
  description?: string
35
33
  keysToOmit?: Array<string>
36
34
  }) {
@@ -51,7 +49,6 @@ export const typeGenerator = defineGenerator<PluginTs>({
51
49
  imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}
52
50
  <Type
53
51
  name={name}
54
- typedName={typedName}
55
52
  node={transformedNode}
56
53
  description={description}
57
54
  enumType={enumType}
@@ -71,7 +68,6 @@ export const typeGenerator = defineGenerator<PluginTs>({
71
68
  renderSchemaType({
72
69
  node: param.schema,
73
70
  name: resolver.resolveParamName(node, param),
74
- typedName: resolver.resolveParamTypedName(node, param),
75
71
  }),
76
72
  )
77
73
 
@@ -79,7 +75,6 @@ export const typeGenerator = defineGenerator<PluginTs>({
79
75
  ? renderSchemaType({
80
76
  node: node.requestBody.schema,
81
77
  name: resolver.resolveDataName(node),
82
- typedName: resolver.resolveDataTypedName(node),
83
78
  description: node.requestBody.description ?? node.requestBody.schema.description,
84
79
  keysToOmit: node.requestBody.keysToOmit,
85
80
  })
@@ -89,28 +84,24 @@ export const typeGenerator = defineGenerator<PluginTs>({
89
84
  renderSchemaType({
90
85
  node: res.schema,
91
86
  name: resolver.resolveResponseStatusName(node, res.statusCode),
92
- typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),
93
87
  description: res.description,
94
88
  keysToOmit: res.keysToOmit,
95
89
  }),
96
90
  )
97
91
 
98
92
  const dataType = renderSchemaType({
99
- node: builderTs.buildData({ node: { ...node, parameters: params }, resolver }),
93
+ node: buildData({ node: { ...node, parameters: params }, resolver }),
100
94
  name: resolver.resolveRequestConfigName(node),
101
- typedName: resolver.resolveRequestConfigTypedName(node),
102
95
  })
103
96
 
104
97
  const responsesType = renderSchemaType({
105
- node: builderTs.buildResponses({ node, resolver }),
98
+ node: buildResponses({ node, resolver }),
106
99
  name: resolver.resolveResponsesName(node),
107
- typedName: resolver.resolveResponsesTypedName(node),
108
100
  })
109
101
 
110
102
  const responseType = renderSchemaType({
111
- node: builderTs.buildResponseUnion({ node, resolver }),
103
+ node: buildResponseUnion({ node, resolver }),
112
104
  name: resolver.resolveResponseName(node),
113
- typedName: resolver.resolveResponseTypedName(node),
114
105
  description: 'Union of all possible responses',
115
106
  })
116
107
 
@@ -131,8 +122,8 @@ export const typeGenerator = defineGenerator<PluginTs>({
131
122
  </File>
132
123
  )
133
124
  },
134
- Schema({ node, adapter, options, config }) {
135
- const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, resolver, transformers = [] } = options
125
+ Schema({ node, adapter, options, config, resolver }) {
126
+ const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options
136
127
 
137
128
  const root = path.resolve(config.root, config.output.path)
138
129
  const mode = getMode(path.resolve(root, output.path))
@@ -150,12 +141,10 @@ export const typeGenerator = defineGenerator<PluginTs>({
150
141
 
151
142
  const isEnumSchema = !!narrowSchema(node, schemaTypes.enum)
152
143
 
153
- const typedName =
154
- ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyTypedName(node, enumTypeSuffix) : resolver.resolveTypedName(node.name)
144
+ const name = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveName(node.name)
155
145
 
156
146
  const type = {
157
- name: resolver.resolveName(node.name),
158
- typedName,
147
+ name,
159
148
  file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),
160
149
  } as const
161
150
 
@@ -173,7 +162,6 @@ export const typeGenerator = defineGenerator<PluginTs>({
173
162
  ))}
174
163
  <Type
175
164
  name={type.name}
176
- typedName={type.typedName}
177
165
  node={transformedNode}
178
166
  enumType={enumType}
179
167
  enumTypeSuffix={enumTypeSuffix}