@pipedream/slack_v2 0.3.2 → 0.5.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.
- package/actions/add-emoji-reaction/add-emoji-reaction.mjs +1 -1
- package/actions/add-reaction/add-reaction.mjs +47 -0
- package/actions/approve-workflow/approve-workflow.mjs +1 -1
- package/actions/archive-channel/archive-channel.mjs +1 -1
- package/actions/browse-files/browse-files.mjs +58 -0
- package/actions/create-channel/create-channel.mjs +1 -1
- package/actions/create-reminder/create-reminder.mjs +1 -1
- package/actions/delete-file/delete-file.mjs +1 -1
- package/actions/delete-message/delete-message.mjs +1 -1
- package/actions/edit-message/edit-message.mjs +63 -0
- package/actions/find-message/find-message.mjs +1 -1
- package/actions/find-user-by-email/find-user-by-email.mjs +1 -1
- package/actions/find-user-by-id/find-user-by-id.mjs +1 -1
- package/actions/get-channel-details/get-channel-details.mjs +1 -1
- package/actions/get-channel-history/get-channel-history.mjs +64 -0
- package/actions/get-current-user/get-current-user.mjs +1 -1
- package/actions/get-file/get-file.mjs +1 -1
- package/actions/get-thread-replies/get-thread-replies.mjs +55 -0
- package/actions/get-user-details/get-user-details.mjs +53 -0
- package/actions/invite-user-to-channel/invite-user-to-channel.mjs +1 -1
- package/actions/kick-user/kick-user.mjs +1 -1
- package/actions/list-channels/list-channels.mjs +1 -1
- package/actions/list-emojis/list-emojis.mjs +1 -1
- package/actions/list-files/list-files.mjs +1 -1
- package/actions/list-group-members/list-group-members.mjs +1 -1
- package/actions/list-icon-emoji-options/list-icon-emoji-options.mjs +24 -0
- package/actions/list-members-in-channel/list-members-in-channel.mjs +1 -1
- package/actions/list-messages/list-messages.mjs +1 -1
- package/actions/list-replies/list-replies.mjs +1 -1
- package/actions/list-user-group-options/list-user-group-options.mjs +24 -0
- package/actions/list-users/list-users.mjs +1 -1
- package/actions/post-message/post-message.mjs +114 -0
- package/actions/reply-to-a-message/reply-to-a-message.mjs +1 -1
- package/actions/search/search.mjs +64 -0
- package/actions/send-block-kit-message/send-block-kit-message.mjs +1 -1
- package/actions/send-large-message/send-large-message.mjs +1 -1
- 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 +1 -1
- package/actions/set-channel-topic/set-channel-topic.mjs +1 -1
- package/actions/set-status/set-status.mjs +1 -1
- package/actions/update-group-members/update-group-members.mjs +1 -1
- package/actions/update-message/update-message.mjs +1 -1
- package/actions/update-profile/update-profile.mjs +1 -1
- package/actions/upload-file/upload-file.mjs +1 -1
- package/actions/verify-slack-signature/verify-slack-signature.mjs +1 -1
- package/package.json +2 -2
- package/slack_v2.app.mjs +40 -0
- package/sources/new-channel-created/new-channel-created.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-private-channel-created/new-private-channel-created.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_v2-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.20",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-add-reaction",
|
|
5
|
+
name: "Add Reaction",
|
|
6
|
+
description:
|
|
7
|
+
"Add an emoji reaction to a message."
|
|
8
|
+
+ " Accepts a channel ID or channel name (resolved automatically)."
|
|
9
|
+
+ " Use **Get Channel History** or **Search** to find the message timestamp."
|
|
10
|
+
+ " Emoji name should be without colons (e.g. `thumbsup`, `fire`, `heart`)."
|
|
11
|
+
+ " [See the documentation](https://api.slack.com/methods/reactions.add)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: false,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
slack,
|
|
21
|
+
channel: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Channel",
|
|
24
|
+
description: "Channel ID (e.g. `C1234567890`) or channel name (e.g. `general` or `#general`). Resolved automatically.",
|
|
25
|
+
},
|
|
26
|
+
timestamp: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Message Timestamp",
|
|
29
|
+
description: "The `ts` of the message to react to (e.g. `1234567890.123456`).",
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
type: "string",
|
|
33
|
+
label: "Emoji Name",
|
|
34
|
+
description: "The emoji name without colons (e.g. `thumbsup`, `fire`, `heart`).",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
async run({ $ }) {
|
|
38
|
+
const channelId = await this.slack.resolveChannelId(this.channel);
|
|
39
|
+
const response = await this.slack.addReactions({
|
|
40
|
+
channel: channelId,
|
|
41
|
+
timestamp: this.timestamp,
|
|
42
|
+
name: this.name,
|
|
43
|
+
});
|
|
44
|
+
$.export("$summary", `Added :${this.name}: reaction`);
|
|
45
|
+
return response;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-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.9",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-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.28",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-browse-files",
|
|
5
|
+
name: "Browse Files",
|
|
6
|
+
description:
|
|
7
|
+
"List files shared in a channel or across the workspace."
|
|
8
|
+
+ " Accepts a channel ID or channel name (resolved automatically)."
|
|
9
|
+
+ " Filter by file type (e.g. `images`, `pdfs`, `snippets`)."
|
|
10
|
+
+ " Returns file metadata including name, type, size, and download URL."
|
|
11
|
+
+ " [See the documentation](https://api.slack.com/methods/files.list)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
slack,
|
|
21
|
+
channel: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Channel",
|
|
24
|
+
description: "Channel ID (e.g. `C1234567890`) or channel name (e.g. `general` or `#general`). Resolved automatically. If omitted, lists files across the workspace.",
|
|
25
|
+
optional: true,
|
|
26
|
+
},
|
|
27
|
+
types: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "File Types",
|
|
30
|
+
description: "Filter by file type. Comma-separated: `all`, `spaces`, `snippets`, `images`, `gdocs`, `zips`, `pdfs`. Default: `all`.",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
33
|
+
count: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
label: "Count",
|
|
36
|
+
description: "Number of files to return. Default: 20.",
|
|
37
|
+
default: 20,
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $ }) {
|
|
42
|
+
const args = {
|
|
43
|
+
count: this.count ?? 20,
|
|
44
|
+
types: this.types,
|
|
45
|
+
};
|
|
46
|
+
if (this.channel) {
|
|
47
|
+
args.channel = await this.slack.resolveChannelId(this.channel);
|
|
48
|
+
}
|
|
49
|
+
const response = await this.slack.listFiles(args);
|
|
50
|
+
const files = response.files || [];
|
|
51
|
+
$.export("$summary", `Found ${files.length} file${files.length === 1
|
|
52
|
+
? ""
|
|
53
|
+
: "s"}`);
|
|
54
|
+
return {
|
|
55
|
+
files,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.29",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.29",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.1.
|
|
7
|
+
version: "0.1.3",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "slack_v2-edit-message",
|
|
6
|
+
name: "Edit Message",
|
|
7
|
+
description:
|
|
8
|
+
"Edit an existing message."
|
|
9
|
+
+ " Accepts a channel ID or channel name (resolved automatically)."
|
|
10
|
+
+ " Requires the message timestamp (`ts`) from **Get Channel History** or **Post Message**."
|
|
11
|
+
+ " You can only edit messages posted by the same token/user."
|
|
12
|
+
+ " [See the documentation](https://api.slack.com/methods/chat.update)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
slack,
|
|
22
|
+
channel: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Channel",
|
|
25
|
+
description: "Channel ID (e.g. `C1234567890`) or channel name (e.g. `general` or `#general`). Resolved automatically.",
|
|
26
|
+
},
|
|
27
|
+
timestamp: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "Message Timestamp",
|
|
30
|
+
description: "The `ts` of the message to edit (e.g. `1234567890.123456`). Get this from **Post Message** response or **Get Channel History**.",
|
|
31
|
+
},
|
|
32
|
+
text: {
|
|
33
|
+
type: "string",
|
|
34
|
+
label: "Text",
|
|
35
|
+
description: "The new message text. Supports Slack mrkdwn formatting.",
|
|
36
|
+
},
|
|
37
|
+
blocks: {
|
|
38
|
+
type: "string",
|
|
39
|
+
label: "Blocks",
|
|
40
|
+
description: "JSON array of Block Kit blocks. Replaces existing blocks. Example: `[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Updated* message\"}}]`.",
|
|
41
|
+
optional: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
async run({ $ }) {
|
|
45
|
+
// chat.update requires a channel ID (unlike chat.postMessage which accepts names)
|
|
46
|
+
const channelId = await this.slack.resolveChannelId(this.channel);
|
|
47
|
+
const args = {
|
|
48
|
+
channel: channelId,
|
|
49
|
+
ts: this.timestamp,
|
|
50
|
+
text: this.text,
|
|
51
|
+
};
|
|
52
|
+
if (this.blocks) {
|
|
53
|
+
try {
|
|
54
|
+
args.blocks = JSON.parse(this.blocks);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
throw new ConfigurationError("Invalid JSON string: " + error.message);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const response = await this.slack.updateMessage(args);
|
|
60
|
+
$.export("$summary", `Message updated in ${channelId}`);
|
|
61
|
+
return response;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-find-message",
|
|
5
5
|
name: "Find Message",
|
|
6
6
|
description: "Find a Slack message. [See the documentation](https://api.slack.com/methods/assistant.search.context)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.3",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-find-user-by-id",
|
|
5
5
|
name: "Find User by ID",
|
|
6
6
|
description: "Find a user by their ID. Returns user profile information including name, email (requires `users:read.email` scope), timezone, and status. [See the documentation](https://api.slack.com/methods/users.info)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-get-channel-details",
|
|
5
5
|
name: "Get Channel Details",
|
|
6
6
|
description: "Retrieve details for a Slack channel by selecting it or providing an ID. [See the documentation](https://api.slack.com/methods/conversations.info)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-get-channel-history",
|
|
5
|
+
name: "Get Channel History",
|
|
6
|
+
description:
|
|
7
|
+
"Read the recent message history from a specific channel."
|
|
8
|
+
+ " Accepts a channel ID or channel name (resolved automatically)."
|
|
9
|
+
+ " Use this when you want to see a channel's latest messages — unlike **Search** which finds messages by keyword."
|
|
10
|
+
+ " Returns messages with text, timestamps (ts), reactions, and user IDs."
|
|
11
|
+
+ " Message timestamps can be used with **Get Thread Replies**, **Edit Message**, and **Add Reaction**."
|
|
12
|
+
+ " [See the documentation](https://api.slack.com/methods/conversations.history)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
slack,
|
|
22
|
+
channel: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Channel",
|
|
25
|
+
description: "Channel ID (e.g. `C1234567890`) or channel name (e.g. `general` or `#general`). Resolved automatically.",
|
|
26
|
+
},
|
|
27
|
+
limit: {
|
|
28
|
+
type: "integer",
|
|
29
|
+
label: "Limit",
|
|
30
|
+
description: "Maximum number of messages to return. Default: 20.",
|
|
31
|
+
default: 20,
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
oldest: {
|
|
35
|
+
type: "string",
|
|
36
|
+
label: "Oldest",
|
|
37
|
+
description: "Only messages after this Unix timestamp. Inclusive.",
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
latest: {
|
|
41
|
+
type: "string",
|
|
42
|
+
label: "Latest",
|
|
43
|
+
description: "Only messages before this Unix timestamp. Default: now.",
|
|
44
|
+
optional: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async run({ $ }) {
|
|
48
|
+
const channelId = await this.slack.resolveChannelId(this.channel);
|
|
49
|
+
const response = await this.slack.conversationsHistory({
|
|
50
|
+
channel: channelId,
|
|
51
|
+
limit: this.limit ?? 20,
|
|
52
|
+
oldest: this.oldest,
|
|
53
|
+
latest: this.latest,
|
|
54
|
+
include_all_metadata: true,
|
|
55
|
+
});
|
|
56
|
+
const messages = response.messages || [];
|
|
57
|
+
$.export("$summary", `Retrieved ${messages.length} message${messages.length === 1
|
|
58
|
+
? ""
|
|
59
|
+
: "s"} from channel`);
|
|
60
|
+
return {
|
|
61
|
+
messages,
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-get-current-user",
|
|
5
5
|
name: "Get Current User",
|
|
6
6
|
description: "Retrieve comprehensive context about the authenticated Slack member, combining `auth.test`, `users.info`, `users.profile.get`, and `team.info` payloads. Returns the user’s profile (name variants, email, locale, timezone, status, admin flags), raw auth test data, and workspace metadata (domain, enterprise info, icons). Ideal when you need to confirm which user token is active, tailor messages to their locale/timezone, or ground an LLM in the member’s role and workspace before executing other Slack actions. [See Slack API docs](https://api.slack.com/methods/auth.test).",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-get-file",
|
|
6
6
|
name: "Get File",
|
|
7
7
|
description: "Return information about a file. [See the documentation](https://api.slack.com/methods/files.info)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-get-thread-replies",
|
|
5
|
+
name: "Get Thread Replies",
|
|
6
|
+
description:
|
|
7
|
+
"Retrieve all replies in a message thread."
|
|
8
|
+
+ " Accepts a channel ID or channel name (resolved automatically)."
|
|
9
|
+
+ " Use **Get Channel History** or **Search** to find the parent message's timestamp (thread_ts)."
|
|
10
|
+
+ " Returns the parent message followed by all replies in chronological order."
|
|
11
|
+
+ " [See the documentation](https://api.slack.com/methods/conversations.replies)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
slack,
|
|
21
|
+
channel: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Channel",
|
|
24
|
+
description: "Channel ID (e.g. `C1234567890`) or channel name (e.g. `general` or `#general`). Resolved automatically.",
|
|
25
|
+
},
|
|
26
|
+
threadTs: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Thread Timestamp",
|
|
29
|
+
description: "The `ts` of the parent message (e.g. `1234567890.123456`).",
|
|
30
|
+
},
|
|
31
|
+
limit: {
|
|
32
|
+
type: "integer",
|
|
33
|
+
label: "Limit",
|
|
34
|
+
description: "Maximum number of replies to return. Default: 50.",
|
|
35
|
+
default: 50,
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
async run({ $ }) {
|
|
40
|
+
const channelId = await this.slack.resolveChannelId(this.channel);
|
|
41
|
+
const response = await this.slack.getConversationReplies({
|
|
42
|
+
channel: channelId,
|
|
43
|
+
ts: this.threadTs,
|
|
44
|
+
limit: this.limit ?? 50,
|
|
45
|
+
});
|
|
46
|
+
const messages = response.messages || [];
|
|
47
|
+
const replyCount = Math.max(messages.length - 1, 0);
|
|
48
|
+
$.export("$summary", `Retrieved ${replyCount} repl${replyCount === 1
|
|
49
|
+
? "y"
|
|
50
|
+
: "ies"} in thread`);
|
|
51
|
+
return {
|
|
52
|
+
messages,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-get-user-details",
|
|
5
|
+
name: "Get User Details",
|
|
6
|
+
description:
|
|
7
|
+
"Retrieve the authenticated user's identity and workspace context."
|
|
8
|
+
+ " Returns user ID, name, email, timezone, profile, and workspace metadata."
|
|
9
|
+
+ " Call this first in any session to establish who you are — other tools like"
|
|
10
|
+
+ " **Search** and **List Channels** can then filter by your user ID."
|
|
11
|
+
+ " [See the documentation](https://api.slack.com/methods/auth.test)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
slack,
|
|
21
|
+
},
|
|
22
|
+
async run({ $ }) {
|
|
23
|
+
const authContext = await this.slack.authTest();
|
|
24
|
+
const userId = authContext.user_id || authContext.user;
|
|
25
|
+
|
|
26
|
+
const { user } = await this.slack.usersInfo({
|
|
27
|
+
user: userId,
|
|
28
|
+
include_locale: true,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const { profile } = await this.slack.getUserProfile({
|
|
32
|
+
user: userId,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { team } = await this.slack.getTeamInfo();
|
|
36
|
+
|
|
37
|
+
const displayName =
|
|
38
|
+
profile?.real_name_normalized
|
|
39
|
+
|| profile?.display_name_normalized
|
|
40
|
+
|| authContext.user
|
|
41
|
+
|| userId;
|
|
42
|
+
|
|
43
|
+
$.export("$summary", `Authenticated as ${displayName} in ${team?.name || authContext.team}`);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
user_id: userId,
|
|
47
|
+
user,
|
|
48
|
+
profile,
|
|
49
|
+
team,
|
|
50
|
+
authContext,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-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.28",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.1.
|
|
7
|
+
version: "0.1.4",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "List Emojis",
|
|
6
6
|
description:
|
|
7
7
|
"List all available emojis in the Slack workspace. Optionally include emoji image URLs. [See the documentation](https://api.slack.com/methods/emoji.list)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-list-files",
|
|
6
6
|
name: "List Files",
|
|
7
7
|
description: "Return a list of files within a team. [See the documentation](https://api.slack.com/methods/files.list)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import slack_v2 from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-list-icon-emoji-options",
|
|
5
|
+
name: "List Icon (emoji) Options",
|
|
6
|
+
description: "Retrieves available options for the Icon (emoji) field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
slack_v2,
|
|
16
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const options = await slack_v2.propDefinitions.icon_emoji.options.call(this.slack_v2);
|
|
19
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
|
+
? ""
|
|
21
|
+
: "s"}`);
|
|
22
|
+
return options;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "List Messages",
|
|
6
6
|
description:
|
|
7
7
|
"Retrieve messages from a Slack conversation, including reactions. [See the documentation](https://api.slack.com/methods/conversations.history)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-list-replies",
|
|
6
6
|
name: "List Replies",
|
|
7
7
|
description: "Retrieve a thread of messages posted to a conversation. [See the documentation](https://api.slack.com/methods/conversations.replies)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.28",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import slack_v2 from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-list-user-group-options",
|
|
5
|
+
name: "List User Group Options",
|
|
6
|
+
description: "Retrieves available options for the User Group field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
slack_v2,
|
|
16
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const options = await slack_v2.propDefinitions.userGroup.options.call(this.slack_v2);
|
|
19
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
|
+
? ""
|
|
21
|
+
: "s"}`);
|
|
22
|
+
return options;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-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.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "slack_v2-post-message",
|
|
6
|
+
name: "Post Message",
|
|
7
|
+
description:
|
|
8
|
+
"Send a message to a channel, user, or group."
|
|
9
|
+
+ " Accepts a channel ID (e.g. `C1234567890`) or channel name (e.g. `#general` or `general`) — names are resolved automatically."
|
|
10
|
+
+ " To reply to a thread, provide `thread_ts` from **Get Channel History**."
|
|
11
|
+
+ " Supports plain text with Slack mrkdwn formatting and Block Kit blocks."
|
|
12
|
+
+ " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
slack,
|
|
22
|
+
channel: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Channel",
|
|
25
|
+
description: "Channel ID (e.g. `C1234567890`), channel name (e.g. `general` or `#general`), user ID, or group ID. Channel names are resolved to IDs automatically.",
|
|
26
|
+
},
|
|
27
|
+
text: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "Text",
|
|
30
|
+
description: "The message text. Supports Slack mrkdwn formatting (e.g. `*bold*`, `_italic_`, `<https://example.com|link>`).",
|
|
31
|
+
},
|
|
32
|
+
blocks: {
|
|
33
|
+
type: "string",
|
|
34
|
+
label: "Blocks",
|
|
35
|
+
description: "JSON array of Block Kit blocks for rich message layouts. Example: `[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Hello from Pipedream\"}}]`.",
|
|
36
|
+
optional: true,
|
|
37
|
+
},
|
|
38
|
+
threadTs: {
|
|
39
|
+
type: "string",
|
|
40
|
+
label: "Thread Timestamp",
|
|
41
|
+
description: "The `ts` of a parent message to reply to. If provided, the message is posted as a threaded reply.",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
replyBroadcast: {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
label: "Reply Broadcast",
|
|
47
|
+
description: "When replying to a thread, set to `true` to also post the reply to the channel.",
|
|
48
|
+
default: false,
|
|
49
|
+
optional: true,
|
|
50
|
+
},
|
|
51
|
+
unfurlLinks: {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
label: "Unfurl Links",
|
|
54
|
+
description: "Enable unfurling of text-based content (URLs).",
|
|
55
|
+
default: true,
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
unfurlMedia: {
|
|
59
|
+
type: "boolean",
|
|
60
|
+
label: "Unfurl Media",
|
|
61
|
+
description: "Enable unfurling of media content.",
|
|
62
|
+
default: true,
|
|
63
|
+
optional: true,
|
|
64
|
+
},
|
|
65
|
+
mrkdwn: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
label: "Parse Markdown",
|
|
68
|
+
description: "Set to `false` to disable Slack mrkdwn parsing.",
|
|
69
|
+
default: true,
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
async run({ $ }) {
|
|
74
|
+
// chat.postMessage accepts channel names directly — no ID resolution needed
|
|
75
|
+
const channel = this.slack.normalizeChannel(this.channel);
|
|
76
|
+
const args = {
|
|
77
|
+
channel,
|
|
78
|
+
text: this.text,
|
|
79
|
+
mrkdwn: this.mrkdwn,
|
|
80
|
+
unfurl_links: this.unfurlLinks,
|
|
81
|
+
unfurl_media: this.unfurlMedia,
|
|
82
|
+
};
|
|
83
|
+
if (this.blocks) {
|
|
84
|
+
try {
|
|
85
|
+
args.blocks = JSON.parse(this.blocks);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
throw new ConfigurationError("Invalid JSON string: " + error.message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (this.threadTs) {
|
|
91
|
+
args.thread_ts = this.threadTs;
|
|
92
|
+
args.reply_broadcast = this.replyBroadcast;
|
|
93
|
+
}
|
|
94
|
+
const response = await this.slack.postChatMessage(args);
|
|
95
|
+
let permalink;
|
|
96
|
+
try {
|
|
97
|
+
const permalinkResponse = await this.slack.makeRequest({
|
|
98
|
+
method: "chat.getPermalink",
|
|
99
|
+
channel: response.channel,
|
|
100
|
+
message_ts: response.ts,
|
|
101
|
+
});
|
|
102
|
+
permalink = permalinkResponse?.permalink;
|
|
103
|
+
} catch {
|
|
104
|
+
// Best-effort enrichment only. Posting already succeeded.
|
|
105
|
+
}
|
|
106
|
+
$.export("$summary", `Message sent to ${response.channel}${this.threadTs
|
|
107
|
+
? " (thread reply)"
|
|
108
|
+
: ""}`);
|
|
109
|
+
return {
|
|
110
|
+
...response,
|
|
111
|
+
permalink: permalink,
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack_v2-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.2.
|
|
9
|
+
version: "0.2.3",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import slack from "../../slack_v2.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "slack_v2-search",
|
|
5
|
+
name: "Search",
|
|
6
|
+
description:
|
|
7
|
+
"Search Slack messages and files using the Real-Time Search API."
|
|
8
|
+
+ " Supports keyword and semantic search across public and private channels."
|
|
9
|
+
+ " Use **Get User Details** first to find your user ID for filtering by 'my' messages."
|
|
10
|
+
+ " Returns matching messages with channel context, timestamps, and permalinks."
|
|
11
|
+
+ " [See the documentation](https://api.slack.com/methods/assistant.search.context)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
slack,
|
|
21
|
+
query: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Query",
|
|
24
|
+
description: "The search query. Supports Slack search syntax — e.g. `from:@user`, `in:#channel`, `before:2025-01-01`.",
|
|
25
|
+
},
|
|
26
|
+
channelTypes: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Channel Types",
|
|
29
|
+
description: "Comma-separated channel types to search. Default: `public_channel,private_channel`.",
|
|
30
|
+
default: "public_channel,private_channel",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
33
|
+
limit: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
label: "Max Results",
|
|
36
|
+
description: "Maximum number of results to return.",
|
|
37
|
+
default: 20,
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $ }) {
|
|
42
|
+
const maxResults = Math.max(this.limit ?? 20, 1);
|
|
43
|
+
const matches = [];
|
|
44
|
+
let cursor;
|
|
45
|
+
|
|
46
|
+
do {
|
|
47
|
+
const response = await this.slack.assistantSearch({
|
|
48
|
+
query: this.query,
|
|
49
|
+
channel_types: this.channelTypes,
|
|
50
|
+
cursor,
|
|
51
|
+
});
|
|
52
|
+
matches.push(...(response.results?.messages || []));
|
|
53
|
+
cursor = response.response_metadata?.next_cursor;
|
|
54
|
+
} while (cursor && matches.length < maxResults);
|
|
55
|
+
|
|
56
|
+
const results = matches.slice(0, maxResults);
|
|
57
|
+
|
|
58
|
+
$.export("$summary", `Found ${results.length} result${results.length === 1
|
|
59
|
+
? ""
|
|
60
|
+
: "s"} for "${this.query}"`);
|
|
61
|
+
|
|
62
|
+
return results;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "slack_v2-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.5.
|
|
10
|
+
version: "0.5.3",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-send-large-message",
|
|
6
6
|
name: "Send a Large Message (3000+ characters)",
|
|
7
7
|
description: "Send a large message (more than 3000 characters) to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack_v2-send-message",
|
|
7
7
|
name: "Send Message",
|
|
8
8
|
description: "Send a message to a user, group, private channel or public channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.3",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "slack_v2-send-message-advanced",
|
|
8
8
|
name: "Send Message (Advanced)",
|
|
9
9
|
description: "Customize advanced settings and send a message to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.3",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack_v2-send-message-to-channel",
|
|
7
7
|
name: "Send Message to Channel",
|
|
8
8
|
description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.3",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "slack_v2-send-message-to-user-or-group",
|
|
8
8
|
name: "Send Message to User or Group",
|
|
9
9
|
description: "Send a message to a user or group. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.3",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-set-channel-description",
|
|
5
5
|
name: "Set Channel Description",
|
|
6
6
|
description: "Change the description or purpose of a channel. [See the documentation](https://api.slack.com/methods/conversations.setPurpose)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-set-channel-topic",
|
|
5
5
|
name: "Set Channel Topic",
|
|
6
6
|
description: "Set the topic on a selected channel. [See the documentation](https://api.slack.com/methods/conversations.setTopic)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.28",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-set-status",
|
|
5
5
|
name: "Set Status",
|
|
6
6
|
description: "Set the current status for a user. [See the documentation](https://api.slack.com/methods/users.profile.set)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-update-group-members",
|
|
5
5
|
name: "Update Group Members",
|
|
6
6
|
description: "Update the list of users for a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.update)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "slack_v2-update-message",
|
|
5
5
|
name: "Update Message",
|
|
6
6
|
description: "Update a message. [See the documentation](https://api.slack.com/methods/chat.update)",
|
|
7
|
-
version: "0.2.
|
|
7
|
+
version: "0.2.3",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-update-profile",
|
|
6
6
|
name: "Update Profile",
|
|
7
7
|
description: "Update basic profile field such as name or title. [See the documentation](https://api.slack.com/methods/users.profile.set)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.28",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "slack_v2-upload-file",
|
|
9
9
|
name: "Upload File",
|
|
10
10
|
description: "Upload a file. [See the documentation](https://api.slack.com/messaging/files#uploading_files)",
|
|
11
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.7",
|
|
12
12
|
annotations: {
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "slack_v2-verify-slack-signature",
|
|
6
6
|
name: "Verify Slack Signature",
|
|
7
7
|
description: "Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. [See the documentation](https://api.slack.com/authentication/verifying-requests-from-slack)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/slack_v2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Pipedream Slack_v2 Components",
|
|
5
5
|
"main": "slack_v2.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"@pipedream/platform": "^3.2.5",
|
|
18
18
|
"@slack/web-api": "^7.9.0",
|
|
19
19
|
"async-retry": "^1.3.3",
|
|
20
|
-
"lodash": "^4.
|
|
20
|
+
"lodash": "^4.18.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/slack_v2.app.mjs
CHANGED
|
@@ -1115,5 +1115,45 @@ export default {
|
|
|
1115
1115
|
...args,
|
|
1116
1116
|
});
|
|
1117
1117
|
},
|
|
1118
|
+
/**
|
|
1119
|
+
* Strips a leading "#" from a channel name. Use for Slack API methods
|
|
1120
|
+
* that accept channel names directly (e.g. chat.postMessage, chat.update).
|
|
1121
|
+
* @param {string} input - Channel ID or channel name (with or without #)
|
|
1122
|
+
* @returns {string} The input with any leading # removed
|
|
1123
|
+
*/
|
|
1124
|
+
normalizeChannel(input) {
|
|
1125
|
+
return input.replace(/^#/, "");
|
|
1126
|
+
},
|
|
1127
|
+
/**
|
|
1128
|
+
* Resolves a channel name (e.g. "general", "#general") to its ID.
|
|
1129
|
+
* If the input already looks like an ID (starts with C/D/G/U + 8+ alphanums),
|
|
1130
|
+
* returns it as-is. Fetches up to 999 channels per page (the Slack API max)
|
|
1131
|
+
* to minimize API calls.
|
|
1132
|
+
*
|
|
1133
|
+
* Note: chat.postMessage and chat.update accept channel names directly —
|
|
1134
|
+
* use normalizeChannel() instead for those methods.
|
|
1135
|
+
*
|
|
1136
|
+
* @param {string} input - Channel ID or channel name
|
|
1137
|
+
* @returns {Promise<string>} The resolved channel ID
|
|
1138
|
+
*/
|
|
1139
|
+
async resolveChannelId(input) {
|
|
1140
|
+
if (/^[CDGU][A-Z0-9]{8,}$/i.test(input)) return input;
|
|
1141
|
+
const name = input.replace(/^#/, "").toLowerCase();
|
|
1142
|
+
let cursor;
|
|
1143
|
+
do {
|
|
1144
|
+
const {
|
|
1145
|
+
channels, response_metadata: { next_cursor: nextCursor },
|
|
1146
|
+
} = await this.conversationsList({
|
|
1147
|
+
types: "public_channel,private_channel",
|
|
1148
|
+
limit: 999,
|
|
1149
|
+
cursor,
|
|
1150
|
+
exclude_archived: true,
|
|
1151
|
+
});
|
|
1152
|
+
const match = channels.find((c) => c.name === name);
|
|
1153
|
+
if (match) return match.id;
|
|
1154
|
+
cursor = nextCursor;
|
|
1155
|
+
} while (cursor);
|
|
1156
|
+
throw new Error(`Channel "${input}" not found. Provide a valid channel ID or name.`);
|
|
1157
|
+
},
|
|
1118
1158
|
},
|
|
1119
1159
|
};
|
|
@@ -3,7 +3,7 @@ import sampleEmit from "./test-event.mjs";
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
name: "New Interaction Events (Instant)",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.24",
|
|
7
7
|
key: "slack_v2-new-interaction-event-received",
|
|
8
8
|
description: "Emit new events on new Slack [interactivity events](https://api.slack.com/interactivity) sourced from [Block Kit interactive elements](https://api.slack.com/interactivity/components), [Slash commands](https://api.slack.com/interactivity/slash-commands), or [Shortcuts](https://api.slack.com/interactivity/shortcuts).",
|
|
9
9
|
type: "source",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
...common,
|
|
8
8
|
key: "slack_v2-new-keyword-mention",
|
|
9
9
|
name: "New Keyword Mention (Instant)",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.3",
|
|
11
11
|
description: "Emit new event when a specific keyword is mentioned in a channel",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
...common,
|
|
8
8
|
key: "slack_v2-new-message-in-channels",
|
|
9
9
|
name: "New Message In Channels (Instant)",
|
|
10
|
-
version: "1.1.
|
|
10
|
+
version: "1.1.3",
|
|
11
11
|
description: "Emit new event when a new message is posted to one or more channels",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
...common,
|
|
5
5
|
key: "slack_v2-new-private-channel-created",
|
|
6
6
|
name: "New Private Channel Created",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
description: "Emit new event when a new private channel is created. [See the documentation](https://api.slack.com/methods/conversations.list)",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
...common,
|
|
6
6
|
key: "slack_v2-new-reaction-added",
|
|
7
7
|
name: "New Reaction Added (Instant)",
|
|
8
|
-
version: "1.2.
|
|
8
|
+
version: "1.2.3",
|
|
9
9
|
description: "Emit new event when a member has added an emoji reaction to a message",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
...common,
|
|
6
6
|
key: "slack_v2-new-saved-message",
|
|
7
7
|
name: "New Saved Message (Instant)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.10",
|
|
9
9
|
description: "Emit new event when a message is saved. Note: The endpoint is marked as deprecated, and Slack might shut this off at some point down the line.",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
...common,
|
|
8
8
|
key: "slack_v2-new-user-mention",
|
|
9
9
|
name: "New User Mention (Instant)",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.3",
|
|
11
11
|
description: "Emit new event when a username or specific keyword is mentioned in a channel",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|