09404db559
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
1.7 KiB
JavaScript
60 lines
1.7 KiB
JavaScript
export const name = "Raptor";
|
|
export const url = "https://status.raptortech.com/";
|
|
|
|
const API_URL =
|
|
"https://status.raptortech.com/1.0/status/6501d5abfab4ce052d52e315";
|
|
|
|
// Status.io status_code → dashboard status
|
|
function mapStatusCode(code) {
|
|
if (code === 100) return "operational";
|
|
if (code === 200) return "degraded"; // planned maintenance
|
|
if (code >= 300 && code < 500) return "degraded"; // degraded / partial disruption
|
|
if (code >= 500) return "outage"; // service disruption / security event
|
|
return "unknown";
|
|
}
|
|
|
|
export async function checkStatus() {
|
|
const res = await fetch(API_URL);
|
|
|
|
if (!res.ok) {
|
|
throw new Error(`Raptor status request failed (${res.status})`);
|
|
}
|
|
|
|
const data = await res.json();
|
|
const result = data.result ?? {};
|
|
const overall = result.status_overall ?? {};
|
|
const status = mapStatusCode(overall.status_code);
|
|
|
|
const incidents = result.incidents ?? [];
|
|
|
|
// Only surface incidents still being actively investigated or identified.
|
|
// State 300 = Monitoring (fix deployed), 400 = Resolved — exclude both.
|
|
const activeIncidents = incidents.filter((i) => {
|
|
const messages = i.messages ?? [];
|
|
if (messages.length === 0) return true;
|
|
const latestState = messages[messages.length - 1].state;
|
|
return latestState < 300;
|
|
});
|
|
|
|
let message;
|
|
if (activeIncidents.length > 0) {
|
|
message = activeIncidents
|
|
.map((i) => {
|
|
const components = (i.containers_affected ?? [])
|
|
.map((c) => c.name)
|
|
.join(", ");
|
|
return components ? `${i.name} (${components})` : i.name;
|
|
})
|
|
.join(" | ");
|
|
} else {
|
|
message = overall.status ?? "All services operational.";
|
|
}
|
|
|
|
return {
|
|
name,
|
|
status,
|
|
message,
|
|
lastUpdated: new Date().toISOString(),
|
|
};
|
|
}
|