import { Class } from '@spinajs/di'; import { ModelBase, SelectQueryBuilder, SortOrder, WhereFunction } from '@spinajs/orm'; export declare class JsonApiIncomingObject { data: { type: string; id: string; attributes: any; relationships: any; }; constructor(data: any); } export interface ITransformOptions { totalCount?: number; currentPage?: number; order?: SortOrder; orderBy?: string; perPage?: number; model: Class>; } export interface IColumnFilter { column?: string; operators: FilterableOperators[]; query?: (operator: FilterableOperators, value: any) => WhereFunction; } export interface IFilter { Column: string; Operator: FilterableOperators; Value: any; } export interface IFilterRequest { op: FilterableLogicalOperators; filters: IFilter[]; } export declare enum FilterableLogicalOperators { And = "and", Or = "or" } export interface FromModelOptions { /** * Optiona route/param/body field for primary key * If not set , route param is used */ paramField?: string; /** * Optional field for db quuery search */ queryField?: string; /** * From where to get primary key value * Eg. body, query, param, header etc. * * If not set, param is used */ paramType?: string; /** * Sometimes we want to skip include relations eg. when we dont want to * load relations when getting another model in route */ noInclude?: boolean; /** * Optional list of relations to include always when loading model */ include?: string[]; /** * * Callback on query builder before model is fetched from DB * * It allows to modify query with data passed to route. * If not set it check for include, model owner ( if has @BelongsTo field marked) etc. * * @param this * @param routeParams passed route params to query * @returns */ query?: (this: SelectQueryBuilder, routeParams: any, value: any) => SelectQueryBuilder; } export type FilterableOperators = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'in' | 'nin' | 'between' | 'isnull' | 'notnull' | 'notbetween' | 'b-like' | 'e-like' | 'exists' | 'n-exists' | 'regexp'; //# sourceMappingURL=interfaces.d.ts.map