137 lines
3.3 KiB
TypeScript
137 lines
3.3 KiB
TypeScript
// Re-export interfaces from the public catalog for consistency
|
|
|
|
// Status types
|
|
export type TStatusType = 'operational' | 'degraded' | 'partial_outage' | 'major_outage' | 'maintenance' | 'initializing' | 'error' | 'paused';
|
|
export type TCheckType = 'assumption' | 'function' | 'pwa' | 'pagerank';
|
|
export type TStatusMode = 'auto' | 'manual';
|
|
|
|
// Check configuration interface
|
|
export interface ICheckConfig {
|
|
domain: string;
|
|
// Assumption check fields
|
|
expectedTitle?: string;
|
|
expectedStatusCode?: string;
|
|
expectedDescription?: string;
|
|
// Function check fields
|
|
functionDef?: string;
|
|
// PageRank check fields
|
|
searchTerm?: string;
|
|
checkBing?: boolean;
|
|
checkGoogle?: boolean;
|
|
bingMinRank?: number;
|
|
googleMinRank?: number;
|
|
}
|
|
|
|
export interface IServiceStatus {
|
|
id: string;
|
|
name: string;
|
|
displayName: string;
|
|
description?: string;
|
|
currentStatus: TStatusType;
|
|
lastChecked: number;
|
|
uptime30d: number;
|
|
uptime90d: number;
|
|
responseTime: number;
|
|
category?: string;
|
|
dependencies?: string[];
|
|
selected?: boolean;
|
|
// Status management
|
|
statusMode?: TStatusMode;
|
|
manualStatus?: TStatusType;
|
|
paused?: boolean;
|
|
// Check configuration
|
|
checkType?: TCheckType;
|
|
checkConfig?: ICheckConfig;
|
|
intervalMs?: number;
|
|
}
|
|
|
|
export interface IStatusHistoryPoint {
|
|
timestamp: number;
|
|
status: TStatusType;
|
|
responseTime?: number;
|
|
errorRate?: number;
|
|
}
|
|
|
|
export interface IIncidentUpdate {
|
|
id: string;
|
|
timestamp: number;
|
|
status: 'investigating' | 'identified' | 'monitoring' | 'resolved' | 'postmortem';
|
|
message: string;
|
|
author?: string;
|
|
}
|
|
|
|
export interface IIncidentDetails {
|
|
id: string;
|
|
title: string;
|
|
status: 'investigating' | 'identified' | 'monitoring' | 'resolved' | 'postmortem';
|
|
severity: 'critical' | 'major' | 'minor' | 'maintenance';
|
|
affectedServices: string[];
|
|
startTime: number;
|
|
endTime?: number;
|
|
updates: IIncidentUpdate[];
|
|
impact: string;
|
|
rootCause?: string;
|
|
resolution?: string;
|
|
}
|
|
|
|
export interface IOverallStatus {
|
|
status: TStatusType;
|
|
message: string;
|
|
lastUpdated: number;
|
|
affectedServices: number;
|
|
totalServices: number;
|
|
}
|
|
|
|
export interface IStatusPageConfig {
|
|
apiEndpoint?: string;
|
|
refreshInterval?: number;
|
|
timeZone?: string;
|
|
dateFormat?: string;
|
|
enableWebSocket?: boolean;
|
|
enableNotifications?: boolean;
|
|
theme?: 'light' | 'dark' | 'auto';
|
|
language?: string;
|
|
showHistoricalDays?: number;
|
|
whitelabel?: boolean;
|
|
companyName?: string;
|
|
companyLogo?: string;
|
|
supportEmail?: string;
|
|
statusPageUrl?: string;
|
|
legalUrl?: string;
|
|
}
|
|
|
|
// Admin-specific interfaces
|
|
export interface IMonitorFormData {
|
|
id?: string;
|
|
name: string;
|
|
displayName: string;
|
|
description?: string;
|
|
category?: string;
|
|
dependencies?: string[];
|
|
// Status management
|
|
statusMode: TStatusMode;
|
|
manualStatus?: TStatusType;
|
|
paused: boolean;
|
|
// Check configuration
|
|
checkType: TCheckType;
|
|
checkConfig: ICheckConfig;
|
|
intervalMs: number;
|
|
}
|
|
|
|
export interface IIncidentFormData {
|
|
id?: string;
|
|
title: string;
|
|
severity: 'critical' | 'major' | 'minor' | 'maintenance';
|
|
status: 'investigating' | 'identified' | 'monitoring' | 'resolved' | 'postmortem';
|
|
affectedServices: string[];
|
|
impact: string;
|
|
rootCause?: string;
|
|
resolution?: string;
|
|
}
|
|
|
|
export interface IIncidentUpdateFormData {
|
|
status: 'investigating' | 'identified' | 'monitoring' | 'resolved' | 'postmortem';
|
|
message: string;
|
|
author?: string;
|
|
}
|