Skip to content

Open-source status page, incident response and uptime monitoring

bug api dns (#1571)

Thibault Le Ouay06e6e1cf5898
diff --git a/apps/server/src/routes/v1/monitors/schema.ts b/apps/server/src/routes/v1/monitors/schema.ts
index d584d6e10..36304e002 100644
--- a/apps/server/src/routes/v1/monitors/schema.ts
+++ b/apps/server/src/routes/v1/monitors/schema.ts
@@ -61,10 +61,22 @@ const _jsonBodyAssertion = z.object({
target: z.string(),
});
+export const dnsRecords = ["A", "AAAA", "CNAME", "MX", "TXT", "NS"] as const;
+
+export const recordAssertion = z
+ .object({
+ type: z.literal("dnsRecord"),
+ key: z.enum(dnsRecords),
+ compare: recordCompare,
+ target: z.string(),
+ })
+ .openapi({ description: "The DNS record assertion" });
+
export const assertion = z.discriminatedUnion("type", [
statusAssertion,
headerAssertion,
textBodyAssertion,
+ recordAssertion,
// jsonBodyAssertion,
]);