// mssql's events entrypoint, loaded by the per-node tool host (the provisioner container runs // ./provisioner separately). The database lifecycle events are EMITTED from the provisioner, where // the lifecycle actually happens (novox/hq ADR 0041/0042): // module.mssql.database.provisioned — a consumer's database + login/user was created // module.mssql.database.deprovisioned — that database was removed // Here in the tool host we react to them, keeping a lightweight audit trail of who was granted a // database and who lost one — observability the provider itself is best placed to log. import { on } from "@novox/mesh-sdk/events"; interface DatabaseEvent { consumer: string; database: string; user?: string; } await on("module.mssql.database.provisioned", async (e) => { console.log(`[mssql] database provisioned for ${e.body.consumer} (db ${e.body.database})`); }); await on("module.mssql.database.deprovisioned", async (e) => { console.log(`[mssql] database deprovisioned for ${e.body.consumer} (db ${e.body.database})`); }); console.log("[mssql] auditing database lifecycle events");