diff --git a/lib/helpers/addRequestid.ts b/lib/helpers/addRequestid.ts index 6bdf1e546a..92d2d6919a 100644 --- a/lib/helpers/addRequestid.ts +++ b/lib/helpers/addRequestid.ts @@ -1,5 +1,5 @@ import { nanoid } from "nanoid"; -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; export const addRequestId: NextMiddleware = async (_req, res, next) => { // Apply header with unique ID to every request diff --git a/lib/helpers/captureErrors.ts b/lib/helpers/captureErrors.ts index ff35ee3c89..0d850b052b 100644 --- a/lib/helpers/captureErrors.ts +++ b/lib/helpers/captureErrors.ts @@ -1,5 +1,5 @@ import * as Sentry from "@sentry/nextjs"; -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; export const captureErrors: NextMiddleware = async (_req, res, next) => { try { diff --git a/lib/helpers/customPrisma.ts b/lib/helpers/customPrisma.ts index 9955568e97..54bb8e76e4 100644 --- a/lib/helpers/customPrisma.ts +++ b/lib/helpers/customPrisma.ts @@ -1,5 +1,5 @@ import { PrismaClient } from "@prisma/client"; -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; import { CONSOLE_URL } from "@calcom/lib/constants"; diff --git a/lib/helpers/extendRequest.ts b/lib/helpers/extendRequest.ts index 430504be7b..d6fff1cbd0 100644 --- a/lib/helpers/extendRequest.ts +++ b/lib/helpers/extendRequest.ts @@ -1,4 +1,4 @@ -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; export const extendRequest: NextMiddleware = async (req, res, next) => { req.pagination = { diff --git a/lib/helpers/httpMethods.ts b/lib/helpers/httpMethods.ts index 0bf6243e0f..8003a71984 100644 --- a/lib/helpers/httpMethods.ts +++ b/lib/helpers/httpMethods.ts @@ -1,4 +1,4 @@ -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; export const httpMethod = (allowedHttpMethod: "GET" | "POST" | "PATCH" | "DELETE"): NextMiddleware => { return async function (req, res, next) { diff --git a/lib/helpers/verifyApiKey.ts b/lib/helpers/verifyApiKey.ts index 2420dc4358..45df30e5ef 100644 --- a/lib/helpers/verifyApiKey.ts +++ b/lib/helpers/verifyApiKey.ts @@ -1,4 +1,4 @@ -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; import { hashAPIKey } from "@calcom/features/ee/api-keys/lib/apiKeys"; import checkLicense from "@calcom/features/ee/common/server/checkLicense"; diff --git a/lib/helpers/withPagination.ts b/lib/helpers/withPagination.ts index 1f1bd397be..f29c08829b 100644 --- a/lib/helpers/withPagination.ts +++ b/lib/helpers/withPagination.ts @@ -1,4 +1,4 @@ -import { NextMiddleware } from "next-api-middleware"; +import type { NextMiddleware } from "next-api-middleware"; import z from "zod"; const withPage = z.object({ diff --git a/lib/types.ts b/lib/types.ts index b75941c517..3022c8c0c8 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,5 +1,5 @@ import type { EventLocationType } from "@calcom/app-store/locations"; -import { +import type { Attendee, Availability, Booking, diff --git a/pages/api/api-keys/[id]/index.ts b/pages/api/api-keys/[id]/index.ts index 4b27553002..2e0c358153 100644 --- a/pages/api/api-keys/[id]/index.ts +++ b/pages/api/api-keys/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/api-keys/_get.ts b/pages/api/api-keys/_get.ts index 3d374b51ec..8c23c6fe9e 100644 --- a/pages/api/api-keys/_get.ts +++ b/pages/api/api-keys/_get.ts @@ -2,7 +2,7 @@ import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { defaultResponder } from "@calcom/lib/server"; -import { Ensure } from "@calcom/types/utils"; +import type { Ensure } from "@calcom/types/utils"; import { apiKeyPublicSchema } from "~/lib/validations/api-key"; import { schemaQuerySingleOrMultipleUserIds } from "~/lib/validations/shared/queryUserId"; diff --git a/pages/api/attendees/[id]/_patch.ts b/pages/api/attendees/[id]/_patch.ts index 73ef195ff8..30e1a3d164 100644 --- a/pages/api/attendees/[id]/_patch.ts +++ b/pages/api/attendees/[id]/_patch.ts @@ -1,5 +1,5 @@ import type { NextApiRequest } from "next"; -import { z } from "zod"; +import type { z } from "zod"; import { HttpError } from "@calcom/lib/http-error"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/attendees/[id]/index.ts b/pages/api/attendees/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/attendees/[id]/index.ts +++ b/pages/api/attendees/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/availabilities/[id]/index.ts b/pages/api/availabilities/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/availabilities/[id]/index.ts +++ b/pages/api/availabilities/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/booking-references/[id]/index.ts b/pages/api/booking-references/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/booking-references/[id]/index.ts +++ b/pages/api/booking-references/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/bookings/[id]/_patch.ts b/pages/api/bookings/[id]/_patch.ts index 55b20bc9c1..ebf392c822 100644 --- a/pages/api/bookings/[id]/_patch.ts +++ b/pages/api/bookings/[id]/_patch.ts @@ -1,5 +1,5 @@ import type { NextApiRequest } from "next"; -import { z } from "zod"; +import type { z } from "zod"; import { HttpError } from "@calcom/lib/http-error"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/bookings/[id]/cancel.ts b/pages/api/bookings/[id]/cancel.ts index d85eac4d0c..8dd20bef17 100644 --- a/pages/api/bookings/[id]/cancel.ts +++ b/pages/api/bookings/[id]/cancel.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler } from "@calcom/lib/server"; diff --git a/pages/api/bookings/[id]/index.ts b/pages/api/bookings/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/bookings/[id]/index.ts +++ b/pages/api/bookings/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/bookings/_get.ts b/pages/api/bookings/_get.ts index a9158c22b3..e610f42103 100644 --- a/pages/api/bookings/_get.ts +++ b/pages/api/bookings/_get.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { HttpError } from "@calcom/lib/http-error"; diff --git a/pages/api/custom-inputs/[id]/index.ts b/pages/api/custom-inputs/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/custom-inputs/[id]/index.ts +++ b/pages/api/custom-inputs/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/destination-calendars/index.ts b/pages/api/destination-calendars/index.ts index 2143ba0d0a..c1330d49fa 100644 --- a/pages/api/destination-calendars/index.ts +++ b/pages/api/destination-calendars/index.ts @@ -1,7 +1,7 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { withMiddleware } from "~/lib/helpers/withMiddleware"; -import { DestinationCalendarResponse, DestinationCalendarsResponse } from "~/lib/types"; +import type { DestinationCalendarResponse, DestinationCalendarsResponse } from "~/lib/types"; import { schemaDestinationCalendarCreateBodyParams, schemaDestinationCalendarReadPublic, diff --git a/pages/api/docs.ts b/pages/api/docs.ts index bdbb3cd462..27a09c650c 100644 --- a/pages/api/docs.ts +++ b/pages/api/docs.ts @@ -1,7 +1,7 @@ import modifyRes from "modify-response-middleware"; import { use } from "next-api-middleware"; import { withSwagger } from "next-swagger-doc"; -import { NextApiRequest, NextApiResponse } from "next/types"; +import type { NextApiRequest, NextApiResponse } from "next/types"; import pjson from "~/package.json"; diff --git a/pages/api/event-types/[id]/_patch.ts b/pages/api/event-types/[id]/_patch.ts index a1c0bef77e..e712bc8f14 100644 --- a/pages/api/event-types/[id]/_patch.ts +++ b/pages/api/event-types/[id]/_patch.ts @@ -1,14 +1,11 @@ import type { NextApiRequest } from "next"; -import { z } from "zod"; +import type { z } from "zod"; import { HttpError } from "@calcom/lib/http-error"; import { defaultResponder } from "@calcom/lib/server"; -import { - schemaEventTypeEditBodyParams, - schemaEventTypeBaseBodyParams, - schemaEventTypeReadPublic, -} from "~/lib/validations/event-type"; +import type { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type"; +import { schemaEventTypeEditBodyParams, schemaEventTypeReadPublic } from "~/lib/validations/event-type"; import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransformParseInt"; import checkTeamEventEditPermission from "../_utils/checkTeamEventEditPermission"; diff --git a/pages/api/event-types/[id]/index.ts b/pages/api/event-types/[id]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/event-types/[id]/index.ts +++ b/pages/api/event-types/[id]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/event-types/_utils/checkTeamEventEditPermission.ts b/pages/api/event-types/_utils/checkTeamEventEditPermission.ts index b2392ba7b4..abcfc055f2 100644 --- a/pages/api/event-types/_utils/checkTeamEventEditPermission.ts +++ b/pages/api/event-types/_utils/checkTeamEventEditPermission.ts @@ -1,9 +1,9 @@ import type { NextApiRequest } from "next"; -import { z } from "zod"; +import type { z } from "zod"; import { HttpError } from "@calcom/lib/http-error"; -import { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type"; +import type { schemaEventTypeBaseBodyParams } from "~/lib/validations/event-type"; export default async function checkTeamEventEditPermission( req: NextApiRequest, diff --git a/pages/api/memberships/[id]/_get.ts b/pages/api/memberships/[id]/_get.ts index a9395bcebe..cf44094bfa 100644 --- a/pages/api/memberships/[id]/_get.ts +++ b/pages/api/memberships/[id]/_get.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/memberships/_get.ts b/pages/api/memberships/_get.ts index dc7bc41c1a..da6e936df3 100644 --- a/pages/api/memberships/_get.ts +++ b/pages/api/memberships/_get.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { HttpError } from "@calcom/lib/http-error"; diff --git a/pages/api/payments/index.ts b/pages/api/payments/index.ts index d6721e2417..c6f8c79fec 100644 --- a/pages/api/payments/index.ts +++ b/pages/api/payments/index.ts @@ -1,7 +1,7 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { withMiddleware } from "~/lib/helpers/withMiddleware"; -import { PaymentsResponse } from "~/lib/types"; +import type { PaymentsResponse } from "~/lib/types"; import { schemaPaymentPublic } from "~/lib/validations/payment"; /** diff --git a/pages/api/schedules/[id]/_patch.ts b/pages/api/schedules/[id]/_patch.ts index e8a27ee105..e121eafa75 100644 --- a/pages/api/schedules/[id]/_patch.ts +++ b/pages/api/schedules/[id]/_patch.ts @@ -1,5 +1,5 @@ import type { NextApiRequest } from "next"; -import { z } from "zod"; +import type { z } from "zod"; import { HttpError } from "@calcom/lib/http-error"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/teams/[teamId]/_patch.ts b/pages/api/teams/[teamId]/_patch.ts index 964a73e4dd..ddf83e5883 100644 --- a/pages/api/teams/[teamId]/_patch.ts +++ b/pages/api/teams/[teamId]/_patch.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { purchaseTeamSubscription } from "@calcom/features/ee/teams/lib/payments"; diff --git a/pages/api/teams/[teamId]/index.ts b/pages/api/teams/[teamId]/index.ts index 02fa97c2f8..727ad02843 100644 --- a/pages/api/teams/[teamId]/index.ts +++ b/pages/api/teams/[teamId]/index.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/teams/[teamId]/publish.ts b/pages/api/teams/[teamId]/publish.ts index f85f6431a9..edb36be796 100644 --- a/pages/api/teams/[teamId]/publish.ts +++ b/pages/api/teams/[teamId]/publish.ts @@ -1,5 +1,5 @@ import { MembershipRole, UserPermissionRole } from "@prisma/client"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { HttpError } from "@calcom/lib/http-error"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/teams/_get.ts b/pages/api/teams/_get.ts index 21fb8eb85e..ca038fdc18 100644 --- a/pages/api/teams/_get.ts +++ b/pages/api/teams/_get.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/pages/api/users/_get.ts b/pages/api/users/_get.ts index da4f985931..59e09bdeb5 100644 --- a/pages/api/users/_get.ts +++ b/pages/api/users/_get.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { defaultResponder } from "@calcom/lib/server"; diff --git a/test/lib/bookings/_post.test.ts b/test/lib/bookings/_post.test.ts index 9072f9e35b..95bf7a73d5 100644 --- a/test/lib/bookings/_post.test.ts +++ b/test/lib/bookings/_post.test.ts @@ -1,5 +1,5 @@ -import { Request, Response } from "express"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { Request, Response } from "express"; +import type { NextApiRequest, NextApiResponse } from "next"; import { createMocks } from "node-mocks-http"; import dayjs from "@calcom/dayjs";