feat: public status page

This commit is contained in:
2026-08-24 14:53:42 +00:00
parent 3abbdc41d6
commit f4f41e400b
7 changed files with 446 additions and 0 deletions
+69
View File
@@ -1247,3 +1247,72 @@ export interface Skip {
due: string;
at: string;
}
// ---------------------------------------------------------------------------
// Public status page types
//
// These mirror services.StatusSnapshot and friends in
// server/internal/services/statussnapshot.go field for field — that Go file
// is the contract. They back the anonymous /status/[pageId] page, which is
// deliberately outside the (app) route group and never calls `request()`
// (no session, no auth). Task 10 adds the authoring types and api client
// methods alongside these; it must not redeclare this block.
// ---------------------------------------------------------------------------
export interface PublicDay {
date: string;
state: "up" | "down" | "maintenance" | "no_data";
uptime: number;
}
export interface PublicComponent {
name: string;
status: "up" | "down" | "maintenance" | "pending" | "no_data";
uptime_90d: number;
days: PublicDay[];
}
export interface PublicSection {
name: string;
components: PublicComponent[];
}
export interface PublicIncidentUpdate {
at: string;
status: string;
body: string;
}
export interface PublicIncident {
id: string;
kind: string;
title: string;
impact?: string;
status: string;
affected?: string[];
started_at: string;
resolved_at?: string;
scheduled_start?: string;
scheduled_end?: string;
updates?: PublicIncidentUpdate[];
}
export interface PublicBanner {
level: string;
text: string;
}
export interface StatusSnapshot {
available: boolean;
reason?: string;
title: string;
description?: string;
logo_url?: string;
banner?: PublicBanner;
overall: string;
sections: PublicSection[];
active_incidents: PublicIncident[];
upcoming_maintenance: PublicIncident[];
history: PublicIncident[];
generated_at: string;
}