Scheduling infrastructure for absolutely everyone.
refactor: split tRPC build into server and react phases (#26082)
Keith Williams51bce6763f4d
diff --git a/apps/api/v2/package.json b/apps/api/v2/package.jsonindex 2006fd05d44..78756bdeef8 100644--- a/apps/api/v2/package.json+++ b/apps/api/v2/package.json@@ -16,7 +16,7 @@"_dev:build:watch:enums": "yarn workspace @calcom/platform-enums build:watch","_dev:build:watch:utils": "yarn workspace @calcom/platform-utils build:watch","_dev:build:watch:types": "yarn workspace @calcom/platform-types build:watch",- "dev:build": "yarn workspace @calcom/platform-constants build && yarn workspace @calcom/platform-enums build && yarn workspace @calcom/platform-utils build && yarn workspace @calcom/platform-types build && yarn workspace @calcom/platform-libraries build",+ "dev:build": "yarn workspace @calcom/platform-constants build && yarn workspace @calcom/platform-enums build && yarn workspace @calcom/platform-utils build && yarn workspace @calcom/platform-types build && yarn workspace @calcom/platform-libraries build && yarn workspace @calcom/trpc build:server","dev": "yarn dev:build && ts-node scripts/docker-start.ts && yarn copy-swagger-module && yarn start --watch","dev:no-docker": "yarn dev:build && yarn copy-swagger-module && yarn start --watch","start:debug": "nest start --debug --watch",diff --git a/apps/web/components/apps/alby/AlbyPaymentComponent.tsx b/apps/web/components/apps/alby/AlbyPaymentComponent.tsxindex 64488f59b70..73e3ea1c53c 100644--- a/apps/web/components/apps/alby/AlbyPaymentComponent.tsx+++ b/apps/web/components/apps/alby/AlbyPaymentComponent.tsx@@ -10,7 +10,7 @@ import type { PaymentPageProps } from "@calcom/features/ee/payments/pages/paymenimport { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useCopy } from "@calcom/lib/hooks/useCopy";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Spinner } from "@calcom/ui/components/icon";import { showToast } from "@calcom/ui/components/toast";diff --git a/apps/web/components/apps/alby/Setup.tsx b/apps/web/components/apps/alby/Setup.tsxindex 9f460046949..4d009286e28 100644--- a/apps/web/components/apps/alby/Setup.tsx+++ b/apps/web/components/apps/alby/Setup.tsx@@ -9,7 +9,7 @@ import { albyCredentialKeysSchema } from "@calcom/app-store/alby/lib/albyCredentimport type { IAlbySetupProps } from "@calcom/app-store/alby/pages/setup/_getServerSideProps";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Badge } from "@calcom/ui/components/badge";import { Button } from "@calcom/ui/components/button";import { Icon } from "@calcom/ui/components/icon";diff --git a/apps/web/components/apps/btcpayserver/BtcpayPaymentComponent.tsx b/apps/web/components/apps/btcpayserver/BtcpayPaymentComponent.tsxindex e89db5fab33..4635e642880 100644--- a/apps/web/components/apps/btcpayserver/BtcpayPaymentComponent.tsx+++ b/apps/web/components/apps/btcpayserver/BtcpayPaymentComponent.tsx@@ -8,7 +8,7 @@ import type { PaymentPageProps } from "@calcom/features/ee/payments/pages/paymenimport { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useCopy } from "@calcom/lib/hooks/useCopy";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Spinner } from "@calcom/ui/components/icon";import { showToast } from "@calcom/ui/components/toast";diff --git a/apps/web/components/apps/btcpayserver/Setup.tsx b/apps/web/components/apps/btcpayserver/Setup.tsxindex 3ebc2f0f6c8..194c537964a 100644--- a/apps/web/components/apps/btcpayserver/Setup.tsx+++ b/apps/web/components/apps/btcpayserver/Setup.tsx@@ -14,7 +14,7 @@ import type { IBTCPaySetupProps } from "@calcom/app-store/btcpayserver/pages/setimport { WEBAPP_URL } from "@calcom/lib/constants";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Icon } from "@calcom/ui/components/icon";import { showToast } from "@calcom/ui/components/toast";diff --git a/apps/web/components/apps/hitpay/Setup.tsx b/apps/web/components/apps/hitpay/Setup.tsxindex ae12d39dccc..f2d3b96c2bd 100644--- a/apps/web/components/apps/hitpay/Setup.tsx+++ b/apps/web/components/apps/hitpay/Setup.tsx@@ -13,7 +13,7 @@ import { hitpayCredentialKeysSchema } from "@calcom/app-store/hitpay/lib/hitpayCimport type { IHitPaySetupProps } from "@calcom/app-store/hitpay/pages/setup/_getServerSideProps";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Switch } from "@calcom/ui/components/form";import { Icon } from "@calcom/ui/components/icon";diff --git a/apps/web/components/apps/paypal/Setup.tsx b/apps/web/components/apps/paypal/Setup.tsxindex 99398f019a8..271494979c7 100644--- a/apps/web/components/apps/paypal/Setup.tsx+++ b/apps/web/components/apps/paypal/Setup.tsx@@ -4,7 +4,7 @@ import { Toaster } from "sonner";import AppNotInstalledMessage from "@calcom/app-store/_components/AppNotInstalledMessage";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { TextField } from "@calcom/ui/components/form";import { Icon } from "@calcom/ui/components/icon";@@ -101,7 +101,7 @@ export default function PayPalSetup() {<aclassName="text-orange-600 underline"target="_blank"- href="https://developer.paypal.com/api/rest/#link-getclientidandclientsecret">+ href="https://developer.paypal.com/api/rest/#link-getclientidandclientsecret" rel="noreferrer">Link to Paypal developer API REST Setup Guide:https://developer.paypal.com/api/rest/#link-getclientidandclientsecret</a>@@ -120,7 +120,7 @@ export default function PayPalSetup() {<atarget="_blank"href="https://developer.paypal.com/dashboard/applications/live"- className="text-orange-600 underline">+ className="text-orange-600 underline" rel="noreferrer">{t("here")}</a>.diff --git a/apps/web/components/apps/routing-forms/TestForm.tsx b/apps/web/components/apps/routing-forms/TestForm.tsxindex e203beff5e9..a552196b826 100644--- a/apps/web/components/apps/routing-forms/TestForm.tsx+++ b/apps/web/components/apps/routing-forms/TestForm.tsx@@ -15,7 +15,7 @@ import { useOrgBranding } from "@calcom/features/ee/organizations/context/providimport { WEBSITE_URL } from "@calcom/lib/constants";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { inferSSRProps } from "@calcom/types/inferSSRProps";import type { Brand } from "@calcom/types/utils";import { Button } from "@calcom/ui/components/button";diff --git a/apps/web/modules/auth/verify-email-view.tsx b/apps/web/modules/auth/verify-email-view.tsxindex 590d113a72e..17a439baef9 100644--- a/apps/web/modules/auth/verify-email-view.tsx+++ b/apps/web/modules/auth/verify-email-view.tsx@@ -8,7 +8,7 @@ import { useEffect } from "react";import { useFlagMap } from "@calcom/features/flags/context/provider";import { APP_NAME } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import useEmailVerifyCheck from "@calcom/trpc/react/hooks/useEmailVerifyCheck";import { Button } from "@calcom/ui/components/button";import { EmptyScreen } from "@calcom/ui/components/empty-screen";diff --git a/apps/web/modules/connect-and-join/connect-and-join-view.tsx b/apps/web/modules/connect-and-join/connect-and-join-view.tsxindex d1de5dbe141..d37770eb130 100644--- a/apps/web/modules/connect-and-join/connect-and-join-view.tsx+++ b/apps/web/modules/connect-and-join/connect-and-join-view.tsx@@ -9,7 +9,7 @@ import { getQueryParam } from "@calcom/features/bookings/Booker/utils/query-paraimport ServerTrans from "@calcom/lib/components/ServerTrans";import { WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Alert } from "@calcom/ui/components/alert";import { Button } from "@calcom/ui/components/button";import { EmptyScreen } from "@calcom/ui/components/empty-screen";diff --git a/apps/web/modules/insights/insights-call-history-view.tsx b/apps/web/modules/insights/insights-call-history-view.tsxindex 1e54b3835a7..0b16d449ecf 100644--- a/apps/web/modules/insights/insights-call-history-view.tsx+++ b/apps/web/modules/insights/insights-call-history-view.tsx@@ -19,7 +19,7 @@ import { CallDetailsSheet } from "@calcom/features/ee/workflows/components/CallDimport type { CallDetailsState, CallDetailsAction } from "@calcom/features/ee/workflows/components/types";import { WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Badge } from "@calcom/ui/components/badge";import { EmptyScreen } from "@calcom/ui/components/empty-screen";diff --git a/apps/web/modules/insights/insights-virtual-queues-view.tsx b/apps/web/modules/insights/insights-virtual-queues-view.tsxindex 8e366129413..c5c4ad71f66 100644--- a/apps/web/modules/insights/insights-virtual-queues-view.tsx+++ b/apps/web/modules/insights/insights-virtual-queues-view.tsx@@ -4,7 +4,7 @@ import { useState } from "react";import type { RoutingForm } from "@calcom/app-store/routing-forms/types/types";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Label } from "@calcom/ui/components/form";import { Select } from "@calcom/ui/components/form";diff --git a/apps/web/modules/settings/admin/locked-sms-view.tsx b/apps/web/modules/settings/admin/locked-sms-view.tsxindex 5daf5858c2d..a6228c0856f 100644--- a/apps/web/modules/settings/admin/locked-sms-view.tsx+++ b/apps/web/modules/settings/admin/locked-sms-view.tsx@@ -2,7 +2,7 @@import { useState } from "react";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { TextField } from "@calcom/ui/components/form";import { Button } from "@calcom/ui/components/button";import { showToast } from "@calcom/ui/components/toast";diff --git a/apps/web/modules/settings/admin/oauth-view.tsx b/apps/web/modules/settings/admin/oauth-view.tsxindex cbc69a78673..a2fb75d344a 100644--- a/apps/web/modules/settings/admin/oauth-view.tsx+++ b/apps/web/modules/settings/admin/oauth-view.tsx@@ -4,7 +4,7 @@ import { useState } from "react";import { useForm } from "react-hook-form";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Avatar } from "@calcom/ui/components/avatar";import { Button } from "@calcom/ui/components/button";import { Form } from "@calcom/ui/components/form";diff --git a/apps/web/modules/settings/organizations/new/_components/OnboardMembersView.tsx b/apps/web/modules/settings/organizations/new/_components/OnboardMembersView.tsxindex a1141a2256b..421bb94dc98 100644--- a/apps/web/modules/settings/organizations/new/_components/OnboardMembersView.tsx+++ b/apps/web/modules/settings/organizations/new/_components/OnboardMembersView.tsx@@ -8,8 +8,8 @@ import { z } from "zod";import { setShowNewOrgModalFlag } from "@calcom/features/ee/organizations/hooks/useWelcomeModal";import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore";import { useLocale } from "@calcom/lib/hooks/useLocale";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import { Alert } from "@calcom/ui/components/alert";import { Avatar } from "@calcom/ui/components/avatar";import { Badge } from "@calcom/ui/components/badge";diff --git a/apps/web/modules/settings/organizations/new/_components/PaymentStatusView.tsx b/apps/web/modules/settings/organizations/new/_components/PaymentStatusView.tsxindex 972e4bb7df3..1a5561b9217 100644--- a/apps/web/modules/settings/organizations/new/_components/PaymentStatusView.tsx+++ b/apps/web/modules/settings/organizations/new/_components/PaymentStatusView.tsx@@ -5,7 +5,7 @@ import { useEffect, useState } from "react";import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Icon } from "@calcom/ui/components/icon";diff --git a/apps/web/modules/settings/organizations/privacy/components/blocked-entries-table.tsx b/apps/web/modules/settings/organizations/privacy/components/blocked-entries-table.tsxindex e8013c63ad9..82d4a9b99af 100644--- a/apps/web/modules/settings/organizations/privacy/components/blocked-entries-table.tsx+++ b/apps/web/modules/settings/organizations/privacy/components/blocked-entries-table.tsx@@ -7,7 +7,7 @@ import { useMemo, useState } from "react";import { DataTableWrapper, useDataTable } from "@calcom/features/data-table";import { IS_CALCOM } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { ConfirmationDialogContent, Dialog, DialogClose } from "@calcom/ui/components/dialog";diff --git a/apps/web/modules/settings/organizations/privacy/components/pending-reports-table.tsx b/apps/web/modules/settings/organizations/privacy/components/pending-reports-table.tsxindex 442861c7fe0..13ef58452a2 100644--- a/apps/web/modules/settings/organizations/privacy/components/pending-reports-table.tsx+++ b/apps/web/modules/settings/organizations/privacy/components/pending-reports-table.tsx@@ -6,7 +6,7 @@ import { useMemo, useState } from "react";import { DataTableWrapper, useDataTable } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { EmptyScreen } from "@calcom/ui/components/empty-screen";diff --git a/docs/developing/guides/insights/add-new-booking-charts.mdx b/docs/developing/guides/insights/add-new-booking-charts.mdxindex 556a22b3b86..a45f003725c 100644--- a/docs/developing/guides/insights/add-new-booking-charts.mdx+++ b/docs/developing/guides/insights/add-new-booking-charts.mdx@@ -22,7 +22,7 @@ UI Component → tRPC Handler → Insights Service → Database Query → Responimport { LineChart, XAxis, YAxis, CartesianGrid, Tooltip, Line, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";- import { trpc } from "@calcom/trpc";+ import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/app-store/_utils/getEventTypeAppData.ts b/packages/app-store/_utils/getEventTypeAppData.tsindex abafe50b77f..80cfe5ab782 100644--- a/packages/app-store/_utils/getEventTypeAppData.ts+++ b/packages/app-store/_utils/getEventTypeAppData.ts@@ -1,7 +1,7 @@import type { z } from "zod";import type { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";-import type { BookerEvent } from "@calcom/features/bookings/types";+import type { BookerEventForAppData } from "@calcom/features/bookings/types.server";export type EventTypeApps = NonNullable<NonNullable<z.infer<typeof eventTypeMetaDataSchemaWithTypedApps>>["apps"]@@ -9,7 +9,7 @@ export type EventTypeApps = NonNullable<export type EventTypeAppsList = keyof EventTypeApps;export const getEventTypeAppData = <T extends EventTypeAppsList>(- eventType: Pick<BookerEvent, "price" | "currency" | "metadata">,+ eventType: BookerEventForAppData,appId: T,forcedGet?: boolean): EventTypeApps[T] => {diff --git a/packages/app-store/_utils/payments/getPaymentAppData.ts b/packages/app-store/_utils/payments/getPaymentAppData.tsindex 5b515d238bc..f9011501888 100644--- a/packages/app-store/_utils/payments/getPaymentAppData.ts+++ b/packages/app-store/_utils/payments/getPaymentAppData.ts@@ -1,6 +1,5 @@import type { z } from "zod";-import type { BookerEvent } from "@calcom/features/bookings/types";import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";import type { appDataSchemas } from "../../apps.schemas.generated";@@ -10,7 +9,9 @@ import { eventTypeMetaDataSchemaWithTypedApps } from "../../zod-utils";import { getEventTypeAppData } from "../getEventTypeAppData";export function getPaymentAppData(- _eventType: Pick<BookerEvent, "price" | "currency"> & {+ _eventType: {+ price: number;+ currency: string;metadata: z.infer<typeof EventTypeMetaDataSchema>;},forcedGet?: booleandiff --git a/packages/features/Segment.test.tsx b/packages/features/Segment.test.tsxindex cbf93aa49f9..85fae73b6d0 100644--- a/packages/features/Segment.test.tsx+++ b/packages/features/Segment.test.tsx@@ -6,7 +6,7 @@ import type { Mock } from "vitest";import { Segment } from "@calcom/features/Segment";import type { AttributesQueryValue } from "@calcom/lib/raqb/types";import { AttributeType } from "@calcom/prisma/enums";-import { trpc, type RouterOutputs } from "@calcom/trpc";+import { trpc, type RouterOutputs } from "@calcom/trpc/react";type Attributes = RouterOutputs["viewer"]["appRoutingForms"]["getAttributesForTeam"];type MatchingTeamMembersData = RouterOutputs["viewer"]["attributes"]["findTeamMembersMatchingAttributeLogic"];@@ -62,7 +62,7 @@ const mockAttributesWithSingleSelect = () => {};// Mock the TRPC hooks-vi.mock("@calcom/trpc", () => ({+vi.mock("@calcom/trpc/react", () => ({trpc: {viewer: {appRoutingForms: {diff --git a/packages/features/Segment.tsx b/packages/features/Segment.tsxindex 910a5ca3a68..a68be96e6ec 100644--- a/packages/features/Segment.tsx+++ b/packages/features/Segment.tsx@@ -14,7 +14,7 @@ import { getQueryBuilderConfigForAttributes } from "@calcom/app-store/routing-foimport { useLocale } from "@calcom/lib/hooks/useLocale";import { isEqual } from "@calcom/lib/isEqual";import type { AttributesQueryValue } from "@calcom/lib/raqb/types";-import { trpc, type RouterOutputs } from "@calcom/trpc";+import { trpc, type RouterOutputs } from "@calcom/trpc/react";import cn from "@calcom/ui/classNames";export type Attributes = RouterOutputs["viewer"]["appRoutingForms"]["getAttributesForTeam"];diff --git a/packages/features/apps/components/AppList.tsx b/packages/features/apps/components/AppList.tsxindex 10831c1d0d7..6e5e8cd9181 100644--- a/packages/features/apps/components/AppList.tsx+++ b/packages/features/apps/components/AppList.tsx@@ -15,7 +15,7 @@ import { BulkEditDefaultForEventsModal } from "@calcom/features/eventtypes/compoimport { isDelegationCredential } from "@calcom/lib/delegationCredential";import { useLocale } from "@calcom/lib/hooks/useLocale";import type { AppCategories } from "@calcom/prisma/enums";-import { type RouterOutputs } from "@calcom/trpc";+import { type RouterOutputs } from "@calcom/trpc/react";import type { App } from "@calcom/types/App";import { Alert } from "@calcom/ui/components/alert";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/bookings/Booker/components/hooks/useBookings.ts b/packages/features/bookings/Booker/components/hooks/useBookings.tsindex 3ee4755ba84..7ef1a668a66 100644--- a/packages/features/bookings/Booker/components/hooks/useBookings.ts+++ b/packages/features/bookings/Booker/components/hooks/useBookings.ts@@ -23,7 +23,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";import { localStorage } from "@calcom/lib/webstorage";import { BookingStatus } from "@calcom/prisma/enums";import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { showToast } from "@calcom/ui/components/toast";import { useBookingSuccessRedirect } from "../../../lib/bookingSuccessRedirect";diff --git a/packages/features/bookings/Booker/components/hooks/useSlots.ts b/packages/features/bookings/Booker/components/hooks/useSlots.tsindex faebef50984..a246d8c8561 100644--- a/packages/features/bookings/Booker/components/hooks/useSlots.ts+++ b/packages/features/bookings/Booker/components/hooks/useSlots.ts@@ -11,7 +11,7 @@ import {PUBLIC_QUERY_RESERVATION_STALE_TIME_SECONDS,} from "@calcom/lib/constants";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { TIsAvailableOutputSchema } from "@calcom/trpc/server/routers/viewer/slots/isAvailable.schema";import { useIsQuickAvailabilityCheckFeatureEnabled } from "./useIsQuickAvailabilityCheckFeatureEnabled";@@ -51,7 +51,7 @@ const useQuickAvailabilityChecks = ({{slots: slotsToCheck,// enabled flag can't be true if eventTypeId is nullish- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion+eventTypeId: eventTypeId!,},{diff --git a/packages/features/bookings/Booker/components/hooks/useVerifyEmail.ts b/packages/features/bookings/Booker/components/hooks/useVerifyEmail.tsindex 3564929d79b..eada0222d3c 100644--- a/packages/features/bookings/Booker/components/hooks/useVerifyEmail.ts+++ b/packages/features/bookings/Booker/components/hooks/useVerifyEmail.ts@@ -4,7 +4,7 @@ import { useState } from "react";import { useBookerStore } from "@calcom/features/bookings/Booker/store";import { useDebounce } from "@calcom/lib/hooks/useDebounce";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { showToast } from "@calcom/ui/components/toast";export interface IUseVerifyEmailProps {diff --git a/packages/features/bookings/types.server.ts b/packages/features/bookings/types.server.tsnew file mode 100644index 00000000000..9fae23b34c8--- /dev/null+++ b/packages/features/bookings/types.server.ts@@ -0,0 +1,14 @@+import type { z } from "zod";++import type { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";++/**+ * Server-safe subset of BookerEvent type.+ * This type is used by server code that needs to access event type metadata+ * without pulling in React/TRPC client dependencies.+ */+export type BookerEventForAppData = {+ price: number;+ currency: string;+ metadata: z.infer<typeof eventTypeMetaDataSchemaWithTypedApps> | null;+};diff --git a/packages/features/bookings/types.ts b/packages/features/bookings/types.tsindex f546760d725..1f3454e5c49 100644--- a/packages/features/bookings/types.ts+++ b/packages/features/bookings/types.ts@@ -1,11 +1,11 @@import type { ErrorOption, FieldPath } from "react-hook-form";import type { RegularBookingCreateResult } from "@calcom/features/bookings/lib/dto/types";+import type { Slots } from "@calcom/features/calendars/lib/types";import type { SchedulingType } from "@calcom/prisma/enums";import type { RouterOutputs } from "@calcom/trpc/react";import type { AppsStatus } from "@calcom/types/Calendar";-import type { DatePickerProps } from "../calendars/DatePicker";import type { BookingCreateBody } from "./lib/bookingCreateBodySchema";export type PublicEvent = NonNullable<RouterOutputs["viewer"]["public"]["event"]>;@@ -29,8 +29,8 @@ type BookerEventUser = Pick<type BookerEventProfile = Pick<PublicEvent["profile"], "name" | "image" | "bookerLayouts">;-// marked as required to keep responsibility on consumers to handle the case where slots is undefined-export type Slots = Required<NonNullable<DatePickerProps["slots"]>>;+// Re-export Slots from the server-safe location+export type { Slots };export type BookerEvent = Pick<PublicEvent,diff --git a/packages/features/calendars/DatePicker.tsx b/packages/features/calendars/DatePicker.tsxindex 63bc4888f6b..fc0de3b0674 100644--- a/packages/features/calendars/DatePicker.tsx+++ b/packages/features/calendars/DatePicker.tsx@@ -4,9 +4,9 @@ import { shallow } from "zustand/shallow";import type { Dayjs } from "@calcom/dayjs";import dayjs from "@calcom/dayjs";import { useEmbedStyles } from "@calcom/embed-core/embed-iframe";-import type { IFromUser, IToUser } from "@calcom/features/availability/lib/getUserAvailability";import { useBookerStoreContext } from "@calcom/features/bookings/Booker/BookerStoreProvider";import { getAvailableDatesInMonth } from "@calcom/features/calendars/lib/getAvailableDatesInMonth";+import type { Slots } from "@calcom/features/calendars/lib/types";import { daysInMonth, yyyymmdd } from "@calcom/lib/dayjs";import { useLocale } from "@calcom/lib/hooks/useLocale";import { weekdayNames } from "@calcom/lib/weekday";@@ -44,19 +44,7 @@ export type DatePickerProps = {/** used to query the multiple selected dates */eventSlug?: string;/** To identify days that are not available and should display OOO and redirect if toUser exists */- slots?: Record<- string,- {- time: string;- userIds?: number[];- away?: boolean;- fromUser?: IFromUser;- toUser?: IToUser;- reason?: string;- emoji?: string;- showNotePublicly?: boolean;- }[]- >;+ slots?: Slots;periodData?: PeriodData;// Whether this is a compact sidebar view or main monthly viewisCompact?: boolean;diff --git a/packages/features/calendars/lib/types.ts b/packages/features/calendars/lib/types.tsnew file mode 100644index 00000000000..8bf2df2a89b--- /dev/null+++ b/packages/features/calendars/lib/types.ts@@ -0,0 +1,14 @@+import type { IFromUser, IToUser } from "@calcom/features/availability/lib/getUserAvailability";++export type SlotInfo = {+ time: string;+ userIds?: number[];+ away?: boolean;+ fromUser?: IFromUser;+ toUser?: IToUser;+ reason?: string;+ emoji?: string;+ showNotePublicly?: boolean;+};++export type Slots = Record<string, SlotInfo[]>;diff --git a/packages/features/data-table/components/segment/DeleteSegmentDialog.tsx b/packages/features/data-table/components/segment/DeleteSegmentDialog.tsxindex 4defe5d3833..0a8226da4f1 100644--- a/packages/features/data-table/components/segment/DeleteSegmentDialog.tsx+++ b/packages/features/data-table/components/segment/DeleteSegmentDialog.tsx@@ -1,5 +1,5 @@import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Dialog, ConfirmationDialogContent } from "@calcom/ui/components/dialog";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/data-table/components/segment/DuplicateSegmentDialog.tsx b/packages/features/data-table/components/segment/DuplicateSegmentDialog.tsxindex 548dd96c7f8..448181502f9 100644--- a/packages/features/data-table/components/segment/DuplicateSegmentDialog.tsx+++ b/packages/features/data-table/components/segment/DuplicateSegmentDialog.tsx@@ -3,7 +3,7 @@ import { useForm } from "react-hook-form";import { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/components/dialog";import { Form, TextField } from "@calcom/ui/components/form";diff --git a/packages/features/data-table/components/segment/RenameSegmentDialog.tsx b/packages/features/data-table/components/segment/RenameSegmentDialog.tsxindex 0b2707068d7..39503b93212 100644--- a/packages/features/data-table/components/segment/RenameSegmentDialog.tsx+++ b/packages/features/data-table/components/segment/RenameSegmentDialog.tsx@@ -1,7 +1,7 @@import { useForm } from "react-hook-form";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/components/dialog";import { Form, TextField } from "@calcom/ui/components/form";diff --git a/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx b/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsxindex c712c28d6c2..62a1f2c1e8e 100644--- a/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx+++ b/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx@@ -6,7 +6,7 @@ import { useState } from "react";import { Controller, useForm } from "react-hook-form";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { Ensure } from "@calcom/types/utils";import { Alert } from "@calcom/ui/components/alert";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/ee/organizations/components/TeamInviteFromOrg.tsx b/packages/features/ee/organizations/components/TeamInviteFromOrg.tsxindex da3a19a67d1..b109f370697 100644--- a/packages/features/ee/organizations/components/TeamInviteFromOrg.tsx+++ b/packages/features/ee/organizations/components/TeamInviteFromOrg.tsx@@ -1,7 +1,7 @@import type { PropsWithChildren } from "react";import { useState } from "react";-import type { RouterOutputs } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";import { TextField } from "@calcom/ui/components/form";import { Avatar } from "@calcom/ui/components/avatar";import classNames from "@calcom/ui/classNames";diff --git a/packages/features/ee/organizations/pages/components/DisableAutofillOnBookingPageSwitch.tsx b/packages/features/ee/organizations/pages/components/DisableAutofillOnBookingPageSwitch.tsxindex c8352de9485..7f2d3fa61ef 100644--- a/packages/features/ee/organizations/pages/components/DisableAutofillOnBookingPageSwitch.tsx+++ b/packages/features/ee/organizations/pages/components/DisableAutofillOnBookingPageSwitch.tsx@@ -3,8 +3,8 @@import { useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import { SettingsToggle } from "@calcom/ui/components/form";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/ee/organizations/pages/components/DisableGuestBookingEmailsSetting.tsx b/packages/features/ee/organizations/pages/components/DisableGuestBookingEmailsSetting.tsxindex b44670dacad..64ba7c5776e 100644--- a/packages/features/ee/organizations/pages/components/DisableGuestBookingEmailsSetting.tsx+++ b/packages/features/ee/organizations/pages/components/DisableGuestBookingEmailsSetting.tsx@@ -5,7 +5,7 @@ import { useState } from "react";import { EmailType } from "@calcom/emails/email-types";import { Dialog } from "@calcom/features/components/controlled-dialog";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Alert } from "@calcom/ui/components/alert";import { ConfirmationDialogContent } from "@calcom/ui/components/dialog";import { Checkbox, SettingsToggle } from "@calcom/ui/components/form";diff --git a/packages/features/ee/organizations/pages/components/DisablePhoneOnlySMSNotificationsSwitch.tsx b/packages/features/ee/organizations/pages/components/DisablePhoneOnlySMSNotificationsSwitch.tsxindex b1852f86857..b7d7957cf81 100644--- a/packages/features/ee/organizations/pages/components/DisablePhoneOnlySMSNotificationsSwitch.tsx+++ b/packages/features/ee/organizations/pages/components/DisablePhoneOnlySMSNotificationsSwitch.tsx@@ -3,8 +3,8 @@import { useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import { SettingsToggle } from "@calcom/ui/components/form";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/ee/organizations/pages/components/LockEventTypeSwitch.tsx b/packages/features/ee/organizations/pages/components/LockEventTypeSwitch.tsxindex 1446765da13..b61a2f4715d 100644--- a/packages/features/ee/organizations/pages/components/LockEventTypeSwitch.tsx+++ b/packages/features/ee/organizations/pages/components/LockEventTypeSwitch.tsx@@ -3,8 +3,8 @@ import { useForm } from "react-hook-form";import { Dialog } from "@calcom/features/components/controlled-dialog";import { useLocale } from "@calcom/lib/hooks/useLocale";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Button } from "@calcom/ui/components/button";import { DialogContent, DialogFooter, DialogHeader, DialogClose } from "@calcom/ui/components/dialog";diff --git a/packages/features/ee/organizations/pages/components/NoSlotsNotificationSwitch.tsx b/packages/features/ee/organizations/pages/components/NoSlotsNotificationSwitch.tsxindex 4d714409df8..f61a66a750c 100644--- a/packages/features/ee/organizations/pages/components/NoSlotsNotificationSwitch.tsx+++ b/packages/features/ee/organizations/pages/components/NoSlotsNotificationSwitch.tsx@@ -1,8 +1,8 @@import { useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import { SettingsToggle } from "@calcom/ui/components/form";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/ee/organizations/pages/components/OrgAutoJoinSetting.tsx b/packages/features/ee/organizations/pages/components/OrgAutoJoinSetting.tsxindex c6b677293cc..5ccfd8317ef 100644--- a/packages/features/ee/organizations/pages/components/OrgAutoJoinSetting.tsx+++ b/packages/features/ee/organizations/pages/components/OrgAutoJoinSetting.tsx@@ -3,7 +3,7 @@import { useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { SettingsToggle } from "@calcom/ui/components/form";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/ee/organizations/pages/settings/admin/WorkspacePlatformPage.tsx b/packages/features/ee/organizations/pages/settings/admin/WorkspacePlatformPage.tsxindex 8e7aa1cc16b..63ec6724ca6 100644--- a/packages/features/ee/organizations/pages/settings/admin/WorkspacePlatformPage.tsx+++ b/packages/features/ee/organizations/pages/settings/admin/WorkspacePlatformPage.tsx@@ -9,7 +9,7 @@ import { z } from "zod";import { Dialog } from "@calcom/features/components/controlled-dialog";import { useLocale } from "@calcom/lib/hooks/useLocale";import { serviceAccountKeySchema } from "@calcom/prisma/zod-utils";-import { trpc, type RouterOutputs } from "@calcom/trpc";+import { trpc, type RouterOutputs } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { DialogContent, DialogFooter, DialogClose } from "@calcom/ui/components/dialog";import { Form } from "@calcom/ui/components/form";diff --git a/packages/features/ee/teams/components/EventTypesList.tsx b/packages/features/ee/teams/components/EventTypesList.tsxindex 0218094d163..48bafb0b780 100644--- a/packages/features/ee/teams/components/EventTypesList.tsx+++ b/packages/features/ee/teams/components/EventTypesList.tsx@@ -5,7 +5,7 @@ import { useState, Fragment } from "react";import { DataTableSelectionBar } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";import { SchedulingType } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Button } from "@calcom/ui/components/button";import {diff --git a/packages/features/ee/teams/components/GoogleWorkspaceInviteButton.tsx b/packages/features/ee/teams/components/GoogleWorkspaceInviteButton.tsxindex 3d9131886fc..876607f5efc 100644--- a/packages/features/ee/teams/components/GoogleWorkspaceInviteButton.tsx+++ b/packages/features/ee/teams/components/GoogleWorkspaceInviteButton.tsx@@ -4,7 +4,7 @@ import { useState } from "react";import { useFlagMap } from "@calcom/features/flags/context/provider";import { useLocale } from "@calcom/lib/hooks/useLocale";import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { showToast } from "@calcom/ui/components/toast";import { Tooltip } from "@calcom/ui/components/tooltip";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/ee/teams/components/InviteLinkSettingsModal.tsx b/packages/features/ee/teams/components/InviteLinkSettingsModal.tsxindex 4efab6743d5..ef323854fe6 100644--- a/packages/features/ee/teams/components/InviteLinkSettingsModal.tsx+++ b/packages/features/ee/teams/components/InviteLinkSettingsModal.tsx@@ -3,7 +3,7 @@ import { Controller, useForm } from "react-hook-form";import { Dialog } from "@calcom/features/components/controlled-dialog";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { DialogContent, DialogFooter } from "@calcom/ui/components/dialog";import { Form } from "@calcom/ui/components/form";diff --git a/packages/features/ee/teams/components/MemberInvitationModal.tsx b/packages/features/ee/teams/components/MemberInvitationModal.tsxindex c07a2afa8ea..ab162630e72 100644--- a/packages/features/ee/teams/components/MemberInvitationModal.tsx+++ b/packages/features/ee/teams/components/MemberInvitationModal.tsx@@ -13,8 +13,8 @@ import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";import { MembershipRole } from "@calcom/prisma/enums";import { CreationSource } from "@calcom/prisma/enums";-import type { RouterOutputs } from "@calcom/trpc";-import { trpc } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";+import { trpc } from "@calcom/trpc/react";import { isEmail } from "@calcom/trpc/server/routers/viewer/teams/util";import classNames from "@calcom/ui/classNames";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/ee/teams/components/MemberList.tsx b/packages/features/ee/teams/components/MemberList.tsxindex ff1ee1627c3..2efe7dc5dfe 100644--- a/packages/features/ee/teams/components/MemberList.tsx+++ b/packages/features/ee/teams/components/MemberList.tsx@@ -35,7 +35,7 @@ import type { MemberPermissions } from "@calcom/features/users/components/UserTaimport { WEBAPP_URL } from "@calcom/lib/constants";import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Avatar } from "@calcom/ui/components/avatar";import { Badge } from "@calcom/ui/components/badge";diff --git a/packages/features/ee/workflows/pages/call-history.tsx b/packages/features/ee/workflows/pages/call-history.tsxindex cf225096ad5..e5218ecfd65 100644--- a/packages/features/ee/workflows/pages/call-history.tsx+++ b/packages/features/ee/workflows/pages/call-history.tsx@@ -18,7 +18,7 @@ import { useSegments } from "@calcom/features/data-table/hooks/useSegments";import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";import { WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Badge } from "@calcom/ui/components/badge";diff --git a/packages/features/ee/workflows/repositories/WorkflowRepository.ts b/packages/features/ee/workflows/repositories/WorkflowRepository.tsindex c2c94d6b6a2..4eeea447bb2 100644--- a/packages/features/ee/workflows/repositories/WorkflowRepository.ts+++ b/packages/features/ee/workflows/repositories/WorkflowRepository.ts@@ -1,6 +1,6 @@import { z } from "zod";-import type { WorkflowType } from "@calcom/ee/workflows/components/WorkflowListPage";+import type { WorkflowListType as WorkflowType } from "@calcom/ee/workflows/lib/types";import { FORM_TRIGGER_WORKFLOW_EVENTS } from "@calcom/ee/workflows/lib/constants";import { deleteScheduledAIPhoneCall } from "@calcom/ee/workflows/lib/reminders/aiPhoneCallManager";import { deleteScheduledEmailReminder } from "@calcom/ee/workflows/lib/reminders/emailReminderManager";diff --git a/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx b/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsxindex c8e16fd8a4f..0d28ee7437d 100644--- a/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx+++ b/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx@@ -2,10 +2,10 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";import type { Props } from "react-select";import { getBookerBaseUrlSync } from "@calcom/features/ee/organizations/lib/getBookerBaseUrlSync";+import type { ChildrenEventType } from "@calcom/features/eventtypes/lib/childrenEventType";import type { SelectClassNames } from "@calcom/features/eventtypes/lib/types";import { useLocale } from "@calcom/lib/hooks/useLocale";import { MembershipRole } from "@calcom/prisma/enums";-import type { UserProfile } from "@calcom/types/UserProfile";import classNames from "@calcom/ui/classNames";import { Avatar } from "@calcom/ui/components/avatar";import { Badge } from "@calcom/ui/components/badge";@@ -15,23 +15,7 @@ import { Select } from "@calcom/ui/components/form";import { Switch } from "@calcom/ui/components/form";import { Tooltip } from "@calcom/ui/components/tooltip";-export type ChildrenEventType = {- value: string;- label: string;- created: boolean;- owner: {- avatar: string;- id: number;- email: string;- name: string;- username: string;- membership: MembershipRole;- eventTypeSlugs: string[];- profile: UserProfile;- };- slug: string;- hidden: boolean;-};+export type { ChildrenEventType } from "@calcom/features/eventtypes/lib/childrenEventType";export type ChildrenEventTypeSelectCustomClassNames = {assignToSelect?: SelectClassNames;diff --git a/packages/features/eventtypes/lib/childrenEventType.ts b/packages/features/eventtypes/lib/childrenEventType.tsnew file mode 100644index 00000000000..ed127cbdda1--- /dev/null+++ b/packages/features/eventtypes/lib/childrenEventType.ts@@ -0,0 +1,20 @@+import type { MembershipRole } from "@calcom/prisma/enums";+import type { UserProfile } from "@calcom/types/UserProfile";++export type ChildrenEventType = {+ value: string;+ label: string;+ created: boolean;+ owner: {+ avatar: string;+ id: number;+ email: string;+ name: string;+ username: string;+ membership: MembershipRole;+ eventTypeSlugs: string[];+ profile: UserProfile;+ };+ slug: string;+ hidden: boolean;+};diff --git a/packages/features/eventtypes/lib/schemas.ts b/packages/features/eventtypes/lib/schemas.tsnew file mode 100644index 00000000000..82350a70369--- /dev/null+++ b/packages/features/eventtypes/lib/schemas.ts@@ -0,0 +1,54 @@+import { z } from "zod";++import { SchedulingType } from "@calcom/prisma/enums";+import { eventTypeLocations, EventTypeMetaDataSchema, eventTypeSlug } from "@calcom/prisma/zod-utils";++const calVideoSettingsSchema = z+ .object({+ disableRecordingForGuests: z.boolean().nullish(),+ disableRecordingForOrganizer: z.boolean().nullish(),+ enableAutomaticTranscription: z.boolean().nullish(),+ enableAutomaticRecordingForOrganizer: z.boolean().nullish(),+ disableTranscriptionForGuests: z.boolean().nullish(),+ disableTranscriptionForOrganizer: z.boolean().nullish(),+ redirectUrlOnExit: z.string().url().nullish(),+ requireEmailForGuests: z.boolean().nullish(),+ })+ .optional()+ .nullable();++export const EventTypeDuplicateInput = z+ .object({+ id: z.number(),+ slug: z.string(),+ title: z.string().min(1),+ description: z.string(),+ length: z.number(),+ teamId: z.number().nullish(),+ })+ .strict();++export const createEventTypeInput = z+ .object({+ title: z.string().trim().min(1),+ slug: eventTypeSlug,+ description: z.string().nullish(),+ length: z.number().int(),+ hidden: z.boolean(),+ teamId: z.number().int().nullish(),+ schedulingType: z.nativeEnum(SchedulingType).nullish(),+ locations: eventTypeLocations,+ metadata: EventTypeMetaDataSchema.optional(),+ disableGuests: z.boolean().optional(),+ slotInterval: z.number().min(0).nullish(),+ minimumBookingNotice: z.number().int().min(0).optional(),+ beforeEventBuffer: z.number().int().min(0).optional(),+ afterEventBuffer: z.number().int().min(0).optional(),+ scheduleId: z.number().int().optional(),+ calVideoSettings: calVideoSettingsSchema,+ })+ .partial({ hidden: true, locations: true })+ .refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {+ path: ["schedulingType"],+ message: "You must select a scheduling type for team events",+ });diff --git a/packages/features/eventtypes/lib/types.ts b/packages/features/eventtypes/lib/types.tsindex e61b881b98b..2c0b0e79439 100644--- a/packages/features/eventtypes/lib/types.ts+++ b/packages/features/eventtypes/lib/types.ts@@ -2,17 +2,12 @@ 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 { ChildrenEventType } from "@calcom/features/eventtypes/lib/childrenEventType";import type { IntervalLimit } from "@calcom/lib/intervalLimits/intervalLimitSchema";import type { AttributesQueryValue } from "@calcom/lib/raqb/types";import type { EventTypeTranslation } from "@calcom/prisma/client";import { type PeriodType, SchedulingType } from "@calcom/prisma/enums";-import {- eventTypeLocations,- EventTypeMetaDataSchema,- eventTypeSlug,- type BookerLayoutSettings,-} from "@calcom/prisma/zod-utils";+import type { BookerLayoutSettings } from "@calcom/prisma/zod-utils";import type { customInputSchema } from "@calcom/prisma/zod-utils";import type { eventTypeBookingFields } from "@calcom/prisma/zod-utils";import type { eventTypeColor } from "@calcom/prisma/zod-utils";@@ -236,55 +231,8 @@ export type SelectClassNames = {container?: string;};-export const EventTypeDuplicateInput = z- .object({- id: z.number(),- slug: z.string(),- title: z.string().min(1),- description: z.string(),- length: z.number(),- teamId: z.number().nullish(),- })- .strict();--const calVideoSettingsSchema = z- .object({- disableRecordingForGuests: z.boolean().nullish(),- disableRecordingForOrganizer: z.boolean().nullish(),- enableAutomaticTranscription: z.boolean().nullish(),- enableAutomaticRecordingForOrganizer: z.boolean().nullish(),- disableTranscriptionForGuests: z.boolean().nullish(),- disableTranscriptionForOrganizer: z.boolean().nullish(),- redirectUrlOnExit: z.string().url().nullish(),- requireEmailForGuests: z.boolean().nullish(),- })- .optional()- .nullable();--export const createEventTypeInput = z- .object({- title: z.string().trim().min(1),- slug: eventTypeSlug,- description: z.string().nullish(),- length: z.number().int(),- hidden: z.boolean(),- teamId: z.number().int().nullish(),- schedulingType: z.nativeEnum(SchedulingType).nullish(),- locations: eventTypeLocations,- metadata: EventTypeMetaDataSchema.optional(),- disableGuests: z.boolean().optional(),- slotInterval: z.number().min(0).nullish(),- minimumBookingNotice: z.number().int().min(0).optional(),- beforeEventBuffer: z.number().int().min(0).optional(),- afterEventBuffer: z.number().int().min(0).optional(),- scheduleId: z.number().int().optional(),- calVideoSettings: calVideoSettingsSchema,- })- .partial({ hidden: true, locations: true })- .refine((data) => (data.teamId ? data.teamId && data.schedulingType : true), {- path: ["schedulingType"],- message: "You must select a scheduling type for team events",- });+// Re-export schemas from server-safe location+export { EventTypeDuplicateInput, createEventTypeInput } from "./schemas";export type FormValidationResult = {isValid: boolean;diff --git a/packages/features/insights/HOW_TO_ADD_BOOKING_CHARTS.md b/packages/features/insights/HOW_TO_ADD_BOOKING_CHARTS.mdindex 13e32276a91..3f6930277c9 100644--- a/packages/features/insights/HOW_TO_ADD_BOOKING_CHARTS.md+++ b/packages/features/insights/HOW_TO_ADD_BOOKING_CHARTS.md@@ -19,7 +19,7 @@ Create your chart component in `packages/features/insights/components/booking/`:import { LineChart, XAxis, YAxis, CartesianGrid, Tooltip, Line, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/AverageEventDurationChart.tsx b/packages/features/insights/components/booking/AverageEventDurationChart.tsxindex 8ccabe406bb..eaa7adce643 100644--- a/packages/features/insights/components/booking/AverageEventDurationChart.tsx+++ b/packages/features/insights/components/booking/AverageEventDurationChart.tsx@@ -3,7 +3,7 @@import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";diff --git a/packages/features/insights/components/booking/BookingKPICards.tsx b/packages/features/insights/components/booking/BookingKPICards.tsxindex df9430c75cc..2fcb995d44b 100644--- a/packages/features/insights/components/booking/BookingKPICards.tsx+++ b/packages/features/insights/components/booking/BookingKPICards.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { SkeletonText } from "@calcom/ui/components/skeleton";diff --git a/packages/features/insights/components/booking/BookingsByHourChart.tsx b/packages/features/insights/components/booking/BookingsByHourChart.tsxindex c66609f745c..aa8e1c379e6 100644--- a/packages/features/insights/components/booking/BookingsByHourChart.tsx+++ b/packages/features/insights/components/booking/BookingsByHourChart.tsx@@ -12,7 +12,7 @@ import {} from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";diff --git a/packages/features/insights/components/booking/CSATOverTimeChart.tsx b/packages/features/insights/components/booking/CSATOverTimeChart.tsxindex f8482e31421..77d7aa08300 100644--- a/packages/features/insights/components/booking/CSATOverTimeChart.tsx+++ b/packages/features/insights/components/booking/CSATOverTimeChart.tsx@@ -3,7 +3,7 @@import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";diff --git a/packages/features/insights/components/booking/EventTrendsChart.tsx b/packages/features/insights/components/booking/EventTrendsChart.tsxindex 0767e4c59eb..a093baaa370 100644--- a/packages/features/insights/components/booking/EventTrendsChart.tsx+++ b/packages/features/insights/components/booking/EventTrendsChart.tsx@@ -3,7 +3,7 @@import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";diff --git a/packages/features/insights/components/booking/HighestNoShowHostTable.tsx b/packages/features/insights/components/booking/HighestNoShowHostTable.tsxindex afbef1811ab..e780ea76d84 100644--- a/packages/features/insights/components/booking/HighestNoShowHostTable.tsx+++ b/packages/features/insights/components/booking/HighestNoShowHostTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/HighestRatedMembersTable.tsx b/packages/features/insights/components/booking/HighestRatedMembersTable.tsxindex cbf79954b40..e849456036d 100644--- a/packages/features/insights/components/booking/HighestRatedMembersTable.tsx+++ b/packages/features/insights/components/booking/HighestRatedMembersTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/LeastBookedTeamMembersTable.tsx b/packages/features/insights/components/booking/LeastBookedTeamMembersTable.tsxindex 24a80954b67..24ca58da76f 100644--- a/packages/features/insights/components/booking/LeastBookedTeamMembersTable.tsx+++ b/packages/features/insights/components/booking/LeastBookedTeamMembersTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/LeastCompletedBookings.tsx b/packages/features/insights/components/booking/LeastCompletedBookings.tsxindex 39bbf71281c..6902f840ab7 100644--- a/packages/features/insights/components/booking/LeastCompletedBookings.tsx+++ b/packages/features/insights/components/booking/LeastCompletedBookings.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/LowestRatedMembersTable.tsx b/packages/features/insights/components/booking/LowestRatedMembersTable.tsxindex ef5faa0a2a9..a02b509d8ae 100644--- a/packages/features/insights/components/booking/LowestRatedMembersTable.tsx+++ b/packages/features/insights/components/booking/LowestRatedMembersTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/MostBookedTeamMembersTable.tsx b/packages/features/insights/components/booking/MostBookedTeamMembersTable.tsxindex fdc16557f22..59fabac803f 100644--- a/packages/features/insights/components/booking/MostBookedTeamMembersTable.tsx+++ b/packages/features/insights/components/booking/MostBookedTeamMembersTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/MostCancelledBookingsTables.tsx b/packages/features/insights/components/booking/MostCancelledBookingsTables.tsxindex fd87f922b63..006b6e053ea 100644--- a/packages/features/insights/components/booking/MostCancelledBookingsTables.tsx+++ b/packages/features/insights/components/booking/MostCancelledBookingsTables.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/MostCompletedBookings.tsx b/packages/features/insights/components/booking/MostCompletedBookings.tsxindex e220dd91da2..0b6c49734fd 100644--- a/packages/features/insights/components/booking/MostCompletedBookings.tsx+++ b/packages/features/insights/components/booking/MostCompletedBookings.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/NoShowHostsOverTimeChart.tsx b/packages/features/insights/components/booking/NoShowHostsOverTimeChart.tsxindex f9b67782bb5..b9fd3461ad7 100644--- a/packages/features/insights/components/booking/NoShowHostsOverTimeChart.tsx+++ b/packages/features/insights/components/booking/NoShowHostsOverTimeChart.tsx@@ -3,7 +3,7 @@import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";diff --git a/packages/features/insights/components/booking/PopularEventsTable.tsx b/packages/features/insights/components/booking/PopularEventsTable.tsxindex d4cd8aabc54..e8432f97e59 100644--- a/packages/features/insights/components/booking/PopularEventsTable.tsx+++ b/packages/features/insights/components/booking/PopularEventsTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard, ChartCardItem } from "../ChartCard";diff --git a/packages/features/insights/components/booking/RecentFeedbackTable.tsx b/packages/features/insights/components/booking/RecentFeedbackTable.tsxindex 499aac00127..e666a3a9a0b 100644--- a/packages/features/insights/components/booking/RecentFeedbackTable.tsx+++ b/packages/features/insights/components/booking/RecentFeedbackTable.tsx@@ -1,7 +1,7 @@"use client";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useInsightsBookingParameters } from "../../hooks/useInsightsBookingParameters";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/booking/RecentNoShowGuestsChart.tsx b/packages/features/insights/components/booking/RecentNoShowGuestsChart.tsxindex dc31d2ab6f6..19fd510be1d 100644--- a/packages/features/insights/components/booking/RecentNoShowGuestsChart.tsx+++ b/packages/features/insights/components/booking/RecentNoShowGuestsChart.tsx@@ -2,7 +2,7 @@import { useCopy } from "@calcom/lib/hooks/useCopy";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/insights/components/routing/FailedBookingsByField.tsx b/packages/features/insights/components/routing/FailedBookingsByField.tsxindex 04c730d185c..b138b21df61 100644--- a/packages/features/insights/components/routing/FailedBookingsByField.tsx+++ b/packages/features/insights/components/routing/FailedBookingsByField.tsx@@ -13,7 +13,7 @@ import {} from "recharts";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { ToggleGroup } from "@calcom/ui/components/form";import { useInsightsRoutingParameters } from "../../hooks/useInsightsRoutingParameters";diff --git a/packages/features/insights/components/routing/RoutedToPerPeriod.tsx b/packages/features/insights/components/routing/RoutedToPerPeriod.tsxindex ff55d571f68..b5b18a69c64 100644--- a/packages/features/insights/components/routing/RoutedToPerPeriod.tsx+++ b/packages/features/insights/components/routing/RoutedToPerPeriod.tsx@@ -8,7 +8,7 @@ import posthog from "posthog-js";import { downloadAsCsv } from "@calcom/lib/csvUtils";import { useDebounce } from "@calcom/lib/hooks/useDebounce";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Avatar } from "@calcom/ui/components/avatar";diff --git a/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx b/packages/features/insights/components/routing/RoutingFormResponsesTable.tsxindex ea524853741..bc4eebfb438 100644--- a/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx+++ b/packages/features/insights/components/routing/RoutingFormResponsesTable.tsx@@ -21,7 +21,7 @@ import {} from "@calcom/features/data-table";import type { FilterType } from "@calcom/types/data-table";import { useInsightsRoutingParameters } from "@calcom/features/insights/hooks/useInsightsRoutingParameters";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { RoutingFormResponsesDownload } from "../../filters/Download";import { OrgTeamsFilter } from "../../filters/OrgTeamsFilter";diff --git a/packages/features/insights/components/routing/RoutingFunnel.tsx b/packages/features/insights/components/routing/RoutingFunnel.tsxindex c907d09ad53..b6a609aa8fa 100644--- a/packages/features/insights/components/routing/RoutingFunnel.tsx+++ b/packages/features/insights/components/routing/RoutingFunnel.tsx@@ -2,7 +2,7 @@import { useInsightsRoutingParameters } from "@calcom/features/insights/hooks/useInsightsRoutingParameters";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useToggleableLegend } from "../../hooks/useToggleableLegend";import { ChartCard } from "../ChartCard";diff --git a/packages/features/insights/components/routing/RoutingKPICards.tsx b/packages/features/insights/components/routing/RoutingKPICards.tsxindex 7d1232076f0..3aa14ca105e 100644--- a/packages/features/insights/components/routing/RoutingKPICards.tsx+++ b/packages/features/insights/components/routing/RoutingKPICards.tsx@@ -2,7 +2,7 @@import { useInsightsRoutingParameters } from "@calcom/features/insights/hooks/useInsightsRoutingParameters";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { SkeletonText } from "@calcom/ui/components/skeleton";diff --git a/packages/features/insights/filters/Download/Download.tsx b/packages/features/insights/filters/Download/Download.tsxindex 9c482f41457..1d8387bbe65 100644--- a/packages/features/insights/filters/Download/Download.tsx+++ b/packages/features/insights/filters/Download/Download.tsx@@ -4,7 +4,7 @@ import posthog from "posthog-js";import dayjs from "@calcom/dayjs";import { downloadAsCsv } from "@calcom/lib/csvUtils";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import {diff --git a/packages/features/insights/filters/Download/RoutingFormResponsesDownload.tsx b/packages/features/insights/filters/Download/RoutingFormResponsesDownload.tsxindex f76a2b0124f..2a3b24cd49d 100644--- a/packages/features/insights/filters/Download/RoutingFormResponsesDownload.tsx+++ b/packages/features/insights/filters/Download/RoutingFormResponsesDownload.tsx@@ -5,7 +5,7 @@ import type { SortingState } from "@calcom/features/data-table";import { useInsightsRoutingParameters } from "@calcom/features/insights/hooks/useInsightsRoutingParameters";import { downloadAsCsv } from "@calcom/lib/csvUtils";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import { Button } from "@calcom/ui/components/button";import {diff --git a/packages/features/insights/filters/OrgTeamsFilter.tsx b/packages/features/insights/filters/OrgTeamsFilter.tsxindex 58f566e3e1d..1684a31d238 100644--- a/packages/features/insights/filters/OrgTeamsFilter.tsx+++ b/packages/features/insights/filters/OrgTeamsFilter.tsx@@ -7,7 +7,7 @@ import {} from "@calcom/features/filters/components/TeamsFilter";import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Avatar } from "@calcom/ui/components/avatar";import { Divider } from "@calcom/ui/components/divider";import { FilterSearchField } from "@calcom/ui/components/form";diff --git a/packages/features/insights/hooks/useDefaultRoutingForm.ts b/packages/features/insights/hooks/useDefaultRoutingForm.tsindex cddd864aa2e..1f62e36827e 100644--- a/packages/features/insights/hooks/useDefaultRoutingForm.ts+++ b/packages/features/insights/hooks/useDefaultRoutingForm.ts@@ -2,7 +2,7 @@ import { usePathname, useRouter } from "next/navigation";import { useEffect, useRef } from "react";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";export function useDefaultRoutingForm({userId,diff --git a/packages/features/insights/hooks/useInsightsBookingFacetedUniqueValues.ts b/packages/features/insights/hooks/useInsightsBookingFacetedUniqueValues.tsindex c2feecf0945..6cae7b4f487 100644--- a/packages/features/insights/hooks/useInsightsBookingFacetedUniqueValues.ts+++ b/packages/features/insights/hooks/useInsightsBookingFacetedUniqueValues.ts@@ -4,7 +4,7 @@ import { useCallback } from "react";import { convertFacetedValuesToMap, type FacetedValue } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";import { BookingStatus } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { bookingStatusToText } from "../lib/bookingStatusToText";diff --git a/packages/features/insights/hooks/useInsightsRoutingFacetedUniqueValues.ts b/packages/features/insights/hooks/useInsightsRoutingFacetedUniqueValues.tsindex c03bb1a670a..12585dd23ff 100644--- a/packages/features/insights/hooks/useInsightsRoutingFacetedUniqueValues.ts+++ b/packages/features/insights/hooks/useInsightsRoutingFacetedUniqueValues.ts@@ -3,7 +3,7 @@ import { useCallback } from "react";import { convertFacetedValuesToMap, type FacetedValue } from "@calcom/features/data-table";import { BookingStatus } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { bookingStatusToText } from "../lib/bookingStatusToText";import type { HeaderRow } from "../lib/types";diff --git a/packages/features/insights/lib/types.ts b/packages/features/insights/lib/types.tsindex 78868b51998..0461a0326e0 100644--- a/packages/features/insights/lib/types.ts+++ b/packages/features/insights/lib/types.ts@@ -1,6 +1,6 @@import { z } from "zod";-import type { RouterOutputs } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";export type RoutingFormTableRow = RouterOutputs["viewer"]["insights"]["routingFormResponses"]["data"][number];diff --git a/packages/features/shell/user-dropdown/ProfileDropdown.tsx b/packages/features/shell/user-dropdown/ProfileDropdown.tsxindex e665ddc31ff..5d700258e6a 100644--- a/packages/features/shell/user-dropdown/ProfileDropdown.tsx+++ b/packages/features/shell/user-dropdown/ProfileDropdown.tsx@@ -3,7 +3,7 @@ import { useState } from "react";import { ENABLE_PROFILE_SWITCHER } from "@calcom/lib/constants";import { useRefreshData } from "@calcom/lib/hooks/useRefreshData";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Avatar } from "@calcom/ui/components/avatar";import classNames from "@calcom/ui/classNames";import {diff --git a/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx b/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsxindex db9a02af74b..767aad9ca47 100644--- a/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx+++ b/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx@@ -15,7 +15,7 @@ import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";import { CURRENT_TIMEZONE } from "@calcom/lib/timezoneConstants";import type { MembershipRole } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { UserProfile } from "@calcom/types/UserProfile";import { UserAvatar } from "@calcom/ui/components/avatar";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/tips/UpgradeTip.tsx b/packages/features/tips/UpgradeTip.tsxindex 25bbd69048c..d0ab6c90516 100644--- a/packages/features/tips/UpgradeTip.tsx+++ b/packages/features/tips/UpgradeTip.tsx@@ -2,7 +2,7 @@ import type { ReactNode } from "react";import { useHasTeamPlan } from "@calcom/features/billing/hooks/useHasPaidPlan";import { useGetTheme } from "@calcom/lib/hooks/useTheme";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";export function UpgradeTip({diff --git a/packages/features/troubleshooter/components/EventTypeSelect.tsx b/packages/features/troubleshooter/components/EventTypeSelect.tsxindex c430c6b2f6b..a7000a249e2 100644--- a/packages/features/troubleshooter/components/EventTypeSelect.tsx+++ b/packages/features/troubleshooter/components/EventTypeSelect.tsx@@ -1,7 +1,7 @@import { useMemo, useEffect, startTransition } from "react";import { shallow } from "zustand/shallow";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { SelectField } from "@calcom/ui/components/form";import { getQueryParam } from "../../bookings/Booker/utils/query-param";diff --git a/packages/features/troubleshooter/components/LargeCalendar.tsx b/packages/features/troubleshooter/components/LargeCalendar.tsxindex 012b63d5cb1..9e3002fe1d3 100644--- a/packages/features/troubleshooter/components/LargeCalendar.tsx+++ b/packages/features/troubleshooter/components/LargeCalendar.tsx@@ -5,7 +5,7 @@ import dayjs from "@calcom/dayjs";import { useAvailableTimeSlots } from "@calcom/features/bookings/Booker/components/hooks/useAvailableTimeSlots";import { Calendar } from "@calcom/features/calendars/weeklyview";import { BookingStatus } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { useTimePreferences } from "../../bookings/lib/timePreferences";import { useSchedule } from "../../schedules/lib/use-schedule/useSchedule";diff --git a/packages/features/users/components/CalendarCredentialBanner.tsx b/packages/features/users/components/CalendarCredentialBanner.tsxindex b1001b1c419..1be95667281 100644--- a/packages/features/users/components/CalendarCredentialBanner.tsx+++ b/packages/features/users/components/CalendarCredentialBanner.tsx@@ -1,7 +1,7 @@import Link from "next/link";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { type RouterOutputs } from "@calcom/trpc";+import { type RouterOutputs } from "@calcom/trpc/react";import { TopBanner } from "@calcom/ui/components/top-banner";export type CalendarCredentialBannerProps = {diff --git a/packages/features/users/components/InvalidAppCredentialsBanner.tsx b/packages/features/users/components/InvalidAppCredentialsBanner.tsxindex 4ce2daaca65..3a8ec7c880b 100644--- a/packages/features/users/components/InvalidAppCredentialsBanner.tsx+++ b/packages/features/users/components/InvalidAppCredentialsBanner.tsx@@ -1,7 +1,7 @@import { useRouter } from "next/navigation";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { type RouterOutputs } from "@calcom/trpc";+import { type RouterOutputs } from "@calcom/trpc/react";import { TopBanner } from "@calcom/ui/components/top-banner";import { type InvalidAppCredentialBannerProps } from "../types/invalidAppCredentials";diff --git a/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx b/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsxindex b357bd680d1..adc2212800a 100644--- a/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx+++ b/packages/features/users/components/UserTable/BulkActions/EventTypesList.tsx@@ -5,7 +5,7 @@ import { useState, Fragment } from "react";import { DataTableSelectionBar } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";import { SchedulingType } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx b/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsxindex c467f5b60e2..af40d4a9cb8 100644--- a/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx+++ b/packages/features/users/components/UserTable/BulkActions/MassAssignAttributes.tsx@@ -5,7 +5,7 @@ import type { Dispatch, SetStateAction } from "react";import { DataTableSelectionBar, type ColumnFilter } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";import type { Attribute as _Attribute, AttributeOption } from "@calcom/prisma/client";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Alert } from "@calcom/ui/components/alert";import { Button } from "@calcom/ui/components/button";diff --git a/packages/features/users/components/UserTable/BulkActions/TeamList.tsx b/packages/features/users/components/UserTable/BulkActions/TeamList.tsxindex 67ad1083988..c105b6c8c78 100644--- a/packages/features/users/components/UserTable/BulkActions/TeamList.tsx+++ b/packages/features/users/components/UserTable/BulkActions/TeamList.tsx@@ -4,7 +4,7 @@ import { useState } from "react";import { DataTableSelectionBar } from "@calcom/features/data-table";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Button } from "@calcom/ui/components/button";import {diff --git a/packages/features/users/components/UserTable/DeleteMemberModal.tsx b/packages/features/users/components/UserTable/DeleteMemberModal.tsxindex ca8a6efe65a..f3a2b12a035 100644--- a/packages/features/users/components/UserTable/DeleteMemberModal.tsx+++ b/packages/features/users/components/UserTable/DeleteMemberModal.tsx@@ -3,7 +3,7 @@ import type { Dispatch } from "react";import { Dialog } from "@calcom/features/components/controlled-dialog";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { ConfirmationDialogContent } from "@calcom/ui/components/dialog";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/features/users/components/UserTable/InviteMemberModal.tsx b/packages/features/users/components/UserTable/InviteMemberModal.tsxindex ba7cd31e4a1..931e84429b5 100644--- a/packages/features/users/components/UserTable/InviteMemberModal.tsx+++ b/packages/features/users/components/UserTable/InviteMemberModal.tsx@@ -4,7 +4,7 @@ import type { Dispatch } from "react";import MemberInvitationModal from "@calcom/features/ee/teams/components/MemberInvitationModal";import { useLocale } from "@calcom/lib/hooks/useLocale";import { CreationSource } from "@calcom/prisma/enums";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { showToast } from "@calcom/ui/components/toast";import usePlatformMe from "@calcom/web/components/settings/platform/hooks/usePlatformMe";diff --git a/packages/features/users/components/UserTable/PlatformManagedUsersTable.tsx b/packages/features/users/components/UserTable/PlatformManagedUsersTable.tsxindex 22269381737..bd1b0658ea7 100644--- a/packages/features/users/components/UserTable/PlatformManagedUsersTable.tsx+++ b/packages/features/users/components/UserTable/PlatformManagedUsersTable.tsx@@ -17,7 +17,7 @@ import {import { useSegments } from "@calcom/features/data-table/hooks/useSegments";import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { Avatar } from "@calcom/ui/components/avatar";import { Badge } from "@calcom/ui/components/badge";import { Checkbox } from "@calcom/ui/components/form";diff --git a/packages/features/users/components/UserTable/UserListTable.tsx b/packages/features/users/components/UserTable/UserListTable.tsxindex c1555ce8f40..08365e2247a 100644--- a/packages/features/users/components/UserTable/UserListTable.tsx+++ b/packages/features/users/components/UserTable/UserListTable.tsx@@ -32,7 +32,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants";import { downloadAsCsv } from "@calcom/lib/csvUtils";import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import type { RouterOutputs } from "@calcom/trpc/react";import classNames from "@calcom/ui/classNames";import { Avatar } from "@calcom/ui/components/avatar";diff --git a/packages/features/users/components/UserTable/types.ts b/packages/features/users/components/UserTable/types.tsindex ab6c8a3f782..e37c028d1c2 100644--- a/packages/features/users/components/UserTable/types.ts+++ b/packages/features/users/components/UserTable/types.ts@@ -1,4 +1,4 @@-import type { RouterOutputs } from "@calcom/trpc";+import type { RouterOutputs } from "@calcom/trpc/react";export type UserTableUser = RouterOutputs["viewer"]["organizations"]["listMembers"]["rows"][number];diff --git a/packages/features/users/components/VerifyEmailBanner.tsx b/packages/features/users/components/VerifyEmailBanner.tsxindex e39078bfd33..f75d73be49e 100644--- a/packages/features/users/components/VerifyEmailBanner.tsx+++ b/packages/features/users/components/VerifyEmailBanner.tsx@@ -1,6 +1,6 @@import { APP_NAME } from "@calcom/lib/constants";import { useLocale } from "@calcom/lib/hooks/useLocale";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";import { TopBanner } from "@calcom/ui/components/top-banner";import { showToast } from "@calcom/ui/components/toast";diff --git a/packages/platform/atoms/add-members-switch/AddMembersWithSwitchWebWrapper.tsx b/packages/platform/atoms/add-members-switch/AddMembersWithSwitchWebWrapper.tsxindex 1720fb54b25..52a3836de28 100644--- a/packages/platform/atoms/add-members-switch/AddMembersWithSwitchWebWrapper.tsx+++ b/packages/platform/atoms/add-members-switch/AddMembersWithSwitchWebWrapper.tsx@@ -1,6 +1,6 @@import type { AddMembersWithSwitchProps } from "@calcom/features/eventtypes/components/AddMembersWithSwitch";import { AddMembersWithSwitch } from "@calcom/features/eventtypes/components/AddMembersWithSwitch";-import { trpc } from "@calcom/trpc";+import { trpc } from "@calcom/trpc/react";export const AddMembersWithSwitchWebWrapper = ({ ...props }: AddMembersWithSwitchProps) => {const utils = trpc.useUtils();diff --git a/packages/trpc/index.ts b/packages/trpc/index.tsindex 2b5ed7162b9..2dbb57b7b7b 100644--- a/packages/trpc/index.ts+++ b/packages/trpc/index.ts@@ -1 +1,3 @@-export * from "./react";+// React exports have been moved to @calcom/trpc/react+// Import from "@calcom/trpc/react" instead of "@calcom/trpc" for client-side code+// This separation improves build performance by preventing server builds from traversing client codediff --git a/packages/trpc/package.json b/packages/trpc/package.jsonindex 0ff233d5979..9b22317f3dd 100644--- a/packages/trpc/package.json+++ b/packages/trpc/package.json@@ -9,8 +9,9 @@"scripts": {"lint": "eslint .","lint:fix": "eslint . ",- "build": "yarn trpc:generate || true",- "trpc:generate": "yarn tsc --project tsconfig.json"+ "build": "yarn build:server && yarn build:react",+ "build:server": "yarn tsc --project tsconfig.server.json",+ "build:react": "yarn tsc --project tsconfig.react.json"},"dependencies": {"@tanstack/react-query": "^5.17.15",diff --git a/packages/trpc/react/trpc.ts b/packages/trpc/react/trpc.tsindex 28a43dc1bf0..d6f16dc6548 100644--- a/packages/trpc/react/trpc.ts+++ b/packages/trpc/react/trpc.ts@@ -9,7 +9,7 @@ import { createTRPCNext } from "@trpc/next";import type { TRPCClientErrorLike } from "@trpc/react-query";import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server";-import type { AppRouter } from "../server/routers/_app";+import type { AppRouter } from "../types/server/routers/_app";import { ENDPOINTS } from "./shared";type Maybe<T> = T | null | undefined;diff --git a/packages/trpc/server/routers/viewer/eventTypes/heavy/create.schema.ts b/packages/trpc/server/routers/viewer/eventTypes/heavy/create.schema.tsindex b7be9a623a5..57b9506a64a 100644--- a/packages/trpc/server/routers/viewer/eventTypes/heavy/create.schema.ts+++ b/packages/trpc/server/routers/viewer/eventTypes/heavy/create.schema.ts@@ -1,6 +1,6 @@import type { z } from "zod";-import { createEventTypeInput } from "@calcom/features/eventtypes/lib/types";+import { createEventTypeInput } from "@calcom/features/eventtypes/lib/schemas";export const ZCreateInputSchema = createEventTypeInput;diff --git a/packages/trpc/server/routers/viewer/eventTypes/heavy/duplicate.schema.ts b/packages/trpc/server/routers/viewer/eventTypes/heavy/duplicate.schema.tsindex a17ae1e6ccc..a8b1c1cf187 100644--- a/packages/trpc/server/routers/viewer/eventTypes/heavy/duplicate.schema.ts+++ b/packages/trpc/server/routers/viewer/eventTypes/heavy/duplicate.schema.ts@@ -1,6 +1,6 @@import type { z } from "zod";-import { EventTypeDuplicateInput } from "@calcom/features/eventtypes/lib/types";+import { EventTypeDuplicateInput } from "@calcom/features/eventtypes/lib/schemas";export const ZDuplicateInputSchema = EventTypeDuplicateInput;diff --git a/packages/trpc/tsconfig.react.json b/packages/trpc/tsconfig.react.jsonnew file mode 100644index 00000000000..4db5bd83824--- /dev/null+++ b/packages/trpc/tsconfig.react.json@@ -0,0 +1,27 @@+{+ "extends": "@calcom/tsconfig/react-library.json",+ "include": [+ "../types/@wojtekmaj__react-daterange-picker.d.ts",+ "../types/business-days-plugin.d.ts",+ "../types/next-auth.d.ts",+ "../types/tanstack-table.d.ts",+ "../types/next.d.ts",+ "../types/window.d.ts",+ "./react"+ ],+ "exclude": ["**/node_modules/**", "./server", "./react/**/*.test.ts", "./react/**/*.spec.ts"],+ "compilerOptions": {+ "isolatedModules": false,+ "noEmit": false,+ "declaration": true,+ "emitDeclarationOnly": true,+ "experimentalDecorators": true,+ "declarationMap": false,+ "resolveJsonModule": true,+ "declarationDir": "types/react",+ "moduleResolution": "node",+ "paths": {+ "~/*": ["./*"]+ }+ }+}diff --git a/packages/trpc/tsconfig.server.json b/packages/trpc/tsconfig.server.jsonnew file mode 100644index 00000000000..b3a251d7427--- /dev/null+++ b/packages/trpc/tsconfig.server.json@@ -0,0 +1,27 @@+{+ "extends": "@calcom/tsconfig/react-library.json",+ "include": [+ "../types/@wojtekmaj__react-daterange-picker.d.ts",+ "../types/business-days-plugin.d.ts",+ "../types/next-auth.d.ts",+ "../types/tanstack-table.d.ts",+ "../types/next.d.ts",+ "../types/window.d.ts",+ "./server"+ ],+ "exclude": ["**/node_modules/**", "./react", "./server/**/*.test.ts", "./server/**/*.spec.ts"],+ "compilerOptions": {+ "isolatedModules": false,+ "noEmit": false,+ "declaration": true,+ "emitDeclarationOnly": true,+ "experimentalDecorators": true,+ "declarationMap": false,+ "resolveJsonModule": true,+ "declarationDir": "types/server",+ "moduleResolution": "node",+ "paths": {+ "~/*": ["./*"]+ }+ }+}diff --git a/turbo.json b/turbo.jsonindex ecfc6cdbec9..d9359f528f8 100644--- a/turbo.json+++ b/turbo.json@@ -321,6 +321,7 @@"dependsOn": ["@calcom/prisma#db-up"]},"@calcom/trpc#build": {+ "dependsOn": ["@calcom/prisma#post-install"],"outputs": ["./types"]},"@calcom/web#build": {