feat: Enhance security metrics handling with new thresholds and improved messaging

This commit is contained in:
Dries Augustyns
2026-04-15 20:55:42 +02:00
parent e3395083db
commit c0b2abaeca
5 changed files with 538 additions and 201 deletions
+10 -11
View File
@@ -14,26 +14,25 @@ export interface SecurityStatus {
projectId: string;
isHealthy: boolean;
shouldDisable: boolean;
twentyFourHour: SecurityRateData;
sevenDay: SecurityRateData;
allTime: SecurityRateData;
isNewProject: boolean;
violations: string[];
warnings: string[];
}
export interface SecurityThresholds {
MIN_EMAILS_FOR_ENFORCEMENT: number;
BOUNCE_7DAY_WARNING: number;
BOUNCE_7DAY_CRITICAL: number;
BOUNCE_ALLTIME_WARNING: number;
BOUNCE_ALLTIME_CRITICAL: number;
COMPLAINT_7DAY_WARNING: number;
COMPLAINT_7DAY_CRITICAL: number;
COMPLAINT_ALLTIME_WARNING: number;
COMPLAINT_ALLTIME_CRITICAL: number;
export type SecurityLevel = 'healthy' | 'warning' | 'critical';
export interface SecurityMetricLevels {
bounce7Day: SecurityLevel;
bounceAllTime: SecurityLevel;
complaint7Day: SecurityLevel;
complaintAllTime: SecurityLevel;
}
export interface ProjectSecurityMetrics {
status: SecurityStatus;
thresholds: SecurityThresholds;
levels: SecurityMetricLevels;
isDisabled: boolean;
}