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.
1.2 kB ยท 41 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142import { createInsertSchema, createSelectSchema } from "drizzle-zod";import { z } from "zod";
import { frozenMonitorUptime } from "./frozen_monitor_uptime";
export const frozenMonitorUptimeDaySchema = z.object({ day: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "day must be YYYY-MM-DD"), // UTC ok: z.number().int().nonnegative(), degraded: z.number().int().nonnegative(), error: z.number().int().nonnegative(),});export type FrozenMonitorUptimeDay = z.infer< typeof frozenMonitorUptimeDaySchema>;
// YYYY-MM-01, UTC first-of-monthexport const frozenMonitorUptimeMonthSchema = z .string() .regex(/^\d{4}-\d{2}-01$/, "month must be YYYY-MM-01");
export const selectFrozenMonitorUptimeSchema = createSelectSchema( frozenMonitorUptime, { days: frozenMonitorUptimeDaySchema.array(), month: frozenMonitorUptimeMonthSchema, },);export type FrozenMonitorUptime = z.infer< typeof selectFrozenMonitorUptimeSchema>;
export const insertFrozenMonitorUptimeSchema = createInsertSchema( frozenMonitorUptime, { days: frozenMonitorUptimeDaySchema.array(), month: frozenMonitorUptimeMonthSchema, },);export type InsertFrozenMonitorUptime = z.infer< typeof insertFrozenMonitorUptimeSchema>;