import { BaseEntity, DeleteResult } from 'typeorm'; import { JsonMap, PrimaryKey, Profile } from '../common'; import { JwtPayload, Role } from '../core/auth'; import { ColumnSchema, OriginSchema } from '../core/db'; import { AnyAuthRequest } from '../helper'; import { Tenant } from '../tenant'; export declare abstract class RestCrudController { protected module: string; protected prefix: string; protected constructor(module?: string, prefix?: string); /** * @deprecated {@see schema} * @param model */ options(model: string): ColumnSchema[]; schema(model: string): OriginSchema; unique(model: string, column: string): Promise; groupCounts(model: string, whereStr: string, column: string): Promise<{ [id: string]: { [name: string]: number; }; }>; list(admin: JwtPayload, tenant: Tenant, roles: Role[], model: string, page?: number, size?: number, profile?: Profile, fields?: string | string[], whereStr?: string, sortStr?: string, relationsStr?: string): Promise<{ query: object; items: any[]; total: number; page: number; size: number; }>; get(model: string, id: PrimaryKey, req: AnyAuthRequest, profile?: Profile, fields?: string, relationsStr?: string | string[]): Promise; delete(admin: JwtPayload, tenant: Tenant, model: string, id: PrimaryKey): Promise; save(model: string, updateTo: JsonMap, req: AnyAuthRequest): Promise; patch(admin: JwtPayload, tenant: Tenant, roles: Role[], model: string, id: PrimaryKey, updateTo: { [member: string]: any; }): Promise; }