Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
2.0 kB ยท 75 lines
TypeScript
at incident-api
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import { z } from "zod";
/** * The schema for the monitor.recovered action. * It represents the event when a monitor has recovered from a failure. */export const monitorRecoveredSchema = z.object({ action: z.literal("monitor.recovered"), metadata: z.object({ region: z.string(), statusCode: z.number(), latency: z.number().optional(), cronTimestamp: z.number().optional(), }),});
/** * The schema for the monitor.recovered action. * It represents the event when a monitor has recovered from a failure. */export const monitorDegradedSchema = z.object({ action: z.literal("monitor.degraded"), metadata: z.object({ region: z.string(), statusCode: z.number(), cronTimestamp: z.number().optional(), latency: z.number().optional(), }),});
/** * The schema for the monitor.failed action. * It represents the event when a monitor has failed. */export const monitorFailedSchema = z.object({ action: z.literal("monitor.failed"), metadata: z.object({ region: z.string(), statusCode: z.number().optional(), message: z.string().optional(), latency: z.number().optional(), cronTimestamp: z.number().optional(), }),});
/** * The schema for the notification.send action. * */export const notificationSentSchema = z.object({ action: z.literal("notification.sent"), metadata: z.object({ // we could use the notificationProviderSchema for more type safety provider: z.string(), cronTimestamp: z.number().optional(), type: z.enum(["alert", "recovery", "degraded"]).optional(), notificationId: z.number().optional(), }),});
export const incidentCreatedSchema = z.object({ action: z.literal("incident.created"), metadata: z.object({ cronTimestamp: z.number().optional(), incidentId: z.number().optional(), }),});
export const incidentResolvedSchema = z.object({ action: z.literal("incident.resolved"), metadata: z.object({ cronTimestamp: z.number().optional(), incidentId: z.number().optional(), }),});