import { ClientContract } from "@zenstackhq/orm"; import { SchemaDef } from "@zenstackhq/orm/schema"; //#region src/types.d.ts /** * Log levels */ type LogLevel = 'debug' | 'info' | 'warn' | 'error'; /** * Logger function */ type Logger = (level: LogLevel, message: string, error?: unknown) => void; /** * Log configuration */ type LogConfig = ReadonlyArray | Logger; /** * API request context */ type RequestContext = { /** * The ZenStackClient instance */ client: ClientContract; /** * The HTTP method */ method: string; /** * The request endpoint path (excluding any prefix) */ path: string; /** * The query parameters */ query?: Record; /** * The request body object */ requestBody?: unknown; }; /** * API response */ type Response = { /** * HTTP status code */ status: number; /** * Response body */ body: unknown; }; /** * Framework-agnostic API handler. */ interface ApiHandler { /** * The schema associated with this handler. */ get schema(): Schema; /** * Logging configuration. */ get log(): LogConfig | undefined; /** * Handle an API request. */ handleRequest(context: RequestContext): Promise; } //#endregion export { Response as i, LogConfig as n, RequestContext as r, ApiHandler as t }; //# sourceMappingURL=types-DYdFPTkH.d.cts.map