import { AppStoreLocationType, DefaultLocationType } from "@calcom/app-store/locations"; import { User, Team, Credential, SelectedCalendar, EventTypeCustomInput, Attendee, Availability, BookingReference, Booking, DailyEventReference, Webhook, DestinationCalendar, Membership, Payment, Schedule, ReminderMail, EventType, } from "@calcom/prisma/client"; // Base response, used for all responses export type BaseResponse = { message?: string; error?: Error; }; // User export type UserResponse = BaseResponse & { user?: Partial; }; export type UsersResponse = BaseResponse & { users?: Partial[]; }; // Team export type TeamResponse = BaseResponse & { team?: Partial; owner?: Partial; }; export type TeamsResponse = BaseResponse & { teams?: Partial[]; }; // SelectedCalendar export type SelectedCalendarResponse = BaseResponse & { selected_calendar?: Partial; }; export type SelectedCalendarsResponse = BaseResponse & { selected_calendars?: Partial[]; }; // Attendee export type AttendeeResponse = BaseResponse & { attendee?: Partial; }; // Grouping attendees in booking arrays for now, // later might remove endpoint and move to booking endpoint altogether. export type AttendeesResponse = BaseResponse & { attendees?: Partial[]; }; // Availability export type AvailabilityResponse = BaseResponse & { availability?: Partial; }; export type AvailabilitiesResponse = BaseResponse & { availabilities?: Partial[]; }; // BookingReference export type BookingReferenceResponse = BaseResponse & { booking_reference?: Partial; }; export type BookingReferencesResponse = BaseResponse & { booking_references?: Partial[]; }; // Booking export type BookingResponse = BaseResponse & { booking?: Partial; }; export type BookingsResponse = BaseResponse & { bookings?: Partial[]; }; // Credential export type CredentialResponse = BaseResponse & { credential?: Partial; }; export type CredentialsResponse = BaseResponse & { credentials?: Partial[]; }; // DailyEventReference export type DailyEventReferenceResponse = BaseResponse & { daily_event_reference?: Partial; }; export type DailyEventReferencesResponse = BaseResponse & { daily_event_references?: Partial[]; }; // DestinationCalendar export type DestinationCalendarResponse = BaseResponse & { destination_calendar?: Partial; }; export type DestinationCalendarsResponse = BaseResponse & { destination_calendars?: Partial[]; }; // Membership export type MembershipResponse = BaseResponse & { membership?: Partial; }; export type MembershipsResponse = BaseResponse & { memberships?: Partial[]; }; // EventTypeCustomInput export type EventTypeCustomInputResponse = BaseResponse & { event_type_custom_input?: Partial; }; export type EventTypeCustomInputsResponse = BaseResponse & { event_type_custom_inputs?: Partial[]; }; // From rrule https://jakubroztocil.github.io/rrule freq export enum Frequency { "YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY", } interface EventTypeExtended extends Omit { recurringEvent: { dtstart?: Date | undefined; interval?: number | undefined; count?: number | undefined; freq?: Frequency | undefined; until?: Date | undefined; tzid?: string | undefined; } | null; locations: | { link?: string | undefined; address?: string | undefined; hostPhoneNumber?: string | undefined; type: DefaultLocationType | AppStoreLocationType; }[] | null; } // EventType export type EventTypeResponse = BaseResponse & { event_type?: Partial; }; export type EventTypesResponse = BaseResponse & { event_types?: Partial[]; }; // Payment export type PaymentResponse = BaseResponse & { payment?: Partial; }; export type PaymentsResponse = BaseResponse & { payments?: Partial[]; }; // Schedule export type ScheduleResponse = BaseResponse & { schedule?: Partial; }; export type SchedulesResponse = BaseResponse & { schedules?: Partial[]; }; // Webhook export type WebhookResponse = BaseResponse & { webhook?: Partial | null; }; export type WebhooksResponse = BaseResponse & { webhooks?: Partial[]; }; // ReminderMail export type ReminderMailResponse = BaseResponse & { reminder_mail?: Partial; }; export type ReminderMailsResponse = BaseResponse & { reminder_mails?: Partial[]; };