feat(interfaces): add structured data models and discriminated check configs; migrate tooling and package metadata
This commit is contained in:
63
ts/data/types.ts
Normal file
63
ts/data/types.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Shared type definitions for uptime.link
|
||||
*/
|
||||
|
||||
// ============================================
|
||||
// Status Types
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Status types for monitors/services
|
||||
*/
|
||||
export type TStatusType =
|
||||
| 'operational'
|
||||
| 'degraded'
|
||||
| 'partial_outage'
|
||||
| 'major_outage'
|
||||
| 'maintenance'
|
||||
| 'initializing'
|
||||
| 'error'
|
||||
| 'paused';
|
||||
|
||||
/**
|
||||
* Check types (discriminant values for TCheck union)
|
||||
*/
|
||||
export type TCheckType = 'assumption' | 'function' | 'pwa' | 'pagerank';
|
||||
|
||||
/**
|
||||
* Status mode for monitors - auto follows checks, manual is user-set
|
||||
*/
|
||||
export type TStatusMode = 'auto' | 'manual';
|
||||
|
||||
// ============================================
|
||||
// Incident Types
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Incident severity levels
|
||||
*/
|
||||
export type TIncidentSeverity = 'critical' | 'major' | 'minor' | 'maintenance';
|
||||
|
||||
/**
|
||||
* Incident status workflow
|
||||
*/
|
||||
export type TIncidentStatus =
|
||||
| 'investigating'
|
||||
| 'identified'
|
||||
| 'monitoring'
|
||||
| 'resolved'
|
||||
| 'postmortem';
|
||||
|
||||
// ============================================
|
||||
// Check Result Types (used by execution)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Result status for check execution
|
||||
*/
|
||||
export type TCheckResultStatus = 'ok' | 'not ok' | 'timed out';
|
||||
|
||||
/**
|
||||
* Last result state for a check
|
||||
*/
|
||||
export type TCheckLastResult = 'success' | 'failure' | 'pending';
|
||||
Reference in New Issue
Block a user