/** * Data API Builder (DAB) configuration generator * * Converts analyzed TypeScript entities into complete DAB configuration JSON. * Handles relationships, permissions, x-schema generation, and multi-dialect support. */ import { PermissionAction } from '..'; import { Dialect } from './dialect-config.js'; import { EntityAnalysisResult } from './type-inference.js'; /** @internal */ export interface Config { $schema: string; entities: Record; } /** @internal */ export interface Entity { source: string; permissions: Array<{ role: string; actions: PermissionAction[]; }>; relationships?: Record; mappings?: Record; 'x-schema'?: XSchemaExtension; } /** @internal */ export interface Relationship { cardinality: 'one' | 'many'; 'target.entity': string; 'source.fields'?: string[]; 'target.fields'?: string[]; linking?: { entity: string; 'source.fields': string[]; 'target.fields': string[]; }; } /** @internal */ export interface XSchemaExtension { fields: Record; constraints: { primaryKey?: { name: string; columns: string[]; }; foreignKeys?: Array<{ name: string; columns: string[]; referencedTable: string; referencedColumns: string[]; }>; uniqueConstraints?: Array<{ name: string; columns: string[]; }>; checkConstraints?: Array<{ name: string; expression: string; }>; }; } /** @internal */ export interface XSchemaField { dbType: string; nullable: boolean; defaultValue?: string | number | boolean; } /** @internal */ export declare class ConfigGenerator { private dialectConfig; private entities; private junctionTables; constructor(dialect: Dialect); generateConfig(entities: EntityAnalysisResult[]): Config; private analyzeRelationships; private generateEntities; private generateEntity; private transformPermissionActions; private generateRelationships; private findForeignKeyFromEntityToEntity; private generateMappings; private generateXSchema; private getIncomingOneToManyRelationships; private getTableNameForEntity; /** * Get the original field name with proper casing for any entity. * This preserves the original TypeScript property casing. */ private getFieldNameForEntity; /** * Get the proper casing of system User entity fields. * Maps from lowercase field names to the actual User class property names. */ private getSystemUserFieldName; private generateJunctionTableName; } //# sourceMappingURL=dab-config-generator.d.ts.map