feat(interfaces): add structured data models and discriminated check configs; migrate tooling and package metadata
This commit is contained in:
64
ts/data/servicestatus.ts
Normal file
64
ts/data/servicestatus.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { TStatusType, TStatusMode, TCheckType } from './types.js';
|
||||
|
||||
// ============================================
|
||||
// Service Status
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Represents the status of a monitored service.
|
||||
*/
|
||||
export interface IServiceStatus {
|
||||
id: string;
|
||||
name: string;
|
||||
displayName: string;
|
||||
description?: string;
|
||||
|
||||
// Current state
|
||||
currentStatus: TStatusType;
|
||||
lastChecked: number;
|
||||
responseTime: number;
|
||||
|
||||
// Uptime metrics
|
||||
uptime30d: number;
|
||||
uptime90d: number;
|
||||
|
||||
// Organization
|
||||
category?: string;
|
||||
dependencies?: string[];
|
||||
|
||||
// Status management
|
||||
statusMode: TStatusMode;
|
||||
manualStatus?: TStatusType;
|
||||
paused: boolean;
|
||||
|
||||
// Check configuration
|
||||
checkType?: TCheckType;
|
||||
checkCollectionId?: string;
|
||||
intervalMs?: number;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Status History
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* A point in the status history timeline.
|
||||
*/
|
||||
export interface IStatusHistoryPoint {
|
||||
timestamp: number;
|
||||
status: TStatusType;
|
||||
responseTime?: number;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Overall Status
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Aggregate status for a group of services or entire status page.
|
||||
*/
|
||||
export interface IOverallStatus {
|
||||
status: TStatusType;
|
||||
message?: string;
|
||||
lastUpdated: number;
|
||||
}
|
||||
Reference in New Issue
Block a user