@datamonsterr/vdt-dashboard
Version:
82 lines • 1.82 kB
TypeScript
export interface ApiResponse<T = any> {
success: boolean;
message: string;
data: T | null;
error?: {
code: string;
details: string;
};
}
export interface Pagination {
page: number;
limit: number;
total: number;
totalPages: number;
}
export interface ApiColumn {
id: string;
name: string;
dataType: string;
length?: number;
nullable: boolean;
primaryKey: boolean;
autoIncrement: boolean;
unique?: boolean;
defaultValue?: string;
}
export interface ApiTable {
id: string;
name: string;
columns: ApiColumn[];
position: {
x: number;
y: number;
};
}
export interface ApiForeignKey {
id: string;
sourceTableId: string;
sourceColumnId: string;
targetTableId: string;
targetColumnId: string;
onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
onUpdate?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
}
export interface ApiSchemaListItem {
id: string;
name: string;
description?: string;
databaseName: string;
status: string;
tableCount: number;
createdAt: string;
updatedAt: string;
version: string;
}
export interface ApiSchema {
id: string;
name: string;
description?: string;
databaseName: string;
status: string;
tables: ApiTable[];
foreignKeys?: ApiForeignKey[];
createdAt: string;
updatedAt: string;
version: string;
}
export interface CreateSchemaRequest {
name: string;
description?: string;
tables: ApiTable[];
foreignKeys?: ApiForeignKey[];
}
export interface SchemasResponse {
data: ApiSchemaListItem[];
pagination: Pagination;
}
export interface DeleteSchemaResponse {
id: string;
databaseDropped: boolean;
}
//# sourceMappingURL=api.d.ts.map