import { ContentFilterScalarOperator } from '../../common/constants/content.constant'; /** * A single filter condition: `field:op:value`. * * `field` is the JSONB leaf (or built-in column) addressed with its **storage * casing** and, for JSONB leaves, the `data.` prefix — e.g. `'data.symbol'`, * `'data.category'`, `'data.user_id'`. The builder does not auto-prefix * `data.` so non-JSONB columns (e.g. `'created_at'`) can also be addressed. */ export interface ContentFilterCondition { field: string; op: ContentFilterScalarOperator; /** * A `string` or `number`; numbers are stringified, never quoted. * * For the `in` operator an array of values may be supplied instead — it is * serialized comma-separated (`v1,v2,v3`), with each item quoted * individually when it contains whitespace. Arrays are only valid with * `in` and must not be empty. */ value: string | number | readonly (string | number)[]; } /** * Build an eaera-cms filter DSL string from conditions joined by ` AND `. * * @example * buildFilter([{ field: 'data.symbol', op: 'eq', value: 'EURUSD' }]) * // → 'data.symbol:eq:EURUSD' * @example * buildFilter([{ field: 'data.category', op: 'eq', value: 'CFDs on Stocks' }]) * // → 'data.category:eq:"CFDs on Stocks"' (whitespace → quoted) * @example * buildFilter([ * { field: 'data.symbol', op: 'contains', value: 'BTC' }, * { field: 'data.category', op: 'neq', value: 'Kalshi' }, * ]) * // → 'data.symbol:contains:BTC AND data.category:neq:Kalshi' * @example * buildFilter([{ field: 'data.symbol', op: 'in', value: ['EURUSD', 'XAUUSD'] }]) * // → 'data.symbol:in:EURUSD,XAUUSD' * * @returns the DSL string, or `undefined` for an empty list (so callers can * assign the result directly to a `filter?: string` param and omit it). */ export declare const buildFilter: (conditions: readonly ContentFilterCondition[]) => string | undefined; //# sourceMappingURL=filter.d.ts.map