Initial commit

This commit is contained in:
2026-06-24 23:47:55 -07:00
commit d134b480a0
297 changed files with 30726 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
/** 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<Model, Attributes extends keyof Model> = {
[K in Attributes]?: Model[K] | Model[K][]
}
export type FiltersOptions<Options> = Partial<Options>
export type QueryOptions<WhereOptions, FiltersOptions> = 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<T> = {
data: T
errors: ApiResponseError[]
messages?: string[]
}
export type ApiResponse<TPayload = object> = {
errors: ApiResponseError[]
messages?: string[]
} & TPayload