mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 02:20:26 +00:00
refactor(media): centralize outbound access plumbing
This commit is contained in:
@@ -7,11 +7,7 @@ import type { CronJob } from "../../cron/types.js";
|
||||
import { requestHeartbeatNow } from "../../infra/heartbeat-wake.js";
|
||||
import { enqueueSystemEvent } from "../../infra/system-events.js";
|
||||
import type { createSubsystemLogger } from "../../logging/subsystem.js";
|
||||
import {
|
||||
normalizeHookDispatchSessionKey,
|
||||
type HookAgentDispatchPayload,
|
||||
type HooksConfigResolved,
|
||||
} from "../hooks.js";
|
||||
import { type HookAgentDispatchPayload, type HooksConfigResolved } from "../hooks.js";
|
||||
import { createHooksRequestHandler, type HookClientIpConfig } from "../server-http.js";
|
||||
|
||||
type SubsystemLogger = ReturnType<typeof createSubsystemLogger>;
|
||||
|
||||
@@ -28,6 +28,7 @@ function createRoute(params: {
|
||||
}
|
||||
|
||||
function createMockLogger(): SubsystemLogger {
|
||||
const child = vi.fn<(name: string) => SubsystemLogger>();
|
||||
const logger = {
|
||||
subsystem: "test/plugins-http-runtime-scopes",
|
||||
isEnabled: () => true,
|
||||
@@ -38,10 +39,10 @@ function createMockLogger(): SubsystemLogger {
|
||||
error: vi.fn(),
|
||||
fatal: vi.fn(),
|
||||
raw: vi.fn(),
|
||||
child: vi.fn(),
|
||||
} satisfies Omit<SubsystemLogger, "child"> & { child: ReturnType<typeof vi.fn> };
|
||||
logger.child.mockImplementation(() => logger);
|
||||
return logger;
|
||||
child,
|
||||
} satisfies SubsystemLogger;
|
||||
child.mockImplementation(() => logger);
|
||||
return logger as SubsystemLogger;
|
||||
}
|
||||
|
||||
function assertWriteHelperAllowed() {
|
||||
|
||||
Reference in New Issue
Block a user