* 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 <zomars@me.com> * 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 <zomars@me.com>
9 lines
326 B
TypeScript
9 lines
326 B
TypeScript
import { z } from "zod";
|
|
|
|
import { isSupportedTimeZone } from "./index";
|
|
|
|
// Schema for validating IANA timezone strings compatible with Intl.DateTimeFormat
|
|
export const timeZoneSchema = z.string().refine((timeZone) => isSupportedTimeZone(timeZone), {
|
|
message: "Invalid timezone. Must be a valid IANA timezone string.",
|
|
});
|