Skip to content

Scheduling infrastructure for absolutely everyone.

refactor: circular deps between app store and lib [5] (#23936)

Benny Joo76332a759bf1
diff --git a/apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts b/apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
index 1061db265b2..f7d68b6bdaf 100644
--- a/apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
+++ b/apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
@@ -1,11 +1,11 @@
import type { NextApiRequest } from "next";
-import { HttpError } from "@calcom/lib/http-error";
-import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import {
getRecordingsOfCalVideoByRoomName,
getDownloadLinkOfCalVideoByRecordingId,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
+import { HttpError } from "@calcom/lib/http-error";
+import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import prisma from "@calcom/prisma";
import type { RecordingItemSchema } from "@calcom/prisma/zod-utils";
import type { PartialReference } from "@calcom/types/EventManager";
diff --git a/apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts b/apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
index ca89c239bc3..ee47e89fe9b 100644
--- a/apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
+++ b/apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
@@ -1,11 +1,11 @@
import type { NextApiRequest } from "next";
-import { HttpError } from "@calcom/lib/http-error";
-import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import {
getTranscriptsAccessLinkFromRecordingId,
checkIfRoomNameMatchesInRecording,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
+import { HttpError } from "@calcom/lib/http-error";
+import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import prisma from "@calcom/prisma";
import type { PartialReference } from "@calcom/types/EventManager";
diff --git a/apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts b/apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
index a3cb57b14e3..17ff122d5e8 100644
--- a/apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
+++ b/apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
@@ -1,8 +1,8 @@
import type { NextApiRequest } from "next";
+import { getAllTranscriptsAccessLinkFromRoomName } from "@calcom/app-store/videoClient";
import { HttpError } from "@calcom/lib/http-error";
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
-import { getAllTranscriptsAccessLinkFromRoomName } from "@calcom/lib/videoClient";
import prisma from "@calcom/prisma";
import type { PartialReference } from "@calcom/types/EventManager";
diff --git a/apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts b/apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
index 2e241fcb88c..582f01d830d 100644
--- a/apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
+++ b/apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
@@ -9,7 +9,7 @@ import { buildBooking } from "@calcom/lib/test/builder";
import {
getRecordingsOfCalVideoByRoomName,
getDownloadLinkOfCalVideoByRecordingId,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
import { getAccessibleUsers } from "~/lib/utils/retrieveScopedAccessibleUsers";
@@ -22,7 +22,7 @@ type CustomNextApiResponse = NextApiResponse & Response;
const adminUserId = 1;
const memberUserId = 10;
-vi.mock("@calcom/lib/videoClient", () => {
+vi.mock("@calcom/app-store/videoClient", () => {
return {
getRecordingsOfCalVideoByRoomName: vi.fn(),
getDownloadLinkOfCalVideoByRecordingId: vi.fn(),
diff --git a/apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts b/apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
index 8d865ceda59..9839308d0c9 100644
--- a/apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
+++ b/apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
@@ -5,11 +5,11 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { createMocks } from "node-mocks-http";
import { describe, expect, test, vi, afterEach } from "vitest";
-import { buildBooking } from "@calcom/lib/test/builder";
import {
getTranscriptsAccessLinkFromRecordingId,
checkIfRoomNameMatchesInRecording,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
+import { buildBooking } from "@calcom/lib/test/builder";
import { getAccessibleUsers } from "~/lib/utils/retrieveScopedAccessibleUsers";
@@ -19,7 +19,7 @@ import handler from "../../../../../../pages/api/bookings/[id]/transcripts/[reco
type CustomNextApiRequest = NextApiRequest & Request;
type CustomNextApiResponse = NextApiResponse & Response;
-vi.mock("@calcom/lib/videoClient", () => {
+vi.mock("@calcom/app-store/videoClient", () => {
return {
getTranscriptsAccessLinkFromRecordingId: vi.fn(),
checkIfRoomNameMatchesInRecording: vi.fn(),
diff --git a/apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts b/apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
index 49fb9d33fbb..6234bca548b 100644
--- a/apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
+++ b/apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
@@ -6,7 +6,7 @@ import { createMocks } from "node-mocks-http";
import { describe, expect, test, vi, afterEach } from "vitest";
import { buildBooking } from "@calcom/lib/test/builder";
-import { getAllTranscriptsAccessLinkFromRoomName } from "@calcom/lib/videoClient";
+import { getAllTranscriptsAccessLinkFromRoomName } from "@calcom/app-store/videoClient";
import { getAccessibleUsers } from "~/lib/utils/retrieveScopedAccessibleUsers";
@@ -16,7 +16,7 @@ import handler from "../../../../../pages/api/bookings/[id]/transcripts/_get";
type CustomNextApiRequest = NextApiRequest & Request;
type CustomNextApiResponse = NextApiResponse & Response;
-vi.mock("@calcom/lib/videoClient", () => {
+vi.mock("@calcom/app-store/videoClient", () => {
return {
getAllTranscriptsAccessLinkFromRoomName: vi.fn(),
};
diff --git a/apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/RouteBuilder.tsx b/apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/RouteBuilder.tsx
index cb514c91818..2bc7ccfd121 100644
--- a/apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/RouteBuilder.tsx
+++ b/apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/RouteBuilder.tsx
@@ -41,8 +41,8 @@ import type {
import type { zodRoutes } from "@calcom/app-store/routing-forms/zod";
import { RouteActionType } from "@calcom/app-store/routing-forms/zod";
import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";
+import type { EventTypesByViewer } from "@calcom/features/eventtypes/lib/getEventTypesByViewer";
import { areTheySiblingEntities } from "@calcom/lib/entityPermissionUtils.shared";
-import type { EventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { buildEmptyQueryValue, raqbQueryValueUtils } from "@calcom/lib/raqb/raqbUtils";
import type { Prisma } from "@calcom/prisma/client";
diff --git a/apps/web/app/api/recorded-daily-video/route.ts b/apps/web/app/api/recorded-daily-video/route.ts
index 2737e7c1752..b7ab18df15b 100644
--- a/apps/web/app/api/recorded-daily-video/route.ts
+++ b/apps/web/app/api/recorded-daily-video/route.ts
@@ -17,7 +17,7 @@ import { safeStringify } from "@calcom/lib/safeStringify";
import {
getAllTranscriptsAccessLinkFromMeetingId,
submitBatchProcessorTranscriptionJob,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
import { generateVideoToken } from "@calcom/lib/videoTokens";
import prisma from "@calcom/prisma";
import { getBooking } from "@calcom/web/lib/daily-webhook/getBooking";
diff --git a/apps/web/app/api/video/recording/__tests__/route.test.ts b/apps/web/app/api/video/recording/__tests__/route.test.ts
index 85c93109147..3d3a947e262 100644
--- a/apps/web/app/api/video/recording/__tests__/route.test.ts
+++ b/apps/web/app/api/video/recording/__tests__/route.test.ts
@@ -1,12 +1,12 @@
import { NextResponse } from "next/server";
import { describe, expect, test, vi, afterEach } from "vitest";
-import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/lib/videoClient";
+import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/app-store/videoClient";
import { verifyVideoToken } from "@calcom/lib/videoTokens";
import { GET } from "../route";
-vi.mock("@calcom/lib/videoClient", () => ({
+vi.mock("@calcom/app-store/videoClient", () => ({
getDownloadLinkOfCalVideoByRecordingId: vi.fn(),
}));
diff --git a/apps/web/app/api/video/recording/route.ts b/apps/web/app/api/video/recording/route.ts
index ad9c18b1739..00d04beec50 100644
--- a/apps/web/app/api/video/recording/route.ts
+++ b/apps/web/app/api/video/recording/route.ts
@@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
-import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/lib/videoClient";
+import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/app-store/videoClient";
import { verifyVideoToken } from "@calcom/lib/videoTokens";
export async function GET(request: Request) {
diff --git a/apps/web/components/apps/installation/ConfigureStepCard.tsx b/apps/web/components/apps/installation/ConfigureStepCard.tsx
index d33e6699a6b..73a774d236c 100644
--- a/apps/web/components/apps/installation/ConfigureStepCard.tsx
+++ b/apps/web/components/apps/installation/ConfigureStepCard.tsx
@@ -8,8 +8,8 @@ import { useForm } from "react-hook-form";
import { z } from "zod";
import type { LocationObject } from "@calcom/app-store/locations";
+import { locationsResolver } from "@calcom/app-store/locations";
import NoSSR from "@calcom/lib/components/NoSSR";
-import { locationsResolver } from "@calcom/lib/event-types/utils/locationsResolver";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { AppCategories } from "@calcom/prisma/enums";
import type { EventTypeMetaDataSchema, eventTypeBookingFields } from "@calcom/prisma/zod-utils";
diff --git a/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx b/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx
index 49b9015c386..777e82bebd5 100644
--- a/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx
+++ b/apps/web/components/apps/installation/EventTypeAppSettingsWrapper.tsx
@@ -2,7 +2,7 @@ import { useEffect, type FC } from "react";
import { EventTypeAppSettings } from "@calcom/app-store/_components/EventTypeAppSettingsInterface";
import type { EventTypeAppsList } from "@calcom/app-store/utils";
-import useAppsData from "@calcom/lib/hooks/useAppsData";
+import useAppsData from "@calcom/features/apps/hooks/useAppsData";
import type { ConfigureStepCardProps } from "@components/apps/installation/ConfigureStepCard";
diff --git a/apps/web/lib/reschedule/[uid]/getServerSideProps.ts b/apps/web/lib/reschedule/[uid]/getServerSideProps.ts
index 8d9a4336198..386972e980b 100644
--- a/apps/web/lib/reschedule/[uid]/getServerSideProps.ts
+++ b/apps/web/lib/reschedule/[uid]/getServerSideProps.ts
@@ -6,7 +6,7 @@ import { z } from "zod";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { determineReschedulePreventionRedirect } from "@calcom/features/bookings/lib/reschedule/determineReschedulePreventionRedirect";
import { buildEventUrlFromBooking } from "@calcom/lib/bookings/buildEventUrlFromBooking";
-import { getDefaultEvent } from "@calcom/lib/defaultEvents";
+import { getDefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import { maybeGetBookingUidFromSeat } from "@calcom/lib/server/maybeGetBookingUidFromSeat";
import { UserRepository } from "@calcom/lib/server/repository/user";
import prisma, { bookingMinimalSelect } from "@calcom/prisma";
diff --git a/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx b/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx
index df102f6974b..b7ecab1ae5c 100644
--- a/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx
+++ b/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx
@@ -6,7 +6,7 @@ import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-util
import { orgDomainConfig } from "@calcom/ee/organizations/lib/orgDomains";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";
-import { getDefaultEvent } from "@calcom/lib/defaultEvents";
+import { getDefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import { shouldHideBrandingForEvent } from "@calcom/lib/hideBranding";
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
diff --git a/apps/web/server/lib/[user]/[type]/getServerSideProps.ts b/apps/web/server/lib/[user]/[type]/getServerSideProps.ts
index 37f7e6c7fad..a48bd543afe 100644
--- a/apps/web/server/lib/[user]/[type]/getServerSideProps.ts
+++ b/apps/web/server/lib/[user]/[type]/getServerSideProps.ts
@@ -7,7 +7,7 @@ import type { GetBookingType } from "@calcom/features/bookings/lib/get-booking";
import { getBookingForReschedule, getBookingForSeatedEvent } from "@calcom/features/bookings/lib/get-booking";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
import type { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { shouldHideBrandingForUserEvent } from "@calcom/lib/hideBranding";
import { EventRepository } from "@calcom/lib/server/repository/event";
import { UserRepository } from "@calcom/lib/server/repository/user";
diff --git a/apps/web/server/lib/[user]/getServerSideProps.ts b/apps/web/server/lib/[user]/getServerSideProps.ts
index 438527b083e..5e8cecaaad0 100644
--- a/apps/web/server/lib/[user]/getServerSideProps.ts
+++ b/apps/web/server/lib/[user]/getServerSideProps.ts
@@ -4,9 +4,9 @@ import { encode } from "querystring";
import type { z } from "zod";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
+import { getEventTypesPublic } from "@calcom/features/eventtypes/lib/getEventTypesPublic";
import { DEFAULT_DARK_BRAND_COLOR, DEFAULT_LIGHT_BRAND_COLOR } from "@calcom/lib/constants";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
-import { getEventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
import logger from "@calcom/lib/logger";
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
diff --git a/packages/lib/event-types/getBulkEventTypes.ts b/packages/app-store/_utils/getBulkEventTypes.ts
similarity index 95%
rename from packages/lib/event-types/getBulkEventTypes.ts
rename to packages/app-store/_utils/getBulkEventTypes.ts
index 6117926ee61..d2c573ae1d8 100644
--- a/packages/lib/event-types/getBulkEventTypes.ts
+++ b/packages/app-store/_utils/getBulkEventTypes.ts
@@ -1,7 +1,8 @@
-import { getAppFromLocationValue } from "@calcom/app-store/utils";
import { prisma } from "@calcom/prisma";
import { eventTypeLocations as eventTypeLocationsSchema } from "@calcom/prisma/zod-utils";
+import { getAppFromLocationValue } from "../utils";
+
/**
* Process event types to add logo information
* @param eventTypes - The event types to process
diff --git a/packages/app-store/_utils/setDefaultConferencingApp.ts b/packages/app-store/_utils/setDefaultConferencingApp.ts
index deeac5f2b90..8d4c3059178 100644
--- a/packages/app-store/_utils/setDefaultConferencingApp.ts
+++ b/packages/app-store/_utils/setDefaultConferencingApp.ts
@@ -1,9 +1,10 @@
-import type { LocationObject } from "@calcom/app-store/locations";
-import { getAppFromSlug } from "@calcom/app-store/utils";
-import { getBulkUserEventTypes } from "@calcom/lib/event-types/getBulkEventTypes";
import prisma from "@calcom/prisma";
import { userMetadata } from "@calcom/prisma/zod-utils";
+import type { LocationObject } from "../locations";
+import { getAppFromSlug } from "../utils";
+import { getBulkUserEventTypes } from "./getBulkEventTypes";
+
const setDefaultConferencingApp = async (userId: number, appSlug: string) => {
const eventTypes = await getBulkUserEventTypes(userId);
const eventTypeIds = eventTypes.eventTypes.map((item) => item.id);
diff --git a/packages/app-store/hitpay/components/EventTypeAppSettingsInterface.tsx b/packages/app-store/hitpay/components/EventTypeAppSettingsInterface.tsx
index daceb2899d2..2388a47d0d6 100644
--- a/packages/app-store/hitpay/components/EventTypeAppSettingsInterface.tsx
+++ b/packages/app-store/hitpay/components/EventTypeAppSettingsInterface.tsx
@@ -1,15 +1,15 @@
import { useState, useEffect } from "react";
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
+import {
+ convertToSmallestCurrencyUnit,
+ convertFromSmallestToPresentableCurrencyUnit,
+} from "@calcom/lib/currencyConversions";
import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { Alert } from "@calcom/ui/components/alert";
import { Select } from "@calcom/ui/components/form";
import { TextField } from "@calcom/ui/components/form";
-import { Alert } from "@calcom/ui/components/alert";
-import {
- convertToSmallestCurrencyUnit,
- convertFromSmallestToPresentableCurrencyUnit,
-} from "../lib/currencyConversions";
import { paymentOptions, currencyOptions } from "./constants";
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({
diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts
index 3be5e783f22..8ff7fed9144 100644
--- a/packages/app-store/locations.ts
+++ b/packages/app-store/locations.ts
@@ -2,6 +2,7 @@
* TODO: Consolidate this file with BookingLocationService and add tests
*/
import type { TFunction } from "i18next";
+import { isValidPhoneNumber } from "libphonenumber-js";
import { z } from "zod";
import { appStoreMetadata } from "@calcom/app-store/bookerAppsMetaData";
@@ -502,3 +503,66 @@ export const isAttendeeInputRequired = (locationType: string) => {
}
return location.attendeeInputType;
};
+
+export const locationsResolver = (t: TFunction) => {
+ return z
+ .array(
+ z
+ .object({
+ type: z.string(),
+ address: z.string().optional(),
+ link: z.string().url().optional(),
+ phone: z
+ .string()
+ .refine((val) => isValidPhoneNumber(val))
+ .optional(),
+ hostPhoneNumber: z
+ .string()
+ .refine((val) => isValidPhoneNumber(val))
+ .optional(),
+ displayLocationPublicly: z.boolean().optional(),
+ credentialId: z.number().optional(),
+ teamName: z.string().optional(),
+ })
+ .passthrough()
+ .superRefine((val, ctx) => {
+ if (val?.link) {
+ const link = val.link;
+ const eventLocationType = getEventLocationType(val.type);
+ if (
+ eventLocationType &&
+ !eventLocationType.default &&
+ eventLocationType.linkType === "static" &&
+ eventLocationType.urlRegExp
+ ) {
+ const valid = z.string().regex(new RegExp(eventLocationType.urlRegExp)).safeParse(link).success;
+
+ if (!valid) {
+ const sampleUrl = eventLocationType.organizerInputPlaceholder;
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: [eventLocationType?.defaultValueVariable ?? "link"],
+ message: t("invalid_url_error_message", {
+ label: eventLocationType.label,
+ sampleUrl: sampleUrl ?? "https://cal.com",
+ }),
+ });
+ }
+ return;
+ }
+
+ const valid = z.string().url().optional().safeParse(link).success;
+
+ if (!valid) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: [eventLocationType?.defaultValueVariable ?? "link"],
+ message: `Invalid URL`,
+ });
+ }
+ }
+ return;
+ })
+ )
+ .optional();
+};
diff --git a/packages/app-store/paypal/components/EventTypeAppSettingsInterface.tsx b/packages/app-store/paypal/components/EventTypeAppSettingsInterface.tsx
index dbcbc476e5a..7663c552c02 100644
--- a/packages/app-store/paypal/components/EventTypeAppSettingsInterface.tsx
+++ b/packages/app-store/paypal/components/EventTypeAppSettingsInterface.tsx
@@ -6,15 +6,15 @@ import {
isAcceptedCurrencyCode,
} from "@calcom/app-store/paypal/lib/currencyOptions";
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
+import {
+ convertToSmallestCurrencyUnit,
+ convertFromSmallestToPresentableCurrencyUnit,
+} from "@calcom/lib/currencyConversions";
import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { Alert } from "@calcom/ui/components/alert";
import { Select } from "@calcom/ui/components/form";
import { TextField } from "@calcom/ui/components/form";
-import { Alert } from "@calcom/ui/components/alert";
-import {
- convertToSmallestCurrencyUnit,
- convertFromSmallestToPresentableCurrencyUnit,
-} from "../../_utils/payments/currencyConversions";
import { PaypalPaymentOptions as paymentOptions } from "../zod";
type Option = { value: string; label: string };
diff --git a/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx b/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx
index 7d320576afb..ff048ed45cf 100644
--- a/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx
+++ b/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx
@@ -2,6 +2,10 @@ import * as RadioGroup from "@radix-ui/react-radio-group";
import { useState, useEffect } from "react";
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
+import {
+ convertToSmallestCurrencyUnit,
+ convertFromSmallestToPresentableCurrencyUnit,
+} from "@calcom/lib/currencyConversions";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RefundPolicy } from "@calcom/lib/payment/types";
import classNames from "@calcom/ui/classNames";
@@ -11,10 +15,6 @@ import { CheckboxField } from "@calcom/ui/components/form";
import { TextField } from "@calcom/ui/components/form";
import { RadioField } from "@calcom/ui/components/radio";
-import {
- convertToSmallestCurrencyUnit,
- convertFromSmallestToPresentableCurrencyUnit,
-} from "../../_utils/payments/currencyConversions";
import { paymentOptions } from "../lib/constants";
import { currencyOptions } from "../lib/currencyOptions";
import { autoChargeNoShowFeeTimeUnitEnum } from "../zod";
diff --git a/packages/app-store/test-setup.ts b/packages/app-store/test-setup.ts
index 696855e7d79..8443124a2cb 100644
--- a/packages/app-store/test-setup.ts
+++ b/packages/app-store/test-setup.ts
@@ -32,9 +32,6 @@ vi.mock("@calcom/ui/classNames", () => ({
},
}));
-vi.mock("@calcom/lib/event-types/getEventTypesByViewer", () => ({}));
-vi.mock("@calcom/lib/event-types/getEventTypesPublic", () => ({}));
-
global.ResizeObserver = vi.fn().mockImplementation(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
diff --git a/packages/lib/videoClient.ts b/packages/app-store/videoClient.ts
similarity index 100%
rename from packages/lib/videoClient.ts
rename to packages/app-store/videoClient.ts
diff --git a/packages/app-store/vital/lib/reschedule.ts b/packages/app-store/vital/lib/reschedule.ts
index cd0258990c0..4f492995263 100644
--- a/packages/app-store/vital/lib/reschedule.ts
+++ b/packages/app-store/vital/lib/reschedule.ts
@@ -6,7 +6,7 @@ import { CalendarEventBuilder } from "@calcom/lib/builders/CalendarEvent/builder
import { CalendarEventDirector } from "@calcom/lib/builders/CalendarEvent/director";
import logger from "@calcom/lib/logger";
import { getTranslation } from "@calcom/lib/server/i18n";
-import { deleteMeeting } from "@calcom/lib/videoClient";
+import { deleteMeeting } from "@calcom/app-store/videoClient";
import prisma from "@calcom/prisma";
import type { Booking, BookingReference, User } from "@calcom/prisma/client";
import { BookingStatus } from "@calcom/prisma/enums";
diff --git a/packages/app-store/wipemycalother/lib/reschedule.ts b/packages/app-store/wipemycalother/lib/reschedule.ts
index 82a535dc95e..308538f51bd 100644
--- a/packages/app-store/wipemycalother/lib/reschedule.ts
+++ b/packages/app-store/wipemycalother/lib/reschedule.ts
@@ -6,7 +6,7 @@ import { CalendarEventBuilder } from "@calcom/lib/builders/CalendarEvent/builder
import { CalendarEventDirector } from "@calcom/lib/builders/CalendarEvent/director";
import logger from "@calcom/lib/logger";
import { getTranslation } from "@calcom/lib/server/i18n";
-import { deleteMeeting } from "@calcom/lib/videoClient";
+import { deleteMeeting } from "@calcom/app-store/videoClient";
import prisma from "@calcom/prisma";
import type { Booking, BookingReference, User } from "@calcom/prisma/client";
import { BookingStatus } from "@calcom/prisma/enums";
diff --git a/packages/emails/src/templates/BaseScheduledEmail.tsx b/packages/emails/src/templates/BaseScheduledEmail.tsx
index e9907442903..0e45b55a1a1 100644
--- a/packages/emails/src/templates/BaseScheduledEmail.tsx
+++ b/packages/emails/src/templates/BaseScheduledEmail.tsx
@@ -1,7 +1,7 @@
import type { TFunction } from "i18next";
import dayjs from "@calcom/dayjs";
-import { formatPrice } from "@calcom/lib/price";
+import { formatPrice } from "@calcom/lib/currencyConversions";
import { TimeFormat } from "@calcom/lib/timeFormat";
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
diff --git a/packages/lib/hooks/useAppsData.ts b/packages/features/apps/hooks/useAppsData.ts
similarity index 100%
rename from packages/lib/hooks/useAppsData.ts
rename to packages/features/apps/hooks/useAppsData.ts
diff --git a/packages/lib/server/repository/PrismaAppRepository.ts b/packages/features/apps/repository/PrismaAppRepository.ts
similarity index 100%
rename from packages/lib/server/repository/PrismaAppRepository.ts
rename to packages/features/apps/repository/PrismaAppRepository.ts
diff --git a/packages/features/bookings/components/event-meta/Price.tsx b/packages/features/bookings/components/event-meta/Price.tsx
index 094df67e407..8fdc2b9d985 100644
--- a/packages/features/bookings/components/event-meta/Price.tsx
+++ b/packages/features/bookings/components/event-meta/Price.tsx
@@ -1,6 +1,6 @@
import dynamic from "next/dynamic";
-import { formatPrice } from "@calcom/lib/price";
+import { formatPrice } from "@calcom/lib/currencyConversions";
import type { EventPrice } from "../../types";
diff --git a/packages/features/bookings/lib/EventManager.ts b/packages/features/bookings/lib/EventManager.ts
index 08b8e24cd53..c4e6e9662be 100644
--- a/packages/features/bookings/lib/EventManager.ts
+++ b/packages/features/bookings/lib/EventManager.ts
@@ -37,7 +37,7 @@ import type {
import { createEvent, updateEvent, deleteEvent } from "@calcom/features/calendars/lib/CalendarManager";
import CrmManager from "@calcom/lib/crmManager/crmManager";
import { isDelegationCredential } from "@calcom/lib/delegationCredential/clientAndServer";
-import { createMeeting, updateMeeting, deleteMeeting } from "@calcom/lib/videoClient";
+import { createMeeting, updateMeeting, deleteMeeting } from "@calcom/app-store/videoClient";
const log = logger.getSubLogger({ prefix: ["EventManager"] });
const CALENDSO_ENCRYPTION_KEY = process.env.CALENDSO_ENCRYPTION_KEY || "";
diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts
index c95e7681433..f466bd50ed1 100644
--- a/packages/features/bookings/lib/handleNewBooking.ts
+++ b/packages/features/bookings/lib/handleNewBooking.ts
@@ -3,6 +3,7 @@ import short, { uuid } from "short-uuid";
import { v5 as uuidv5 } from "uuid";
import processExternalId from "@calcom/app-store/_utils/calendars/processExternalId";
+import { getPaymentAppData } from "@calcom/app-store/_utils/payments/getPaymentAppData";
import { metadata as GoogleMeetMetadata } from "@calcom/app-store/googlevideo/_metadata";
import {
getLocationValueForDB,
@@ -16,6 +17,7 @@ import dayjs from "@calcom/dayjs";
import { scheduleMandatoryReminder } from "@calcom/ee/workflows/lib/reminders/scheduleMandatoryReminder";
import getICalUID from "@calcom/emails/lib/getICalUID";
import { CalendarEventBuilder } from "@calcom/features/CalendarEventBuilder";
+import EventManager, { placeholderCreatedEvent } from "@calcom/features/bookings/lib/EventManager";
import type { BookingDataSchemaGetter } from "@calcom/features/bookings/lib/dto/types";
import type { CreateRegularBookingData, CreateBookingMeta } from "@calcom/features/bookings/lib/dto/types";
import type { CheckBookingAndDurationLimitsService } from "@calcom/features/bookings/lib/handleNewBooking/checkBookingAndDurationLimits";
@@ -24,9 +26,11 @@ import { handleWebhookTrigger } from "@calcom/features/bookings/lib/handleWebhoo
import { isEventTypeLoggingEnabled } from "@calcom/features/bookings/lib/isEventTypeLoggingEnabled";
import type { CacheService } from "@calcom/features/calendar-cache/lib/getShouldServeCache";
import AssignmentReasonRecorder from "@calcom/features/ee/round-robin/assignmentReason/AssignmentReasonRecorder";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { getEventName, updateHostInEventName } from "@calcom/features/eventtypes/lib/eventNaming";
import type { FeaturesRepository } from "@calcom/features/flags/features.repository";
import { getFullName } from "@calcom/features/form-builder/utils";
+import { handleAnalyticsEvents } from "@calcom/features/tasker/tasks/analytics/handleAnalyticsEvents";
import { UsersRepository } from "@calcom/features/users/users.repository";
import type { GetSubscriberOptions } from "@calcom/features/webhooks/lib/getWebhooks";
import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
@@ -36,12 +40,9 @@ import {
scheduleTrigger,
} from "@calcom/features/webhooks/lib/scheduleTrigger";
import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
-import EventManager, { placeholderCreatedEvent } from "@calcom/features/bookings/lib/EventManager";
-import { handleAnalyticsEvents } from "@calcom/lib/analyticsManager/handleAnalyticsEvents";
import { groupHostsByGroupId } from "@calcom/lib/bookings/hostGroupUtils";
import { shouldIgnoreContactOwner } from "@calcom/lib/bookings/routing/utils";
import { DEFAULT_GROUP_ID } from "@calcom/lib/constants";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
import {
enrichHostsWithDelegationCredentials,
getFirstDelegationConferencingCredentialAppLocation,
@@ -54,7 +55,6 @@ import { getErrorFromUnknown } from "@calcom/lib/errors";
import { extractBaseEmail } from "@calcom/lib/extract-base-email";
import { getBookerBaseUrl } from "@calcom/lib/getBookerUrl/server";
import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
-import { getPaymentAppData } from "@calcom/app-store/_utils/payments/getPaymentAppData";
import { getTeamIdFromEventType } from "@calcom/lib/getTeamIdFromEventType";
import { HttpError } from "@calcom/lib/http-error";
import type { CheckBookingLimitsService } from "@calcom/lib/intervalLimits/server/checkBookingLimits";
diff --git a/packages/features/bookings/lib/handleNewBooking/getEventType.ts b/packages/features/bookings/lib/handleNewBooking/getEventType.ts
index 27d83294ba6..bb5313375b3 100644
--- a/packages/features/bookings/lib/handleNewBooking/getEventType.ts
+++ b/packages/features/bookings/lib/handleNewBooking/getEventType.ts
@@ -1,4 +1,4 @@
-import { getDefaultEvent } from "@calcom/lib/defaultEvents";
+import { getDefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import { withReporting } from "@calcom/lib/sentryWrapper";
import { getBookingFieldsWithSystemFields } from "../getBookingFields";
diff --git a/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts b/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts
index c8ed5213602..7e60482df24 100644
--- a/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts
+++ b/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts
@@ -1,7 +1,7 @@
import type { LocationObject } from "@calcom/app-store/locations";
import { workflowSelect } from "@calcom/ee/workflows/lib/getAllWorkflows";
import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";
-import type { DefaultEvent } from "@calcom/lib/defaultEvents";
+import type { DefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import { ErrorCode } from "@calcom/lib/errorCodes";
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
import { withSelectedCalendars } from "@calcom/lib/server/repository/user";
diff --git a/packages/features/bookings/lib/handlePayment.ts b/packages/features/bookings/lib/handlePayment.ts
index 373e4908536..c970119046c 100644
--- a/packages/features/bookings/lib/handlePayment.ts
+++ b/packages/features/bookings/lib/handlePayment.ts
@@ -1,10 +1,10 @@
import { PaymentServiceMap } from "@calcom/app-store/payment.services.generated";
import type { EventTypeAppsList } from "@calcom/app-store/utils";
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
-import type { AppCategories, Prisma, EventType } from "@calcom/prisma/client";
-import { convertToSmallestCurrencyUnit } from "@calcom/app-store/_utils/payments/currencyConversions";
import type { Fields } from "@calcom/features/bookings/lib/getBookingFields";
import { fieldTypesConfigMap } from "@calcom/features/form-builder/fieldTypes";
+import { convertToSmallestCurrencyUnit } from "@calcom/lib/currencyConversions";
+import type { AppCategories, Prisma, EventType } from "@calcom/prisma/client";
import type { CalendarEvent } from "@calcom/types/Calendar";
import type { IAbstractPaymentService } from "@calcom/types/PaymentService";
diff --git a/packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts b/packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
index 372f5fdd1ca..1a59292c841 100644
--- a/packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
+++ b/packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
@@ -10,7 +10,7 @@ import logger from "@calcom/lib/logger";
import { safeStringify } from "@calcom/lib/safeStringify";
import { getTranslation } from "@calcom/lib/server/i18n";
import { WorkflowRepository } from "@calcom/lib/server/repository/workflow";
-import { updateMeeting } from "@calcom/lib/videoClient";
+import { updateMeeting } from "@calcom/app-store/videoClient";
import prisma from "@calcom/prisma";
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
import { bookingCancelAttendeeSeatSchema } from "@calcom/prisma/zod-utils";
diff --git a/packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts b/packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
index 906833a405e..846aa640e9f 100644
--- a/packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
+++ b/packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
@@ -2,7 +2,7 @@
import { getCalendar } from "@calcom/app-store/_utils/getCalendar";
import { getAllDelegationCredentialsForUserIncludeServiceAccountKey } from "@calcom/lib/delegationCredential/server";
import { getDelegationCredentialOrFindRegularCredential } from "@calcom/lib/delegationCredential/server";
-import { deleteMeeting } from "@calcom/lib/videoClient";
+import { deleteMeeting } from "@calcom/app-store/videoClient";
import prisma from "@calcom/prisma";
import type { Attendee } from "@calcom/prisma/client";
import { BookingStatus } from "@calcom/prisma/enums";
diff --git a/packages/features/credentials/deleteCredential.test.ts b/packages/features/credentials/deleteCredential.test.ts
index c30570bc78f..ebe279d33e8 100644
--- a/packages/features/credentials/deleteCredential.test.ts
+++ b/packages/features/credentials/deleteCredential.test.ts
@@ -5,7 +5,7 @@ import {
import { describe, test, expect, beforeEach } from "vitest";
-import { PrismaAppRepository } from "@calcom/lib/server/repository/PrismaAppRepository";
+import { PrismaAppRepository } from "@calcom/features/apps/repository/PrismaAppRepository";
import { CredentialRepository } from "@calcom/lib/server/repository/credential";
import { DestinationCalendarRepository } from "@calcom/lib/server/repository/destinationCalendar";
import { EventTypeRepository } from "@calcom/lib/server/repository/eventTypeRepository";
diff --git a/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.ts b/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.ts
index 564e23653d7..75ec635ce0f 100644
--- a/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.ts
+++ b/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.ts
@@ -1,7 +1,7 @@
import type { getEventTypeResponse } from "@calcom/features/bookings/lib/handleNewBooking/getEventTypesFromDB";
import { scheduleEmailReminder } from "@calcom/features/ee/workflows/lib/reminders/emailReminderManager";
import type { Workflow } from "@calcom/features/ee/workflows/lib/types";
-import type { getDefaultEvent } from "@calcom/lib/defaultEvents";
+import type { getDefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import logger from "@calcom/lib/logger";
import { withReporting } from "@calcom/lib/sentryWrapper";
import { WorkflowTriggerEvents, TimeUnit, WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
diff --git a/packages/features/eventtypes/components/tabs/apps/EventAppsTab.tsx b/packages/features/eventtypes/components/tabs/apps/EventAppsTab.tsx
index a40f0ea7b0f..c9d0da8dad7 100644
--- a/packages/features/eventtypes/components/tabs/apps/EventAppsTab.tsx
+++ b/packages/features/eventtypes/components/tabs/apps/EventAppsTab.tsx
@@ -4,10 +4,10 @@ import { useFormContext } from "react-hook-form";
import { EventTypeAppCard } from "@calcom/app-store/_components/EventTypeAppCardInterface";
import type { EventTypeAppCardComponentProps } from "@calcom/app-store/types";
import type { EventTypeAppsList } from "@calcom/app-store/utils";
+import useAppsData from "@calcom/features/apps/hooks/useAppsData";
import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager";
import type { FormValues, EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
import ServerTrans from "@calcom/lib/components/ServerTrans";
-import useAppsData from "@calcom/lib/hooks/useAppsData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Alert } from "@calcom/ui/components/alert";
diff --git a/apps/web/test/lib/CheckForEmptyAssignment.test.ts b/packages/features/eventtypes/lib/checkForEmptyAssignment.test.ts
similarity index 97%
rename from apps/web/test/lib/CheckForEmptyAssignment.test.ts
rename to packages/features/eventtypes/lib/checkForEmptyAssignment.test.ts
index 3dbfce4c153..3d1d30ba063 100644
--- a/apps/web/test/lib/CheckForEmptyAssignment.test.ts
+++ b/packages/features/eventtypes/lib/checkForEmptyAssignment.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
-import { checkForEmptyAssignment } from "@calcom/lib/event-types/utils/checkForEmptyAssignment";
+import { checkForEmptyAssignment } from "./checkForEmptyAssignment";
describe("Tests to Check if Event Types have empty Assignment", () => {
it("should return true if managed event type has no assigned users", () => {
diff --git a/packages/lib/event-types/utils/checkForEmptyAssignment.ts b/packages/features/eventtypes/lib/checkForEmptyAssignment.ts
similarity index 87%
rename from packages/lib/event-types/utils/checkForEmptyAssignment.ts
rename to packages/features/eventtypes/lib/checkForEmptyAssignment.ts
index d7b33fd096b..a1c27825bd7 100644
--- a/packages/lib/event-types/utils/checkForEmptyAssignment.ts
+++ b/packages/features/eventtypes/lib/checkForEmptyAssignment.ts
@@ -1,7 +1,4 @@
-import type {
- EventTypeAssignedUsers,
- EventTypeHosts,
-} from "@calcom/features/eventtypes/components/EventType";
+import type { EventTypeAssignedUsers, EventTypeHosts } from "../components/EventType";
// This function checks if EventType requires assignment.
// returns true: if EventType requires assignment but there is no assignment yet done by the user.
diff --git a/packages/lib/defaultEvents.ts b/packages/features/eventtypes/lib/defaultEvents.ts
similarity index 100%
rename from packages/lib/defaultEvents.ts
rename to packages/features/eventtypes/lib/defaultEvents.ts
index d282126f948..40d4dd82434 100644
--- a/packages/lib/defaultEvents.ts
+++ b/packages/features/eventtypes/lib/defaultEvents.ts
@@ -1,10 +1,10 @@
import { DailyLocationType } from "@calcom/app-store/constants";
+import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
import slugify from "@calcom/lib/slugify";
import type { Prisma, SelectedCalendar } from "@calcom/prisma/client";
import { PeriodType, SchedulingType } from "@calcom/prisma/enums";
import type { userSelect } from "@calcom/prisma/selects";
import type { CustomInputSchema } from "@calcom/prisma/zod-utils";
-import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import type { CredentialPayload } from "@calcom/types/Credential";
diff --git a/packages/lib/event-types/getEventTypesByViewer.ts b/packages/features/eventtypes/lib/getEventTypesByViewer.ts
similarity index 100%
rename from packages/lib/event-types/getEventTypesByViewer.ts
rename to packages/features/eventtypes/lib/getEventTypesByViewer.ts
diff --git a/packages/lib/event-types/getEventTypesPublic.ts b/packages/features/eventtypes/lib/getEventTypesPublic.ts
similarity index 98%
rename from packages/lib/event-types/getEventTypesPublic.ts
rename to packages/features/eventtypes/lib/getEventTypesPublic.ts
index c889ad934e5..a64ff1fc113 100644
--- a/packages/lib/event-types/getEventTypesPublic.ts
+++ b/packages/features/eventtypes/lib/getEventTypesPublic.ts
@@ -1,11 +1,10 @@
import logger from "@calcom/lib/logger";
+import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
import prisma from "@calcom/prisma";
import type { Prisma } from "@calcom/prisma/client";
import type { baseEventTypeSelect } from "@calcom/prisma/selects";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
-import { markdownToSafeHTML } from "../markdownToSafeHTML";
-
const log = logger.getSubLogger({ prefix: ["getEventTypesPublic"] });
export type EventTypesPublic = Awaited<ReturnType<typeof getEventTypesPublic>>;
diff --git a/packages/features/eventtypes/lib/getPublicEvent.ts b/packages/features/eventtypes/lib/getPublicEvent.ts
index 8928a96ad79..eb579ae791d 100644
--- a/packages/features/eventtypes/lib/getPublicEvent.ts
+++ b/packages/features/eventtypes/lib/getPublicEvent.ts
@@ -7,7 +7,7 @@ import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/
import { getSlugOrRequestedSlug } from "@calcom/features/ee/organizations/lib/orgDomains";
import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage";
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
-import { getDefaultEvent, getUsernameList } from "@calcom/lib/defaultEvents";
+import { getDefaultEvent, getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
import { getBookerBaseUrlSync } from "@calcom/lib/getBookerUrl/client";
import { isRecurringEvent, parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
diff --git a/packages/features/eventtypes/lib/types.ts b/packages/features/eventtypes/lib/types.ts
index 41b81989ce5..a0c0ac92562 100644
--- a/packages/features/eventtypes/lib/types.ts
+++ b/packages/features/eventtypes/lib/types.ts
@@ -1,9 +1,9 @@
import { z } from "zod";
+import type { EventLocationType } from "@calcom/app-store/locations";
import type { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
import type { ChildrenEventType } from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
import type { IntervalLimit } from "@calcom/lib/intervalLimits/intervalLimitSchema";
-import type { EventLocationType } from "@calcom/app-store/locations";
import type { AttributesQueryValue } from "@calcom/lib/raqb/types";
import type { EventTypeTranslation } from "@calcom/prisma/client";
import { type PeriodType, SchedulingType } from "@calcom/prisma/enums";
diff --git a/packages/features/form-builder/FormBuilder.tsx b/packages/features/form-builder/FormBuilder.tsx
index 25d13b682c7..7bbd3aa9484 100644
--- a/packages/features/form-builder/FormBuilder.tsx
+++ b/packages/features/form-builder/FormBuilder.tsx
@@ -4,9 +4,10 @@ import type { SubmitHandler, UseFormReturn } from "react-hook-form";
import { Controller, useFieldArray, useForm, useFormContext } from "react-hook-form";
import type { z } from "zod";
import { ZodError } from "zod";
+
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
-import { getCurrencySymbol } from "@calcom/app-store/_utils/payments/currencyConversions";
import { Dialog } from "@calcom/features/components/controlled-dialog";
+import { getCurrencySymbol } from "@calcom/lib/currencyConversions";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { md } from "@calcom/lib/markdownIt";
import { markdownToSafeHTMLClient } from "@calcom/lib/markdownToSafeHTMLClient";
diff --git a/packages/features/instant-meeting/handleInstantMeeting.test.ts b/packages/features/instant-meeting/handleInstantMeeting.test.ts
index 1cdccb34145..74909bd02b0 100644
--- a/packages/features/instant-meeting/handleInstantMeeting.test.ts
+++ b/packages/features/instant-meeting/handleInstantMeeting.test.ts
@@ -20,7 +20,7 @@ vi.mock("@calcom/features/notifications/sendNotification", () => ({
sendNotification: vi.fn(),
}));
-vi.mock("@calcom/lib/videoClient", () => ({
+vi.mock("@calcom/app-store/videoClient", () => ({
createInstantMeetingWithCalVideo: vi.fn().mockResolvedValue({
type: "daily_video",
id: "MOCK_INSTANT_MEETING_ID",
diff --git a/packages/features/instant-meeting/handleInstantMeeting.ts b/packages/features/instant-meeting/handleInstantMeeting.ts
index c5fccbfe4ae..557216612d2 100644
--- a/packages/features/instant-meeting/handleInstantMeeting.ts
+++ b/packages/features/instant-meeting/handleInstantMeeting.ts
@@ -22,7 +22,7 @@ import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
import logger from "@calcom/lib/logger";
import { getTranslation } from "@calcom/lib/server/i18n";
-import { createInstantMeetingWithCalVideo } from "@calcom/lib/videoClient";
+import { createInstantMeetingWithCalVideo } from "@calcom/app-store/videoClient";
import prisma from "@calcom/prisma";
import { Prisma } from "@calcom/prisma/client";
import { BookingStatus, WebhookTriggerEvents } from "@calcom/prisma/enums";
diff --git a/packages/features/schedules/lib/use-schedule/useSchedule.ts b/packages/features/schedules/lib/use-schedule/useSchedule.ts
index 11263327fd4..29cb456f216 100644
--- a/packages/features/schedules/lib/use-schedule/useSchedule.ts
+++ b/packages/features/schedules/lib/use-schedule/useSchedule.ts
@@ -6,7 +6,7 @@ import { isBookingDryRun } from "@calcom/features/bookings/Booker/utils/isBookin
import { useTimesForSchedule } from "@calcom/features/schedules/lib/use-schedule/useTimesForSchedule";
import { getRoutedTeamMemberIdsFromSearchParams } from "@calcom/lib/bookings/getRoutedTeamMemberIdsFromSearchParams";
import { PUBLIC_QUERY_AVAILABLE_SLOTS_INTERVAL_SECONDS } from "@calcom/lib/constants";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { trpc } from "@calcom/trpc/react";
import { useApiV2AvailableSlots } from "./useApiV2AvailableSlots";
diff --git a/packages/lib/analyticsManager/analyticsManager.ts b/packages/features/tasker/tasks/analytics/analyticsManager.ts
similarity index 100%
rename from packages/lib/analyticsManager/analyticsManager.ts
rename to packages/features/tasker/tasks/analytics/analyticsManager.ts
diff --git a/packages/lib/analyticsManager/handleAnalyticsEvents.ts b/packages/features/tasker/tasks/analytics/handleAnalyticsEvents.ts
similarity index 95%
rename from packages/lib/analyticsManager/handleAnalyticsEvents.ts
rename to packages/features/tasker/tasks/analytics/handleAnalyticsEvents.ts
index c068594c5ea..1f4aaca8c9f 100644
--- a/packages/lib/analyticsManager/handleAnalyticsEvents.ts
+++ b/packages/features/tasker/tasks/analytics/handleAnalyticsEvents.ts
@@ -1,6 +1,7 @@
-import tasker from "@calcom/features/tasker";
import type { CredentialForCalendarService } from "@calcom/types/Credential";
+import { tasker } from "../../../tasker";
+
interface HandleAnalyticsEventsProps {
credentials: CredentialForCalendarService[];
rawBookingData: Record<string, any>;
diff --git a/packages/features/tasker/tasks/analytics/sendAnalyticsEvent.ts b/packages/features/tasker/tasks/analytics/sendAnalyticsEvent.ts
index 94410b7ecd3..17864c78ce3 100644
--- a/packages/features/tasker/tasks/analytics/sendAnalyticsEvent.ts
+++ b/packages/features/tasker/tasks/analytics/sendAnalyticsEvent.ts
@@ -1,8 +1,8 @@
-import AnalyticsManager from "@calcom/lib/analyticsManager/analyticsManager";
import logger from "@calcom/lib/logger";
import { safeStringify } from "@calcom/lib/safeStringify";
import { CredentialRepository } from "@calcom/lib/server/repository/credential";
+import AnalyticsManager from "./analyticsManager";
import { sendAnalyticsEventSchema } from "./schema";
const log = logger.getSubLogger({ prefix: [`[[tasker] sendAnalyticsEvent]`] });
diff --git a/packages/app-store/_utils/payments/currencyConversions.ts b/packages/lib/currencyConversions.ts
similarity index 80%
rename from packages/app-store/_utils/payments/currencyConversions.ts
rename to packages/lib/currencyConversions.ts
index da5c5e539ab..5a3c1b9b497 100644
--- a/packages/app-store/_utils/payments/currencyConversions.ts
+++ b/packages/lib/currencyConversions.ts
@@ -56,3 +56,16 @@ export const getCurrencySymbol = (currencyCode: string): string => {
return "$";
}
};
+
+export const formatPrice = (price: number, currency: string | undefined, locale = "en") => {
+ switch (currency) {
+ case "BTC":
+ return `${price} sats`;
+ default:
+ currency = currency?.toUpperCase() || "USD";
+ return `${Intl.NumberFormat(locale, {
+ style: "currency",
+ currency: currency,
+ }).format(convertFromSmallestToPresentableCurrencyUnit(price, currency))}`;
+ }
+};
diff --git a/packages/lib/event-types/utils/locationsResolver.ts b/packages/lib/event-types/utils/locationsResolver.ts
deleted file mode 100644
index 119b00ebdc6..00000000000
--- a/packages/lib/event-types/utils/locationsResolver.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/* eslint-disable @typescript-eslint/no-empty-function */
-import type { TFunction } from "i18next";
-import { isValidPhoneNumber } from "libphonenumber-js";
-// eslint-disable-next-line @calcom/eslint/deprecated-imports-next-router
-import { z } from "zod";
-
-import { getEventLocationType } from "@calcom/app-store/locations";
-
-export const locationsResolver = (t: TFunction) => {
- return z
- .array(
- z
- .object({
- type: z.string(),
- address: z.string().optional(),
- link: z.string().url().optional(),
- phone: z
- .string()
- .refine((val) => isValidPhoneNumber(val))
- .optional(),
- hostPhoneNumber: z
- .string()
- .refine((val) => isValidPhoneNumber(val))
- .optional(),
- displayLocationPublicly: z.boolean().optional(),
- credentialId: z.number().optional(),
- teamName: z.string().optional(),
- })
- .passthrough()
- .superRefine((val, ctx) => {
- if (val?.link) {
- const link = val.link;
- const eventLocationType = getEventLocationType(val.type);
- if (
- eventLocationType &&
- !eventLocationType.default &&
- eventLocationType.linkType === "static" &&
- eventLocationType.urlRegExp
- ) {
- const valid = z.string().regex(new RegExp(eventLocationType.urlRegExp)).safeParse(link).success;
-
- if (!valid) {
- const sampleUrl = eventLocationType.organizerInputPlaceholder;
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- path: [eventLocationType?.defaultValueVariable ?? "link"],
- message: t("invalid_url_error_message", {
- label: eventLocationType.label,
- sampleUrl: sampleUrl ?? "https://cal.com",
- }),
- });
- }
- return;
- }
-
- const valid = z.string().url().optional().safeParse(link).success;
-
- if (!valid) {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- path: [eventLocationType?.defaultValueVariable ?? "link"],
- message: `Invalid URL`,
- });
- }
- }
- return;
- })
- )
- .optional();
-};
diff --git a/packages/lib/price.ts b/packages/lib/price.ts
deleted file mode 100644
index 4a6e92128ff..00000000000
--- a/packages/lib/price.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { convertFromSmallestToPresentableCurrencyUnit } from "@calcom/app-store/_utils/payments/currencyConversions";
-
-export const formatPrice = (price: number, currency: string | undefined, locale = "en") => {
- switch (currency) {
- case "BTC":
- return `${price} sats`;
- default:
- currency = currency?.toUpperCase() || "USD";
- return `${Intl.NumberFormat(locale, {
- style: "currency",
- currency: currency,
- }).format(convertFromSmallestToPresentableCurrencyUnit(price, currency))}`;
- }
-};
diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
index 16522116bf1..59ed2baf721 100644
--- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
+++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
@@ -19,7 +19,7 @@ import { useInitializeBookerStore } from "@calcom/features/bookings/Booker/store
import { useTimePreferences } from "@calcom/features/bookings/lib";
import { useTimesForSchedule } from "@calcom/features/schedules/lib/use-schedule/useTimesForSchedule";
import { getRoutedTeamMemberIdsFromSearchParams } from "@calcom/lib/bookings/getRoutedTeamMemberIdsFromSearchParams";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import type { ConnectedDestinationCalendars } from "@calcom/lib/getConnectedDestinationCalendars";
import { localStorage } from "@calcom/lib/webstorage";
import { BookerLayouts } from "@calcom/prisma/zod-utils";
diff --git a/packages/platform/atoms/event-types/hooks/useEventTypeForm.ts b/packages/platform/atoms/event-types/hooks/useEventTypeForm.ts
index 03b64c6b490..3ea864c0e08 100644
--- a/packages/platform/atoms/event-types/hooks/useEventTypeForm.ts
+++ b/packages/platform/atoms/event-types/hooks/useEventTypeForm.ts
@@ -4,6 +4,7 @@ import { useForm } from "react-hook-form";
import { z } from "zod";
import checkForMultiplePaymentApps from "@calcom/app-store/_utils/payments/checkForMultiplePaymentApps";
+import { locationsResolver } from "@calcom/app-store/locations";
import { DEFAULT_PROMPT_VALUE, DEFAULT_BEGIN_MESSAGE } from "@calcom/features/calAIPhone/promptTemplates";
import type { TemplateType } from "@calcom/features/calAIPhone/zod-utils";
import { sortHosts } from "@calcom/features/eventtypes/components/HostEditDialogs";
@@ -13,7 +14,6 @@ import type {
EventTypeSetupProps,
EventTypeUpdateInput,
} from "@calcom/features/eventtypes/lib/types";
-import { locationsResolver } from "@calcom/lib/event-types/utils/locationsResolver";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { validateIntervalLimitOrder } from "@calcom/lib/intervalLimits/validateIntervalLimitOrder";
import { validateBookerLayouts } from "@calcom/lib/validateBookerLayouts";
diff --git a/packages/platform/atoms/event-types/hooks/useHandleRouteChange.ts b/packages/platform/atoms/event-types/hooks/useHandleRouteChange.ts
index b1256b48fca..ef85c7ed97e 100644
--- a/packages/platform/atoms/event-types/hooks/useHandleRouteChange.ts
+++ b/packages/platform/atoms/event-types/hooks/useHandleRouteChange.ts
@@ -5,7 +5,7 @@ import type {
EventTypeAssignedUsers,
EventTypeHosts,
} from "@calcom/features/eventtypes/components/EventType";
-import { checkForEmptyAssignment } from "@calcom/lib/event-types/utils/checkForEmptyAssignment";
+import { checkForEmptyAssignment } from "@calcom/features/eventtypes/lib/checkForEmptyAssignment";
export const useHandleRouteChange = ({
isTeamEventTypeDeleted,
diff --git a/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx b/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx
index c7e98cc0ecd..7447d8b665f 100644
--- a/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx
+++ b/packages/platform/atoms/event-types/wrappers/EventPaymentsTabPlatformWrapper.tsx
@@ -4,8 +4,8 @@ import type {
EventTypeForAppCard,
} from "@calcom/app-store/_components/EventTypeAppCardInterface";
import type { EventTypeAppsList } from "@calcom/app-store/utils";
+import useAppsData from "@calcom/features/apps/hooks/useAppsData";
import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
-import useAppsData from "@calcom/lib/hooks/useAppsData";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import { StripeConnect } from "../../connect/stripe/StripeConnect";
diff --git a/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.tsx b/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.tsx
index 5e5cd46e290..249af285d48 100644
--- a/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.tsx
+++ b/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.tsx
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { useMemo } from "react";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { SUCCESS_STATUS, V2_ENDPOINTS } from "@calcom/platform-constants";
import type { PublicEventType } from "@calcom/features/eventtypes/lib/getPublicEvent";
import type { ApiResponse } from "@calcom/platform-types";
diff --git a/packages/platform/atoms/hooks/event-types/public/useEventType.ts b/packages/platform/atoms/hooks/event-types/public/useEventType.ts
index 33dae8a8515..c2796bef53d 100644
--- a/packages/platform/atoms/hooks/event-types/public/useEventType.ts
+++ b/packages/platform/atoms/hooks/event-types/public/useEventType.ts
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { useMemo } from "react";
-import { getUsernameList } from "@calcom/lib/defaultEvents";
+import { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
import { SUCCESS_STATUS, V2_ENDPOINTS } from "@calcom/platform-constants";
import type { EventTypeOutput_2024_06_14 } from "@calcom/platform-types";
import type { ApiResponse } from "@calcom/platform-types";
diff --git a/packages/platform/libraries/conferencing.ts b/packages/platform/libraries/conferencing.ts
index b5bed7b4e8f..2d1acd5c2a0 100644
--- a/packages/platform/libraries/conferencing.ts
+++ b/packages/platform/libraries/conferencing.ts
@@ -2,4 +2,4 @@ export {
getRecordingsOfCalVideoByRoomName,
getDownloadLinkOfCalVideoByRecordingId,
getAllTranscriptsAccessLinkFromRoomName,
-} from "@calcom/lib/videoClient";
+} from "@calcom/app-store/videoClient";
diff --git a/packages/platform/libraries/event-types.ts b/packages/platform/libraries/event-types.ts
index 3a222c7edd2..df62d149163 100644
--- a/packages/platform/libraries/event-types.ts
+++ b/packages/platform/libraries/event-types.ts
@@ -2,14 +2,14 @@ import EventManager from "@calcom/features/bookings/lib/EventManager";
export { getPublicEvent, type PublicEventType } from "@calcom/features/eventtypes/lib/getPublicEvent";
-export { getBulkUserEventTypes, getBulkTeamEventTypes } from "@calcom/lib/event-types/getBulkEventTypes";
+export { getBulkUserEventTypes, getBulkTeamEventTypes } from "@calcom/app-store/_utils/getBulkEventTypes";
export { createHandler as createEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/heavy/create.handler";
export { updateHandler as updateEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/heavy/update.handler";
export type { TUpdateInputSchema as TUpdateEventTypeInputSchema } from "@calcom/trpc/server/routers/viewer/eventTypes/heavy/update.schema";
-export type { EventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
-export { getEventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
+export type { EventTypesPublic } from "@calcom/features/eventtypes/lib/getEventTypesPublic";
+export { getEventTypesPublic } from "@calcom/features/eventtypes/lib/getEventTypesPublic";
export { parseEventTypeColor } from "@calcom/lib/isEventTypeColor";
export {
@@ -21,9 +21,9 @@ export {
export { validateCustomEventName } from "@calcom/features/eventtypes/lib/eventNaming";
export { EventManager };
export { getEventTypeById } from "@calcom/features/eventtypes/lib/getEventTypeById";
-export { getEventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
+export { getEventTypesByViewer } from "@calcom/features/eventtypes/lib/getEventTypesByViewer";
export type { EventType } from "@calcom/features/eventtypes/lib/getEventTypeById";
-export type { EventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
+export type { EventTypesByViewer } from "@calcom/features/eventtypes/lib/getEventTypesByViewer";
export type { UpdateEventTypeReturn } from "@calcom/trpc/server/routers/viewer/eventTypes/heavy/update.handler";
export { updateNewTeamMemberEventTypes } from "@calcom/features/ee/teams/lib/queries";
diff --git a/packages/platform/libraries/index.ts b/packages/platform/libraries/index.ts
index 7cd253390be..3c5e1ee8586 100644
--- a/packages/platform/libraries/index.ts
+++ b/packages/platform/libraries/index.ts
@@ -39,7 +39,7 @@ export {
WorkflowTemplates,
} from "@calcom/prisma/enums";
-export { getUsernameList } from "@calcom/lib/defaultEvents";
+export { getUsernameList } from "@calcom/features/eventtypes/lib/defaultEvents";
const handleNewBooking = newBookingMethods.default;
export { handleNewBooking };
@@ -75,7 +75,7 @@ export { userMetadata, bookingMetadataSchema, teamMetadataSchema } from "@calcom
export { parseBookingLimit } from "@calcom/lib/intervalLimits/isBookingLimits";
export { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
-export { dynamicEvent } from "@calcom/lib/defaultEvents";
+export { dynamicEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
export { symmetricEncrypt, symmetricDecrypt };
diff --git a/packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts b/packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
index b7207190070..2afdbe1500e 100644
--- a/packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
+++ b/packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
@@ -22,7 +22,7 @@ import { getUsersCredentialsIncludeServiceAccountKey } from "@calcom/lib/server/
import { getTranslation } from "@calcom/lib/server/i18n";
import { WorkflowRepository } from "@calcom/lib/server/repository/workflow";
import { BookingWebhookFactory } from "@calcom/lib/server/service/BookingWebhookFactory";
-import { deleteMeeting } from "@calcom/lib/videoClient";
+import { deleteMeeting } from "@calcom/app-store/videoClient";
import { prisma } from "@calcom/prisma";
import type { BookingReference, EventType } from "@calcom/prisma/client";
import type { WebhookTriggerEvents } from "@calcom/prisma/enums";
diff --git a/packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts b/packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
index 1cb6c39a5c2..402eadc7144 100644
--- a/packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
+++ b/packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
@@ -1,4 +1,4 @@
-import { getRecordingsOfCalVideoByRoomName } from "@calcom/lib/videoClient";
+import { getRecordingsOfCalVideoByRoomName } from "@calcom/app-store/videoClient";
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
import { TRPCError } from "@trpc/server";
diff --git a/packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts b/packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
index b836c9899b9..a5b71daec05 100644
--- a/packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
+++ b/packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
@@ -1,6 +1,6 @@
/// <reference types="@calcom/types/next-auth" />
import { IS_SELF_HOSTED } from "@calcom/lib/constants";
-import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/lib/videoClient";
+import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/app-store/videoClient";
import { TRPCError } from "@trpc/server";
diff --git a/packages/trpc/server/routers/viewer/eventTypes/bulkEventFetch.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/bulkEventFetch.handler.ts
index 6d21df0afef..62d923d4056 100644
--- a/packages/trpc/server/routers/viewer/eventTypes/bulkEventFetch.handler.ts
+++ b/packages/trpc/server/routers/viewer/eventTypes/bulkEventFetch.handler.ts
@@ -1,4 +1,4 @@
-import { getBulkUserEventTypes } from "@calcom/lib/event-types/getBulkEventTypes";
+import { getBulkUserEventTypes } from "@calcom/app-store/_utils/getBulkEventTypes";
import type { TrpcSessionUser } from "../../../types";
diff --git a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
index f72d39d86a5..58ccfd8cb45 100644
--- a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
+++ b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
@@ -1,5 +1,5 @@
+import { getEventTypesByViewer } from "@calcom/features/eventtypes/lib/getEventTypesByViewer";
import { checkRateLimitAndThrowError } from "@calcom/lib/checkRateLimitAndThrowError";
-import { getEventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
import type { PrismaClient } from "@calcom/prisma";
import type { TrpcSessionUser } from "../../../types";
diff --git a/packages/trpc/server/routers/viewer/eventTypes/getUserEventGroups.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/getUserEventGroups.handler.ts
index 57e6e8b13e1..a4cadf2b204 100644
--- a/packages/trpc/server/routers/viewer/eventTypes/getUserEventGroups.handler.ts
+++ b/packages/trpc/server/routers/viewer/eventTypes/getUserEventGroups.handler.ts
@@ -66,4 +66,4 @@ export const getUserEventGroups = async ({ ctx, input }: GetByViewerOptions) =>
};
// Re-export the compareMembership function for backward compatibility
-export { compareMembership } from "@calcom/lib/event-types/getEventTypesByViewer";
+export { compareMembership } from "@calcom/features/eventtypes/lib/getEventTypesByViewer";
diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.ts
index 71ff80d08a9..ea976e7d770 100644
--- a/packages/trpc/server/routers/viewer/slots/util.ts
+++ b/packages/trpc/server/routers/viewer/slots/util.ts
@@ -15,7 +15,7 @@ import { shouldIgnoreContactOwner } from "@calcom/lib/bookings/routing/utils";
import { RESERVED_SUBDOMAINS } from "@calcom/lib/constants";
import { buildDateRanges } from "@calcom/lib/date-ranges";
import { getUTCOffsetByTimezone } from "@calcom/lib/dayjs";
-import { getDefaultEvent } from "@calcom/lib/defaultEvents";
+import { getDefaultEvent } from "@calcom/features/eventtypes/lib/defaultEvents";
import type { getBusyTimesService } from "@calcom/lib/di/containers/BusyTimes";
import { getAggregatedAvailability } from "@calcom/lib/getAggregatedAvailability";
import type { BusyTimesService } from "@calcom/lib/getBusyTimes";
diff --git a/packages/ui/components/test-setup.tsx b/packages/ui/components/test-setup.tsx
index 237b587cd0f..95ed0b4700a 100644
--- a/packages/ui/components/test-setup.tsx
+++ b/packages/ui/components/test-setup.tsx
@@ -80,8 +80,8 @@ vi.mock("@calcom/atoms/hooks/useIsPlatform", () => ({
},
}));
-vi.mock("@calcom/lib/event-types/getEventTypesByViewer", () => ({}));
-vi.mock("@calcom/lib/event-types/getEventTypesPublic", () => ({}));
+vi.mock("@calcom/features/eventtypes/lib/getEventTypesByViewer", () => ({}));
+vi.mock("@calcom/features/eventtypes/lib/getEventTypesPublic", () => ({}));
vi.mock("@calcom/ui/classNames", () => ({
default: (...args: string[]) => {
return args.filter(Boolean).join(" ");
diff --git a/tests/libs/__mocks__/videoClient.ts b/tests/libs/__mocks__/videoClient.ts
index cc21f8c1918..7e5891215c8 100644
--- a/tests/libs/__mocks__/videoClient.ts
+++ b/tests/libs/__mocks__/videoClient.ts
@@ -1,9 +1,9 @@
import { beforeEach, vi } from "vitest";
import { mockReset, mockDeep } from "vitest-mock-extended";
-import type * as videoClient from "@calcom/lib/videoClient";
+import type * as videoClient from "@calcom/app-store/videoClient";
-vi.mock("@calcom/lib/videoClient", () => videoClientMock);
+vi.mock("@calcom/app-store/videoClient", () => videoClientMock);
beforeEach(() => {
mockReset(videoClientMock);