diff --git a/extensions/whatsapp/src/auto-reply.test-harness.ts b/extensions/whatsapp/src/auto-reply.test-harness.ts index 573bc28510c..34436e318d6 100644 --- a/extensions/whatsapp/src/auto-reply.test-harness.ts +++ b/extensions/whatsapp/src/auto-reply.test-harness.ts @@ -16,7 +16,6 @@ import { } from "./test-helpers.js"; export { - resetBaileysMocks, resetLoadConfigMock, setLoadConfigMock, setRuntimeConfigSourceSnapshotMock, @@ -56,7 +55,7 @@ type MockSessionSocket = { user: { id: string }; }; -export const TEST_NET_IP = "93.184.216.34"; +const TEST_NET_IP = "93.184.216.34"; const WEB_AUTO_REPLY_SOCKETS_KEY = Symbol.for("openclaw:webAutoReplySessionSockets"); function getSessionSockets(): MockSessionSocket[] { @@ -97,7 +96,7 @@ export function getLastWebAutoReplySessionSocket(): MockSessionSocket { return last; } -export function resetWebAutoReplySessionSockets() { +function resetWebAutoReplySessionSockets() { getSessionSockets().length = 0; } @@ -115,7 +114,7 @@ vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ runEmbeddedPiAgent: vi.fn(), })); -export async function rmDirWithRetries( +async function rmDirWithRetries( dir: string, opts?: { attempts?: number; delayMs?: number }, ): Promise { @@ -314,7 +313,7 @@ export function createWebInboundDeliverySpies(): AnyExport { }; } -export function createWebAutoReplyRuntime(): WebAutoReplyRuntime { +function createWebAutoReplyRuntime(): WebAutoReplyRuntime { return { log: vi.fn(), error: vi.fn(), diff --git a/extensions/whatsapp/src/setup-finalize.ts b/extensions/whatsapp/src/setup-finalize.ts index 651b6d69d99..0ea0a12711e 100644 --- a/extensions/whatsapp/src/setup-finalize.ts +++ b/extensions/whatsapp/src/setup-finalize.ts @@ -152,10 +152,7 @@ function setWhatsAppSelfChatMode( return mergeWhatsAppConfig(cfg, accountId, { selfChatMode }); } -export async function detectWhatsAppLinked( - cfg: OpenClawConfig, - accountId: string, -): Promise { +async function detectWhatsAppLinked(cfg: OpenClawConfig, accountId: string): Promise { const { authDir } = resolveWhatsAppAuthDir({ cfg, accountId }); const credsPath = path.join(authDir, "creds.json"); return await pathExists(credsPath); diff --git a/extensions/whatsapp/src/setup-test-helpers.ts b/extensions/whatsapp/src/setup-test-helpers.ts index 941c225d6f4..279ac078c92 100644 --- a/extensions/whatsapp/src/setup-test-helpers.ts +++ b/extensions/whatsapp/src/setup-test-helpers.ts @@ -23,12 +23,12 @@ type QueuedWizardPrompterFactory = (params: { textValues?: string[]; }) => T; -export const WHATSAPP_OWNER_NUMBER_INPUT = "+1 (555) 555-0123"; -export const WHATSAPP_OWNER_NUMBER = "+15555550123"; -export const WHATSAPP_PERSONAL_NUMBER_INPUT = "+1 (555) 111-2222"; -export const WHATSAPP_PERSONAL_NUMBER = "+15551112222"; -export const WHATSAPP_ACCESS_NOTE_TITLE = "WhatsApp DM access"; -export const WHATSAPP_LOGIN_NOTE_TITLE = "WhatsApp"; +const WHATSAPP_OWNER_NUMBER_INPUT = "+1 (555) 555-0123"; +const WHATSAPP_OWNER_NUMBER = "+15555550123"; +const WHATSAPP_PERSONAL_NUMBER_INPUT = "+1 (555) 111-2222"; +const WHATSAPP_PERSONAL_NUMBER = "+15551112222"; +const WHATSAPP_ACCESS_NOTE_TITLE = "WhatsApp DM access"; +const WHATSAPP_LOGIN_NOTE_TITLE = "WhatsApp"; export function createWhatsAppRootAllowFromConfig(): WhatsAppSetupConfig { return { @@ -99,7 +99,7 @@ export function createWhatsAppAllowlistModeInput(): { }; } -export function expectWhatsAppDmAccess( +function expectWhatsAppDmAccess( cfg: WhatsAppSetupConfig, expected: { selfChatMode: boolean; @@ -123,7 +123,7 @@ export function expectWhatsAppWorkAccountOpenAccess(cfg: WhatsAppSetupConfig): v expect(cfg.channels?.whatsapp?.accounts?.work?.allowFrom).toEqual(["*", WHATSAPP_OWNER_NUMBER]); } -export function expectWhatsAppOwnerNumberPrompt(harness: WizardPromptHarness): void { +function expectWhatsAppOwnerNumberPrompt(harness: WizardPromptHarness): void { expect(harness.text).toHaveBeenCalledWith( expect.objectContaining({ message: "Your personal WhatsApp number (the phone you will message from)",