From 19f2197eefde156a385a01a2b6f938e863facfc8 Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Fri, 4 Apr 2025 10:35:12 -0300 Subject: [PATCH] Vital and libphonenumber-js (#20547) --- packages/app-store/vital/lib/client.ts | 2 +- packages/features/bookings/lib/getBookingResponsesSchema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-store/vital/lib/client.ts b/packages/app-store/vital/lib/client.ts index 5ae7384218..ec7d025fee 100644 --- a/packages/app-store/vital/lib/client.ts +++ b/packages/app-store/vital/lib/client.ts @@ -1,3 +1,4 @@ +import { VitalClient } from "@tryvital/vital-node"; import type { ClientConfig } from "@tryvital/vital-node/dist/lib/models"; import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug"; @@ -22,7 +23,6 @@ export async function initVitalClient() { ) throw Error("Missing properties in vital-automation DB keys"); vitalEnv = appKeys; - const { VitalClient } = await import("@tryvital/vital-node"); vitalClient = new VitalClient({ region: appKeys.region, api_key: appKeys.api_key || "", diff --git a/packages/features/bookings/lib/getBookingResponsesSchema.ts b/packages/features/bookings/lib/getBookingResponsesSchema.ts index 24fff7905c..bb3a18d014 100644 --- a/packages/features/bookings/lib/getBookingResponsesSchema.ts +++ b/packages/features/bookings/lib/getBookingResponsesSchema.ts @@ -1,3 +1,4 @@ +import { isValidPhoneNumber } from "libphonenumber-js"; import z from "zod"; import type { ALL_VIEWS } from "@calcom/features/form-builder/schema"; @@ -144,7 +145,6 @@ function preprocess({ const phoneSchema = isPartialSchema ? z.string() : z.string().refine(async (val) => { - const { isValidPhoneNumber } = await import("libphonenumber-js"); return isValidPhoneNumber(val); }); // Tag the message with the input name so that the message can be shown at appropriate place