weaver-frontend-cli
Version:
🕷️ Weaver CLI - Generador completo de arquitectura Clean Architecture con parser OpenAPI avanzado para entidades CRUD y flujos de negocio complejos
90 lines • 2.65 kB
TypeScript
export interface EntityField {
name: string;
type: string;
required: boolean;
format?: string;
description?: string;
maxLength?: number;
isArray?: boolean;
isEnum?: boolean;
enumValues?: string[];
nestedFields?: EntityField[];
isPathParam?: boolean;
}
export interface EntitySchema {
name: string;
description?: string;
fields: EntityField[];
operations: {
create?: boolean;
read?: boolean;
update?: boolean;
delete?: boolean;
list?: boolean;
};
businessOperations?: {
operationId: string;
method: string;
path: string;
summary?: string;
requestSchema?: string;
responseSchema?: string;
fields: EntityField[];
responseFields?: EntityField[];
isResponseArray?: boolean;
pathParameters?: EntityField[];
}[];
}
export declare class SwaggerAnalyzer {
private openApiDoc;
private detectedApiName;
loadFromUrl(url: string): Promise<void>;
getAvailableEntities(): string[];
/**
* Obtiene los servicios de negocio disponibles basándose en tags que NO tienen CRUD completo
* o que tienen diferente a 5 métodos HTTP
*/
getAvailableBusinessServices(): string[];
/**
* Mapea un método HTTP y path a una operación CRUD
*/
private mapHttpMethodToCrud;
/**
* Verifica si un conjunto de operaciones incluye CRUD completo
*/
private hasCompleteCrudOperations;
/**
* Obtiene el schema de un servicio de negocio basándose en sus operaciones Request/Response
*/
getBusinessServiceSchema(serviceName: string): EntitySchema | null;
getEntitySchema(entityName: string): EntitySchema | null;
private isEntitySchema;
private extractEntityName;
private hasEntityOperations;
private extractFields;
private parseFieldSchema;
private getTypeFromSchema;
private analyzeOperations;
/**
* Detecta el nombre de la API basándose en el título, URL base o paths
*/
private detectApiName;
/**
* Obtiene el nombre de la API detectado
*/
getDetectedApiName(): string | null;
/**
* Sugiere posibles nombres de API basándose en análisis
*/
suggestApiNames(): string[];
printEntityInfo(entityName: string): void;
/**
* Genera campos de respuesta basándose en el contexto de la operación
*/
private generateContextualResponseFields;
/**
* Parsea un campo resolviendo referencias $ref y allOf
*/
private parseFieldSchemaWithRefs;
}
//# sourceMappingURL=swagger-parser.d.ts.map