2023-04-25 22:39:47 +00:00
|
|
|
import { z } from "zod";
|
|
|
|
|
|
|
|
import { WEBHOOK_TRIGGER_EVENTS } from "@calcom/features/webhooks/lib/constants";
|
|
|
|
|
|
|
|
import { webhookIdAndEventTypeIdSchema } from "./types";
|
|
|
|
|
|
|
|
export const ZCreateInputSchema = webhookIdAndEventTypeIdSchema.extend({
|
|
|
|
subscriberUrl: z.string().url(),
|
|
|
|
eventTriggers: z.enum(WEBHOOK_TRIGGER_EVENTS).array(),
|
|
|
|
active: z.boolean(),
|
|
|
|
payloadTemplate: z.string().nullable(),
|
|
|
|
eventTypeId: z.number().optional(),
|
|
|
|
appId: z.string().optional().nullable(),
|
|
|
|
secret: z.string().optional().nullable(),
|
2023-05-23 01:15:29 +00:00
|
|
|
teamId: z.number().optional(),
|
2023-04-25 22:39:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export type TCreateInputSchema = z.infer<typeof ZCreateInputSchema>;
|