2022-04-01 23:55:41 +00:00
|
|
|
import { z } from "zod";
|
2022-03-26 23:58:22 +00:00
|
|
|
|
2022-04-02 00:09:04 +00:00
|
|
|
import { _SelectedCalendarModel as SelectedCalendar } from "@calcom/prisma/zod";
|
2022-03-30 14:56:24 +00:00
|
|
|
|
2022-04-01 23:55:41 +00:00
|
|
|
export const schemaSelectedCalendarBaseBodyParams = SelectedCalendar.omit({ userId: true }).partial();
|
2022-03-30 14:56:24 +00:00
|
|
|
|
2022-04-01 23:55:41 +00:00
|
|
|
export const schemaSelectedCalendarPublic = SelectedCalendar.omit({});
|
|
|
|
|
|
|
|
const schemaSelectedCalendarRequiredParams = z.object({
|
|
|
|
externalId: z.string(),
|
|
|
|
integration: z.string(),
|
|
|
|
user: z.object({
|
|
|
|
connect: z.object({
|
|
|
|
id: z.number().optional(),
|
|
|
|
username: z.string().optional(),
|
|
|
|
email: z.string().optional(),
|
|
|
|
}),
|
2022-04-02 00:09:04 +00:00
|
|
|
// FIXME: Provide valid UserModel schema here, but not sure how yet.
|
2022-04-01 23:55:41 +00:00
|
|
|
create: z.any(),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const schemaSelectedCalendarBodyParams = schemaSelectedCalendarBaseBodyParams.merge(
|
|
|
|
schemaSelectedCalendarRequiredParams
|
|
|
|
);
|