@saulx/selva
Advanced tools
Comparing version 11.0.2 to 11.1.0
@@ -5,3 +5,3 @@ import { Id } from '../schema/index'; | ||
$field: string; | ||
$operator: '=' | '>' | '<' | '..' | '!=' | 'has' | 'distance' | 'exists' | 'notExists' | 'textSearch'; | ||
$operator: '=' | '>' | '<' | '..' | '!=' | 'has' | 'includes' | 'distance' | 'exists' | 'notExists' | 'textSearch'; | ||
$value?: Value; | ||
@@ -42,3 +42,3 @@ hasNow?: true; | ||
export declare type Filter = ExistsFilter | GeoFilter | { | ||
$operator: '=' | '!=' | '>' | '<' | '..' | 'has' | 'textSearch'; | ||
$operator: '=' | '!=' | '>' | '<' | '..' | 'has' | 'includes' | 'textSearch'; | ||
$field: string; | ||
@@ -45,0 +45,0 @@ $value: string | number | (string | number)[]; |
@@ -22,6 +22,6 @@ "use strict"; | ||
} | ||
or for geo filters | ||
{ | ||
{ | ||
$operator: 'distance' | ||
@@ -54,12 +54,16 @@ $field: string | ||
(0, util_1.validateFieldPath)(filter.$field); | ||
if (filter.$operator !== '=' && | ||
filter.$operator !== '!=' && | ||
filter.$operator !== '>' && | ||
filter.$operator !== '<' && | ||
filter.$operator !== '..' && | ||
filter.$operator !== 'has' && | ||
filter.$operator !== 'distance' && | ||
filter.$operator !== 'exists' && | ||
filter.$operator !== 'notExists' && | ||
filter.$operator !== 'textSearch') { | ||
const ops = new Set([ | ||
'=', | ||
'!=', | ||
'>', | ||
'<', | ||
'..', | ||
'has', | ||
'includes', | ||
'distance', | ||
'exists', | ||
'notExists', | ||
'textSearch', | ||
]); | ||
if (!ops.has(filter.$operator)) { | ||
err(`Unsupported $operator ${filter.$operator}, has to be one of =, !=, >, <, .., distance, exists, notExists`); | ||
@@ -66,0 +70,0 @@ } |
{ | ||
"name": "@saulx/selva", | ||
"version": "11.0.2", | ||
"version": "11.1.0", | ||
"main": "dist/src/index.js", | ||
@@ -53,3 +53,3 @@ "scripts": { | ||
"@types/pg": "^8.6.1", | ||
"@saulx/selva-server": "11.0.2", | ||
"@saulx/selva-server": "11.1.0", | ||
"before-exit": "1.0.0", | ||
@@ -56,0 +56,0 @@ "async-exec": "^1.1.0", |
Sorry, the diff of this file is not supported yet
16378
1183221