import { InputValueDefinitionNode, DirectiveNode } from "graphql"; import { ResolveTree } from "graphql-parse-resolve-info"; import { JwtPayload } from "jsonwebtoken"; import { Driver, Integer } from "neo4j-driver"; import { Neo4jGraphQL } from "./classes"; export declare type DriverConfig = { database?: string; bookmarks?: string | string[]; }; interface AuthContext { isAuthenticated: boolean; roles: [string]; jwt: JwtPayload; } export interface Context { driver: Driver; driverConfig?: DriverConfig; resolveTree: ResolveTree; neoSchema: Neo4jGraphQL; jwt?: JwtPayload; auth?: AuthContext; queryOptions?: CypherQueryOptions; [k: string]: any; } export interface BaseAuthRule { isAuthenticated?: boolean; allowUnauthenticated?: boolean; allow?: { [k: string]: any; } | "*"; bind?: { [k: string]: any; } | "*"; where?: { [k: string]: any; } | "*"; roles?: string[]; AND?: BaseAuthRule[]; OR?: BaseAuthRule[]; } export interface AuthRule extends BaseAuthRule { operations?: AuthOperations[]; } export declare type Auth = { rules: AuthRule[]; type: "JWT"; }; export declare type FullTextIndex = { name: string; fields: string[]; defaultThreshold?: number; }; export declare type FullText = { indexes: FullTextIndex[]; }; /** * Metadata about a field.type on either * FieldDefinitionNode or InputValueDefinitionNode. */ export interface TypeMeta { name: string; array?: boolean; required: boolean; pretty: string; input: { where: { type: string; pretty: string; }; create: { type: string; pretty: string; }; update: { type: string; pretty: string; }; }; } export interface Unique { constraintName: string; } /** * Representation a ObjectTypeDefinitionNode field. */ export interface BaseField { fieldName: string; typeMeta: TypeMeta; otherDirectives: DirectiveNode[]; arguments: InputValueDefinitionNode[]; private?: boolean; auth?: Auth; description?: string; readonly?: boolean; writeonly?: boolean; ignored?: boolean; dbPropertyName?: string; unique?: Unique; } /** * Representation of the `@relationship` directive and its meta. */ export interface RelationField extends BaseField { direction: "OUT" | "IN"; type: string; allowMultiple?: boolean; connectionPrefix?: string; inherited: boolean; properties?: string; union?: UnionField; interface?: InterfaceField; } export interface ConnectionField extends BaseField { relationship: RelationField; relationshipTypeName: string; } /** * Representation of the `@cypher` directive and its meta. */ export interface CypherField extends BaseField { statement: string; } /** * Representation of any field thats not * a cypher directive or relationship directive * String, Int, Float, ID, Boolean... (custom scalars). */ export interface PrimitiveField extends BaseField { autogenerate?: boolean; defaultValue?: any; coalesceValue?: any; } export declare type CustomScalarField = BaseField; export interface CustomEnumField extends BaseField { kind: string; } export interface UnionField extends BaseField { nodes?: string[]; } export interface InterfaceField extends BaseField { implementations?: string[]; } export declare type ObjectField = BaseField; export interface TemporalField extends PrimitiveField { timestamps?: TimeStampOperations[]; } export declare type PointField = BaseField; export declare type SortDirection = "ASC" | "DESC"; export interface GraphQLSortArg { [field: string]: SortDirection; } export interface ConnectionSortArg { node?: GraphQLSortArg; edge?: GraphQLSortArg; } export interface ConnectionQueryArgs { where?: ConnectionWhereArg; first?: number; after?: string; sort?: ConnectionSortArg[]; } /** * Representation of the options arg * passed to resolvers. */ export interface GraphQLOptionsArg { limit?: number | Integer; offset?: number | Integer; sort?: GraphQLSortArg[]; } /** * Representation of the where arg * passed to resolvers. */ export interface GraphQLWhereArg { [k: string]: any | GraphQLWhereArg | GraphQLWhereArg[]; AND?: GraphQLWhereArg[]; OR?: GraphQLWhereArg[]; } export interface ConnectionWhereArg { node?: GraphQLWhereArg; node_NOT?: GraphQLWhereArg; edge?: GraphQLWhereArg; edge_NOT?: GraphQLWhereArg; AND?: ConnectionWhereArg[]; OR?: ConnectionWhereArg[]; } export interface InterfaceWhereArg { _on?: GraphQLWhereArg[]; [k: string]: any | GraphQLWhereArg | GraphQLWhereArg[]; } export declare type AuthOperations = "CREATE" | "READ" | "UPDATE" | "DELETE" | "CONNECT" | "DISCONNECT"; export declare type AuthOrders = "pre" | "post"; /** * Whats returned when deleting nodes */ export interface DeleteInfo { nodesDeleted: number; relationshipsDeleted: number; } export declare type TimeStampOperations = "CREATE" | "UPDATE"; export declare enum CypherRuntime { INTERPRETED = "interpreted", SLOTTED = "slotted", PIPELINED = "pipelined" } export declare enum CypherPlanner { COST = "cost", IDP = "idp", DP = "dp" } export declare enum CypherConnectComponentsPlanner { GREEDY = "greedy", IDP = "idp" } export declare enum CypherUpdateStrategy { DEFAULT = "default", EAGER = "eager" } export declare enum CypherExpressionEngine { DEFAULT = "default", INTERPRETED = "interpreted", COMPILED = "compiled" } export declare enum CypherOperatorEngine { DEFAULT = "default", INTERPRETED = "interpreted", COMPILED = "compiled" } export declare enum CypherInterpretedPipesFallback { DEFAULT = "default", DISABLED = "disabled", WHITELISTED_PLANS_ONLY = "whitelisted_plans_only", ALL = "all" } export declare enum CypherReplanning { DEFAULT = "default", FORCE = "force", SKIP = "skip" } export interface CypherQueryOptions { runtime?: CypherRuntime; planner?: CypherPlanner; connectComponentsPlanner?: CypherConnectComponentsPlanner; updateStrategy?: CypherUpdateStrategy; expressionEngine?: CypherExpressionEngine; operatorEngine?: CypherOperatorEngine; interpretedPipesFallback?: CypherInterpretedPipesFallback; replan?: CypherReplanning; } /** Nested Records helper type, supports any level of recursion. Ending in properties of type T */ export interface NestedRecord extends Record> { } export {}; //# sourceMappingURL=types.d.ts.map