This commit is contained in:
Adria Navarro 2024-08-05 17:21:10 +02:00
parent 0b5eb9f21c
commit 1cd3347262
2 changed files with 13 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import {
Datasource, Datasource,
DocumentType, DocumentType,
FieldType, FieldType,
LogicalOperator,
Operation, Operation,
QueryJson, QueryJson,
RelationshipFieldMetadata, RelationshipFieldMetadata,

View File

@ -23,7 +23,16 @@ export enum RangeOperator {
RANGE = "range", RANGE = "range",
} }
export type SearchFilterOperator = BasicOperator | ArrayOperator | RangeOperator export enum LogicalOperator {
AND = "$and",
OR = "$or",
}
export type SearchFilterOperator =
| BasicOperator
| ArrayOperator
| RangeOperator
| LogicalOperator
export enum InternalSearchFilterOperator { export enum InternalSearchFilterOperator {
COMPLEX_ID_OPERATOR = "_complexIdOperator", COMPLEX_ID_OPERATOR = "_complexIdOperator",
@ -76,10 +85,10 @@ export interface SearchFilters {
// specific document type (such as just rows) // specific document type (such as just rows)
documentType?: DocumentType documentType?: DocumentType
$and?: { [LogicalOperator.AND]?: {
conditions: SearchFilters[] conditions: SearchFilters[]
} }
$or?: { [LogicalOperator.OR]?: {
conditions: SearchFilters[] conditions: SearchFilters[]
} }
} }