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.5 kB ยท 55 lines
TypeScript
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import { createInsertSchema, createSelectSchema } from "drizzle-zod";import * as z from "zod";
import { statusReport, statusReportStatus, statusReportUpdate,} from "./status_reports";
export const statusReportStatusSchema = z.enum(statusReportStatus);
export const insertStatusReportUpdateSchema = createInsertSchema( statusReportUpdate, { status: statusReportStatusSchema, },).extend({ date: z.coerce.date().prefault(new Date()),});
export const insertStatusReportSchema = createInsertSchema(statusReport, { status: statusReportStatusSchema,}) .extend({ date: z.coerce.date().prefault(new Date()), /** * relationship to monitors and pages */ monitors: z.number().array().prefault([]), }) .extend({ /** * message for the `InsertIncidentUpdate` */ message: z.string(), });
export const selectStatusReportSchema = createSelectSchema(statusReport, { status: statusReportStatusSchema,});
export const selectStatusReportUpdateSchema = createSelectSchema( statusReportUpdate, { status: statusReportStatusSchema, },);
export type InsertStatusReport = z.infer<typeof insertStatusReportSchema>;export type StatusReport = z.infer<typeof selectStatusReportSchema>;export type InsertStatusReportUpdate = z.infer< typeof insertStatusReportUpdateSchema>;export type StatusReportUpdate = z.infer<typeof selectStatusReportUpdateSchema>;export type StatusReportStatus = z.infer<typeof statusReportStatusSchema>;