import { Field, Relation, RootEntityType } from '../model'; import { QueryNode } from './base'; import { PropertySpecification } from './objects'; import { VariableQueryNode } from './variables'; /** * A node that creates a new entity and evaluates to that new entity object */ export declare class CreateEntityQueryNode extends QueryNode { readonly rootEntityType: RootEntityType; readonly objectNode: QueryNode; readonly affectedFields: ReadonlyArray; constructor(rootEntityType: RootEntityType, objectNode: QueryNode, affectedFields: ReadonlyArray); describe(): string; } /** * A node that creates multiple new entities of the same type and evaluates to the list of these new entity objects */ export declare class CreateEntitiesQueryNode extends QueryNode { readonly rootEntityType: RootEntityType; readonly objectsNode: QueryNode; readonly affectedFields: ReadonlyArray; constructor(rootEntityType: RootEntityType, objectsNode: QueryNode, affectedFields: ReadonlyArray); describe(): string; } /** * A node that indicates that a field of a node is set, without being evaluated */ export declare class AffectedFieldInfoQueryNode extends QueryNode { readonly field: Field; constructor(field: Field); describe(): string; } /** * A node that updates existing entities and evaluates to the ids of the updated entities * * Existing properties of the entities will be kept when not specified in the updateNode. If a property is specified * in updates and in the existing entity, it will be replaced with the PropertySpecification's value. To access the old * value of the entity within the updates, specify an oldValueVariable and use that inside the updates. Then, you can * access the old value of a field via a FieldQueryNode and use e.g. an UpdateObjectQueryNode to only modify some properties. * * FOR doc * IN $collection(objectType) * FILTER $filterNode * UPDATE doc * WITH $updateNode * IN $collection(objectType) * OPTIONS { mergeObjects: false } * * A revision can be specified, but the list should only evaluated in to at most one item in this case. If specified, * the transaction will be aborted if the revision is no longer up to date. */ export declare class UpdateEntitiesQueryNode extends QueryNode { constructor(params: { rootEntityType: RootEntityType; listNode: QueryNode; updates: ReadonlyArray; currentEntityVariable?: VariableQueryNode; affectedFields: ReadonlyArray; revision?: string; }); readonly rootEntityType: RootEntityType; readonly listNode: QueryNode; readonly updates: ReadonlyArray; readonly currentEntityVariable: VariableQueryNode; readonly affectedFields: ReadonlyArray; readonly revision?: string; describe(): string; } /** * Specifies one property of a an ObjectQueryNode, and indicates that this will set a field of an object */ export declare class SetFieldQueryNode extends PropertySpecification { readonly field: Field; readonly valueNode: QueryNode; constructor(field: Field, valueNode: QueryNode); } export declare enum EntitiesIdentifierKind { ENTITY = "ENTITY", ID = "ID" } export declare enum DeleteEntitiesResultValue { OLD_ENTITIES = "OLD_ENTITIES", COUNT = "COUNT" } /** * A node that deletes existing entities and evaluates to the entities before deletion * * Does not delete edges related to the entities. */ export declare class DeleteEntitiesQueryNode extends QueryNode { constructor(params: { readonly rootEntityType: RootEntityType; readonly listNode: QueryNode; readonly entitiesIdentifierKind?: EntitiesIdentifierKind; readonly revision?: string; readonly resultValue?: DeleteEntitiesResultValue; }); readonly rootEntityType: RootEntityType; readonly listNode: QueryNode; readonly entitiesIdentifierKind: EntitiesIdentifierKind; readonly revision?: string; readonly resultValue: DeleteEntitiesResultValue; describe(): string; } /** * A node that adds edges if they do not yet exist * * No multiplicity constraints are checked. */ export declare class AddEdgesQueryNode extends QueryNode { readonly relation: Relation; readonly edges: ReadonlyArray; constructor(relation: Relation, edges: ReadonlyArray); describe(): string; } /** * A node that removes edges if they exist */ export declare class RemoveEdgesQueryNode extends QueryNode { readonly relation: Relation; readonly edgeFilter: EdgeFilter; constructor(relation: Relation, edgeFilter: EdgeFilter); describe(): string; } /** * Checks if an edge specified by existingEdge exists. If it does, replaces it by the newEdge. If it does not, * creates newEge. * * No multiplicity constraints are checked. */ export declare class SetEdgeQueryNode extends QueryNode { constructor(params: { relation: Relation; existingEdge: PartialEdgeIdentifier; newEdge: EdgeIdentifier; }); readonly relation: Relation; readonly existingEdge: PartialEdgeIdentifier; readonly newEdge: EdgeIdentifier; describe(): string; } /** * Filters edges by from and to id (from and to are and-combined, but the individual ids are or-combined) * * If e.g. fromIDsNode is undefined, this filter applies to all edges, regardless of the from id * * fromIDsNode and toIDsNode should evaluate to a *list* of ids. * * pseudo code: from IN fromIDsNode && to IN toIDsNode */ export declare class EdgeFilter extends QueryNode { readonly fromIDsNode?: QueryNode | undefined; readonly toIDsNode?: QueryNode | undefined; constructor(fromIDsNode?: QueryNode | undefined, toIDsNode?: QueryNode | undefined); describe(): string; private describeIDs; } export declare class PartialEdgeIdentifier extends QueryNode { readonly fromIDNode?: QueryNode | undefined; readonly toIDNode?: QueryNode | undefined; constructor(fromIDNode?: QueryNode | undefined, toIDNode?: QueryNode | undefined); describe(): string; private describeNode; } export declare class EdgeIdentifier extends QueryNode { readonly fromIDNode: QueryNode; readonly toIDNode: QueryNode; constructor(fromIDNode: QueryNode, toIDNode: QueryNode); describe(): string; }