feat(gateway): add node capability negotiation foundation
This commit is contained in:
@@ -14,6 +14,9 @@ export class Router {
|
||||
}
|
||||
|
||||
async dispatch(request: GatewayRequest, send: SendFn): Promise<OutboundMessage | void> {
|
||||
if (request.method.startsWith('node.') && !request.params) {
|
||||
return makeError(request.id, ErrorCode.InvalidRequest, 'params are required for node methods');
|
||||
}
|
||||
const handler = this.handlers.get(request.method);
|
||||
if (!handler) {
|
||||
return makeError(request.id, ErrorCode.MethodNotFound, `Unknown method: ${request.method}`);
|
||||
|
||||
Reference in New Issue
Block a user