/** * API Contract Validator - Validates APIs against defined contracts * * Prevents frontend-backend authentication mismatches like the 401 bug * that slipped into Shop.Solar production. * * 3-Phase Validation: * 1. Static Analysis - Code analysis without execution * 2. Runtime Testing - Execute requests in different auth states * 3. Authentication Matrix - Comprehensive auth state testing */ import { APIContract, APIContractValidationResult, APIContractValidatorConfig } from '../types/api-contracts'; export declare class APIContractValidator { private config; constructor(config: APIContractValidatorConfig); /** * Validate a single API contract */ validateContract(contract: APIContract): Promise; /** * Phase 1: Static Analysis * Analyze code without execution */ private validateStaticContract; /** * Phase 2: Runtime Testing * Execute requests in different auth states */ private validateRuntimeContract; /** * Find backend route implementation */ private findBackendImplementation; /** * Detect backend framework from file path and content */ private detectFramework; /** * Analyze backend authentication patterns */ private analyzeBackendAuth; /** * Find frontend API usage */ private findFrontendUsage; /** * Recursively search directory for API usage */ private searchDirectoryForAPIUsage; /** * Detect if authentication header is included */ private detectAuthHeader; /** * Detect if error handling exists */ private detectErrorHandling; /** * Detect auth check in context */ private detectAuthCheck; /** * Detect component context (public/protected) */ private detectContext; /** * Extract HTTP method from line */ private extractMethod; /** * Test endpoint in specific auth state */ private testEndpoint; /** * Get authentication headers for auth state */ private getAuthHeaders; } //# sourceMappingURL=api-contract-validator.d.ts.map