@pipedream/microsoft_teams 0.2.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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import microsoftTeams from "../../microsoft_teams.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "microsoft_teams-list-chats",
|
|
5
|
+
name: "List Chats",
|
|
6
|
+
description: "Lists all chat conversations for the authenticated user. [See the documentation](https://learn.microsoft.com/en-us/graph/api/chat-list)",
|
|
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
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const chats = [];
|
|
19
|
+
const paginator = this.microsoftTeams.paginate(this.microsoftTeams.listChats);
|
|
20
|
+
|
|
21
|
+
for await (const chat of paginator) {
|
|
22
|
+
chats.push(chat);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$.export("$summary", `Successfully fetched ${chats.length} ${chats.length === 1
|
|
26
|
+
? "chat"
|
|
27
|
+
: "chats"}`);
|
|
28
|
+
|
|
29
|
+
return chats;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import microsoftTeams from "../../microsoft_teams.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "microsoft_teams-list-teams",
|
|
5
|
+
name: "List Teams",
|
|
6
|
+
description: "Lists all teams the authenticated user has joined. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-joinedteams)",
|
|
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
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const teams = [];
|
|
19
|
+
const paginator = this.microsoftTeams.paginate(this.microsoftTeams.listTeams);
|
|
20
|
+
|
|
21
|
+
for await (const team of paginator) {
|
|
22
|
+
teams.push(team);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$.export("$summary", `Successfully fetched ${teams.length} ${teams.length === 1
|
|
26
|
+
? "team"
|
|
27
|
+
: "teams"}`);
|
|
28
|
+
|
|
29
|
+
return teams;
|
|
30
|
+
},
|
|
31
|
+
};
|