{"version":3,"file":"index.mjs","names":["arrayLiteral","readDecoratorName","modelTypeDeclaration","stringifyFlatted","parseFlatted","joinFilePath"],"sources":["../src/core/error/base.ts","../src/core/error/config.ts","../src/core/error/config-codes.ts","../src/core/error/generator.ts","../src/core/error/generator-codes.ts","../src/core/error/parameter-codes.ts","../src/core/error/parameter.ts","../src/core/error/resolver.ts","../src/core/error/validator.ts","../src/core/error/validator-codes.ts","../src/adapters/typescript/js-doc/constants.ts","../src/core/utils/array.ts","../src/core/utils/object.ts","../src/core/utils/path-normalize.ts","../src/adapters/typescript/js-doc/utils.ts","../src/adapters/typescript/js-doc/module.ts","../src/adapters/typescript/initializer.ts","../src/adapters/decorator/typescript/utils.ts","../src/adapters/decorator/typescript/module.ts","../src/adapters/decorator/orchestrator/module.ts","../src/adapters/typescript/validator/module.ts","../src/adapters/typescript/resolver/extension/module.ts","../src/adapters/typescript/resolver/sub/array.ts","../src/adapters/typescript/resolver/sub/base.ts","../src/adapters/typescript/resolver/utils.ts","../src/adapters/typescript/resolver/sub/indexed-access.ts","../src/adapters/typescript/resolver/sub/intersection.ts","../src/adapters/typescript/resolver/sub/literal.ts","../src/adapters/typescript/resolver/sub/mapped.ts","../src/adapters/typescript/resolver/sub/object-literal.ts","../src/adapters/typescript/resolver/sub/primitive.ts","../src/adapters/typescript/resolver/sub/reference.ts","../src/adapters/typescript/resolver/sub/tuple.ts","../src/adapters/typescript/resolver/sub/type-operator.ts","../src/adapters/typescript/resolver/sub/union.ts","../src/adapters/typescript/resolver/module.ts","../src/adapters/typescript/resolver/cache.ts","../src/adapters/typescript/node-utils/module.ts","../src/adapters/filesystem/source-files.ts","../src/adapters/filesystem/tsconfig/module.ts","../src/adapters/cache/constants.ts","../src/adapters/cache/utils.ts","../src/adapters/cache/client.ts","../src/app/generator/parameter/module.ts","../src/app/generator/method/constants.ts","../src/app/generator/method/module.ts","../src/app/generator/controller/module.ts","../src/app/generator/metadata/module.ts","../src/app/generate.ts"],"sourcesContent":["/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { BaseError } from '@ebec/core';\n\nexport class MetadataError extends BaseError {\n\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { MetadataError } from './base';\n\nexport class ConfigError extends MetadataError {\n\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const ConfigErrorCode = {\n    TSCONFIG_MALFORMED: 'CONFIG_TSCONFIG_MALFORMED',\n    PRESET_NOT_FOUND: 'CONFIG_PRESET_NOT_FOUND',\n    PRESET_MISSING: 'CONFIG_PRESET_MISSING',\n} as const;\n\n// eslint-disable-next-line @tada5hi/type-declaration-location -- Preserve the merged public value and type.\nexport type ConfigErrorCode = typeof ConfigErrorCode[keyof typeof ConfigErrorCode];\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isBaseError } from '@ebec/core';\nimport { MetadataError } from './base';\n\nexport class GeneratorError extends MetadataError {\n\n}\n\nexport function isGeneratorError(input: unknown): input is GeneratorError & { code: string } {\n    if (!isBaseError(input)) {\n        return false;\n    }\n\n    return typeof input.code === 'string';\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const GeneratorErrorCode = {\n    CONTROLLER_NO_SOURCE_FILE: 'GENERATOR_CONTROLLER_NO_SOURCE_FILE',\n    CONTROLLER_NO_NAME: 'GENERATOR_CONTROLLER_NO_NAME',\n    PARAMETER_GENERATION_FAILED: 'GENERATOR_PARAMETER_GENERATION_FAILED',\n    BODY_PARAMETER_DUPLICATE: 'GENERATOR_BODY_PARAMETER_DUPLICATE',\n    BODY_FORM_CONFLICT: 'GENERATOR_BODY_FORM_CONFLICT',\n    STRICT_UNMATCHED_DECORATORS: 'GENERATOR_STRICT_UNMATCHED_DECORATORS',\n    SUCCESS_STATUS_INVALID: 'GENERATOR_SUCCESS_STATUS_INVALID',\n} as const;\n\n// eslint-disable-next-line @tada5hi/type-declaration-location -- Preserve the merged public value and type.\nexport type GeneratorErrorCode = typeof GeneratorErrorCode[keyof typeof GeneratorErrorCode];\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const ParameterErrorCode = {\n    TYPE_UNSUPPORTED: 'PARAMETER_TYPE_UNSUPPORTED',\n    METHOD_UNSUPPORTED: 'PARAMETER_METHOD_UNSUPPORTED',\n    PATH_MISMATCH: 'PARAMETER_PATH_MISMATCH',\n    SCOPE_REQUIRED: 'PARAMETER_SCOPE_REQUIRED',\n    INVALID_EXAMPLE: 'PARAMETER_INVALID_EXAMPLE',\n} as const;\n\n// eslint-disable-next-line @tada5hi/type-declaration-location -- Preserve the merged public value and type.\nexport type ParameterErrorCode = typeof ParameterErrorCode[keyof typeof ParameterErrorCode];\n","/*\n * Copyright (c) 2022-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport { isClassDeclaration, isMethodDeclaration } from 'typescript';\nimport type { Node } from 'typescript';\nimport type { BaseType } from '@trapi/core';\nimport { ParameterErrorCode } from './parameter-codes';\nimport { MetadataError } from './base';\n\ntype UnsupportedTypeContext = {\n    decoratorName: string,\n    propertyName: string,\n    type: BaseType,\n    node?: Node\n};\n\ntype UnsupportedMethodContext = {\n    decoratorName: string,\n    propertyName: string,\n    method: string,\n    node?: Node\n};\n\ntype PathMatchInvalidContext = {\n    decoratorName: string,\n    propertyName: string,\n    path: string,\n    node?: Node\n};\n\ntype ScopeRequiredContext = {\n    decoratorName: string,\n    node?: Node\n};\n\nexport class ParameterError extends MetadataError {\n    static typeUnsupported(context: UnsupportedTypeContext) {\n        const location = context.node ? ParameterError.getCurrentLocation(context.node) : undefined;\n\n        return new ParameterError({\n            message: `@${context.decoratorName}('${context.propertyName}') does not support '${context.type.typeName}' type${location ? ` at ${location}` : ''}.`,\n            code: ParameterErrorCode.TYPE_UNSUPPORTED,\n        });\n    }\n\n    static methodUnsupported(context: UnsupportedMethodContext) {\n        const location = context.node ? ParameterError.getCurrentLocation(context.node) : undefined;\n\n        return new ParameterError({\n            message: `@${context.decoratorName}('${context.propertyName}') does not support method '${context.method}'${location ? ` at ${location}` : ''}.`,\n            code: ParameterErrorCode.METHOD_UNSUPPORTED,\n        });\n    }\n\n    static invalidPathMatch(context: PathMatchInvalidContext) {\n        const location = context.node ? ParameterError.getCurrentLocation(context.node) : undefined;\n\n        return new ParameterError({\n            message: `@${context.decoratorName}('${context.propertyName}') does not exist in path '${context.path}'${location ? ` at ${location}` : ''}.`,\n            code: ParameterErrorCode.PATH_MISMATCH,\n        });\n    }\n\n    static scopeRequired(context: ScopeRequiredContext) {\n        const location = context.node ? ParameterError.getCurrentLocation(context.node) : undefined;\n\n        return new ParameterError({\n            message: `@${context.decoratorName}() requires a scope argument${location ? ` at ${location}` : ''}.`,\n            code: ParameterErrorCode.SCOPE_REQUIRED,\n        });\n    }\n\n    static invalidExampleSchema() {\n        return new ParameterError({\n            message: 'The @example JSDoc tag contains invalid JSON.',\n            code: ParameterErrorCode.INVALID_EXAMPLE,\n        });\n    }\n\n    public static getCurrentLocation(node: Node) {\n        const parts : string[] = [];\n\n        if (isMethodDeclaration(node.parent)) {\n            parts.push(node.parent.name.getText());\n\n            if (isClassDeclaration(node.parent.parent) && node.parent.parent.name) {\n                parts.unshift(node.parent.parent.name.text);\n            }\n        }\n\n        return parts.join('.');\n    }\n}\n","/*\n * Copyright (c) 2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { normalize } from 'node:path';\nimport { isBaseError } from '@ebec/core';\nimport type { Node, TypeNode } from 'typescript';\nimport { MetadataError } from './base';\n\nexport class ResolverError extends MetadataError {\n    public readonly file?: string;\n\n    public readonly line?: number;\n\n    constructor(\n        message: string,\n        node?: Node | TypeNode,\n        options?: boolean | { onlyCurrent?: boolean, cause?: unknown },\n    ) {\n        const opts = typeof options === 'boolean' ? { onlyCurrent: options } : options;\n        const onlyCurrent = opts?.onlyCurrent ?? false;\n\n        const parts: string[] = [message];\n        let file: string | undefined;\n        let line: number | undefined;\n\n        if (node) {\n            const location = prettyLocationOfNode(node);\n\n            if (location) {\n                parts.push(location.text);\n                file = location.file;\n                line = location.line;\n            }\n\n            parts.push(prettyTroubleCause(node, onlyCurrent));\n        }\n\n        super({\n            message: parts.join('\\n'),\n            cause: opts?.cause,\n        });\n\n        this.file = file;\n        this.line = line;\n    }\n}\n\nexport function isResolverError(input: unknown): input is ResolverError {\n    if (!isBaseError(input)) {\n        return false;\n    }\n\n    return 'file' in input && 'line' in input;\n}\n\nexport function prettyLocationOfNode(node: Node | TypeNode): {\n    text: string,\n    file: string,\n    line?: number,\n} | undefined {\n    try {\n        const sourceFile = node.getSourceFile();\n\n        if (!sourceFile) {\n            return undefined;\n        }\n\n        const token = node.getFirstToken() || node.parent?.getFirstToken();\n        const start = token ? sourceFile.getLineAndCharacterOfPosition(token.getStart()).line + 1 : undefined;\n        const end = token ? sourceFile.getLineAndCharacterOfPosition(token.getEnd()).line + 1 : undefined;\n\n        const normalizedFile = normalize(sourceFile.fileName);\n        const startSuffix = start ? `:${start}` : '';\n        const endSuffix = end ? `:${end}` : '';\n\n        return {\n            text: `At: ${normalizedFile}${startSuffix}${endSuffix}.`,\n            file: sourceFile.fileName,\n            line: start,\n        };\n    } catch {\n        return undefined;\n    }\n}\n\nexport function prettyTroubleCause(node: Node | TypeNode, onlyCurrent = false) {\n    try {\n        let name: string;\n\n        if (onlyCurrent || !node.parent) {\n            name = node.pos !== -1 ? node.getText() : (node as any).name.text;\n        } else {\n            name = node.parent.pos !== -1 ? node.parent.getText() : (node as any).parent.name.text;\n        }\n\n        return `This was caused by '${name}'`;\n    } catch {\n        return 'This was caused by an unknown node';\n    }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { MetadataError } from './base';\n\nexport class ValidatorError extends MetadataError {\n\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const ValidatorErrorCode = {\n    EXPECTED_NUMBER: 'VALIDATOR_EXPECTED_NUMBER',\n    EXPECTED_DATE: 'VALIDATOR_EXPECTED_DATE',\n    EXPECTED_STRING: 'VALIDATOR_EXPECTED_STRING',\n} as const;\n\n// eslint-disable-next-line @tada5hi/type-declaration-location -- Preserve the merged public value and type.\nexport type ValidatorErrorCode = typeof ValidatorErrorCode[keyof typeof ValidatorErrorCode];\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum JSDocTagName {\n    ABSTRACT = 'abstract',\n    ACCESS = 'access',\n    ALIAS = 'alias',\n    ASYNC = 'async',\n    /**\n     * Alias for @extends\n     */\n    AUGMENTS = 'augments',\n    AUTHOR = 'author',\n\n    // todo: ... add missing\n\n    DEFAULT = 'default',\n    DEPRECATED = 'deprecated',\n    DESCRIPTION = 'description',\n    EXAMPLE = 'example',\n\n    FORMAT = 'format',\n\n    IGNORE = 'ignore',\n\n    SUMMARY = 'summary',\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isStringArray(input: unknown) : input is string[] {\n    if (!Array.isArray(input)) {\n        return false;\n    }\n\n    for (const element of input) {\n        if (typeof element !== 'string') {\n            return false;\n        }\n    }\n\n    return true;\n}\n","/*\n * Copyright (c) 2021-2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function hasOwnProperty<Y extends PropertyKey>(obj: unknown, prop: Y): obj is Record<Y, unknown> {\n    return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function normalizePath(str: string) : string {\n    // remove slashes\n    str = str.replace(/^[/\\\\\\s]+|[/\\\\\\s]+$/g, '');\n\n    str = str.replace(/([^:]\\/)\\/+/g, '$1');\n\n    return str;\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from 'smob';\nimport type { JSDocComment, NodeArray } from 'typescript';\n\nexport function transformJSDocComment(\n    input?: string | NodeArray<JSDocComment>,\n) : string | undefined {\n    if (typeof input === 'string') {\n        return input;\n    }\n\n    if (!input || input.length === 0) {\n        return undefined;\n    }\n\n    const comment = input[0];\n\n    if (typeof comment === 'string') {\n        return comment;\n    }\n\n    if (\n        isObject(comment) &&\n        typeof comment.text === 'string'\n    ) {\n        return comment.text;\n    }\n\n    return undefined;\n}\n","/*\n * Copyright (c) 2021-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type {\n    Identifier,\n    JSDoc,\n    JSDocTag,\n    Node,\n} from 'typescript';\nimport { SyntaxKind, isJSDocParameterTag } from 'typescript';\nimport { MetadataError } from '../../../core/error';\nimport { hasOwnProperty } from '../../../core/utils';\nimport type { JSDocTagName } from './constants';\nimport { transformJSDocComment } from './utils';\n\n// -----------------------------------------\n// Description\n// -----------------------------------------\nexport function getJSDocDescription(node: Node, index?: number) : string | undefined {\n    const jsDoc = getJSDoc(node, index);\n\n    if (!jsDoc) {\n        return undefined;\n    }\n\n    return transformJSDocComment(jsDoc.comment);\n}\n\n// -----------------------------------------\n// Tag\n// -----------------------------------------\n\nexport function getJSDoc(node: Node, index?: number) : undefined | JSDoc {\n    if (!hasOwnProperty(node, 'jsDoc')) {\n        return undefined;\n    }\n\n    const jsDoc : JSDoc[] | undefined = (node as any).jsDoc as JSDoc[];\n\n    if (!jsDoc || !Array.isArray(jsDoc) || !jsDoc.length) {\n        return undefined;\n    }\n\n    index = index ?? 0;\n\n    return jsDoc.length > index && index >= 0 ? jsDoc[index] : undefined; // jsDoc[0] else case\n}\n\nexport function getJSDocTags(\n    node: Node,\n    isMatching?:\n        | `${JSDocTagName}` |\n        `${JSDocTagName}`[] |\n        (string & {}) |\n        (string & {})[] |\n        ((tag: JSDocTag) => boolean),\n) : JSDocTag[] {\n    const jsDoc = getJSDoc(node);\n\n    if (typeof jsDoc === 'undefined') {\n        return [];\n    }\n\n    const jsDocTags : JSDocTag[] = jsDoc.tags as unknown as JSDocTag[];\n\n    if (typeof jsDocTags === 'undefined') {\n        return [];\n    }\n\n    if (typeof isMatching === 'undefined') {\n        return jsDocTags;\n    }\n\n    if (typeof isMatching === 'function') {\n        return jsDocTags.filter(isMatching);\n    }\n\n    const tagNames : string[] = Array.isArray(isMatching) ? isMatching : [isMatching];\n\n    return jsDocTags.filter((tag) => tagNames.includes(tag.tagName.text));\n}\n\nexport function hasJSDocTag(node: Node, tagName: ((tag: JSDocTag) => boolean) | `${JSDocTagName}` | (string & {})) : boolean {\n    const tags : JSDocTag[] = getJSDocTags(node, tagName);\n\n    return !(!tags || !tags.length);\n}\n\n// -----------------------------------------\n// Tag Comment(s)\n// -----------------------------------------\n\nexport function getJSDocTagComment(node: Node, tagName: ((tag: JSDocTag) => boolean) | `${JSDocTagName}`) : undefined | string {\n    const tags : JSDocTag[] = getJSDocTags(node, tagName);\n    const first = tags[0];\n\n    if (!first || typeof first.comment !== 'string') {\n        return undefined;\n    }\n\n    return first.comment;\n}\n\n// -----------------------------------------\n// Tag Names\n// -----------------------------------------\n\nexport function getJSDocTagNames(node: Node, requireTagName = false) : string[] {\n    let tags: JSDocTag[];\n\n    /* istanbul ignore next */\n    if (node.kind === SyntaxKind.Parameter) {\n        const parameterName = ((node as any).name as Identifier).text;\n\n        tags = getJSDocTags(node.parent as any, (tag) => {\n            if (isJSDocParameterTag(tag)) {\n                return false;\n            }\n\n            if (tag.comment === undefined) {\n                throw new MetadataError(`Orphan tag: @${String(tag.tagName.text || tag.tagName.escapedText)} must be followed by a parameter name.`);\n            }\n\n            return typeof tag.comment === 'string' ? tag.comment.startsWith(parameterName) : false;\n        });\n    } else {\n        tags = getJSDocTags(node as any, (tag) => (requireTagName ? tag.comment !== undefined : true));\n    }\n\n    return tags.map((tag) => tag.tagName.text);\n}\n","/*\n * Copyright (c) 2021-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { SyntaxKind, isImportSpecifier } from 'typescript';\nimport type {\n    ArrayLiteralExpression,\n    Declaration,\n    Expression,\n    HasInitializer,\n    Identifier,\n    ImportSpecifier,\n    NewExpression,\n    Node,\n    NumericLiteral,\n    ObjectLiteralExpression,\n    PrefixUnaryExpression,\n    StringLiteral,\n    Symbol as TsSymbol,\n    TypeChecker,\n} from 'typescript';\nimport { MetadataError } from '../../core/error';\nimport type { Type } from '@trapi/core';\nimport { hasOwnProperty } from '../../core/utils/object';\n\nexport function getInitializerValue(\n    initializer?: Expression,\n    typeChecker?: TypeChecker,\n    type?: Type,\n) : unknown {\n    if (!initializer) {\n        return undefined;\n    }\n\n    switch (initializer.kind) {\n        case SyntaxKind.ArrayLiteralExpression: {\n            const arrayLiteral = initializer as ArrayLiteralExpression;\n\n            return arrayLiteral.elements.map((element) => getInitializerValue(element, typeChecker));\n        }\n        case SyntaxKind.StringLiteral:\n        case SyntaxKind.NoSubstitutionTemplateLiteral:\n            return (initializer as StringLiteral).text;\n        case SyntaxKind.TrueKeyword:\n            return true;\n        case SyntaxKind.FalseKeyword:\n            return false;\n        case SyntaxKind.PrefixUnaryExpression: {\n            const prefixUnary = initializer as PrefixUnaryExpression;\n\n            switch (prefixUnary.operator) {\n                case SyntaxKind.PlusToken:\n                    return Number((prefixUnary.operand as NumericLiteral).text);\n                case SyntaxKind.MinusToken:\n                    return Number(`-${(prefixUnary.operand as NumericLiteral).text}`);\n                default:\n                    throw new MetadataError(`Unsupported prefix operator token: ${prefixUnary.operator}`);\n            }\n        }\n        case SyntaxKind.NumberKeyword:\n        case SyntaxKind.FirstLiteralToken:\n            return Number((initializer as NumericLiteral).text);\n        case SyntaxKind.NewExpression: {\n            const newExpression = initializer as NewExpression;\n            const ident = newExpression.expression as Identifier;\n\n            if (ident.text === 'Date') {\n                let date = new Date();\n\n                if (newExpression.arguments) {\n                    const newArguments = newExpression.arguments.filter((args) => args.kind !== undefined);\n                    const argsValue = newArguments.map((args) => getInitializerValue(args, typeChecker));\n\n                    if (argsValue.length > 0) {\n                        date = new Date(argsValue as any);\n                    }\n                }\n\n                const dateString = date.toISOString();\n\n                if (type && type.typeName === 'date') {\n                    return dateString.split('T')[0];\n                }\n\n                return dateString;\n            }\n\n            return undefined;\n        }\n        case SyntaxKind.NullKeyword: {\n            return null;\n        }\n        case SyntaxKind.ObjectLiteralExpression: {\n            const objectLiteral = initializer as ObjectLiteralExpression;\n            const nestedObject: any = {};\n\n            objectLiteral.properties.forEach((p: any) => {\n                nestedObject[p.name.text] = getInitializerValue(p.initializer, typeChecker);\n            });\n\n            return nestedObject;\n        }\n        case SyntaxKind.ImportSpecifier: {\n            if (typeof typeChecker === 'undefined') {\n                return undefined;\n            }\n\n            const importSpecifier = (initializer as any) as ImportSpecifier;\n            const importSymbol = typeChecker.getSymbolAtLocation(importSpecifier.name);\n\n            if (!importSymbol) {\n                return undefined;\n            }\n\n            const aliasedSymbol = typeChecker.getAliasedSymbol(importSymbol);\n            const declarations = aliasedSymbol.getDeclarations();\n            const declaration = declarations && declarations.length > 0 ? declarations[0] : undefined;\n\n            return getInitializerValue(extractInitializer(declaration), typeChecker);\n        }\n        default: {\n            if (typeof initializer === 'undefined') {\n                return undefined;\n            }\n\n            if (\n                typeof initializer.parent === 'undefined' ||\n                typeof typeChecker === 'undefined'\n            ) {\n                if (hasOwnProperty(initializer, 'text')) {\n                    return initializer.text;\n                }\n\n                return undefined;\n            }\n\n            // Ask the checker before hand-walking declarations. It has already\n            // constant-folded the shapes the walk below cannot follow: an import\n            // alias (an `ImportSpecifier` has no `initializer` to extract), a\n            // barrel re-export, and a template expression (which has no symbol\n            // at all). The walk still runs second — the checker deliberately\n            // widens `let x = '/a'` and `const x: string = '/a'` to `string`,\n            // and those two the walk does resolve.\n            const literalType = typeChecker.getTypeAtLocation(initializer);\n\n            if (literalType.isStringLiteral() || literalType.isNumberLiteral()) {\n                return literalType.value;\n            }\n\n            const symbol = typeChecker.getSymbolAtLocation(initializer);\n\n            if (!symbol) {\n                return undefined;\n            }\n\n            // Hand the `ImportSpecifier` itself to the recursion, not its\n            // (always absent) initializer — that is what reaches the\n            // `SyntaxKind.ImportSpecifier` case below, which walks the alias to\n            // the declaration in the other file. Without it an annotated\n            // constant like `export const X: string = '/a'` is unresolvable\n            // once imported: the checker widens it to `string` and declines to\n            // fold it, and there is nothing else left to follow.\n            return getInitializerValue(\n                // An `ImportSpecifier` is a Node, not an Expression; the case\n                // that receives it casts it back.\n                (extractInitializer(symbol.valueDeclaration) || extractImportSpecifier(symbol)) as Expression | undefined,\n                typeChecker,\n            );\n        }\n    }\n}\n\nexport const hasInitializer = (\n    node: Node,\n): node is HasInitializer => Object.prototype.hasOwnProperty.call(node, 'initializer');\nconst extractInitializer = (\n    valueDeclaration?: Declaration,\n) => (valueDeclaration && hasInitializer(valueDeclaration) && (valueDeclaration.initializer as Expression)) || undefined;\nconst extractImportSpecifier = (\n    symbol?: TsSymbol,\n) => {\n    const declaration = symbol?.declarations?.[0];\n\n    return declaration && isImportSpecifier(declaration) ? declaration : undefined;\n};\n","import type { RawDecorator } from './types';\n/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    SyntaxKind,\n    canHaveDecorators,\n    getDecorators,\n    isArrayLiteralExpression,\n    isCallExpression,\n    isIdentifier,\n    isNoSubstitutionTemplateLiteral,\n    isNumericLiteral,\n    isObjectLiteralExpression,\n    isPrefixUnaryExpression,\n    isPropertyAccessExpression,\n    isStringLiteral,\n    isTemplateExpression,\n} from 'typescript';\nimport type { Expression, Node, TypeChecker } from 'typescript';\nimport { getInitializerValue } from '../../typescript/initializer';\nimport type { DecoratorArgument } from '@trapi/core';\n\n/**\n * Enumerate decorators on a TS node and classify their argument values without\n * going through the registry. Used by read-side consumers (type resolver,\n * extension extraction) that only need decorator names + argument values.\n */\nexport function readNodeDecorators(node: Node, typeChecker?: TypeChecker): RawDecorator[] {\n    if (!canHaveDecorators(node)) {\n        return [];\n    }\n\n    const decorators = getDecorators(node);\n\n    if (!decorators || decorators.length === 0) {\n        return [];\n    }\n\n    const output: RawDecorator[] = [];\n\n    for (const decorator of decorators) {\n        const { expression } = decorator;\n        let name: string | undefined;\n        let argumentExpressions: readonly Expression[] = [];\n\n        if (isCallExpression(expression)) {\n            argumentExpressions = expression.arguments;\n            name = readDecoratorName(expression.expression);\n        } else {\n            name = readDecoratorName(expression);\n        }\n\n        if (!name) {\n            continue;\n        }\n\n        output.push({\n            name,\n            arguments: argumentExpressions.map((a) => buildDecoratorArgument(a, typeChecker)),\n        });\n    }\n\n    return output;\n}\n\nexport function findDecoratorByName(\n    node: Node,\n    name: string,\n    typeChecker?: TypeChecker,\n): RawDecorator | undefined {\n    return readNodeDecorators(node, typeChecker).find((d) => d.name === name);\n}\n\nexport function findDecoratorsByName(\n    node: Node,\n    name: string,\n    typeChecker?: TypeChecker,\n): RawDecorator[] {\n    return readNodeDecorators(node, typeChecker).filter((d) => d.name === name);\n}\n\nexport function hasDecoratorNamed(node: Node, name: string, typeChecker?: TypeChecker): boolean {\n    return readNodeDecorators(node, typeChecker).some((d) => d.name === name);\n}\n\nfunction readDecoratorName(expression: Node): string | undefined {\n    if (isIdentifier(expression)) {\n        return expression.text;\n    }\n\n    if (isPropertyAccessExpression(expression)) {\n        return expression.name.text;\n    }\n\n    return undefined;\n}\n\nexport function buildDecoratorArgument(\n    expr: Expression,\n    typeChecker?: TypeChecker,\n): DecoratorArgument {\n    if (\n        isStringLiteral(expr) ||\n        isNumericLiteral(expr) ||\n        isNoSubstitutionTemplateLiteral(expr)\n    ) {\n        return { raw: getInitializerValue(expr, typeChecker), kind: 'literal' };\n    }\n\n    if (expr.kind === SyntaxKind.TrueKeyword) {\n        return { raw: true, kind: 'literal' };\n    }\n\n    if (expr.kind === SyntaxKind.FalseKeyword) {\n        return { raw: false, kind: 'literal' };\n    }\n\n    if (expr.kind === SyntaxKind.NullKeyword) {\n        return { raw: null, kind: 'literal' };\n    }\n\n    if (\n        isPrefixUnaryExpression(expr) &&\n        (expr.operator === SyntaxKind.PlusToken || expr.operator === SyntaxKind.MinusToken) &&\n        isNumericLiteral(expr.operand)\n    ) {\n        return { raw: getInitializerValue(expr, typeChecker), kind: 'literal' };\n    }\n\n    if (isObjectLiteralExpression(expr)) {\n        return { raw: getInitializerValue(expr, typeChecker), kind: 'object' };\n    }\n\n    if (isArrayLiteralExpression(expr)) {\n        return { raw: getInitializerValue(expr, typeChecker), kind: 'array' };\n    }\n\n    // A template expression is included because the checker folds one whose\n    // substitutions are all constants (`` `/${SEGMENT}` `` -> '/segment').\n    // It keeps `kind: 'identifier'` — the kind union is public API that\n    // third-party presets match on, and `readString` already accepts it.\n    if (isIdentifier(expr) || isPropertyAccessExpression(expr) || isTemplateExpression(expr)) {\n        const value = getInitializerValue(expr, typeChecker);\n\n        if (typeof value !== 'undefined') {\n            return { raw: value, kind: 'identifier' };\n        }\n\n        return { raw: undefined, kind: 'unresolvable' };\n    }\n\n    return { raw: undefined, kind: 'unresolvable' };\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    canHaveDecorators,\n    getDecorators,\n    isCallExpression,\n    isIdentifier,\n    isJSDocParameterTag,\n    isJSDocPropertyTag,\n    isJSDocReturnTag,\n    isJSDocThisTag,\n    isJSDocTypeTag,\n    isPropertyAccessExpression,\n    isQualifiedName,\n} from 'typescript';\nimport type {\n    Decorator,\n    EntityName,\n    Expression,\n    JSDocTag,\n    Node,\n    TypeNode,\n} from 'typescript';\nimport { getJSDocTags } from '../../typescript/js-doc';\nimport { transformJSDocComment } from '../../typescript/js-doc/utils';\nimport type {\n    DecoratorArgument,\n    DecoratorSource,\n    DecoratorTypeArgument,\n    JsDocSource,\n} from '@trapi/core';\nimport type { DecoratorSourceBuilderOptions, JsDocSourceBuilderOptions } from './types';\nimport { buildDecoratorArgument } from './utils';\n\n// -----------------------------------------------------------------------------\n// Decorator sources\n// -----------------------------------------------------------------------------\n\nexport function buildDecoratorSources(\n    node: Node,\n    options: DecoratorSourceBuilderOptions,\n): DecoratorSource[] {\n    if (!canHaveDecorators(node)) {\n        return [];\n    }\n\n    const decorators = getDecorators(node);\n\n    if (!decorators || decorators.length === 0) {\n        return [];\n    }\n\n    const output: DecoratorSource[] = [];\n\n    for (const decorator of decorators) {\n        const source = buildDecoratorSource(decorator, options);\n\n        if (source) {\n            output.push(source);\n        }\n    }\n\n    return output;\n}\n\nfunction buildDecoratorSource(\n    decorator: Decorator,\n    options: DecoratorSourceBuilderOptions,\n): DecoratorSource | undefined {\n    const { expression } = decorator;\n\n    let name: string | undefined;\n    let argumentExpressions: readonly Expression[] = [];\n    let typeArgumentNodes: readonly TypeNode[] = [];\n\n    if (isCallExpression(expression)) {\n        argumentExpressions = expression.arguments;\n        typeArgumentNodes = expression.typeArguments ?? [];\n        name = readDecoratorName(expression.expression);\n    } else {\n        name = readDecoratorName(expression);\n    }\n\n    if (!name) {\n        return undefined;\n    }\n\n    const decoratorArguments: DecoratorArgument[] = argumentExpressions.map(\n        (arg) => buildDecoratorArgument(arg, options.typeChecker),\n    );\n\n    const decoratorTypeArguments: DecoratorTypeArgument[] = typeArgumentNodes.map(\n        (typeNode) => ({ resolve: () => options.resolveTypeNode(typeNode) }),\n    );\n\n    const sourceFile = decorator.getSourceFile();\n    const location = sourceFile ? {\n        file: sourceFile.fileName,\n        line: sourceFile.getLineAndCharacterOfPosition(decorator.getStart()).line + 1,\n    } : undefined;\n\n    return {\n        name,\n        arguments: decoratorArguments,\n        typeArguments: decoratorTypeArguments,\n        target: options.target,\n        host: options.host,\n        location,\n    };\n}\n\nfunction readDecoratorName(expression: Node): string | undefined {\n    if (isIdentifier(expression)) {\n        return expression.text;\n    }\n\n    if (isPropertyAccessExpression(expression)) {\n        return expression.name.text;\n    }\n\n    return undefined;\n}\n\n// -----------------------------------------------------------------------------\n// JSDoc sources\n// -----------------------------------------------------------------------------\n\nexport function buildJsDocSources(\n    node: Node,\n    options: JsDocSourceBuilderOptions,\n): JsDocSource[] {\n    const tags = getJSDocTags(node);\n\n    if (tags.length === 0) {\n        return [];\n    }\n\n    const output: JsDocSource[] = [];\n\n    for (const tag of tags) {\n        output.push(buildJsDocSource(tag, options));\n    }\n\n    return output;\n}\n\nfunction buildJsDocSource(\n    tag: JSDocTag,\n    options: JsDocSourceBuilderOptions,\n): JsDocSource {\n    const tagName = tag.tagName.text;\n    const text = transformJSDocComment(tag.comment);\n\n    let parameterName: string | undefined;\n    let typeNode: TypeNode | undefined;\n\n    if (isJSDocParameterTag(tag) || isJSDocPropertyTag(tag)) {\n        if (tag.name) {\n            parameterName = readEntityName(tag.name);\n        }\n\n        typeNode = tag.typeExpression?.type;\n    } else if (\n        isJSDocReturnTag(tag) ||\n        isJSDocTypeTag(tag) ||\n        isJSDocThisTag(tag)\n    ) {\n        typeNode = tag.typeExpression?.type;\n    }\n\n    const source: JsDocSource = {\n        tag: tagName,\n        target: options.target,\n        host: options.host,\n    };\n\n    if (typeof text !== 'undefined') {\n        source.text = text;\n    }\n\n    if (typeof parameterName !== 'undefined') {\n        source.parameterName = parameterName;\n    }\n\n    if (typeNode) {\n        const capturedTypeNode = typeNode;\n\n        source.typeExpression = { resolve: () => options.resolveTypeNode(capturedTypeNode) };\n    }\n\n    return source;\n}\n\nfunction readEntityName(name: EntityName): string | undefined {\n    if (isIdentifier(name)) {\n        return name.text;\n    }\n\n    if (isQualifiedName(name)) {\n        const left = readEntityName(name.left);\n\n        return left ? `${left}.${name.right.text}` : name.right.text;\n    }\n\n    return undefined;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Node } from 'typescript';\nimport {\n    matches,\n    matchesJsDoc,\n} from '@trapi/core';\nimport type {\n    DecoratorSource,\n    HandlerContext,\n    JsDocHandlerContext,\n    JsDocMatch,\n    JsDocSource,\n    Match,\n} from '@trapi/core';\nimport { buildDecoratorSources, buildJsDocSources } from '../typescript';\nimport type { ApplyHandlersOptions } from './types';\n\ntype DecoratorHandlerLike<D> = {\n    match: Match;\n    apply: (ctx: HandlerContext, draft: D) => void;\n};\n\ntype JsDocHandlerLike<D> = {\n    match: JsDocMatch;\n    apply: (ctx: JsDocHandlerContext, draft: D) => void;\n};\n\nexport function buildHandlerContext(\n    source: DecoratorSource,\n    options: ApplyHandlersOptions,\n): HandlerContext {\n    return {\n        host: source.host,\n        decorator: { name: source.name, location: source.location },\n        argument: (i) => source.arguments[i],\n        arguments: () => source.arguments,\n        typeArgument: (i) => source.typeArguments[i],\n        typeArguments: () => source.typeArguments,\n        parameterType: options.parameterType ?? (() => undefined),\n    };\n}\n\nexport function buildJsDocHandlerContext(\n    source: JsDocSource,\n    options: ApplyHandlersOptions,\n): JsDocHandlerContext {\n    return {\n        host: source.host,\n        source,\n        parameterType: options.parameterType ?? (() => undefined),\n    };\n}\n\nexport function applyDecoratorHandlers<D>(\n    node: Node,\n    handlers: DecoratorHandlerLike<D>[],\n    draft: D,\n    options: ApplyHandlersOptions,\n): void {\n    if (handlers.length === 0 && !options.onUnmatchedDecorator) {\n        return;\n    }\n\n    const sources = buildDecoratorSources(node, options);\n\n    if (sources.length === 0) {\n        return;\n    }\n\n    for (const source of sources) {\n        let matched = 0;\n\n        for (const handler of handlers) {\n            if (matches(handler.match, source)) {\n                handler.apply(buildHandlerContext(source, options), draft);\n                matched += 1;\n            }\n        }\n\n        if (matched === 0 && options.onUnmatchedDecorator) {\n            // Prefer the decorator's own AST line if `buildDecoratorSources`\n            // populated it; fall back to the host node's line otherwise.\n            let file: string;\n            let line: number;\n\n            if (source.location) {\n                file = source.location.file;\n                line = source.location.line;\n            } else {\n                const sourceFile = node.getSourceFile();\n\n                file = sourceFile.fileName;\n                line = sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1;\n            }\n\n            options.onUnmatchedDecorator(\n                {\n                    name: source.name,\n                    target: source.target,\n                    host: source.host,\n                    file,\n                    line,\n                },\n                source,\n            );\n        }\n    }\n}\n\nexport function applyJsDocHandlers<D>(\n    node: Node,\n    handlers: JsDocHandlerLike<D>[],\n    draft: D,\n    options: ApplyHandlersOptions,\n): void {\n    if (handlers.length === 0) {\n        return;\n    }\n\n    const sources = buildJsDocSources(node, options);\n\n    if (sources.length === 0) {\n        return;\n    }\n\n    for (const source of sources) {\n        for (const handler of handlers) {\n            if (matchesJsDoc(handler.match, source)) {\n                handler.apply(buildJsDocHandlerContext(source, options), draft);\n            }\n        }\n    }\n}\n","/*\n * Copyright (c) 2021-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type {\n    ParameterDeclaration,\n    PropertyDeclaration,\n    PropertySignature,\n    TypeAliasDeclaration,\n} from 'typescript';\nimport type { Validator } from '@trapi/core';\nimport { ValidatorName } from '@trapi/core';\nimport { ValidatorError } from '../../../core/error/validator';\nimport { getJSDocTags, transformJSDocComment } from '../js-doc';\nimport { ValidatorErrorCode } from '../../../core/error/validator-codes';\n\nexport function getDeclarationValidators(\n    declaration: PropertyDeclaration | TypeAliasDeclaration | PropertySignature | ParameterDeclaration,\n    name?: string,\n): Record<string, Validator> {\n    if (!declaration.parent) {\n        return {};\n    }\n\n    const getCommentValue = (comment?: string) => comment && comment.split(' ')[0];\n\n    const parameterTags = getSupportedParameterTags();\n    const tags = getJSDocTags(declaration.parent, (tag) => {\n        const { comment } = tag;\n\n        if (!comment) {\n            return false;\n        }\n\n        const text = transformJSDocComment(comment);\n        const commentValue = getCommentValue(text);\n\n        return parameterTags.some((value) => {\n            if (value !== tag.tagName.text) {\n                return false;\n            }\n\n            return !name || name === commentValue;\n        });\n    });\n\n    function getErrorMsg(comment?: string, isValue = true) : string | undefined {\n        if (!comment) {\n            return undefined;\n        }\n\n        if (isValue) {\n            const indexOf = comment.indexOf(' ');\n\n            if (indexOf > 0) {\n                return comment.substring(indexOf + 1);\n            }\n\n            return undefined;\n        }\n\n        return comment;\n    }\n\n    const validators : Record<string, Validator> = {};\n\n    for (const tag of tags) {\n        if (!tag.comment) {\n            continue;\n        }\n\n        const name = tag.tagName.text;\n\n        const rawComment = transformJSDocComment(tag.comment);\n\n        if (!rawComment) {\n            continue;\n        }\n\n        const comment = rawComment.substring(rawComment.indexOf(' ') + 1).trim();\n\n        const value = getCommentValue(comment);\n\n        switch (name) {\n            case ValidatorName.UNIQUE_ITEMS:\n                validators[name] = {\n                    message: getErrorMsg(comment, false),\n                    value: undefined,\n                };\n\n                break;\n            case ValidatorName.MINIMUM:\n            case ValidatorName.MAXIMUM:\n            case ValidatorName.MIN_ITEMS:\n            case ValidatorName.MAX_ITEMS:\n            case ValidatorName.MIN_LENGTH:\n            case ValidatorName.MAX_LENGTH:\n                {\n                    const parsed = Number(value);\n\n                    if (!Number.isFinite(parsed)) {\n                        throw new ValidatorError({\n                            message: `@${name} validator expects a numeric value, got '${value}'.`,\n                            code: ValidatorErrorCode.EXPECTED_NUMBER,\n                        });\n                    }\n\n                    validators[name] = {\n                        message: getErrorMsg(comment),\n                        value: parsed,\n                    };\n                }\n                break;\n            case ValidatorName.MIN_DATE:\n            case ValidatorName.MAX_DATE:\n                if (typeof value !== 'string') {\n                    throw new ValidatorError({\n                        message: `@${name} validator expects a date string, got '${typeof value}'.`,\n                        code: ValidatorErrorCode.EXPECTED_DATE,\n                    });\n                }\n\n                validators[name] = {\n                    message: getErrorMsg(comment),\n                    value,\n                };\n\n                break;\n            case ValidatorName.PATTERN:\n                if (typeof value !== 'string') {\n                    throw new ValidatorError({\n                        message: `@${name} validator expects a string pattern, got '${value}'.`,\n                        code: ValidatorErrorCode.EXPECTED_STRING,\n                    });\n                }\n\n                validators[name] = {\n                    message: getErrorMsg(comment),\n                    value: removeSurroundingQuotes(value),\n                };\n\n                break;\n            default:\n                if (name.toLowerCase().startsWith('is')) {\n                    const errorMsg = getErrorMsg(comment, false);\n\n                    if (errorMsg) {\n                        validators[name] = {\n                            message: errorMsg,\n                            value: undefined,\n                        };\n                    }\n                }\n\n                break;\n        }\n    }\n\n    return validators;\n}\n\nfunction getSupportedParameterTags() {\n    return [\n        'isString',\n        'isBoolean',\n        'isInt',\n        'isLong',\n        'isFloat',\n        'isDouble',\n        'isDate',\n        'isDateTime',\n\n        'minItems',\n        'maxItems',\n        'uniqueItems',\n        'minLength',\n        'maxLength',\n        'pattern',\n        'minimum',\n        'maximum',\n        'minDate',\n        'maxDate',\n    ];\n}\n\nfunction removeSurroundingQuotes(str: string) {\n    if (str.startsWith('`') && str.endsWith('`')) {\n        return str.substring(1, str.length - 1);\n    }\n\n    if (str.startsWith('```') && str.endsWith('```')) {\n        return str.substring(3, str.length - 3);\n    }\n\n    return str;\n}\n","/*\n * Copyright (c) 2023-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Node } from 'typescript';\nimport {\n    isExtensionMarker,\n    namesForMarker,\n} from '@trapi/core';\nimport type { Extension, Registry } from '@trapi/core';\nimport { findDecoratorsByName } from '../../../decorator';\n\nexport function getNodeExtensions(node: Node, registry: Registry) : Extension[] {\n    const names = namesForMarker(registry, isExtensionMarker);\n\n    if (names.size === 0) {\n        return [];\n    }\n\n    const output : Extension[] = [];\n\n    for (const name of names) {\n        const decorators = findDecoratorsByName(node, name);\n\n        for (const decorator of decorators) {\n            const keyArg = decorator.arguments[0];\n            const valueArg = decorator.arguments[1];\n\n            if (!keyArg || keyArg.kind !== 'literal' || typeof keyArg.raw !== 'string' || !valueArg || valueArg.kind === 'unresolvable' || typeof valueArg.raw === 'undefined') {\n                continue;\n            }\n\n            output.push({ key: keyArg.raw, value: valueArg.raw as never });\n        }\n    }\n\n    return output;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isArrayTypeNode } from 'typescript';\nimport type { TypeNode } from 'typescript';\nimport { TypeName } from '@trapi/core';\nimport type { ArrayType, Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveArrayType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isArrayTypeNode(typeNode)) {\n        return undefined;\n    }\n\n    return {\n        typeName: TypeName.ARRAY,\n        elementType: ctx.resolveType(\n            typeNode.elementType,\n            ctx.parentNode,\n            ctx.context,\n        ),\n    } as ArrayType;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Node } from 'typescript';\nimport {\n    SyntaxKind,\n    canHaveModifiers,\n    getModifiers,\n} from 'typescript';\n\n\nexport class ResolverBase {\n    protected hasPublicModifier(node: Node) {\n        if (!canHaveModifiers(node)) {\n            return true;\n        }\n\n        const modifiers = getModifiers(node);\n\n        if (!modifiers) {\n            return true;\n        }\n\n        return modifiers.every(\n            (modifier) => modifier.kind !== SyntaxKind.ProtectedKeyword && modifier.kind !== SyntaxKind.PrivateKeyword,\n        );\n    }\n\n    protected hasStaticModifier(node: Node) {\n        if (!canHaveModifiers(node)) {\n            return false;\n        }\n\n        const modifiers = getModifiers(node);\n\n        return modifiers && modifiers.some((modifier) => modifier.kind === SyntaxKind.StaticKeyword);\n    }\n\n    protected isAccessibleParameter(node: Node) {\n        // No modifiers\n        if (!canHaveModifiers(node)) {\n            return false;\n        }\n\n        const modifiers = getModifiers(node);\n\n        if (!modifiers) {\n            return false;\n        }\n\n        // public || public readonly\n        const matchesModifiers = modifiers.some((modifier) => modifier.kind === SyntaxKind.PublicKeyword);\n\n        if (matchesModifiers) {\n            return true;\n        }\n\n        // readonly, not private readonly, not public readonly\n        const isReadonly = modifiers.some((modifier) => modifier.kind === SyntaxKind.ReadonlyKeyword);\n        const isProtectedOrPrivate = modifiers.some(\n            (modifier) => modifier.kind === SyntaxKind.ProtectedKeyword ||\n                modifier.kind === SyntaxKind.PrivateKeyword,\n        );\n\n        return isReadonly && !isProtectedOrPrivate;\n    }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport type {\n    Node,\n    TypeChecker,\n    TypeNode,\n} from 'typescript';\nimport { SyntaxKind, displayPartsToString } from 'typescript';\nimport { hasOwnProperty } from '../../../core/utils';\nimport { ResolverError } from '../../../core/error/resolver';\n\nexport function getNodeDescription(\n    node: Node,\n    typeChecker: TypeChecker,\n) {\n    if (!hasOwnProperty(node, 'name')) {\n        return undefined;\n    }\n\n    const symbol = typeChecker.getSymbolAtLocation(node.name as Node);\n\n    if (!symbol) {\n        return undefined;\n    }\n\n    /**\n     * TODO: Workaround for what seems like a bug in the compiler\n     * Warrants more investigation and possibly a PR against typescript\n     */\n    if (node.kind === SyntaxKind.Parameter) {\n        // TypeScript won't parse jsdoc if the flag is 4, i.e. 'Property'\n        symbol.flags = 0;\n    }\n\n    const comments = symbol.getDocumentationComment(typeChecker);\n\n    if (comments.length) {\n        return displayPartsToString(comments);\n    }\n\n    return undefined;\n}\n\nexport function toTypeNodeOrFail(\n    typeChecker: TypeChecker,\n    ...args: Parameters<TypeChecker['typeToTypeNode']>\n) : TypeNode {\n    const output = typeChecker.typeToTypeNode(...args);\n\n    if (typeof output === 'undefined') {\n        throw new ResolverError('Type could not be transformed to TypeNode.');\n    }\n\n    return output;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    SyntaxKind,\n    isIndexedAccessTypeNode,\n    isLiteralTypeNode,\n    isNumericLiteral,\n    isStringLiteral,\n} from 'typescript';\nimport type { HasType, Node, TypeNode } from 'typescript';\nimport { ResolverError } from '../../../../core/error/resolver';\nimport type { Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\nimport { toTypeNodeOrFail } from '../utils';\n\nexport function resolveIndexedAccessType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isIndexedAccessTypeNode(typeNode)) {\n        return undefined;\n    }\n\n    // Variant 1: T[number] or T[string]\n    if (\n        typeNode.indexType.kind === SyntaxKind.NumberKeyword ||\n        typeNode.indexType.kind === SyntaxKind.StringKeyword\n    ) {\n        const numberIndexType = typeNode.indexType.kind === SyntaxKind.NumberKeyword;\n        const objectType = ctx.typeChecker.getTypeFromTypeNode(typeNode.objectType);\n        const type = numberIndexType ? objectType.getNumberIndexType() : objectType.getStringIndexType();\n\n        if (type === undefined) {\n            throw new ResolverError(\n                `Could not determine ${numberIndexType ? 'number' : 'string'} index on ${ctx.typeChecker.typeToString(objectType)}`,\n                typeNode,\n            );\n        }\n\n        return ctx.resolveType(\n            toTypeNodeOrFail(ctx.typeChecker, type, undefined, undefined),\n            typeNode,\n            ctx.context,\n            ctx.referencer,\n        );\n    }\n\n    // Variant 2: T['key'] or T[0]\n    if (\n        isLiteralTypeNode(typeNode.indexType) &&\n        (\n            isStringLiteral(typeNode.indexType.literal) ||\n            isNumericLiteral(typeNode.indexType.literal)\n        )\n    ) {\n        const hasType = (node: Node | undefined): node is HasType => node !== undefined &&\n            Object.prototype.hasOwnProperty.call(node, 'type');\n\n        const symbol = ctx.typeChecker.getPropertyOfType(\n            ctx.typeChecker.getTypeFromTypeNode(typeNode.objectType),\n            typeNode.indexType.literal.text,\n        );\n\n        if (symbol === undefined) {\n            throw new ResolverError(\n                `Could not determine the keys on ${ctx.typeChecker.typeToString(ctx.typeChecker.getTypeFromTypeNode(typeNode.objectType))}`,\n                typeNode,\n            );\n        }\n\n        if (hasType(symbol.valueDeclaration) && symbol.valueDeclaration.type) {\n            return ctx.resolveType(\n                symbol.valueDeclaration.type,\n                typeNode,\n                ctx.context,\n                ctx.referencer,\n            );\n        }\n\n        const declaration = ctx.typeChecker.getTypeOfSymbolAtLocation(symbol, typeNode.objectType);\n\n        try {\n            return ctx.resolveType(\n                toTypeNodeOrFail(ctx.typeChecker, declaration, undefined, undefined),\n                typeNode,\n                ctx.context,\n                ctx.referencer,\n            );\n        } catch (err) {\n            throw new ResolverError(\n                `Could not determine the keys on ${ctx.typeChecker.typeToString(declaration)}`,\n                typeNode,\n                { cause: err },\n            );\n        }\n    }\n\n    return undefined;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isIntersectionTypeNode } from 'typescript';\nimport type { TypeNode } from 'typescript';\nimport { TypeName } from '@trapi/core';\nimport type { IntersectionType, Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveIntersectionType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isIntersectionTypeNode(typeNode)) {\n        return undefined;\n    }\n\n    const members = typeNode.types.map(\n        (type) => ctx.resolveType(type, ctx.parentNode, ctx.context),\n    );\n\n    return {\n        typeName: TypeName.INTERSECTION,\n        members,\n    } as IntersectionType;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    SyntaxKind,\n    isFunctionTypeNode,\n    isLiteralTypeNode,\n    isParenthesizedTypeNode,\n} from 'typescript';\nimport type {\n    LiteralExpression,\n    LiteralTypeNode,\n    StringLiteralType,\n    TypeNode,\n} from 'typescript';\nimport { TypeName } from '@trapi/core';\nimport { ResolverError } from '../../../../core/error/resolver';\nimport type {\n    AnyType,\n    EnumType,\n    Type,\n} from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveLiteralType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (typeNode.kind === SyntaxKind.NullKeyword) {\n        return {\n            typeName: TypeName.ENUM,\n            members: [null],\n        } as EnumType;\n    }\n\n    if (\n        typeNode.kind === SyntaxKind.AnyKeyword ||\n        typeNode.kind === SyntaxKind.UnknownKeyword\n    ) {\n        return { typeName: TypeName.ANY } as AnyType;\n    }\n\n    if (isLiteralTypeNode(typeNode)) {\n        return {\n            typeName: TypeName.ENUM,\n            members: [getLiteralValue(typeNode)],\n        } as EnumType;\n    }\n\n    if (typeNode.kind === SyntaxKind.TemplateLiteralType) {\n        const type = ctx.typeChecker.getTypeFromTypeNode(ctx.referencer || typeNode);\n\n        const matchesTypes = type.isUnion() && type.types.every((t) => t.isStringLiteral());\n\n        if (matchesTypes) {\n            return {\n                typeName: TypeName.ENUM,\n                members: type.types.map(\n                    (t) => (t as StringLiteralType).value,\n                ),\n            } as EnumType;\n        }\n\n        throw new ResolverError(\n            `Could not resolve type: ${ctx.typeChecker.typeToString(ctx.typeChecker.getTypeFromTypeNode(typeNode), typeNode)}`,\n            typeNode,\n        );\n    }\n\n    if (isParenthesizedTypeNode(typeNode)) {\n        return ctx.resolveType(\n            typeNode.type,\n            typeNode,\n            ctx.context,\n            ctx.referencer,\n        );\n    }\n\n    if (\n        typeNode.kind === SyntaxKind.ObjectKeyword ||\n        isFunctionTypeNode(typeNode)\n    ) {\n        return { typeName: TypeName.OBJECT };\n    }\n\n    return undefined;\n}\n\nexport function getLiteralValue(typeNode: LiteralTypeNode): string | number | boolean | null {\n    let value: boolean | number | string | null;\n\n    switch (typeNode.literal.kind) {\n        case SyntaxKind.TrueKeyword:\n            value = true;\n\n            break;\n        case SyntaxKind.FalseKeyword:\n            value = false;\n\n            break;\n        case SyntaxKind.StringLiteral:\n            value = typeNode.literal.text;\n\n            break;\n        case SyntaxKind.NumericLiteral:\n            value = Number.parseFloat(typeNode.literal.text);\n\n            break;\n        case SyntaxKind.NullKeyword:\n            value = null;\n\n            break;\n        default:\n            if (Object.prototype.hasOwnProperty.call(typeNode.literal, 'text')) {\n                value = (typeNode.literal as LiteralExpression).text;\n            } else {\n                throw new ResolverError(\n                    `Couldn't resolve literal node: ${typeNode.literal.getText()}`,\n                    typeNode.literal,\n                );\n            }\n    }\n\n    return value;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    NodeBuilderFlags,\n    SymbolFlags,\n    SyntaxKind,\n    factory,\n    isMappedTypeNode,\n    isParameter,\n    isPropertyDeclaration,\n    isPropertySignature,\n} from 'typescript';\nimport type {\n    Declaration,\n    ParameterDeclaration,\n    PropertyDeclaration,\n    PropertySignature,\n    Symbol as TsSymbol,\n    TypeNode,\n} from 'typescript';\nimport { JSDocTagName } from '../../js-doc';\nimport { TypeName } from '@trapi/core';\nimport type { ResolverProperty, Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\nimport { toTypeNodeOrFail } from '../utils';\n\nexport function resolveMappedType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isMappedTypeNode(typeNode) || !ctx.referencer) {\n        return undefined;\n    }\n\n    const type = ctx.typeChecker.getTypeFromTypeNode(ctx.referencer);\n    const mappedTypeNode = typeNode;\n    const { typeChecker } = ctx;\n\n    const getDeclaration = (prop: TsSymbol) => prop.declarations && (prop.declarations[0] as Declaration | undefined);\n\n    const isIgnored = (prop: TsSymbol) => {\n        const declaration = getDeclaration(prop);\n        const tagNames = prop.getJsDocTags();\n        const tagNameIndex = tagNames.findIndex((tag) => tag.name === JSDocTagName.IGNORE);\n\n        if (tagNameIndex >= 0) {\n            return true;\n        }\n\n        return (\n            !!declaration &&\n            !isPropertyDeclaration(declaration) &&\n            !isPropertySignature(declaration) &&\n            !isParameter(declaration)\n        );\n    };\n\n    const properties: ResolverProperty[] = type\n        .getProperties()\n        .filter((property) => !isIgnored(property))\n        .map((property) => {\n            const declaration = getDeclaration(property) as\n                PropertySignature |\n                PropertyDeclaration |\n                ParameterDeclaration |\n                undefined;\n\n            // Normalize +? (PlusToken) to ? (QuestionToken) so property helpers treat it as optional\n            const overrideToken = mappedTypeNode.questionToken?.kind === SyntaxKind.PlusToken ?\n                factory.createToken(SyntaxKind.QuestionToken) :\n                mappedTypeNode.questionToken;\n\n            if (declaration && isPropertySignature(declaration)) {\n                return { ...ctx.propertyFromSignature(declaration, overrideToken), name: property.getName() };\n            }\n\n            if (declaration && (isPropertyDeclaration(declaration) || isParameter(declaration))) {\n                return { ...ctx.propertyFromDeclaration(declaration, overrideToken), name: property.getName() };\n            }\n\n            let required = (property.flags & SymbolFlags.Optional) === 0;\n\n            const typeNode2 = toTypeNodeOrFail(\n                typeChecker,\n                typeChecker.getTypeOfSymbolAtLocation(property, typeNode),\n                undefined,\n                NodeBuilderFlags.NoTruncation,\n            );\n\n            if (mappedTypeNode.questionToken && mappedTypeNode.questionToken.kind === SyntaxKind.MinusToken) {\n                required = true;\n            } else if (\n                mappedTypeNode.questionToken &&\n                (\n                    mappedTypeNode.questionToken.kind === SyntaxKind.QuestionToken ||\n                    mappedTypeNode.questionToken.kind === SyntaxKind.PlusToken\n                )\n            ) {\n                required = false;\n            }\n\n            return {\n                name: property.getName(),\n                required,\n                deprecated: false,\n                type: ctx.resolveType(typeNode2, typeNode, ctx.context, ctx.referencer),\n                validators: {},\n            };\n        });\n\n    return {\n        typeName: TypeName.NESTED_OBJECT_LITERAL,\n        properties,\n    };\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    isIdentifier,\n    isIndexSignatureDeclaration,\n    isNumericLiteral,\n    isPropertySignature,\n    isStringLiteral,\n    isTypeLiteralNode,\n} from 'typescript';\nimport type {\n    IndexSignatureDeclaration,\n    ParameterDeclaration,\n    PropertyDeclaration,\n    PropertySignature,\n    TypeNode,\n} from 'typescript';\nimport {\n    JSDocTagName,\n    getJSDocTagComment,\n    hasJSDocTag,\n} from '../../js-doc';\nimport { getDeclarationValidators } from '../../validator';\nimport { TypeName, isStringType  } from '@trapi/core';\nimport { ResolverError } from '../../../../core/error/resolver';\nimport type {\n    NestedObjectLiteralType,\n    ResolverProperty,\n    Type,\n} from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveObjectLiteralType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isTypeLiteralNode(typeNode)) {\n        return undefined;\n    }\n\n    const properties: ResolverProperty[] = typeNode.members\n        .filter((member) => isPropertySignature(member))\n        .reduce((res, propertySignature: PropertySignature) => {\n            if (!propertySignature.type) {\n                throw new ResolverError('No valid type found for property declaration.', propertySignature);\n            }\n\n            const type = ctx.resolveType(\n                propertySignature.type,\n                propertySignature,\n                ctx.context,\n            );\n\n            const property: ResolverProperty = {\n                deprecated: hasJSDocTag(propertySignature, JSDocTagName.DEPRECATED),\n                example: ctx.getNodeExample(propertySignature),\n                extensions: ctx.getNodeExtensions(propertySignature),\n                default: getJSDocTagComment(propertySignature, JSDocTagName.DEFAULT),\n                description: ctx.getNodeDescription(propertySignature),\n                format: getNodeFormat(propertySignature),\n                name: getPropertyName(propertySignature),\n                required: !propertySignature.questionToken,\n                type,\n                validators: getDeclarationValidators(propertySignature) || {},\n            };\n\n            return [property, ...res];\n        }, [] as ResolverProperty[]);\n\n    const indexMember = typeNode.members.find(\n        (member) => isIndexSignatureDeclaration(member),\n    );\n    let additionalType: Type | undefined;\n\n    if (indexMember) {\n        const indexSignatureDeclaration = indexMember as IndexSignatureDeclaration;\n        const indexType = ctx.resolveType(\n            indexSignatureDeclaration.parameters[0]!.type as TypeNode,\n            ctx.parentNode,\n            ctx.context,\n        );\n\n        if (!isStringType(indexType)) {\n            throw new ResolverError('Only string indexes are supported.', typeNode);\n        }\n\n        additionalType = ctx.resolveType(\n            indexSignatureDeclaration.type,\n            ctx.parentNode,\n            ctx.context,\n        );\n    }\n\n    return {\n        additionalProperties: indexMember && additionalType,\n        typeName: TypeName.NESTED_OBJECT_LITERAL,\n        properties,\n    } as NestedObjectLiteralType;\n}\n\nfunction getNodeFormat(\n    node: PropertySignature | PropertyDeclaration | ParameterDeclaration,\n) {\n    return getJSDocTagComment(node, JSDocTagName.FORMAT);\n}\n\nfunction getPropertyName(node: PropertySignature): string {\n    if (isIdentifier(node.name)) {\n        return node.name.text;\n    }\n\n    if (isStringLiteral(node.name) || isNumericLiteral(node.name)) {\n        return node.name.text;\n    }\n\n    return node.name.getText();\n}\n","/*\n * Copyright (c) 2025-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Node, TypeNode } from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport {\n    NumericKind,\n    TypeName,\n    namesForMarker,\n    numericMarkerKind,\n    tagsForMarker,\n} from '@trapi/core';\nimport type {\n    NeverType,\n    PrimitiveType,\n    Registry,\n    ResolverMarker,\n    VoidType,\n} from '@trapi/core';\nimport { hasDecoratorNamed } from '../../../decorator';\nimport { getJSDocTagNames } from '../../js-doc';\n\nconst NUMERIC_KIND_TO_TYPE_NAME: Record<string, string> = {\n    [NumericKind.Int]: TypeName.INTEGER,\n    [NumericKind.Long]: TypeName.LONG,\n    [NumericKind.Float]: TypeName.FLOAT,\n    [NumericKind.Double]: TypeName.DOUBLE,\n};\n\nexport class PrimitiveResolver {\n    protected registry: Registry;\n\n    constructor(registry: Registry) {\n        this.registry = registry;\n    }\n\n    resolve(node: TypeNode, parentNode?: Node) : PrimitiveType | NeverType | VoidType | undefined {\n        const resolved = this.resolveSyntaxKind(node.kind);\n\n        if (resolved) {\n            if (resolved === 'string') {\n                return { typeName: TypeName.STRING };\n            }\n\n            if (resolved === 'void') {\n                return { typeName: TypeName.VOID };\n            }\n\n            if (resolved === 'boolean') {\n                return { typeName: TypeName.BOOLEAN };\n            }\n\n            if (resolved === 'undefined') {\n                return { typeName: TypeName.UNDEFINED };\n            }\n\n            if (resolved === 'null') {\n                // todo: check\n                return undefined;\n            }\n\n            if (resolved === 'never') {\n                return { typeName: TypeName.NEVER };\n            }\n\n            if (resolved === 'bigint') {\n                return { typeName: TypeName.BIGINT };\n            }\n\n            if (resolved === 'number') {\n                if (!parentNode) {\n                    return { typeName: TypeName.DOUBLE };\n                }\n\n                // For each numeric kind: check decorator handlers first (preset\n                // may rename `@IsInt`), then JSDoc handlers (preset may rename\n                // `@isInt`). Both lookups use the registry markers.\n                const presentJsDocTags = new Set(\n                    getJSDocTagNames(parentNode).map((tag) => tag.toLowerCase()),\n                );\n\n                for (const kind of [NumericKind.Int, NumericKind.Long, NumericKind.Float, NumericKind.Double] as const) {\n                    const matchKind = (m: ResolverMarker) => numericMarkerKind(m) === kind;\n\n                    const decoratorNames = namesForMarker(this.registry, matchKind);\n\n                    for (const name of decoratorNames) {\n                        if (hasDecoratorNamed(parentNode, name)) {\n                            return { typeName: NUMERIC_KIND_TO_TYPE_NAME[kind] } as PrimitiveType;\n                        }\n                    }\n\n                    const jsDocTags = tagsForMarker(this.registry, matchKind);\n\n                    for (const tag of jsDocTags) {\n                        if (presentJsDocTags.has(tag.toLowerCase())) {\n                            return { typeName: NUMERIC_KIND_TO_TYPE_NAME[kind] } as PrimitiveType;\n                        }\n                    }\n                }\n\n                return { typeName: TypeName.DOUBLE };\n            }\n        }\n\n        return undefined;\n    }\n\n    resolveSyntaxKind(syntaxKind: SyntaxKind) {\n        switch (syntaxKind) {\n            case SyntaxKind.StringKeyword:\n                return 'string';\n            case SyntaxKind.BooleanKeyword:\n                return 'boolean';\n            case SyntaxKind.VoidKeyword:\n                return 'void';\n            case SyntaxKind.UndefinedKeyword:\n                return 'undefined';\n            case SyntaxKind.NullKeyword:\n                return 'null';\n            case SyntaxKind.NumberKeyword:\n                return 'number';\n            case SyntaxKind.BigIntKeyword:\n                return 'bigint';\n            case SyntaxKind.NeverKeyword:\n                return 'never';\n            default:\n                return undefined;\n        }\n    }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EnumDeclaration, EnumMember, TypeChecker } from 'typescript';\nimport { JSDocTagName, hasJSDocTag } from '../../js-doc';\nimport { TypeName } from '@trapi/core';\nimport { ResolverError } from '../../../../core/error/resolver';\nimport type {\n    RefEnumType,\n    RefObjectType,\n    ReferenceType,\n    Type,\n} from '@trapi/core';\nimport { getNodeDescription } from '../utils';\nimport { ResolverBase } from './base';\n\nexport class ReferenceResolver extends ResolverBase {\n    protected typeChecker : TypeChecker;\n\n    constructor(typeChecker: TypeChecker) {\n        super();\n\n        this.typeChecker = typeChecker;\n    }\n\n    public merge(referenceTypes: ReferenceType[]): ReferenceType {\n        if (referenceTypes.length === 1) {\n            return referenceTypes[0]!;\n        }\n\n        const matchesReferenceTypes = referenceTypes.every((refType) => refType.refName === TypeName.REF_ENUM);\n\n        if (matchesReferenceTypes) {\n            return this.mergeManyRefEnums(referenceTypes as RefEnumType[]);\n        }\n\n        const matchesReferenceTypesResult = referenceTypes.every((refType) => refType.refName === TypeName.REF_OBJECT);\n\n        if (matchesReferenceTypesResult) {\n            return this.mergeManyRefObjects(referenceTypes as RefObjectType[]);\n        }\n\n        throw new ResolverError(\n            `These resolved type merge rules are not defined: ${JSON.stringify(referenceTypes)}`,\n        );\n    }\n\n    public mergeManyRefEnums(many: RefEnumType[]): RefEnumType {\n        let merged = this.mergeRefEnums(many[0]!, many[1]!);\n\n        for (let i = 2; i < many.length; ++i) {\n            merged = this.mergeRefEnums(merged, many[i]!);\n        }\n\n        return merged;\n    }\n\n    public mergeRefEnums(first: RefEnumType, second: RefEnumType): RefEnumType {\n        let description : string | undefined;\n\n        if (first.description || second.description) {\n            if (!first.description) {\n                description = second.description;\n            } else if (!second.description) {\n                description = first.description;\n            } else {\n                description = `${first.description}\\n${second.description}`;\n            }\n        }\n\n        return {\n            typeName: TypeName.REF_ENUM,\n            example: first.example || second.example,\n            description,\n            members: [\n                ...(first.members || []),\n                ...(second.members || []),\n            ],\n            memberNames: [\n                ...(first.memberNames || []),\n                ...(second.memberNames || []),\n            ],\n            refName: first.refName,\n            deprecated: first.deprecated || second.deprecated,\n        };\n    }\n\n    public mergeManyRefObjects(many: RefObjectType[]) {\n        let merged = this.mergeRefObject(many[0]!, many[1]!);\n\n        for (let i = 2; i < many.length; ++i) {\n            merged = this.mergeRefObject(merged, many[i]!);\n        }\n\n        return merged;\n    }\n\n    public mergeRefObject(first: RefObjectType, second: RefObjectType) : RefObjectType {\n        let description : string | undefined;\n\n        if (first.description || second.description) {\n            if (!first.description) {\n                description = second.description;\n            } else if (!second.description) {\n                description = first.description;\n            } else {\n                description = `${first.description}\\n${second.description}`;\n            }\n        }\n\n        const properties = [\n            ...first.properties,\n            ...second.properties.filter((prop) => first.properties.every((firstProp) => firstProp.name !== prop.name)),\n        ];\n\n        let additionalProperties : Type | undefined;\n\n        if (first.additionalProperties || second.additionalProperties) {\n            if (!first.additionalProperties) {\n                additionalProperties = second.additionalProperties;\n            } else if (!second.additionalProperties) {\n                additionalProperties = first.additionalProperties;\n            } else {\n                additionalProperties = {\n                    typeName: TypeName.UNION,\n                    members: [first.additionalProperties, second.additionalProperties],\n                };\n            }\n        }\n\n        return {\n            typeName: TypeName.REF_OBJECT,\n            description,\n            properties,\n            additionalProperties,\n            refName: first.refName,\n            deprecated: first.deprecated || second.deprecated,\n            example: first.example || second.example,\n        };\n    }\n\n    transformEnum(declaration: EnumDeclaration, enumName: string) : RefEnumType {\n        const isNotUndefined = <T>(item: T): item is Exclude<T, undefined> => item !== undefined;\n\n        const enums = declaration.members.map(this.typeChecker.getConstantValue.bind(this.typeChecker)).filter(isNotUndefined);\n        const enumNames = declaration.members.map((e) => e.name.getText()).filter(isNotUndefined);\n\n        return {\n            typeName: TypeName.REF_ENUM,\n            description: getNodeDescription(declaration, this.typeChecker),\n            members: enums as string[],\n            memberNames: enumNames,\n            refName: enumName,\n            deprecated: hasJSDocTag(declaration, JSDocTagName.DEPRECATED),\n        };\n    }\n\n    transformEnumMember(declaration: EnumMember, enumName: string) : RefEnumType {\n        return {\n            typeName: TypeName.REF_ENUM,\n            refName: enumName,\n            members: [this.typeChecker.getConstantValue(declaration)!],\n            memberNames: [declaration.name.getText()],\n            deprecated: hasJSDocTag(declaration, JSDocTagName.DEPRECATED),\n        };\n    }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isNamedTupleMember, isTupleTypeNode } from 'typescript';\nimport type { TypeNode } from 'typescript';\nimport { TypeName } from '@trapi/core';\nimport type { TupleType, Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveTupleType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isTupleTypeNode(typeNode)) {\n        return undefined;\n    }\n\n    const elements = typeNode.elements.map((element) => {\n        const isNamed = isNamedTupleMember(element);\n        const actualType = isNamed ? element.type : element;\n\n        return {\n            type: ctx.resolveType(actualType, ctx.parentNode, ctx.context),\n            ...(isNamed && { name: element.name.text }),\n        };\n    });\n\n    return {\n        typeName: TypeName.TUPLE,\n        elements,\n    } as TupleType;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { NodeBuilderFlags, SyntaxKind, isTypeOperatorNode } from 'typescript';\nimport type { TypeNode } from 'typescript';\nimport { ResolverError } from '../../../../core/error/resolver';\nimport type { Type } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\nimport { toTypeNodeOrFail } from '../utils';\n\nexport function resolveTypeOperatorType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isTypeOperatorNode(typeNode)) {\n        return undefined;\n    }\n\n    if (typeNode.operator === SyntaxKind.KeyOfKeyword) {\n        const type = ctx.typeChecker.getTypeFromTypeNode(typeNode);\n\n        try {\n            return ctx.resolveType(\n                toTypeNodeOrFail(ctx.typeChecker, type, undefined, NodeBuilderFlags.NoTruncation),\n                typeNode,\n                ctx.context,\n                ctx.referencer,\n            );\n        } catch (err) {\n            const indexedTypeName = ctx.typeChecker.typeToString(\n                ctx.typeChecker.getTypeFromTypeNode(typeNode.type),\n            );\n            throw new ResolverError(\n                `Could not determine the keys on ${indexedTypeName}`,\n                typeNode,\n                { cause: err },\n            );\n        }\n    }\n\n    if (typeNode.operator === SyntaxKind.ReadonlyKeyword) {\n        return ctx.resolveType(typeNode.type, typeNode, ctx.context, ctx.referencer);\n    }\n\n    return undefined;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isUnionTypeNode } from 'typescript';\nimport type { TypeNode } from 'typescript';\nimport { TypeName } from '@trapi/core';\nimport type { Type, UnionType } from '@trapi/core';\nimport type { SubResolverContext } from '../types';\n\nexport function resolveUnionType(\n    typeNode: TypeNode,\n    ctx: SubResolverContext,\n): Type | undefined {\n    if (!isUnionTypeNode(typeNode)) {\n        return undefined;\n    }\n\n    const members = typeNode.types.map(\n        (type) => ctx.resolveType(type, ctx.parentNode, ctx.context),\n    );\n\n    return {\n        typeName: TypeName.UNION,\n        members,\n    } as UnionType;\n}\n","/*\n * Copyright (c) 2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    NodeBuilderFlags,\n    SymbolFlags,\n    SyntaxKind,\n    isConditionalTypeNode,\n    isConstructorDeclaration,\n    isEnumDeclaration,\n    isEnumMember,\n    isExpressionWithTypeArguments,\n    isIdentifier,\n    isInterfaceDeclaration,\n    isLiteralTypeNode,\n    isMethodDeclaration,\n    isMethodSignature,\n    isPropertySignature,\n    isTypeAliasDeclaration,\n    isTypeReferenceNode,\n} from 'typescript';\nimport type {\n    ClassDeclaration,\n    ClassElement,\n    ConstructorDeclaration,\n    Declaration,\n    EntityName,\n    EnumDeclaration,\n    EnumMember,\n    ExpressionWithTypeArguments,\n    Identifier,\n    IndexSignatureDeclaration,\n    InterfaceDeclaration,\n    Node,\n    ParameterDeclaration,\n    PropertyDeclaration,\n    PropertySignature,\n    Symbol as TsSymbol,\n    TypeAliasDeclaration,\n    TypeElement,\n    TypeNode,\n    TypeReferenceNode,\n    TypeReferenceType,\n} from 'typescript';\nimport {\n    TypeName,\n    UtilityTypeName,\n    isDeprecatedMarker,\n    isRefAliasType,\n    isRefObjectType,\n    namesForMarker,\n    tagsForMarker,\n} from '@trapi/core';\nimport type {\n    BufferType,\n    DateTimeType,\n    DateType,\n    Extension,\n    NestedObjectLiteralType,\n    ReferenceType,\n    ResolverProperty,\n    Type,\n} from '@trapi/core';\nimport { hasDecoratorNamed } from '../../decorator';\nimport type { IReferenceTypeRegistry, IResolverContext } from '../../../core/metadata/types';\nimport {\n    JSDocTagName,\n    getJSDocTagComment,\n    getJSDocTagNames,\n    hasJSDocTag,\n} from '../js-doc';\nimport { getDeclarationValidators } from '../validator';\nimport { getInitializerValue } from '../initializer';\nimport { ResolverError } from '../../../core/error/resolver';\nimport { getNodeExtensions } from './extension';\nimport {\n    PrimitiveResolver,\n    ReferenceResolver,\n    ResolverBase,\n    resolveArrayType,\n    resolveIndexedAccessType,\n    resolveIntersectionType,\n    resolveLiteralType,\n    resolveMappedType,\n    resolveObjectLiteralType,\n    resolveTupleType,\n    resolveTypeOperatorType,\n    resolveUnionType,\n} from './sub';\nimport { getLiteralValue } from './sub/literal';\nimport type {\n    OverrideToken,\n    SubResolverContext,\n    TypeNodeResolverContext,\n    UsableDeclaration,\n} from './types';\nimport { getNodeDescription } from './utils';\n\nexport class TypeNodeResolver extends ResolverBase {\n    private static readonly MAX_DEPTH = 50;\n\n    private readonly typeNode : TypeNode;\n\n    private readonly current: IResolverContext & IReferenceTypeRegistry;\n\n    private readonly parentNode?: Node;\n\n    private context: TypeNodeResolverContext;\n\n    private readonly referencer : TypeNode | undefined;\n\n    private readonly depth: number;\n\n    private readonly primitiveResolver : PrimitiveResolver;\n\n    private readonly referenceResolver : ReferenceResolver;\n\n    constructor(\n        typeNode: TypeNode,\n        current: IResolverContext & IReferenceTypeRegistry,\n        parentNode?: Node,\n        context?: TypeNodeResolverContext,\n        referencer?: TypeNode,\n        depth?: number,\n    ) {\n        super();\n\n        this.typeNode = typeNode;\n        this.current = current;\n        this.parentNode = parentNode;\n        this.context = context || {};\n        this.referencer = referencer;\n        this.depth = depth ?? 0;\n\n        this.primitiveResolver = new PrimitiveResolver(current.registry);\n        this.referenceResolver = new ReferenceResolver(current.typeChecker);\n    }\n\n    /**\n     * @deprecated Use resolverCache.clear() on the context instead.\n     * Kept for backward compatibility — no-ops since cache is now instance-scoped.\n     */\n    public static clearCache() {\n        // Cache is now instance-scoped via IResolverContext.resolverCache.\n        // This method is a no-op for backward compatibility.\n    }\n\n    public resolve(): Type {\n        if (this.depth > TypeNodeResolver.MAX_DEPTH) {\n            throw new ResolverError(\n                `Type resolution exceeded maximum depth of ${TypeNodeResolver.MAX_DEPTH}. This usually indicates deeply nested or circular generics.`,\n                this.typeNode,\n            );\n        }\n\n        const ctx = this.createSubResolverContext();\n\n        const result = this.primitiveResolver.resolve(this.typeNode, this.parentNode) ??\n            resolveLiteralType(this.typeNode, ctx) ??\n            resolveArrayType(this.typeNode, ctx) ??\n            resolveUnionType(this.typeNode, ctx) ??\n            resolveIntersectionType(this.typeNode, ctx) ??\n            resolveObjectLiteralType(this.typeNode, ctx) ??\n            resolveTupleType(this.typeNode, ctx) ??\n            resolveMappedType(this.typeNode, ctx) ??\n            this.resolveConditionalType() ??\n            resolveTypeOperatorType(this.typeNode, ctx) ??\n            resolveIndexedAccessType(this.typeNode, ctx) ??\n            this.resolveTypeReference();\n\n        if (!result) {\n            this.throwUnknownType();\n        }\n\n        return result;\n    }\n\n    private createSubResolverContext(): SubResolverContext {\n        return {\n            typeChecker: this.current.typeChecker,\n            current: this.current,\n            parentNode: this.parentNode,\n            context: this.context,\n            referencer: this.referencer,\n            resolveType: (typeNode, parentNode, context, referencer) => (\n                this.resolveNestedType(typeNode, parentNode, context, referencer)\n            ),\n            propertyFromSignature: (sig, overrideToken) => this.propertyFromSignature(sig, overrideToken),\n            propertyFromDeclaration: (decl, overrideToken) => (\n                this.propertyFromDeclaration(decl, overrideToken)\n            ),\n            getNodeDescription: (node) => this.getNodeDescription(node),\n            getNodeExample: (node) => this.getNodeExample(node),\n            getNodeExtensions: (node) => this.getNodeExtensions(node),\n        };\n    }\n\n    private resolveNestedType(\n        typeNode: TypeNode,\n        parentNode?: Node,\n        context?: TypeNodeResolverContext,\n        referencer?: TypeNode,\n    ): Type {\n        return new TypeNodeResolver(\n            typeNode,\n            this.current,\n            parentNode,\n            context,\n            referencer,\n            this.depth + 1,\n        ).resolve();\n    }\n\n    private throwUnknownType(): never {\n        throw new ResolverError(`Unknown type: ${SyntaxKind[this.typeNode.kind]}`, this.typeNode);\n    }\n\n    // ------------------------------------------------------------------\n    // Conditional type resolution (kept inline — deeply coupled to reference handling)\n    // ------------------------------------------------------------------\n\n    private resolveConditionalType(): Type | undefined {\n        if (!isConditionalTypeNode(this.typeNode)) {\n            return undefined;\n        }\n\n        // When inside a generic type alias (context has entries) and we\n        // have a usage-site node (referencer), resolve via the referencer\n        // so the checker evaluates with concrete type arguments (#782).\n        if (Object.keys(this.context).length > 0 && this.referencer) {\n            return this.resolveTypeViaChecker(this.referencer);\n        }\n\n        // Delegate conditional type evaluation to the TypeScript type\n        // checker. The checker can evaluate any conditional directly,\n        // including complex patterns like `typeof globalThis extends\n        // { onmessage: any } ? {} : X` from @types/node (#753).\n        return this.resolveTypeViaChecker(this.typeNode);\n    }\n\n    // ------------------------------------------------------------------\n    // Type reference resolution (kept inline — deeply coupled to caching/utility types)\n    // ------------------------------------------------------------------\n\n    private resolveTypeReference(): Type | undefined {\n        if (this.typeNode.kind !== SyntaxKind.TypeReference) {\n            return undefined;\n        }\n\n        const typeReference = this.typeNode as TypeReferenceNode;\n\n        if (typeReference.typeName.kind === SyntaxKind.Identifier) {\n            if (\n                typeReference.typeName.text === 'Record' &&\n                typeReference.typeArguments &&\n                typeReference.typeArguments[1]\n            ) {\n                return {\n                    additionalProperties: this.resolveNestedType(\n                        typeReference.typeArguments[1],\n                        this.parentNode,\n                        this.context,\n                    ),\n                    typeName: TypeName.NESTED_OBJECT_LITERAL,\n                    properties: [],\n                } as NestedObjectLiteralType;\n            }\n\n            const specialReference = TypeNodeResolver.resolveSpecialReference(typeReference.typeName);\n\n            if (typeof specialReference !== 'undefined') {\n                return specialReference;\n            }\n\n            if (typeReference.typeName.text === 'Date') {\n                return this.getDateType(this.parentNode);\n            }\n\n            if (\n                typeReference.typeName.text === 'Buffer' ||\n                typeReference.typeName.text === 'Readable'\n            ) {\n                return { typeName: TypeName.BUFFER };\n            }\n\n            if (\n                typeReference.typeName.text === 'Array' &&\n                typeReference.typeArguments?.[0]\n            ) {\n                return {\n                    typeName: TypeName.ARRAY,\n                    elementType: this.resolveNestedType(\n                        typeReference.typeArguments[0],\n                        this.parentNode,\n                        this.context,\n                    ),\n                };\n            }\n\n            if (\n                typeReference.typeName.text === 'Promise' &&\n                typeReference.typeArguments?.length === 1 &&\n                typeReference.typeArguments[0]\n            ) {\n                return this.resolveNestedType(\n                    typeReference.typeArguments[0],\n                    this.parentNode,\n                    this.context,\n                );\n            }\n\n            if (typeReference.typeName.text === 'String') {\n                return { typeName: TypeName.STRING };\n            }\n\n            const contextual = this.context[typeReference.typeName.text];\n\n            if (contextual) {\n                return this.resolveNestedType(\n                    contextual,\n                    this.parentNode,\n                    this.context,\n                );\n            }\n\n            if (TypeNodeResolver.isCheckerResolvableUtilityType(typeReference.typeName.text)) {\n                return this.resolveUtilityTypeViaChecker(typeReference);\n            }\n        }\n\n        try {\n            const referenceType = this.getReferenceType(typeReference);\n\n            this.current.addReferenceType(referenceType);\n\n            return referenceType;\n        } catch (err) {\n            // When the model declaration walker fails (e.g. for global types\n            // like Headers, Request, Response from @types/node that use\n            // complex declaration patterns — #753), fall back to the checker.\n            // If the checker also fails, re-throw the original error.\n            try {\n                return this.resolveTypeViaChecker(typeReference);\n            } catch {\n                throw err;\n            }\n        }\n    }\n\n    // ------------------------------------------------------------------------\n    // Utility Type(s)\n    // ------------------------------------------------------------------------\n\n    private static readonly CHECKER_RESOLVABLE_UTILITY_TYPES: ReadonlySet<string> = new Set([\n        UtilityTypeName.NON_NULLABLE,\n        UtilityTypeName.OMIT,\n        UtilityTypeName.PARTIAL,\n        UtilityTypeName.READONLY,\n        UtilityTypeName.REQUIRED,\n        UtilityTypeName.PICK,\n        UtilityTypeName.EXTRACT,\n        UtilityTypeName.EXCLUDE,\n        UtilityTypeName.RETURN_TYPE,\n        UtilityTypeName.PARAMETERS,\n        UtilityTypeName.AWAITED,\n        UtilityTypeName.INSTANCE_TYPE,\n        UtilityTypeName.CONSTRUCTOR_PARAMETERS,\n    ]);\n\n    private static isCheckerResolvableUtilityType(name: string): boolean {\n        return TypeNodeResolver.CHECKER_RESOLVABLE_UTILITY_TYPES.has(name);\n    }\n\n    private resolveUtilityTypeViaChecker(typeReference: TypeReferenceNode): Type {\n        // When type arguments reference unbound type parameters from our\n        // context (e.g. `Awaited<T>` inside `type Box<T> = Awaited<T>`),\n        // the checker can't resolve them from the declaration-site node.\n        // Use the referencer (usage-site node like `Box<Promise<Foo>>`)\n        // which the checker CAN resolve with concrete type arguments.\n        if (this.hasUnboundContextArgs(typeReference) && this.referencer) {\n            return this.resolveTypeViaChecker(this.referencer);\n        }\n\n        return this.resolveTypeViaChecker(typeReference);\n    }\n\n    /**\n     * Shared checker delegation: resolves a type node by letting the TS\n     * type checker evaluate it, converting back to a TypeNode, and\n     * recursively resolving the result.\n     */\n    private resolveTypeViaChecker(typeNode: TypeNode): Type {\n        const type = this.current.typeChecker.getTypeFromTypeNode(typeNode);\n        // InTypeAlias prevents the node builder from emitting type alias\n        // references (which could cause circular resolution when the utility\n        // type is used inside a type alias declaration).\n        const resolvedTypeNode = this.current.typeChecker.typeToTypeNode(\n            type,\n            undefined,\n            NodeBuilderFlags.NoTruncation | NodeBuilderFlags.InTypeAlias,\n        );\n\n        // typeToTypeNode returns undefined for some edge cases (e.g. empty\n        // tuples from Parameters<> of a no-arg function). Fall back to an\n        // empty tuple type.\n        if (!resolvedTypeNode) {\n            return { typeName: TypeName.TUPLE, elements: [] };\n        }\n\n        return this.resolveNestedType(\n            resolvedTypeNode,\n            this.parentNode,\n            this.context,\n        );\n    }\n\n    /**\n     * Check if a type reference has type arguments that reference unbound\n     * type parameters from this.context (e.g. `Awaited<T>` where T is a\n     * generic parameter mapped in context).\n     */\n    private hasUnboundContextArgs(typeReference: TypeReferenceNode): boolean {\n        if (!typeReference.typeArguments || Object.keys(this.context).length === 0) {\n            return false;\n        }\n\n        return typeReference.typeArguments.some((arg) =>\n            isTypeReferenceNode(arg) &&\n            isIdentifier(arg.typeName) &&\n            arg.typeName.text in this.context);\n    }\n\n    private static resolveSpecialReference(node: Identifier) : Type | undefined {\n        switch (node.text) {\n            case 'Buffer':\n            case 'DownloadBinaryData':\n            case 'DownloadResource':\n                return { typeName: TypeName.BUFFER } as BufferType;\n            default:\n                return undefined;\n        }\n    }\n\n    private getDateType(parentNode?: Node): DateType | DateTimeType {\n        if (!parentNode) {\n            return { typeName: TypeName.DATETIME };\n        }\n\n        const tags = getJSDocTagNames(parentNode).filter((name) => ['isDate', 'isDateTime'].includes(name));\n\n        if (tags.length === 0) {\n            return { typeName: TypeName.DATETIME };\n        }\n\n        switch (tags[0]) {\n            case 'isDate':\n                return { typeName: TypeName.DATE };\n            default:\n                return { typeName: TypeName.DATETIME };\n        }\n    }\n\n    private static getDesignatedModels<T extends Node>(nodes: T[], _typeName: string): T[] {\n        return nodes;\n    }\n\n    private getReferenceType(node: TypeReferenceType): ReferenceType {\n        let type: EntityName;\n\n        if (isTypeReferenceNode(node)) {\n            type = node.typeName;\n        } else if (isExpressionWithTypeArguments(node)) {\n            type = node.expression as EntityName;\n        } else {\n            throw new ResolverError('Can\\'t resolve reference type.');\n        }\n\n        // Can't invoke getText on Synthetic Nodes\n        let resolvableName = node.pos !== -1 ? node.getText() : (type as Identifier).text;\n\n        if (node.pos === -1 && 'typeArguments' in node && Array.isArray(node.typeArguments)) {\n            // Add typeArguments for Synthetic nodes (e.g. Record<> in TestClassModel.indexedResponse)\n            const argumentsString = node.typeArguments\n                .map((arg) => {\n                    if (isLiteralTypeNode(arg)) {\n                        return `'${String(getLiteralValue(arg))}'`;\n                    }\n\n                    const resolvedType = this.primitiveResolver.resolveSyntaxKind(arg.kind);\n\n                    if (\n                        typeof resolvedType === 'undefined'\n                    ) {\n                        return 'any';\n                    }\n\n                    return resolvedType;\n                });\n\n            resolvableName += `<${argumentsString.join(', ')}>`;\n        }\n\n        const name = this.contextualizedName(resolvableName);\n\n        this.typeArgumentsToContext(node, type, this.context);\n\n        try {\n            const existingType = this.current.resolverCache.getCachedType(name);\n\n            if (existingType) {\n                return existingType;\n            }\n\n            if (this.current.resolverCache.isInProgress(name)) {\n                return this.createCircularDependencyResolver(name);\n            }\n\n            this.current.resolverCache.markInProgress(name);\n\n            try {\n                const refName = TypeNodeResolver.getRefTypeName(name);\n                const declarations = this.getModelTypeDeclarations(type);\n                const referenceTypes: ReferenceType[] = [];\n\n                for (const declaration of declarations) {\n                    if (isTypeAliasDeclaration(declaration)) {\n                        referenceTypes.push(\n                            this.getTypeAliasReference(\n                                declaration,\n                                name,\n                                node,\n                            ),\n                        );\n                    } else if (isEnumDeclaration(declaration)) {\n                        referenceTypes.push(this.referenceResolver.transformEnum(declaration, refName));\n                    } else if (isEnumMember(declaration)) {\n                        referenceTypes.push(this.referenceResolver.transformEnumMember(declaration, refName));\n                    } else {\n                        // todo: dont cast handle property-signature\n                        referenceTypes.push(\n                            this.getModelReference(\n                                declaration as InterfaceDeclaration,\n                                name,\n                            ),\n                        );\n                    }\n                }\n\n                const referenceType = this.referenceResolver.merge(referenceTypes);\n\n                this.current.resolverCache.setCachedType(name, referenceType);\n\n                return referenceType;\n            } finally {\n                this.current.resolverCache.clearInProgress(name);\n            }\n        } catch (err) {\n            throw new ResolverError(\n                `There was a problem resolving type of '${name}'.`,\n                node,\n                { cause: err },\n            );\n        }\n    }\n\n    private getTypeAliasReference(\n        declaration: TypeAliasDeclaration,\n        name: string,\n        referencer: TypeReferenceType,\n    ): ReferenceType {\n        const refName = TypeNodeResolver.getRefTypeName(name);\n\n        if (declaration.type.kind === SyntaxKind.TypeReference) {\n            const innerRef = declaration.type as TypeReferenceNode;\n            // Record<K,V> and checker-resolvable utility types (Pick, Omit, etc.)\n            // should not go through getReferenceType — resolveNestedType handles\n            // them correctly via resolveTypeReference.\n            const innerName = isIdentifier(innerRef.typeName) ? innerRef.typeName.text : undefined;\n            const skipReferenceType = innerName === UtilityTypeName.RECORD ||\n                (innerName !== undefined && TypeNodeResolver.isCheckerResolvableUtilityType(innerName));\n\n            if (!skipReferenceType) {\n                const referenceType = this.getReferenceType(innerRef);\n\n                if (referenceType.refName === refName) {\n                    return referenceType;\n                }\n            }\n        }\n\n        const type = this.resolveNestedType(\n            declaration.type,\n            declaration,\n            this.context,\n            this.referencer || referencer,\n        );\n\n        const example = this.getNodeExample(declaration);\n\n        return {\n            typeName: TypeName.REF_ALIAS,\n            default: getJSDocTagComment(declaration, JSDocTagName.DEFAULT),\n            description: this.getNodeDescription(declaration),\n            refName,\n            format: TypeNodeResolver.getNodeFormat(declaration),\n            type,\n            validators: getDeclarationValidators(declaration) || {},\n            deprecated: hasJSDocTag(declaration, JSDocTagName.DEPRECATED),\n            ...(example && { example }),\n        };\n    }\n\n    private getModelReference(\n        modelType: InterfaceDeclaration | ClassDeclaration,\n        name: string,\n    ) : ReferenceType {\n        const example = this.getNodeExample(modelType);\n        const description = this.getNodeDescription(modelType);\n        const deprecatedDecoratorNames = namesForMarker(this.current.registry, isDeprecatedMarker);\n        const deprecatedJsDocTags = tagsForMarker(this.current.registry, isDeprecatedMarker);\n        const deprecated : boolean =            [...deprecatedJsDocTags].some((tag) => hasJSDocTag(modelType, tag)) ||\n            [...deprecatedDecoratorNames].some((name) => hasDecoratorNamed(modelType, name));\n\n        // Handle toJSON methods\n        if (!modelType.name) {\n            throw new ResolverError('Can\\'t get Symbol from anonymous class', modelType);\n        }\n\n        const type = this.current.typeChecker.getTypeAtLocation(modelType.name);\n        const toJSON = this.current.typeChecker.getPropertyOfType(type, 'toJSON');\n\n        if (\n            toJSON &&\n            toJSON.valueDeclaration &&\n            (\n                isMethodDeclaration(toJSON.valueDeclaration) ||\n                isMethodSignature(toJSON.valueDeclaration)\n            )\n        ) {\n            let nodeType = toJSON.valueDeclaration.type;\n\n            if (!nodeType) {\n                const signature = this.current.typeChecker.getSignatureFromDeclaration(toJSON.valueDeclaration);\n\n                if (signature) {\n                    const implicitType = this.current.typeChecker.getReturnTypeOfSignature(signature);\n\n                    nodeType = this.current.typeChecker.typeToTypeNode(implicitType, undefined, NodeBuilderFlags.NoTruncation) as TypeNode;\n                } else {\n                    throw new ResolverError('Can\\'t get signature from toJson value declaration', modelType);\n                }\n            }\n\n            return {\n                refName: `${TypeNodeResolver.getRefTypeName(name)}Alias`,\n                typeName: TypeName.REF_ALIAS,\n                description,\n                type: this.resolveNestedType(nodeType),\n                deprecated,\n                validators: {},\n                ...(example && { example }),\n            };\n        }\n\n        const properties = this.getModelProperties(modelType);\n        const additionalProperties = this.getModelAdditionalProperties(modelType);\n        const inheritedProperties = this.getModelInheritedProperties(modelType) || [];\n\n        const referenceType: ReferenceType & { properties: ResolverProperty[] } = {\n            additionalProperties,\n            typeName: TypeName.REF_OBJECT,\n            description,\n            properties: inheritedProperties,\n            refName: TypeNodeResolver.getRefTypeName(name),\n            deprecated,\n            ...(example && { example }),\n        };\n\n        referenceType.properties = referenceType.properties.concat(properties);\n\n        return referenceType;\n    }\n\n    private static getRefTypeName(name: string): string {\n        const sanitized = name\n            // Structural characters → temporary placeholders\n            .replace(/[<>]/g, '_')\n            .replace(/[{}]/g, '_')\n            .replace(/\\s+/g, '')\n            // Delimiter characters → semantic names\n            .replace(/,/g, '.')\n            .replace(/'([^']*)'/g, '$1')\n            .replace(/\"([^\"]*)\"/g, '$1')\n            .replace(/&/g, '-and-')\n            .replace(/\\|/g, '-or-')\n            .replace(/\\[\\]/g, '-array')\n            .replace(/([a-z]+):([a-z]+)/gi, '$1-$2')\n            .replace(/;/g, '--')\n            .replace(/([a-z]+)\\[([a-z]+)]/gi, '$1-at-$2')\n            // Strip temporary placeholders (keep hyphens for semantic separators)\n            .replace(/_/g, '');\n\n        return encodeURIComponent(sanitized);\n    }\n\n    private contextualizedName(name: string): string {\n        return Object.entries(\n            this.context,\n        ).reduce((acc, [key, entry]) => acc\n            .replace(new RegExp(`<\\\\s*([^>]*\\\\s)*\\\\s*(${key})(\\\\s[^>]*)*\\\\s*>`, 'g'), `<$1${entry.getText()}$3>`)\n            .replace(new RegExp(`<\\\\s*([^,]*\\\\s)*\\\\s*(${key})(\\\\s[^,]*)*\\\\s*,`, 'g'), `<$1${entry.getText()}$3,`)\n            .replace(new RegExp(`,\\\\s*([^>]*\\\\s)*\\\\s*(${key})(\\\\s[^>]*)*\\\\s*>`, 'g'), `,$1${entry.getText()}$3>`)\n            .replace(new RegExp(`<\\\\s*([^<]*\\\\s)*\\\\s*(${key})(\\\\s[^<]*)*\\\\s*<`, 'g'), `<$1${entry.getText()}$3<`), name);\n    }\n\n    private createCircularDependencyResolver(refName: string) {\n        const referenceType : ReferenceType = {\n            deprecated: false,\n            properties: [],\n            typeName: TypeName.REF_OBJECT,\n            refName,\n        };\n\n        this.current.registerDependencyResolver((referenceTypes) => {\n            const realReferenceType : ReferenceType | undefined = referenceTypes[refName];\n\n            if (!realReferenceType) {\n                return;\n            }\n\n            referenceType.description = realReferenceType.description;\n\n            if (realReferenceType.typeName === 'refObject' && referenceType.typeName === 'refObject') {\n                referenceType.properties = realReferenceType.properties;\n            }\n\n            referenceType.typeName = realReferenceType.typeName as `${TypeName.REF_OBJECT}`;\n            referenceType.refName = realReferenceType.refName;\n        });\n\n        return referenceType;\n    }\n\n    private static nodeIsUsable(node: Node) : node is UsableDeclaration {\n        switch (node.kind) {\n            case SyntaxKind.InterfaceDeclaration:\n            case SyntaxKind.ClassDeclaration:\n            case SyntaxKind.TypeAliasDeclaration:\n            case SyntaxKind.EnumDeclaration:\n            case SyntaxKind.EnumMember:\n                return true;\n            default:\n                return false;\n        }\n    }\n\n    private getModelTypeDeclarations(type: EntityName) {\n        let typeName = type.kind === SyntaxKind.Identifier ? type.text : type.right.text;\n\n        let symbol : TsSymbol | undefined = this.getSymbolAtLocation(type);\n\n        if (!symbol && type.kind === SyntaxKind.QualifiedName) {\n            const fullEnumSymbol = this.getSymbolAtLocation(type.left);\n\n            symbol = fullEnumSymbol.exports?.get(typeName as any);\n        }\n\n        if (!symbol) {\n            throw new ResolverError(\n                `No symbol found for referenced type ${typeName}.`,\n            );\n        }\n\n        const declarations = symbol.getDeclarations();\n\n        if (!declarations || declarations.length === 0) {\n            throw new ResolverError(\n                `No declarations found for referenced type ${typeName}.`,\n            );\n        }\n\n        if (symbol.escapedName !== typeName && symbol.escapedName !== 'default') {\n            typeName = symbol.escapedName as string;\n        }\n\n        let modelTypes = declarations.filter((node) => {\n            if (!TypeNodeResolver.nodeIsUsable(node) || !this.current.isExportedNode(node)) {\n                return false;\n            }\n\n            const modelTypeDeclaration = node as UsableDeclaration;\n\n            return (modelTypeDeclaration.name as Identifier)?.text === typeName;\n        });\n\n        if (!modelTypes.length) {\n            throw new ResolverError(\n                `No matching model found for referenced type ${typeName}. If ${typeName} comes from a dependency, please create an interface in your own code that has the same structure. The compiler can not utilize interfaces from external dependencies.`,\n            );\n        }\n\n        if (modelTypes.length > 1) {\n            // remove types that are from typescript e.g. 'Account'\n            modelTypes = modelTypes.filter((modelType) => !modelType.getSourceFile()\n                .fileName.replace(/\\\\/g, '/').toLowerCase().includes('node_modules/typescript'));\n\n            modelTypes = TypeNodeResolver.getDesignatedModels(modelTypes, typeName);\n        }\n\n        return modelTypes;\n    }\n\n    private getModelTypeDeclaration(type: EntityName) : UsableDeclaration {\n        let typeName = type.kind === SyntaxKind.Identifier ? type.text : type.right.text;\n\n        const symbol = this.getSymbolAtLocation(type);\n        const declarations = symbol.getDeclarations();\n\n        if (!declarations || declarations.length === 0) {\n            throw new ResolverError(\n                `No models found for referenced type ${typeName}.`,\n            );\n        }\n\n        if (symbol.escapedName !== typeName && symbol.escapedName !== 'default') {\n            typeName = symbol.escapedName as string;\n        }\n\n        let modelTypes = declarations.filter((node) => {\n            if (!TypeNodeResolver.nodeIsUsable(node) || !this.current.isExportedNode(node)) {\n                return false;\n            }\n\n            const modelTypeDeclaration = node as UsableDeclaration;\n\n            return (modelTypeDeclaration.name as Identifier)?.text === typeName;\n        });\n\n        if (!modelTypes.length) {\n            throw new ResolverError(\n                `No matching model found for referenced type ${typeName}. If ${typeName} comes from a dependency, please create an interface in your own code that has the same structure. The compiler can not utilize interfaces from external dependencies.`,\n            );\n        }\n\n        if (modelTypes.length > 1) {\n            // remove types that are from typescript e.g. 'Account'\n            modelTypes = modelTypes.filter((modelType) => !modelType.getSourceFile()\n                .fileName.replace(/\\\\/g, '/').toLowerCase().includes('node_modules/typescript'));\n\n            modelTypes = TypeNodeResolver.getDesignatedModels(modelTypes, typeName);\n        }\n\n        if (modelTypes.length > 1) {\n            const conflicts = modelTypes.map((modelType) => modelType.getSourceFile().fileName).join('\"; \"');\n            throw new ResolverError(\n                `Multiple matching models found for referenced type ${typeName}; please make model names unique. Conflicts found: \"${conflicts}\".`,\n            );\n        }\n\n        return modelTypes[0] as UsableDeclaration;\n    }\n\n    private hasFlag(type: TsSymbol | Declaration, flag: number) {\n        return (type.flags & flag) === flag;\n    }\n\n    private getSymbolAtLocation(type: Node) : TsSymbol {\n        const symbol = this.current.typeChecker.getSymbolAtLocation(type) || ((type as any).symbol as TsSymbol);\n\n        // resolve alias if it is an alias, otherwise take symbol directly\n        return (\n            symbol &&\n            this.hasFlag(symbol, SymbolFlags.Alias) &&\n            this.current.typeChecker.getAliasedSymbol(symbol)\n        ) || symbol;\n    }\n\n    private getModelProperties(\n        node: InterfaceDeclaration | ClassDeclaration,\n        overrideToken?: OverrideToken,\n    ) : ResolverProperty[] {\n        const isIgnored = (e: TypeElement | ClassElement) => hasJSDocTag(e, JSDocTagName.IGNORE);\n\n        // Interface model\n        if (isInterfaceDeclaration(node)) {\n            return node.members\n                .filter(\n                    (member) => !isIgnored(member) &&\n                    isPropertySignature(member),\n                ).map(\n                    (member) => this.propertyFromSignature(member as PropertySignature, overrideToken),\n                );\n        }\n\n        // Class model\n        const properties = node.members\n            .filter((member) => !isIgnored(member) &&\n                    member.kind === SyntaxKind.PropertyDeclaration &&\n                !this.hasStaticModifier(member) &&\n                this.hasPublicModifier(member)) as Array<PropertyDeclaration | ParameterDeclaration>;\n\n        const classConstructor = node.members.find(\n            (member) => isConstructorDeclaration(member),\n        ) as ConstructorDeclaration;\n\n        if (classConstructor && classConstructor.parameters) {\n            const constructorProperties = classConstructor.parameters.filter((parameter) => this.isAccessibleParameter(parameter));\n\n            properties.push(...constructorProperties);\n        }\n\n        return properties.map((property) => this.propertyFromDeclaration(property, overrideToken));\n    }\n\n    private propertyFromSignature(propertySignature: PropertySignature, overrideToken?: OverrideToken) {\n        const identifier = propertySignature.name as Identifier;\n\n        if (!propertySignature.type) {\n            throw new ResolverError('No valid type found for property declaration.');\n        }\n\n        let required = !propertySignature.questionToken;\n\n        if (overrideToken && overrideToken.kind === SyntaxKind.MinusToken) {\n            required = true;\n        } else if (overrideToken && overrideToken.kind === SyntaxKind.QuestionToken) {\n            required = false;\n        }\n\n        const property: ResolverProperty = {\n            deprecated: hasJSDocTag(propertySignature, JSDocTagName.DEPRECATED),\n            default: getJSDocTagComment(propertySignature, JSDocTagName.DEFAULT),\n            description: this.getNodeDescription(propertySignature),\n            example: this.getNodeExample(propertySignature),\n            extensions: this.getNodeExtensions(propertySignature),\n            format: TypeNodeResolver.getNodeFormat(propertySignature),\n            name: identifier.text,\n            required,\n            type: this.resolveNestedType(\n                propertySignature.type,\n                propertySignature.type.parent,\n                this.context,\n                propertySignature.type,\n            ),\n            validators: getDeclarationValidators(propertySignature) || {},\n        };\n\n        return property;\n    }\n\n    private propertyFromDeclaration(\n        propertyDeclaration: PropertyDeclaration | ParameterDeclaration,\n        overrideToken?: OverrideToken,\n    ) {\n        const identifier = propertyDeclaration.name as Identifier;\n        let typeNode = propertyDeclaration.type;\n\n        if (!typeNode) {\n            const tsType = this.current.typeChecker.getTypeAtLocation(propertyDeclaration);\n\n            typeNode = this.current.typeChecker.typeToTypeNode(tsType, undefined, NodeBuilderFlags.NoTruncation);\n        }\n\n        if (!typeNode) {\n            throw new ResolverError('No valid type found for property declaration.');\n        }\n\n        const type = this.resolveNestedType(typeNode, propertyDeclaration, this.context, typeNode);\n\n        let required = !propertyDeclaration.questionToken && !propertyDeclaration.initializer;\n\n        if (overrideToken && overrideToken.kind === SyntaxKind.MinusToken) {\n            required = true;\n        } else if (overrideToken && overrideToken.kind === SyntaxKind.QuestionToken) {\n            required = false;\n        }\n\n        const property: ResolverProperty = {\n            deprecated: hasJSDocTag(propertyDeclaration, JSDocTagName.DEPRECATED),\n            default: getInitializerValue(propertyDeclaration.initializer, this.current.typeChecker),\n            description: this.getNodeDescription(propertyDeclaration),\n            example: this.getNodeExample(propertyDeclaration),\n            extensions: this.getNodeExtensions(propertyDeclaration),\n            format: TypeNodeResolver.getNodeFormat(propertyDeclaration),\n            name: identifier.text,\n            required,\n            type,\n            validators: getDeclarationValidators(propertyDeclaration) || {},\n        };\n\n        return property;\n    }\n\n    private getModelAdditionalProperties(node: UsableDeclaration) {\n        if (node.kind === SyntaxKind.InterfaceDeclaration) {\n            const indexMember = node.members.find((member) => member.kind === SyntaxKind.IndexSignature);\n\n            if (!indexMember) {\n                return undefined;\n            }\n\n            const indexSignatureDeclaration = indexMember as IndexSignatureDeclaration;\n            const indexType = this.resolveNestedType(\n                indexSignatureDeclaration.parameters[0]!.type as TypeNode,\n                this.parentNode,\n                this.context,\n            );\n\n            if (indexType.typeName !== 'string') {\n                throw new ResolverError('Only string indexers are supported.', this.typeNode);\n            }\n\n            return this.resolveNestedType(indexSignatureDeclaration.type, this.parentNode, this.context);\n        }\n\n        return undefined;\n    }\n\n    private typeArgumentsToContext(\n        type: TypeReferenceNode | ExpressionWithTypeArguments,\n        targetEntity: EntityName,\n        context: TypeNodeResolverContext,\n    ): TypeNodeResolverContext {\n        // this.context = {};\n\n        const declaration = this.getModelTypeDeclaration(targetEntity);\n\n        if (typeof declaration === 'undefined' || !('typeParameters' in declaration)) {\n            return context;\n        }\n\n        const { typeParameters } = declaration;\n\n        if (typeParameters) {\n            for (const [index, typeParameter] of typeParameters.entries()) {\n                const typeArg = type.typeArguments && type.typeArguments[index];\n                let resolvedType: TypeNode;\n\n                // Argument may be a forward reference from context\n                const contextual = typeArg && isTypeReferenceNode(typeArg) && isIdentifier(typeArg.typeName) ?\n                    context[typeArg.typeName.text] :\n                    undefined;\n\n                if (contextual) {\n                    resolvedType = contextual;\n                } else if (typeArg) {\n                    resolvedType = typeArg;\n                } else if (typeParameter.default) {\n                    resolvedType = typeParameter.default;\n                } else {\n                    throw new ResolverError(`Could not find a value for type parameter ${typeParameter.name.text}`, type);\n                }\n\n                this.context = {\n                    ...this.context,\n                    [typeParameter.name.text]: resolvedType,\n                };\n            }\n        }\n\n        return context;\n    }\n\n    private getModelInheritedProperties(\n        modelTypeDeclaration: Exclude<UsableDeclaration, PropertySignature | TypeAliasDeclaration | EnumMember>,\n    ): ResolverProperty[] {\n        let properties: ResolverProperty[] = [];\n\n        const { heritageClauses } = modelTypeDeclaration;\n\n        if (!heritageClauses) {\n            return properties;\n        }\n\n        heritageClauses.forEach((clause) => {\n            if (!clause.types) {\n                return;\n            }\n\n            clause.types.forEach((t) => {\n                const baseEntityName = t.expression as EntityName;\n\n                // create subContext\n                const resetCtx = this.typeArgumentsToContext(t, baseEntityName, this.context);\n\n                const referenceType = this.getReferenceType(t);\n\n                if (referenceType) {\n                    if (isRefAliasType(referenceType)) {\n                        let type: Type = referenceType;\n\n                        while (isRefAliasType(type)) {\n                            type = type.type;\n                        }\n\n                        if (\n                            type.typeName === TypeName.REF_OBJECT ||\n                            type.typeName === TypeName.NESTED_OBJECT_LITERAL\n                        ) {\n                            properties = [...properties, ...type.properties];\n                        }\n                    }\n\n                    if (isRefObjectType(referenceType)) {\n                        properties.push(...referenceType.properties);\n                    }\n                }\n\n                // reset subContext\n                this.context = resetCtx;\n            });\n        });\n\n        return properties;\n    }\n\n    private getNodeDescription(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration) {\n        return getNodeDescription(node, this.current.typeChecker);\n    }\n\n    private static getNodeFormat(\n        node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration,\n    ) {\n        return getJSDocTagComment(node, JSDocTagName.FORMAT);\n    }\n\n    private getNodeExample(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration) {\n        const example = getJSDocTagComment(node, JSDocTagName.EXAMPLE);\n\n        if (example) {\n            try {\n                return JSON.parse(example);\n            } catch {\n                return example;\n            }\n        }\n\n        return undefined;\n    }\n\n    protected getNodeExtensions(node: UsableDeclaration | PropertyDeclaration | ParameterDeclaration | EnumDeclaration) : Extension[] {\n        return getNodeExtensions(node, this.current.registry);\n    }\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IResolverCache, ReferenceType } from '@trapi/core';\n\nexport class ResolverCache implements IResolverCache {\n    private referenceTypes = new Map<string, ReferenceType>();\n\n    private inProgressTypes = new Set<string>();\n\n    getCachedType(name: string): ReferenceType | undefined {\n        return this.referenceTypes.get(name);\n    }\n\n    setCachedType(name: string, type: ReferenceType): void {\n        this.referenceTypes.set(name, type);\n    }\n\n    isInProgress(name: string): boolean {\n        return this.inProgressTypes.has(name);\n    }\n\n    markInProgress(name: string): void {\n        this.inProgressTypes.add(name);\n    }\n\n    clearInProgress(name: string): void {\n        this.inProgressTypes.delete(name);\n    }\n\n    clear(): void {\n        this.referenceTypes.clear();\n        this.inProgressTypes.clear();\n    }\n}\n","/*\n * Copyright (c) 2021-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Node } from 'typescript';\nimport {\n    canHaveDecorators,\n    getDecorators,\n    isCallExpression,\n    isNumericLiteral,\n    isStringLiteral,\n} from 'typescript';\nimport type { NodeDecorator } from './types';\n\n/**\n * Get Decorators for a specific node.\n *\n * @param node\n * @param isMatching\n */\nexport function getNodeDecorators(\n    node: Node,\n    isMatching?: (data: NodeDecorator) => boolean,\n): NodeDecorator[] {\n    if (!canHaveDecorators(node)) {\n        return [];\n    }\n\n    const decorators = getDecorators(node);\n\n    if (typeof decorators === 'undefined') {\n        return [];\n    }\n\n    const items = decorators\n        .map((d) => {\n            const result: any = {\n                arguments: [],\n                typeArguments: [],\n            };\n\n            let x: any = d.expression;\n\n            if (isCallExpression(x)) {\n                if (x.arguments) {\n                    result.arguments = x.arguments.map((argument: any) => {\n                        if (isStringLiteral(argument) || isNumericLiteral(argument)) {\n                            return argument.text;\n                        }\n\n                        return argument;\n                    });\n                }\n\n                if (x.typeArguments) {\n                    result.typeArguments = x.typeArguments;\n                }\n\n                x = x.expression;\n            }\n\n            result.text = x.text || x.name.text;\n\n            return result as NodeDecorator;\n        });\n\n    return typeof isMatching === 'undefined' ? items : items.filter(isMatching);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { LocatorInfo } from 'locter';\nimport { buildFilePath, locateMany } from 'locter';\nimport type { EntryPoint } from '../../core/config';\n\nexport async function scanSourceFiles(input: EntryPoint) : Promise<string[]> {\n    const sources = Array.isArray(input) ? input : [input];\n    const result: Set<string> = new Set<string>();\n\n    const promises : Promise<LocatorInfo[]>[] = [];\n\n    for (const source of sources) {\n        if (typeof source === 'string') {\n            promises.push(locateMany(source));\n        } else {\n            promises.push(locateMany(source.pattern, { cwd: source.cwd }));\n        }\n    }\n\n    const groupMatches = await Promise.all(promises);\n    const matches = groupMatches.flat();\n\n    for (const match of matches) {\n        result.add(buildFilePath(match));\n    }\n\n    return Array.from(result);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { read } from 'locter';\nimport { isObject } from 'smob';\nimport { ConfigErrorCode } from '../../../core/error/config-codes';\nimport { ConfigError } from '../../../core/error/config';\nimport process from 'node:process';\nimport path from 'node:path';\nimport { parseJsonConfigFileContent, sys } from 'typescript';\nimport type { TsConfig, TsconfigLoadContext } from './types';\n\nexport async function loadTSConfig(\n    context: TsconfigLoadContext = {},\n) : Promise<TsConfig> {\n    const cwd = context.cwd || process.cwd();\n    // must be absolute: with a relative basePath, typescript silently skips the extends chain\n    const filePath = path.resolve(cwd, context.name || 'tsconfig.json');\n\n    // read() returns the raw parsed value for data formats —\n    // mutable, so compilerOptions can be reassigned below\n    const content = await read(filePath);\n\n    if (!isObject(content)) {\n        throw new ConfigError({\n            message: `The tsconfig file '${filePath}' is malformed.`,\n            code: ConfigErrorCode.TSCONFIG_MALFORMED,\n        });\n    }\n\n    // unlike convertCompilerOptionsFromJson, this follows extends and sets pathsBasePath.\n    // the copy keeps the returned raw config clean — parseJsonConfigFileContent\n    // writes compileOnSave and the inherited include/exclude onto what it is handed.\n    content.compilerOptions = parseJsonConfigFileContent(\n        { ...content },\n        sys,\n        path.dirname(filePath),\n        undefined,\n        filePath,\n    ).options;\n\n    return content;\n}\n\nexport async function softLoadTsconfig(\n    context: TsconfigLoadContext = {},\n) : Promise<TsConfig> {\n    try {\n        return await loadTSConfig(context);\n    } catch {\n        return {};\n    }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n/**\n * Bump whenever the on-disk cache shape changes incompatibly\n * (Metadata, Controller, Method, Parameter, resolver type nodes,\n * or the cache wrapper itself), OR whenever the generator starts\n * producing different metadata from unchanged input. No other\n * contributor to the cache key tracks the generator itself — the key\n * folds source text, compiler options, the registry and the preset\n * name, all of which a resolution fix leaves untouched — so without a\n * bump an upgrade keeps serving pre-fix metadata from a warm cache.\n * Old cache files with a different version are rejected on read.\n */\nexport const CACHE_SCHEMA_VERSION = '9';\n\nexport const CACHE_FILE_PREFIX = '.trapi-metadata-';\nexport const CACHE_FILE_SUFFIX = '.json';\n\n/** 7 days. */\nexport const CACHE_DEFAULT_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;\n","import type { CacheKeyParts, CacheOptions, CacheOptionsInput  } from './types';\n/*\n * Copyright (c) 2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { tmpdir } from 'node:os';\nimport path from 'node:path';\nimport crypto from 'node:crypto';\nimport process from 'node:process';\nimport type { CompilerOptions } from 'typescript';\nimport type { Registry } from '@trapi/core';\nimport { CACHE_DEFAULT_MAX_AGE_MS } from './constants';\n\nexport function buildCacheOptions(input?: string | boolean | CacheOptionsInput) : CacheOptions {\n    if (typeof input === 'string') {\n        input = {\n            enabled: true,\n            directoryPath: input,\n        };\n    }\n\n    if (typeof input === 'boolean') {\n        input = { enabled: input };\n    }\n\n    input = input || {};\n\n    let directoryPath = tmpdir();\n\n    if (typeof input.directoryPath === 'string') {\n        directoryPath = path.isAbsolute(input.directoryPath) ?\n            input.directoryPath :\n            path.join(process.cwd(), input.directoryPath);\n    }\n\n    return {\n        fileName: input.fileName,\n        directoryPath,\n        enabled: input.enabled ?? true,\n        maxAgeMs: normalizeMaxAgeMs(input.maxAgeMs),\n    };\n}\n\nfunction normalizeMaxAgeMs(input: number | undefined): number {\n    if (typeof input !== 'number' || !Number.isFinite(input) || input < 0) {\n        // NaN, Infinity, negative, or absent → fall back to the default.\n        // Only `0` (explicit disable) and positive finite values are honored.\n        return CACHE_DEFAULT_MAX_AGE_MS;\n    }\n\n    return input;\n}\n\n/**\n * Combines all key contributors into a single sha256 hex string. The order is\n * stable; each part is null-separated to avoid concatenation ambiguity.\n */\nexport function composeCacheKey(parts: CacheKeyParts): string {\n    const hash = crypto.createHash('sha256');\n\n    hash.update(parts.schemaVersion);\n    hash.update('\\0');\n    hash.update(parts.sourceFilesHash);\n    hash.update('\\0');\n    hash.update(parts.compilerOptionsHash);\n    hash.update('\\0');\n    hash.update(parts.registryHash);\n    hash.update('\\0');\n    hash.update(parts.presetName ?? '');\n\n    return hash.digest('hex');\n}\n\n/**\n * Hash a stable JSON projection of `compilerOptions`. Sorting keys keeps the\n * output deterministic regardless of declaration order in tsconfig.json.\n */\nexport function hashCompilerOptions(options?: CompilerOptions): string {\n    const hash = crypto.createHash('sha256');\n\n    hash.update(stableStringify(options ?? {}));\n\n    return hash.digest('hex');\n}\n\n/**\n * Hash the resolved registry's structural shape. Catches structural changes\n * (handler added/removed/renamed, marker changed, replaces policy changed)\n * AND most logic changes via `apply.toString()`. Misses changes that are\n * purely captured-variable shifts in factory-built handlers — acceptable\n * trade-off for catching local preset edits.\n */\nexport function hashRegistry(registry: Registry): string {\n    const hash = crypto.createHash('sha256');\n    const kinds = [\n        'controllers',\n        'methods',\n        'parameters',\n        'controllerJsDoc',\n        'methodJsDoc',\n        'parameterJsDoc',\n    ] as const;\n\n    for (const kind of kinds) {\n        hash.update(kind);\n        hash.update('\\0');\n\n        const handlers = registry[kind] ?? [];\n\n        for (const handler of handlers) {\n            hash.update(stableStringify(handler.match));\n            hash.update('\\0');\n            hash.update(stableStringify(handler.marker ?? null));\n            hash.update('\\0');\n            hash.update(String(handler.replaces ?? ''));\n            hash.update('\\0');\n            hash.update(handler.apply.toString());\n            hash.update('\\0');\n        }\n\n        hash.update('\\x01');\n    }\n\n    // Finalizers carry no match/marker, only their body. Missing arrays (a\n    // hand-built `Registry` literal) hash like empty ones.\n    const finalizerKinds = ['methodFinalizers', 'controllerFinalizers'] as const;\n\n    for (const kind of finalizerKinds) {\n        hash.update(kind);\n        hash.update('\\0');\n\n        for (const finalizer of registry[kind] ?? []) {\n            hash.update(finalizer.toString());\n            hash.update('\\0');\n        }\n\n        hash.update('\\x01');\n    }\n\n    return hash.digest('hex');\n}\n\n/**\n * JSON.stringify with sorted object keys at every level. Functions and\n * undefined are omitted as usual; that's fine for the inputs we hash here.\n */\nfunction stableStringify(value: unknown): string {\n    return JSON.stringify(value, (_key, val) => {\n        if (val && typeof val === 'object' && !Array.isArray(val)) {\n            const sorted: Record<string, unknown> = {};\n\n            for (const k of Object.keys(val as Record<string, unknown>).sort()) {\n                sorted[k] = (val as Record<string, unknown>)[k];\n            }\n\n            return sorted;\n        }\n\n        return val;\n    });\n}\n","/* eslint-disable unicorn/prefer-uint8array-hex -- Keep compatibility with the published Node.js runtime requirement. */\n/*\n * Copyright (c) 2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { parse as parseFlatted, stringify as stringifyFlatted } from 'flatted';\nimport { buildFilePath as joinFilePath, locateMany } from 'locter';\nimport crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\nimport {\n    CACHE_FILE_PREFIX,\n    CACHE_FILE_SUFFIX,\n    CACHE_SCHEMA_VERSION,\n} from './constants';\nimport { buildCacheOptions } from './utils';\nimport type {\n    CacheData,\n    CacheOptions,\n    CacheOptionsInput,\n    ICacheClient,\n} from './types';\n\nexport class CacheClient implements ICacheClient {\n    private readonly options: CacheOptions;\n\n    constructor(input?: string | boolean | CacheOptionsInput) {\n        this.options = buildCacheOptions(input);\n    }\n\n    // -------------------------------------------------------------------------\n\n    async save(data: CacheData): Promise<string | undefined> {\n        if (!this.options.enabled) {\n            return undefined;\n        }\n\n        await this.ensureDirectory();\n\n        const filePath = this.resolveFilePath(data.cacheKey);\n        // `flatted` is cycle-safe — it encodes self-references and back-edges\n        // as integer indices into a flat array. Well-formed metadata uses\n        // `refName` strings for cross-references and contains no cycles, but\n        // we use `flatted` defensively so a future regression cannot crash\n        // serialization or silently corrupt the cached graph.\n        const payload = stringifyFlatted(data);\n\n        // Atomic write: rename is atomic on POSIX, so concurrent generators\n        // either see the previous file or the new one — never a half-written\n        // truncation.\n        const tmpPath = `${filePath}.${process.pid}.${crypto.randomBytes(6).toString('hex')}.tmp`;\n\n        try {\n            await fs.promises.writeFile(tmpPath, payload);\n            await fs.promises.rename(tmpPath, filePath);\n        } catch (err) {\n            // Best-effort cleanup of the temp file if rename failed.\n            try {\n                await fs.promises.unlink(tmpPath);\n            } catch {\n                // ignore\n            }\n\n            throw err;\n        }\n\n        // Opportunistic eviction. Errors are ignored — eviction is a\n        // housekeeping concern, not a correctness one.\n        this.evict().catch((): void => undefined);\n\n        return filePath;\n    }\n\n    async get(cacheKey: string): Promise<CacheData | undefined> {\n        if (!this.options.enabled) {\n            return undefined;\n        }\n\n        const filePath = this.resolveFilePath(cacheKey);\n\n        let content: string;\n\n        try {\n            content = await fs.promises.readFile(filePath, { encoding: 'utf-8' });\n        } catch {\n            return undefined;\n        }\n\n        let cache: CacheData;\n\n        try {\n            cache = parseFlatted(content) as CacheData;\n        } catch {\n            // Corrupt file — drop it so the next save can replace cleanly.\n            await fs.promises.unlink(filePath).catch((): void => undefined);\n\n            return undefined;\n        }\n\n        if (\n            !cache ||\n            cache.cacheKey !== cacheKey ||\n            cache.schemaVersion !== CACHE_SCHEMA_VERSION\n        ) {\n            return undefined;\n        }\n\n        return cache;\n    }\n\n    // -------------------------------------------------------------------------\n\n    /**\n     * Prune cache files older than `maxAgeMs`. No-op when disabled or when\n     * `maxAgeMs <= 0`. Each unlink is best-effort — a concurrent generator\n     * may have already removed the file.\n     */\n    async evict(): Promise<void> {\n        if (!this.options.enabled || this.options.maxAgeMs <= 0) {\n            return;\n        }\n\n        const pattern = this.options.fileName ?? `${CACHE_FILE_PREFIX}*${CACHE_FILE_SUFFIX}`;\n\n        let entries: Awaited<ReturnType<typeof locateMany>>;\n\n        try {\n            entries = await locateMany(pattern, { cwd: this.options.directoryPath });\n        } catch {\n            return;\n        }\n\n        const cutoff = Date.now() - this.options.maxAgeMs;\n\n        await Promise.all(entries.map(async (entry) => {\n            const filePath = joinFilePath(entry);\n\n            try {\n                const stat = await fs.promises.stat(filePath);\n\n                if (stat.mtimeMs < cutoff) {\n                    await fs.promises.unlink(filePath);\n                }\n            } catch {\n                // ignore — file may have been removed by another process\n            }\n        }));\n    }\n\n    // -------------------------------------------------------------------------\n\n    private resolveFilePath(cacheKey: string): string {\n        // The internal pipeline always passes a sha256 hex digest, but the\n        // public `ICacheClient` accepts any string. Reject anything that\n        // could break out of `directoryPath` via `path.join`'s normalization\n        // (`../`, absolute paths, embedded separators, NUL bytes).\n        if (!CACHE_KEY_PATTERN.test(cacheKey)) {\n            throw new Error(`Invalid cacheKey: must match ${CACHE_KEY_PATTERN}`);\n        }\n\n        const fileName = this.options.fileName ??\n            `${CACHE_FILE_PREFIX}${cacheKey}${CACHE_FILE_SUFFIX}`;\n\n        return path.join(this.options.directoryPath, fileName);\n    }\n\n    private async ensureDirectory(): Promise<void> {\n        // Don't memoize — the directory may be removed externally (temp\n        // cleanup, another process) at any time. `mkdir(recursive: true)`\n        // is a no-op when the directory already exists, so re-running it\n        // on every save is cheap and self-healing.\n        await fs.promises.mkdir(this.options.directoryPath, { recursive: true });\n    }\n}\n\n// Hex digest from sha256 (64 chars) is the canonical caller, but allow\n// any printable ASCII without separators / dots up to a sane length so\n// custom callers (and the suffix-bearing tmp path) keep working.\nconst CACHE_KEY_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;\n","/*\n * Copyright (c) 2021-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from 'smob';\nimport { NodeBuilderFlags, displayPartsToString, isIdentifier } from 'typescript';\nimport type { ParameterDeclaration } from 'typescript';\nimport {\n    CollectionFormat,\n    ParamKind,\n    ParameterSource,\n    TypeName,\n    isArrayType,\n    isNestedObjectLiteralType,\n    isRefEnumType,\n    isRefObjectType,\n    isUnionType,\n    newParameterDraft,\n} from '@trapi/core';\nimport type {\n    ArrayParameter,\n    BaseType,\n    Extension,\n    IParameterGenerator,\n    NestedObjectLiteralType,\n    Parameter,\n    ParameterDraft,\n    RefObjectType,\n    Type,\n} from '@trapi/core';\nimport {\n    type ApplyHandlersOptions,\n    applyDecoratorHandlers,\n    applyJsDocHandlers,\n} from '../../../adapters/decorator';\nimport { getInitializerValue } from '../../../adapters/typescript/initializer';\nimport { getDeclarationValidators } from '../../../adapters/typescript/validator';\nimport {\n    JSDocTagName,\n    getJSDocTags,\n    hasJSDocTag,\n    transformJSDocComment,\n} from '../../../adapters/typescript/js-doc';\nimport { TypeNodeResolver } from '../../../adapters/typescript/resolver';\nimport { ParameterError } from '../../../core/error/parameter';\nimport type { IGeneratorContext } from '../../../core/metadata/types';\n\nconst BODY_SUPPORTED_METHODS = new Set(['delete', 'post', 'put', 'patch', 'get']);\n\nconst SUPPORTED_LEAF_TYPES = new Set<string>([\n    TypeName.STRING,\n    TypeName.INTEGER,\n    TypeName.LONG,\n    TypeName.FLOAT,\n    TypeName.DOUBLE,\n    TypeName.DATE,\n    TypeName.DATETIME,\n    TypeName.BUFFER,\n    TypeName.BOOLEAN,\n    TypeName.ENUM,\n]);\n\nexport class ParameterGenerator implements IParameterGenerator {\n    private readonly parameter: ParameterDeclaration;\n\n    private readonly method: string;\n\n    private readonly paths: string[];\n\n    private readonly current: IGeneratorContext;\n\n    constructor(\n        parameter: ParameterDeclaration,\n        method: string,\n        paths: string[],\n        current: IGeneratorContext,\n    ) {\n        this.parameter = parameter;\n        this.method = method;\n        this.paths = paths.length === 0 ? [''] : paths;\n        this.current = current;\n    }\n\n    public generate(): Parameter[] {\n        const parameterName = this.getParameterName();\n        const draft = newParameterDraft({ parameterName });\n\n        const options = this.applyOptions(parameterName);\n\n        applyDecoratorHandlers(this.parameter, this.current.registry.parameters, draft, options);\n        applyJsDocHandlers(this.parameter, this.current.registry.parameterJsDoc, draft, options);\n\n        // A context parameter (framework request/response/next objects) produces\n        // no OpenAPI parameter. Stop before resolving its type: resolution\n        // registers every named type it reaches, so the framework's whole type\n        // graph would land in the reference-type map and in the document's\n        // schemas without anything referencing it.\n        if (draft.in === ParamKind.Context) {\n            return [];\n        }\n\n        // TS-resolved type\n        const type = this.resolveType();\n\n        draft.type = type;\n\n        // Description from TS symbol's documentation comment.\n        const description = this.getDescription();\n\n        if (description) {\n            draft.description = description;\n        }\n\n        // Deprecation: handler may have set it; otherwise check JSDoc on parameter.\n        if (draft.deprecated === undefined && hasJSDocTag(this.parameter, JSDocTagName.DEPRECATED)) {\n            draft.deprecated = true;\n        }\n\n        // Default value from TS initializer.\n        const defaultValue = getInitializerValue(this.parameter.initializer, this.current.typeChecker, type);\n\n        if (defaultValue !== undefined) {\n            draft.default = defaultValue;\n        }\n\n        // Required: TS optionality and presence of initializer.\n        draft.required = !this.parameter.questionToken && !this.parameter.initializer;\n\n        // Examples from method-level JSDoc @example tags scoped to this parameter.\n        const { examples, exampleLabels } = this.getJsDocExamples(parameterName);\n\n        if (examples) {\n            draft.examples = examples.map((value) => ({ value }));\n            draft.exampleLabels = (exampleLabels ?? []).filter((l): l is string => l !== undefined);\n        }\n\n        // Declaration-level validators (e.g., @MaxLength annotations on the parameter).\n        Object.assign(draft.validators, getDeclarationValidators(this.parameter, parameterName));\n\n        // Apply default `in` if no handler claimed.\n        if (!draft.in) {\n            if (!BODY_SUPPORTED_METHODS.has(this.method)) {\n                throw ParameterError.methodUnsupported({\n                    decoratorName: 'Body',\n                    propertyName: parameterName,\n                    method: this.method,\n                    node: this.parameter,\n                });\n            }\n\n            draft.in = ParamKind.Body;\n        }\n\n        // Body validation requires the method to support a body.\n        if ((draft.in === ParamKind.Body || draft.in === ParamKind.BodyProp) &&\n            !BODY_SUPPORTED_METHODS.has(this.method)) {\n            throw ParameterError.methodUnsupported({\n                decoratorName: 'Body',\n                propertyName: draft.name,\n                method: this.method,\n                node: this.parameter,\n            });\n        }\n\n        return this.finalize(draft, type, parameterName, examples, exampleLabels);\n    }\n\n    private finalize(\n        draft: ParameterDraft,\n        type: Type,\n        parameterName: string,\n        examples: unknown[] | undefined,\n        exampleLabels: Array<string | undefined> | undefined,\n    ): Parameter[] {\n        const kind = draft.in!;\n        const wrappedExamples = examples ? examples.map((value) => ({ value })) : undefined;\n        const filteredLabels = exampleLabels?.filter((l): l is string => l !== undefined);\n\n        // Object decomposition for kinds that can carry an object payload.\n        if ((kind === ParameterSource.QUERY || kind === ParameterSource.PATH) &&\n            (isNestedObjectLiteralType(type) || isRefObjectType(type))) {\n            const decomposed = this.decomposeObject(type, {\n                in: kind === ParameterSource.QUERY ? ParameterSource.QUERY_PROP : ParameterSource.PATH,\n                examples: wrappedExamples,\n                exampleLabels: filteredLabels,\n                extensions: draft.extensions,\n            });\n\n            if (kind === ParameterSource.PATH) {\n                this.validatePathDecomposition(decomposed);\n            }\n\n            return decomposed;\n        }\n\n        // A `query` draft marks the whole query bag. The object case decomposed\n        // above; every other supported shape already binds exactly one named key,\n        // so resolve it here too — `finalize` must never return `in: 'query'`,\n        // which both swagger emitters group away and drop (#910).\n        // ponytail: mutate `draft.in`, not the local `kind` — the branch tests and\n        // the '@Query' vs '@QueryProp' error labels below still read `kind`.\n        if (kind === ParameterSource.QUERY) {\n            draft.in = ParameterSource.QUERY_PROP;\n        }\n\n        if ((kind === ParameterSource.QUERY || kind === ParameterSource.QUERY_PROP) &&\n            isArrayType(type)) {\n            if (!this.isLeafTypeSupported(type.elementType)) {\n                throw ParameterError.typeUnsupported({\n                    decoratorName: kind === ParameterSource.QUERY ? 'Query' : 'QueryProp',\n                    propertyName: draft.name,\n                    type: type.elementType,\n                    node: this.parameter,\n                });\n            }\n\n            const arrayParameter: ArrayParameter = {\n                ...this.draftToParameter(draft),\n                collectionFormat: draft.collectionFormat ?? CollectionFormat.MULTI,\n                type,\n            };\n\n            return [arrayParameter];\n        }\n\n        if ((kind === ParameterSource.QUERY || kind === ParameterSource.QUERY_PROP) &&\n            !this.isLeafOrEnumOrUnion(type)) {\n            throw ParameterError.typeUnsupported({\n                decoratorName: kind === ParameterSource.QUERY ? 'Query' : 'QueryProp',\n                propertyName: draft.name,\n                type,\n                node: this.parameter,\n            });\n        }\n\n        if (kind === ParameterSource.PATH) {\n            this.validatePathName(draft.name, parameterName);\n        }\n\n        return [this.draftToParameter(draft)];\n    }\n\n    private draftToParameter(draft: ParameterDraft): Parameter {\n        return {\n            allowEmptyValue: draft.allowEmptyValue,\n            collectionFormat: draft.collectionFormat,\n            default: draft.default,\n            description: draft.description,\n            examples: draft.examples.length > 0 ? draft.examples : undefined,\n            exampleLabels: draft.exampleLabels.length > 0 ? draft.exampleLabels : undefined,\n            extensions: draft.extensions,\n            in: draft.in!,\n            maxItems: draft.maxItems,\n            minItems: draft.minItems,\n            name: draft.name,\n            parameterName: draft.parameterName,\n            required: draft.required,\n            type: draft.type!,\n            deprecated: draft.deprecated,\n            validators: draft.validators,\n        };\n    }\n\n    private decomposeObject(\n        type: NestedObjectLiteralType | RefObjectType,\n        details: {\n            in: `${ParameterSource}`;\n            examples: { value: unknown }[] | undefined;\n            exampleLabels: string[] | undefined;\n            extensions: Extension[];\n        },\n    ): Parameter[] {\n        if (type.properties.length === 0) {\n            return [];\n        }\n\n        const parameterName = this.getParameterName();\n        const initializerValue = getInitializerValue(this.parameter.initializer, this.current.typeChecker, type);\n        const description = this.getDescription();\n        const isParamOptional = !!this.parameter.questionToken;\n        const isParamDeprecated = hasJSDocTag(this.parameter, JSDocTagName.DEPRECATED);\n\n        const output: Parameter[] = [];\n\n        for (const property of type.properties) {\n            let propertyDefaultValue = property.default;\n\n            if (typeof propertyDefaultValue === 'undefined' && isObject(initializerValue)) {\n                propertyDefaultValue = (initializerValue as Record<string, unknown>)[property.name];\n            }\n\n            const required = isParamOptional ? false : property.required;\n\n            output.push({\n                extensions: [...details.extensions],\n                in: details.in,\n                examples: details.examples,\n                exampleLabels: details.exampleLabels,\n                default: propertyDefaultValue,\n                description: property.description || description,\n                name: property.name,\n                parameterName,\n                required,\n                type: property.type,\n                deprecated: property.deprecated || isParamDeprecated,\n                validators: {},\n            });\n        }\n\n        return output;\n    }\n\n    private pathContainsParam(name: string): boolean {\n        // Match `{name}` literally — curly braces are their own boundaries.\n        // For `:name`, require a word boundary after the name so `:id` doesn't\n        // match `:id2` (substring), but it still matches when path-to-regexp\n        // modifiers/constraints follow the name (`:id?`, `:id*`, `:id(\\\\d+)`).\n        // eslint-disable-next-line unicorn/prefer-regexp-escape -- Published consumers support Node 22, which has no RegExp.escape.\n        const escaped = name.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n        const colonPattern = new RegExp(`:${escaped}\\\\b`);\n        const bracePattern = `{${name}}`;\n\n        for (const p of this.paths) {\n            if (p.includes(bracePattern) || colonPattern.test(p)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    private validatePathDecomposition(decomposed: Parameter[]): void {\n        for (const element of decomposed) {\n            if (!this.pathContainsParam(element.name)) {\n                throw ParameterError.invalidPathMatch({\n                    decoratorName: 'Path',\n                    propertyName: element.name,\n                    path: this.paths.join(' | '),\n                    node: this.parameter,\n                });\n            }\n        }\n    }\n\n    private validatePathName(name: string, parameterName: string): void {\n        const candidate = name || parameterName;\n\n        if (!this.pathContainsParam(candidate)) {\n            throw ParameterError.invalidPathMatch({\n                decoratorName: 'Path',\n                propertyName: candidate,\n                path: this.paths.join(' | '),\n                node: this.parameter,\n            });\n        }\n    }\n\n    private isLeafTypeSupported(type: BaseType): boolean {\n        return SUPPORTED_LEAF_TYPES.has(type.typeName);\n    }\n\n    private isLeafOrEnumOrUnion(type: Type): boolean {\n        return SUPPORTED_LEAF_TYPES.has(type.typeName) ||\n            isRefEnumType(type) ||\n            isUnionType(type);\n    }\n\n    private resolveType(): Type {\n        let typeNode = this.parameter.type;\n\n        if (!typeNode) {\n            const t = this.current.typeChecker.getTypeAtLocation(this.parameter);\n\n            typeNode = this.current.typeChecker.typeToTypeNode(\n                t,\n                undefined,\n                NodeBuilderFlags.NoTruncation,\n            );\n        }\n\n        if (!typeNode) {\n            throw new ParameterError({ message: `Could not resolve type for parameter '${this.getParameterName()}'.` });\n        }\n\n        return new TypeNodeResolver(typeNode, this.current, this.parameter).resolve();\n    }\n\n    private getParameterName(): string {\n        if (!isIdentifier(this.parameter.name)) {\n            throw new ParameterError({ message: 'Destructured parameters are not supported. Use a simple identifier name.' });\n        }\n\n        return this.parameter.name.text;\n    }\n\n    private getDescription(): string {\n        const symbol = this.current.typeChecker.getSymbolAtLocation(this.parameter.name);\n\n        if (symbol) {\n            const comments = symbol.getDocumentationComment(this.current.typeChecker);\n\n            if (comments.length > 0) {\n                return displayPartsToString(comments);\n            }\n        }\n\n        return '';\n    }\n\n    private getJsDocExamples(parameterName: string): {\n        examples: unknown[] | undefined;\n        exampleLabels: Array<string | undefined> | undefined;\n    } {\n        const exampleLabels: Array<string | undefined> = [];\n        const tags = getJSDocTags(this.parameter.parent, (tag) => {\n            const comment = transformJSDocComment(tag.comment);\n            const isExample = (tag.tagName.text === JSDocTagName.EXAMPLE ||\n                    tag.tagName.escapedText === JSDocTagName.EXAMPLE) &&\n                !!comment && comment.startsWith(parameterName);\n\n            if (isExample && comment) {\n                const head = comment.split(' ')[0] ?? '';\n                const hasExampleLabel = head.indexOf('.') > 0;\n\n                exampleLabels.push(hasExampleLabel ?\n                    head.split('.').slice(1).join('.') :\n                    undefined);\n            }\n\n            return isExample ?? false;\n        });\n\n        const examples = tags.map((tag) => (\n            transformJSDocComment(tag.comment) || '')\n            .replace(`${transformJSDocComment(tag.comment)?.split(' ')[0] || ''}`, '')\n            .replace(/\\r/g, ''));\n\n        if (examples.length === 0) {\n            return { examples: undefined, exampleLabels: undefined };\n        }\n\n        try {\n            return {\n                examples: examples.map((example) => JSON.parse(example)),\n                exampleLabels,\n            };\n        } catch {\n            throw ParameterError.invalidExampleSchema();\n        }\n    }\n\n    private applyOptions(parameterName: string): ApplyHandlersOptions {\n        return {\n            target: 'parameter',\n            host: { name: parameterName, parentName: this.method },\n            resolveTypeNode: (n) => new TypeNodeResolver(n, this.current).resolve(),\n            typeChecker: this.current.typeChecker,\n            parameterType: () => this.parameter.type ?\n                new TypeNodeResolver(this.parameter.type, this.current).resolve() :\n                undefined,\n            onUnmatchedDecorator: (this.current.config.strict || this.current.config.onUnmatchedDecorator) ?\n                (report) => this.current.reportUnmatchedDecorator?.(report) :\n                undefined,\n        };\n    }\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n/**\n * The default response description per status, used for an explicit\n * `successStatus`: the HTTP reason phrase, except that `200` and `204` keep\n * the spelling existing documents carry (`Ok`, `No content`).\n */\nexport const SuccessStatusDescription = {\n    100: 'Continue',\n    101: 'Switching Protocols',\n    102: 'Processing',\n    103: 'Early Hints',\n    200: 'Ok',\n    201: 'Created',\n    202: 'Accepted',\n    203: 'Non-Authoritative Information',\n    204: 'No content',\n    205: 'Reset Content',\n    206: 'Partial Content',\n    207: 'Multi-Status',\n    208: 'Already Reported',\n    226: 'IM Used',\n    300: 'Multiple Choices',\n    301: 'Moved Permanently',\n    302: 'Found',\n    303: 'See Other',\n    304: 'Not Modified',\n    305: 'Use Proxy',\n    307: 'Temporary Redirect',\n    308: 'Permanent Redirect',\n    400: 'Bad Request',\n    401: 'Unauthorized',\n    402: 'Payment Required',\n    403: 'Forbidden',\n    404: 'Not Found',\n    405: 'Method Not Allowed',\n    406: 'Not Acceptable',\n    407: 'Proxy Authentication Required',\n    408: 'Request Timeout',\n    409: 'Conflict',\n    410: 'Gone',\n    411: 'Length Required',\n    412: 'Precondition Failed',\n    413: 'Content Too Large',\n    414: 'URI Too Long',\n    415: 'Unsupported Media Type',\n    416: 'Range Not Satisfiable',\n    417: 'Expectation Failed',\n    418: 'I\\'m a teapot',\n    421: 'Misdirected Request',\n    422: 'Unprocessable Content',\n    423: 'Locked',\n    424: 'Failed Dependency',\n    425: 'Too Early',\n    426: 'Upgrade Required',\n    428: 'Precondition Required',\n    429: 'Too Many Requests',\n    431: 'Request Header Fields Too Large',\n    451: 'Unavailable For Legal Reasons',\n    500: 'Internal Server Error',\n    501: 'Not Implemented',\n    502: 'Bad Gateway',\n    503: 'Service Unavailable',\n    504: 'Gateway Timeout',\n    505: 'HTTP Version Not Supported',\n    506: 'Variant Also Negotiates',\n    507: 'Insufficient Storage',\n    508: 'Loop Detected',\n    510: 'Not Extended',\n    511: 'Network Authentication Required',\n} as const;\n\n/**\n * Statuses that never carry a body (RFC 9110 §15.3.5, §15.3.6, §15.4.5): a\n * `successStatus` among them documents no schema, whatever the return type.\n */\nexport const NO_CONTENT_STATUSES = ['204', '205', '304'] as const;\n","/* eslint-disable unicorn/prefer-error-is-error -- Keep compatibility with the published Node.js runtime requirement. */\n/*\n * Copyright (c) 2021-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport path from 'node:path';\nimport { NodeBuilderFlags } from 'typescript';\nimport type {\n    ClassDeclaration,\n    Identifier,\n    MethodDeclaration,\n    TypeNode,\n} from 'typescript';\nimport {\n    ParameterSource,\n    isNeverType,\n    isVoidType,\n    newMethodDraft,\n} from '@trapi/core';\nimport type {\n    BaseType,\n    Example,\n    Method,\n    Parameter,\n    Response,\n    Type,\n} from '@trapi/core';\nimport {\n    type ApplyHandlersOptions,\n    applyDecoratorHandlers,\n    applyJsDocHandlers,\n} from '../../../adapters/decorator';\nimport { GeneratorErrorCode } from '../../../core/error/generator-codes';\nimport { GeneratorError } from '../../../core/error/generator';\nimport { TypeNodeResolver } from '../../../adapters/typescript/resolver';\nimport {\n    JSDocTagName,\n    getJSDocDescription,\n    getJSDocTagComment,\n} from '../../../adapters/typescript/js-doc';\nimport { normalizePath } from '../../../core/utils';\nimport type { IGeneratorContext } from '../../../core/metadata/types';\nimport { ParameterGenerator } from '../parameter';\nimport { NO_CONTENT_STATUSES, SuccessStatusDescription } from './constants';\n\n// One concrete HTTP status code: a success status is never a range, and\n// Swagger 2.0 accepts no range as a response key.\nconst SUCCESS_STATUS_PATTERN = /^[1-5]\\d\\d$/;\n\nexport class MethodGenerator {\n    protected readonly node: MethodDeclaration;\n\n    protected readonly current: IGeneratorContext;\n\n    constructor(node: MethodDeclaration, current: IGeneratorContext) {\n        this.node = node;\n        this.current = current;\n    }\n\n    public getMethodName(): string {\n        const identifier = this.node.name as Identifier;\n\n        return identifier.text;\n    }\n\n    public generate(controllerPaths: string[], controllerSuccessProduces: string[] = []): Method | null {\n        const name = this.getMethodName();\n        const draft = newMethodDraft({ name });\n\n        const options = this.applyOptions();\n\n        applyDecoratorHandlers(this.node, this.current.registry.methods, draft, options);\n        applyJsDocHandlers(this.node, this.current.registry.methodJsDoc, draft, options);\n\n        // Not a route method (no HTTP verb decorator matched), or hidden.\n        if ((!draft.verb) || (draft.hidden)) {\n            return null;\n        }\n\n        // Memoised: a finalizer asking for the return type and the default\n        // response below share one resolution.\n        let returnType: Type | undefined;\n        const resolveReturnType = (): Type => {\n            returnType ??= this.resolveReturnType();\n\n            return returnType;\n        };\n\n        for (const finalize of this.current.registry.methodFinalizers ?? []) {\n            finalize({ host: options.host, returnType: resolveReturnType }, draft);\n        }\n\n        // A finalizer may have dropped the verb or hidden the method.\n        if ((!draft.verb) || (draft.hidden)) {\n            return null;\n        }\n\n        this.assertSuccessStatus(draft.successStatus);\n\n        // Only an explicit no-content status drops the body: an implicit 204\n        // (a void method) keeps documenting its void schema as it always has.\n        const noContent = isNoContentStatus(draft.successStatus);\n\n        // Build responses: handler-supplied first, then a derived default that\n        // carries any handler-contributed default-response examples.\n        const defaultResponse = buildDefaultResponse({\n            returnType: resolveReturnType(),\n            examples: draft.defaultResponseExamples,\n            successStatus: draft.successStatus,\n            noContent,\n        });\n\n        // A method's own list overrides the controller's; an explicit\n        // no-content status documents no body to describe. `?? []`: the type\n        // requires the list, but a finalizer or a hand-built draft may unset it.\n        const ownSuccessProduces = draft.successProduces ?? [];\n        let successProduces = ownSuccessProduces.length > 0 ? ownSuccessProduces : controllerSuccessProduces;\n\n        if (noContent) {\n            successProduces = [];\n        }\n\n        const responses = mergeDefaultResponse(\n            draft.responses,\n            defaultResponse,\n            draft.successStatus !== undefined,\n            successProduces,\n        );\n\n        // Walk parameters. Handler-contributed ones are appended after the\n        // signature-derived ones, so a handler can add to the operation but\n        // never displace what the method's own arguments put there. They skip\n        // ParameterGenerator entirely — there is no declaration behind them.\n        const parameters = [\n            ...this.buildParameters(controllerPaths, draft.path, draft.verb),\n            ...draft.parameters,\n        ];\n\n        // Description from leading JSDoc comment (no v2 handler covers this since it\n        // isn't a tagged value).\n        const description = getJSDocDescription(this.node) ?? draft.description;\n        const summary = draft.summary ?? getJSDocTagComment(this.node, JSDocTagName.SUMMARY);\n\n        return {\n            consumes: draft.consumes,\n            deprecated: draft.deprecated ?? false,\n            description: description ?? '',\n            extensions: draft.extensions,\n            hidden: draft.hidden,\n            method: draft.verb,\n            name,\n            operationId: draft.operationId,\n            path: normalizePath(draft.path),\n            produces: draft.produces,\n            responses,\n            security: draft.security,\n            summary,\n            tags: draft.tags,\n            type: resolveReturnType(),\n            parameters,\n        };\n    }\n\n    /**\n     * `successStatus` comes from handler code, so a bad value (an empty string,\n     * `String(undefined)` from a missing decorator argument) would otherwise\n     * become a response key no OpenAPI document accepts.\n     */\n    private assertSuccessStatus(status: string | undefined): void {\n        if (status === undefined || SUCCESS_STATUS_PATTERN.test(status)) {\n            return;\n        }\n\n        const parentName = (this.node.parent as ClassDeclaration).name?.text;\n\n        throw new GeneratorError({\n            message: `Invalid success status '${status}' on '${parentName}.${this.getMethodName()}': ` +\n                'a three-digit HTTP status code such as \\'201\\' or \\'202\\' is required.',\n            code: GeneratorErrorCode.SUCCESS_STATUS_INVALID,\n        });\n    }\n\n    private applyOptions(): ApplyHandlersOptions {\n        const parentName = (this.node.parent as ClassDeclaration).name?.text;\n\n        return {\n            target: 'method',\n            host: { name: this.getMethodName(), parentName },\n            resolveTypeNode: (n: TypeNode) => new TypeNodeResolver(n, this.current).resolve(),\n            typeChecker: this.current.typeChecker,\n            onUnmatchedDecorator: (this.current.config.strict || this.current.config.onUnmatchedDecorator) ?\n                (report) => this.current.reportUnmatchedDecorator?.(report) :\n                undefined,\n        };\n    }\n\n    private resolveReturnType(): Type {\n        let nodeType = this.node.type;\n\n        if (!nodeType) {\n            const { typeChecker } = this.current;\n            const signature = typeChecker.getSignatureFromDeclaration(this.node);\n\n            if (!signature) {\n                throw new GeneratorError({ message: 'Could not resolve method signature.' });\n            }\n\n            const implicitType = typeChecker.getReturnTypeOfSignature(signature);\n\n            nodeType = typeChecker.typeToTypeNode(implicitType, undefined, NodeBuilderFlags.NoTruncation) as TypeNode;\n        }\n\n        return new TypeNodeResolver(nodeType, this.current).resolve();\n    }\n\n    private buildParameters(\n        controllerPaths: string[],\n        methodPath: string,\n        verb: string,\n    ): Parameter[] {\n        const controllerId = (this.node.parent as ClassDeclaration).name as Identifier;\n        const methodId = this.node.name as Identifier;\n        // Build the union of every (controllerPath × methodPath) combination so\n        // path-parameter validation accepts a parameter that's present in any\n        // mount (a controller can mount at /roles AND /realms/:id/roles).\n        const fullPaths = (controllerPaths.length === 0 ? [''] : controllerPaths)\n            .map((cp) => path.posix.join('/', cp, methodPath));\n\n        const output: Parameter[] = [];\n        let bodyParameterCount = 0;\n        let bodyPropParameterCount = 0;\n        let formParameterCount = 0;\n\n        for (const [i, declaration] of this.node.parameters.entries()) {\n            try {\n                const generator = new ParameterGenerator(\n                    declaration,\n                    verb,\n                    fullPaths,\n                    this.current,\n                );\n\n                const parameters = generator.generate();\n\n                for (const parameter of parameters) {\n                    if (parameter.in === ParameterSource.BODY) {\n                        bodyParameterCount += 1;\n                    }\n\n                    if (parameter.in === ParameterSource.BODY_PROP) {\n                        bodyPropParameterCount += 1;\n                    }\n\n                    if (parameter.in === ParameterSource.FORM_DATA) {\n                        formParameterCount += 1;\n                    }\n\n                    output.push(parameter);\n                }\n            } catch (e) {\n                const causeMsg = (e instanceof Error) ? `: ${e.message}` : '';\n                throw new GeneratorError({\n                    message: `Parameter generation failed for '${controllerId.text}.${methodId.text}' argument index ${i}${causeMsg}`,\n                    code: GeneratorErrorCode.PARAMETER_GENERATION_FAILED,\n                    cause: e,\n                });\n            }\n        }\n\n        if (bodyParameterCount > 1) {\n            throw new GeneratorError({\n                message: `Only one body parameter allowed in '${controllerId.text}.${methodId.text}' method.`,\n                code: GeneratorErrorCode.BODY_PARAMETER_DUPLICATE,\n            });\n        }\n\n        // `@BodyProp` names a key *in* the body, so it conflicts with a form-encoded\n        // request exactly as `@Body` does. Counted separately because the check\n        // above rejects a second *body*, while several `@BodyProp` are legal.\n        if ((bodyParameterCount > 0 || bodyPropParameterCount > 0) && formParameterCount > 0) {\n            throw new GeneratorError({\n                message: `Cannot mix body and form parameters in '${controllerId.text}.${methodId.text}' method.`,\n                code: GeneratorErrorCode.BODY_FORM_CONFLICT,\n            });\n        }\n\n        return output;\n    }\n}\n\ntype DefaultResponseInput = {\n    returnType: BaseType,\n    examples: Example[],\n    successStatus?: string,\n    /**\n     * `successStatus` is a status that never carries a body.\n     */\n    noContent: boolean,\n};\n\nfunction buildDefaultResponse(input: DefaultResponseInput): Response {\n    const isVoid = isVoidType(input.returnType);\n    const explicit = input.successStatus !== undefined;\n    const status = input.successStatus ?? (isVoid ? '204' : '200');\n\n    let description: string;\n\n    if (explicit) {\n        description = describeStatus(status);\n    } else {\n        // Unset: keep the descriptions documents have always carried.\n        description = isVoid ? 'No content' : 'Ok';\n    }\n\n    // No `schema` key at all under a no-content status, so a fresh result\n    // and one read back from the cache have the same shape.\n    return {\n        description,\n        examples: input.examples,\n        ...(input.noContent ? {} : { schema: input.returnType }),\n        status,\n        name: status,\n    };\n}\n\n/**\n * Gives the response carrying the return type the success media types, but\n * only when it documents a body and declares no media types of its own. An\n * empty list adds no key, so output without `successProduces` is unchanged.\n * Duplicates are dropped, first occurrence kept.\n */\nfunction attachSuccessProduces(response: Response, successProduces: string[]): void {\n    if (successProduces.length === 0 || (response.produces && response.produces.length > 0)) {\n        return;\n    }\n\n    // `void` and `never` are body-less: the emitters document no schema.\n    if (!response.schema || isVoidType(response.schema) || isNeverType(response.schema)) {\n        return;\n    }\n\n    response.produces = [...new Set(successProduces)];\n}\n\nfunction isNoContentStatus(status: string | undefined): boolean {\n    return status !== undefined && (NO_CONTENT_STATUSES as readonly string[]).includes(status);\n}\n\nfunction describeStatus(status: string): string {\n    return (SuccessStatusDescription as Record<string, string>)[status] ?? 'Ok';\n}\n\n/**\n * @param explicit - the status came from `draft.successStatus`: a handler\n * response declared at that status then carries the return type, so it gets\n * the schema when it has none. Without an opt-in a handler response at\n * `200`/`204` stays as declared.\n */\nfunction mergeDefaultResponse(\n    handlerResponses: Response[],\n    defaultResponse: Response,\n    explicit: boolean,\n    successProduces: string[],\n): Response[] {\n    // The last one declared at the status: both emitters keep that one when\n    // a status is declared more than once.\n    const target = handlerResponses.filter((r) => r.status === defaultResponse.status).at(-1);\n\n    if (!target) {\n        attachSuccessProduces(defaultResponse, successProduces);\n\n        return [...handlerResponses, defaultResponse];\n    }\n\n    if (defaultResponse.examples && defaultResponse.examples.length > 0 &&\n        (!target.examples || target.examples.length === 0)) {\n        target.examples = defaultResponse.examples;\n    }\n\n    // An explicit no-content status leaves `defaultResponse.schema` unset, so\n    // the handler response stays without a body too.\n    if (explicit && !target.schema && defaultResponse.schema) {\n        target.schema = defaultResponse.schema;\n    }\n\n    // Every handler response at the status, not only the first: both\n    // emitters keep the last one. Each is judged on its own final schema, as\n    // a handler response may document a body even when the method itself\n    // returns `void`.\n    for (const response of handlerResponses) {\n        if (response.status === defaultResponse.status) {\n            attachSuccessProduces(response, successProduces);\n        }\n    }\n\n    return handlerResponses;\n}\n","/*\n * Copyright (c) 2021-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type {\n    ClassDeclaration,\n    Expression,\n    MethodDeclaration,\n    TypeNode,\n} from 'typescript';\nimport {\n    SymbolFlags,\n    SyntaxKind,\n    isClassDeclaration,\n    isMethodDeclaration,\n} from 'typescript';\nimport { newControllerDraft } from '@trapi/core';\nimport {\n    type ApplyHandlersOptions,\n    applyDecoratorHandlers,\n    applyJsDocHandlers,\n} from '../../../adapters/decorator';\nimport { TypeNodeResolver } from '../../../adapters/typescript/resolver';\nimport { isResolverError } from '../../../core/error/resolver';\nimport { GeneratorErrorCode } from '../../../core/error/generator-codes';\nimport { GeneratorError, isGeneratorError } from '../../../core/error/generator';\nimport { normalizePath } from '../../../core/utils';\nimport type { Controller, IControllerGenerator, Method } from '@trapi/core';\nimport { MethodGenerator } from '../method';\nimport type { IGeneratorContext } from '../../../core/metadata/types';\n\nexport class ControllerGenerator implements IControllerGenerator {\n    protected readonly node: ClassDeclaration;\n\n    protected readonly current: IGeneratorContext;\n\n    constructor(node: ClassDeclaration, current: IGeneratorContext) {\n        this.node = node;\n        this.current = current;\n    }\n\n    public isValid(): boolean {\n        // Whether a class is a controller depends on whether any registry handler\n        // matches one of its decorators (e.g. `@Controller`). Resolving that\n        // requires running handler dispatch — which `generate()` does — so\n        // `isValid()` only screens out unnamed classes here. `generate()` returns\n        // `null` when no controller handler claimed the node.\n        return !!this.node.name;\n    }\n\n    public generate(): Controller | null {\n        if (!this.node.parent) {\n            throw new GeneratorError({\n                message: 'Controller node doesn\\'t have a valid parent source file.',\n                code: GeneratorErrorCode.CONTROLLER_NO_SOURCE_FILE,\n            });\n        }\n\n        if (!this.node.name) {\n            throw new GeneratorError({\n                message: 'Controller node doesn\\'t have a valid name.',\n                code: GeneratorErrorCode.CONTROLLER_NO_NAME,\n            });\n        }\n\n        const sourceFile = this.node.parent.getSourceFile();\n        const draft = newControllerDraft({\n            name: this.node.name.text,\n            location: sourceFile.fileName,\n        });\n\n        const options = this.applyOptions();\n\n        applyDecoratorHandlers(this.node, this.current.registry.controllers, draft, options);\n        applyJsDocHandlers(this.node, this.current.registry.controllerJsDoc, draft, options);\n\n        // A class is a controller iff a controller-target handler claimed it\n        // (convention: the Controller handler sets `draft.paths` to a non-undefined value).\n        if (draft.paths === undefined) {\n            return null;\n        }\n\n        // Only for a claimed controller (never for every class in the\n        // program), and before paths are normalised and methods generated, so\n        // the finalizer settles the state both build on.\n        for (const finalize of this.current.registry.controllerFinalizers ?? []) {\n            finalize({ host: options.host }, draft);\n        }\n\n        // A finalizer may have un-claimed the class, as no handler did.\n        if (draft.paths === undefined) {\n            return null;\n        }\n\n        // Normalize and dedupe — a user passing `@Controller(['/roles', '/roles'])`\n        // (or paths that collide after normalization) shouldn't produce duplicate\n        // OpenAPI path keys downstream.\n        const normalized = (draft.paths.length === 0 ? [''] : draft.paths).map(normalizePath);\n        const paths = [...new Set(normalized)];\n        // `?? []`: the type requires the list, but a finalizer may unset it.\n        const methods = this.buildMethods(paths, draft.successProduces ?? []);\n\n        return {\n            consumes: draft.consumes,\n            deprecated: draft.deprecated,\n            extensions: draft.extensions,\n            hidden: draft.hidden,\n            location: draft.location,\n            name: draft.name,\n            paths,\n            produces: draft.produces,\n            responses: draft.responses,\n            security: draft.security,\n            tags: draft.tags,\n            methods,\n        };\n    }\n\n    private applyOptions(): ApplyHandlersOptions {\n        return {\n            target: 'class',\n            host: { name: this.node.name!.text },\n            resolveTypeNode: (n: TypeNode) => new TypeNodeResolver(n, this.current).resolve(),\n            typeChecker: this.current.typeChecker,\n            onUnmatchedDecorator: (this.current.config.strict || this.current.config.onUnmatchedDecorator) ?\n                (report) => this.current.reportUnmatchedDecorator?.(report) :\n                undefined,\n        };\n    }\n\n    protected buildMethods(controllerPaths: string[], successProduces: string[] = []): Method[] {\n        const set = new Set<string>();\n        const output: Method[] = [];\n\n        // Process own methods first\n        for (const member of this.node.members) {\n            if (!isMethodDeclaration(member)) {\n                continue;\n            }\n\n            const generator = new MethodGenerator(member, this.current);\n            const methodName = generator.getMethodName();\n\n            if (set.has(methodName)) {\n                continue;\n            }\n\n            const method = generator.generate(controllerPaths, successProduces);\n\n            if (!method) {\n                continue;\n            }\n\n            set.add(methodName);\n            output.push(method);\n        }\n\n        // Then process inherited methods from base classes\n        const inheritedMethods = this.collectInheritedMethodDeclarations(this.node);\n\n        for (const node of inheritedMethods) {\n            const generator = new MethodGenerator(node, this.current);\n            const methodName = generator.getMethodName();\n\n            if (set.has(methodName)) {\n                continue;\n            }\n\n            try {\n                const method = generator.generate(controllerPaths, successProduces);\n\n                if (!method) {\n                    continue;\n                }\n\n                set.add(methodName);\n                output.push(method);\n            } catch (error: unknown) {\n                // Skip inherited methods that fail due to unresolvable generic\n                // type parameters (e.g., return type T or parameter type T from\n                // generic base classes). Rethrow everything else.\n                if (\n                    isResolverError(error) ||\n                    (isGeneratorError(error) &&\n                        error.code === GeneratorErrorCode.PARAMETER_GENERATION_FAILED)\n                ) {\n                    continue;\n                }\n\n                throw error;\n            }\n        }\n\n        return output;\n    }\n\n    private collectInheritedMethodDeclarations(node: ClassDeclaration): MethodDeclaration[] {\n        const methods: MethodDeclaration[] = [];\n\n        if (!node.heritageClauses) {\n            return methods;\n        }\n\n        for (const clause of node.heritageClauses) {\n            if (clause.token !== SyntaxKind.ExtendsKeyword) {\n                continue;\n            }\n\n            for (const type of clause.types) {\n                const baseDeclaration = this.resolveBaseClassDeclaration(type.expression);\n\n                if (!baseDeclaration) {\n                    continue;\n                }\n\n                // Collect direct methods from the base class\n                for (const member of baseDeclaration.members) {\n                    if (isMethodDeclaration(member)) {\n                        methods.push(member);\n                    }\n                }\n\n                // Recurse to pick up the full inheritance chain\n                methods.push(...this.collectInheritedMethodDeclarations(baseDeclaration));\n            }\n        }\n\n        return methods;\n    }\n\n    private resolveBaseClassDeclaration(expression: Expression): ClassDeclaration | undefined {\n        let symbol = this.current.typeChecker.getSymbolAtLocation(expression);\n\n        if (!symbol) {\n            return undefined;\n        }\n\n        // Follow import aliases to the original declaration\n        if (symbol.flags & SymbolFlags.Alias) {\n            symbol = this.current.typeChecker.getAliasedSymbol(symbol);\n        }\n\n        const declarations = symbol.getDeclarations();\n\n        if (!declarations || declarations.length === 0) {\n            return undefined;\n        }\n\n        const declaration = declarations[0];\n\n        if (declaration && isClassDeclaration(declaration)) {\n            return declaration;\n        }\n\n        return undefined;\n    }\n}\n","/*\n * Copyright (c) 2022-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport crypto from 'node:crypto';\nimport { minimatch } from 'minimatch';\nimport type {\n    Node,\n    Program,\n    SourceFile,\n    TypeChecker,\n} from 'typescript';\nimport {\n    NodeFlags,\n    createProgram,\n    forEachChild,\n    isClassDeclaration,\n    isModuleBlock,\n    isModuleDeclaration,\n} from 'typescript';\nimport {\n    CACHE_SCHEMA_VERSION,\n    CacheClient,\n    composeCacheKey,\n    hashCompilerOptions,\n    hashRegistry,\n} from '../../../adapters/cache';\nimport type { MetadataGeneratorOptions } from '../../../core/config';\nimport type {\n    Controller,\n    DependencyResolver,\n    Metadata,\n    ReferenceType,\n    ReferenceTypes,\n    Registry,\n    UnmatchedDecoratorReport,\n} from '@trapi/core';\nimport {\n    createRegistry,\n    loadRegistry,\n    loadRegistryByName,\n    mergeRegistries,\n    resolvePresetByName,\n} from '@trapi/core';\nimport { ConfigError } from '../../../core/error/config';\nimport { ConfigErrorCode } from '../../../core/error/config-codes';\nimport { GeneratorErrorCode } from '../../../core/error/generator-codes';\nimport { GeneratorError } from '../../../core/error/generator';\nimport { ResolverCache } from '../../../adapters/typescript/resolver/cache';\nimport { ControllerGenerator } from '../controller';\nimport type {\n    IGeneratorContext,\n    IMetadataGenerator,\n    MetadataGeneratorContext,\n} from '../../../core/metadata/types';\n\nexport class MetadataGenerator implements IGeneratorContext, IMetadataGenerator {\n    public readonly nodes : Node[];\n\n    public readonly typeChecker: TypeChecker;\n\n    public registry: Registry;\n\n    public readonly resolverCache: ResolverCache;\n\n    public readonly config: MetadataGeneratorOptions;\n\n    private readonly program: Program;\n\n    private cache : CacheClient;\n\n    private controllers: Controller[] = [];\n\n    private referenceTypes: ReferenceTypes = {};\n\n    private circularDependencyResolvers = new Array<DependencyResolver>();\n\n    private unmatchedDecorators: Map<string, UnmatchedDecoratorReport[]> = new Map();\n\n    // -------------------------------------------------------------------------\n\n    constructor(context: MetadataGeneratorContext) {\n        this.nodes = [];\n        this.config = context.options;\n\n        this.cache = new CacheClient(context.options.cache);\n        this.registry = createRegistry();\n        this.resolverCache = new ResolverCache();\n\n        this.program = createProgram(\n            context.sourceFiles,\n            context.compilerOptions || {},\n        );\n        this.typeChecker = this.program.getTypeChecker();\n    }\n\n    // -------------------------------------------------------------------------\n\n    async generate(): Promise<Metadata> {\n        const sourceFilesHash : string = this.buildNodesFromSourceFiles();\n\n        // Load the preset upfront so its resolved registry can contribute to\n        // the cache key. Otherwise edits to a local preset (or upgrades that\n        // share a name) would silently serve stale metadata.\n        let presetRegistry: Registry | undefined;\n        let presetName: string | undefined;\n\n        if (typeof this.config.preset === 'string') {\n            presetName = this.config.preset;\n            presetRegistry = await loadRegistryByName(this.config.preset);\n        } else if (this.config.preset) {\n            presetName = this.config.preset.name;\n            presetRegistry = await loadRegistry(this.config.preset, { resolver: resolvePresetByName });\n        }\n\n        if (presetRegistry && this.config.registry) {\n            this.registry = mergeRegistries(presetRegistry, this.config.registry);\n        } else if (presetRegistry) {\n            this.registry = presetRegistry;\n        } else if (this.config.registry) {\n            this.registry = this.config.registry;\n        }\n\n        const cacheKey = composeCacheKey({\n            schemaVersion: CACHE_SCHEMA_VERSION,\n            sourceFilesHash,\n            compilerOptionsHash: hashCompilerOptions(this.program.getCompilerOptions()),\n            registryHash: hashRegistry(this.registry),\n            presetName,\n        });\n\n        // Strict reporting requires handler dispatch to actually run. A cache hit\n        // would skip it and silently swallow unmatched-decorator reports.\n        const bypassCache = !!(this.config.strict || this.config.onUnmatchedDecorator);\n\n        let cache = bypassCache ?\n            undefined :\n            await this.cache.get(cacheKey);\n\n        if (!cache) {\n            this.buildControllers();\n\n            this.assertPresetProducedControllers();\n\n            this.circularDependencyResolvers.forEach((resolve) => resolve(this.referenceTypes));\n\n            cache = {\n                controllers: this.controllers,\n                referenceTypes: this.referenceTypes,\n                cacheKey,\n                schemaVersion: CACHE_SCHEMA_VERSION,\n            };\n\n            if (!bypassCache) {\n                await this.cache.save(cache);\n            }\n        }\n\n        if (this.config.strict || this.config.onUnmatchedDecorator) {\n            this.dispatchUnmatchedDecoratorReports();\n        }\n\n        return {\n            controllers: cache.controllers,\n            referenceTypes: cache.referenceTypes,\n        };\n    }\n\n    private assertPresetProducedControllers(): void {\n        if ((this.config.preset || this.config.registry || this.controllers.length > 0) || (this.nodes.length === 0)) {\n            return;\n        }\n\n        // Only fault a missing preset when we actually scanned source files —\n        // an empty entry point is a different misconfiguration that shouldn't\n        // surface as a preset error.\n\n\n        throw new ConfigError({\n            message: 'No preset or registry configured and no controllers detected. Provide `preset: \\'@trapi/preset-decorators-express\\'` (or another preset), or pass an inline `registry`, so handlers can match your decorators.',\n            code: ConfigErrorCode.PRESET_MISSING,\n        });\n    }\n\n    public reportUnmatchedDecorator(report: UnmatchedDecoratorReport): void {\n        const key = `${report.target}:${report.name}`;\n        const existing = this.unmatchedDecorators.get(key);\n\n        if (existing) {\n            existing.push(report);\n\n            return;\n        }\n\n        this.unmatchedDecorators.set(key, [report]);\n    }\n\n    private dispatchUnmatchedDecoratorReports(): void {\n        if (this.unmatchedDecorators.size === 0) {\n            return;\n        }\n\n        const flat: UnmatchedDecoratorReport[] = [];\n\n        for (const reports of this.unmatchedDecorators.values()) {\n            flat.push(...reports);\n        }\n\n        // User-supplied callback short-circuits the default warn/throw path.\n        if (this.config.onUnmatchedDecorator) {\n            this.config.onUnmatchedDecorator(flat);\n\n            return;\n        }\n\n        const summary = this.formatUnmatchedSummary();\n\n        if (this.config.strict === 'throw') {\n            throw new GeneratorError({\n                message: summary,\n                code: GeneratorErrorCode.STRICT_UNMATCHED_DECORATORS,\n            });\n        }\n\n        // eslint-disable-next-line no-console\n        console.warn(summary);\n    }\n\n    private formatUnmatchedSummary(): string {\n        const lines: string[] = ['[trapi] strict mode: decorators with no matching handler:'];\n\n        for (const reports of this.unmatchedDecorators.values()) {\n            const first = reports[0];\n\n            if (!first) {\n                continue;\n            }\n\n            const occurrences = reports.length;\n            const location = `${first.file}:${first.line}`;\n            const suffix = occurrences > 1 ?\n                ` (${occurrences} occurrences; first at ${location})` :\n                ` (${location})`;\n\n            lines.push(`  - @${first.name} on ${first.target} '${first.host.name}'${suffix}`);\n        }\n\n        return lines.join('\\n');\n    }\n\n    protected buildNodesFromSourceFiles() : string {\n        const hash = crypto.createHash('sha256');\n\n        this.program.getSourceFiles().forEach((sf: SourceFile) => {\n            if (\n                this.isIgnoredPath(sf.fileName) &&\n                !this.isAllowedPath(sf.fileName)\n            ) {\n                return;\n            }\n\n            // Hash the file path alongside its contents so that renames or\n            // reordered identical files invalidate the cache. The null byte is\n            // a safe separator since it cannot appear in a path or source.\n            hash.update(sf.fileName);\n            hash.update('\\0');\n            hash.update(sf.text);\n            hash.update('\\0');\n\n            forEachChild(sf, (node: any) => {\n                if (isModuleDeclaration(node)) {\n                    /**\n                     * For some reason unknown to me, TS resolves both `declare module` and `namespace` to\n                     * the same kind (`ModuleDeclaration`). In order to figure out whether it's one or the other,\n                     * we check the node flags. They tell us whether it is a namespace or not.\n                     */\n\n                    // tslint:disable-next-line:no-bitwise\n                    if ((node.flags & NodeFlags.Namespace) === 0 && node.body && isModuleBlock(node.body)) {\n                        node.body.statements.forEach((statement) => {\n                            this.nodes.push(statement);\n                        });\n\n                        return;\n                    }\n                }\n\n                this.nodes.push(node);\n            });\n        });\n\n        return hash.digest('hex');\n    }\n\n    // -------------------------------------------------------------------------\n\n    /**\n     * Check if the source file path is in the ignored path list.\n     *\n     * @param filePath\n     * @protected\n     */\n    protected isIgnoredPath(filePath: string) : boolean {\n        if (typeof this.config.ignore === 'undefined') {\n            return false;\n        }\n\n        return this.config.ignore.some((item) => minimatch(filePath, item));\n    }\n\n    /**\n     * Check if the source file path is in the ignored path list.\n     *\n     * @param filePath\n     * @protected\n     */\n    protected isAllowedPath(filePath: string) {\n        if (typeof this.config.allow === 'undefined') {\n            return false;\n        }\n\n        return this.config.allow.some((item) => minimatch(filePath, item));\n    }\n\n    // -------------------------------------------------------------------------\n\n    public isExportedNode(_node: Node) {\n        return true;\n    }\n\n    // -------------------------------------------------------------------------\n\n    public addReferenceType(referenceType: ReferenceType) {\n        if (!referenceType.refName) {\n            return;\n        }\n\n        this.referenceTypes[referenceType.refName] = referenceType;\n    }\n\n    public getReferenceType(refName: string) {\n        return this.referenceTypes[refName];\n    }\n\n    public registerDependencyResolver(callback: DependencyResolver) {\n        this.circularDependencyResolvers.push(callback);\n    }\n\n    private buildControllers() : void {\n        this.controllers = [];\n\n        for (const node of this.nodes) {\n            if (!isClassDeclaration(node)) {\n                continue;\n            }\n\n            const generator = new ControllerGenerator(node, this);\n\n            if (!generator.isValid()) {\n                continue;\n            }\n\n            const controller = generator.generate();\n\n            if (controller) {\n                this.controllers.push(controller);\n            }\n        }\n    }\n}\n","/*\n * Copyright (c) 2021-2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { CompilerOptions } from 'typescript';\nimport type { MetadataGenerateOptions } from '../core/config';\nimport type { Metadata } from '@trapi/core';\nimport { MetadataGenerator } from './generator/metadata';\nimport { scanSourceFiles } from '../adapters/filesystem';\nimport { softLoadTsconfig } from '../adapters/filesystem/tsconfig';\n\nexport async function generateMetadata(\n    options: MetadataGenerateOptions,\n) : Promise<Metadata> {\n    let compilerOptions : CompilerOptions | undefined;\n\n    if (options.tsconfig) {\n        let { tsconfig } = options;\n\n        if (typeof tsconfig === 'string') {\n            tsconfig = await softLoadTsconfig({ name: tsconfig });\n            compilerOptions = tsconfig.compilerOptions;\n        } else {\n            compilerOptions = tsconfig.compilerOptions || {};\n        }\n    }\n\n    const sourceFiles = await scanSourceFiles(options.entryPoint);\n\n    const generator = new MetadataGenerator({\n        sourceFiles,\n        compilerOptions,\n        options,\n    });\n\n    return generator.generate();\n}\n"],"mappings":";;;;;;;;;;;;;AASA,IAAa,gBAAb,cAAmC,UAAU,CAE7C;;ACFA,IAAa,cAAb,cAAiC,cAAc,CAE/C;;ACJA,MAAa,kBAAkB;CAC3B,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;AACpB;;ACDA,IAAa,iBAAb,cAAoC,cAAc,CAElD;AAEA,SAAgB,iBAAiB,OAA4D;CACzF,IAAI,CAAC,YAAY,KAAK,GAClB,OAAO;CAGX,OAAO,OAAO,MAAM,SAAS;AACjC;;ACbA,MAAa,qBAAqB;CAC9B,2BAA2B;CAC3B,oBAAoB;CACpB,6BAA6B;CAC7B,0BAA0B;CAC1B,oBAAoB;CACpB,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