/** * The Constructive query language specification. * * Defines the shared filter, ordering, and pagination grammar used across the * stack: the generated GraphQL SDK/ORM clients, the PostGraphile connection * filters, and the SQL query builder all conform to these shapes. * * The `Filter` grammar is generic over the operand type so each layer can * constrain what a field may be compared against (plain JSON values in the * SDK, parameterized values / expressions / subqueries in SQL). */ /** Null check */ export declare const NULL_FILTER_OPERATORS: readonly ["isNull"]; export type NullFilterOperator = (typeof NULL_FILTER_OPERATORS)[number]; /** Binary comparisons */ export declare const COMPARISON_FILTER_OPERATORS: readonly ["equalTo", "notEqualTo", "lessThan", "lessThanOrEqualTo", "greaterThan", "greaterThanOrEqualTo"]; export type ComparisonFilterOperator = (typeof COMPARISON_FILTER_OPERATORS)[number]; /** IS DISTINCT FROM / IS NOT DISTINCT FROM */ export declare const DISTINCT_FILTER_OPERATORS: readonly ["distinctFrom", "notDistinctFrom"]; export type DistinctFilterOperator = (typeof DISTINCT_FILTER_OPERATORS)[number]; /** List membership */ export declare const LIST_FILTER_OPERATORS: readonly ["in", "notIn"]; export type ListFilterOperator = (typeof LIST_FILTER_OPERATORS)[number]; /** LIKE / ILIKE with caller-supplied patterns */ export declare const LIKE_FILTER_OPERATORS: readonly ["like", "notLike", "likeInsensitive", "notLikeInsensitive"]; export type LikeFilterOperator = (typeof LIKE_FILTER_OPERATORS)[number]; /** Pattern sugar — the layer builds the `%` pattern from a plain string */ export declare const PATTERN_FILTER_OPERATORS: readonly ["includes", "notIncludes", "includesInsensitive", "notIncludesInsensitive", "startsWith", "notStartsWith", "startsWithInsensitive", "notStartsWithInsensitive", "endsWith", "notEndsWith", "endsWithInsensitive", "notEndsWithInsensitive"]; export type PatternFilterOperator = (typeof PATTERN_FILTER_OPERATORS)[number]; /** Case-insensitive equality/membership variants */ export declare const INSENSITIVE_FILTER_OPERATORS: readonly ["equalToInsensitive", "notEqualToInsensitive", "distinctFromInsensitive", "notDistinctFromInsensitive", "inInsensitive", "notInInsensitive"]; export type InsensitiveFilterOperator = (typeof INSENSITIVE_FILTER_OPERATORS)[number]; /** Array containment/overlap */ export declare const ARRAY_FILTER_OPERATORS: readonly ["contains", "containedBy", "overlaps"]; export type ArrayFilterOperator = (typeof ARRAY_FILTER_OPERATORS)[number]; /** PostGIS spatial operators */ export declare const POSTGIS_FILTER_OPERATORS: readonly ["intersects", "intersects3D", "containsProperly", "coveredBy", "covers", "crosses", "disjoint", "orderingEquals", "touches", "within", "bboxIntersects2D", "bboxIntersects3D", "bboxOverlapsOrLeftOf", "bboxOverlapsOrRightOf", "bboxOverlapsOrBelow", "bboxOverlapsOrAbove", "bboxLeftOf", "bboxRightOf", "bboxBelow", "bboxAbove", "bboxContains", "bboxEquals"]; export type PostgisFilterOperator = (typeof POSTGIS_FILTER_OPERATORS)[number]; /** All supported filter operators */ export declare const FILTER_OPERATORS: readonly ["isNull", "equalTo", "notEqualTo", "lessThan", "lessThanOrEqualTo", "greaterThan", "greaterThanOrEqualTo", "distinctFrom", "notDistinctFrom", "in", "notIn", "like", "notLike", "likeInsensitive", "notLikeInsensitive", "includes", "notIncludes", "includesInsensitive", "notIncludesInsensitive", "startsWith", "notStartsWith", "startsWithInsensitive", "notStartsWithInsensitive", "endsWith", "notEndsWith", "endsWithInsensitive", "notEndsWithInsensitive", "equalToInsensitive", "notEqualToInsensitive", "distinctFromInsensitive", "notDistinctFromInsensitive", "inInsensitive", "notInInsensitive", "contains", "containedBy", "overlaps", "intersects", "intersects3D", "containsProperly", "coveredBy", "covers", "crosses", "disjoint", "orderingEquals", "touches", "within", "bboxIntersects2D", "bboxIntersects3D", "bboxOverlapsOrLeftOf", "bboxOverlapsOrRightOf", "bboxOverlapsOrBelow", "bboxOverlapsOrAbove", "bboxLeftOf", "bboxRightOf", "bboxBelow", "bboxAbove", "bboxContains", "bboxEquals"]; export type FilterOperator = (typeof FILTER_OPERATORS)[number]; export declare function isFilterOperator(op: string): op is FilterOperator; /** Boolean combinators */ export declare const LOGICAL_OPERATORS: readonly ["and", "or", "not"]; export type LogicalOperator = (typeof LOGICAL_OPERATORS)[number]; export declare function isLogicalOperator(op: string): op is LogicalOperator; /** * Filter on a single field. * * Generic over the operand type: the SDK uses plain JSON values, the SQL * layer additionally allows expressions and subqueries. */ export type FieldFilter = { [K in FilterOperator]?: TOperand; }; /** * Filter on related records (GraphQL/ORM layer semantics). */ export interface RelationalFilter { /** All related records must match */ every?: Filter; /** At least one related record must match */ some?: Filter; /** No related records match */ none?: Filter; } /** * The main filter type. Sibling keys combine with AND; `or`/`not` * introduce disjunction and negation. Nestable arbitrarily. */ export interface Filter { [field: string]: FieldFilter | RelationalFilter | Filter | Filter[] | undefined; and?: Filter[]; or?: Filter[]; not?: Filter; } export type OrderDirection = 'asc' | 'desc'; /** Single order by specification */ export interface OrderByItem { field: string; direction: OrderDirection; } /** Relay-style pagination info */ export interface PageInfo { hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: string | null; endCursor?: string | null; } /** Relay-style connection result */ export interface ConnectionResult { nodes: T[]; totalCount: number; pageInfo: PageInfo; }