@syntropysoft/praetorian
Version:
Praetorian CLI – A universal multi-environment configuration validator for DevSecOps teams. Validate, compare, and secure YAML/ENV files with ease.
85 lines • 2.69 kB
TypeScript
/**
* ValidationOrchestratorRefactored - Clean Architecture with SOLID SRP
*
* This orchestrator now follows Single Responsibility Principle:
* - Orchestrates validation flow only
* - Delegates specific responsibilities to specialized services
* - Uses guard clauses for early validation
* - Employs functional programming patterns
*
* Mutation Score: Expected 90%+ (functional patterns are more testable)
*/
export interface ValidationResult {
success: boolean;
errors?: any[];
warnings?: any[];
summary?: any;
results?: any[];
error?: string;
}
export interface ValidationOptions {
verbose?: boolean;
strict?: boolean;
env?: string;
all?: boolean;
environments?: string;
failFast?: boolean;
ignore_keys?: string[];
required_keys?: string[];
schema_validation?: boolean;
schema_rules?: string[];
}
export interface PraetorianConfig {
files: string[];
ignore_keys?: string[];
required_keys?: string[];
}
export declare class ValidationOrchestratorRefactored {
private readonly environmentManager;
private readonly configLoader;
private readonly structureGenerator;
private readonly validationService;
constructor();
/**
* Orchestrate validation based on options (main entry point)
*/
orchestrateValidation(configPath: string, options: ValidationOptions): Promise<ValidationResult>;
/**
* Check if validation should use environment-based approach (pure function)
*/
private isEnvironmentValidation;
/**
* Validate using environment-based approach
*/
private validateByEnvironments;
/**
* Validate all environments (pure function with async side effects)
*/
private validateAllEnvironments;
/**
* Validate specific environment (pure function with async side effects)
*/
private validateSpecificEnvironment;
/**
* Validate single file configuration
*/
private validateSingleFile;
/**
* Handle missing files by creating empty structures (pure function with async side effects)
*/
private handleMissingFiles;
/**
* Run schema validation on configuration files
*/
private runSchemaValidation;
/**
* Get schema rules based on options
* NOTE: SchemaValidationRule and CommonSchemas were removed as unused
*/
private getSchemaRules;
}
/**
* Run validation with the refactored orchestrator (pure function with async side effects)
*/
export declare function runValidationRefactored(configPath: string, options?: ValidationOptions): Promise<ValidationResult>;
//# sourceMappingURL=ValidationOrchestratorRefactored.d.ts.map