import { AthenaTableQueryClient, AthenaTableQueryDefinition } from './table-query-executor.js'; export interface AthenaTableQueryRouteBody { page?: number; pageSize?: number; query?: AthenaTableQueryDefinition; } export interface AthenaTableQueryRouteAuthorizeContext { body: AthenaTableQueryRouteBody; query: AthenaTableQueryDefinition; request: Request; } export interface CreateAthenaTableQueryRouteOptions { /** * Return true to allow the query. Default allows all (not recommended for * production proxies — pass session checks and table allowlists). */ authorize?: (context: AthenaTableQueryRouteAuthorizeContext) => boolean | Promise; defaultPageSize?: number; /** * Build a request-scoped Athena client (cookies/session/scope applied). * Called only after body validation and successful authorization. */ getClient: (request: Request, body: AthenaTableQueryRouteBody) => AthenaTableQueryClient | Promise; maxPageSize?: number; /** Optional extra validation after structural parse (e.g. table allowlist). */ validateQuery?: (query: AthenaTableQueryDefinition, request: Request) => AthenaTableQueryDefinition | null | Promise; } /** * Structural validation of a portable table query definition. * Does not authorize or check table allowlists — use `validateQuery` / `authorize`. */ export declare function isAthenaTableQueryDefinition(value: unknown): value is AthenaTableQueryDefinition; /** * Handle `POST` for a table-query data proxy. */ export declare function handleAthenaTableQueryPost(request: Request, options: CreateAthenaTableQueryRouteOptions): Promise; /** * Create App Router handlers for a portable Athena table-query proxy. * * @example * ```ts * // app/api/data/[...all]/route.ts * import { createAthenaTableQueryRoute } from "@xylex-group/athena-auth-ui/tables" * import { createAthenaServerClient } from "@xylex-group/athena/next/server" * * export const dynamic = "force-dynamic" * export const { POST } = createAthenaTableQueryRoute({ * authorize: async ({ request }) => Boolean(request.headers.get("cookie")), * getClient: async () => * createAthenaServerClient({ * url: process.env.ATHENA_URL!, * key: process.env.ATHENA_API_KEY!, * }), * }) * ``` */ export declare function createAthenaTableQueryRoute(options: CreateAthenaTableQueryRouteOptions): { POST: (request: Request) => Promise; };