fix: extracted app-store and DWD platform-libraries imports to a /app-store barrel file (#19938)

* fix: platform libraries barrel file extract app-store

* extracted DWD to app-store barrel file

* removed getCalendar as not used in api/v2

* bump platform-libraries
This commit is contained in:
Somay Chauhan authored and GitHub committed 2025-03-11 08:30:37 +00:00
1 parent 517d509321
commit 861e3aa24f
17 files changed
+2606 -695

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.142",
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.143",
"@calcom/platform-libraries-0.0.2": "npm:@calcom/platform-libraries@0.0.2",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
@@ -2,7 +2,7 @@ import { CreateBookingInput_2024_04_15 } from "@/ee/bookings/2024-04-15/inputs/c
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsBoolean, IsString, IsNumber, IsOptional } from "class-validator";
import type { AppsStatus } from "@calcom/platform-libraries";
import type { AppsStatus } from "@calcom/platform-libraries/app-store";
export class CreateRecurringBookingInput_2024_04_15 extends CreateBookingInput_2024_04_15 {
@IsBoolean()
@@ -31,7 +31,7 @@ import {
} from "@calcom/platform-constants";
import { OFFICE_365_CALENDAR_ID, OFFICE_365_CALENDAR_TYPE } from "@calcom/platform-constants";
import { ICS_CALENDAR } from "@calcom/platform-constants/apps";
import { IcsFeedCalendarService } from "@calcom/platform-libraries";
import { IcsFeedCalendarService } from "@calcom/platform-libraries/app-store";
const CLIENT_REDIRECT_URI = "http://localhost:5555";
@@ -5,7 +5,8 @@ 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, symmetricDecrypt } from "@calcom/platform-libraries";
import { symmetricEncrypt, symmetricDecrypt } from "@calcom/platform-libraries";
import { CalendarService } from "@calcom/platform-libraries/app-store";
import { Credential } from "@calcom/prisma/client";
@Injectable()
@@ -6,7 +6,8 @@ import { BadRequestException, UnauthorizedException, Logger } from "@nestjs/comm
import { Injectable } from "@nestjs/common";
import { SUCCESS_STATUS, ICS_CALENDAR_TYPE, ICS_CALENDAR } from "@calcom/platform-constants";
import { symmetricEncrypt, IcsFeedCalendarService } from "@calcom/platform-libraries";
import { symmetricEncrypt } from "@calcom/platform-libraries";
import { IcsFeedCalendarService } from "@calcom/platform-libraries/app-store";
@Injectable()
export class IcsFeedService implements ICSFeedCalendarApp {
@@ -23,7 +23,7 @@ import {
import { ApiTags as DocsTags, ApiExcludeController as DocsExcludeController } from "@nestjs/swagger";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
import { ConnectedApps } from "@calcom/platform-libraries";
import { ConnectedApps } from "@calcom/platform-libraries/app-store";
import type { UpdateEventTypeReturn } from "@calcom/platform-libraries/event-types";
import { ApiResponse } from "@calcom/platform-types";
@@ -3,7 +3,7 @@ import { UserWithProfile } from "@/modules/users/users.repository";
import { Logger } from "@nestjs/common";
import { Injectable } from "@nestjs/common";
import { getConnectedApps, ConnectedApps } from "@calcom/platform-libraries";
import { getConnectedApps, ConnectedApps } from "@calcom/platform-libraries/app-store";
import { PrismaClient } from "@calcom/prisma";
@Injectable()
@@ -9,22 +9,18 @@ import { UsersService } from "@/modules/users/services/users.service";
import { UserWithProfile } from "@/modules/users/users.repository";
import { Injectable, NotFoundException, ForbiddenException } from "@nestjs/common";
import {
getEnabledAppsFromCredentials,
getAppFromSlug,
MembershipRole,
getClientSecretFromPayment,
enrichUserWithDelegationConferencingCredentialsWithoutOrgId,
} from "@calcom/platform-libraries";
import { MembershipRole, getClientSecretFromPayment } from "@calcom/platform-libraries";
import type { TeamQuery } from "@calcom/platform-libraries";
import { enrichUserWithDelegationConferencingCredentialsWithoutOrgId } from "@calcom/platform-libraries/app-store";
import { getEnabledAppsFromCredentials, getAppFromSlug } from "@calcom/platform-libraries/app-store";
import type {
App,
TDependencyData,
CredentialOwner,
CredentialPayload,
CredentialDataWithTeamName,
LocationOption,
TeamQuery,
CredentialOwner,
TDependencyData,
CredentialPayload,
} from "@calcom/platform-libraries";
} from "@calcom/platform-libraries/app-store";
import {
getBulkEventTypes,
getEventTypeById,
@@ -5,12 +5,8 @@ import { BadRequestException, InternalServerErrorException, Logger } from "@nest
import { Injectable } from "@nestjs/common";
import { CONFERENCING_APPS, CAL_VIDEO } from "@calcom/platform-constants";
import {
userMetadata,
handleDeleteCredential,
getApps,
getUsersCredentials,
} from "@calcom/platform-libraries";
import { userMetadata, getUsersCredentials } from "@calcom/platform-libraries";
import { getApps, handleDeleteCredential } from "@calcom/platform-libraries/app-store";
@Injectable()
export class ConferencingService {
@@ -9,11 +9,11 @@ import { DelegationCredentialOutput } from "@/modules/organizations/delegation-c
import { Injectable, NotFoundException } from "@nestjs/common";
import { User } from "@prisma/client";
import { encryptServiceAccountKey } from "@calcom/platform-libraries";
import {
addDelegationCredential,
toggleDelegationCredentialEnabled,
encryptServiceAccountKey,
} from "@calcom/platform-libraries";
} from "@calcom/platform-libraries/app-store";
@Injectable()
export class OrganizationsDelegationCredentialService {
+10 -1
View File
@@ -8847,6 +8847,10 @@
"type": {
"type": "string",
"description": "The policy that determines when confirmation is required",
"enum": [
"always",
"time"
],
"example": "always"
},
"noticeThreshold": {
@@ -8856,10 +8860,15 @@
"$ref": "#/components/schemas/NoticeThreshold_2024_06_14"
}
]
},
"blockUnconfirmedBookingsInBooker": {
"type": "boolean",
"description": "Unconfirmed bookings still block calendar slots."
}
},
"required": [
"type"
"type",
"blockUnconfirmedBookingsInBooker"
]
},
"Seats_2024_06_14": {
File diff suppressed because it is too large. Load diff
+34
View File
@@ -0,0 +1,34 @@
import getApps from "@calcom/app-store/utils";
import handleDeleteCredential from "@calcom/features/credentials/handleDeleteCredential";
import getEnabledAppsFromCredentials from "@calcom/lib/apps/getEnabledAppsFromCredentials";
import addDelegationCredential from "@calcom/trpc/server/routers/viewer/delegationCredential/add.handler";
export type { TDependencyData } from "@calcom/app-store/_appRegistry";
export type { CredentialOwner } from "@calcom/app-store/types";
export { CalendarService as IcsFeedCalendarService } from "@calcom/app-store/ics-feedcalendar/lib";
export { getAppFromSlug } from "@calcom/app-store/utils";
export type { CredentialDataWithTeamName, LocationOption } from "@calcom/app-store/utils";
export { CalendarService } from "@calcom/app-store/applecalendar/lib";
export { getApps };
export { handleDeleteCredential };
export type { App } from "@calcom/types/App";
export { getEnabledAppsFromCredentials };
export { getConnectedApps } from "@calcom/lib/getConnectedApps";
export type { ConnectedApps } from "@calcom/lib/getConnectedApps";
export type { AppsStatus } from "@calcom/types/Calendar";
export type { CredentialPayload } from "@calcom/types/Credential";
export { addDelegationCredential };
export { enrichUserWithDelegationConferencingCredentialsWithoutOrgId } from "@calcom/lib/delegationCredential/server";
export { toggleDelegationCredentialEnabled } from "@calcom/trpc/server/routers/viewer/delegationCredential/toggleEnabled.handler";
-64
View File
@@ -1,11 +1,3 @@
import type { TDependencyData } from "@calcom/app-store/_appRegistry";
import { getCalendar } from "@calcom/app-store/_utils/getCalendar";
import { CalendarService } from "@calcom/app-store/applecalendar/lib";
import { CalendarService as IcsFeedCalendarService } from "@calcom/app-store/ics-feedcalendar/lib";
import type { CredentialOwner } from "@calcom/app-store/types";
import { getAppFromSlug } from "@calcom/app-store/utils";
import type { CredentialDataWithTeamName, LocationOption } from "@calcom/app-store/utils";
import getApps from "@calcom/app-store/utils";
import AttendeeCancelledEmail from "@calcom/emails/templates/attendee-cancelled-email";
import AttendeeDeclinedEmail from "@calcom/emails/templates/attendee-declined-email";
import AttendeeRequestEmail from "@calcom/emails/templates/attendee-request-email";
@@ -22,28 +14,12 @@ import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/
import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";
import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooking";
import * as newBookingMethods from "@calcom/features/bookings/lib/handleNewBooking";
import handleDeleteCredential from "@calcom/features/credentials/handleDeleteCredential";
import { getClientSecretFromPayment } from "@calcom/features/ee/payments/pages/getClientSecretFromPayment";
import { handleCreatePhoneCall } from "@calcom/features/handleCreatePhoneCall";
import handleMarkNoShow from "@calcom/features/handleMarkNoShow";
import * as instantMeetingMethods from "@calcom/features/instant-meeting/handleInstantMeeting";
import getEnabledAppsFromCredentials from "@calcom/lib/apps/getEnabledAppsFromCredentials";
import getAllUserBookings from "@calcom/lib/bookings/getAllUserBookings";
import { symmetricEncrypt, symmetricDecrypt } from "@calcom/lib/crypto";
import {
getFirstDelegationConferencingCredentialAppLocation,
getFirstDelegationConferencingCredential,
getDelegationCredentialOrRegularCredential,
getDelegationCredentialOrFindRegularCredential,
enrichUserWithDelegationConferencingCredentialsWithoutOrgId,
enrichUserWithDelegationCredentialsWithoutOrgId,
enrichHostsWithDelegationCredentials,
enrichUsersWithDelegationCredentials,
buildAllCredentials,
getAllDelegationCredentialsForUserByAppSlug,
getAllDelegationCredentialsForUserByAppType,
checkIfSuccessfullyConfiguredInWorkspace,
} from "@calcom/lib/delegationCredential/server";
import { getRoutedUrl } from "@calcom/lib/server/getRoutedUrl";
import { getTeamMemberEmailForResponseOrContactUsingUrlQuery } from "@calcom/lib/server/getTeamMemberEmailFromCrm";
import { getTranslation } from "@calcom/lib/server/i18n";
@@ -52,33 +28,13 @@ import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/crede
import { paymentDataSelect } from "@calcom/prisma/selects/payment";
import type { TeamQuery } from "@calcom/trpc/server/routers/loggedInViewer/integrations.handler";
import { updateHandler as updateScheduleHandler } from "@calcom/trpc/server/routers/viewer/availability/schedule/update.handler";
import addDelegationCredential from "@calcom/trpc/server/routers/viewer/delegationCredential/add.handler";
import {
createNewUsersConnectToOrgIfExists,
sendSignupToOrganizationEmail,
} from "@calcom/trpc/server/routers/viewer/teams/inviteMember/utils";
import type { App } from "@calcom/types/App";
import type { CredentialPayload } from "@calcom/types/Credential";
export { getUsersCredentials } from "@calcom/lib/server/getUsersCredentials";
export { getApps };
export {
getFirstDelegationConferencingCredentialAppLocation,
getFirstDelegationConferencingCredential,
getDelegationCredentialOrRegularCredential,
getDelegationCredentialOrFindRegularCredential,
enrichUserWithDelegationConferencingCredentialsWithoutOrgId,
enrichUserWithDelegationCredentialsWithoutOrgId,
enrichHostsWithDelegationCredentials,
enrichUsersWithDelegationCredentials,
buildAllCredentials,
getAllDelegationCredentialsForUserByAppSlug,
getAllDelegationCredentialsForUserByAppType,
checkIfSuccessfullyConfiguredInWorkspace,
};
export { slugify } from "@calcom/lib/slugify";
export { getBookingForReschedule };
export { updateScheduleHandler };
@@ -105,9 +61,6 @@ export { handleNewRecurringBooking } from "@calcom/features/bookings/lib/handleN
export { getConnectedDestinationCalendarsAndEnsureDefaultsInDb } from "@calcom/lib/getConnectedDestinationCalendars";
export type { ConnectedDestinationCalendars } from "@calcom/lib/getConnectedDestinationCalendars";
export { getConnectedApps } from "@calcom/lib/getConnectedApps";
export type { ConnectedApps } from "@calcom/lib/getConnectedApps";
export { getBusyCalendarTimes } from "@calcom/lib/CalendarManager";
export {
@@ -124,7 +77,6 @@ export type {
RecurringBookingCreateBody,
} from "@calcom/features/bookings/types";
export { HttpError } from "@calcom/lib/http-error";
export type { AppsStatus } from "@calcom/types/Calendar";
export { MINUTES_TO_BOOK } from "@calcom/lib/constants";
@@ -147,9 +99,6 @@ export { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
export { dynamicEvent } from "@calcom/lib/defaultEvents";
export { symmetricEncrypt, symmetricDecrypt };
export { CalendarService };
export { getCalendar };
export { getTranslation };
@@ -158,18 +107,9 @@ export { roundRobinManualReassignment } from "@calcom/features/ee/round-robin/ro
export { ErrorCode } from "@calcom/lib/errorCodes";
export { IcsFeedCalendarService };
export { validateCustomEventName } from "@calcom/lib/event";
export { getEnabledAppsFromCredentials };
export type { App };
export type { CredentialDataWithTeamName };
export type { LocationOption };
export type { TeamQuery };
export type { CredentialOwner };
export type { TDependencyData };
export type { CredentialPayload };
export { getAppFromSlug };
export { credentialForCalendarServiceSelect };
export { MembershipRole };
@@ -199,7 +139,6 @@ export { AttendeeUpdatedEmail };
export { OrganizerRequestEmail };
export { AttendeeRequestEmail };
export { handleDeleteCredential };
export { getBookingFieldsWithSystemFields };
@@ -207,9 +146,6 @@ export { getRoutedUrl };
export { getTeamMemberEmailForResponseOrContactUsingUrlQuery };
export { addDelegationCredential };
export { SelectedCalendarRepository } from "@calcom/lib/server/repository/selectedCalendar";
export { toggleDelegationCredentialEnabled } from "@calcom/trpc/server/routers/viewer/delegationCredential/toggleEnabled.handler";
export { encryptServiceAccountKey } from "@calcom/lib/server/serviceAccountKey";
export { createHandler as createApiKeyHandler } from "@calcom/trpc/server/routers/viewer/apiKeys/create.handler";
+8
View File
@@ -29,6 +29,11 @@
"vite-plugin-environment": "^1.1.3"
},
"exports": {
"./app-store": {
"import": "./dist/app-store.js",
"require": "./dist/app-store.cjs",
"types": "./dist/app-store.d.ts"
},
"./event-types": {
"import": "./dist/event-types.js",
"require": "./dist/event-types.cjs",
@@ -52,6 +57,9 @@
],
"slots": [
"dist/slots.d.ts"
],
"app-store": [
"dist/app-store.d.ts"
]
}
}
@@ -19,6 +19,7 @@ export default defineConfig({
entry: {
index: resolve(__dirname, "./index.ts"),
"event-types": resolve(__dirname, "./event-types.ts"),
"app-store": resolve(__dirname, "./app-store.ts"),
slots: resolve(__dirname, "./slots.ts"),
},
name: "calcom-lib",
+5 -5
View File
@@ -2295,7 +2295,7 @@ __metadata:
"@axiomhq/winston": ^1.2.0
"@calcom/platform-constants": "*"
"@calcom/platform-enums": "*"
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.142"
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.143"
"@calcom/platform-libraries-0.0.2": "npm:@calcom/platform-libraries@0.0.2"
"@calcom/platform-types": "*"
"@calcom/platform-utils": "*"
@@ -3341,13 +3341,13 @@ __metadata:
languageName: node
linkType: hard
"@calcom/platform-libraries@npm:@calcom/platform-libraries@0.0.142":
version: 0.0.142
resolution: "@calcom/platform-libraries@npm:0.0.142"
"@calcom/platform-libraries@npm:@calcom/platform-libraries@0.0.143":
version: 0.0.143
resolution: "@calcom/platform-libraries@npm:0.0.143"
dependencies:
"@calcom/features": "*"
"@calcom/lib": "*"
checksum: e33926ed22ed4afb50c8ff124f4af6f86073e4ffe8d8a936814d14746e9516e7c67f683a3bcffb95792ab956e77e2d4ff02012cd894f98d66b9d9eb9d4a1248f
checksum: 4fc720af57b82bcf7dca7df7d86efa7e8a65342036d0ae67b18c14f68007750c63ff234cd0d2ee2439c346beb3656c3c965c9d2ccb9d6dd0e99427223f6e1806
languageName: node
linkType: hard