cal.pub0.org/packages/trpc/server/routers/viewer/webhook/edit.schema.ts

19 lines
641 B
TypeScript
Raw Normal View History

import { z } from "zod";
import { WEBHOOK_TRIGGER_EVENTS } from "@calcom/features/webhooks/lib/constants";
import { webhookIdAndEventTypeIdSchema } from "./types";
export const ZEditInputSchema = webhookIdAndEventTypeIdSchema.extend({
id: z.string(),
subscriberUrl: z.string().url().optional(),
eventTriggers: z.enum(WEBHOOK_TRIGGER_EVENTS).array().optional(),
active: z.boolean().optional(),
payloadTemplate: z.string().nullable(),
eventTypeId: z.number().optional(),
appId: z.string().optional().nullable(),
secret: z.string().optional().nullable(),
});
export type TEditInputSchema = z.infer<typeof ZEditInputSchema>;