export type ResourceField = { name: string; type: "string" | "number" | "boolean" | "object" | "array" | "date"; required?: boolean; defaultValue?: unknown; description?: string; }; export type Relationship = { type: "belongsTo" | "hasOne" | "hasMany" | "manyToMany"; resource: string; foreignKey: string; targetKey?: string; through?: string; }; export type Resource = { name: string; primaryKey?: string; fields: ResourceField[]; relationships?: Relationship[]; initialData?: Record[]; }; export type AuthConfig = { enabled: boolean; tokenExpiration?: number; authEndpoint?: string; secretKey?: string; tokenHeader?: string; users?: Array<{ username: string; password: string; role?: string; }>; }; export type LatencyConfig = { enabled: boolean; fixed?: number; min?: number; max?: number; }; export type ErrorSimulationConfig = { enabled: boolean; rate?: number; statusCodes?: number[]; queryParamTrigger?: string; }; export type ApiOptions = { port?: number; host?: string; corsEnabled?: boolean; auth?: AuthConfig; latency?: LatencyConfig; errorSimulation?: ErrorSimulationConfig; dbPath?: string; logRequests?: boolean; logMaxEntries?: number; allowPartialResponses?: boolean; defaultPageSize?: number; maxPageSize?: number; }; export type ApiConfig = { resources: Resource[]; options?: ApiOptions; data?: Record[]>; };