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.
TypeScript
12345678910111213141516171819202122232425262728293031323334353637import { monitorRegionSchema } from "@openstatus/db/src/schema/constants";import { z } from "zod";
export const tcpPayload = z.object({ workspaceId: z.string(), monitorId: z.string(), url: z.string(), cronTimestamp: z.number(), timeout: z.number().prefault(45000), degradedAfter: z.number().nullable(),});
export const TCPResponse = z.object({ type: z.literal("tcp").prefault("tcp"), requestId: z.number().optional(), workspaceId: z.number().optional(), monitorId: z.number().optional(), timestamp: z.number(), timing: z.object({ tcpStart: z.number(), tcpDone: z.number(), }), error: z.string().optional(), region: monitorRegionSchema, latency: z.number().optional(),});
export const TCPResponseTest = TCPResponse.extend({ state: z.literal("success").prefault("success"),}).or( z.object({ type: z.literal("tcp").prefault("tcp"), state: z.literal("error").prefault("error"), }),);export type tcpPayload = z.infer<typeof tcpPayload>;