@pipedream/microsoft_teams 0.4.2 → 0.4.4
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.
|
@@ -4,8 +4,9 @@ export default {
|
|
|
4
4
|
key: "microsoft_teams-get-current-user",
|
|
5
5
|
name: "Get Current User",
|
|
6
6
|
description: "Returns the authenticated Microsoft Teams user's ID, display name, email, and principal name via Microsoft Graph. Call this first when the user says 'my channels', 'my chats', or needs identity context. Use the returned `id` to identify the sender in **Send Channel Message** or **Send Chat Message** results. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-get).",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
|
+
ai: "optimized",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -3,9 +3,9 @@ import microsoftTeams from "../../microsoft_teams.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "microsoft_teams-send-chat-message",
|
|
5
5
|
name: "Send Chat Message",
|
|
6
|
-
description: "Send a message to a team
|
|
6
|
+
description: "Send a message to a team's chat. Optionally include inline images via `hostedContents`. [See the docs here](https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.13",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -31,23 +31,41 @@ export default {
|
|
|
31
31
|
"contentType",
|
|
32
32
|
],
|
|
33
33
|
},
|
|
34
|
+
hostedContents: {
|
|
35
|
+
type: "string[]",
|
|
36
|
+
label: "Hosted Contents",
|
|
37
|
+
description: "An array of JSON strings, each representing an inline hosted image to attach. Each item must be a JSON object with `'@microsoft.graph.temporaryId'` (string), `contentBytes` (base64-encoded image data), and `contentType` (MIME type, e.g. `image/png`). Example: `{\"@microsoft.graph.temporaryId\": \"1\", \"contentBytes\": \"BASE64_STRING\", \"contentType\": \"image/png\"}`. Reference each image in your HTML message body using `<img src=\"../hostedContents/1/$value\">`. [See the docs](https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http#example-6-send-inline-images-along-with-the-message)",
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
34
40
|
},
|
|
35
41
|
async run({ $ }) {
|
|
36
42
|
const {
|
|
37
43
|
chatId,
|
|
38
44
|
message,
|
|
39
45
|
contentType,
|
|
46
|
+
hostedContents,
|
|
40
47
|
} = this;
|
|
41
48
|
|
|
49
|
+
const parsedHostedContents = hostedContents?.map((item) =>
|
|
50
|
+
typeof item === "string"
|
|
51
|
+
? JSON.parse(item)
|
|
52
|
+
: item);
|
|
53
|
+
|
|
54
|
+
const content = {
|
|
55
|
+
body: {
|
|
56
|
+
content: message,
|
|
57
|
+
contentType: contentType ?? "text",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (parsedHostedContents?.length) {
|
|
62
|
+
content.hostedContents = parsedHostedContents;
|
|
63
|
+
}
|
|
64
|
+
|
|
42
65
|
const response =
|
|
43
66
|
await this.microsoftTeams.sendChatMessage({
|
|
44
67
|
chatId,
|
|
45
|
-
content
|
|
46
|
-
body: {
|
|
47
|
-
content: message,
|
|
48
|
-
contentType,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
68
|
+
content,
|
|
51
69
|
});
|
|
52
70
|
|
|
53
71
|
$.export("$summary", `Successfully sent message to chat ${chatId}`);
|