From 41689ecc9262d615c3a0a115563e6225cd2c3b53 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 18 Oct 2022 13:55:31 -0600 Subject: [PATCH] Type fixes --- packages/app-store/huddle01video/lib/VideoApiAdapter.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-store/huddle01video/lib/VideoApiAdapter.ts b/packages/app-store/huddle01video/lib/VideoApiAdapter.ts index 1850a34ca4..00760f30e2 100644 --- a/packages/app-store/huddle01video/lib/VideoApiAdapter.ts +++ b/packages/app-store/huddle01video/lib/VideoApiAdapter.ts @@ -1,8 +1,12 @@ +import z from "zod"; + import { handleErrorsJson } from "@calcom/lib/errors"; import { randomString } from "@calcom/lib/random"; import type { PartialReference } from "@calcom/types/EventManager"; import type { VideoApiAdapter, VideoCallData } from "@calcom/types/VideoApiAdapter"; +const huddle01Schema = z.object({ url: z.string().url(), roomId: z.string() }); + const Huddle01VideoApiAdapter = (): VideoApiAdapter => { return { getAvailability: () => { @@ -13,7 +17,8 @@ const Huddle01VideoApiAdapter = (): VideoApiAdapter => { "https://wpss2zlpb9.execute-api.us-east-1.amazonaws.com/new-meeting?utmCampaign=cal.com&utmSource=partner&utmMedium=calendar" ); - const { url } = await handleErrorsJson(res); + const json = await handleErrorsJson(res); + const { url } = huddle01Schema.parse(json); return Promise.resolve({ type: "huddle01_video",