import { FilterAst } from "./shared/ast.mjs"; import { IndexCondition, NativePagination } from "./filters.mjs"; import { PageCompleteness } from "../zod-table.mjs"; import { RelationEdge } from "../relations.mjs"; import { QueryInput, StoredConstraint, createPlanner } from "./planner.mjs"; import { CursorBinding, createCursorCodec } from "./cursors.mjs"; import { ExecutionRequest } from "./execution.mjs"; import { GenericSchema, SchemaDefinition } from "convex/server"; import { GenericId, Value } from "convex/values"; //#region src/querying/relationships.d.ts export interface OutputSelection { [name: string]: true | OutputSelection; } export type ResolvedGroups = { fieldGroups: Record; relations: Record; }; export interface GroupAccess { at(path: readonly string[]): ResolvedGroups; allowed(path: readonly string[]): readonly string[]; checkOrder(table: string, fields: readonly string[], path?: readonly string[]): void; } type Edge = RelationEdge; export type RelationDocument = Record & { _id: GenericId; _creationTime: number; }; type Document = RelationDocument; type Planner = ReturnType; export declare class RelationshipError extends Error { readonly code: 'AMBIGUOUS_RELATION' | 'INVALID_RELATION'; constructor(code: 'AMBIGUOUS_RELATION' | 'INVALID_RELATION'); } /** The selection has already passed the registry validator; count leaf edges too. */ export declare function assertRelationshipDepth(selection: OutputSelection, depth: number): void; /** One request owns all traversal and authorized ID memoization. No raw reader escapes. */ export declare function relationshipExecutor(schema: SchemaDefinition, request: ExecutionRequest, planner: Planner, codec: ReturnType, rootBinding: CursorBinding, groups?: GroupAccess): { matches: (table: string, parent: Document, ast: FilterAst, depth?: number) => Promise; output: (table: string, parent: Document, selection: OutputSelection, args: NativePagination & { order?: 'asc' | 'desc'; }, path?: readonly string[], depth?: number, parents?: readonly string[]) => Promise>; continuation: (rootTable: string, rootId: string, path: readonly string[], selection: OutputSelection, input: QueryInput, conditions: readonly IndexCondition[], constraints: readonly StoredConstraint[], ordering?: string) => Promise<{ page: Record[]; isDone: boolean; splitCursor?: import("convex/server").Cursor | null; pageStatus?: "SplitRecommended" | "SplitRequired" | null; paginationMode?: 'native-search'; completeness: PageCompleteness; continueCursor: string; }>; edge: (table: string, name: string) => Edge; preflight: (table: string, selection: OutputSelection, input: QueryInput, path?: readonly string[]) => void; }; //#endregion //# sourceMappingURL=relationships.d.mts.map