import _ from 'lodash';
import { AKRegexListFilter } from './regex.js';
import { AKRelationListFilter } from './relation.js';
import { AKSuffixListFilter } from './suffix.js';
export const genericListFilters = [
    new AKSuffixListFilter(`like`, (q, field, value) => q.whereLike(field, `%${value}%`)),
    new AKSuffixListFilter(`ilike`, (q, field, value) => q.whereILike(field, `%${value}%`)),
    new AKSuffixListFilter(`gt`, (q, field, value) => q.where(field, '>', value)),
    new AKSuffixListFilter(`gte`, (q, field, value) => q.where(field, '>=', value)),
    new AKSuffixListFilter(`lt`, (q, field, value) => q.where(field, '<', value)),
    new AKSuffixListFilter(`lte`, (q, field, value) => q.where(field, '<=', value)),
    new AKSuffixListFilter(`in`, (q, field, value) => q.whereIn(field, _.isArray(value) ? value : [value])),
    new AKSuffixListFilter(`day`, (q, field, value) => q.whereRaw(`DATE(${field}) = ?`, [value.split('T')[0]])),
    new AKRegexListFilter(/^(?!.*__).*$/, (q, field, value) => q.where(field, '=', value)),
    new AKRelationListFilter(),
];
//# sourceMappingURL=generic.js.map