feat: implement metadata catalog database management

This commit is contained in:
Codex
2026-08-27 22:43:54 +02:00
parent 705af3aeb2
commit 79c4c925b5
86 changed files with 12566 additions and 135 deletions
+19
View File
@@ -289,3 +289,22 @@ test("loadConfig accepts only an absolute generic model key file", () => {
expect(() => loadConfig({ THT_MODEL_API_KEY_FILE: " /run/secrets/key" }))
.toThrow(/model credential configuration is invalid/);
});
test("loadConfig accepts a file-backed catalog role and rejects partial catalog configuration", () => {
expect(loadConfig({
THT_CATALOG_DB_HOST: "catalog-db",
THT_CATALOG_DB_NAME: "thothii_catalog",
THT_CATALOG_RUNTIME_USER: "thothii_catalog_runtime",
THT_CATALOG_RUNTIME_PASSWORD_FILE: "/run/secrets/catalog_runtime_password",
}).catalogDatabase).toEqual({
host: "catalog-db",
port: 5432,
database: "thothii_catalog",
user: "thothii_catalog_runtime",
passwordFile: "/run/secrets/catalog_runtime_password",
});
expect(() => loadConfig({ THT_CATALOG_DB_HOST: "catalog-db" }))
.toThrow(/catalog database configuration is invalid/);
expect(() => loadConfig({ THT_CATALOG_DATABASE_URL: "https://catalog.invalid/db" }))
.toThrow(/catalog database configuration is invalid/);
});