Scheduling infrastructure for absolutely everyone.
import { z } from "zod";
import { WEBHOOK_TRIGGER_EVENTS } from "@calcom/features/webhooks/lib/constants";
import { WebhookVersion } from "@calcom/features/webhooks/lib/interface/IWebhookRepository";
import { webhookIdAndEventTypeIdSchema } from "./types";
const TIME_UNIT = ["DAY", "HOUR", "MINUTE"] as const;
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(),
time: z.number().nullable().optional(),
timeUnit: z.enum(TIME_UNIT).nullable().optional(),
version: z.nativeEnum(WebhookVersion).optional(),
});
export type TEditInputSchema = z.infer<typeof ZEditInputSchema>;