@openclaw/msteams 2026.2.22 → 2026.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -4
- package/src/attachments/payload.ts +3 -11
- package/src/attachments/shared.test.ts +4 -2
- package/src/attachments.test.ts +674 -486
- package/src/messenger.test.ts +30 -48
- package/src/monitor-handler/message-handler.ts +7 -0
- package/src/policy.test.ts +13 -1
- package/src/policy.ts +2 -0
- package/src/reply-dispatcher.ts +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/msteams",
|
|
3
|
-
"version": "2026.2.
|
|
3
|
+
"version": "2026.2.24",
|
|
4
4
|
"description": "OpenClaw Microsoft Teams channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@microsoft/agents-hosting": "^1.3.1",
|
|
8
8
|
"express": "^5.2.1"
|
|
9
9
|
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"openclaw": "workspace:*"
|
|
12
|
-
},
|
|
13
10
|
"openclaw": {
|
|
14
11
|
"extensions": [
|
|
15
12
|
"./index.ts"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { buildMediaPayload } from "openclaw/plugin-sdk";
|
|
2
|
+
|
|
1
3
|
export function buildMSTeamsMediaPayload(
|
|
2
4
|
mediaList: Array<{ path: string; contentType?: string }>,
|
|
3
5
|
): {
|
|
@@ -8,15 +10,5 @@ export function buildMSTeamsMediaPayload(
|
|
|
8
10
|
MediaUrls?: string[];
|
|
9
11
|
MediaTypes?: string[];
|
|
10
12
|
} {
|
|
11
|
-
|
|
12
|
-
const mediaPaths = mediaList.map((media) => media.path);
|
|
13
|
-
const mediaTypes = mediaList.map((media) => media.contentType ?? "");
|
|
14
|
-
return {
|
|
15
|
-
MediaPath: first?.path,
|
|
16
|
-
MediaType: first?.contentType,
|
|
17
|
-
MediaUrl: first?.path,
|
|
18
|
-
MediaPaths: mediaPaths.length > 0 ? mediaPaths : undefined,
|
|
19
|
-
MediaUrls: mediaPaths.length > 0 ? mediaPaths : undefined,
|
|
20
|
-
MediaTypes: mediaPaths.length > 0 ? mediaTypes : undefined,
|
|
21
|
-
};
|
|
13
|
+
return buildMediaPayload(mediaList, { preserveMediaTypeCardinality: true });
|
|
22
14
|
}
|
|
@@ -120,11 +120,13 @@ describe("resolveAndValidateIP", () => {
|
|
|
120
120
|
|
|
121
121
|
describe("safeFetch", () => {
|
|
122
122
|
it("fetches a URL directly when no redirect occurs", async () => {
|
|
123
|
-
const fetchMock = vi.fn
|
|
123
|
+
const fetchMock = vi.fn(async (_url: string, _init?: RequestInit) => {
|
|
124
|
+
return new Response("ok", { status: 200 });
|
|
125
|
+
});
|
|
124
126
|
const res = await safeFetch({
|
|
125
127
|
url: "https://teams.sharepoint.com/file.pdf",
|
|
126
128
|
allowHosts: ["sharepoint.com"],
|
|
127
|
-
fetchFn: fetchMock,
|
|
129
|
+
fetchFn: fetchMock as unknown as typeof fetch,
|
|
128
130
|
resolveFn: publicResolve,
|
|
129
131
|
});
|
|
130
132
|
expect(res.status).toBe(200);
|