



























@@ -63,6 +63,7 @@ import {
6363createGatewayMethodDescriptorsFromHandlers,
6464createGatewayMethodRegistry,
6565createPluginGatewayMethodDescriptors,
66+isCoreGatewayMethodClassified,
6667type GatewayMethodRegistry,
6768} from "./methods/registry.js";
6869import {
@@ -1096,16 +1097,26 @@ export async function startGatewayServer(
10961097let attachedPluginGatewayHandlerKeys = new Set(Object.keys(pluginRegistry.gatewayHandlers));
10971098const buildAttachedGatewayMethodRegistry = (
10981099nextPluginRegistry: typeof pluginRegistry,
1099-): GatewayMethodRegistry =>
1100-createGatewayMethodRegistry([
1101- ...createCoreGatewayMethodDescriptors(coreGatewayHandlers),
1100+): GatewayMethodRegistry => {
1101+const coreDescriptorHandlers: GatewayRequestHandlers = { ...coreGatewayHandlers };
1102+const auxHandlers: GatewayRequestHandlers = {};
1103+for (const [method, handler] of Object.entries(extraHandlers)) {
1104+if (isCoreGatewayMethodClassified(method)) {
1105+coreDescriptorHandlers[method] = handler;
1106+} else {
1107+auxHandlers[method] = handler;
1108+}
1109+}
1110+return createGatewayMethodRegistry([
1111+ ...createCoreGatewayMethodDescriptors(coreDescriptorHandlers),
11021112 ...createPluginGatewayMethodDescriptors(nextPluginRegistry),
11031113 ...createGatewayMethodDescriptorsFromHandlers({
1104-handlers: extraHandlers,
1114+handlers: auxHandlers,
11051115owner: { kind: "aux", area: "gateway-extra" },
11061116defaultScope: ADMIN_SCOPE,
11071117}),
11081118]);
1119+};
11091120let attachedGatewayMethodRegistry = buildAttachedGatewayMethodRegistry(pluginRegistry);
11101121const listAttachedGatewayMethods = () => {
11111122const methods = attachedGatewayMethodRegistry.listAdvertisedMethods();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。