UNPKG

nestjs-reverse-engineering

Version:

A powerful TypeScript/NestJS library for database reverse engineering, entity generation, and CRUD operations

198 lines 5.68 kB
import { ReverseEngineeringService } from './reverse-engineering.service'; import { EntityGenerationOptions } from './types/database.types'; export declare class ReverseEngineeringController { private readonly reverseEngineeringService; constructor(reverseEngineeringService: ReverseEngineeringService); testConnection(): Promise<{ connected: boolean; dialect: string; version?: string; error?: string; }>; analyzeSchema(): Promise<import("./types/database.types").DatabaseSchema>; getTableList(): Promise<{ tableName: string; tableSchema: string; columnCount: number; }[]>; generateEntities(options: Partial<EntityGenerationOptions>): Promise<{ success: boolean; message: string; outputPath: string; error?: undefined; } | { success: boolean; message: string; error: string; outputPath?: undefined; }>; generateSqlScripts(body: { dialect?: 'postgres' | 'mysql'; schemaName?: string; includeDropIfExists?: boolean; includeCreateIfNotExists?: boolean; outputPath?: string; entitiesPath?: string; }): Promise<{ success: boolean; message: string; tableCount: number; outputPath: string; sqlPreview: string; error?: undefined; } | { success: boolean; message: string; error: string; tableCount?: undefined; outputPath?: undefined; sqlPreview?: undefined; }>; generateUIComponents(outputPath?: string): Promise<{ success: boolean; message: string; outputPath: string; error?: undefined; } | { success: boolean; message: string; error: string; outputPath?: undefined; }>; scanEntityFiles(entitiesPath?: string): Promise<{ success: boolean; count: number; entities: { className: string; fileName: string; filePath: string; }[]; message?: undefined; error?: undefined; } | { success: boolean; message: string; error: string; count?: undefined; entities?: undefined; }>; generateEntityIndex(body: { entitiesPath?: string; }): Promise<{ success: boolean; message: string; outputPath: string; error?: undefined; } | { success: boolean; message: string; error: string; outputPath?: undefined; }>; exportTableData(body: { tables?: string[]; excludeTables?: string[]; batchSize?: number; outputPath?: string; prettyPrint?: boolean; alignValues?: boolean; nullHandling?: 'NULL' | 'DEFAULT' | 'SKIP'; dataMasking?: { enabled: boolean; sensitiveFields?: string[]; maskEmail?: boolean; maskPasswords?: boolean; maskPhones?: boolean; }; whereConditions?: Record<string, string>; }): Promise<{ success: boolean; tableCount: number; totalRows: number; fileCount: number; outputPaths: string[]; statistics: Record<string, { rows: number; batches: number; }>; message: string; error?: undefined; } | { success: boolean; message: string; error: string; }>; generateCrudOperations(body: { outputPath?: string; framework?: 'nestjs' | 'express' | 'fastify'; includeValidation?: boolean; includeSwagger?: boolean; includePagination?: boolean; includeFiltering?: boolean; includeSorting?: boolean; includeRelations?: boolean; generateTests?: boolean; authGuards?: boolean; useTypeORM?: boolean; useDTO?: boolean; tables?: string[]; excludeTables?: string[]; }): Promise<{ success: boolean; tablesProcessed: number; filesGenerated: number; outputPaths: string[]; modules: Array<{ tableName: string; entityName: string; moduleName: string; files: { entity: string; dto: string[]; controller: string; service: string; repository: string; module: string; tests?: string[]; }; }>; message: string; error?: undefined; } | { success: boolean; message: string; error: string; }>; generateCrudForTables(body: { tableNames: string[]; outputPath?: string; framework?: 'nestjs' | 'express' | 'fastify'; includeValidation?: boolean; includeSwagger?: boolean; includePagination?: boolean; includeFiltering?: boolean; includeSorting?: boolean; includeRelations?: boolean; generateTests?: boolean; authGuards?: boolean; useTypeORM?: boolean; useDTO?: boolean; }): Promise<{ success: boolean; tablesProcessed: number; filesGenerated: number; outputPaths: string[]; modules: Array<{ tableName: string; entityName: string; moduleName: string; }>; message: string; error?: undefined; } | { success: boolean; message: string; error: string; }>; } //# sourceMappingURL=reverse-engineering.controller.d.ts.map