The same Team event as §6, delivered a third time: push, email, and now a Discord channel the operator configured. Not a second pipeline — teamNotify.js already computed the recipient set once, so the bridge is a sink beside the two that were there. The design's gate has no data source. §7.2 bridges an event only if "its visibility is public, or its destination channel is configured for a members-only Team context". The four team.* streams carry no visibility; forum threads have no public/members column because a forum is members-only by construction; and core cannot see a Discord channel's permissions. So §7.2's own example config names exactly the two events that are never public. The gate is therefore an attributed operator acknowledgement, in the shape teams_forum_uploads_ack already uses. It is a precondition — 422, not a quiet drop at delivery — it is re-asked at delivery as well as at the save, and changing the channel clears it, because an acknowledgement is about a destination and cannot survive the destination changing underneath it. The design's DDL cannot hold its own default row: MariaDB coerces every PRIMARY KEY column to NOT NULL, so `team_id NULL` — the deployment-wide default every override overrides — is unrepresentable. Proved on a real MariaDB (error 1048). Replaced with a surrogate id, a generated team_key AS IFNULL(team_id, 0) in the unique key, and the foreign key the original had no room for. One-shot, not queued: "identical to announce and mod-reverse" names two different reliability models, and a Team notification is the moment it describes. Co-Authored-By: Claude <noreply@anthropic.com>
18 lines
500 B
JavaScript
18 lines
500 B
JavaScript
const express = require('express')
|
|
|
|
const requireInternalKey = require('./requireInternalKey')
|
|
const ctrl = require('./internal.controller')
|
|
|
|
const router = express.Router()
|
|
|
|
router.use(requireInternalKey)
|
|
|
|
router.post('/config', ctrl.setConfig)
|
|
router.get('/status', ctrl.getStatus)
|
|
router.post('/announce', ctrl.announce)
|
|
router.post('/mod-reverse', ctrl.reverseModAction)
|
|
router.post('/refresh-commands', ctrl.refreshCommands)
|
|
router.post('/team-notify', ctrl.teamNotify)
|
|
|
|
module.exports = router
|