2023-04-25 22:39:47 +00:00
|
|
|
import { z } from "zod";
|
|
|
|
|
|
|
|
import { FULL_NAME_LENGTH_MAX_LIMIT } from "@calcom/lib/constants";
|
2023-08-16 00:27:48 +00:00
|
|
|
import { bookerLayouts, userMetadata } from "@calcom/prisma/zod-utils";
|
|
|
|
|
|
|
|
export const updateUserMetadataAllowedKeys = z.object({
|
|
|
|
sessionTimeout: z.number().optional(), // Minutes
|
|
|
|
defaultBookerLayouts: bookerLayouts.optional(),
|
|
|
|
});
|
2023-04-25 22:39:47 +00:00
|
|
|
|
|
|
|
export const ZUpdateProfileInputSchema = z.object({
|
|
|
|
username: z.string().optional(),
|
|
|
|
name: z.string().max(FULL_NAME_LENGTH_MAX_LIMIT).optional(),
|
|
|
|
email: z.string().optional(),
|
|
|
|
bio: z.string().optional(),
|
|
|
|
avatar: z.string().optional(),
|
|
|
|
timeZone: z.string().optional(),
|
|
|
|
weekStart: z.string().optional(),
|
|
|
|
hideBranding: z.boolean().optional(),
|
|
|
|
allowDynamicBooking: z.boolean().optional(),
|
2023-08-15 00:44:09 +00:00
|
|
|
allowSEOIndexing: z.boolean().optional(),
|
2023-09-19 14:19:36 +00:00
|
|
|
receiveMonthlyDigestEmail: z.boolean().optional(),
|
2023-04-25 22:39:47 +00:00
|
|
|
brandColor: z.string().optional(),
|
|
|
|
darkBrandColor: z.string().optional(),
|
|
|
|
theme: z.string().optional().nullable(),
|
|
|
|
completedOnboarding: z.boolean().optional(),
|
|
|
|
locale: z.string().optional(),
|
|
|
|
timeFormat: z.number().optional(),
|
|
|
|
disableImpersonation: z.boolean().optional(),
|
|
|
|
metadata: userMetadata.optional(),
|
|
|
|
});
|
|
|
|
|
|
|
|
export type TUpdateProfileInputSchema = z.infer<typeof ZUpdateProfileInputSchema>;
|