/** Keep in sync with api/src/controllers/base-controller.ts#ModelOrder */ export type ModelOrder = | [string, string] | [string, string, string] | [string, string, string, string] | [string, string, string, string, string] | [string, string, string, string, string, string] export type Policy = { show: boolean create: boolean update: boolean destroy: boolean } export type WhereOptions = { [K in Attributes]?: Model[K] | Model[K][] } export type FiltersOptions = Partial export type QueryOptions = Partial<{ where: WhereOptions filters: FiltersOptions order: ModelOrder[] page: number perPage: number }> // Keep in sync with api/src/controllers/base-controller.ts export const MAX_PER_PAGE = 1000 export type ApiResponseError = { field?: string; text: string } export type ApiResponseLegacy = { data: T errors: ApiResponseError[] messages?: string[] } export type ApiResponse = { errors: ApiResponseError[] messages?: string[] } & TPayload