chore: remove unused internal dead code · openclaw/openclaw@14e8a2d
steipete
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; |
2 | 2 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
3 | | -import { msteamsActionsAdapter } from "./actions.js"; |
4 | 3 | import { msteamsPlugin } from "./channel.js"; |
5 | 4 | |
6 | 5 | const { |
@@ -100,7 +99,7 @@ function okMSTeamsActionDetails(action: string, details?: Record<string, unknown
|
100 | 99 | } |
101 | 100 | |
102 | 101 | function requireMSTeamsHandleAction() { |
103 | | -const handleAction = msteamsActionsAdapter.handleAction; |
| 102 | +const handleAction = msteamsPlugin.actions?.handleAction; |
104 | 103 | if (!handleAction) { |
105 | 104 | throw new Error("msteams actions.handleAction unavailable"); |
106 | 105 | } |
@@ -234,7 +233,7 @@ describe("msteamsPlugin message actions", () => {
|
234 | 233 | |
235 | 234 | it("advertises upload-file in the message tool surface", () => { |
236 | 235 | expect( |
237 | | -msteamsActionsAdapter.describeMessageTool?.({ |
| 236 | +msteamsPlugin.actions?.describeMessageTool?.({ |
238 | 237 | cfg: { |
239 | 238 | channels: { |
240 | 239 | msteams: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,14 +4,17 @@ import {
|
4 | 4 | } from "openclaw/plugin-sdk/channel-test-helpers"; |
5 | 5 | import { afterEach, describe, expect, it, vi } from "vitest"; |
6 | 6 | import type { OpenClawConfig, RuntimeEnv } from "../runtime-api.js"; |
7 | | -import { msteamsDirectoryAdapter } from "./directory.js"; |
| 7 | +import { msteamsPlugin } from "./channel.js"; |
8 | 8 | import { resolveMSTeamsOutboundSessionRoute } from "./session-route.js"; |
9 | 9 | |
10 | | -function requireDirectorySelf(): NonNullable<(typeof msteamsDirectoryAdapter)["self"]> { |
11 | | -if (!msteamsDirectoryAdapter.self) { |
| 10 | +const msteamsDirectoryAdapter = msteamsPlugin.directory; |
| 11 | + |
| 12 | +function requireDirectorySelf(): NonNullable<NonNullable<typeof msteamsDirectoryAdapter>["self"]> { |
| 13 | +const directorySelf = msteamsDirectoryAdapter?.self; |
| 14 | +if (!directorySelf) { |
12 | 15 | throw new Error("expected msteams directory.self"); |
13 | 16 | } |
14 | | -return msteamsDirectoryAdapter.self; |
| 17 | +return directorySelf; |
15 | 18 | } |
16 | 19 | |
17 | 20 | describe("msteams directory", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,12 +30,6 @@ import {
|
30 | 30 | sendAdaptiveCardMSTeams as sendAdaptiveCardMSTeamsImpl, |
31 | 31 | sendMessageMSTeams as sendMessageMSTeamsImpl, |
32 | 32 | } from "./send.js"; |
33 | | -// NOTE: reactMessageMSTeams / listReactionsMSTeams / unreactMessageMSTeams are |
34 | | -// imported from ./graph-messages.js above. The channel dispatcher in channel.ts |
35 | | -// calls those signatures (messageId + reactionType), not the send.reactions.ts |
36 | | -// variants. send.reactions.ts remains as a delegated-auth implementation that |
37 | | -// is currently wired through its own test surface; do not re-import it here |
38 | | -// until channel.ts is migrated to that signature, otherwise identifiers collide. |
39 | 33 | export const msTeamsChannelRuntime = { |
40 | 34 | addParticipantMSTeams: addParticipantMSTeamsImpl, |
41 | 35 | deleteMessageMSTeams: deleteMessageMSTeamsImpl, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。