import { GraphQLClient } from 'graphql-request'; /** * Default poll budget for deferred results (attempts × 1s). 45 finishes comfortably under the * remote proxy's 55s request deadline and the ~60s host tool-call ceiling, so the handle-bearing * timeout below reaches the caller instead of the transport aborting mid-poll. */ export declare const DEFAULT_MAX_POLL_ATTEMPTS = 45; /** * Thrown when a deferred query is still running after the poll budget is exhausted — a distinct * type so callers can tell "still running" apart from a real query error. The backend keeps * executing regardless of this client-side budget (Neo4j allows up to ~4 minutes per attempt) * and retains results at the status URL for ~1 hour, so the error carries that URL as a * resume handle. */ export declare class J1qlQueryTimeoutError extends Error { readonly resultsUrl: string; readonly correlationId?: string | undefined; /** Epoch ms when the query was initiated, when the caller knows it (execute path). */ readonly startedAt?: number | undefined; constructor(seconds: number, resultsUrl: string, correlationId?: string | undefined, /** Epoch ms when the query was initiated, when the caller knows it (execute path). */ startedAt?: number | undefined); } export declare class J1qlService { private client; private abortSignal?; constructor(client: GraphQLClient, abortSignal?: AbortSignal | undefined); /** * Construct query results URL based on subdomain */ constructQueryUrl(query: string, subdomain?: string): string; /** * Initiate a J1QL query without waiting for results. Returns the raw `queryV2` payload: for * deferred execution that is `{ type: 'deferred', url, correlationId }` where `url` is the * status/results file the backend writes to (pollable for ~1 hour); small queries may return * inline results instead. */ startJ1qlQuery({ query, variables, cursor, scopeFilters, flags, }: { query: string; variables?: Record; cursor?: string; scopeFilters?: Record[]; flags?: Record; }): Promise; /** * Poll a deferred query's status URL until it reports a terminal status or the poll budget * (attempts × 1s) is exhausted. The status file moves ENQUEUED → IN_PROGRESS → COMPLETED/FAILED; * unknown statuses are treated as still-running so a new upstream state never gets returned as * results. Budget exhaustion throws a handle-bearing J1qlQueryTimeoutError — the query itself * keeps running server-side. */ pollDeferredResult(url: string, { maxPollAttempts, correlationId, startedAt, }?: { maxPollAttempts?: number; correlationId?: string; /** Query initiation time (epoch ms), carried into the timeout error for liveness reporting. */ startedAt?: number; }): Promise; /** * Execute a J1QL query */ executeJ1qlQuery({ query, variables, cursor, scopeFilters, flags, maxPollAttempts, }: { query: string; variables?: Record; cursor?: string; scopeFilters?: Record[]; flags?: Record; maxPollAttempts?: number; }): Promise; /** * List all entity types in the account */ listEntityTypes(): Promise; } //# sourceMappingURL=j1ql-service.d.ts.map