@pipedream/slack 0.9.1 → 0.9.2
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/add-emoji-reaction/add-emoji-reaction.mjs +2 -2
- package/actions/approve-workflow/approve-workflow.mjs +2 -2
- package/actions/archive-channel/archive-channel.mjs +2 -2
- package/actions/common/send-message.mjs +6 -4
- package/actions/create-channel/create-channel.mjs +2 -2
- package/actions/create-reminder/create-reminder.mjs +2 -2
- package/actions/delete-file/delete-file.mjs +11 -2
- package/actions/delete-message/delete-message.mjs +2 -2
- package/actions/find-message/find-message.mjs +1 -1
- package/actions/find-user-by-email/find-user-by-email.mjs +2 -2
- package/actions/get-file/get-file.mjs +11 -2
- package/actions/invite-user-to-channel/invite-user-to-channel.mjs +15 -7
- package/actions/kick-user/kick-user.mjs +15 -7
- package/actions/list-channels/list-channels.mjs +32 -4
- package/actions/list-files/list-files.mjs +16 -3
- package/actions/list-group-members/list-group-members.mjs +33 -12
- package/actions/list-members-in-channel/list-members-in-channel.mjs +30 -5
- package/actions/list-replies/list-replies.mjs +32 -5
- package/actions/list-users/list-users.mjs +32 -5
- package/actions/reply-to-a-message/reply-to-a-message.mjs +1 -1
- package/actions/send-block-kit-message/send-block-kit-message.mjs +1 -1
- package/actions/send-large-message/send-large-message.mjs +8 -5
- package/actions/send-message/send-message.mjs +1 -1
- package/actions/send-message-advanced/send-message-advanced.mjs +1 -1
- package/actions/send-message-to-channel/send-message-to-channel.mjs +1 -1
- package/actions/send-message-to-user-or-group/send-message-to-user-or-group.mjs +1 -1
- package/actions/set-channel-description/set-channel-description.mjs +2 -2
- package/actions/set-channel-topic/set-channel-topic.mjs +2 -2
- package/actions/set-status/set-status.mjs +2 -2
- package/actions/update-group-members/update-group-members.mjs +3 -3
- package/actions/update-message/update-message.mjs +2 -2
- package/actions/update-profile/update-profile.mjs +2 -2
- package/actions/upload-file/upload-file.mjs +51 -7
- package/actions/verify-slack-signature/verify-slack-signature.mjs +1 -1
- package/common/constants.mjs +1 -1
- package/package.json +2 -2
- package/slack.app.mjs +267 -56
- package/sources/common/base.mjs +6 -6
- package/sources/new-channel-created/new-channel-created.mjs +1 -1
- package/sources/new-direct-message/new-direct-message.mjs +1 -1
- package/sources/new-interaction-event-received/new-interaction-event-received.mjs +1 -1
- package/sources/new-keyword-mention/new-keyword-mention.mjs +1 -1
- package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
- package/sources/new-reaction-added/new-reaction-added.mjs +1 -1
- package/sources/new-saved-message/new-saved-message.mjs +1 -1
- package/sources/new-user-added/new-user-added.mjs +1 -1
- package/sources/new-user-mention/new-user-mention.mjs +1 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-add-emoji-reaction",
|
|
5
5
|
name: "Add Emoji Reaction",
|
|
6
6
|
description: "Add an emoji reaction to a message. [See the documentation](https://api.slack.com/methods/reactions.add)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.15",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
async run({ $ }) {
|
|
35
|
-
const response = await this.slack.
|
|
35
|
+
const response = await this.slack.addReactions({
|
|
36
36
|
channel: this.conversation,
|
|
37
37
|
timestamp: this.timestamp,
|
|
38
38
|
name: this.icon_emoji,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-approve-workflow",
|
|
6
6
|
name: "Approve Workflow",
|
|
7
7
|
description: "Suspend the workflow until approved by a Slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.4",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
slack,
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
resume_url, cancel_url,
|
|
45
45
|
} = $.flow.suspend();
|
|
46
46
|
|
|
47
|
-
const response = await this.slack.
|
|
47
|
+
const response = await this.slack.postChatMessage({
|
|
48
48
|
text: "Click here to approve or cancel workflow",
|
|
49
49
|
blocks: [
|
|
50
50
|
{
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-archive-channel",
|
|
6
6
|
name: "Archive Channel",
|
|
7
7
|
description: "Archive a channel. [See the documentation](https://api.slack.com/methods/conversations.archive)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.23",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
slack,
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
async run({ $ }) {
|
|
27
|
-
const response = await this.slack.
|
|
27
|
+
const response = await this.slack.archiveConversations({
|
|
28
28
|
channel: this.conversation,
|
|
29
29
|
});
|
|
30
30
|
$.export("$summary", "Successfully archived channel.");
|
|
@@ -235,16 +235,18 @@ export default {
|
|
|
235
235
|
|
|
236
236
|
if (this.post_at) {
|
|
237
237
|
obj.post_at = Math.floor(new Date(this.post_at).getTime() / 1000);
|
|
238
|
-
return await this.slack.
|
|
238
|
+
return await this.slack.scheduleMessage(obj);
|
|
239
239
|
}
|
|
240
|
-
const resp = await this.slack.
|
|
240
|
+
const resp = await this.slack.postChatMessage(obj);
|
|
241
241
|
const { channel } = await this.slack.conversationsInfo({
|
|
242
242
|
channel: resp.channel,
|
|
243
243
|
});
|
|
244
244
|
let channelName = `#${channel?.name}`;
|
|
245
245
|
if (channel.is_im) {
|
|
246
|
-
const
|
|
247
|
-
|
|
246
|
+
const { profile } = await this.slack.getUserProfile({
|
|
247
|
+
user: channel.user,
|
|
248
|
+
});
|
|
249
|
+
channelName = `@${profile.real_name}`;
|
|
248
250
|
} else if (channel.is_mpim) {
|
|
249
251
|
channelName = `@${channel.purpose.value}`;
|
|
250
252
|
}
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-create-channel",
|
|
5
5
|
name: "Create a Channel",
|
|
6
6
|
description: "Create a new channel. [See the documentation](https://api.slack.com/methods/conversations.create)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.24",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
// parse name
|
|
26
26
|
const name = this.channelName.replace(/\s+/g, "-").toLowerCase();
|
|
27
27
|
|
|
28
|
-
const response = await this.slack.
|
|
28
|
+
const response = await this.slack.createConversations({
|
|
29
29
|
name,
|
|
30
30
|
is_private: this.isPrivate,
|
|
31
31
|
});
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-create-reminder",
|
|
5
5
|
name: "Create Reminder",
|
|
6
6
|
description: "Create a reminder. [See the documentation](https://api.slack.com/methods/reminders.add)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.24",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
async run({ $ }) {
|
|
38
|
-
const response = await this.slack.
|
|
38
|
+
const response = await this.slack.addReminders({
|
|
39
39
|
text: this.text,
|
|
40
40
|
team_id: this.team_id,
|
|
41
41
|
time: this.timestamp,
|
|
@@ -4,19 +4,28 @@ export default {
|
|
|
4
4
|
key: "slack-delete-file",
|
|
5
5
|
name: "Delete File",
|
|
6
6
|
description: "Delete a file. [See the documentation](https://api.slack.com/methods/files.delete)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
11
|
+
conversation: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
slack,
|
|
14
|
+
"conversation",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
11
17
|
file: {
|
|
12
18
|
propDefinition: [
|
|
13
19
|
slack,
|
|
14
20
|
"file",
|
|
21
|
+
(c) => ({
|
|
22
|
+
channel: c.conversation,
|
|
23
|
+
}),
|
|
15
24
|
],
|
|
16
25
|
},
|
|
17
26
|
},
|
|
18
27
|
async run({ $ }) {
|
|
19
|
-
const response = await this.slack.
|
|
28
|
+
const response = await this.slack.deleteFiles({
|
|
20
29
|
file: this.file,
|
|
21
30
|
});
|
|
22
31
|
$.export("$summary", `Successfully deleted file with ID ${this.file}`);
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-delete-message",
|
|
5
5
|
name: "Delete Message",
|
|
6
6
|
description: "Delete a message. [See the documentation](https://api.slack.com/methods/chat.delete)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
async run({ $ }) {
|
|
32
|
-
const response = await this.slack.
|
|
32
|
+
const response = await this.slack.deleteMessage({
|
|
33
33
|
channel: this.conversation,
|
|
34
34
|
ts: this.timestamp,
|
|
35
35
|
as_user: this.as_user,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-find-user-by-email",
|
|
5
5
|
name: "Find User by Email",
|
|
6
6
|
description: "Find a user by matching against their email. [See the documentation](https://api.slack.com/methods/users.lookupByEmail)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
async run({ $ }) {
|
|
19
|
-
const response = await this.slack.
|
|
19
|
+
const response = await this.slack.lookupUserByEmail({
|
|
20
20
|
email: this.email,
|
|
21
21
|
});
|
|
22
22
|
if (response.ok) {
|
|
@@ -4,19 +4,28 @@ export default {
|
|
|
4
4
|
key: "slack-get-file",
|
|
5
5
|
name: "Get File",
|
|
6
6
|
description: "Return information about a file. [See the documentation](https://api.slack.com/methods/files.info)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
11
|
+
conversation: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
slack,
|
|
14
|
+
"conversation",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
11
17
|
file: {
|
|
12
18
|
propDefinition: [
|
|
13
19
|
slack,
|
|
14
20
|
"file",
|
|
21
|
+
(c) => ({
|
|
22
|
+
channel: c.conversation,
|
|
23
|
+
}),
|
|
15
24
|
],
|
|
16
25
|
},
|
|
17
26
|
},
|
|
18
27
|
async run({ $ }) {
|
|
19
|
-
const response = await this.slack.
|
|
28
|
+
const response = await this.slack.getFileInfo({
|
|
20
29
|
file: this.file,
|
|
21
30
|
});
|
|
22
31
|
$.export("$summary", `Successfully retrieved file with ID ${this.file}`);
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-invite-user-to-channel",
|
|
5
5
|
name: "Invite User to Channel",
|
|
6
6
|
description: "Invite a user to an existing channel. [See the documentation](https://api.slack.com/methods/conversations.invite)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -22,11 +22,19 @@ export default {
|
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
async run({ $ }) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
try {
|
|
26
|
+
const response = await this.slack.inviteToConversation({
|
|
27
|
+
channel: this.conversation,
|
|
28
|
+
users: this.user,
|
|
29
|
+
});
|
|
30
|
+
$.export("$summary", `Successfully invited user ${this.user} to channel with ID ${this.conversation}`);
|
|
31
|
+
return response;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error.includes("already_in_channel")) {
|
|
34
|
+
$.export("$summary", `The user ${this.user} is already in the channel`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
31
39
|
},
|
|
32
40
|
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack-kick-user",
|
|
6
6
|
name: "Kick User",
|
|
7
7
|
description: "Remove a user from a conversation. [See the documentation](https://api.slack.com/methods/conversations.kick)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.23",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
slack,
|
|
@@ -33,11 +33,19 @@ export default {
|
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
async run({ $ }) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
try {
|
|
37
|
+
const response = await this.slack.kickUserFromConversation({
|
|
38
|
+
channel: this.conversation,
|
|
39
|
+
user: this.user,
|
|
40
|
+
});
|
|
41
|
+
$.export("$summary", `Successfully kicked user ${this.user} from channel with ID ${this.conversation}`);
|
|
42
|
+
return response;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (error.includes("not_in_channel")) {
|
|
45
|
+
$.export("$summary", `The user ${this.user} is not in the channel`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
42
50
|
},
|
|
43
51
|
};
|
|
@@ -4,16 +4,44 @@ export default {
|
|
|
4
4
|
key: "slack-list-channels",
|
|
5
5
|
name: "List Channels",
|
|
6
6
|
description: "Return a list of all channels in a workspace. [See the documentation](https://api.slack.com/methods/conversations.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
11
|
+
pageSize: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
slack,
|
|
14
|
+
"pageSize",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
numPages: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
slack,
|
|
20
|
+
"numPages",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
11
23
|
},
|
|
12
24
|
async run({ $ }) {
|
|
13
|
-
const
|
|
14
|
-
|
|
25
|
+
const allChannels = [];
|
|
26
|
+
const params = {
|
|
27
|
+
limit: this.pageSize,
|
|
28
|
+
};
|
|
29
|
+
let page = 0;
|
|
30
|
+
|
|
31
|
+
do {
|
|
32
|
+
const {
|
|
33
|
+
channels, response_metadata: { next_cursor: nextCursor },
|
|
34
|
+
} = await this.slack.conversationsList(params);
|
|
35
|
+
allChannels.push(...channels);
|
|
36
|
+
params.cursor = nextCursor;
|
|
37
|
+
page++;
|
|
38
|
+
} while (params.cursor && page < this.numPages);
|
|
39
|
+
|
|
40
|
+
$.export("$summary", `Successfully found ${allChannels.length} channel${allChannels.length === 1
|
|
15
41
|
? ""
|
|
16
42
|
: "s"}`);
|
|
17
|
-
return
|
|
43
|
+
return {
|
|
44
|
+
channels: allChannels,
|
|
45
|
+
};
|
|
18
46
|
},
|
|
19
47
|
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-files",
|
|
5
5
|
name: "List Files",
|
|
6
6
|
description: "Return a list of files within a team. [See the documentation](https://api.slack.com/methods/files.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.51",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -28,6 +28,18 @@ export default {
|
|
|
28
28
|
],
|
|
29
29
|
optional: true,
|
|
30
30
|
},
|
|
31
|
+
pageSize: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
slack,
|
|
34
|
+
"pageSize",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
numPages: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
slack,
|
|
40
|
+
"numPages",
|
|
41
|
+
],
|
|
42
|
+
},
|
|
31
43
|
},
|
|
32
44
|
async run({ $ }) {
|
|
33
45
|
const allFiles = [];
|
|
@@ -36,15 +48,16 @@ export default {
|
|
|
36
48
|
user: this.user,
|
|
37
49
|
team_id: this.team_id,
|
|
38
50
|
page: 1,
|
|
51
|
+
count: this.pageSize,
|
|
39
52
|
};
|
|
40
53
|
let hasMore;
|
|
41
54
|
|
|
42
55
|
do {
|
|
43
|
-
const { files } = await this.slack.
|
|
56
|
+
const { files } = await this.slack.listFiles(params);
|
|
44
57
|
allFiles.push(...files);
|
|
45
58
|
hasMore = files.length;
|
|
46
59
|
params.page++;
|
|
47
|
-
} while (hasMore);
|
|
60
|
+
} while (hasMore && params.page <= this.numPages);
|
|
48
61
|
|
|
49
62
|
$.export("$summary", `Successfully retrieved ${allFiles.length} file${allFiles.length === 1
|
|
50
63
|
? ""
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-group-members",
|
|
5
5
|
name: "List Group Members",
|
|
6
6
|
description: "List all users in a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -22,21 +22,42 @@ export default {
|
|
|
22
22
|
optional: true,
|
|
23
23
|
description: "Encoded team id where the user group exists, required if org token is used.",
|
|
24
24
|
},
|
|
25
|
+
pageSize: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
slack,
|
|
28
|
+
"pageSize",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
numPages: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
slack,
|
|
34
|
+
"numPages",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
25
37
|
},
|
|
26
38
|
async run({ $ }) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
const members = [];
|
|
40
|
+
const params = {
|
|
41
|
+
usergroup: this.userGroup,
|
|
42
|
+
team_id: this.team,
|
|
43
|
+
limit: this.pageSize,
|
|
44
|
+
};
|
|
45
|
+
let page = 0;
|
|
46
|
+
|
|
47
|
+
do {
|
|
48
|
+
const {
|
|
49
|
+
users, response_metadata: { next_cursor: nextCursor },
|
|
50
|
+
} = await this.slack.listGroupMembers(params);
|
|
51
|
+
members.push(...users);
|
|
52
|
+
params.cursor = nextCursor;
|
|
53
|
+
page++;
|
|
54
|
+
} while (params.cursor && page < this.numPages);
|
|
55
|
+
|
|
56
|
+
if (members?.length) {
|
|
57
|
+
$.export("$summary", `Successfully retrieved ${members.length} user${members.length === 1
|
|
37
58
|
? ""
|
|
38
59
|
: "s"}`);
|
|
39
60
|
}
|
|
40
|
-
return
|
|
61
|
+
return members;
|
|
41
62
|
},
|
|
42
63
|
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-members-in-channel",
|
|
5
5
|
name: "List Members in Channel",
|
|
6
6
|
description: "Retrieve members of a channel. [See the documentation](https://api.slack.com/methods/conversations.members)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -20,19 +20,44 @@ export default {
|
|
|
20
20
|
description: "Optionally, return usernames in addition to IDs",
|
|
21
21
|
optional: true,
|
|
22
22
|
},
|
|
23
|
+
pageSize: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
slack,
|
|
26
|
+
"pageSize",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
numPages: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
slack,
|
|
32
|
+
"numPages",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
23
35
|
},
|
|
24
36
|
async run({ $ }) {
|
|
25
|
-
|
|
37
|
+
let channelMembers = [];
|
|
38
|
+
const params = {
|
|
26
39
|
channel: this.conversation,
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
limit: this.pageSize,
|
|
41
|
+
};
|
|
42
|
+
let page = 0;
|
|
43
|
+
|
|
44
|
+
do {
|
|
45
|
+
const {
|
|
46
|
+
members, response_metadata: { next_cursor: nextCursor },
|
|
47
|
+
} = await this.slack.listChannelMembers(params);
|
|
48
|
+
channelMembers.push(...members);
|
|
49
|
+
params.cursor = nextCursor;
|
|
50
|
+
page++;
|
|
51
|
+
} while (params.cursor && page < this.numPages);
|
|
52
|
+
|
|
29
53
|
if (this.returnUsernames) {
|
|
30
|
-
const usernames = await this.slack.
|
|
54
|
+
const usernames = await this.slack.userNameLookup(channelMembers);
|
|
31
55
|
channelMembers = channelMembers?.map((id) => ({
|
|
32
56
|
id,
|
|
33
57
|
username: usernames[id],
|
|
34
58
|
})) || [];
|
|
35
59
|
}
|
|
60
|
+
|
|
36
61
|
$.export("$summary", `Successfully retrieved ${channelMembers.length} member${channelMembers.length === 1
|
|
37
62
|
? ""
|
|
38
63
|
: "s"}`);
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-replies",
|
|
5
5
|
name: "List Replies",
|
|
6
6
|
description: "Retrieve a thread of messages posted to a conversation. [See the documentation](https://api.slack.com/methods/conversations.replies)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -20,15 +20,42 @@ export default {
|
|
|
20
20
|
"messageTs",
|
|
21
21
|
],
|
|
22
22
|
},
|
|
23
|
+
pageSize: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
slack,
|
|
26
|
+
"pageSize",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
numPages: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
slack,
|
|
32
|
+
"numPages",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
23
35
|
},
|
|
24
36
|
async run({ $ }) {
|
|
25
|
-
const
|
|
37
|
+
const replies = [];
|
|
38
|
+
const params = {
|
|
26
39
|
channel: this.conversation,
|
|
27
40
|
ts: this.timestamp,
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
limit: this.pageSize,
|
|
42
|
+
};
|
|
43
|
+
let page = 0;
|
|
44
|
+
|
|
45
|
+
do {
|
|
46
|
+
const {
|
|
47
|
+
messages, response_metadata: { next_cursor: nextCursor },
|
|
48
|
+
} = await this.slack.getConversationReplies(params);
|
|
49
|
+
replies.push(...messages);
|
|
50
|
+
params.cursor = nextCursor;
|
|
51
|
+
page++;
|
|
52
|
+
} while (params.cursor && page < this.numPages);
|
|
53
|
+
|
|
54
|
+
$.export("$summary", `Successfully retrieved ${replies.length} reply message${replies.length === 1
|
|
30
55
|
? ""
|
|
31
56
|
: "s"}`);
|
|
32
|
-
return
|
|
57
|
+
return {
|
|
58
|
+
messages: replies,
|
|
59
|
+
};
|
|
33
60
|
},
|
|
34
61
|
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack-list-users",
|
|
5
5
|
name: "List Users",
|
|
6
6
|
description: "Return a list of all users in a workspace. [See the documentation](https://api.slack.com/methods/users.list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.23",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
slack,
|
|
@@ -15,14 +15,41 @@ export default {
|
|
|
15
15
|
],
|
|
16
16
|
optional: true,
|
|
17
17
|
},
|
|
18
|
+
pageSize: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
slack,
|
|
21
|
+
"pageSize",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
numPages: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
slack,
|
|
27
|
+
"numPages",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
18
30
|
},
|
|
19
31
|
async run({ $ }) {
|
|
20
|
-
const
|
|
32
|
+
const users = [];
|
|
33
|
+
const params = {
|
|
21
34
|
team_id: this.teamId,
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
limit: this.pageSize,
|
|
36
|
+
};
|
|
37
|
+
let page = 0;
|
|
38
|
+
|
|
39
|
+
do {
|
|
40
|
+
const {
|
|
41
|
+
members, response_metadata: { next_cursor: nextCursor },
|
|
42
|
+
} = await this.slack.usersList(params);
|
|
43
|
+
users.push(...members);
|
|
44
|
+
params.cursor = nextCursor;
|
|
45
|
+
page++;
|
|
46
|
+
} while (params.cursor && page < this.numPages);
|
|
47
|
+
|
|
48
|
+
$.export("$summary", `Successfully retrieved ${users.length} user${users.length === 1
|
|
24
49
|
? ""
|
|
25
50
|
: "s"}`);
|
|
26
|
-
return
|
|
51
|
+
return {
|
|
52
|
+
members: users,
|
|
53
|
+
};
|
|
27
54
|
},
|
|
28
55
|
};
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack-reply-to-a-message",
|
|
7
7
|
name: "Reply to a Message Thread",
|
|
8
8
|
description: "Send a message as a threaded reply. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.28",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
slack: common.props.slack,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "slack-send-block-kit-message",
|
|
8
8
|
name: "Build and Send a Block Kit Message",
|
|
9
9
|
description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).",
|
|
10
|
-
version: "0.4.
|
|
10
|
+
version: "0.4.4",
|
|
11
11
|
type: "action",
|
|
12
12
|
props: {
|
|
13
13
|
slack: common.props.slack,
|