import type { FieldSegment, RelationSegment } from '../model/implementation/collect-path.js'; import type { Field } from '../model/implementation/field.js'; import type { RelationSide } from '../model/implementation/relation.js'; import type { RootEntityType } from '../model/implementation/root-entity-type.js'; import { QueryNode } from './base.js'; import { OrderSpecification } from './lists.js'; import { EntitiesIdentifierKind } from './mutations.js'; import { VariableQueryNode } from './variables.js'; export declare class EntityFromIdQueryNode extends QueryNode { readonly rootEntityType: RootEntityType; readonly idNode: QueryNode; constructor(rootEntityType: RootEntityType, idNode: QueryNode); describe(): string; } /** * A node that evaluates in the list of entities of a given type. use ListQueryNode to further process them */ export declare class EntitiesQueryNode extends QueryNode { readonly rootEntityType: RootEntityType; constructor(rootEntityType: RootEntityType); describe(): string; } /** * A node that evaluates to the value of a field of an object, or NULL if it does not exist or objectNode does not * evaluate to an object * * Note: this is unrelated to storing the value in a property of a result object, see ObjectQueryNode */ export declare class FieldQueryNode extends QueryNode { readonly objectNode: QueryNode; readonly field: Field; constructor(objectNode: QueryNode, field: Field); describe(): string; } /** * A node that evaluates to the value of a field of an object, or NULL if it does not exist or objectNode does not * evaluate to an object * * Note: this is unrelated to storing the value in a property of a result object, see ObjectQueryNode */ export declare class FieldPathQueryNode extends QueryNode { readonly objectNode: QueryNode; readonly path: ReadonlyArray; constructor(objectNode: QueryNode, path: ReadonlyArray); describe(): string; } /** * A node that evaluates to the value of a property of an object, or NULL if it does not exist or objectNode does not * evaluate to an object * * This is equivalent to a FieldQueryNode except there does not need to be a model field. Authorization checks will not * be applied. */ export declare class PropertyAccessQueryNode extends QueryNode { readonly objectNode: QueryNode; readonly propertyName: string; constructor(objectNode: QueryNode, propertyName: string); describe(): string; } /** * A node that evaluates to the value of a property of an object, or NULL if it does not exist or objectNode does not * evaluate to an object */ export declare class DynamicPropertyAccessQueryNode extends QueryNode { readonly objectNode: QueryNode; readonly propertyNode: QueryNode; constructor(objectNode: QueryNode, propertyNode: QueryNode); describe(): string; } /** * A node that evaluates to the id of a root entity */ export declare class RootEntityIDQueryNode extends QueryNode { readonly objectNode: QueryNode; constructor(objectNode: QueryNode); describe(): string; } /** * A node that evaluates to the revision identifier of a root entity */ export declare class RevisionQueryNode extends QueryNode { readonly objectNode: QueryNode; constructor(objectNode: QueryNode); describe(): string; } /** * Evaluates to all root entities that are connected to a specific root entitity through a specific edge */ export declare class FollowEdgeQueryNode extends QueryNode { readonly relationSide: RelationSide; readonly sourceEntityNode: QueryNode; /** * A variable that identifies the target entities of this edge traversal * * It is not referenced within the query tree. Database adapters can use it to identify the * loop variable they generate for the traversal. */ readonly itemVariable: VariableQueryNode; constructor(relationSide: RelationSide, sourceEntityNode: QueryNode); protected fieldEquals(key: string, lhs: any, rhs: any): boolean; describe(): string; } export interface TraversalQueryNodeParams { readonly entitiesIdentifierKind?: EntitiesIdentifierKind; readonly sourceEntityNode: QueryNode; readonly relationSegments: ReadonlyArray; readonly fieldSegments: ReadonlyArray; /** * Specifies if sourceEntityNode resolves to a list of entities instead of a single entity */ readonly sourceIsList?: boolean; /** * Specifies if the result should be a list of one value if the path results in a single object instead of a list * * Only supported if fieldSegments is empty */ readonly alwaysProduceList?: boolean; /** * If true and this traversal results in a list, NULL values will be preserved in the list * * Note: this only exists for aggregations, so it might not work in every case * * @default false */ readonly preserveNullValues?: boolean; /** * An optional transformation (map) to apply on the traversal result */ readonly innerNode?: QueryNode; /** * The variable under which each item will be available in the innerNode */ readonly itemVariable?: VariableQueryNode; /** * The variable under which the root entity (result after relation traversal, but before child entity traversals) * will be available in the innerNode */ readonly rootEntityVariable?: VariableQueryNode; /** * An optional filter that is applied on the resulting items of the traversal * * Don't access rootEntityVariable here (if we need that, we should add a rootFilterNode that is * applied after the relation traversal but before the field traversal) */ readonly filterNode?: QueryNode; /** * An optional filter that is applied on the resulting items of the traversal * * Both item and root can be accessed here */ readonly orderBy?: OrderSpecification; /** * Number of items to skip at the start */ readonly skip?: number; /** * Maximum number of items to return */ readonly maxCount?: number; } /** * Traverses a path of relations and other fields */ export declare class TraversalQueryNode extends QueryNode { readonly entitiesIdentifierKind: EntitiesIdentifierKind; readonly sourceEntityNode: QueryNode; readonly relationSegments: ReadonlyArray; readonly fieldSegments: ReadonlyArray; /** * Specifies if sourceEntityNode resolves to a list of entities instead of a single entity */ readonly sourceIsList: boolean; /** * Specifies if the result should be a list of one value if the path results in a single object instead of a list * * Only supported if fieldSegments is empty */ readonly alwaysProduceList: boolean; /** * True if either alwaysProduceList is true or there is at least one list segment */ readonly resultIsList: boolean; /** * If true and this traversal results in a list, NULL values will be preserved in the list * * Note: this only exists for aggregations, so it might not work in every case */ readonly preserveNullValues: boolean; /** * An optional transformation (map) to apply on the traversal result */ readonly innerNode?: QueryNode; /** * An optional filter that is applied on the resulting items of the traversal * * Don't access rootEntityVariable here (if we need that, we should add a rootFilterNode that is * applied after the relation traversal but before the field traversal) */ readonly filterNode?: QueryNode; /** * An optional filter that is applied on the resulting items of the traversal * * Both item and root can be accessed here */ readonly orderBy: OrderSpecification; /** * The variable under which each item will be available in the innerNode */ readonly itemVariable: VariableQueryNode; /** * The variable under which the root entity (result after relation traversal, but before child entity traversals) * will be available in the innerNode */ readonly rootEntityVariable: VariableQueryNode; /** * Number of items to skip at the start */ readonly skip: number; /** * Maximum number of items to return */ readonly maxCount?: number; constructor(params: TraversalQueryNodeParams); describe(): string; private describeSegment; }