Files
formbricks/packages/database/zod/webhooks.ts
Piyush Gupta e691c076a1 chore: adds webhook types (#4606)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com>
2025-01-24 12:23:07 +00:00

15 lines
490 B
TypeScript

import type { Webhook } from "@prisma/client";
import { z } from "zod";
export const ZWebhook = z.object({
id: z.string().cuid2(),
name: z.string().nullable(),
createdAt: z.date(),
updatedAt: z.date(),
url: z.string().url(),
source: z.enum(["user", "zapier", "make", "n8n"]),
environmentId: z.string().cuid2(),
triggers: z.array(z.enum(["responseFinished", "responseCreated", "responseUpdated"])),
surveyIds: z.array(z.string().cuid2()),
}) satisfies z.ZodType<Webhook>;