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>
This commit is contained in:
Piyush Gupta
2025-01-24 17:53:07 +05:30
committed by GitHub
parent ad842e0e80
commit e691c076a1
35 changed files with 481 additions and 370 deletions
+14
View File
@@ -0,0 +1,14 @@
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>;