@kenniy/godeye-data-contracts
Version:
Enterprise-grade base repository architecture for GOD-EYE microservices with zero overhead and maximum code reuse
57 lines (56 loc) • 1.31 kB
TypeScript
export interface ORMConfig {
type: 'typeorm' | 'mongoose';
entityPath: string;
repositoryPath: string;
modelPath?: string;
}
export declare class RepositoryGenerator {
private templates;
constructor();
/**
* Auto-detect ORM type from current service directory
*/
detectORM(servicePath?: string): ORMConfig;
/**
* Generate repository for specified entity
*/
generateRepository(entityName: string, options?: {
servicePath?: string;
force?: boolean;
}): Promise<{
filePath: string;
content: string;
}>;
/**
* Validate that the entity/model file exists
*/
private validateEntityExists;
/**
* Analyze entity file to extract relations/properties
*/
private analyzeEntity;
/**
* Extract relations from entity file
*/
private extractRelations;
/**
* Extract basic properties from entity file
*/
private extractProperties;
/**
* Update repository index.ts file
*/
private updateRepositoryIndex;
/**
* Load Handlebars templates
*/
private loadTemplates;
/**
* Register Handlebars helpers
*/
private registerHelpers;
/**
* Convert string to kebab-case
*/
private toKebabCase;
}