import type { LibSQLDatabase } from "drizzle-orm/libsql"; import { type NewAppRequest } from "../../db/schema.js"; import type * as schema from "../../db/schema.js"; type RequestIdType = schema.AppResponse["requestId"]; type DbType = LibSQLDatabase; /** * This function executes a proxy request and returns the response or *throws* an error. */ export declare function executeProxyRequest(reqOrAppReq: NewAppRequest | Request): Promise; export declare function removeUnsupportedHeaders(headers: Record): Record; /** * Extract useful data from the error when a request fails, * and save that data in the `app_responses` table */ export declare function handleFailedRequest(db: DbType, requestId: RequestIdType, traceId: string, responseTime: number, error: unknown): Promise<{ isFailure: boolean; responseTime: number; traceId: string; requestId: number | null; failureReason: string; failureDetails: Record; }>; /** * Extract useful data from the response when a request succeeds, * and save that data in the `app_responses` table */ export declare function handleSuccessfulRequest(db: DbType, requestId: RequestIdType, duration: number, response: Awaited>, traceId: string): Promise<{ isFailure: boolean; responseStatusCode: number; responseTime: number; responseHeaders: Record; responseBody: string | null; traceId: string; }>; export {};