/** * Operators for where clauses */ export declare enum Operators { eq = 0, neq = 1, gt = 2, gte = 3, lt = 4, lte = 5, inq = 6, between = 7, exists = 8, and = 9, or = 10, } export interface Condition { eq?: any; neq?: any; gt?: any; get?: any; lt?: any; lte?: any; inq?: any[]; between?: any[]; exists?: boolean; and?: Where[]; or?: Where[]; } /** * Where object * * Examples: * `{afieldname: 'aName'}` * `{and: [{fieldone: 'one'}, {fieldtwo: 'two'}]}` * `{or: [{fieldone: 'one'}, {fieldtwo: 'two'}]}` */ export interface Where { and?: Where[]; or?: Where[]; [property: string]: Condition | any; } /** * Order by direction */ export declare type Direction = 'ASC' | 'DESC'; /** * Order by * * Example: * `{afieldname: 'ASC'}` */ export interface Order { [property: string]: Direction; } /** * Selection of fields * * Example: * `{afieldname: true}` */ export interface Fields { [property: string]: boolean; } /** * Inclusion of related items * * Note: scope means filter on related items * * Example: * `{relation: 'aRelationName', scope: {}}` */ export interface Inclusion { relation: string; scope: Filter; } /** * Query filter object */ export interface Filter { where?: Where; fields?: Fields; order?: Order[]; limit?: number; skip?: number; offset?: number; include?: Inclusion[]; }