// ── The push facet: which triggers may reach a phone ────────────────────── // // `registerNotificationStreams` (MODULE_API.md §2.4). A stream is what a device // subscribes to, and **core delivers an engagement rule's push only to devices // subscribed to a stream whose id IS the trigger id** (`pushChannel.deliver` -> // `publishToUsers(row.trigger_id)`). So a trigger with no stream here can never // buzz a phone, however its rule is set — which is exactly how the families // that should not are kept off it (D65). // // Every id here is ALSO a trigger in `triggers.js`. That is the one namespace // core enforces across both facets: one event, with a payload contract and a // subscription toggle, owned by one module. An id that appeared only here would // be a toggle nothing could ever fire. // // **The tickle carries nothing.** A push is `{ stream, ref }` and the app pulls // the real item over the authenticated inbox API, so a leaked relay topic says // that something happened and not what. That is core's guarantee and it is why // a raid alert may be a push at all. const STREAMS = Object.freeze([ { id: 'rust.base.destroyed', label: 'Your base was raided', description: 'Part of a base you are authorised on was destroyed by another player.', // Delivered only to the owner's devices, never fanned out: `owner` ceiling, // one emit per authorised person (D59). personal: true, requiresLinkedAccount: true, }, { id: 'rust.server.online', label: 'A server came online', description: 'A Rust server started or came back.', personal: false, requiresLinkedAccount: false, }, { id: 'rust.server.offline', label: 'A server went offline', description: 'A Rust server stopped or stopped answering.', personal: false, requiresLinkedAccount: false, }, { id: 'rust.wipe.started', label: 'A server wiped', description: 'A Rust server started a new wipe.', personal: false, requiresLinkedAccount: false, }, ]) module.exports = { STREAMS }