Scheduling infrastructure for absolutely everyone.
chore: platform libraries versions cleanup api v2 (#15768)
Morgan539a2ea30195
diff --git a/apps/api/v2/package.json b/apps/api/v2/package.jsonindex c38d047ffae..175ce3e6de7 100644--- a/apps/api/v2/package.json+++ b/apps/api/v2/package.json@@ -25,12 +25,8 @@},"dependencies": {"@calcom/platform-constants": "*",- "@calcom/platform-libraries-0.0.13": "npm:@calcom/[email protected]",- "@calcom/platform-libraries-0.0.14": "npm:@calcom/[email protected]",- "@calcom/platform-libraries-0.0.15": "npm:@calcom/[email protected]",- "@calcom/platform-libraries-0.0.17": "npm:@calcom/[email protected]",+ "@calcom/platform-libraries-0.0.18": "npm:@calcom/[email protected]","@calcom/platform-libraries-0.0.2": "npm:@calcom/[email protected]",- "@calcom/platform-libraries-0.0.4": "npm:@calcom/[email protected]","@calcom/platform-types": "*","@calcom/platform-utils": "*","@calcom/prisma": "*",diff --git a/apps/api/v2/src/ee/bookings/controllers/bookings.controller.e2e-spec.ts b/apps/api/v2/src/ee/bookings/controllers/bookings.controller.e2e-spec.tsindex 37d1f7e8f4c..3408cbeca00 100644--- a/apps/api/v2/src/ee/bookings/controllers/bookings.controller.e2e-spec.ts+++ b/apps/api/v2/src/ee/bookings/controllers/bookings.controller.e2e-spec.ts@@ -19,7 +19,7 @@ import { UserRepositoryFixture } from "test/fixtures/repository/users.repositoryimport { withApiAuth } from "test/utils/withApiAuth";import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";-import { handleNewBooking } from "@calcom/platform-libraries-0.0.2";+import { handleNewBooking } from "@calcom/platform-libraries-0.0.18";import { ApiSuccessResponse, ApiResponse } from "@calcom/platform-types";describe("Bookings Endpoints", () => {diff --git a/apps/api/v2/src/ee/bookings/controllers/bookings.controller.ts b/apps/api/v2/src/ee/bookings/controllers/bookings.controller.tsindex 2849a2f4255..09ed912043f 100644--- a/apps/api/v2/src/ee/bookings/controllers/bookings.controller.ts+++ b/apps/api/v2/src/ee/bookings/controllers/bookings.controller.ts@@ -35,20 +35,18 @@ import { NextApiRequest } from "next/types";import { X_CAL_CLIENT_ID } from "@calcom/platform-constants";import { BOOKING_READ, SUCCESS_STATUS, BOOKING_WRITE } from "@calcom/platform-constants";-import {- getAllUserBookings,- getBookingInfo,- handleCancelBooking,- getBookingForReschedule,-} from "@calcom/platform-libraries-0.0.2";import {handleNewBooking,BookingResponse,HttpError,handleNewRecurringBooking,handleInstantMeeting,-} from "@calcom/platform-libraries-0.0.2";-import { handleMarkNoShow } from "@calcom/platform-libraries-0.0.17";+ handleMarkNoShow,+ getAllUserBookings,+ getBookingInfo,+ handleCancelBooking,+ getBookingForReschedule,+} from "@calcom/platform-libraries-0.0.18";import { GetBookingsInput, CancelBookingInput, Status } from "@calcom/platform-types";import { ApiResponse } from "@calcom/platform-types";import { PrismaClient } from "@calcom/prisma";diff --git a/apps/api/v2/src/ee/bookings/inputs/create-recurring-booking.input.ts b/apps/api/v2/src/ee/bookings/inputs/create-recurring-booking.input.tsindex 138215b8d5d..fb403a909f4 100644--- a/apps/api/v2/src/ee/bookings/inputs/create-recurring-booking.input.ts+++ b/apps/api/v2/src/ee/bookings/inputs/create-recurring-booking.input.ts@@ -1,7 +1,7 @@import { CreateBookingInput } from "@/ee/bookings/inputs/create-booking.input";import { IsBoolean, IsNumber, IsOptional } from "class-validator";-import type { AppsStatus } from "@calcom/platform-libraries-0.0.2";+import type { AppsStatus } from "@calcom/platform-libraries-0.0.18";export class CreateRecurringBookingInput extends CreateBookingInput {@IsBoolean()diff --git a/apps/api/v2/src/ee/calendars/services/apple-calendar.service.ts b/apps/api/v2/src/ee/calendars/services/apple-calendar.service.tsindex e95c64a7af0..1984e3a001c 100644--- a/apps/api/v2/src/ee/calendars/services/apple-calendar.service.ts+++ b/apps/api/v2/src/ee/calendars/services/apple-calendar.service.ts@@ -5,7 +5,7 @@ import { BadRequestException, UnauthorizedException } from "@nestjs/common";import { Injectable } from "@nestjs/common";import { SUCCESS_STATUS, APPLE_CALENDAR_TYPE, APPLE_CALENDAR_ID } from "@calcom/platform-constants";-import { symmetricEncrypt, CalendarService } from "@calcom/platform-libraries-0.0.14";+import { symmetricEncrypt, CalendarService } from "@calcom/platform-libraries-0.0.18";@Injectable()export class AppleCalendarService implements CredentialSyncCalendarApp {diff --git a/apps/api/v2/src/ee/calendars/services/calendars.service.ts b/apps/api/v2/src/ee/calendars/services/calendars.service.tsindex 37b7ed44a12..d1b0056d23c 100644--- a/apps/api/v2/src/ee/calendars/services/calendars.service.ts+++ b/apps/api/v2/src/ee/calendars/services/calendars.service.ts@@ -17,8 +17,7 @@ import { User } from "@prisma/client";import { DateTime } from "luxon";import { z } from "zod";-import { getConnectedDestinationCalendars } from "@calcom/platform-libraries-0.0.2";-import { getBusyCalendarTimes } from "@calcom/platform-libraries-0.0.2";+import { getConnectedDestinationCalendars, getBusyCalendarTimes } from "@calcom/platform-libraries-0.0.18";import { Calendar } from "@calcom/platform-types";import { PrismaClient } from "@calcom/prisma";diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.tsindex a1d283c62bb..f27b559d66c 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts@@ -35,7 +35,7 @@ import {EventTypesPublic,eventTypeBookingFields,eventTypeLocations,-} from "@calcom/platform-libraries-0.0.2";+} from "@calcom/platform-libraries-0.0.18";import { ApiSuccessResponse } from "@calcom/platform-types";describe("Event types Endpoints", () => {diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.tsindex 3669420db1a..3c57548d91b 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.ts@@ -39,8 +39,7 @@ import {import { ApiTags as DocsTags } from "@nestjs/swagger";import { EVENT_TYPE_READ, EVENT_TYPE_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";-import { getPublicEvent } from "@calcom/platform-libraries-0.0.2";-import { getEventTypesByViewer } from "@calcom/platform-libraries-0.0.2";+import { getPublicEvent, getEventTypesByViewer } from "@calcom/platform-libraries-0.0.18";import { PrismaClient } from "@calcom/prisma";@Controller({diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/event-types.repository.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/event-types.repository.tsindex 5d9c3c5dd23..efe2cce7947 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/event-types.repository.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/event-types.repository.ts@@ -4,7 +4,7 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";import { UserWithProfile } from "@/modules/users/users.repository";import { Injectable } from "@nestjs/common";-import { getEventTypeById } from "@calcom/platform-libraries-0.0.2";+import { getEventTypeById } from "@calcom/platform-libraries-0.0.18";import type { PrismaClient } from "@calcom/prisma";@Injectable()diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/services/event-types.service.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/services/event-types.service.tsindex 926abc0cdbc..490ceb8635e 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/services/event-types.service.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/services/event-types.service.ts@@ -9,8 +9,12 @@ import { SelectedCalendarsRepository } from "@/modules/selected-calendars/selectimport { UserWithProfile, UsersRepository } from "@/modules/users/users.repository";import { BadRequestException, ForbiddenException, Injectable, NotFoundException } from "@nestjs/common";-import { createEventType, updateEventType } from "@calcom/platform-libraries-0.0.2";-import { getEventTypesPublic, EventTypesPublic } from "@calcom/platform-libraries-0.0.2";+import {+ createEventType,+ updateEventType,+ EventTypesPublic,+ getEventTypesPublic,+} from "@calcom/platform-libraries-0.0.18";import { EventType } from "@calcom/prisma/client";@Injectable()diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.tsindex 6532bceae79..bec574cfd77 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/event-types.repository.ts@@ -7,7 +7,7 @@ import {getEventTypeById,transformApiEventTypeBookingFields,transformApiEventTypeLocations,-} from "@calcom/platform-libraries-0.0.13";+} from "@calcom/platform-libraries-0.0.18";import { CreateEventTypeInput_2024_06_14 } from "@calcom/platform-types";import type { PrismaClient } from "@calcom/prisma";diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.tsindex bb1975a9fcf..b3947afb313 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/event-types.service.ts@@ -11,7 +11,7 @@ import { BadRequestException, ForbiddenException, Injectable, NotFoundExceptionimport { createEventType, updateEventType } from "@calcom/platform-libraries";import { getEventTypesPublic, EventTypesPublic } from "@calcom/platform-libraries";-import { dynamicEvent } from "@calcom/platform-libraries-0.0.13";+import { dynamicEvent } from "@calcom/platform-libraries-0.0.18";import {CreateEventTypeInput_2024_06_14,UpdateEventTypeInput_2024_06_14,diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/input-event-types.service.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/input-event-types.service.tsindex 3f463459f18..f6aace9d3f5 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/input-event-types.service.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/input-event-types.service.ts@@ -3,7 +3,7 @@ import { Injectable } from "@nestjs/common";import {transformApiEventTypeBookingFields,transformApiEventTypeLocations,-} from "@calcom/platform-libraries-0.0.13";+} from "@calcom/platform-libraries-0.0.18";import { CreateEventTypeInput_2024_06_14, UpdateEventTypeInput_2024_06_14 } from "@calcom/platform-types";@Injectable()diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.tsindex 09b829ac72a..f145935b9fc 100644--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/services/output-event-types.service.ts@@ -9,7 +9,7 @@ import {parseRecurringEvent,TransformedLocationsSchema,BookingFieldsSchema,-} from "@calcom/platform-libraries-0.0.13";+} from "@calcom/platform-libraries-0.0.18";type EventTypeRelations = { users: User[]; schedule: Schedule | null };type DatabaseEventType = EventType & EventTypeRelations;diff --git a/apps/api/v2/src/ee/schedules/schedules_2024_06_11/services/input-schedules.service.ts b/apps/api/v2/src/ee/schedules/schedules_2024_06_11/services/input-schedules.service.tsindex 087687aecb0..0b33e9bcb37 100644--- a/apps/api/v2/src/ee/schedules/schedules_2024_06_11/services/input-schedules.service.ts+++ b/apps/api/v2/src/ee/schedules/schedules_2024_06_11/services/input-schedules.service.ts@@ -3,7 +3,7 @@ import { Injectable } from "@nestjs/common";import {transformApiScheduleOverrides,transformApiScheduleAvailability,-} from "@calcom/platform-libraries-0.0.4";+} from "@calcom/platform-libraries-0.0.18";import { CreateScheduleInput_2024_06_11, ScheduleAvailabilityInput_2024_06_11 } from "@calcom/platform-types";import { ScheduleOverrideInput_2024_06_11 } from "@calcom/platform-types";diff --git a/apps/api/v2/src/filters/trpc-exception.filter.ts b/apps/api/v2/src/filters/trpc-exception.filter.tsindex 5c195349f9b..cf32853c29e 100644--- a/apps/api/v2/src/filters/trpc-exception.filter.ts+++ b/apps/api/v2/src/filters/trpc-exception.filter.ts@@ -2,7 +2,7 @@ import { ArgumentsHost, Catch, ExceptionFilter, Logger } from "@nestjs/common";import { Request } from "express";import { ERROR_STATUS } from "@calcom/platform-constants";-import { TRPCError } from "@calcom/platform-libraries-0.0.2";+import { TRPCError } from "@calcom/platform-libraries-0.0.18";import { Response } from "@calcom/platform-types";@Catch(TRPCError)diff --git a/apps/api/v2/src/modules/oauth-clients/services/oauth-clients-users.service.ts b/apps/api/v2/src/modules/oauth-clients/services/oauth-clients-users.service.tsindex 087fdd2df43..50beea88b40 100644--- a/apps/api/v2/src/modules/oauth-clients/services/oauth-clients-users.service.ts+++ b/apps/api/v2/src/modules/oauth-clients/services/oauth-clients-users.service.ts@@ -7,7 +7,7 @@ import { UsersRepository } from "@/modules/users/users.repository";import { BadRequestException, Injectable } from "@nestjs/common";import { User } from "@prisma/client";-import { createNewUsersConnectToOrgIfExists, slugify } from "@calcom/platform-libraries-0.0.15";+import { createNewUsersConnectToOrgIfExists, slugify } from "@calcom/platform-libraries-0.0.18";@Injectable()export class OAuthClientUsersService {diff --git a/apps/api/v2/src/modules/slots/controllers/slots.controller.ts b/apps/api/v2/src/modules/slots/controllers/slots.controller.tsindex 9b4621aea5c..a3a0c2c3df6 100644--- a/apps/api/v2/src/modules/slots/controllers/slots.controller.ts+++ b/apps/api/v2/src/modules/slots/controllers/slots.controller.ts@@ -5,8 +5,8 @@ import { ApiTags as DocsTags } from "@nestjs/swagger";import { Response as ExpressResponse, Request as ExpressRequest } from "express";import { SUCCESS_STATUS } from "@calcom/platform-constants";-import { getAvailableSlots } from "@calcom/platform-libraries-0.0.2";-import type { AvailableSlotsType } from "@calcom/platform-libraries-0.0.2";+import { getAvailableSlots } from "@calcom/platform-libraries-0.0.18";+import type { AvailableSlotsType } from "@calcom/platform-libraries-0.0.18";import { RemoveSelectedSlotInput, ReserveSlotInput } from "@calcom/platform-types";import { ApiResponse, GetAvailableSlotsInput } from "@calcom/platform-types";diff --git a/apps/api/v2/src/modules/slots/slots.repository.ts b/apps/api/v2/src/modules/slots/slots.repository.tsindex abf5d916bb4..6f382147145 100644--- a/apps/api/v2/src/modules/slots/slots.repository.ts+++ b/apps/api/v2/src/modules/slots/slots.repository.ts@@ -3,7 +3,7 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";import { Injectable } from "@nestjs/common";import { DateTime } from "luxon";-import { MINUTES_TO_BOOK } from "@calcom/platform-libraries-0.0.2";+import { MINUTES_TO_BOOK } from "@calcom/platform-libraries-0.0.18";import { ReserveSlotInput } from "@calcom/platform-types";@Injectable()diff --git a/apps/api/v2/src/modules/timezones/controllers/timezones.controller.ts b/apps/api/v2/src/modules/timezones/controllers/timezones.controller.tsindex 7d2707c2708..61dae93479e 100644--- a/apps/api/v2/src/modules/timezones/controllers/timezones.controller.ts+++ b/apps/api/v2/src/modules/timezones/controllers/timezones.controller.ts@@ -4,7 +4,7 @@ import { Controller, Get } from "@nestjs/common";import { ApiTags as DocsTags } from "@nestjs/swagger";import { SUCCESS_STATUS } from "@calcom/platform-constants";-import type { CityTimezones } from "@calcom/platform-libraries-0.0.2";+import type { CityTimezones } from "@calcom/platform-libraries-0.0.18";import { ApiResponse } from "@calcom/platform-types";@Controller({diff --git a/apps/api/v2/src/modules/timezones/services/timezones.service.ts b/apps/api/v2/src/modules/timezones/services/timezones.service.tsindex 7fc1657b9ea..207b572ae70 100644--- a/apps/api/v2/src/modules/timezones/services/timezones.service.ts+++ b/apps/api/v2/src/modules/timezones/services/timezones.service.ts@@ -1,8 +1,8 @@import { RedisService } from "@/modules/redis/redis.service";import { Injectable } from "@nestjs/common";-import { cityTimezonesHandler } from "@calcom/platform-libraries-0.0.2";-import type { CityTimezones } from "@calcom/platform-libraries-0.0.2";+import { cityTimezonesHandler } from "@calcom/platform-libraries-0.0.18";+import type { CityTimezones } from "@calcom/platform-libraries-0.0.18";@Injectable()export class TimezonesService {diff --git a/packages/features/auth/lib/getServerSession.ts b/packages/features/auth/lib/getServerSession.tsindex 1fde417d38e..734debd0e7b 100644--- a/packages/features/auth/lib/getServerSession.ts+++ b/packages/features/auth/lib/getServerSession.ts@@ -1,4 +1,4 @@-import * as lruCache from "lru-cache";+import { LRUCache } from "lru-cache";import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from "next";import type { AuthOptions, Session } from "next-auth";import { getToken } from "next-auth/jwt";@@ -15,7 +15,7 @@ const log = logger.getSubLogger({ prefix: ["getServerSession"] });* Stores the session in memory using the stringified token as the key.**/-const CACHE = new lruCache.LRUCache<string, Session>({ max: 1000 });+const CACHE = new LRUCache<string, Session>({ max: 1000 });/*** This is a slimmed down version of the `getServerSession` function fromdiff --git a/packages/platform/libraries/README.md b/packages/platform/libraries/README.mdindex b1187caf5fc..26f3d17325c 100644--- a/packages/platform/libraries/README.md+++ b/packages/platform/libraries/README.md@@ -23,7 +23,7 @@ since the versions are matching in both package.json yarn will try to use the lonow go to packages/platform/libraries and do-- yarn build+- yarn build:devthen go back to /apps/api/v2 and rundiff --git a/packages/platform/libraries/index.ts b/packages/platform/libraries/index.tsindex 1a6a41140b7..830b7f893d0 100644--- a/packages/platform/libraries/index.ts+++ b/packages/platform/libraries/index.ts@@ -1,3 +1,4 @@+import { getCalendar } from "@calcom/app-store/_utils/getCalendar";import { CalendarService } from "@calcom/app-store/applecalendar/lib";import { getBookingForReschedule } from "@calcom/features/bookings/lib/get-booking";import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";@@ -8,9 +9,13 @@ import handleMarkNoShow from "@calcom/features/handleMarkNoShow";import * as instantMeetingMethods from "@calcom/features/instant-meeting/handleInstantMeeting";import getAllUserBookings from "@calcom/lib/bookings/getAllUserBookings";import { symmetricEncrypt } from "@calcom/lib/crypto";+import { getTranslation } from "@calcom/lib/server/i18n";import { updateHandler as updateScheduleHandler } from "@calcom/trpc/server/routers/viewer/availability/schedule/update.handler";import { getAvailableSlots } from "@calcom/trpc/server/routers/viewer/slots/util";-import { createNewUsersConnectToOrgIfExists } from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";+import {+ createNewUsersConnectToOrgIfExists,+ sendSignupToOrganizationEmail,+} from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";export { slugify } from "@calcom/lib/slugify";export { getBookingForReschedule };@@ -76,7 +81,7 @@ export type { CityTimezones } from "@calcom/lib/cityTimezonesHandler";export { TRPCError } from "@trpc/server";export type { TUpdateInputSchema } from "@calcom/trpc/server/routers/viewer/availability/schedule/update.schema";-export { createNewUsersConnectToOrgIfExists };+export { createNewUsersConnectToOrgIfExists, sendSignupToOrganizationEmail };export { getAllUserBookings };export { getBookingInfo };@@ -100,3 +105,7 @@ export { dynamicEvent } from "@calcom/lib/defaultEvents";export { symmetricEncrypt };export { CalendarService };++export { getCalendar };++export { getTranslation };diff --git a/packages/platform/libraries/package.json b/packages/platform/libraries/package.jsonindex 7e0843a24b3..2df5d3d0370 100644--- a/packages/platform/libraries/package.json+++ b/packages/platform/libraries/package.json@@ -11,6 +11,7 @@"scripts": {"build": "yarn vite build","build:watch": "yarn vite build --watch",+ "build:dev": "yarn vite build && sed -i'' -e 's/const CACHE = new lruCache\\.LRUCache({ max: 1e3 });/const CACHE = new lruCache({ max: 1e3 });/g' ./dist/index.cjs","publish": "rm -rf dist && yarn build && npm publish --access public"},"dependencies": {