@pipedream/slack_v2 0.8.0 → 1.0.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 +2 -2
- package/actions/add-reaction/add-reaction.mjs +1 -1
- package/actions/archive-channel/archive-channel.mjs +3 -10
- package/actions/browse-files/browse-files.mjs +1 -1
- package/actions/common/build-blocks.mjs +44 -106
- package/actions/common/send-message.mjs +5 -59
- package/actions/create-channel/create-channel.mjs +2 -1
- package/actions/create-reminder/create-reminder.mjs +2 -1
- package/actions/delete-file/delete-file.mjs +2 -4
- package/actions/delete-message/delete-message.mjs +7 -6
- package/actions/edit-message/edit-message.mjs +20 -2
- package/actions/find-message/find-message.mjs +2 -1
- package/actions/find-user-by-email/find-user-by-email.mjs +2 -1
- package/actions/find-user-by-id/find-user-by-id.mjs +4 -3
- package/actions/get-channel-details/get-channel-details.mjs +3 -2
- package/actions/get-channel-history/get-channel-history.mjs +3 -3
- package/actions/get-current-user/get-current-user.mjs +3 -2
- package/actions/get-file/get-file.mjs +2 -12
- package/actions/get-thread-replies/get-thread-replies.mjs +1 -1
- package/actions/get-user-details/get-user-details.mjs +1 -1
- package/actions/invite-user-to-channel/invite-user-to-channel.mjs +2 -1
- package/actions/kick-user/kick-user.mjs +2 -12
- package/actions/list-channels/list-channels.mjs +28 -10
- package/actions/list-emojis/list-emojis.mjs +2 -1
- package/actions/list-files/list-files.mjs +6 -11
- package/actions/list-group-conversations/list-group-conversations.mjs +86 -0
- package/actions/list-group-members/list-group-members.mjs +3 -2
- package/actions/list-icon-emoji-options/list-icon-emoji-options.mjs +6 -3
- package/actions/list-members-in-channel/list-members-in-channel.mjs +2 -1
- package/actions/list-messages/list-messages.mjs +2 -1
- package/actions/list-reminder-options/list-reminder-options.mjs +10 -3
- package/actions/list-replies/list-replies.mjs +2 -9
- package/actions/list-teams/list-teams.mjs +88 -0
- package/actions/list-user-group-options/list-user-group-options.mjs +10 -3
- package/actions/list-users/list-users.mjs +2 -1
- package/actions/post-message/post-message.mjs +29 -3
- package/actions/reply-to-a-message/reply-to-a-message.mjs +13 -12
- package/actions/search/search.mjs +1 -1
- package/actions/send-block-kit-message/send-block-kit-message.mjs +2 -1
- package/actions/send-large-message/send-large-message.mjs +2 -1
- package/actions/send-message/send-message.mjs +5 -15
- package/actions/send-message-advanced/send-message-advanced.mjs +46 -4
- package/actions/send-message-to-channel/send-message-to-channel.mjs +10 -10
- package/actions/send-message-to-user-or-group/send-message-to-user-or-group.mjs +4 -9
- package/actions/set-channel-description/set-channel-description.mjs +2 -1
- package/actions/set-channel-topic/set-channel-topic.mjs +2 -1
- package/actions/set-status/set-status.mjs +4 -3
- package/actions/update-group-members/update-group-members.mjs +5 -4
- package/actions/update-message/update-message.mjs +3 -2
- package/actions/update-profile/update-profile.mjs +3 -2
- package/actions/upload-file/upload-file.mjs +7 -2
- package/actions/verify-slack-signature/verify-slack-signature.mjs +4 -3
- package/common/constants.mjs +16 -0
- package/package.json +2 -2
- package/slack_v2.app.mjs +20 -369
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
import common from "../common/send-message.mjs";
|
|
3
4
|
|
|
@@ -5,8 +6,15 @@ export default {
|
|
|
5
6
|
...common,
|
|
6
7
|
key: "slack_v2-reply-to-a-message",
|
|
7
8
|
name: "Reply to a Message Thread",
|
|
8
|
-
description:
|
|
9
|
-
|
|
9
|
+
description:
|
|
10
|
+
"Send a message as a threaded reply to an existing message."
|
|
11
|
+
+ " Use this when the reply should be nested under a specific message rather than posted"
|
|
12
|
+
+ " as a new top-level message — for example, responding to a triggering event or"
|
|
13
|
+
+ " continuing a discussion. Requires `thread_ts`, the parent message's timestamp"
|
|
14
|
+
+ " (e.g. `1403051575.000407`); get it from **Get Channel History** or an incoming event's"
|
|
15
|
+
+ " `ts` field. For a plain, non-threaded message use **Post Message** instead."
|
|
16
|
+
+ " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
17
|
+
version: "0.2.7",
|
|
10
18
|
annotations: {
|
|
11
19
|
destructiveHint: false,
|
|
12
20
|
openWorldHint: true,
|
|
@@ -34,21 +42,14 @@ export default {
|
|
|
34
42
|
],
|
|
35
43
|
},
|
|
36
44
|
...common.props,
|
|
37
|
-
replyToThread: {
|
|
38
|
-
...common.props.replyToThread,
|
|
39
|
-
hidden: true,
|
|
40
|
-
},
|
|
41
45
|
thread_ts: {
|
|
42
46
|
propDefinition: [
|
|
43
47
|
slack,
|
|
44
48
|
"messageTs",
|
|
45
49
|
],
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
slack,
|
|
50
|
-
"thread_broadcast",
|
|
51
|
-
],
|
|
50
|
+
label: "Thread Timestamp",
|
|
51
|
+
description: "The `ts` timestamp of the parent message to reply to (e.g., if triggering on new Slack messages, enter `{{event.ts}}`). Avoid using a reply's `ts` value; use its parent's instead. E.g., `1403051575.000407`.",
|
|
52
|
+
optional: false,
|
|
52
53
|
},
|
|
53
54
|
},
|
|
54
55
|
};
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " Use **Get User Details** first to find your user ID for filtering by 'my' messages."
|
|
11
11
|
+ " Returns matching messages with channel context, timestamps, and permalinks."
|
|
12
12
|
+ " [See the documentation](https://api.slack.com/methods/assistant.search.context)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.4",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: false,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import buildBlocks from "../common/build-blocks.mjs";
|
|
2
3
|
import common from "../common/send-message.mjs";
|
|
3
4
|
|
|
@@ -7,7 +8,7 @@ export default {
|
|
|
7
8
|
key: "slack_v2-send-block-kit-message",
|
|
8
9
|
name: "Build and Send a Block Kit Message",
|
|
9
10
|
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.
|
|
11
|
+
version: "0.5.7",
|
|
11
12
|
annotations: {
|
|
12
13
|
destructiveHint: false,
|
|
13
14
|
openWorldHint: true,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import common from "../common/send-message.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
@@ -5,7 +6,7 @@ export default {
|
|
|
5
6
|
key: "slack_v2-send-large-message",
|
|
6
7
|
name: "Send a Large Message (3000+ characters)",
|
|
7
8
|
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.
|
|
9
|
+
version: "0.1.7",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import common from "../common/send-message.mjs";
|
|
2
3
|
import constants from "../../common/constants.mjs";
|
|
3
4
|
|
|
@@ -6,7 +7,7 @@ export default {
|
|
|
6
7
|
key: "slack_v2-send-message",
|
|
7
8
|
name: "Send Message",
|
|
8
9
|
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.
|
|
10
|
+
version: "0.2.0",
|
|
10
11
|
annotations: {
|
|
11
12
|
destructiveHint: false,
|
|
12
13
|
openWorldHint: true,
|
|
@@ -18,25 +19,14 @@ export default {
|
|
|
18
19
|
channelType: {
|
|
19
20
|
type: "string",
|
|
20
21
|
label: "Channel Type",
|
|
21
|
-
description: "The type of channel to send to
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
22
|
+
description: "The type of channel to send to: `Channels` (public or private), Group (`mpim`), or User/Direct Message (`im`). Informational only — it does not affect which value is accepted in Channel.",
|
|
23
|
+
options: constants.CHANNEL_TYPE_OPTIONS,
|
|
24
|
+
optional: true,
|
|
25
25
|
},
|
|
26
26
|
conversation: {
|
|
27
27
|
propDefinition: [
|
|
28
28
|
common.props.slack,
|
|
29
29
|
"conversation",
|
|
30
|
-
(c) => ({
|
|
31
|
-
types: c.channelType === "Channels"
|
|
32
|
-
? [
|
|
33
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
34
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
35
|
-
]
|
|
36
|
-
: [
|
|
37
|
-
c.channelType,
|
|
38
|
-
],
|
|
39
|
-
}),
|
|
40
30
|
],
|
|
41
31
|
},
|
|
42
32
|
text: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
3
|
import common from "../common/send-message.mjs";
|
|
2
4
|
import buildBlocks from "../common/build-blocks.mjs";
|
|
3
5
|
|
|
@@ -7,7 +9,7 @@ export default {
|
|
|
7
9
|
key: "slack_v2-send-message-advanced",
|
|
8
10
|
name: "Send Message (Advanced)",
|
|
9
11
|
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.
|
|
12
|
+
version: "0.1.7",
|
|
11
13
|
annotations: {
|
|
12
14
|
destructiveHint: false,
|
|
13
15
|
openWorldHint: true,
|
|
@@ -27,7 +29,8 @@ export default {
|
|
|
27
29
|
common.props.slack,
|
|
28
30
|
"text",
|
|
29
31
|
],
|
|
30
|
-
description: "If you're using `blocks`, this is used as a fallback string to display in notifications. If you aren't, this is the main body text of the message. It can be formatted as plain text, or with mrkdwn.",
|
|
32
|
+
description: "If you're using `blocks`, this is used as a fallback string to display in notifications. If you aren't, this is the main body text of the message. It can be formatted as plain text, or with mrkdwn. Required when no blocks are provided.",
|
|
33
|
+
optional: true,
|
|
31
34
|
},
|
|
32
35
|
mrkdwn: {
|
|
33
36
|
propDefinition: [
|
|
@@ -65,11 +68,50 @@ export default {
|
|
|
65
68
|
},
|
|
66
69
|
async run({ $ }) {
|
|
67
70
|
if (this.passArrayOrConfigure) {
|
|
68
|
-
|
|
71
|
+
const generated = await this.getGeneratedBlocks();
|
|
72
|
+
// Only override this.blocks when something was actually generated.
|
|
73
|
+
// When passArrayOrConfigure === "configure" but no section/context/linkButton
|
|
74
|
+
// props are filled, getGeneratedBlocks returns [] (empty array). An empty
|
|
75
|
+
// array is truthy so common.run would skip the text-block fallback and post
|
|
76
|
+
// with zero content. Checking length lets common.run fall back to a text
|
|
77
|
+
// block when the user configured no blocks.
|
|
78
|
+
this.blocks = generated?.length
|
|
79
|
+
? generated
|
|
80
|
+
: undefined;
|
|
69
81
|
}
|
|
82
|
+
|
|
83
|
+
const hasBlocks = (() => {
|
|
84
|
+
if (Array.isArray(this.blocks)) {
|
|
85
|
+
return this.blocks.length > 0;
|
|
86
|
+
}
|
|
87
|
+
if (typeof this.blocks === "string") {
|
|
88
|
+
if (!this.blocks.trim()) return false;
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(this.blocks);
|
|
92
|
+
} catch {
|
|
93
|
+
// Malformed JSON — let common.run's own JSON.parse surface the error.
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if (!Array.isArray(parsed)) {
|
|
97
|
+
throw new ConfigurationError(
|
|
98
|
+
"`Blocks` must be a JSON array of Block Kit blocks, e.g. `[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"Hello\"}}]`.",
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return parsed.length > 0;
|
|
102
|
+
}
|
|
103
|
+
return Boolean(this.blocks);
|
|
104
|
+
})();
|
|
105
|
+
|
|
106
|
+
if (!this.text && !hasBlocks) {
|
|
107
|
+
throw new ConfigurationError(
|
|
108
|
+
"Provide `Text`, or configure at least one block (via `Blocks` or the block-builder props), before sending a message.",
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
70
112
|
const resp = await common.run.call(this, {
|
|
71
113
|
$,
|
|
72
|
-
});
|
|
114
|
+
});
|
|
73
115
|
return resp;
|
|
74
116
|
},
|
|
75
117
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import common from "../common/send-message.mjs";
|
|
2
|
-
import constants from "../../common/constants.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
...common,
|
|
6
6
|
key: "slack_v2-send-message-to-channel",
|
|
7
7
|
name: "Send Message to Channel",
|
|
8
|
-
description:
|
|
9
|
-
|
|
8
|
+
description:
|
|
9
|
+
"Send a message to a public or private channel."
|
|
10
|
+
+ " Legacy, channel-only variant — prefer **Post Message** for new integrations: it"
|
|
11
|
+
+ " covers channels, users, and groups from a single tool, and also supports threaded"
|
|
12
|
+
+ " replies and unfurl settings. Use this tool only if a workflow specifically needs to"
|
|
13
|
+
+ " target a channel exclusively, without the user/group support **Post Message** offers."
|
|
14
|
+
+ " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
|
|
15
|
+
version: "0.2.0",
|
|
10
16
|
annotations: {
|
|
11
17
|
destructiveHint: false,
|
|
12
18
|
openWorldHint: true,
|
|
@@ -19,14 +25,8 @@ export default {
|
|
|
19
25
|
propDefinition: [
|
|
20
26
|
common.props.slack,
|
|
21
27
|
"conversation",
|
|
22
|
-
() => ({
|
|
23
|
-
types: [
|
|
24
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
25
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
26
|
-
],
|
|
27
|
-
}),
|
|
28
28
|
],
|
|
29
|
-
description: "
|
|
29
|
+
description: "A public or private channel ID (e.g. `C1234567890`). Use **List Channels** to find valid IDs.",
|
|
30
30
|
},
|
|
31
31
|
text: {
|
|
32
32
|
propDefinition: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import common from "../common/send-message.mjs";
|
|
2
|
-
import constants from "../../common/constants.mjs";
|
|
3
3
|
import { ConfigurationError } from "@pipedream/platform";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -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.
|
|
10
|
+
version: "0.2.0",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -23,20 +23,15 @@ export default {
|
|
|
23
23
|
],
|
|
24
24
|
type: "string[]",
|
|
25
25
|
label: "Users",
|
|
26
|
-
description: "
|
|
26
|
+
description: "The user ID(s) to message (e.g. `U1234567890`). Use **Find User by Email** / **Find User by ID** to resolve an ID.",
|
|
27
27
|
optional: true,
|
|
28
28
|
},
|
|
29
29
|
conversation: {
|
|
30
30
|
propDefinition: [
|
|
31
31
|
common.props.slack,
|
|
32
32
|
"conversation",
|
|
33
|
-
() => ({
|
|
34
|
-
types: [
|
|
35
|
-
constants.CHANNEL_TYPE.MPIM,
|
|
36
|
-
],
|
|
37
|
-
}),
|
|
38
33
|
],
|
|
39
|
-
description: "
|
|
34
|
+
description: "The group DM conversation ID to message (e.g. `G1234567890`). Use **List Group Conversations** to find valid IDs.",
|
|
40
35
|
optional: true,
|
|
41
36
|
},
|
|
42
37
|
text: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-set-channel-description",
|
|
5
6
|
name: "Set Channel Description",
|
|
6
7
|
description: "Change the description or purpose of a channel. [See the documentation](https://api.slack.com/methods/conversations.setPurpose)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.17",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: false,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-set-channel-topic",
|
|
5
6
|
name: "Set Channel Topic",
|
|
6
7
|
description: "Set the topic on a channel, specified by ID or by name — names are resolved automatically. [See the documentation](https://api.slack.com/methods/conversations.setTopic)",
|
|
7
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.2",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: true,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-set-status",
|
|
5
6
|
name: "Set Status",
|
|
6
7
|
description: "Set the current status for a user. [See the documentation](https://api.slack.com/methods/users.profile.set)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.16",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: true,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -24,7 +25,7 @@ export default {
|
|
|
24
25
|
"icon_emoji",
|
|
25
26
|
],
|
|
26
27
|
label: "Status Emoji",
|
|
27
|
-
description: "The emoji to display with the status",
|
|
28
|
+
description: "The emoji to display with the status, e.g. `fire` or `:fire:` — colons are optional, either form works.",
|
|
28
29
|
optional: true,
|
|
29
30
|
},
|
|
30
31
|
statusExpiration: {
|
|
@@ -38,7 +39,7 @@ export default {
|
|
|
38
39
|
const response = await this.slack.updateProfile({
|
|
39
40
|
profile: {
|
|
40
41
|
status_text: this.statusText,
|
|
41
|
-
status_emoji: this.statusEmoji && `:${this.statusEmoji}:`,
|
|
42
|
+
status_emoji: this.statusEmoji && `:${this.statusEmoji.replace(/^:|:$/g, "")}:`,
|
|
42
43
|
status_expiration: this.statusExpiration
|
|
43
44
|
&& Math.floor(new Date(this.statusExpiration).getTime() / 1000),
|
|
44
45
|
},
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-update-group-members",
|
|
5
6
|
name: "Update Group Members",
|
|
6
7
|
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.
|
|
8
|
+
version: "0.0.17",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: true,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -26,7 +27,7 @@ export default {
|
|
|
26
27
|
],
|
|
27
28
|
type: "string[]",
|
|
28
29
|
label: "Users to Add",
|
|
29
|
-
description: "
|
|
30
|
+
description: "One or more user IDs to add to the group (e.g. `U1234567890`). Use **Find User by Email** or **List Users** to find valid IDs.",
|
|
30
31
|
optional: true,
|
|
31
32
|
},
|
|
32
33
|
usersToRemove: {
|
|
@@ -36,7 +37,7 @@ export default {
|
|
|
36
37
|
],
|
|
37
38
|
type: "string[]",
|
|
38
39
|
label: "Users to Remove",
|
|
39
|
-
description: "
|
|
40
|
+
description: "One or more user IDs to remove from the group (e.g. `U1234567890`). Use **Find User by Email** or **List Users** to find valid IDs.",
|
|
40
41
|
optional: true,
|
|
41
42
|
},
|
|
42
43
|
team: {
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
45
46
|
"team",
|
|
46
47
|
],
|
|
47
48
|
optional: true,
|
|
48
|
-
description: "
|
|
49
|
+
description: "The encoded team ID (e.g. `T1234567890`) where the user group exists. Required only if the connected token spans multiple teams (Enterprise Grid). Use **List Teams** to find valid IDs.",
|
|
49
50
|
},
|
|
50
51
|
},
|
|
51
52
|
async run({ $ }) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-update-message",
|
|
5
6
|
name: "Update Message",
|
|
6
7
|
description: "Update a message. [See the documentation](https://api.slack.com/methods/chat.update)",
|
|
7
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.7",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: true,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -36,7 +37,7 @@ export default {
|
|
|
36
37
|
slack,
|
|
37
38
|
"as_user",
|
|
38
39
|
],
|
|
39
|
-
description: "Pass true to update the message as the authed user.
|
|
40
|
+
description: "Pass `true` to update the message as the authenticated user (bot users are treated as the authed user here too). Pass `false` (default) to update using the bot token instead. Slack only allows editing a message posted by the same identity now attempting the edit — check the message's `user`/`bot_id` via **Get Channel History** first if unsure.",
|
|
40
41
|
},
|
|
41
42
|
attachments: {
|
|
42
43
|
propDefinition: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
import { ConfigurationError } from "@pipedream/platform";
|
|
3
4
|
|
|
@@ -5,7 +6,7 @@ export default {
|
|
|
5
6
|
key: "slack_v2-update-profile",
|
|
6
7
|
name: "Update Profile",
|
|
7
8
|
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.
|
|
9
|
+
version: "0.0.32",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: true,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -61,7 +62,7 @@ export default {
|
|
|
61
62
|
slack,
|
|
62
63
|
"user",
|
|
63
64
|
],
|
|
64
|
-
description: "ID of user to
|
|
65
|
+
description: "The ID of the user whose profile to update (e.g. `U1234567890`). Only admins on paid teams may update another user's profile — omit to update your own. Use **Find User by Email** or **List Users** to find valid IDs.",
|
|
65
66
|
optional: true,
|
|
66
67
|
},
|
|
67
68
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import {
|
|
2
3
|
ConfigurationError, axios, getFileStreamAndMetadata,
|
|
3
4
|
} from "@pipedream/platform";
|
|
@@ -8,7 +9,7 @@ export default {
|
|
|
8
9
|
key: "slack_v2-upload-file",
|
|
9
10
|
name: "Upload File",
|
|
10
11
|
description: "Upload a file. [See the documentation](https://api.slack.com/messaging/files#uploading_files)",
|
|
11
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.11",
|
|
12
13
|
annotations: {
|
|
13
14
|
destructiveHint: false,
|
|
14
15
|
openWorldHint: true,
|
|
@@ -45,6 +46,10 @@ export default {
|
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
48
|
async run({ $ }) {
|
|
49
|
+
// Accept a channel NAME as well as an ID — agents routinely pass the "#name" they read
|
|
50
|
+
// in the prompt, and completeUpload answers that with invalid_arguments.
|
|
51
|
+
const channelId = await this.slack.resolveChannelId(this.conversation);
|
|
52
|
+
|
|
48
53
|
const {
|
|
49
54
|
stream, metadata,
|
|
50
55
|
} = await getFileStreamAndMetadata(this.content);
|
|
@@ -85,7 +90,7 @@ export default {
|
|
|
85
90
|
|
|
86
91
|
// Complete the file upload process in Slack
|
|
87
92
|
const completeUploadResponse = await this.slack.completeUpload({
|
|
88
|
-
channel_id:
|
|
93
|
+
channel_id: channelId,
|
|
89
94
|
initial_comment: this.initialComment,
|
|
90
95
|
files: [
|
|
91
96
|
{
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import crypto from "crypto";
|
|
2
3
|
import slack from "../../slack_v2.app.mjs";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
key: "slack_v2-verify-slack-signature",
|
|
6
7
|
name: "Verify Slack Signature",
|
|
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
|
+
description: "Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. `Request Body` must be the raw request body as a string (not a parsed object) — Slack computes its signature over the exact raw bytes it sent, so re-serializing a parsed object will not match. [See the documentation](https://api.slack.com/authentication/verifying-requests-from-slack)",
|
|
9
|
+
version: "1.0.0",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -31,7 +32,7 @@ export default {
|
|
|
31
32
|
description: "Slack request timestamp (from X-Slack-Request-Timestamp header).",
|
|
32
33
|
},
|
|
33
34
|
requestBody: {
|
|
34
|
-
type: "
|
|
35
|
+
type: "string",
|
|
35
36
|
label: "Request Body",
|
|
36
37
|
description: "The body of the request to be verified.",
|
|
37
38
|
},
|
package/common/constants.mjs
CHANGED
|
@@ -27,10 +27,26 @@ const CHANNEL_TYPE_OPTIONS = [
|
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
29
|
|
|
30
|
+
// Block Kit block-type literals used by build-blocks createBlock() branching.
|
|
31
|
+
const BLOCK_TYPES = {
|
|
32
|
+
SECTION: "section",
|
|
33
|
+
CONTEXT: "context",
|
|
34
|
+
LINK_BUTTON: "link_button",
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Option values for the passArrayOrConfigure prop shared by build-blocks and
|
|
38
|
+
// the concrete actions that spread it (send-block-kit-message, send-message-advanced).
|
|
39
|
+
const PASS_ARRAY_OR_CONFIGURE_OPTIONS = {
|
|
40
|
+
ARRAY: "array",
|
|
41
|
+
CONFIGURE: "configure",
|
|
42
|
+
};
|
|
43
|
+
|
|
30
44
|
export default {
|
|
31
45
|
MAX_RESOURCES,
|
|
32
46
|
LIMIT,
|
|
33
47
|
MAX_NAME_LOOKUP_PAGES,
|
|
34
48
|
CHANNEL_TYPE,
|
|
35
49
|
CHANNEL_TYPE_OPTIONS,
|
|
50
|
+
BLOCK_TYPES,
|
|
51
|
+
PASS_ARRAY_OR_CONFIGURE_OPTIONS,
|
|
36
52
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/slack_v2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Pipedream Slack_v2 Components",
|
|
5
5
|
"main": "slack_v2.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@pipedream/platform": "^3.2.5",
|
|
18
|
-
"@slack/web-api": "
|
|
18
|
+
"@slack/web-api": "8.0.0",
|
|
19
19
|
"async-retry": "^1.3.3",
|
|
20
20
|
"lodash": "^4.18.1"
|
|
21
21
|
}
|