typeorm-dto-generator 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +156 -0
- package/dist/index.d.ts +133 -52
- package/dist/index.js +833 -768
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +803 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +27 -9
- package/dist/.tsbuildinfo +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -43
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport { Project, Node, type ClassDeclaration, type PropertyDeclaration, type SourceFile } from 'ts-morph'\nimport { type DataSource } from 'typeorm'\nimport { ColumnMeta, Config, EntityMeta, GenerateResult, InitConfig, RelationMeta } from './types'\n\ntype RuntimeColumn = {\n propertyName: string\n type: unknown\n enum?: (string | number)[]\n enumName?: string\n isNullable: boolean\n isSelect: boolean\n relationMetadata?: unknown\n}\n\ntype RuntimeRelation = {\n propertyName: string\n inverseEntityMetadata: RuntimeEntityMetadata\n isManyToMany: boolean\n isOneToMany: boolean\n isNullable: boolean\n}\n\ntype RuntimeEntityMetadata = {\n target: Function | string\n name: string\n columns: RuntimeColumn[]\n relations: RuntimeRelation[]\n}\n\ntype EntitySourceInfo = {\n filePath?: string\n enumTypeByProperty: Map<string, string>\n typeByProperty: Map<string, string>\n}\n\nexport class TORMDTOGenerator {\n public readonly config: Config\n protected readonly project: Project\n protected readonly sourceInfoByClassName = new Map<string, EntitySourceInfo>()\n\n constructor(config: InitConfig) {\n this.config = this.createConfig(config)\n this.project = new Project({\n skipAddingFilesFromTsConfig: true\n })\n }\n\n async run(): Promise<GenerateResult> {\n this.loadEntitySourceInfo()\n const metas = await this.createEntityMetas()\n\n fs.rmSync(this.config.dtoOutputDir, {\n recursive: true,\n force: true\n })\n\n fs.mkdirSync(this.config.dtoOutputDir, {\n recursive: true\n })\n\n this.ensureCommonTypesFile(metas)\n this.validateCommonTypeCoverage(metas)\n\n for (const meta of metas) {\n this.writeFile(\n path.join(this.config.dtoOutputDir, meta.dtoFileName),\n this.createDTOContent(meta, metas)\n )\n }\n\n this.writeFile(\n path.join(this.config.dtoOutputDir, `index.ts`),\n `${this.createDTOIndexContent(metas)}\\n`\n )\n\n this.writeFile(\n this.config.mapperOutputFile,\n this.createGeneratedMapperContent(metas)\n )\n\n this.log(`Generated DTO files: ${metas.length}`)\n this.log(`Generated DTO directory: ${this.config.dtoOutputDir}`)\n this.log(`Generated mapper file: ${this.config.mapperOutputFile}`)\n\n return {\n metas,\n dtoOutputDir: this.config.dtoOutputDir,\n mapperOutputFile: this.config.mapperOutputFile\n }\n }\n\n protected log(message: string) {\n if (this.config.debug)\n console.log(message)\n }\n\n protected createConfig(config: InitConfig): Config {\n if (!config.datasource)\n throw new Error('datasource is required')\n\n const root = process.cwd()\n const dtoOutputDir = config.dtoOutputDir || path.join(root, 'dto')\n const mapperOutputFile = config.mapperOutputFile || path.join(root, 'dto.mapper.ts')\n const sharedDTOImportPath = config.sharedDTOImportPath || path.relative(path.parse(mapperOutputFile).dir, dtoOutputDir).replaceAll('\\\\', '/')\n\n return {\n debug: config.debug || false,\n dtoOutputDir,\n mapperOutputFile,\n sharedDTOImportPath: sharedDTOImportPath.startsWith('.') ? sharedDTOImportPath : `./${sharedDTOImportPath}`,\n includeExtensionOnImports: config.includeExtensionOnImports ?? true,\n excludePropertyNames: config.excludePropertyNames ?? [\n 'password',\n 'passwordHash',\n 'secret',\n 'refreshToken',\n 'accessToken',\n 'keyHash',\n 'token',\n 'otp',\n 'salt'\n ],\n customScalarTypeMap: config.customScalarTypeMap ?? {\n BigInt: 'string',\n bigint: 'string',\n Buffer: 'string',\n Decimal: 'string'\n },\n ...config,\n }\n }\n\n protected writeFile(filePath: string, content: string) {\n fs.mkdirSync(path.dirname(filePath), {\n recursive: true\n })\n\n fs.writeFileSync(filePath, content)\n }\n\n protected toKebabCase(value: string) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[\\s_]+/g, '-')\n .toLowerCase()\n }\n\n protected unique<T>(items: T[]) {\n return [...new Set(items)]\n }\n\n protected createRelativeJSImportPath(fromFile: string, targetFile: string) {\n const relativePath = path\n .relative(path.dirname(fromFile), targetFile)\n .replace(/\\\\/g, '/')\n .replace(/\\.(ts|tsx|mts|cts)$/, this.config.includeExtensionOnImports ? '.ts' : '')\n\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`\n }\n\n protected getCommonTypesFilePath() {\n return path.join(this.config.dtoOutputDir, 'common.dto.ts')\n }\n\n protected getCommonTypesImportSpecifier(dtoFilePath: string) {\n return this.createRelativeJSImportPath(dtoFilePath, this.getCommonTypesFilePath())\n }\n\n protected getDatasourceEntities() {\n const entities = this.config.datasource.options.entities ?? []\n\n if (Array.isArray(entities)) {\n return entities\n }\n\n return Object.values(entities)\n }\n\n protected normalizeEntityPattern(pattern: string) {\n return pattern.replace(/\\\\/g, '/')\n }\n\n protected isSourceFilePath(filePath: string) {\n return /\\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(filePath)\n }\n\n protected isEntitySourceFilePath(filePath: string) {\n return /\\.entity\\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(filePath)\n }\n\n protected normalizeAbsolutePath(filePath: string) {\n return path.resolve(filePath).replace(/\\\\/g, '/').toLowerCase()\n }\n\n protected isIgnoredSourcePath(filePath: string) {\n const normalized = this.normalizeAbsolutePath(filePath)\n const dtoOutputDir = this.normalizeAbsolutePath(this.config.dtoOutputDir)\n const mapperOutputFile = this.normalizeAbsolutePath(this.config.mapperOutputFile)\n const ignoredSegments = [\n '/node_modules/',\n '/.git/',\n '/.next/',\n '/dist/',\n '/build/',\n '/coverage/'\n ]\n\n if (ignoredSegments.some((segment) => normalized.includes(segment))) {\n return true\n }\n\n if (normalized === dtoOutputDir || normalized.startsWith(`${dtoOutputDir}/`)) {\n return true\n }\n\n return normalized === mapperOutputFile\n }\n\n protected discoverProjectSourcePaths() {\n const result: string[] = []\n const walk = (directory: string) => {\n if (!fs.existsSync(directory)) {\n return\n }\n\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n const fullPath = path.join(directory, entry.name)\n const normalized = fullPath.replace(/\\\\/g, '/')\n\n if (this.isIgnoredSourcePath(normalized)) {\n continue\n }\n\n if (entry.isDirectory()) {\n walk(fullPath)\n continue\n }\n\n if (entry.isFile() && this.isSourceFilePath(fullPath)) {\n result.push(fullPath)\n }\n }\n }\n\n walk(process.cwd())\n\n return result\n }\n\n protected addEntityOptionSourceFiles() {\n const sourceFiles: SourceFile[] = []\n\n for (const entity of this.getDatasourceEntities()) {\n if (typeof entity !== 'string') {\n continue\n }\n\n sourceFiles.push(...this.project.addSourceFilesAtPaths(this.normalizeEntityPattern(entity)))\n }\n\n return sourceFiles\n }\n\n protected addDiscoveredSourceFiles() {\n const paths = this.discoverProjectSourcePaths()\n return paths.map((filePath) => {\n return this.project.addSourceFileAtPathIfExists(filePath)\n }).filter((sourceFile): sourceFile is SourceFile => {\n return Boolean(sourceFile)\n })\n }\n\n protected loadEntitySourceInfo() {\n const fromEntityOptions = this.addEntityOptionSourceFiles()\n this.addDiscoveredSourceFiles()\n const candidateFiles = fromEntityOptions.length ? fromEntityOptions : this.project.getSourceFiles()\n\n for (const sourceFile of candidateFiles) {\n for (const classDeclaration of sourceFile.getClasses()) {\n if (!this.isEntityClass(classDeclaration)) {\n continue\n }\n\n this.sourceInfoByClassName.set(classDeclaration.getNameOrThrow(), {\n filePath: sourceFile.getFilePath(),\n enumTypeByProperty: this.collectEnumTypesByProperty(classDeclaration),\n typeByProperty: this.collectTypesByProperty(classDeclaration)\n })\n }\n }\n }\n\n protected isEntityClass(classDeclaration: ClassDeclaration) {\n return classDeclaration.getDecorators().some((decorator) => {\n return decorator.getName() === 'Entity'\n })\n }\n\n protected getDecoratorObjectLiteral(property: PropertyDeclaration) {\n for (const decorator of property.getDecorators()) {\n const objectLiteral = decorator.getArguments().find((argument) => {\n return Node.isObjectLiteralExpression(argument)\n })\n\n if (objectLiteral && Node.isObjectLiteralExpression(objectLiteral)) {\n return objectLiteral\n }\n }\n\n return null\n }\n\n protected getColumnEnumInitializer(property: PropertyDeclaration) {\n const objectLiteral = this.getDecoratorObjectLiteral(property)\n const enumProperty = objectLiteral?.getProperty('enum')\n\n if (!enumProperty || !Node.isPropertyAssignment(enumProperty)) {\n return null\n }\n\n return enumProperty.getInitializer()?.getText() ?? null\n }\n\n protected getEnumTypeNameFromProperty(property: PropertyDeclaration) {\n const typeText = property.getTypeNode()?.getText()\n\n if (typeText && /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(typeText)) {\n return typeText\n }\n\n const enumInitializer = this.getColumnEnumInitializer(property)\n\n if (enumInitializer && /^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(enumInitializer)) {\n return enumInitializer.split('.').pop() ?? enumInitializer\n }\n\n return null\n }\n\n protected collectEnumTypesByProperty(classDeclaration: ClassDeclaration) {\n const enumTypeByProperty = new Map<string, string>()\n\n for (const property of this.collectProperties(classDeclaration)) {\n const enumTypeName = this.getEnumTypeNameFromProperty(property)\n\n if (enumTypeName) {\n enumTypeByProperty.set(property.getName(), enumTypeName)\n }\n }\n\n return enumTypeByProperty\n }\n\n protected cleanTypeText(value: string) {\n return value\n .replace(/import\\(\".*?\"\\)\\./g, '')\n .replace(/\\s+/g, ' ')\n .trim()\n }\n\n protected collectTypesByProperty(classDeclaration: ClassDeclaration) {\n const typeByProperty = new Map<string, string>()\n\n for (const property of this.collectProperties(classDeclaration)) {\n const typeText = property.getTypeNode()?.getText()\n\n if (typeText) {\n typeByProperty.set(property.getName(), this.cleanTypeText(typeText))\n }\n }\n\n return typeByProperty\n }\n\n protected collectProperties(classDeclaration: ClassDeclaration, visitedClassNames = new Set<string>()): PropertyDeclaration[] {\n const className = classDeclaration.getName()\n\n if (className && visitedClassNames.has(className)) {\n return []\n }\n\n if (className) {\n visitedClassNames.add(className)\n }\n\n const baseClass = classDeclaration.getBaseClass()\n const baseProperties = baseClass ? this.collectProperties(baseClass, visitedClassNames) : []\n\n return [...baseProperties, ...classDeclaration.getProperties()]\n }\n\n protected getClassName(target: Function | string, fallback: string) {\n return typeof target === 'function' ? target.name : fallback\n }\n\n protected async ensureDatasourceMetadata() {\n if (this.config.datasource.entityMetadatas.length) {\n return\n }\n\n const datasource = this.config.datasource as DataSource & {\n buildMetadatas?: () => Promise<void>\n }\n\n if (typeof datasource.buildMetadatas !== 'function') {\n throw new Error('DTOGeneratorService config error: datasource cannot build entity metadata.')\n }\n\n await datasource.buildMetadatas()\n }\n\n protected isExcludedColumn(column: RuntimeColumn) {\n return this.config.excludePropertyNames.includes(column.propertyName)\n || column.isSelect === false\n || Boolean(column.relationMetadata)\n }\n\n protected isDateColumn(column: RuntimeColumn) {\n return column.type === Date || [\n 'date',\n 'datetime',\n 'datetime2',\n 'timestamp',\n 'timestamp with time zone',\n 'timestamp without time zone',\n 'time',\n 'time with time zone',\n 'time without time zone'\n ].includes(String(column.type))\n }\n\n protected isJsonColumn(column: RuntimeColumn) {\n return ['json', 'jsonb', 'simple-json'].includes(String(column.type))\n }\n\n protected resolveEnumTypeName(entityName: string, column: RuntimeColumn) {\n const enumTypeName = this.sourceInfoByClassName.get(entityName)?.enumTypeByProperty.get(column.propertyName)\n\n if (enumTypeName) {\n return enumTypeName\n }\n\n if (column.enumName) {\n return column.enumName\n }\n\n return `${entityName}${column.propertyName.charAt(0).toUpperCase()}${column.propertyName.slice(1)}`\n }\n\n protected resolveSourcePropertyType(entityName: string, propertyName: string) {\n const sourceType = this.sourceInfoByClassName.get(entityName)?.typeByProperty.get(propertyName)\n\n if (!sourceType) {\n return null\n }\n\n return sourceType\n .split('|')\n .map((item) => item.trim())\n .map((item) => item === 'Date' ? 'string' : item)\n .join(' | ')\n }\n\n protected resolveColumnType(entityName: string, column: RuntimeColumn) {\n if (column.enum?.length) {\n return this.resolveEnumTypeName(entityName, column)\n }\n\n const sourceType = this.resolveSourcePropertyType(entityName, column.propertyName)\n\n if (sourceType) {\n return sourceType\n }\n\n const typeText = typeof column.type === 'function' ? column.type.name : String(column.type)\n\n if (this.config.customScalarTypeMap[typeText]) {\n return this.config.customScalarTypeMap[typeText]\n }\n\n if (this.isDateColumn(column)) {\n return 'string'\n }\n\n if (column.type === String || [\n 'char',\n 'varchar',\n 'nvarchar',\n 'text',\n 'tinytext',\n 'mediumtext',\n 'longtext',\n 'uuid',\n 'simple-enum'\n ].includes(typeText)) {\n return 'string'\n }\n\n if (column.type === Number || [\n 'int',\n 'integer',\n 'tinyint',\n 'smallint',\n 'mediumint',\n 'bigint',\n 'float',\n 'double',\n 'double precision',\n 'real',\n 'decimal',\n 'numeric'\n ].includes(typeText)) {\n return 'number'\n }\n\n if (column.type === Boolean || ['bool', 'boolean'].includes(typeText)) {\n return 'boolean'\n }\n\n if (this.isJsonColumn(column)) {\n return 'any'\n }\n\n if (typeText === 'object') {\n return 'Record<string, unknown>'\n }\n\n return typeText\n }\n\n protected appendNullType(typeText: string) {\n if (typeText.split('|').map((item) => item.trim()).includes('null')) {\n return typeText\n }\n\n return `${typeText} | null`\n }\n\n protected columnToMeta(entityName: string, column: RuntimeColumn): ColumnMeta {\n const resolvedType = this.resolveColumnType(entityName, column)\n\n return {\n name: column.propertyName,\n optional: false,\n type: column.isNullable ? this.appendNullType(resolvedType) : resolvedType,\n isDate: this.isDateColumn(column),\n mapAsNumber: resolvedType === 'number',\n enumValues: column.enum ? [...column.enum] : undefined\n }\n }\n\n protected relationToMeta(relation: RuntimeRelation): RelationMeta {\n const targetClassName = this.getClassName(relation.inverseEntityMetadata.target, relation.inverseEntityMetadata.name)\n\n return {\n name: relation.propertyName,\n targetClassName,\n targetDTOName: `${targetClassName}DTO`,\n isArray: relation.isOneToMany || relation.isManyToMany,\n nullable: relation.isNullable\n }\n }\n\n protected async createEntityMetas() {\n await this.ensureDatasourceMetadata()\n\n const metas = (this.config.datasource.entityMetadatas as RuntimeEntityMetadata[]).map((metadata) => {\n const className = this.getClassName(metadata.target, metadata.name)\n const moduleName = this.toKebabCase(className)\n const columns = metadata.columns\n .filter((column) => !this.isExcludedColumn(column))\n .map((column) => this.columnToMeta(className, column))\n const relations = metadata.relations.map((relation) => this.relationToMeta(relation))\n\n return {\n className,\n dtoName: `${className}DTO`,\n moduleName,\n dtoFileName: `${moduleName}.dto.ts`,\n mapperName: `parse${className}DTO`,\n filePath: this.sourceInfoByClassName.get(className)?.filePath,\n columns,\n relations\n }\n })\n\n return metas.sort((a, b) => {\n return a.className.localeCompare(b.className)\n })\n }\n\n protected findMetaByClassName(metas: EntityMeta[], className: string) {\n return metas.find((meta) => {\n return meta.className === className\n })\n }\n\n protected getValidRelations(meta: EntityMeta, metas: EntityMeta[]) {\n return meta.relations.filter((relation) => {\n return Boolean(this.findMetaByClassName(metas, relation.targetClassName))\n })\n }\n\n protected createDTOContent(meta: EntityMeta, metas: EntityMeta[]) {\n const dtoFilePath = path.join(this.config.dtoOutputDir, meta.dtoFileName)\n const validRelations = this.getValidRelations(meta, metas)\n\n const relationImports = this.unique(\n validRelations\n .filter((relation) => relation.targetClassName !== meta.className)\n .map((relation) => relation.targetClassName)\n ).map((targetClassName): [string, string] | null => {\n const targetMeta = this.findMetaByClassName(metas, targetClassName)\n if (!targetMeta) {\n return null\n }\n\n const targetPath = path.join(this.config.dtoOutputDir, targetMeta.dtoFileName)\n\n return [targetMeta.dtoName, this.createRelativeJSImportPath(dtoFilePath, targetPath)]\n }).filter((item): item is [string, string] => {\n return item !== null\n })\n\n const relationTypeNames = new Set(validRelations.map((relation) => relation.targetDTOName))\n const externalTypeImports = this.collectExternalTypeImports(meta, dtoFilePath, relationTypeNames)\n const importMap = new Map<string, Set<string>>()\n\n for (const [typeName, moduleSpecifier] of [...relationImports, ...externalTypeImports]) {\n if (!importMap.has(moduleSpecifier)) {\n importMap.set(moduleSpecifier, new Set())\n }\n\n importMap.get(moduleSpecifier)?.add(typeName)\n }\n\n const imports = [...importMap.entries()]\n .sort((a, b) => a[0].localeCompare(b[0]))\n .map(([moduleSpecifier, typeNames]) => {\n let newModuleSpecifier = moduleSpecifier\n\n if (!this.config.includeExtensionOnImports) {\n newModuleSpecifier = newModuleSpecifier.replace('.ts', '')\n }\n\n return `import type { ${[...typeNames].sort((a, b) => a.localeCompare(b)).join(', ')} } from '${newModuleSpecifier}'`\n })\n\n const columnLines = meta.columns.map((column) => {\n const optional = column.optional ? '?' : ''\n\n return ` ${column.name}${optional}: ${column.type}`\n })\n\n const relationLines = validRelations.map((relation) => {\n const type = relation.isArray\n ? `${relation.targetDTOName}[]`\n : `${relation.targetDTOName}${relation.nullable ? ' | null' : ''}`\n\n return ` ${relation.name}?: ${type}`\n })\n\n const importBlock = imports.length ? `${imports.join('\\n')}\\n\\n` : ''\n const body = [...columnLines, ...relationLines].join('\\n')\n\n return `${importBlock}export type ${meta.dtoName} = {\\n${body}\\n}\\n`\n }\n\n protected collectExternalTypeImports(meta: EntityMeta, dtoFilePath: string, relationTypeNames: Set<string>) {\n const symbols = this.collectExternalTypeSymbols(meta, relationTypeNames)\n const importSpecifier = this.getCommonTypesImportSpecifier(dtoFilePath)\n\n return [...symbols].map((symbol) => {\n return [symbol, importSpecifier] as [string, string]\n })\n }\n\n protected collectExternalTypeSymbols(meta: EntityMeta, relationTypeNames: Set<string>) {\n const symbols = new Set<string>()\n const ignoredNames = new Set([\n 'string',\n 'number',\n 'boolean',\n 'null',\n 'undefined',\n 'unknown',\n 'any',\n 'object',\n 'bigint',\n 'never',\n 'void',\n 'true',\n 'false',\n 'Record',\n 'Array',\n 'Promise',\n 'ReadonlyArray'\n ])\n\n for (const column of meta.columns) {\n const identifiers: string[] = column.type.match(/\\b[A-Za-z_][A-Za-z0-9_]*\\b/g) ?? []\n\n for (const identifier of identifiers) {\n if (ignoredNames.has(identifier)) {\n continue\n }\n\n if (relationTypeNames.has(identifier) || identifier === meta.dtoName) {\n continue\n }\n\n symbols.add(identifier)\n }\n }\n\n return symbols\n }\n\n protected collectAllExternalTypeSymbols(metas: EntityMeta[]) {\n const symbols = new Set<string>()\n\n for (const meta of metas) {\n const relationTypeNames = new Set(meta.relations.map((relation) => relation.targetDTOName))\n const metaSymbols = this.collectExternalTypeSymbols(meta, relationTypeNames)\n\n for (const symbol of metaSymbols) {\n symbols.add(symbol)\n }\n }\n\n return symbols\n }\n\n protected findTypeDeclarationByName(typeName: string) {\n for (const sourceFile of this.project.getSourceFiles()) {\n if (this.isIgnoredSourcePath(sourceFile.getFilePath())) {\n continue\n }\n\n const enumDeclaration = sourceFile.getEnum(typeName)\n\n if (enumDeclaration) {\n return enumDeclaration\n }\n\n const interfaceDeclaration = sourceFile.getInterface(typeName)\n\n if (interfaceDeclaration) {\n return interfaceDeclaration\n }\n\n const typeAliasDeclaration = sourceFile.getTypeAlias(typeName)\n\n if (typeAliasDeclaration) {\n return typeAliasDeclaration\n }\n }\n\n return null\n }\n\n protected findEnumDeclarationByName(typeName: string) {\n for (const sourceFile of this.project.getSourceFiles()) {\n if (this.isIgnoredSourcePath(sourceFile.getFilePath())) {\n continue\n }\n\n const enumDeclaration = sourceFile.getEnum(typeName)\n\n if (enumDeclaration) {\n return enumDeclaration\n }\n }\n\n return null\n }\n\n protected normalizeDeclarationToExportText(typeName: string, preferEnum = false) {\n const declaration = preferEnum\n ? this.findEnumDeclarationByName(typeName) ?? this.findTypeDeclarationByName(typeName)\n : this.findTypeDeclarationByName(typeName)\n\n if (!declaration) {\n return null\n }\n\n const declarationText = declaration.getText().trim()\n\n if (declarationText.startsWith('export ')) {\n return declarationText\n }\n\n return `export ${declarationText}`\n }\n\n protected formatEnumKey(value: string | number) {\n const normalized = String(value)\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .replace(/[^A-Za-z0-9]+/g, '_')\n .replace(/^_+|_+$/g, '')\n .toUpperCase()\n\n return normalized || `VALUE_${String(value)}`\n }\n\n protected formatEnumValue(value: string | number) {\n return typeof value === 'number' ? String(value) : `'${value.replace(/'/g, \"\\\\'\")}'`\n }\n\n protected createCommonEnumDeclaration(typeName: string, values: (string | number)[]) {\n const uniqueValues = this.unique(values)\n const lines = uniqueValues.map((value) => {\n return ` ${this.formatEnumKey(value)} = ${this.formatEnumValue(value)}`\n })\n\n return `export enum ${typeName} {\\n${lines.join(',\\n')}\\n}`\n }\n\n protected ensureCommonTypesFile(metas: EntityMeta[]) {\n const symbols = [...this.collectAllExternalTypeSymbols(metas)].sort((a, b) => a.localeCompare(b))\n const enumBySymbol = new Map<string, (string | number)[]>()\n\n for (const meta of metas) {\n for (const column of meta.columns) {\n if (column.enumValues?.length) {\n enumBySymbol.set(column.type, column.enumValues)\n }\n }\n }\n\n const lines = symbols.map((symbol) => {\n const enumValues = enumBySymbol.get(symbol)\n const declarationText = this.normalizeDeclarationToExportText(symbol, Boolean(enumValues))\n\n if (declarationText) {\n return declarationText.replace(/^export declare /, 'export ')\n }\n\n if (!enumValues) {\n throw new Error(`DTOGeneratorService config error: could not generate common type '${symbol}'.`)\n }\n\n return this.createCommonEnumDeclaration(symbol, enumValues)\n })\n\n this.writeFile(this.getCommonTypesFilePath(), `${lines.join('\\n\\n')}\\n`)\n }\n\n protected resolveCommonTypesSourceContent() {\n const commonTypesFilePath = this.getCommonTypesFilePath()\n\n if (!fs.existsSync(commonTypesFilePath)) {\n return null\n }\n\n return fs.readFileSync(commonTypesFilePath, 'utf-8')\n }\n\n protected validateCommonTypeCoverage(metas: EntityMeta[]) {\n const commonTypesContent = this.resolveCommonTypesSourceContent()\n\n if (!commonTypesContent) {\n throw new Error(`DTOGeneratorService config error: common.dto.ts was not generated in '${this.config.dtoOutputDir}'.`)\n }\n\n const missing: string[] = []\n\n for (const meta of metas) {\n const relationTypeNames = new Set(meta.relations.map((relation) => relation.targetDTOName))\n const symbols = this.collectExternalTypeSymbols(meta, relationTypeNames)\n\n for (const symbol of symbols) {\n const pattern = new RegExp(`export\\\\s+(?:enum|type|interface)\\\\s+${symbol}\\\\b`)\n\n if (!pattern.test(commonTypesContent)) {\n const columns = meta.columns.filter((column) => {\n const identifiers: string[] = column.type.match(/\\b[A-Za-z_][A-Za-z0-9_]*\\b/g) ?? []\n\n return identifiers.includes(symbol)\n }).map((column) => column.name)\n\n const uniqueColumns = this.unique(columns)\n missing.push(`${symbol} (used in ${meta.dtoName}.${uniqueColumns.join(', ')})`)\n }\n }\n }\n\n if (missing.length) {\n const details = this.unique(missing).sort((a, b) => a.localeCompare(b)).join('\\n- ')\n\n throw new Error(\n `DTOGeneratorService validation error: generated/common.dto.ts is missing exports for:\\n- ${details}`\n )\n }\n }\n\n protected createDTOIndexContent(metas: EntityMeta[]) {\n const dtoTypeExports = metas\n .map((meta) => {\n return `export type { ${meta.dtoName} } from './${meta.moduleName}.dto${this.config.includeExtensionOnImports ? '.ts' : ''}'`\n })\n .join('\\n')\n\n return `export * from './common.dto${this.config.includeExtensionOnImports ? '.ts' : ''}'\\n${dtoTypeExports}`\n }\n\n protected getMetasWithFilePath(metas: EntityMeta[]) {\n return metas.filter((meta) => {\n return Boolean(meta.filePath)\n })\n }\n\n protected createEntityImports(metas: EntityMeta[]) {\n const metasWithFilePath = this.getMetasWithFilePath(metas)\n\n if (metasWithFilePath.length !== metas.length) {\n return ''\n }\n\n const importMap = new Map<string, Set<string>>()\n\n for (const meta of metasWithFilePath) {\n if (!meta.filePath) {\n continue\n }\n\n const moduleSpecifier = this.createRelativeJSImportPath(this.config.mapperOutputFile, meta.filePath)\n\n if (!importMap.has(moduleSpecifier)) {\n importMap.set(moduleSpecifier, new Set())\n }\n\n importMap.get(moduleSpecifier)?.add(meta.className)\n }\n\n return [...importMap.entries()]\n .sort((a, b) => a[0].localeCompare(b[0]))\n .map(([moduleSpecifier, classNames]) => {\n let newModuleSpecifier = moduleSpecifier\n\n if (!this.config.includeExtensionOnImports) {\n newModuleSpecifier = newModuleSpecifier.replace('.ts', '')\n }\n\n return `import { ${[...classNames].sort((a, b) => a.localeCompare(b)).join(', ')} } from '${newModuleSpecifier}'`\n })\n .join('\\n')\n }\n\n protected getMapperEntityTypeName(meta: EntityMeta) {\n return meta.filePath ? meta.className : `${meta.className}EntityLike`\n }\n\n protected createStructuralEntityTypes(metas: EntityMeta[]) {\n if (this.getMetasWithFilePath(metas).length === metas.length) {\n return ''\n }\n\n return metas.map((meta) => {\n return `type ${meta.className}EntityLike = Record<string, any>`\n }).join('\\n')\n }\n\n protected createGeneratedMapperContent(metas: EntityMeta[]) {\n const entityImports = this.createEntityImports(metas)\n const dtoImports = `import type { ${metas.map((meta) => meta.dtoName).join(', ')} } from '${this.config.sharedDTOImportPath}'`\n const structuralTypes = this.createStructuralEntityTypes(metas)\n const mapperFunctions = metas.map((meta) => {\n return this.createMapperFunctionContent(meta, metas)\n })\n const blocks = [\n entityImports,\n dtoImports,\n structuralTypes,\n mapperFunctions.join('\\n\\n')\n ].filter(Boolean)\n\n let contents = `${blocks.join('\\n')}\\n\\n`\n\n const dtoDateContent = `export function toDTODate(value: Date | string): string\nexport function toDTODate(value: Date | string | null | undefined): string | null\nexport function toDTODate(value: Date | string | null | undefined) {\n if (!value) {\n return null\n }\n\n if (value instanceof Date) {\n return value.toISOString()\n }\n\n return value\n}\n`\n contents += dtoDateContent\n\n return contents\n }\n\n protected createMapperFunctionContent(meta: EntityMeta, metas: EntityMeta[]) {\n const validRelations = this.getValidRelations(meta, metas)\n const entityTypeName = this.getMapperEntityTypeName(meta)\n\n const columnLines = meta.columns.map((column) => {\n let value = `entity.${column.name}`\n\n if (column.isDate) {\n value = `toDTODate(entity.${column.name})`\n } else if (column.mapAsNumber) {\n value = column.type.includes('null')\n ? `entity.${column.name} === null || entity.${column.name} === undefined ? null : Number(entity.${column.name})`\n : `Number(entity.${column.name})`\n }\n\n return ` ${column.name}: ${value}`\n })\n\n const relationLines = validRelations.map((relation) => {\n return this.createRelationMapperLine(relation, metas)\n })\n\n const relationBlock = relationLines.length ? `\\n${relationLines.join('\\n\\n')}\\n` : ''\n\n return `export function ${meta.mapperName}(entity: ${entityTypeName}): ${meta.dtoName} {\\n const dto: ${meta.dtoName} = {\\n${columnLines.join(',\\n')}\\n }\\n${relationBlock}\\n return dto\\n}\\n\\nexport function ${meta.mapperName}Array(entities: ${entityTypeName}[]): ${meta.dtoName}[] {\\n return entities.map(${meta.mapperName})\\n\\n}`\n }\n\n protected createRelationMapperLine(relation: RelationMeta, metas: EntityMeta[]) {\n const targetMeta = this.findMetaByClassName(metas, relation.targetClassName)\n const parserName = targetMeta?.mapperName\n\n if (relation.isArray) {\n return ` if (Array.isArray(entity.${relation.name})) {\\n dto.${relation.name} = entity.${relation.name}.map(${parserName})\\n }`\n }\n\n if (relation.nullable) {\n return ` if (entity.${relation.name} !== undefined) {\\n dto.${relation.name} = entity.${relation.name} === null ? null : ${parserName}(entity.${relation.name})\\n }`\n }\n\n return ` if (entity.${relation.name} !== undefined && entity.${relation.name} !== null) {\\n dto.${relation.name} = ${parserName}(entity.${relation.name})\\n }`\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,kBAAiB;AACjB,sBAAgG;AAmCzF,IAAM,mBAAN,MAAuB;AAAA,EACV;AAAA,EACG;AAAA,EACA,wBAAwB,oBAAI,IAA8B;AAAA,EAE7E,YAAY,QAAoB;AAC5B,SAAK,SAAS,KAAK,aAAa,MAAM;AACtC,SAAK,UAAU,IAAI,wBAAQ;AAAA,MACvB,6BAA6B;AAAA,IACjC,CAAC;AAAA,EACL;AAAA,EAEA,MAAM,MAA+B;AACjC,SAAK,qBAAqB;AAC1B,UAAM,QAAQ,MAAM,KAAK,kBAAkB;AAE3C,cAAAA,QAAG,OAAO,KAAK,OAAO,cAAc;AAAA,MAChC,WAAW;AAAA,MACX,OAAO;AAAA,IACX,CAAC;AAED,cAAAA,QAAG,UAAU,KAAK,OAA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