/** * Type definitions for custom schema configuration * Used in databridge.schemas.ts files */ import { PrismaClient } from './prisma-client.js'; export { PrismaClient } from './prisma-client.js'; export type FieldType = 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array'; export interface ComputedFieldDefinition { compute: (model: TModel, prisma?: PrismaClient) => Promise | TResult; type: FieldType; description?: string; } export interface RenamedFieldDefinition { from: string; transform?: (value: any) => any; type: FieldType; description?: string; } export interface RelationFieldDefinition { include: boolean; shape?: string; select?: string[]; where?: Record; } export type FieldDefinition = boolean | ComputedFieldDefinition | RenamedFieldDefinition | RelationFieldDefinition; export interface SchemaDefinition { from: string; description?: string; fields: Record; } export type SchemaDefinitions = Record; /** * Helper function to define schemas with type inference */ export declare function defineSchemas(schemas: T): T; /** * Metadata about a parsed schema */ export interface ParsedSchema { name: string; sourceModel: string; description?: string; fields: ParsedSchemaField[]; } export interface ParsedSchemaField { name: string; type: 'include' | 'exclude' | 'computed' | 'renamed' | 'relation'; fieldType: FieldType; sourceField?: string; computeFunction?: string; transformFunction?: string; relationShape?: string; relationSelect?: string[]; relationWhere?: Record; description?: string; } /** * Configuration for applying schemas to models */ export interface ModelSchemaConfig { responseSchema?: string; schemas?: { list?: string; getById?: string; create?: string; update?: string; delete?: string; }; } //# sourceMappingURL=custom-schemas.d.ts.map