fix: platform libraries barrel file extract event-types (#19846)
* fix: event-types
* chore: added "+ group link" tip (#19809)
* added + link tip
* nit
---------
Co-authored-by: amrit <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Tushar Bhatt <[email protected]>
* Added fix to solve the id TypeError (#19810)
Co-authored-by: amrit <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Tushar Bhatt <[email protected]>
* Revert "fix: prevent background scroll on opening timezone select menu (#19789)" (#19814)
This reverts commit 1a96149ce3.
* fix: Calendar events attached to workflow emails are missing meeting link (#19790)
* fixup! fix: Calendar events attached to workflow emails are missing meeting link (#19790)
* chore: fix type errors
* fix: wrong import in e2e file
* fix: tsconfig api v2 for /event-types
* fix: import and refactor
* fixed remaning type issues
* undo extra changes
* bump platform libs
* Update event-types.controller.e2e-spec.ts
* fix: test with seats enabled
---------
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: amrit <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Tushar Bhatt <[email protected]>
Co-authored-by: Harshit Singh <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
27 files changed
+281
-150
No files matched your search
@@ -6,10 +6,8 @@ import type {
|
||||
|
||||
export function transformSeatsApiToInternal(
|
||||
inputSeats: CreateEventTypeInput_2024_06_14["seats"]
|
||||
): SeatOptionsTransformedSchema | SeatOptionsDisabledSchema | undefined {
|
||||
if (!inputSeats) return undefined;
|
||||
|
||||
if (inputSeats.disabled)
|
||||
): SeatOptionsTransformedSchema | SeatOptionsDisabledSchema {
|
||||
if (!inputSeats || inputSeats.disabled)
|
||||
return {
|
||||
seatsPerTimeSlot: null,
|
||||
};
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import type {
|
||||
SeatOptionsTransformedSchema,
|
||||
SeatOptionsDisabledSchema,
|
||||
CreateEventTypeInput_2024_06_14,
|
||||
Seats_2024_06_14,
|
||||
Disabled_2024_06_14,
|
||||
} from "@calcom/platform-types";
|
||||
|
||||
export function transformSeatsInternalToApi(
|
||||
transformedSeats: SeatOptionsTransformedSchema | SeatOptionsDisabledSchema
|
||||
): CreateEventTypeInput_2024_06_14["seats"] {
|
||||
): Seats_2024_06_14 | Disabled_2024_06_14 {
|
||||
if (transformedSeats.seatsPerTimeSlot == null) {
|
||||
return {
|
||||
disabled: true,
|
||||
};
|
||||
} satisfies Disabled_2024_06_14;
|
||||
}
|
||||
return {
|
||||
seatsPerTimeSlot: transformedSeats.seatsPerTimeSlot,
|
||||
showAttendeeInfo: transformedSeats.seatsShowAttendees,
|
||||
showAvailabilityCount: transformedSeats.seatsShowAvailabilityCount,
|
||||
};
|
||||
} satisfies Seats_2024_06_14;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
|
||||
import getBulkEventTypes from "@calcom/lib/event-types/getBulkEventTypes";
|
||||
|
||||
export { createHandler as createEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/create.handler";
|
||||
export { updateHandler as updateEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/update.handler";
|
||||
|
||||
export type { TUpdateInputSchema as TUpdateEventTypeInputSchema } from "@calcom/trpc/server/routers/viewer/eventTypes/update.schema";
|
||||
export type { EventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
|
||||
export { getEventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
|
||||
export { parseEventTypeColor } from "@calcom/lib/isEventTypeColor";
|
||||
export {
|
||||
// note(Lauris): Api to internal
|
||||
transformBookingFieldsApiToInternal,
|
||||
transformLocationsApiToInternal,
|
||||
transformTeamLocationsApiToInternal,
|
||||
transformIntervalLimitsApiToInternal,
|
||||
transformFutureBookingLimitsApiToInternal,
|
||||
transformRecurrenceApiToInternal,
|
||||
transformBookerLayoutsApiToInternal,
|
||||
transformConfirmationPolicyApiToInternal,
|
||||
transformEventColorsApiToInternal,
|
||||
transformSeatsApiToInternal,
|
||||
// note(Lauris): Internal to api
|
||||
transformBookingFieldsInternalToApi,
|
||||
transformLocationsInternalToApi,
|
||||
transformIntervalLimitsInternalToApi,
|
||||
transformFutureBookingLimitsInternalToApi,
|
||||
transformRecurrenceInternalToApi,
|
||||
transformBookerLayoutsInternalToApi,
|
||||
transformRequiresConfirmationInternalToApi,
|
||||
transformEventTypeColorsInternalToApi,
|
||||
transformSeatsInternalToApi,
|
||||
// note(Lauris): schemas
|
||||
InternalLocationsSchema,
|
||||
InternalLocationSchema,
|
||||
BookingFieldsSchema,
|
||||
BookingFieldSchema,
|
||||
// note(Lauris): constants
|
||||
systemBeforeFieldName,
|
||||
systemBeforeFieldEmail,
|
||||
systemBeforeFieldLocation,
|
||||
systemAfterFieldRescheduleReason,
|
||||
systemAfterFieldTitle,
|
||||
systemAfterFieldNotes,
|
||||
systemAfterFieldGuests,
|
||||
} from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export type {
|
||||
SystemField,
|
||||
CustomField,
|
||||
NameSystemField,
|
||||
EmailSystemField,
|
||||
InternalLocation,
|
||||
} from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
|
||||
|
||||
export { validateCustomEventName } from "@calcom/lib/event";
|
||||
|
||||
export { getEventTypeById } from "@calcom/lib/event-types/getEventTypeById";
|
||||
export { getEventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
|
||||
export type { EventType } from "@calcom/lib/event-types/getEventTypeById";
|
||||
export type { EventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
|
||||
export type { UpdateEventTypeReturn } from "@calcom/trpc/server/routers/viewer/eventTypes/update.handler";
|
||||
export { eventTypeBookingFields, eventTypeLocations } from "@calcom/prisma/zod-utils";
|
||||
export { updateNewTeamMemberEventTypes } from "@calcom/lib/server/queries";
|
||||
|
||||
export { getBulkEventTypes };
|
||||
|
||||
export type PublicEventType = Awaited<ReturnType<typeof getPublicEvent>>;
|
||||
export { bulkUpdateEventsToDefaultLocation } from "@calcom/lib/bulkUpdateEventsToDefaultLocation";
|
||||
export { getPublicEvent };
|
||||
@@ -24,7 +24,6 @@ import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooki
|
||||
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 { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
|
||||
import { handleCreatePhoneCall } from "@calcom/features/handleCreatePhoneCall";
|
||||
import handleMarkNoShow from "@calcom/features/handleMarkNoShow";
|
||||
import * as instantMeetingMethods from "@calcom/features/instant-meeting/handleInstantMeeting";
|
||||
@@ -45,7 +44,6 @@ import {
|
||||
getAllDelegationCredentialsForUserByAppType,
|
||||
checkIfSuccessfullyConfiguredInWorkspace,
|
||||
} from "@calcom/lib/delegationCredential/server";
|
||||
import getBulkEventTypes from "@calcom/lib/event-types/getBulkEventTypes";
|
||||
import { getRoutedUrl } from "@calcom/lib/server/getRoutedUrl";
|
||||
import { getTeamMemberEmailForResponseOrContactUsingUrlQuery } from "@calcom/lib/server/getTeamMemberEmailFromCrm";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
@@ -90,21 +88,8 @@ export type UpdateScheduleOutputType = Awaited<
|
||||
>
|
||||
>;
|
||||
|
||||
export { getEventTypeById } from "@calcom/lib/event-types/getEventTypeById";
|
||||
export { getEventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
|
||||
export { getEventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
|
||||
export { createHandler as createEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/create.handler";
|
||||
export { updateHandler as updateEventType } from "@calcom/trpc/server/routers/viewer/eventTypes/update.handler";
|
||||
|
||||
export { SchedulingType, PeriodType } from "@calcom/prisma/enums";
|
||||
|
||||
export type { EventType } from "@calcom/lib/event-types/getEventTypeById";
|
||||
export type { EventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
|
||||
export type { EventTypesPublic } from "@calcom/lib/event-types/getEventTypesPublic";
|
||||
export type { UpdateEventTypeReturn } from "@calcom/trpc/server/routers/viewer/eventTypes/update.handler";
|
||||
|
||||
export type PublicEventType = Awaited<ReturnType<typeof getPublicEvent>>;
|
||||
export { getPublicEvent };
|
||||
export { getUsernameList } from "@calcom/lib/defaultEvents";
|
||||
|
||||
const handleNewBooking = newBookingMethods.default;
|
||||
@@ -121,7 +106,7 @@ export { getConnectedDestinationCalendarsAndEnsureDefaultsInDb } from "@calcom/l
|
||||
export type { ConnectedDestinationCalendars } from "@calcom/lib/getConnectedDestinationCalendars";
|
||||
|
||||
export { getConnectedApps } from "@calcom/lib/getConnectedApps";
|
||||
export { bulkUpdateEventsToDefaultLocation } from "@calcom/lib/bulkUpdateEventsToDefaultLocation";
|
||||
|
||||
export type { ConnectedApps } from "@calcom/lib/getConnectedApps";
|
||||
export { getBusyCalendarTimes } from "@calcom/lib/CalendarManager";
|
||||
|
||||
@@ -148,63 +133,14 @@ export type { CityTimezones } from "@calcom/features/cityTimezones/cityTimezones
|
||||
|
||||
export { TRPCError } from "@trpc/server";
|
||||
export type { TUpdateInputSchema } from "@calcom/trpc/server/routers/viewer/availability/schedule/update.schema";
|
||||
export type { TUpdateInputSchema as TUpdateEventTypeInputSchema } from "@calcom/trpc/server/routers/viewer/eventTypes/update.schema";
|
||||
export { createNewUsersConnectToOrgIfExists, sendSignupToOrganizationEmail };
|
||||
|
||||
export { getAllUserBookings };
|
||||
export { getBookingInfo };
|
||||
export { handleCancelBooking };
|
||||
|
||||
export { eventTypeBookingFields, eventTypeLocations } from "@calcom/prisma/zod-utils";
|
||||
export { userMetadata, bookingMetadataSchema } from "@calcom/prisma/zod-utils";
|
||||
|
||||
export { EventTypeMetaDataSchema, userMetadata, bookingMetadataSchema } from "@calcom/prisma/zod-utils";
|
||||
|
||||
export {
|
||||
// note(Lauris): Api to internal
|
||||
transformBookingFieldsApiToInternal,
|
||||
transformLocationsApiToInternal,
|
||||
transformTeamLocationsApiToInternal,
|
||||
transformIntervalLimitsApiToInternal,
|
||||
transformFutureBookingLimitsApiToInternal,
|
||||
transformRecurrenceApiToInternal,
|
||||
transformBookerLayoutsApiToInternal,
|
||||
transformConfirmationPolicyApiToInternal,
|
||||
transformEventColorsApiToInternal,
|
||||
transformSeatsApiToInternal,
|
||||
// note(Lauris): Internal to api
|
||||
transformBookingFieldsInternalToApi,
|
||||
transformLocationsInternalToApi,
|
||||
transformIntervalLimitsInternalToApi,
|
||||
transformFutureBookingLimitsInternalToApi,
|
||||
transformRecurrenceInternalToApi,
|
||||
transformBookerLayoutsInternalToApi,
|
||||
transformRequiresConfirmationInternalToApi,
|
||||
transformEventTypeColorsInternalToApi,
|
||||
transformSeatsInternalToApi,
|
||||
// note(Lauris): schemas
|
||||
InternalLocationsSchema,
|
||||
InternalLocationSchema,
|
||||
BookingFieldsSchema,
|
||||
BookingFieldSchema,
|
||||
// note(Lauris): constants
|
||||
systemBeforeFieldName,
|
||||
systemBeforeFieldEmail,
|
||||
systemBeforeFieldLocation,
|
||||
systemAfterFieldRescheduleReason,
|
||||
systemAfterFieldTitle,
|
||||
systemAfterFieldNotes,
|
||||
systemAfterFieldGuests,
|
||||
} from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export type {
|
||||
SystemField,
|
||||
CustomField,
|
||||
NameSystemField,
|
||||
EmailSystemField,
|
||||
InternalLocation,
|
||||
} from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export { parseEventTypeColor } from "@calcom/lib";
|
||||
export { parseBookingLimit } from "@calcom/lib/intervalLimits/isBookingLimits";
|
||||
|
||||
export { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
@@ -217,8 +153,6 @@ export { getCalendar };
|
||||
|
||||
export { getTranslation };
|
||||
|
||||
export { updateNewTeamMemberEventTypes } from "@calcom/lib/server/queries";
|
||||
|
||||
export { roundRobinReassignment } from "@calcom/features/ee/round-robin/roundRobinReassignment";
|
||||
export { roundRobinManualReassignment } from "@calcom/features/ee/round-robin/roundRobinManualReassignment";
|
||||
|
||||
@@ -266,7 +200,6 @@ export { OrganizerRequestEmail };
|
||||
|
||||
export { AttendeeRequestEmail };
|
||||
export { handleDeleteCredential };
|
||||
export { getBulkEventTypes };
|
||||
|
||||
export { getBookingFieldsWithSystemFields };
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
"vite-plugin-environment": "^1.1.3"
|
||||
},
|
||||
"exports": {
|
||||
"./event-types": {
|
||||
"import": "./dist/event-types.js",
|
||||
"require": "./dist/event-types.cjs",
|
||||
"types": "./dist/event-types.d.ts"
|
||||
},
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
@@ -42,6 +47,9 @@
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"event-types": [
|
||||
"dist/event-types.d.ts"
|
||||
],
|
||||
"slots": [
|
||||
"dist/slots.d.ts"
|
||||
]
|
||||
|
||||
@@ -18,6 +18,7 @@ export default defineConfig({
|
||||
lib: {
|
||||
entry: {
|
||||
index: resolve(__dirname, "./index.ts"),
|
||||
"event-types": resolve(__dirname, "./event-types.ts"),
|
||||
slots: resolve(__dirname, "./slots.ts"),
|
||||
},
|
||||
name: "calcom-lib",
|
||||
|
||||
+2
-1
@@ -33,6 +33,7 @@ import { BookerLayouts_2024_06_14 } from "../inputs/booker-layouts.input";
|
||||
import type { BookingLimitsCount_2024_06_14 } from "../inputs/booking-limits-count.input";
|
||||
import type { ConfirmationPolicy_2024_06_14 } from "../inputs/confirmation-policy.input";
|
||||
import { DestinationCalendar_2024_06_14 } from "../inputs/destination-calendar.input";
|
||||
import type { Disabled_2024_06_14 } from "../inputs/disabled.input";
|
||||
import {
|
||||
EmailDefaultFieldOutput_2024_06_14,
|
||||
NameDefaultFieldOutput_2024_06_14,
|
||||
@@ -401,7 +402,7 @@ class BaseEventTypeOutput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@Type(() => Seats_2024_06_14)
|
||||
@ApiPropertyOptional({ type: Seats_2024_06_14 })
|
||||
seats?: Seats_2024_06_14;
|
||||
seats?: Seats_2024_06_14 | Disabled_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
|
||||
Reference in new issue
Block a user