refactor: trim slack helper exports · openclaw/openclaw@a301df0
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { SlackAccountConfig } from "./runtime-api.js"; |
2 | 2 | |
3 | | -export type SlackReplyToMode = "off" | "first" | "all" | "batched"; |
| 3 | +type SlackReplyToMode = "off" | "first" | "all" | "batched"; |
4 | 4 | |
5 | | -export type SlackReplyToModeAccount = { |
| 5 | +type SlackReplyToModeAccount = { |
6 | 6 | replyToMode?: SlackReplyToMode; |
7 | 7 | replyToModeByChatType?: SlackAccountConfig["replyToModeByChatType"]; |
8 | 8 | dm?: { replyToMode?: SlackReplyToMode }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,7 @@ const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("sl
|
44 | 44 | export const listSlackAccountIds = listAccountIds; |
45 | 45 | export const resolveDefaultSlackAccountId = resolveDefaultAccountId; |
46 | 46 | |
47 | | -export function resolveSlackAccountConfig( |
| 47 | +function resolveSlackAccountConfig( |
48 | 48 | cfg: OpenClawConfig, |
49 | 49 | accountId: string, |
50 | 50 | ): SlackAccountConfig | undefined { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
|
6 | 6 | import { resolveSlackAccount, resolveSlackAccountAllowFrom } from "./accounts.js"; |
7 | 7 | import { normalizeSlackApproverId } from "./exec-approvals.js"; |
8 | 8 | |
9 | | -export function getSlackApprovalApprovers(params: { |
| 9 | +function getSlackApprovalApprovers(params: { |
10 | 10 | cfg: OpenClawConfig; |
11 | 11 | accountId?: string | null; |
12 | 12 | }): string[] { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ const SLACK_ACTION_BLOCK_ELEMENTS_MAX = 25;
|
21 | 21 | |
22 | 22 | export type SlackBlock = Block | KnownBlock; |
23 | 23 | |
24 | | -export type SlackInteractiveBlockRenderOptions = { |
| 24 | +type SlackInteractiveBlockRenderOptions = { |
25 | 25 | buttonIndexOffset?: number; |
26 | 26 | selectIndexOffset?: number; |
27 | 27 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ type SlackChannels = Record<string, SlackChannelConfig>;
|
7 | 7 | |
8 | 8 | type MigrationScope = "account" | "global"; |
9 | 9 | |
10 | | -export type SlackChannelMigrationResult = { |
| 10 | +type SlackChannelMigrationResult = { |
11 | 11 | migrated: boolean; |
12 | 12 | skippedExisting: boolean; |
13 | 13 | scopes: MigrationScope[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,7 @@ function asObjectRecord(value: unknown): Record<string, unknown> | null {
|
12 | 12 | : null; |
13 | 13 | } |
14 | 14 | |
15 | | -export const collectSlackMutableAllowlistWarnings = |
| 15 | +const collectSlackMutableAllowlistWarnings = |
16 | 16 | createDangerousNameMatchingMutableAllowlistWarningCollector({ |
17 | 17 | channel: "slack", |
18 | 18 | detector: isSlackMutableAllowEntry, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import { sendMessageSlack } from "./send.js";
|
7 | 7 | |
8 | 8 | const DEFAULT_THROTTLE_MS = 1000; |
9 | 9 | |
10 | | -export type SlackDraftStream = { |
| 10 | +type SlackDraftStream = { |
11 | 11 | update: (text: string) => void; |
12 | 12 | flush: () => Promise<void>; |
13 | 13 | clear: () => Promise<void>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,7 @@ export type SlackInteractiveHandlerRegistration = PluginInteractiveRegistration<
|
55 | 55 | "slack" |
56 | 56 | >; |
57 | 57 | |
58 | | -export type SlackInteractiveDispatchContext = Omit< |
| 58 | +type SlackInteractiveDispatchContext = Omit< |
59 | 59 | SlackInteractiveHandlerContext, |
60 | 60 | | "interaction" |
61 | 61 | | "respond" |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime"; |
2 | 2 | |
3 | | -export type SlackModalPrivateMetadata = { |
| 3 | +type SlackModalPrivateMetadata = { |
4 | 4 | sessionKey?: string; |
5 | 5 | channelId?: string; |
6 | 6 | channelType?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -694,7 +694,7 @@ describe("monitorSlackProvider tool results", () => {
|
694 | 694 | await runMentionGatedChannelMessageAndFlush(); |
695 | 695 | |
696 | 696 | expect(sendMock).not.toHaveBeenCalled(); |
697 | | -expectReactionNames(["eyes", "scream", "eyes", "eyes", "scream"]); |
| 697 | +expectReactionNames(["eyes", "scream", "scream"]); |
698 | 698 | }); |
699 | 699 | |
700 | 700 | it("replies with pairing code when dmPolicy is pairing and no allowFrom is set", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。