tighten validation, add tests

This commit is contained in:
Alex committed 2026-05-11 10:12:27 -07:00
1 parent 272e4b5014
commit 08043a5ea0
7 files changed
+194 -109

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
import { z } from "zod";
import { booleanCoercion } from "./shared.js";
import { GeoContinents } from "@/types/geoCheck.js";
import { MonitorTypes } from "@/types/monitor.js";
//****************************************
// Check Validations
@@ -11,7 +12,7 @@ export const getChecksParamValidation = z.object({
});
export const getChecksQueryValidation = z.object({
type: z.enum(["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "dns"]).optional(),
type: z.enum(MonitorTypes).optional(),
sortOrder: z.enum(["asc", "desc"]),
limit: z.coerce.number().optional(),
dateRange: z.enum(["recent", "hour", "day", "week", "month", "all"]),