@rushdb/javascript-sdk 2.8.0 → 2.9.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/query.d.ts +25 -1
- package/package.json +1 -1
package/dist/types/query.d.ts
CHANGED
|
@@ -2,10 +2,34 @@ import type { Model, RelationOptions } from '../sdk/index.js';
|
|
|
2
2
|
import type { BooleanExpression, DatetimeExpression, LogicalGrouping, NullExpression, NumberExpression, PropertyExpression, PropertyExpressionByType, StringExpression } from './expressions.js';
|
|
3
3
|
import type { Schema } from './schema.js';
|
|
4
4
|
import type { AnyObject, MaybeArray, RequireAtLeastOne } from './utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* Variable-length traversal depth for `$relation.hops`.
|
|
7
|
+
* A number matches exactly that many hops; `{ min?, max? }` matches a range
|
|
8
|
+
* (`min` defaults to 1, or 2 inside a `$cycle` block). Omitting `max` requests
|
|
9
|
+
* unbounded traversal, which is only allowed on self-hosted deployments and
|
|
10
|
+
* projects with a custom Neo4j instance.
|
|
11
|
+
*/
|
|
12
|
+
export type TraversalHops = number | {
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Relationship constraints for a traversal block in `where`.
|
|
18
|
+
* Extends {@link RelationOptions} with variable-length traversal support.
|
|
19
|
+
*/
|
|
20
|
+
export type TraversalRelationOptions = RelationOptions & {
|
|
21
|
+
hops?: TraversalHops;
|
|
22
|
+
};
|
|
5
23
|
export type Related<M extends Record<string, Model['schema']> = Models> = keyof M extends never ? AnyObject : {
|
|
6
24
|
[Key in keyof M]?: {
|
|
7
25
|
$alias?: string;
|
|
8
|
-
$relation?:
|
|
26
|
+
$relation?: TraversalRelationOptions | string;
|
|
27
|
+
/**
|
|
28
|
+
* Matches records sitting on a closed path (cycle/ring) back to the
|
|
29
|
+
* parent record. Requires `$relation` with `hops` (`min` ≥ 2); accepts
|
|
30
|
+
* no other keys — a cycle has no separate endpoint to filter or alias.
|
|
31
|
+
*/
|
|
32
|
+
$cycle?: boolean;
|
|
9
33
|
} & Where<M[Key]>;
|
|
10
34
|
};
|
|
11
35
|
export type LogicalExpressionValue<T = PropertyExpression & Related> = AndExpression<T> | NorExpression<T> | NotExpression<T> | OrExpression<T> | T | XorExpression<T>;
|