feat(notifications): P3 HTTP face — channel config CRUD + recent + test-send

Bearer-gated WebUI routes:
- GET/POST /api/notifications/config — read/normalize the global channel store
  (whole-config CRUD, mirroring the ui-config pattern).
- GET /api/notifications/recent?limit=N — in-memory delivery history (≤100).
- POST /api/notifications/test {channelId} — one-off test to a single channel
  (ignores enabled/opt-in, sample vars, reuses render+POST, not recorded).

NotificationManager.testSend() added; initWebUI takes the manager (optional).
Tests: testSend unit coverage. 16 manager tests green, typecheck clean.
Adversarial review: 0 blockers / 0 should-fix / 0 nits.
This commit is contained in:
DrSmoothl committed 2026-06-16 19:30:54 +08:00
1 parent 30bcd97a3f
commit c0af18e1c2
4 files changed
+131 -1

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ async function main() {
) {
try {
const { initWebUI } = await import('./webui/server');
await initWebUI(runtimeConfig.webuiPort || 5099, oneBotManager, hookManager);
await initWebUI(runtimeConfig.webuiPort || 5099, oneBotManager, hookManager, notificationManager);
} catch (err) {
log.error('Failed to start WebUI: ', err);
}