Add Telegram and Discord IM channels

This commit is contained in:
xmanrui 2026-08-16 14:47:16 +08:00
parent 7123fce47a
commit cb74e1c4c7
66 changed files with 8579 additions and 1910 deletions

View file

@ -0,0 +1,11 @@
const RPC_AUTHORITIES = new Set(['loopback', 'trusted-host']);
/**
* Resolve the browser authority accepted by an IM management RPC channel.
* The default keeps credential and bot-management operations on loopback.
*/
export function resolveRpcAuthority(value) {
if (value === undefined) return 'loopback';
if (RPC_AUTHORITIES.has(value)) return value;
throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"');
}