mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:30:43 +00:00
refactor: trim gateway server type exports
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
import type {
|
||||
GatewayBroadcastFn,
|
||||
GatewayBroadcastOpts,
|
||||
GatewayBroadcastStateVersion,
|
||||
GatewayBroadcastToConnIdsFn,
|
||||
} from "./server-broadcast-types.js";
|
||||
import { MAX_BUFFERED_BYTES } from "./server-constants.js";
|
||||
@@ -51,13 +50,6 @@ const EVENT_SCOPE_GUARDS: Record<string, string[]> = {
|
||||
// (e.g. reconfiguring wake-word triggers).
|
||||
const NODE_ALLOWED_EVENTS = new Set<string>(["voicewake.changed", "voicewake.routing.changed"]);
|
||||
|
||||
export type {
|
||||
GatewayBroadcastFn,
|
||||
GatewayBroadcastOpts,
|
||||
GatewayBroadcastStateVersion,
|
||||
GatewayBroadcastToConnIdsFn,
|
||||
} from "./server-broadcast-types.js";
|
||||
|
||||
function hasEventScope(client: GatewayWsClient, event: string): boolean {
|
||||
const required = EVENT_SCOPE_GUARDS[event];
|
||||
// Plugin-defined gateway broadcast events (plugin.* namespace) are allowed
|
||||
|
||||
@@ -8,8 +8,8 @@ import { createGatewayHttpServer } from "./server-http.js";
|
||||
import { createHooksRequestHandler } from "./server/hooks-request-handler.js";
|
||||
import { withTempConfig } from "./test-temp-config.js";
|
||||
|
||||
export type GatewayHttpServer = ReturnType<typeof createGatewayHttpServer>;
|
||||
export type GatewayServerOptions = Partial<Parameters<typeof createGatewayHttpServer>[0]>;
|
||||
type GatewayHttpServer = ReturnType<typeof createGatewayHttpServer>;
|
||||
type GatewayServerOptions = Partial<Parameters<typeof createGatewayHttpServer>[0]>;
|
||||
type HooksHandlerDeps = Parameters<typeof createHooksRequestHandler>[0];
|
||||
|
||||
const responseEndPromises = new WeakMap<ServerResponse, Promise<void>>();
|
||||
@@ -221,7 +221,7 @@ export function createHooksHandler(
|
||||
});
|
||||
}
|
||||
|
||||
export type RouteVariant = {
|
||||
type RouteVariant = {
|
||||
label: string;
|
||||
path: string;
|
||||
};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export type NodeSendEventFn = (opts: {
|
||||
type NodeSendEventFn = (opts: {
|
||||
nodeId: string;
|
||||
event: string;
|
||||
payloadJSON?: string | null;
|
||||
}) => void;
|
||||
|
||||
export type NodeListConnectedFn = () => Array<{ nodeId: string }>;
|
||||
type NodeListConnectedFn = () => Array<{ nodeId: string }>;
|
||||
|
||||
export type NodeSubscriptionManager = {
|
||||
type NodeSubscriptionManager = {
|
||||
subscribe: (nodeId: string, sessionKey: string) => void;
|
||||
unsubscribe: (nodeId: string, sessionKey: string) => void;
|
||||
unsubscribeAll: (nodeId: string) => void;
|
||||
|
||||
@@ -8,7 +8,7 @@ type GatewayRequestContextClient = GatewayClient & {
|
||||
usesSharedGatewayAuth?: boolean;
|
||||
};
|
||||
|
||||
export type GatewayRequestContextParams = {
|
||||
type GatewayRequestContextParams = {
|
||||
deps: GatewayRequestContext["deps"];
|
||||
runtimeState: Pick<GatewayServerLiveState, "cronState">;
|
||||
getRuntimeConfig: GatewayRequestContext["getRuntimeConfig"];
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from "./net.js";
|
||||
import { mergeGatewayTailscaleConfig } from "./startup-auth.js";
|
||||
|
||||
export type GatewayRuntimeConfig = {
|
||||
type GatewayRuntimeConfig = {
|
||||
bindHost: string;
|
||||
controlUiEnabled: boolean;
|
||||
openAiChatCompletionsEnabled: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import type { HeartbeatRunner } from "../infra/heartbeat-runner.js";
|
||||
import type { ChannelHealthMonitor } from "./channel-health-monitor.js";
|
||||
|
||||
export type GatewayConfigReloaderHandle = {
|
||||
type GatewayConfigReloaderHandle = {
|
||||
stop: () => Promise<void>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user