mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-11 17:20:53 +08:00
Mount IM RPC channels via plugin webServer to fix HTTP 405.
connection.rpc.handle looks up webServer on a Cordis fiber that does not inject it, so channel routes never registered after host restart. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
dd2365407e
commit
6107692418
18 changed files with 666 additions and 330 deletions
|
|
@ -3,6 +3,7 @@ import {
|
|||
createTokenBotRpcHandler,
|
||||
} from '../shared/rpc.mjs';
|
||||
import { resolveRpcAuthority } from '../../rpc-authority.mjs';
|
||||
import { installConnectionRpcChannel } from '../../connection-rpc-mount.mjs';
|
||||
|
||||
export const TELEGRAM_RPC_CHANNEL = '/telegram';
|
||||
export const TELEGRAM_ENDPOINTS = TOKEN_BOT_ENDPOINTS;
|
||||
|
|
@ -13,12 +14,10 @@ export function createTelegramRpcHandler(controller) {
|
|||
}
|
||||
|
||||
export function installTelegramRpc(ctx, controller, authority) {
|
||||
if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== 'function') {
|
||||
throw new TypeError('DSH Host Connection RPC is required');
|
||||
}
|
||||
return ctx.connection.rpc.handle(
|
||||
resolveRpcAuthority(authority);
|
||||
return installConnectionRpcChannel(
|
||||
ctx,
|
||||
TELEGRAM_RPC_CHANNEL,
|
||||
createTelegramRpcHandler(controller),
|
||||
{ authority: resolveRpcAuthority(authority) },
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue