integration layer; merge work on indicators from forks with existing ingestion pipeline

This commit is contained in:
Roberto Treviño Cervantes
2026-10-23 00:00:14 -06:00
parent b0608fdc70
commit d9245fe9b7
194 changed files with 21773 additions and 848 deletions
+24
View File
@@ -0,0 +1,24 @@
import { SqlEngineInfo } from '../api/api.types';
export interface SqlServerSettings {
engine: SqlEngineInfo;
host: string;
port: number | null;
database: string;
user: string;
password: string;
}
/** What the UI shows for a connection; never the password. */
export function describeSqlServer(settings: SqlServerSettings): string {
const port = settings.port ?? settings.engine.default_port;
return `${settings.database} · ${settings.user ? `${settings.user}@` : ''}${settings.host}:${port}`;
}
/** Credential-free label for a raw connection string (`scheme://user:pass@host/db` -> `db · host`). */
export function describeSqlUrl(url: string): string {
const match = /^([^:]+):\/\/(?:[^@/]*@)?([^/?#]*)\/?([^?#]*)/.exec(url.trim());
if (!match) return 'Base de datos';
const [, , host, database] = match;
return database ? `${decodeURIComponent(database)} · ${host}` : host || 'Base de datos';
}