import { type IncomingMessage, type ServerResponse } from "node:http"; import { DKGAgent } from '@origintrail-official/dkg-agent'; import { type ApiQueryPriority } from '../api-query-priority.js'; export { configureApiQueryPriority, resolveApiQueryPriority, } from '../api-query-priority.js'; export type { ApiQueryPriority } from '../api-query-priority.js'; import { type CatchupTracker } from '../types.js'; import { type RequestContext } from './context.js'; import { type ContextGraphFollowCaller } from '../context-graph-subscription-admission.js'; import { type StoreQueryRequestLifecycle } from '../store-query-lifecycle.js'; export interface ApiQueryRequestLifecycle extends StoreQueryRequestLifecycle { readonly priority: ApiQueryPriority; readonly source: 'api.query'; } /** * Own the HTTP-disconnect signal and the exact store-admission options passed * by `/api/query`. Exported so the route boundary can be tested without * replacing the real query engine with a hand-typed error stub. */ export declare function createApiQueryRequestLifecycle(req: IncomingMessage, res: ServerResponse): ApiQueryRequestLifecycle; type LegacyApiQueryResult = { bindings: Array>; quads?: Array<{ subject: string; predicate: string; object: string; graph: string; }>; }; export type PublicApiQueryResult = import('@origintrail-official/dkg-core').PublicQueryResult, { subject: string; predicate: string; object: string; graph: string; }>; /** Normalize the legacy engine shape at the public daemon boundary. */ export declare function normalizePublicApiQueryResult(sparql: string, result: LegacyApiQueryResult): PublicApiQueryResult; /** * The latest catch-up job for a Context Graph id that `caller` may see. The * id as given wins; an on-chain id (`32`, `#32`) then finds the job of the row * it names, under its cleartext id or its name hash (adoption can move a job * between the two). A job names its graph, so a job that names a cleartext id * the caller did not give is returned only to a caller who may follow the id * there: an on-chain id that finds a cleartext row, or a name hash this node * resolved. A refusal returns `undefined`, which the route answers exactly as * an id with no job. */ export declare function latestCatchupJobIdFor(agent: DKGAgent, catchupTracker: CatchupTracker, contextGraphId: string, caller: ContextGraphFollowCaller): Promise; export declare function handleQueryRoutes(ctx: RequestContext): Promise; //# sourceMappingURL=query.d.ts.map