refactor: trim mattermost helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 19:27:30 +01:00
parent 847a9d26f7
commit be3e10475f
4 changed files with 8 additions and 12 deletions

View File

@@ -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;

View File

@@ -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") {

View File

@@ -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<MattermostCommandResponse> {
@@ -233,10 +233,7 @@ export async function createMattermostCommand(
/**
* Delete a custom slash command.
*/
export async function deleteMattermostCommand(
client: MattermostClient,
commandId: string,
): Promise<void> {
async function deleteMattermostCommand(client: MattermostClient, commandId: string): Promise<void> {
await client.request<Record<string, unknown>>(`/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<MattermostCommandResponse> {

View File

@@ -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<string, unknown> };