diff --git a/apps/web/lib/location.ts b/apps/web/lib/location.ts index 16e4265982..1f632382b7 100644 --- a/apps/web/lib/location.ts +++ b/apps/web/lib/location.ts @@ -1 +1 @@ -export * from "@calcom/lib/location"; +export * from "@calcom/core/location"; diff --git a/packages/lib/location.ts b/packages/app-store/locations.ts similarity index 52% rename from packages/lib/location.ts rename to packages/app-store/locations.ts index 39905ea75d..681d52b77b 100644 --- a/packages/lib/location.ts +++ b/packages/app-store/locations.ts @@ -1,8 +1,11 @@ -/** TODO: These should all come from each individual App Store package, and merge them here. */ -export enum LocationType { +export enum DefaultLocationType { InPerson = "inPerson", Phone = "phone", Link = "link", +} + +/** If your App has a location option, add it here */ +export enum AppStoreLocationType { GoogleMeet = "integrations:google:meet", Zoom = "integrations:zoom", Daily = "integrations:daily", @@ -11,3 +14,6 @@ export enum LocationType { Tandem = "integrations:tandem", Teams = "integrations:office365_video", } + +export const LocationType = { ...DefaultLocationType, ...AppStoreLocationType }; +export type LocationType = DefaultLocationType | AppStoreLocationType; diff --git a/packages/app-store/utils.ts b/packages/app-store/utils.ts index 56fba2f333..f05f596c7c 100644 --- a/packages/app-store/utils.ts +++ b/packages/app-store/utils.ts @@ -1,10 +1,10 @@ import { Prisma } from "@prisma/client"; import { TFunction } from "next-i18next"; -import { LocationType } from "@calcom/lib/location"; import type { App } from "@calcom/types/App"; import appStore from "."; +import { LocationType } from "./locations"; const ALL_APPS_MAP = Object.keys(appStore).reduce((store, key) => { store[key] = appStore[key as keyof typeof appStore].metadata; diff --git a/packages/core/EventManager.ts b/packages/core/EventManager.ts index f8b98454c0..bf1289ac58 100644 --- a/packages/core/EventManager.ts +++ b/packages/core/EventManager.ts @@ -4,7 +4,6 @@ import merge from "lodash/merge"; import { v5 as uuidv5 } from "uuid"; import getApps from "@calcom/app-store/utils"; -import { LocationType } from "@calcom/lib/location"; import prisma from "@calcom/prisma"; import type { AdditionInformation, CalendarEvent } from "@calcom/types/Calendar"; import type { @@ -16,6 +15,7 @@ import type { import type { VideoCallData } from "@calcom/types/VideoApiAdapter"; import { createEvent, updateEvent } from "./CalendarManager"; +import { LocationType } from "./location"; import { createMeeting, updateMeeting } from "./videoClient"; export type Event = AdditionInformation & VideoCallData; diff --git a/packages/core/location.ts b/packages/core/location.ts new file mode 100644 index 0000000000..3c5493f967 --- /dev/null +++ b/packages/core/location.ts @@ -0,0 +1 @@ +export * from "@calcom/app-store/locations"; diff --git a/packages/prisma/zod-utils.ts b/packages/prisma/zod-utils.ts index 293cc30421..c19a9824c8 100644 --- a/packages/prisma/zod-utils.ts +++ b/packages/prisma/zod-utils.ts @@ -1,6 +1,6 @@ import { z } from "zod"; -import { LocationType } from "@calcom/lib/location"; +import { LocationType } from "@calcom/core/location"; import { slugify } from "@calcom/lib/slugify"; export const eventTypeLocations = z.array(