* refactor: replace timeZone string validation with timeZoneSchema - Replace all instances of timeZone: z.string() with timeZoneSchema - Preserve modifiers (.optional(), .default(), .nullish()) where present - Fix VideoApiAdapter to use organizer's timezone value - Remove redundant isSupportedTimeZone import from booking.ts - Add timeZoneSchema import where needed * Update index.ts * fix: conflicts Signed-off-by: Omar López <[email protected]> * Update yarn.lock * Discard changes to yarn.lock * Update booking.ts * Discard changes to packages/platform/types/me.ts * Discard changes to packages/platform/types/me/outputs/me.ts * Discard changes to packages/platform/types/schedules/schedules-2024-04-15/schedules.ts * Discard changes to packages/features/ee/cal-ai-phone/zod-utils.ts --------- Signed-off-by: Omar López <[email protected]>
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { z } from "zod";
|
|
|
|
import { timeZoneSchema } from "@calcom/lib/dayjs/timeZone.schema";
|
|
import { teamMetadataSchema } from "@calcom/prisma/zod-utils";
|
|
|
|
export const ZUpdateInputSchema = z.object({
|
|
name: z.string().optional(),
|
|
orgId: z
|
|
.string()
|
|
.regex(/^\d+$/)
|
|
.transform((id) => parseInt(id))
|
|
.or(z.number())
|
|
.optional(),
|
|
bio: z.string().optional(),
|
|
logoUrl: z.string().optional().nullable(),
|
|
calVideoLogo: z
|
|
.string()
|
|
.optional()
|
|
.nullable()
|
|
.transform((v) => v || null),
|
|
banner: z.string().nullable().optional(),
|
|
slug: z.string().optional(),
|
|
hideBranding: z.boolean().optional(),
|
|
hideBookATeamMember: z.boolean().optional(),
|
|
brandColor: z.string().optional(),
|
|
darkBrandColor: z.string().optional(),
|
|
theme: z.string().optional().nullable(),
|
|
timeZone: timeZoneSchema.optional(),
|
|
weekStart: z.string().optional(),
|
|
timeFormat: z.number().optional(),
|
|
metadata: teamMetadataSchema.unwrap().optional(),
|
|
lockEventTypeCreation: z.boolean().optional(),
|
|
lockEventTypeCreationOptions: z.enum(["DELETE", "HIDE"]).optional(),
|
|
adminGetsNoSlotsNotification: z.boolean().optional(),
|
|
allowSEOIndexing: z.boolean().optional(),
|
|
orgProfileRedirectsToVerifiedDomain: z.boolean().optional(),
|
|
});
|
|
|
|
export type TUpdateInputSchema = z.infer<typeof ZUpdateInputSchema>;
|