UNPKG

nestjs-reverse-engineering

Version:

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

93 lines (92 loc) 2.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_REVERSE_ENGINEERING_CONFIG = void 0; exports.createConfig = createConfig; /** * Default configuration for the reverse engineering library */ exports.DEFAULT_REVERSE_ENGINEERING_CONFIG = { paths: { baseOutput: './src', entities: './src/entities', crud: './src', sql: './sql', dataExport: './data' }, features: { entities: true, crud: true, sql: true, dataExport: false, generateIndex: true }, crud: { framework: 'nestjs', includeValidation: true, includeSwagger: true, includePagination: true, includeFiltering: true, includeSorting: true, includeRelations: false, generateTests: false, authGuards: false, useTypeORM: true, useDTO: true, excludedTables: [], includedTables: undefined }, entities: { useTypeORM: true, includeValidation: true, includeSwagger: true, generateEnums: true, excludedTables: [], includedTables: undefined }, sql: { generateCreateTables: true, generateInserts: true, formatSql: true, includeComments: true }, dataExport: { enableMasking: false, batchSize: 1000, format: 'sql', maskedFields: ['password', 'email', 'phone', 'ssn', 'credit_card'], maxRows: undefined } }; /** * Create a complete configuration by merging user input with defaults */ function createConfig(userConfig) { return { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG, ...userConfig, paths: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.paths, ...userConfig.paths }, features: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.features, ...userConfig.features }, crud: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.crud, ...userConfig.crud }, entities: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.entities, ...userConfig.entities }, sql: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.sql, ...userConfig.sql }, dataExport: { ...exports.DEFAULT_REVERSE_ENGINEERING_CONFIG.dataExport, ...userConfig.dataExport } }; }