cal.pub0.org/lib/types.ts

39 lines
869 B
TypeScript
Raw Normal View History

import { User, ApiKey, Team, SelectedCalendar } 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;
};
// User
export type UserResponse = BaseResponse & {
data?: Partial<User>;
};
export type UsersResponse = BaseResponse & {
data?: Partial<User>[];
};
// API Key
export type ApiKeyResponse = BaseResponse & {
data?: Partial<ApiKey>;
};
export type ApiKeysResponse = BaseResponse & {
data?: Partial<ApiKey>[];
};
// API Key
export type TeamResponse = BaseResponse & {
data?: Partial<Team>;
};
export type TeamsResponse = BaseResponse & {
data?: Partial<Team>[];
};
// API Key
export type SelectedCalendarResponse = BaseResponse & {
data?: Partial<SelectedCalendar>;
};
export type SelectedCalendarsResponse = BaseResponse & {
data?: Partial<SelectedCalendar>[];
};