@samiyev/guardian
Version:
Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W
47 lines • 1.55 kB
TypeScript
import { ValueObject } from "./ValueObject";
interface EntityExposureProps {
readonly entityName: string;
readonly returnType: string;
readonly filePath: string;
readonly layer: string;
readonly line?: number;
readonly methodName?: string;
}
/**
* Represents an entity exposure violation in the codebase
*
* Entity exposure occurs when a domain entity is directly exposed in API responses
* instead of using DTOs (Data Transfer Objects). This violates the separation of concerns
* and can lead to exposing internal domain logic to external clients.
*
* @example
* ```typescript
* // Bad: Controller returning domain entity
* const exposure = EntityExposure.create(
* 'User',
* 'User',
* 'src/infrastructure/controllers/UserController.ts',
* 'infrastructure',
* 25,
* 'getUser'
* )
*
* console.log(exposure.getMessage())
* // "Method 'getUser' returns domain entity 'User' instead of DTO"
* ```
*/
export declare class EntityExposure extends ValueObject<EntityExposureProps> {
private constructor();
static create(entityName: string, returnType: string, filePath: string, layer: string, line?: number, methodName?: string): EntityExposure;
get entityName(): string;
get returnType(): string;
get filePath(): string;
get layer(): string;
get line(): number | undefined;
get methodName(): string | undefined;
getMessage(): string;
getSuggestion(): string;
getExampleFix(): string;
}
export {};
//# sourceMappingURL=EntityExposure.d.ts.map