@pipedream/microsoft_teams 0.3.0 → 0.4.0

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.
@@ -0,0 +1,57 @@
1
+ import microsoftTeams from "../../microsoft_teams.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_teams-list-channel-messages",
5
+ name: "List Channel Messages",
6
+ description: "Lists messages in a Microsoft Teams channel. [See the documentation](https://learn.microsoft.com/en-us/graph/api/channel-list-messages)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ microsoftTeams,
16
+ teamId: {
17
+ propDefinition: [
18
+ microsoftTeams,
19
+ "team",
20
+ ],
21
+ },
22
+ channelId: {
23
+ propDefinition: [
24
+ microsoftTeams,
25
+ "channel",
26
+ ({ teamId }) => ({
27
+ teamId,
28
+ }),
29
+ ],
30
+ },
31
+ maxResults: {
32
+ type: "integer",
33
+ label: "Max Results",
34
+ description: "The maximum number of messages to return",
35
+ optional: true,
36
+ },
37
+ },
38
+ async run({ $ }) {
39
+ const messages = [];
40
+ const paginator = this.microsoftTeams.paginate(this.microsoftTeams.listChannelMessages, {
41
+ teamId: this.teamId,
42
+ channelId: this.channelId,
43
+ });
44
+
45
+ for await (const message of paginator) {
46
+ messages.push(message);
47
+ if (this.maxResults && messages.length >= this.maxResults) {
48
+ break;
49
+ }
50
+ }
51
+
52
+ $.export("$summary", `Successfully fetched ${messages.length} message${messages.length === 1
53
+ ? ""
54
+ : "s"}`);
55
+ return messages;
56
+ },
57
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_teams",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Pipedream Microsoft Teams Components",
5
5
  "main": "microsoft_teams.app.mjs",
6
6
  "keywords": [