Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Update prisma enums to platform libs (#23604)

Alex van Andel0bf95ec568c4
diff --git a/apps/api/v2/package.json b/apps/api/v2/package.json
index 6709e6d66ee..1c43ded3421 100644
--- a/apps/api/v2/package.json
+++ b/apps/api/v2/package.json
@@ -38,7 +38,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
- "@calcom/platform-libraries": "npm:@calcom/[email protected]",
+ "@calcom/platform-libraries": "npm:@calcom/[email protected]",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
"@calcom/prisma": "*",
diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts b/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts
index c797f5096b6..5bf6614ba3a 100644
--- a/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts
+++ b/apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts
@@ -57,6 +57,7 @@ import {
getBookingForReschedule,
ErrorCode,
} from "@calcom/platform-libraries";
+import { CreationSource } from "@calcom/platform-libraries";
import {
GetBookingsInput_2024_04_15,
CancelBookingInput_2024_04_15,
@@ -64,7 +65,6 @@ import {
} from "@calcom/platform-types";
import { ApiResponse } from "@calcom/platform-types";
import { PrismaClient } from "@calcom/prisma";
-import { CreationSource } from "@calcom/prisma/enums";
type BookingRequest = Request & {
userId?: number;
diff --git a/apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts b/apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts
index db74fb7e7f1..bc293a68bce 100644
--- a/apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts
+++ b/apps/api/v2/src/ee/bookings/2024-08-13/services/input.service.ts
@@ -29,6 +29,7 @@ import { NextApiRequest } from "next/types";
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
+import { CreationSource } from "@calcom/platform-libraries";
import { EventTypeMetaDataSchema } from "@calcom/platform-libraries/event-types";
import {
CancelBookingInput,
@@ -45,7 +46,6 @@ import {
} from "@calcom/platform-types";
import { BookingInputLocation_2024_08_13 } from "@calcom/platform-types/bookings/2024-08-13/inputs/location.input";
import { EventType } from "@calcom/prisma/client";
-import { CreationSource } from "@calcom/prisma/enums";
type BookingRequest = NextApiRequest & {
userId: number | undefined;
diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
index 9f22ce102ec..bd3ce4d9fcc 100644
--- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
+++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
@@ -30,6 +30,7 @@ import {
NoticeThresholdUnitEnum,
FrequencyInput,
} from "@calcom/platform-enums";
+import { SchedulingType } from "@calcom/platform-libraries";
import {
ApiSuccessResponse,
CreateEventTypeInput_2024_06_14,
@@ -39,7 +40,6 @@ import {
NotesDefaultFieldInput_2024_06_14,
UpdateEventTypeInput_2024_06_14,
} from "@calcom/platform-types";
-import { SchedulingType } from "@calcom/prisma/enums";
const orderBySlug = (a: { slug: string }, b: { slug: string }) => {
if (a.slug < b.slug) return -1;
diff --git a/apps/api/v2/src/lib/roles/constants.ts b/apps/api/v2/src/lib/roles/constants.ts
index bef321ceb0c..05b7e47d076 100644
--- a/apps/api/v2/src/lib/roles/constants.ts
+++ b/apps/api/v2/src/lib/roles/constants.ts
@@ -1,4 +1,4 @@
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export const SYSTEM_ADMIN_ROLE = "SYSADMIN";
export const ORG_ROLES = [
diff --git a/apps/api/v2/src/modules/auth/decorators/roles/membership-roles.decorator.ts b/apps/api/v2/src/modules/auth/decorators/roles/membership-roles.decorator.ts
index 9a6a46a4200..e99efc42c89 100644
--- a/apps/api/v2/src/modules/auth/decorators/roles/membership-roles.decorator.ts
+++ b/apps/api/v2/src/modules/auth/decorators/roles/membership-roles.decorator.ts
@@ -1,5 +1,5 @@
import { Reflector } from "@nestjs/core";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export const MembershipRoles = Reflector.createDecorator<MembershipRole[]>();
diff --git a/apps/api/v2/src/modules/auth/guards/organization-roles/organization-roles.guard.ts b/apps/api/v2/src/modules/auth/guards/organization-roles/organization-roles.guard.ts
index 12d45e1266d..fbdedc0f145 100644
--- a/apps/api/v2/src/modules/auth/guards/organization-roles/organization-roles.guard.ts
+++ b/apps/api/v2/src/modules/auth/guards/organization-roles/organization-roles.guard.ts
@@ -6,7 +6,7 @@ import { UserWithProfile } from "@/modules/users/users.repository";
import { Injectable, CanActivate, ExecutionContext, ForbiddenException } from "@nestjs/common";
import { Reflector } from "@nestjs/core";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
@Injectable()
export class OrganizationRolesGuard implements CanActivate {
diff --git a/apps/api/v2/src/modules/memberships/memberships.repository.ts b/apps/api/v2/src/modules/memberships/memberships.repository.ts
index 578fd508c88..15b1b5b76cc 100644
--- a/apps/api/v2/src/modules/memberships/memberships.repository.ts
+++ b/apps/api/v2/src/modules/memberships/memberships.repository.ts
@@ -1,7 +1,7 @@
import { PrismaReadService } from "@/modules/prisma/prisma-read.service";
import { Injectable } from "@nestjs/common";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
@Injectable()
export class MembershipsRepository {
diff --git a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/oauth-client-users.controller.ts b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/oauth-client-users.controller.ts
index e9614c37acf..09a44b53fb1 100644
--- a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/oauth-client-users.controller.ts
+++ b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/oauth-client-users.controller.ts
@@ -35,7 +35,7 @@ import { ApiOperation, ApiTags as DocsTags, ApiHeader } from "@nestjs/swagger";
import { User } from "@prisma/client";
import { SUCCESS_STATUS, X_CAL_SECRET_KEY } from "@calcom/platform-constants";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
@Controller({
path: "/v2/oauth-clients/:clientId/users",
diff --git a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-webhooks/oauth-client-webhooks.controller.ts b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-webhooks/oauth-client-webhooks.controller.ts
index aa51235ade1..14b74f18048 100644
--- a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-webhooks/oauth-client-webhooks.controller.ts
+++ b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-webhooks/oauth-client-webhooks.controller.ts
@@ -21,8 +21,8 @@ import { Webhook } from "@prisma/client";
import { plainToClass } from "class-transformer";
import { SUCCESS_STATUS, X_CAL_SECRET_KEY } from "@calcom/platform-constants";
+import { MembershipRole } from "@calcom/platform-libraries";
import { SkipTakePagination } from "@calcom/platform-types";
-import { MembershipRole } from "@calcom/prisma/enums";
import { OAuthClientGuard } from "../../guards/oauth-client-guard";
diff --git a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/oauth-clients.controller.ts b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/oauth-clients.controller.ts
index b8ab68fa8ec..d84291fff95 100644
--- a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/oauth-clients.controller.ts
+++ b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/oauth-clients.controller.ts
@@ -5,12 +5,10 @@ import { MembershipRoles } from "@/modules/auth/decorators/roles/membership-role
import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";
import { OrganizationRolesGuard } from "@/modules/auth/guards/organization-roles/organization-roles.guard";
import { GetManagedUsersOutput } from "@/modules/oauth-clients/controllers/oauth-client-users/outputs/get-managed-users.output";
-import { ManagedUserOutput } from "@/modules/oauth-clients/controllers/oauth-client-users/outputs/managed-user.output";
import { CreateOAuthClientResponseDto } from "@/modules/oauth-clients/controllers/oauth-clients/responses/CreateOAuthClientResponse.dto";
import { GetOAuthClientResponseDto } from "@/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientResponse.dto";
import { GetOAuthClientsResponseDto } from "@/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientsResponse.dto";
import { OAuthClientGuard } from "@/modules/oauth-clients/guards/oauth-client-guard";
-import { OAuthClientRepository } from "@/modules/oauth-clients/oauth-client.repository";
import { OAuthClientUsersOutputService } from "@/modules/oauth-clients/services/oauth-clients-users-output.service";
import { OAuthClientsService } from "@/modules/oauth-clients/services/oauth-clients/oauth-clients.service";
import { OrganizationsRepository } from "@/modules/organizations/index/organizations.repository";
@@ -39,8 +37,8 @@ import {
} from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
+import { MembershipRole } from "@calcom/platform-libraries";
import { CreateOAuthClientInput, UpdateOAuthClientInput, Pagination } from "@calcom/platform-types";
-import { MembershipRole } from "@calcom/prisma/enums";
@Controller({
path: "/v2/oauth-clients",
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.ts
index 64a1f7c6d81..7f0d3d69d90 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
@@ -11,7 +11,7 @@ import { BadRequestException, ConflictException, Injectable, Logger } from "@nes
import { User, PlatformOAuthClient } from "@prisma/client";
import { createNewUsersConnectToOrgIfExists, slugify } from "@calcom/platform-libraries";
-import { CreationSource } from "@calcom/prisma/enums";
+import { CreationSource } from "@calcom/platform-libraries";
@Injectable()
export class OAuthClientUsersService {
diff --git a/apps/api/v2/src/modules/organizations/attributes/index/inputs/create-organization-attribute.input.ts b/apps/api/v2/src/modules/organizations/attributes/index/inputs/create-organization-attribute.input.ts
index 0fbdf239d8c..dd6e9f047b9 100644
--- a/apps/api/v2/src/modules/organizations/attributes/index/inputs/create-organization-attribute.input.ts
+++ b/apps/api/v2/src/modules/organizations/attributes/index/inputs/create-organization-attribute.input.ts
@@ -11,7 +11,7 @@ import {
ValidateNested,
} from "class-validator";
-import { AttributeType } from "@calcom/prisma/enums";
+import { AttributeType } from "@calcom/platform-libraries";
export class CreateOrganizationAttributeInput {
@IsString()
diff --git a/apps/api/v2/src/modules/organizations/attributes/index/inputs/update-organization-attribute.input.ts b/apps/api/v2/src/modules/organizations/attributes/index/inputs/update-organization-attribute.input.ts
index 3aa738f698d..6a5ec4ae8c3 100644
--- a/apps/api/v2/src/modules/organizations/attributes/index/inputs/update-organization-attribute.input.ts
+++ b/apps/api/v2/src/modules/organizations/attributes/index/inputs/update-organization-attribute.input.ts
@@ -1,7 +1,7 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsEnum, IsOptional, IsString } from "class-validator";
-import { AttributeType } from "@calcom/prisma/enums";
+import { AttributeType } from "@calcom/platform-libraries";
export class UpdateOrganizationAttributeInput {
@IsString()
diff --git a/apps/api/v2/src/modules/organizations/event-types/organizations-event-types.e2e-spec.ts b/apps/api/v2/src/modules/organizations/event-types/organizations-event-types.e2e-spec.ts
index 1d6231c2d59..c28c7a2fda7 100644
--- a/apps/api/v2/src/modules/organizations/event-types/organizations-event-types.e2e-spec.ts
+++ b/apps/api/v2/src/modules/organizations/event-types/organizations-event-types.e2e-spec.ts
@@ -24,6 +24,7 @@ import {
ConfirmationPolicyEnum,
NoticeThresholdUnitEnum,
} from "@calcom/platform-enums";
+import { SchedulingType } from "@calcom/platform-libraries";
import {
ApiSuccessResponse,
CreateTeamEventTypeInput_2024_06_14,
@@ -33,7 +34,6 @@ import {
UpdateTeamEventTypeInput_2024_06_14,
} from "@calcom/platform-types";
import { Team } from "@calcom/prisma/client";
-import { SchedulingType } from "@calcom/prisma/enums";
describe("Organizations Event Types Endpoints", () => {
describe("User Authentication - User is Org Admin", () => {
diff --git a/apps/api/v2/src/modules/organizations/event-types/services/input.service.ts b/apps/api/v2/src/modules/organizations/event-types/services/input.service.ts
index 7883cab28ff..c5267015f4f 100644
--- a/apps/api/v2/src/modules/organizations/event-types/services/input.service.ts
+++ b/apps/api/v2/src/modules/organizations/event-types/services/input.service.ts
@@ -7,12 +7,12 @@ import { TeamsRepository } from "@/modules/teams/teams/teams.repository";
import { UsersRepository } from "@/modules/users/users.repository";
import { BadRequestException, Injectable, NotFoundException } from "@nestjs/common";
+import { SchedulingType } from "@calcom/platform-libraries";
import {
CreateTeamEventTypeInput_2024_06_14,
UpdateTeamEventTypeInput_2024_06_14,
HostPriority,
} from "@calcom/platform-types";
-import { SchedulingType } from "@calcom/prisma/client";
export type TransformedCreateTeamEventTypeInput = Awaited<
ReturnType<InstanceType<typeof InputOrganizationsEventTypesService>["transformInputCreateTeamEventType"]>
diff --git a/apps/api/v2/src/modules/organizations/event-types/services/output.service.ts b/apps/api/v2/src/modules/organizations/event-types/services/output.service.ts
index 433bb00e9ef..3925278fc15 100644
--- a/apps/api/v2/src/modules/organizations/event-types/services/output.service.ts
+++ b/apps/api/v2/src/modules/organizations/event-types/services/output.service.ts
@@ -12,8 +12,8 @@ import type {
CalVideoSettings,
} from "@prisma/client";
+import { SchedulingType } from "@calcom/platform-libraries";
import { HostPriority, TeamEventTypeResponseHost } from "@calcom/platform-types";
-import { SchedulingType } from "@calcom/prisma/enums";
type EventTypeRelations = {
users: User[];
diff --git a/apps/api/v2/src/modules/organizations/memberships/inputs/create-organization-membership.input.ts b/apps/api/v2/src/modules/organizations/memberships/inputs/create-organization-membership.input.ts
index e2f168d46f9..9eec79d2431 100644
--- a/apps/api/v2/src/modules/organizations/memberships/inputs/create-organization-membership.input.ts
+++ b/apps/api/v2/src/modules/organizations/memberships/inputs/create-organization-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class CreateOrgMembershipDto {
@IsInt()
diff --git a/apps/api/v2/src/modules/organizations/memberships/inputs/update-organization-membership.input.ts b/apps/api/v2/src/modules/organizations/memberships/inputs/update-organization-membership.input.ts
index b82c7f894e8..527a883931f 100644
--- a/apps/api/v2/src/modules/organizations/memberships/inputs/update-organization-membership.input.ts
+++ b/apps/api/v2/src/modules/organizations/memberships/inputs/update-organization-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class UpdateOrgMembershipDto {
@IsOptional()
diff --git a/apps/api/v2/src/modules/organizations/teams/index/outputs/organization-team.output.ts b/apps/api/v2/src/modules/organizations/teams/index/outputs/organization-team.output.ts
index eba24ba92c7..5b8b9b8a580 100644
--- a/apps/api/v2/src/modules/organizations/teams/index/outputs/organization-team.output.ts
+++ b/apps/api/v2/src/modules/organizations/teams/index/outputs/organization-team.output.ts
@@ -3,8 +3,8 @@ import { Expose, Type } from "class-transformer";
import { IsEnum, IsString, ValidateNested } from "class-validator";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
+import { MembershipRole } from "@calcom/platform-libraries";
import { OrgTeamOutputDto } from "@calcom/platform-types";
-import { MembershipRole } from "@calcom/prisma/enums";
export class OrgMeTeamOutputDto extends OrgTeamOutputDto {
@IsString()
diff --git a/apps/api/v2/src/modules/organizations/teams/memberships/inputs/create-organization-team-membership.input.ts b/apps/api/v2/src/modules/organizations/teams/memberships/inputs/create-organization-team-membership.input.ts
index 7b933b05500..33852e89e7f 100644
--- a/apps/api/v2/src/modules/organizations/teams/memberships/inputs/create-organization-team-membership.input.ts
+++ b/apps/api/v2/src/modules/organizations/teams/memberships/inputs/create-organization-team-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class CreateOrgTeamMembershipDto {
@IsInt()
diff --git a/apps/api/v2/src/modules/organizations/teams/memberships/inputs/update-organization-team-membership.input.ts b/apps/api/v2/src/modules/organizations/teams/memberships/inputs/update-organization-team-membership.input.ts
index 7bddff9d5f0..da1f11a14ea 100644
--- a/apps/api/v2/src/modules/organizations/teams/memberships/inputs/update-organization-team-membership.input.ts
+++ b/apps/api/v2/src/modules/organizations/teams/memberships/inputs/update-organization-team-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class UpdateOrgTeamMembershipDto {
@IsOptional()
diff --git a/apps/api/v2/src/modules/organizations/users/index/inputs/create-organization-user.input.ts b/apps/api/v2/src/modules/organizations/users/index/inputs/create-organization-user.input.ts
index 7984ae9971c..94b34df576b 100644
--- a/apps/api/v2/src/modules/organizations/users/index/inputs/create-organization-user.input.ts
+++ b/apps/api/v2/src/modules/organizations/users/index/inputs/create-organization-user.input.ts
@@ -2,7 +2,7 @@ import { CreateUserInput } from "@/modules/users/inputs/create-user.input";
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsString, IsOptional, IsBoolean, IsEnum } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class CreateOrganizationUserInput extends CreateUserInput {
@IsOptional()
diff --git a/apps/api/v2/src/modules/organizations/users/index/services/organizations-users-service.ts b/apps/api/v2/src/modules/organizations/users/index/services/organizations-users-service.ts
index dbcb943be71..51b1b3553b5 100644
--- a/apps/api/v2/src/modules/organizations/users/index/services/organizations-users-service.ts
+++ b/apps/api/v2/src/modules/organizations/users/index/services/organizations-users-service.ts
@@ -8,7 +8,7 @@ import { Team } from "@prisma/client";
import { plainToInstance } from "class-transformer";
import { createNewUsersConnectToOrgIfExists } from "@calcom/platform-libraries";
-import { CreationSource } from "@calcom/prisma/enums";
+import { CreationSource } from "@calcom/platform-libraries";
@Injectable()
export class OrganizationsUsersService {
diff --git a/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts b/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts
index e255cd792af..282526aa9b3 100644
--- a/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts
+++ b/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class CreateTeamMembershipInput {
@IsInt()
diff --git a/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts b/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts
index a7f12185b96..c0121935bb0 100644
--- a/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts
+++ b/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts
@@ -1,7 +1,7 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsOptional, IsEnum } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class UpdateTeamMembershipInput {
@IsOptional()
diff --git a/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts b/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts
index 2d76521e8f5..93c78152738 100644
--- a/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts
+++ b/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts
@@ -2,7 +2,7 @@ import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { Expose, Transform, Type } from "class-transformer";
import { IsBoolean, IsInt, IsObject, IsOptional, IsString, ValidateNested } from "class-validator";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
class MembershipUserOutputDto {
@IsOptional()
diff --git a/apps/api/v2/src/modules/users/users.repository.ts b/apps/api/v2/src/modules/users/users.repository.ts
index 6de084b3ade..0d90a49ce16 100644
--- a/apps/api/v2/src/modules/users/users.repository.ts
+++ b/apps/api/v2/src/modules/users/users.repository.ts
@@ -5,7 +5,7 @@ import { UpdateManagedUserInput } from "@/modules/users/inputs/update-managed-us
import { Injectable, NotFoundException } from "@nestjs/common";
import type { Profile, User, Team, Prisma } from "@prisma/client";
-import { CreationSource } from "@calcom/prisma/enums";
+import { CreationSource } from "@calcom/platform-libraries";
export type UserWithProfile = User & {
movedToProfile?: (Profile & { organization: Pick<Team, "isPlatform" | "id" | "slug" | "name"> }) | null;
diff --git a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts
index 3acbfd93251..3f186d177ba 100644
--- a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts
+++ b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts
@@ -1,7 +1,7 @@
import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger";
import { IsArray, IsBoolean, IsEnum, IsOptional, IsString } from "class-validator";
-import { WebhookTriggerEvents } from "@calcom/prisma/enums";
+import { WebhookTriggerEvents } from "@calcom/platform-libraries";
export class CreateWebhookInputDto {
@IsString()
diff --git a/apps/api/v2/src/modules/webhooks/outputs/webhook.output.ts b/apps/api/v2/src/modules/webhooks/outputs/webhook.output.ts
index eb6e76d7214..e2ea2761b1e 100644
--- a/apps/api/v2/src/modules/webhooks/outputs/webhook.output.ts
+++ b/apps/api/v2/src/modules/webhooks/outputs/webhook.output.ts
@@ -3,7 +3,7 @@ import { Expose, Type } from "class-transformer";
import { IsBoolean, IsEnum, IsInt, IsString, ValidateNested, IsArray } from "class-validator";
import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
-import { WebhookTriggerEvents } from "@calcom/prisma/enums";
+import { WebhookTriggerEvents } from "@calcom/platform-libraries";
export class WebhookOutputDto {
@IsInt()
diff --git a/apps/api/v2/src/modules/workflows/inputs/workflow-step.input.ts b/apps/api/v2/src/modules/workflows/inputs/workflow-step.input.ts
index 3b4925c5195..1fa00c191e3 100644
--- a/apps/api/v2/src/modules/workflows/inputs/workflow-step.input.ts
+++ b/apps/api/v2/src/modules/workflows/inputs/workflow-step.input.ts
@@ -2,7 +2,7 @@ import { ApiProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsNumber, IsBoolean, IsString, ValidateNested, IsIn } from "class-validator";
-import { WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
+import { WorkflowActions, WorkflowTemplates } from "@calcom/platform-libraries";
export const EMAIL_HOST = "email_host";
export const EMAIL_ATTENDEE = "email_attendee";
diff --git a/apps/api/v2/src/modules/workflows/inputs/workflow-trigger.input.ts b/apps/api/v2/src/modules/workflows/inputs/workflow-trigger.input.ts
index dc1723972cb..061cba1cd39 100644
--- a/apps/api/v2/src/modules/workflows/inputs/workflow-trigger.input.ts
+++ b/apps/api/v2/src/modules/workflows/inputs/workflow-trigger.input.ts
@@ -2,7 +2,7 @@ import { ApiProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsIn, IsNumber, IsString, ValidateNested } from "class-validator";
-import { TimeUnit, WorkflowTriggerEvents } from "@calcom/prisma/enums";
+import { TimeUnit, WorkflowTriggerEvents } from "@calcom/platform-libraries";
export const BEFORE_EVENT = "beforeEvent";
export const EVENT_CANCELLED = "eventCancelled";
diff --git a/apps/api/v2/src/modules/workflows/workflows.repository.ts b/apps/api/v2/src/modules/workflows/workflows.repository.ts
index 95940be457a..314571c1871 100644
--- a/apps/api/v2/src/modules/workflows/workflows.repository.ts
+++ b/apps/api/v2/src/modules/workflows/workflows.repository.ts
@@ -3,11 +3,11 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
import { UserWithProfile } from "@/modules/users/users.repository";
import { Injectable } from "@nestjs/common";
+import { TimeUnit, WorkflowTriggerEvents } from "@calcom/platform-libraries";
import { TUpdateInputSchema } from "@calcom/platform-libraries/workflows";
import { updateWorkflow } from "@calcom/platform-libraries/workflows";
import { PrismaClient } from "@calcom/prisma";
import type { Workflow, WorkflowStep } from "@calcom/prisma/client";
-import { TimeUnit, WorkflowTriggerEvents } from "@calcom/prisma/enums";
export type WorkflowType = Workflow & { activeOn: { eventTypeId: number }[]; steps: WorkflowStep[] };
diff --git a/apps/api/v2/test/fixtures/repository/membership.repository.fixture.ts b/apps/api/v2/test/fixtures/repository/membership.repository.fixture.ts
index bf056f4a593..3382d36ea32 100644
--- a/apps/api/v2/test/fixtures/repository/membership.repository.fixture.ts
+++ b/apps/api/v2/test/fixtures/repository/membership.repository.fixture.ts
@@ -3,7 +3,7 @@ import { PrismaWriteService } from "@/modules/prisma/prisma-write.service";
import { TestingModule } from "@nestjs/testing";
import { Membership, Prisma, Team, User } from "@prisma/client";
-import { MembershipRole } from "@calcom/prisma/enums";
+import { MembershipRole } from "@calcom/platform-libraries";
export class MembershipRepositoryFixture {
private prismaReadClient: PrismaReadService["prisma"];
diff --git a/packages/platform/libraries/index.ts b/packages/platform/libraries/index.ts
index c31d11325c1..a627251eddb 100644
--- a/packages/platform/libraries/index.ts
+++ b/packages/platform/libraries/index.ts
@@ -17,7 +17,6 @@ import { getRoutedUrl } from "@calcom/lib/server/getRoutedUrl";
import { getTeamMemberEmailForResponseOrContactUsingUrlQuery } from "@calcom/lib/server/getTeamMemberEmailFromCrm";
import { getTranslation } from "@calcom/lib/server/i18n";
import type { Prisma } from "@calcom/prisma/client";
-import { MembershipRole } from "@calcom/prisma/enums";
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
import { paymentDataSelect } from "@calcom/prisma/selects/payment";
import { createNewUsersConnectToOrgIfExists } from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";
@@ -27,7 +26,18 @@ export { getBookingForReschedule };
export type { EventBusyDate } from "@calcom/types/Calendar";
-export { SchedulingType, PeriodType } from "@calcom/prisma/enums";
+export {
+ CreationSource,
+ SchedulingType,
+ PeriodType,
+ AttributeType,
+ MembershipRole,
+ TimeUnit,
+ WebhookTriggerEvents,
+ WorkflowTriggerEvents,
+ WorkflowActions,
+ WorkflowTemplates,
+} from "@calcom/prisma/enums";
export { getUsernameList } from "@calcom/lib/defaultEvents";
@@ -95,8 +105,6 @@ export type TeamQuery = Prisma.TeamGetPayload<{
}>;
export { credentialForCalendarServiceSelect };
-export { MembershipRole };
-
export { paymentDataSelect };
export { getClientSecretFromPayment };
diff --git a/yarn.lock b/yarn.lock
index 90d919392f0..ab7de38173e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2708,7 +2708,7 @@ __metadata:
"@axiomhq/winston": ^1.2.0
"@calcom/platform-constants": "*"
"@calcom/platform-enums": "*"
- "@calcom/platform-libraries": "npm:@calcom/[email protected]"
+ "@calcom/platform-libraries": "npm:@calcom/[email protected]"
"@calcom/platform-types": "*"
"@calcom/platform-utils": "*"
"@calcom/prisma": "*"
@@ -3767,13 +3767,13 @@ __metadata:
languageName: unknown
linkType: soft
-"@calcom/platform-libraries@npm:@calcom/[email protected]":
- version: 0.0.338
- resolution: "@calcom/platform-libraries@npm:0.0.338"
+"@calcom/platform-libraries@npm:@calcom/[email protected]":
+ version: 0.0.340
+ resolution: "@calcom/platform-libraries@npm:0.0.340"
dependencies:
"@calcom/features": "*"
"@calcom/lib": "*"
- checksum: d44d2bbbd636803dfb7767566535fd995135ae9db5dabfafee76a9431d24f38b8e088446a64f056880295e1f001671a107e7ae4615e056d792e6ac9c6a609dc1
+ checksum: 19c2f125fc6b3074314365a19894e86a709243ccf29a5315468ff5e8f9767a4b2cc618cd5e4797c37f1e46c8a4f6937b3063b85b5f26157ba65d84ab664d7298
languageName: node
linkType: hard