UNPKG

@unito/integration-sdk

Version:

Integration SDK

26 lines (25 loc) 709 B
import { OperatorType } from '@unito/integration-api'; import { Request, Response, NextFunction } from 'express'; declare global { namespace Express { interface Locals { filters: Filter[]; } } } /** * Represents one filter parsed from the filters query param. * * Given a filters query param containing: * `filters=[...],name=John,[...]` * * Filter for `name=John` will be: * `{ field: 'name', operator: 'EQUAL', values: ['John'] }` */ export type Filter = { field: string; operator: OperatorType; values: string[] | undefined; }; declare function extractFilters(req: Request, res: Response, next: NextFunction): void; export default extractFilters;