{"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/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;\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} as const;\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;\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        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        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        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        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            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        if (!sourceFile) return undefined;\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        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;\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 'locter';\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    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    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    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    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    if (!first || typeof first.comment !== 'string') {\n        return undefined;\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        tags = getJSDocTags(node.parent as any, (tag) => {\n            if (isJSDocParameterTag(tag)) {\n                return false;\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            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            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            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                if (newExpression.arguments) {\n                    const newArguments = newExpression.arguments.filter((args) => args.kind !== undefined);\n                    const argsValue = newArguments.map((args) => getInitializerValue(args, typeChecker));\n                    if (argsValue.length > 0) {\n                        date = new Date(argsValue as any);\n                    }\n                }\n                const dateString = date.toISOString();\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            objectLiteral.properties.forEach((p: any) => {\n                nestedObject[p.name.text] = getInitializerValue(p.initializer, typeChecker);\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            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            return getInitializerValue(extractInitializer(declaration), typeChecker);\n        }\n        default: {\n            if (typeof initializer === 'undefined') {\n                return undefined;\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            const symbol = typeChecker.getSymbolAtLocation(initializer);\n            if (!symbol) {\n                return undefined;\n            }\n            return getInitializerValue(\n                extractInitializer(symbol.valueDeclaration) || extractInitializer(extractImportSpecifier(symbol)),\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    return declaration && isImportSpecifier(declaration) ? declaration : 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 {\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} from 'typescript';\nimport type {\n    Expression,\n    Node,\n    TypeChecker,\n} from 'typescript';\nimport { getInitializerValue } from '../../typescript/initializer';\nimport type { DecoratorArgument } from '@trapi/core';\n\nexport type RawDecorator = {\n    name: string;\n    arguments: DecoratorArgument[];\n};\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    const decorators = getDecorators(node);\n    if (!decorators || decorators.length === 0) {\n        return [];\n    }\n\n    const output: RawDecorator[] = [];\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    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    if (isPropertyAccessExpression(expression)) {\n        return expression.name.text;\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    if (isIdentifier(expr) || isPropertyAccessExpression(expr)) {\n        const value = getInitializerValue(expr, typeChecker);\n        if (typeof value !== 'undefined') {\n            return { raw: value, kind: 'identifier' };\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    if (!decorators || decorators.length === 0) {\n        return [];\n    }\n\n    const output: DecoratorSource[] = [];\n    for (const decorator of decorators) {\n        const source = buildDecoratorSource(decorator, options);\n        if (source) {\n            output.push(source);\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    if (isPropertyAccessExpression(expression)) {\n        return expression.name.text;\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    if (tags.length === 0) {\n        return [];\n    }\n\n    const output: JsDocSource[] = [];\n    for (const tag of tags) {\n        output.push(buildJsDocSource(tag, options));\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        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        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    if (isQualifiedName(name)) {\n        const left = readEntityName(name.left);\n        return left ? `${left}.${name.right.text}` : name.right.text;\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        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    const sources = buildDecoratorSources(node, options);\n    if (sources.length === 0) {\n        return;\n    }\n    for (const source of sources) {\n        let matched = 0;\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        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            if (source.location) {\n                file = source.location.file;\n                line = source.location.line;\n            } else {\n                const sourceFile = node.getSourceFile();\n                file = sourceFile.fileName;\n                line = sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1;\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    const sources = buildJsDocSources(node, options);\n    if (sources.length === 0) {\n        return;\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        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        if (isValue) {\n            const indexOf = comment.indexOf(' ');\n            if (indexOf > 0) {\n                return comment.substring(indexOf + 1);\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        if (!rawComment) {\n            continue;\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                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                    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                    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                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                break;\n            default:\n                if (name.toLowerCase().startsWith('is')) {\n                    const errorMsg = getErrorMsg(comment, false);\n                    if (errorMsg) {\n                        validators[name] = {\n                            message: errorMsg,\n                            value: undefined,\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    if (str.startsWith('```') && str.endsWith('```')) {\n        return str.substring(3, str.length - 3);\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    if (names.size === 0) {\n        return [];\n    }\n\n    const output : Extension[] = [];\n    for (const name of names) {\n        const decorators = findDecoratorsByName(node, name);\n        for (const decorator of decorators) {\n            const keyArg = decorator.arguments[0];\n            const valueArg = decorator.arguments[1];\n            if (!keyArg || keyArg.kind !== 'literal' || typeof keyArg.raw !== 'string') {\n                continue;\n            }\n            if (!valueArg || valueArg.kind === 'unresolvable' || typeof valueArg.raw === 'undefined') {\n                continue;\n            }\n            output.push({ key: keyArg.raw, value: valueArg.raw as never });\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        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        if (!modifiers) {\n            return false;\n        }\n\n        // public || public readonly\n        if (modifiers.some((modifier) => modifier.kind === SyntaxKind.PublicKeyword)) {\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    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    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    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        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        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        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        if (type.isUnion() && type.types.every((t) => t.isStringLiteral())) {\n            return {\n                typeName: TypeName.ENUM,\n                members: type.types.map(\n                    (t: StringLiteralType) => t.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    switch (typeNode.literal.kind) {\n        case SyntaxKind.TrueKeyword:\n            value = true;\n            break;\n        case SyntaxKind.FalseKeyword:\n            value = false;\n            break;\n        case SyntaxKind.StringLiteral:\n            value = typeNode.literal.text;\n            break;\n        case SyntaxKind.NumericLiteral:\n            value = Number.parseFloat(typeNode.literal.text);\n            break;\n        case SyntaxKind.NullKeyword:\n            value = null;\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    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        if (tagNameIndex >= 0) {\n            return true;\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            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            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        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                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                    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                    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        if (referenceTypes.every((refType) => refType.refName === TypeName.REF_ENUM)) {\n            return this.mergeManyRefEnums(referenceTypes as RefEnumType[]);\n        }\n\n        if (referenceTypes.every((refType) => refType.refName === TypeName.REF_OBJECT)) {\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        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        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        for (let i = 2; i < many.length; ++i) {\n            merged = this.mergeRefObject(merged, many[i]!);\n        }\n        return merged;\n    }\n\n    public mergeRefObject(first: RefObjectType, second: RefObjectType) : RefObjectType {\n        let description : string | undefined;\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        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        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        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            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            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            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        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        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        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                    const resolvedType = this.primitiveResolver.resolveSyntaxKind(arg.kind);\n                    if (\n                        typeof resolvedType === 'undefined'\n                    ) { return 'any'; }\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            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                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                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                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        const type = this.current.typeChecker.getTypeAtLocation(modelType.name);\n        const toJSON = this.current.typeChecker.getPropertyOfType(type, 'toJSON');\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            if (!nodeType) {\n                const signature = this.current.typeChecker.getSignatureFromDeclaration(toJSON.valueDeclaration);\n                if (signature) {\n                    const implicitType = this.current.typeChecker.getReturnTypeOfSignature(signature);\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            if (!realReferenceType) {\n                return;\n            }\n\n            referenceType.description = realReferenceType.description;\n            if (realReferenceType.typeName === 'refObject' && referenceType.typeName === 'refObject') {\n                referenceType.properties = realReferenceType.properties;\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        if (!symbol && type.kind === SyntaxKind.QualifiedName) {\n            const fullEnumSymbol = this.getSymbolAtLocation(type.left);\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        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            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().indexOf('node_modules/typescript') <= -1);\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        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            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().indexOf('node_modules/typescript') <= -1);\n\n            modelTypes = TypeNodeResolver.getDesignatedModels(modelTypes, typeName);\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        // 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        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        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            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        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        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            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        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                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        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        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                if (referenceType) {\n                    if (isRefAliasType(referenceType)) {\n                        let type: Type = referenceType;\n                        while (isRefAliasType(type)) {\n                            type = type.type;\n                        }\n\n                        if (type.typeName === TypeName.REF_OBJECT) {\n                            properties = [...properties, ...type.properties];\n                        } else if (type.typeName === TypeName.NESTED_OBJECT_LITERAL) {\n                            properties = [...properties, ...type.properties];\n                        }\n                    }\n\n                    if (isRefObjectType(referenceType)) {\n                        referenceType.properties.forEach((property) => properties.push(property));\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                        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, { path: 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 { isObject, load } from 'locter';\nimport { ConfigErrorCode } from '../../../core/error/config-codes';\nimport { ConfigError } from '../../../core/error/config';\nimport process from 'node:process';\nimport path from 'node:path';\nimport { convertCompilerOptionsFromJson } from 'typescript';\nimport type { TsConfig, TsconfigLoadContext } from './types';\n\nexport async function loadTSConfig(\n    context: TsconfigLoadContext = {},\n) : Promise<TsConfig> {\n    let fileName : string;\n    let filePath : string;\n    const cwd = context.cwd || process.cwd();\n\n    if (typeof context.name === 'string') {\n        if (path.isAbsolute(context.name)) {\n            filePath = context.name;\n        } else {\n            filePath = path.resolve(cwd, context.name);\n        }\n\n        fileName = path.basename(filePath);\n    } else {\n        fileName = 'tsconfig.json';\n        filePath = path.join(cwd, fileName);\n    }\n\n    const content = await load(filePath);\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    if (typeof content.compilerOptions !== 'undefined') {\n        const { options: compilerOptions } = convertCompilerOptionsFromJson(\n            content.compilerOptions,\n            cwd,\n            fileName,\n        );\n\n        content.compilerOptions = compilerOptions;\n    }\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). Old cache files with a different\n * version are rejected on read.\n */\nexport const CACHE_SCHEMA_VERSION = '3';\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","/*\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';\nimport type { CacheOptions, CacheOptionsInput } from './types';\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    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    return input;\n}\n\n// -----------------------------------------------------------------------------\n// Cache key composition\n// -----------------------------------------------------------------------------\n\nexport type CacheKeyParts = {\n    schemaVersion: string;\n    sourceFilesHash: string;\n    compilerOptionsHash: string;\n    registryHash: string;\n    presetName?: string;\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    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    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    hash.update(stableStringify(options ?? {}));\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    for (const kind of kinds) {\n        hash.update(kind);\n        hash.update('\\0');\n        const handlers = registry[kind] ?? [];\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        hash.update('\\x01');\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            for (const k of Object.keys(val as Record<string, unknown>).sort()) {\n                sorted[k] = (val as Record<string, unknown>)[k];\n            }\n            return sorted;\n        }\n        return val;\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 { 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            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        try {\n            content = await fs.promises.readFile(filePath, { encoding: 'utf-8' });\n        } catch {\n            return undefined;\n        }\n\n        let cache: CacheData;\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            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        try {\n            entries = await locateMany(pattern, { path: 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            try {\n                const stat = await fs.promises.stat(filePath);\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        const fileName = this.options.fileName ??\n            `${CACHE_FILE_PREFIX}${cacheKey}${CACHE_FILE_SUFFIX}`;\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 'locter';\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        applyDecoratorHandlers(this.parameter, this.current.registry.parameters, draft, options);\n        applyJsDocHandlers(this.parameter, this.current.registry.parameterJsDoc, draft, options);\n\n        // TS-resolved type\n        const type = this.resolveType();\n        draft.type = type;\n\n        // Description from TS symbol's documentation comment.\n        const description = this.getDescription();\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        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        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            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            if (kind === ParameterSource.PATH) {\n                this.validatePathDecomposition(decomposed);\n            }\n            return decomposed;\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            const arrayParameter: ArrayParameter = {\n                ...this.draftToParameter(draft),\n                collectionFormat: draft.collectionFormat ?? CollectionFormat.MULTI,\n                type,\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        for (const property of type.properties) {\n            let propertyDefaultValue = property.default;\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        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        const escaped = name.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n        const colonPattern = new RegExp(`:${escaped}\\\\b`);\n        const bracePattern = `{${name}}`;\n        for (const p of this.paths) {\n            if (p.includes(bracePattern) || colonPattern.test(p)) {\n                return true;\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        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        if (!typeNode) {\n            const t = this.current.typeChecker.getTypeAtLocation(this.parameter);\n            typeNode = this.current.typeChecker.typeToTypeNode(\n                t,\n                undefined,\n                NodeBuilderFlags.NoTruncation,\n            );\n        }\n        if (!typeNode) {\n            throw new ParameterError({ message: `Could not resolve type for parameter '${this.getParameterName()}'.` });\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        return this.parameter.name.text;\n    }\n\n    private getDescription(): string {\n        const symbol = this.current.typeChecker.getSymbolAtLocation(this.parameter.name);\n        if (symbol) {\n            const comments = symbol.getDocumentationComment(this.current.typeChecker);\n            if (comments.length > 0) {\n                return displayPartsToString(comments);\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                exampleLabels.push(hasExampleLabel ?\n                    head.split('.').slice(1).join('.') :\n                    undefined);\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) 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    isVoidType,\n    newMethodDraft,\n} from '@trapi/core';\nimport type {\n    BaseType,\n    Example,\n    Method,\n    Parameter,\n    Response,\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';\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        return identifier.text;\n    }\n\n    public generate(controllerPaths: string[]): Method | null {\n        const name = this.getMethodName();\n        const draft = newMethodDraft({ name });\n\n        const options = this.applyOptions();\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).\n        if (!draft.verb) {\n            return null;\n        }\n\n        // Skip hidden methods entirely (matches v1 behaviour for class member iteration).\n        if (draft.hidden) {\n            return null;\n        }\n\n        // Resolve return type.\n        const returnType = this.resolveReturnType();\n\n        // Build responses: handler-supplied first, then a derived default that\n        // carries any handler-contributed default-response examples.\n        const defaultResponse = buildDefaultResponse(returnType, draft.defaultResponseExamples);\n        const responses = mergeDefaultResponse(draft.responses, defaultResponse);\n\n        // Walk parameters.\n        const parameters = this.buildParameters(controllerPaths, draft.path, draft.verb);\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            path: normalizePath(draft.path),\n            produces: draft.produces,\n            responses,\n            security: draft.security,\n            summary,\n            tags: draft.tags,\n            type: returnType,\n            parameters,\n        };\n    }\n\n    private applyOptions(): ApplyHandlersOptions {\n        const parentName = (this.node.parent as ClassDeclaration).name?.text;\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(): BaseType {\n        let nodeType = this.node.type;\n        if (!nodeType) {\n            const { typeChecker } = this.current;\n            const signature = typeChecker.getSignatureFromDeclaration(this.node);\n            if (!signature) {\n                throw new GeneratorError({ message: 'Could not resolve method signature.' });\n            }\n            const implicitType = typeChecker.getReturnTypeOfSignature(signature);\n            nodeType = typeChecker.typeToTypeNode(implicitType, undefined, NodeBuilderFlags.NoTruncation) as TypeNode;\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 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                    if (parameter.in === ParameterSource.FORM_DATA) {\n                        formParameterCount += 1;\n                    }\n                    if (parameter.in !== ParameterSource.CONTEXT) {\n                        output.push(parameter);\n                    }\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        if (bodyParameterCount > 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\nfunction buildDefaultResponse(returnType: BaseType, examples: Example[]): Response {\n    const isVoid = isVoidType(returnType);\n    return {\n        description: isVoid ? 'No content' : 'Ok',\n        examples,\n        schema: returnType,\n        status: isVoid ? '204' : '200',\n        name: isVoid ? '204' : '200',\n    };\n}\n\nfunction mergeDefaultResponse(handlerResponses: Response[], defaultResponse: Response): Response[] {\n    if (handlerResponses.length === 0) {\n        return [defaultResponse];\n    }\n    const target = handlerResponses.find((r) => r.status === defaultResponse.status);\n    if (target) {\n        if (defaultResponse.examples && defaultResponse.examples.length > 0 &&\n            (!target.examples || target.examples.length === 0)) {\n            target.examples = defaultResponse.examples;\n        }\n        return handlerResponses;\n    }\n    return [...handlerResponses, defaultResponse];\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        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        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        // 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        const methods = this.buildMethods(paths);\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[]): 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            if (set.has(methodName)) {\n                continue;\n            }\n\n            const method = generator.generate(controllerPaths);\n            if (!method) {\n                continue;\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        for (const node of inheritedMethods) {\n            const generator = new MethodGenerator(node, this.current);\n            const methodName = generator.getMethodName();\n            if (set.has(methodName)) {\n                continue;\n            }\n\n            try {\n                const method = generator.generate(controllerPaths);\n                if (!method) {\n                    continue;\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                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        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        if (!declarations || declarations.length === 0) {\n            return undefined;\n        }\n\n        const declaration = declarations[0];\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 { GeneratorError } from '../../../core/error/generator';\nimport { GeneratorErrorCode } from '../../../core/error/generator-codes';\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        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) {\n            return;\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        if (this.nodes.length === 0) {\n            return;\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        if (existing) {\n            existing.push(report);\n            return;\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        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            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        for (const reports of this.unmatchedDecorators.values()) {\n            const first = reports[0];\n            if (!first) {\n                continue;\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            lines.push(`  - @${first.name} on ${first.target} '${first.host.name}'${suffix}`);\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                        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            if (!generator.isValid()) {\n                continue;\n            }\n\n            const controller = generator.generate();\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        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"],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