From be3e10475fb0aa94c8fde940e8673c8fdd4b5dd1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 19:27:30 +0100 Subject: [PATCH] refactor: trim mattermost helper exports --- extensions/mattermost/src/mattermost/monitor-helpers.ts | 3 +-- .../mattermost/src/mattermost/monitor-websocket.ts | 4 ++-- extensions/mattermost/src/mattermost/slash-commands.ts | 9 +++------ extensions/mattermost/src/secret-contract.ts | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/extensions/mattermost/src/mattermost/monitor-helpers.ts b/extensions/mattermost/src/mattermost/monitor-helpers.ts index e625e4d1acd..92cc750ec7a 100644 --- a/extensions/mattermost/src/mattermost/monitor-helpers.ts +++ b/extensions/mattermost/src/mattermost/monitor-helpers.ts @@ -1,9 +1,8 @@ import { formatInboundFromLabel as formatInboundFromLabelShared } from "openclaw/plugin-sdk/channel-inbound"; -import { createDedupeCache } from "openclaw/plugin-sdk/core"; import { resolveThreadSessionKeys as resolveThreadSessionKeysShared } from "openclaw/plugin-sdk/routing"; import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress"; -export { createDedupeCache, rawDataToString }; +export { rawDataToString }; export const formatInboundFromLabel = formatInboundFromLabelShared; diff --git a/extensions/mattermost/src/mattermost/monitor-websocket.ts b/extensions/mattermost/src/mattermost/monitor-websocket.ts index 725951b1f6d..a7c011a0675 100644 --- a/extensions/mattermost/src/mattermost/monitor-websocket.ts +++ b/extensions/mattermost/src/mattermost/monitor-websocket.ts @@ -110,12 +110,12 @@ type CreateMattermostConnectOnceOpts = { pongTimeoutMs?: number; }; -export const defaultMattermostWebSocketFactory: MattermostWebSocketFactory = (url) => { +const defaultMattermostWebSocketFactory: MattermostWebSocketFactory = (url) => { const agent = createDebugProxyWebSocketAgent(resolveDebugProxySettings()); return new WebSocket(url, agent ? { agent } : undefined) as MattermostWebSocketLike; }; -export function parsePostedPayload( +function parsePostedPayload( payload: MattermostEventPayload, ): { payload: MattermostEventPayload; post: MattermostPost } | null { if (payload.event !== "posted") { diff --git a/extensions/mattermost/src/mattermost/slash-commands.ts b/extensions/mattermost/src/mattermost/slash-commands.ts index 306f9cf4873..493c6a03151 100644 --- a/extensions/mattermost/src/mattermost/slash-commands.ts +++ b/extensions/mattermost/src/mattermost/slash-commands.ts @@ -220,7 +220,7 @@ export async function getMattermostCommand( /** * Create a custom slash command on a Mattermost team. */ -export async function createMattermostCommand( +async function createMattermostCommand( client: MattermostClient, params: MattermostCommandCreate, ): Promise { @@ -233,10 +233,7 @@ export async function createMattermostCommand( /** * Delete a custom slash command. */ -export async function deleteMattermostCommand( - client: MattermostClient, - commandId: string, -): Promise { +async function deleteMattermostCommand(client: MattermostClient, commandId: string): Promise { await client.request>(`/commands/${encodeURIComponent(commandId)}`, { method: "DELETE", }); @@ -245,7 +242,7 @@ export async function deleteMattermostCommand( /** * Update an existing custom slash command. */ -export async function updateMattermostCommand( +async function updateMattermostCommand( client: MattermostClient, params: MattermostCommandUpdate, ): Promise { diff --git a/extensions/mattermost/src/secret-contract.ts b/extensions/mattermost/src/secret-contract.ts index 54a7d7c9a81..bbc2855300b 100644 --- a/extensions/mattermost/src/secret-contract.ts +++ b/extensions/mattermost/src/secret-contract.ts @@ -6,7 +6,7 @@ import { type SecretTargetRegistryEntry, } from "openclaw/plugin-sdk/channel-secret-basic-runtime"; -export const secretTargetRegistryEntries = [ +export const secretTargetRegistryEntries: SecretTargetRegistryEntry[] = [ { id: "channels.mattermost.accounts.*.botToken", targetType: "channels.mattermost.accounts.*.botToken", @@ -29,7 +29,7 @@ export const secretTargetRegistryEntries = [ includeInConfigure: true, includeInAudit: true, }, -] satisfies SecretTargetRegistryEntry[]; +]; export function collectRuntimeConfigAssignments(params: { config: { channels?: Record };