/** * Type definitions for custom query configuration * Used in databridge.queries.ts files */ import { PrismaClient } from './prisma-client.js'; export { PrismaClient } from './prisma-client.js'; export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; export type ParamType = 'string' | 'number' | 'boolean'; export interface ParamDefinition { type: ParamType; required?: boolean; description?: string; default?: any; min?: number; max?: number; enum?: readonly string[]; format?: 'date' | 'date-time' | 'email' | 'uuid'; } export interface ArrayParamDefinition extends Omit { type: 'array'; items: Record; } export type AnyParamDefinition = ParamDefinition | ArrayParamDefinition; export interface QueryContext, TQuery = Record, TBody = Record> { params: TParams; query: TQuery; body: TBody; user?: any; } export interface AuthConfig { required: boolean; roles?: string[]; } export interface QueryDefinition, TQuery = Record, TBody = Record, TResponse = any> { method: HttpMethod; path: string; description?: string; tags?: string[]; params?: Record; query?: Record; body?: Record | ArrayParamDefinition; auth?: AuthConfig; handler: (prisma: PrismaClient, context: QueryContext) => Promise | TResponse; responseType?: string; statusCode?: number; } export type QueryDefinitions = Record; /** * Helper function to define queries with type inference */ export declare function defineQueries(queries: T): T; /** * Metadata about a parsed query */ export interface ParsedQuery { name: string; method: HttpMethod; path: string; description?: string; tags: string[]; params: Record; query: Record; body?: Record | ArrayParamDefinition; auth?: AuthConfig; handler: string; responseType?: string; statusCode: number; } //# sourceMappingURL=custom-queries.d.ts.map