mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: trim mattermost helper exports
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> };
|
||||
|
||||
Reference in New Issue
Block a user