export interface RegisteredParamItem {
    default: string;
    name: string;
    type: string;
}
export type DatabaseType = "postgresql" | "mysql" | "sqlserver" | "mongodb";
interface PostgresCredentials {
    host: string;
    port: string;
    database: string;
    username: string;
    password: string;
    ssl_mode: "disable" | "require";
}
export type TDatabaseCredentials = PostgresCredentials;
interface DatabaseConfig {
    type: DatabaseType;
    credentials: TDatabaseCredentials;
    schema: string;
}
interface HTTPConfig {
    url: string;
    method: string;
    headers: Header[];
    body: Body[];
    type_body: "none" | "form-data" | "raw";
    key_source: string;
    pagination: Pagination;
    columns: Column[];
}
interface Header {
    key: string;
    value: string;
    type: string;
}
interface Body {
    key: string;
    value: string;
    description: string;
}
interface Pagination {
    limit: string;
    current_page: string;
    total_page: string;
    total_item: string;
}
interface Column {
    name: string;
    type: string;
    show: boolean;
}
interface DatabaseColumn {
    name: string;
    id: string;
    is_hidden: boolean;
    field_type: string;
    active: boolean;
    definition: Record<string, any>;
    metadata: Record<string, any>;
}
export interface ColumnSelection {
    column: string;
    alias: string;
    table: string;
}
export interface JoinTable {
    targetTable: string;
    targetColumn: string;
    originTable: string;
    originColumn: string;
    joinType?: string;
    selectedColumns: ColumnSelection[];
}
export interface Parameter {
    name: string;
    value: string | Date;
    type: string;
}
export interface WhereCondition {
    originTableName: string;
    originColumnName: string;
    alias: string;
    operator: string;
    value: string;
    parameter?: string;
}
export interface OrderByCondition {
    alias: string;
    originTableName: string;
    originColumnName: string;
    direction: "ASC" | "DESC";
}
export interface GroupByCondition {
    alias: string;
    originTableName: string;
    originColumnName: string;
}
export interface RelationFormData {
    relationName: string;
    joinTables: JoinTable[];
    parameters: Parameter[];
    whereConditions: WhereCondition[];
    orderByConditions: OrderByCondition[];
    groupByConditions: GroupByCondition[];
}
interface DatabaseTable {
    id: string;
    name: string;
    total_rows: number;
    columns: DatabaseColumn[];
    object_type?: "table" | "relation";
    join_tables?: JoinTable[];
    order_by?: OrderByCondition[];
    group_by?: GroupByCondition[];
    registered_params?: Parameter[];
    where_condition?: WhereCondition[];
    type?: "OneToMany" | "ManyToMany";
    created_at?: string;
    updated_at?: string;
    external_data_id?: string;
}
export interface IExternalHTTPData {
    name: string;
    type: "http";
    params: Record<string, RegisteredParamItem>;
    config: HTTPConfig;
}
export interface IExternalDatabaseData {
    name: string;
    type: "database";
    params: Record<string, RegisteredParamItem>;
    config: DatabaseConfig;
    tables: DatabaseTable[];
}
export type IExternalData = IExternalHTTPData | IExternalDatabaseData;
export {};
