type RecordData = Record<string, unknown> & {
id: string;
created_by?: string;
updated_by?: string;
created_at: string;
updated_at: string;
};
type ListResponse<T> = {
data: T[];
meta: { hasMore: boolean; cursor: string | null; total?: number };
};
type SingleResponse<T> = { data: T };
type Filter = Record<string, Partial<Record<FilterOperator, FilterValue>>>;
type FilterOperator = 'eq' | 'neq' | 'in' | 'contains' | 'gt' | 'gte' | 'lt' | 'lte';
type FilterValue = string | number | boolean | (string | number)[];
type ListOptions = {
filter?: Filter;
sort?: string;
pageSize?: number;
cursor?: string;
};
type PaginateOptions = Omit<ListOptions, 'cursor'> & {
maxPages?: number;
maxRecords?: number;
signal?: AbortSignal;
};
type SchemaEntity = {
key: string;
name: string;
display_field: string | null;
fields: SchemaField[];
};
type SchemaField = {
key: string;
name: string;
type: string;
required: boolean;
read_only: boolean;
options?: string[] | null;
sort_order: number;
};
type BootstrapData = {
user: { id: string; name: string; email: string };
role: 'viewer' | 'org_admin_viewer' | 'editor' | 'admin';
app: { id: string; name: string; type: string };
limits: Record<string, number>;
};
type FileUploadRequest = {
fieldKey: string;
fileName: string;
mimeType?: string;
sizeBytes: number;
};
type FileUploadResponse = {
fileId: string;
uploadUrl: string;
headers: Record<string, string>;
};
type FileDownloadResponse = {
url: string;
fileName: string;
mimeType: string | null;
expiresAt: string;
};