2022-03-30 15:37:51 +00:00
|
|
|
import {
|
|
|
|
User,
|
|
|
|
ApiKey,
|
|
|
|
Team,
|
2022-04-01 21:03:03 +00:00
|
|
|
Credential,
|
2022-03-30 15:37:51 +00:00
|
|
|
SelectedCalendar,
|
|
|
|
EventType,
|
2022-04-01 23:55:41 +00:00
|
|
|
EventTypeCustomInput,
|
2022-03-30 15:37:51 +00:00
|
|
|
Attendee,
|
|
|
|
Availability,
|
|
|
|
BookingReference,
|
|
|
|
Booking,
|
|
|
|
DailyEventReference,
|
|
|
|
Webhook,
|
|
|
|
DestinationCalendar,
|
|
|
|
Membership,
|
|
|
|
Payment,
|
|
|
|
Schedule,
|
2022-04-02 00:45:28 +00:00
|
|
|
ReminderMail,
|
2022-03-30 15:37:51 +00:00
|
|
|
} from "@calcom/prisma/client";
|
2022-03-30 12:17:55 +00:00
|
|
|
|
|
|
|
// Base response, used for all responses
|
|
|
|
export type BaseResponse = {
|
|
|
|
message?: string;
|
|
|
|
error?: Error;
|
|
|
|
};
|
2022-03-31 20:14:37 +00:00
|
|
|
|
2022-03-30 12:17:55 +00:00
|
|
|
// User
|
|
|
|
export type UserResponse = BaseResponse & {
|
|
|
|
data?: Partial<User>;
|
|
|
|
};
|
2022-03-31 20:14:37 +00:00
|
|
|
|
2022-03-30 12:17:55 +00:00
|
|
|
export type UsersResponse = BaseResponse & {
|
|
|
|
data?: Partial<User>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// API Key
|
|
|
|
export type ApiKeyResponse = BaseResponse & {
|
|
|
|
data?: Partial<ApiKey>;
|
|
|
|
};
|
|
|
|
export type ApiKeysResponse = BaseResponse & {
|
|
|
|
data?: Partial<ApiKey>[];
|
|
|
|
};
|
2022-03-30 14:56:24 +00:00
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
// Team
|
2022-03-30 14:56:24 +00:00
|
|
|
export type TeamResponse = BaseResponse & {
|
|
|
|
data?: Partial<Team>;
|
|
|
|
};
|
|
|
|
export type TeamsResponse = BaseResponse & {
|
|
|
|
data?: Partial<Team>[];
|
|
|
|
};
|
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
// SelectedCalendar
|
2022-03-30 14:56:24 +00:00
|
|
|
export type SelectedCalendarResponse = BaseResponse & {
|
|
|
|
data?: Partial<SelectedCalendar>;
|
|
|
|
};
|
|
|
|
export type SelectedCalendarsResponse = BaseResponse & {
|
|
|
|
data?: Partial<SelectedCalendar>[];
|
|
|
|
};
|
2022-03-30 15:37:51 +00:00
|
|
|
|
|
|
|
// Attendee
|
|
|
|
export type AttendeeResponse = BaseResponse & {
|
|
|
|
data?: Partial<Attendee>;
|
|
|
|
};
|
|
|
|
export type AttendeesResponse = BaseResponse & {
|
|
|
|
data?: Partial<Attendee>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Availability
|
|
|
|
export type AvailabilityResponse = BaseResponse & {
|
|
|
|
data?: Partial<Availability>;
|
|
|
|
};
|
2022-04-04 19:53:03 +00:00
|
|
|
export type AvailabilitiesResponse = BaseResponse & {
|
2022-03-30 15:37:51 +00:00
|
|
|
data?: Partial<Availability>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// BookingReference
|
|
|
|
export type BookingReferenceResponse = BaseResponse & {
|
|
|
|
data?: Partial<BookingReference>;
|
|
|
|
};
|
|
|
|
export type BookingReferencesResponse = BaseResponse & {
|
|
|
|
data?: Partial<BookingReference>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Booking
|
|
|
|
export type BookingResponse = BaseResponse & {
|
|
|
|
data?: Partial<Booking>;
|
|
|
|
};
|
|
|
|
export type BookingsResponse = BaseResponse & {
|
|
|
|
data?: Partial<Booking>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Credential
|
|
|
|
export type CredentialResponse = BaseResponse & {
|
|
|
|
data?: Partial<Credential>;
|
|
|
|
};
|
|
|
|
export type CredentialsResponse = BaseResponse & {
|
|
|
|
data?: Partial<Credential>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// DailyEventReference
|
|
|
|
export type DailyEventReferenceResponse = BaseResponse & {
|
|
|
|
data?: Partial<DailyEventReference>;
|
|
|
|
};
|
|
|
|
export type DailyEventReferencesResponse = BaseResponse & {
|
|
|
|
data?: Partial<DailyEventReference>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// DestinationCalendar
|
|
|
|
export type DestinationCalendarResponse = BaseResponse & {
|
|
|
|
data?: Partial<DestinationCalendar>;
|
|
|
|
};
|
|
|
|
export type DestinationCalendarsResponse = BaseResponse & {
|
|
|
|
data?: Partial<DestinationCalendar>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Membership
|
|
|
|
export type MembershipResponse = BaseResponse & {
|
|
|
|
data?: Partial<Membership>;
|
|
|
|
};
|
|
|
|
export type MembershipsResponse = BaseResponse & {
|
|
|
|
data?: Partial<Membership>[];
|
|
|
|
};
|
|
|
|
|
2022-04-01 23:55:41 +00:00
|
|
|
// EventTypeCustomInput
|
|
|
|
export type EventTypeCustomInputResponse = BaseResponse & {
|
|
|
|
data?: Partial<EventTypeCustomInput>;
|
|
|
|
};
|
|
|
|
export type EventTypeCustomInputsResponse = BaseResponse & {
|
|
|
|
data?: Partial<EventTypeCustomInput>[];
|
|
|
|
};
|
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
// EventType
|
|
|
|
export type EventTypeResponse = BaseResponse & {
|
|
|
|
data?: Partial<EventType>;
|
|
|
|
};
|
|
|
|
export type EventTypesResponse = BaseResponse & {
|
|
|
|
data?: Partial<EventType>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Payment
|
|
|
|
export type PaymentResponse = BaseResponse & {
|
|
|
|
data?: Partial<Payment>;
|
|
|
|
};
|
|
|
|
export type PaymentsResponse = BaseResponse & {
|
|
|
|
data?: Partial<Payment>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Schedule
|
|
|
|
export type ScheduleResponse = BaseResponse & {
|
|
|
|
data?: Partial<Schedule>;
|
|
|
|
};
|
|
|
|
export type SchedulesResponse = BaseResponse & {
|
|
|
|
data?: Partial<Schedule>[];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Webhook
|
|
|
|
export type WebhookResponse = BaseResponse & {
|
|
|
|
data?: Partial<Webhook>;
|
|
|
|
};
|
|
|
|
export type WebhooksResponse = BaseResponse & {
|
|
|
|
data?: Partial<Webhook>[];
|
|
|
|
};
|
2022-04-02 00:45:28 +00:00
|
|
|
|
|
|
|
// ReminderMail
|
|
|
|
export type ReminderMailResponse = BaseResponse & {
|
|
|
|
data?: Partial<ReminderMail>;
|
|
|
|
};
|
|
|
|
export type ReminderMailsResponse = BaseResponse & {
|
|
|
|
data?: Partial<ReminderMail>[];
|
|
|
|
};
|