@pipedream/microsoft_teams 0.0.7 → 0.1.1
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/actions/create-channel/create-channel.mjs +1 -1
- package/actions/list-channels/list-channels.mjs +1 -1
- package/actions/list-shifts/list-shifts.mjs +34 -0
- package/actions/send-channel-message/send-channel-message.mjs +1 -1
- package/actions/send-chat-message/send-chat-message.mjs +1 -1
- package/common/constants.mjs +0 -2
- package/microsoft_teams.app.mjs +10 -12
- package/package.json +1 -1
- package/sources/common/base.mjs +1 -4
- package/sources/new-channel/new-channel.mjs +1 -8
- package/sources/new-channel-message/new-channel-message.mjs +1 -8
- package/sources/new-chat/new-chat.mjs +1 -11
- package/sources/new-chat-message/new-chat-message.mjs +1 -8
- package/sources/new-team/new-team.mjs +1 -11
- package/sources/new-team-member/new-team-member.mjs +1 -1
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Create Channel",
|
|
6
6
|
description: "Create a new channel in Microsoft Teams. [See the docs here](https://docs.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=http)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftTeams,
|
|
11
11
|
teamId: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "List Channels",
|
|
6
6
|
description: "Lists all channels in a Microsoft Team. [See the docs here](https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0&tabs=http)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftTeams,
|
|
11
11
|
teamId: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import microsoftTeams from "../../microsoft_teams.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "microsoft_teams-list-shifts",
|
|
5
|
+
name: "List Shifts",
|
|
6
|
+
description: "Get the list of shift instances for a team. [See the documentation](https://learn.microsoft.com/en-us/graph/api/schedule-list-shifts?view=graph-rest-1.0&tabs=http)",
|
|
7
|
+
type: "action",
|
|
8
|
+
version: "0.0.2",
|
|
9
|
+
props: {
|
|
10
|
+
microsoftTeams,
|
|
11
|
+
teamId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
microsoftTeams,
|
|
14
|
+
"team",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
async run({ $ }) {
|
|
19
|
+
const paginator = this.microsoftTeams.paginate(this.microsoftTeams.listShifts, {
|
|
20
|
+
teamId: this.teamId,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const shifts = [];
|
|
24
|
+
for await (const shift of paginator) {
|
|
25
|
+
shifts.push(shift);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
$.export("$summary", `Successfully fetched ${shifts?.length} shift${shifts?.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}.`);
|
|
31
|
+
|
|
32
|
+
return shifts;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Send Channel Message",
|
|
6
6
|
description: "Send a message to a team's channel. [See the docs here](https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftTeams,
|
|
11
11
|
teamId: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Send Chat Message",
|
|
6
6
|
description: "Send a message to a team's chat. [See the docs here](https://docs.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftTeams,
|
|
11
11
|
chatId: {
|
package/common/constants.mjs
CHANGED
package/microsoft_teams.app.mjs
CHANGED
|
@@ -96,13 +96,6 @@ export default {
|
|
|
96
96
|
label: "Message",
|
|
97
97
|
description: "Message to be sent",
|
|
98
98
|
},
|
|
99
|
-
max: {
|
|
100
|
-
type: "integer",
|
|
101
|
-
label: "Max",
|
|
102
|
-
description: "Maximum number of items to return",
|
|
103
|
-
optional: true,
|
|
104
|
-
default: 20,
|
|
105
|
-
},
|
|
106
99
|
},
|
|
107
100
|
methods: {
|
|
108
101
|
_accessToken() {
|
|
@@ -149,17 +142,17 @@ export default {
|
|
|
149
142
|
async listTeams() {
|
|
150
143
|
const id = await this.authenticatedUserId();
|
|
151
144
|
return this.makeRequest({
|
|
152
|
-
path: `/users/${id}/joinedTeams
|
|
145
|
+
path: `/users/${id}/joinedTeams`,
|
|
153
146
|
});
|
|
154
147
|
},
|
|
155
148
|
async listChannels({ teamId }) {
|
|
156
149
|
return this.makeRequest({
|
|
157
|
-
path: `/teams/${teamId}/channels
|
|
150
|
+
path: `/teams/${teamId}/channels`,
|
|
158
151
|
});
|
|
159
152
|
},
|
|
160
153
|
async listChats() {
|
|
161
154
|
return this.makeRequest({
|
|
162
|
-
path:
|
|
155
|
+
path: "/chats?$expand=members",
|
|
163
156
|
});
|
|
164
157
|
},
|
|
165
158
|
async createChannel({
|
|
@@ -214,7 +207,7 @@ export default {
|
|
|
214
207
|
teamId, channelId,
|
|
215
208
|
}) {
|
|
216
209
|
return this.makeRequest({
|
|
217
|
-
path: `/teams/${teamId}/channels/${channelId}/messages/delta
|
|
210
|
+
path: `/teams/${teamId}/channels/${channelId}/messages/delta`,
|
|
218
211
|
});
|
|
219
212
|
},
|
|
220
213
|
async listTeamMembers({ teamId }) {
|
|
@@ -224,7 +217,12 @@ export default {
|
|
|
224
217
|
},
|
|
225
218
|
async listChatMessages({ chatId }) {
|
|
226
219
|
return this.makeRequest({
|
|
227
|
-
path: `/chats/${chatId}/messages
|
|
220
|
+
path: `/chats/${chatId}/messages`,
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
async listShifts({ teamId }) {
|
|
224
|
+
return this.makeRequest({
|
|
225
|
+
path: `/teams/${teamId}/schedule/shifts`,
|
|
228
226
|
});
|
|
229
227
|
},
|
|
230
228
|
},
|
package/package.json
CHANGED
package/sources/common/base.mjs
CHANGED
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
}
|
|
28
28
|
return Date.parse(resource.createdDateTime) > lastCreated;
|
|
29
29
|
},
|
|
30
|
-
async getNewPaginatedResources(fn, params,
|
|
30
|
+
async getNewPaginatedResources(fn, params, lastCreated) {
|
|
31
31
|
const resources = [];
|
|
32
32
|
const paginator = this.paginate(fn, params);
|
|
33
33
|
|
|
@@ -36,9 +36,6 @@ export default {
|
|
|
36
36
|
if (isNewResource) {
|
|
37
37
|
resources.push(resource);
|
|
38
38
|
}
|
|
39
|
-
if (!isNewResource || resources.length >= max) {
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
39
|
}
|
|
43
40
|
return resources;
|
|
44
41
|
},
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_teams-new-channel",
|
|
6
6
|
name: "New Channel",
|
|
7
7
|
description: "Emit new event when a new channel is created within a team",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -16,12 +16,6 @@ export default {
|
|
|
16
16
|
"team",
|
|
17
17
|
],
|
|
18
18
|
},
|
|
19
|
-
max: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
base.props.microsoftTeams,
|
|
22
|
-
"max",
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
19
|
},
|
|
26
20
|
methods: {
|
|
27
21
|
...base.methods,
|
|
@@ -31,7 +25,6 @@ export default {
|
|
|
31
25
|
{
|
|
32
26
|
teamId: this.team,
|
|
33
27
|
},
|
|
34
|
-
this.max,
|
|
35
28
|
lastCreated,
|
|
36
29
|
);
|
|
37
30
|
},
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_teams-new-channel-message",
|
|
6
6
|
name: "New Channel Message",
|
|
7
7
|
description: "Emit new event when a new message is posted in a channel",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -25,12 +25,6 @@ export default {
|
|
|
25
25
|
}),
|
|
26
26
|
],
|
|
27
27
|
},
|
|
28
|
-
max: {
|
|
29
|
-
propDefinition: [
|
|
30
|
-
base.props.microsoftTeams,
|
|
31
|
-
"max",
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
28
|
},
|
|
35
29
|
methods: {
|
|
36
30
|
...base.methods,
|
|
@@ -41,7 +35,6 @@ export default {
|
|
|
41
35
|
teamId: this.team,
|
|
42
36
|
channelId: this.channel,
|
|
43
37
|
},
|
|
44
|
-
this.max,
|
|
45
38
|
lastCreated,
|
|
46
39
|
);
|
|
47
40
|
},
|
|
@@ -5,25 +5,15 @@ export default {
|
|
|
5
5
|
key: "microsoft_teams-new-chat",
|
|
6
6
|
name: "New Chat",
|
|
7
7
|
description: "Emit new event when a new chat is created",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
-
props: {
|
|
12
|
-
...base.props,
|
|
13
|
-
max: {
|
|
14
|
-
propDefinition: [
|
|
15
|
-
base.props.microsoftTeams,
|
|
16
|
-
"max",
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
11
|
methods: {
|
|
21
12
|
...base.methods,
|
|
22
13
|
async getResources(lastCreated) {
|
|
23
14
|
return this.getNewPaginatedResources(
|
|
24
15
|
this.microsoftTeams.listChats,
|
|
25
16
|
{},
|
|
26
|
-
this.max,
|
|
27
17
|
lastCreated,
|
|
28
18
|
);
|
|
29
19
|
},
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_teams-new-chat-message",
|
|
6
6
|
name: "New Chat Message",
|
|
7
7
|
description: "Emit new event when a new message is received in a chat",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -16,12 +16,6 @@ export default {
|
|
|
16
16
|
"chat",
|
|
17
17
|
],
|
|
18
18
|
},
|
|
19
|
-
max: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
base.props.microsoftTeams,
|
|
22
|
-
"max",
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
19
|
},
|
|
26
20
|
methods: {
|
|
27
21
|
...base.methods,
|
|
@@ -31,7 +25,6 @@ export default {
|
|
|
31
25
|
{
|
|
32
26
|
chatId: this.chat,
|
|
33
27
|
},
|
|
34
|
-
this.max,
|
|
35
28
|
lastCreated,
|
|
36
29
|
);
|
|
37
30
|
},
|
|
@@ -5,25 +5,15 @@ export default {
|
|
|
5
5
|
key: "microsoft_teams-new-team",
|
|
6
6
|
name: "New Team",
|
|
7
7
|
description: "Emit new event when a new team is joined by the authenticated user",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
|
-
props: {
|
|
12
|
-
...base.props,
|
|
13
|
-
max: {
|
|
14
|
-
propDefinition: [
|
|
15
|
-
base.props.microsoftTeams,
|
|
16
|
-
"max",
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
11
|
methods: {
|
|
21
12
|
...base.methods,
|
|
22
13
|
async getResources(lastCreated) {
|
|
23
14
|
return this.getNewPaginatedResources(
|
|
24
15
|
this.microsoftTeams.listTeams,
|
|
25
16
|
{},
|
|
26
|
-
this.max,
|
|
27
17
|
lastCreated,
|
|
28
18
|
);
|
|
29
19
|
},
|