@rushdb/javascript-sdk 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/expressions.d.ts +16 -13
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { PROPERTY_TYPE_BOOLEAN, PROPERTY_TYPE_DATETIME, PROPERTY_TYPE_NULL, PROPERTY_TYPE_NUMBER, PROPERTY_TYPE_STRING, PROPERTY_TYPE_VECTOR } from '../common/constants.js';
|
|
2
2
|
import type { MaybeArray, RequireAtLeastOne } from './utils.js';
|
|
3
|
-
import type { BooleanValue, DatetimeObject, DatetimeValue, NullValue, NumberValue, StringValue } from './value.js';
|
|
4
|
-
export type DatetimeExpression = DatetimeValue | RequireAtLeastOne<Record<'$gt' | '$gte' | '$lt' | '$lte' | '$ne', DatetimeObject | DatetimeValue> & Record<'$in' | '$nin', Array<DatetimeObject | DatetimeValue
|
|
5
|
-
export type BooleanExpression = BooleanValue | Record<'$ne', BooleanValue>;
|
|
6
|
-
export type NullExpression = NullValue | Record<'$ne', NullValue>;
|
|
7
|
-
export type NumberExpression = NumberValue | RequireAtLeastOne<Record<'$gt' | '$gte' | '$lt' | '$lte' | '$ne', NumberValue> & Record<'$in' | '$nin', Array<NumberValue
|
|
8
|
-
export type StringExpression = StringValue | RequireAtLeastOne<Record<'$contains' | '$endsWith' | '$ne' | '$startsWith', StringValue> & Record<'$in' | '$nin', Array<StringValue
|
|
3
|
+
import type { BooleanValue, DatetimeObject, DatetimeValue, NullValue, NumberValue, PropertyType, StringValue } from './value.js';
|
|
4
|
+
export type DatetimeExpression = DatetimeValue | RequireAtLeastOne<Record<'$gt' | '$gte' | '$lt' | '$lte' | '$ne', DatetimeObject | DatetimeValue> & Record<'$in' | '$nin', Array<DatetimeObject | DatetimeValue>> & Record<'$exists', BooleanValue>>;
|
|
5
|
+
export type BooleanExpression = BooleanValue | Record<'$ne' | '$exists', BooleanValue>;
|
|
6
|
+
export type NullExpression = NullValue | Record<'$ne' | '$exists', NullValue | BooleanValue>;
|
|
7
|
+
export type NumberExpression = NumberValue | RequireAtLeastOne<Record<'$gt' | '$gte' | '$lt' | '$lte' | '$ne', NumberValue> & Record<'$in' | '$nin', Array<NumberValue>> & Record<'$exists', BooleanValue>>;
|
|
8
|
+
export type StringExpression = StringValue | RequireAtLeastOne<Record<'$contains' | '$endsWith' | '$ne' | '$startsWith', StringValue> & Record<'$in' | '$nin', Array<StringValue>> & Record<'$exists', BooleanValue>>;
|
|
9
9
|
export type VectorSearchFn = 'jaccard' | 'overlap' | 'cosine' | 'pearson' | 'euclideanDistance' | 'euclidean';
|
|
10
10
|
export type VectorExpression = {
|
|
11
11
|
$vector: {
|
|
@@ -14,14 +14,17 @@ export type VectorExpression = {
|
|
|
14
14
|
threshold: number | RequireAtLeastOne<Record<'$gt' | '$gte' | '$lt' | '$lte' | '$ne', number>>;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type TypeExpression = {
|
|
18
|
+
$type: PropertyType;
|
|
19
|
+
};
|
|
20
|
+
export type PropertyExpression = BooleanExpression | DatetimeExpression | NullExpression | NumberExpression | StringExpression | TypeExpression | VectorExpression;
|
|
18
21
|
export type PropertyExpressionByType = {
|
|
19
|
-
[PROPERTY_TYPE_BOOLEAN]: BooleanExpression;
|
|
20
|
-
[PROPERTY_TYPE_DATETIME]: DatetimeExpression;
|
|
21
|
-
[PROPERTY_TYPE_NULL]: NullExpression;
|
|
22
|
-
[PROPERTY_TYPE_NUMBER]: NumberExpression;
|
|
23
|
-
[PROPERTY_TYPE_STRING]: StringExpression;
|
|
24
|
-
[PROPERTY_TYPE_VECTOR]: VectorExpression;
|
|
22
|
+
[PROPERTY_TYPE_BOOLEAN]: BooleanExpression | TypeExpression;
|
|
23
|
+
[PROPERTY_TYPE_DATETIME]: DatetimeExpression | TypeExpression;
|
|
24
|
+
[PROPERTY_TYPE_NULL]: NullExpression | TypeExpression;
|
|
25
|
+
[PROPERTY_TYPE_NUMBER]: NumberExpression | TypeExpression;
|
|
26
|
+
[PROPERTY_TYPE_STRING]: StringExpression | TypeExpression;
|
|
27
|
+
[PROPERTY_TYPE_VECTOR]: VectorExpression | TypeExpression;
|
|
25
28
|
};
|
|
26
29
|
export type LogicalGrouping<T> = Partial<{
|
|
27
30
|
$and: MaybeArray<T>;
|