@pipedream/slack 0.6.1 → 0.6.3

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.
Files changed (41) hide show
  1. package/actions/add-emoji-reaction/add-emoji-reaction.mjs +1 -1
  2. package/actions/archive-channel/archive-channel.mjs +1 -1
  3. package/actions/common/build-blocks.mjs +2 -1
  4. package/actions/common/send-message.mjs +93 -9
  5. package/actions/create-channel/create-channel.mjs +1 -1
  6. package/actions/create-reminder/create-reminder.mjs +1 -1
  7. package/actions/delete-file/delete-file.mjs +1 -1
  8. package/actions/delete-message/delete-message.mjs +1 -1
  9. package/actions/find-message/find-message.mjs +1 -1
  10. package/actions/find-user-by-email/find-user-by-email.mjs +1 -1
  11. package/actions/get-file/get-file.mjs +1 -1
  12. package/actions/invite-user-to-channel/invite-user-to-channel.mjs +1 -1
  13. package/actions/kick-user/kick-user.mjs +1 -1
  14. package/actions/list-channels/list-channels.mjs +1 -1
  15. package/actions/list-files/list-files.mjs +1 -1
  16. package/actions/list-group-members/list-group-members.mjs +1 -1
  17. package/actions/list-members-in-channel/list-members-in-channel.mjs +1 -1
  18. package/actions/list-replies/list-replies.mjs +1 -1
  19. package/actions/list-users/list-users.mjs +1 -1
  20. package/actions/reply-to-a-message/reply-to-a-message.mjs +17 -13
  21. package/actions/send-large-message/send-large-message.mjs +22 -7
  22. package/actions/send-message/send-message.mjs +12 -5
  23. package/actions/{send-custom-message/send-custom-message.mjs → send-message-advanced/send-message-advanced.mjs} +3 -20
  24. package/actions/set-channel-description/set-channel-description.mjs +1 -1
  25. package/actions/set-channel-topic/set-channel-topic.mjs +1 -1
  26. package/actions/set-status/set-status.mjs +1 -1
  27. package/actions/update-group-members/update-group-members.mjs +1 -1
  28. package/actions/update-message/update-message.mjs +1 -1
  29. package/actions/update-profile/update-profile.mjs +1 -1
  30. package/actions/upload-file/upload-file.mjs +1 -1
  31. package/actions/verify-slack-signature/verify-slack-signature.mjs +1 -1
  32. package/common/constants.mjs +16 -0
  33. package/package.json +1 -1
  34. package/slack.app.mjs +28 -14
  35. package/sources/new-channel-created/new-channel-created.mjs +1 -1
  36. package/sources/new-direct-message/new-direct-message.mjs +1 -1
  37. package/sources/new-interaction-event-received/new-interaction-event-received.mjs +1 -1
  38. package/sources/new-keyword-mention/new-keyword-mention.mjs +1 -1
  39. package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
  40. package/sources/new-reaction-added/new-reaction-added.mjs +1 -1
  41. 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.8",
7
+ version: "0.0.10",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
8
+ version: "0.0.18",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
@@ -81,7 +81,8 @@ export default {
81
81
  }
82
82
  },
83
83
  },
84
- async additionalProps() {
84
+ async additionalProps(existingProps) {
85
+ await common.additionalProps.call(this, existingProps);
85
86
  const props = {};
86
87
  const sectionDescription = "Add a **section** block to your message and configure with plain text or mrkdwn. See [Slack's docs](https://api.slack.com/reference/block-kit/blocks?ref=bk#section) for more info.";
87
88
  const contextDescription = "Add a **context** block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See [Slack's docs](https://api.slack.com/reference/block-kit/blocks?ref=bk#context) for more info.";
@@ -9,62 +9,136 @@ export default {
9
9
  "as_user",
10
10
  ],
11
11
  },
12
+ post_at: {
13
+ propDefinition: [
14
+ slack,
15
+ "post_at",
16
+ ],
17
+ },
18
+ include_sent_via_pipedream_flag: {
19
+ type: "boolean",
20
+ optional: true,
21
+ default: true,
22
+ label: "Include link to workflow",
23
+ description: "Defaults to `true`, includes a link to the workflow at the end of your Slack message.",
24
+ },
25
+ customizeBotSettings: {
26
+ type: "boolean",
27
+ label: "Customize Bot Settings",
28
+ description: "Customize the username and/or icon of the Bot",
29
+ optional: true,
30
+ reloadProps: true,
31
+ },
12
32
  username: {
13
33
  propDefinition: [
14
34
  slack,
15
35
  "username",
16
36
  ],
37
+ hidden: true,
17
38
  },
18
39
  icon_emoji: {
19
40
  propDefinition: [
20
41
  slack,
21
42
  "icon_emoji",
22
43
  ],
44
+ hidden: true,
23
45
  },
24
46
  icon_url: {
25
47
  propDefinition: [
26
48
  slack,
27
49
  "icon_url",
28
50
  ],
51
+ hidden: true,
29
52
  },
30
- post_at: {
53
+ replyToThread: {
54
+ type: "boolean",
55
+ label: "Reply to Thread",
56
+ description: "Reply to an existing thread",
57
+ optional: true,
58
+ reloadProps: true,
59
+ },
60
+ thread_ts: {
31
61
  propDefinition: [
32
62
  slack,
33
- "post_at",
63
+ "messageTs",
64
+ (c) => ({
65
+ channel: c.conversation,
66
+ }),
34
67
  ],
68
+ description: "Provide another message's `ts` value to make this message a reply (e.g., if triggering on new Slack messages, enter `{{event.ts}}`). Avoid using a reply's `ts` value; use its parent instead.",
69
+ optional: true,
70
+ hidden: true,
35
71
  },
36
- include_sent_via_pipedream_flag: {
72
+ thread_broadcast: {
73
+ propDefinition: [
74
+ slack,
75
+ "thread_broadcast",
76
+ ],
77
+ hidden: true,
78
+ },
79
+ addMessageMetadata: {
37
80
  type: "boolean",
81
+ label: "Add Message Metadata",
82
+ description: "Set the metadata event type and payload",
38
83
  optional: true,
39
- default: true,
40
- label: "Include link to workflow",
41
- description: "Defaults to `true`, includes a link to the workflow at the end of your Slack message.",
84
+ reloadProps: true,
42
85
  },
43
86
  metadata_event_type: {
44
87
  propDefinition: [
45
88
  slack,
46
89
  "metadata_event_type",
47
90
  ],
91
+ hidden: true,
48
92
  },
49
93
  metadata_event_payload: {
50
94
  propDefinition: [
51
95
  slack,
52
96
  "metadata_event_payload",
53
97
  ],
98
+ hidden: true,
99
+ },
100
+ configureUnfurlSettings: {
101
+ type: "boolean",
102
+ label: "Configure Unfurl Settings",
103
+ description: "Configure settings for unfurling links and media",
104
+ optional: true,
105
+ reloadProps: true,
54
106
  },
55
107
  unfurl_links: {
56
108
  propDefinition: [
57
109
  slack,
58
110
  "unfurl_links",
59
111
  ],
112
+ hidden: true,
60
113
  },
61
114
  unfurl_media: {
62
115
  propDefinition: [
63
116
  slack,
64
117
  "unfurl_media",
65
118
  ],
119
+ hidden: true,
66
120
  },
67
121
  },
122
+ async additionalProps(props) {
123
+ if (this.conversation && this.replyToThread) {
124
+ props.thread_ts.hidden = false;
125
+ props.thread_broadcast.hidden = false;
126
+ }
127
+ if (this.customizeBotSettings) {
128
+ props.username.hidden = false;
129
+ props.icon_emoji.hidden = false;
130
+ props.icon_url.hidden = false;
131
+ }
132
+ if (this.addMessageMetadata) {
133
+ props.metadata_event_type.hidden = false;
134
+ props.metadata_event_payload.hidden = false;
135
+ }
136
+ if (this.configureUnfurlSettings) {
137
+ props.unfurl_links.hidden = false;
138
+ props.unfurl_media.hidden = false;
139
+ }
140
+ return {};
141
+ },
68
142
  methods: {
69
143
  _makeSentViaPipedreamBlock() {
70
144
  const workflowId = process.env.PIPEDREAM_WORKFLOW_ID;
@@ -120,7 +194,7 @@ export default {
120
194
 
121
195
  if (this.metadata_event_type) {
122
196
 
123
- if (typeof metadataEventPayload === "string") {
197
+ if (typeof this.metadata_event_payload === "string") {
124
198
  try {
125
199
  metadataEventPayload = JSON.parse(this.metadata_event_payload);
126
200
  } catch (error) {
@@ -148,7 +222,7 @@ export default {
148
222
  mrkdwn: this.mrkdwn,
149
223
  blocks,
150
224
  link_names: this.link_names,
151
- reply_broadcast: this.reply_broadcast,
225
+ reply_broadcast: this.thread_broadcast,
152
226
  thread_ts: this.thread_ts,
153
227
  metadata: this.metadata || null,
154
228
  };
@@ -158,7 +232,17 @@ export default {
158
232
  return await this.slack.sdk().chat.scheduleMessage(obj);
159
233
  }
160
234
  const resp = await this.slack.sdk().chat.postMessage(obj);
161
- $.export("$summary", "Successfully sent a message to channel ID " + resp.channel);
235
+ const { channel } = await this.slack.conversationsInfo({
236
+ channel: resp.channel,
237
+ });
238
+ let channelName = `#${channel?.name}`;
239
+ if (channel.is_im) {
240
+ const usernames = await this.slack.userNames();
241
+ channelName = `@${usernames[channel.user]}`;
242
+ } else if (channel.is_mpim) {
243
+ channelName = `@${channel.purpose.value}`;
244
+ }
245
+ $.export("$summary", `Successfully sent a message to ${channelName}`);
162
246
  return resp;
163
247
  },
164
248
  };
@@ -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.17",
7
+ version: "0.0.19",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.17",
7
+ version: "0.0.19",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ 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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-find-message",
5
5
  name: "Find Message",
6
6
  description: "Find a Slack message. [See the documentation](https://api.slack.com/methods/search.messages)",
7
- version: "0.0.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ 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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
8
+ version: "0.0.18",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
@@ -4,7 +4,7 @@ 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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.44",
7
+ version: "0.0.46",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -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.21",
9
+ version: "0.1.23",
10
10
  type: "action",
11
11
  props: {
12
12
  slack: common.props.slack,
@@ -16,33 +16,37 @@ export default {
16
16
  "conversation",
17
17
  ],
18
18
  },
19
- thread_ts: {
19
+ text: {
20
20
  propDefinition: [
21
21
  slack,
22
- "messageTs",
23
- (c) => ({
24
- channel: c.conversation,
25
- }),
22
+ "text",
26
23
  ],
27
24
  },
28
- reply_broadcast: {
25
+ mrkdwn: {
29
26
  propDefinition: [
30
27
  slack,
31
- "reply_broadcast",
28
+ "mrkdwn",
32
29
  ],
33
30
  },
34
- text: {
31
+ ...common.props,
32
+ replyToThread: {
33
+ ...common.props.replyToThread,
34
+ hidden: true,
35
+ },
36
+ thread_ts: {
35
37
  propDefinition: [
36
38
  slack,
37
- "text",
39
+ "messageTs",
40
+ (c) => ({
41
+ channel: c.conversation,
42
+ }),
38
43
  ],
39
44
  },
40
- mrkdwn: {
45
+ thread_broadcast: {
41
46
  propDefinition: [
42
47
  slack,
43
- "mrkdwn",
48
+ "thread_broadcast",
44
49
  ],
45
50
  },
46
- ...common.props,
47
51
  },
48
52
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack-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.0.16",
8
+ version: "0.0.18",
9
9
  type: "action",
10
10
  props: {
11
11
  slack: common.props.slack,
@@ -38,10 +38,12 @@ export default {
38
38
  let metadataEventPayload;
39
39
 
40
40
  if (this.metadata_event_type) {
41
- try {
42
- metadataEventPayload = JSON.parse(this.metadata_event_payload);
43
- } catch (error) {
44
- throw new Error(`Invalid JSON in metadata_event_payload: ${error.message}`);
41
+ if (typeof this.metadata_event_payload === "string") {
42
+ try {
43
+ metadataEventPayload = JSON.parse(this.metadata_event_payload);
44
+ } catch (error) {
45
+ throw new Error(`Invalid JSON in metadata_event_payload: ${error.message}`);
46
+ }
45
47
  }
46
48
 
47
49
  this.metadata = {
@@ -59,6 +61,10 @@ export default {
59
61
  icon_url: this.icon_url,
60
62
  mrkdwn: this.mrkdwn,
61
63
  metadata: this.metadata || null,
64
+ reply_broadcast: this.thread_broadcast,
65
+ thread_ts: this.thread_ts,
66
+ unfurl_links: this.unfurl_links,
67
+ unfurl_media: this.unfurl_media,
62
68
  };
63
69
 
64
70
  let response;
@@ -68,8 +74,17 @@ export default {
68
74
  }
69
75
 
70
76
  response = await this.slack.sdk().chat.postMessage(obj);
71
-
72
- $.export("$summary", "Successfully sent a message to channel ID " + this.conversation);
77
+ const { channel } = await this.slack.conversationsInfo({
78
+ channel: response.channel,
79
+ });
80
+ let channelName = `#${channel?.name}`;
81
+ if (channel.is_im) {
82
+ const usernames = await this.slack.userNames();
83
+ channelName = `@${usernames[channel.user]}`;
84
+ } else if (channel.is_mpim) {
85
+ channelName = `@${channel.purpose.value}`;
86
+ }
87
+ $.export("$summary", `Successfully sent a message to ${channelName}`);
73
88
  return response;
74
89
  },
75
90
  };
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack-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.0.11",
9
+ version: "0.0.13",
10
10
  type: "action",
11
11
  props: {
12
12
  slack: common.props.slack,
@@ -14,16 +14,23 @@ export default {
14
14
  type: "string",
15
15
  label: "Channel Type",
16
16
  description: "The type of channel to send to. User/Direct Message (im), Group (mpim), Private Channel or Public Channel",
17
- options: Object.values(constants.CHANNEL_TYPE),
17
+ async options() {
18
+ return constants.CHANNEL_TYPE_OPTIONS;
19
+ },
18
20
  },
19
21
  conversation: {
20
22
  propDefinition: [
21
23
  common.props.slack,
22
24
  "channelId",
23
25
  (c) => ({
24
- types: [
25
- c.channelType,
26
- ],
26
+ types: c.channelType === "Channels"
27
+ ? [
28
+ constants.CHANNEL_TYPE.PUBLIC,
29
+ constants.CHANNEL_TYPE.PRIVATE,
30
+ ]
31
+ : [
32
+ c.channelType,
33
+ ],
27
34
  }),
28
35
  ],
29
36
  },
@@ -4,10 +4,10 @@ import buildBlocks from "../common/build-blocks.mjs";
4
4
  export default {
5
5
  ...common,
6
6
  ...buildBlocks,
7
- key: "slack-send-custom-message",
8
- name: "Send a Custom Message",
7
+ key: "slack-send-message-advanced",
8
+ name: "Send Message (Advanced)",
9
9
  description: "Customize advanced setttings 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.2.20",
10
+ version: "0.0.1",
11
11
  type: "action",
12
12
  props: {
13
13
  slack: common.props.slack,
@@ -48,23 +48,6 @@ export default {
48
48
  "link_names",
49
49
  ],
50
50
  },
51
- reply_broadcast: {
52
- propDefinition: [
53
- common.props.slack,
54
- "reply_broadcast",
55
- ],
56
- },
57
- thread_ts: {
58
- propDefinition: [
59
- common.props.slack,
60
- "messageTs",
61
- (c) => ({
62
- channel: c.conversation,
63
- }),
64
- ],
65
- description: "Provide another message's `ts` value to make this message a reply (e.g., if triggering on new Slack messages, enter `{{event.ts}}`). Avoid using a reply's `ts` value; use its parent instead.",
66
- optional: true,
67
- },
68
51
  ...common.props,
69
52
  ...buildBlocks.props,
70
53
  },
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-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.16",
7
+ version: "0.0.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-update-group-members",
5
5
  name: "Update Groups 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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "slack-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.1.16",
7
+ version: "0.1.18",
8
8
  type: "action",
9
9
  props: {
10
10
  slack,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack-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.16",
8
+ version: "0.0.18",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack-upload-file",
7
7
  name: "Upload File",
8
8
  description: "Upload a file. [See the documentation](https://api.slack.com/methods/files.upload)",
9
- version: "0.0.19",
9
+ version: "0.0.21",
10
10
  type: "action",
11
11
  props: {
12
12
  slack,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack-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.9",
8
+ version: "0.0.11",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
@@ -8,8 +8,24 @@ const CHANNEL_TYPE = {
8
8
  IM: "im",
9
9
  };
10
10
 
11
+ const CHANNEL_TYPE_OPTIONS = [
12
+ {
13
+ label: "Channels",
14
+ value: "Channels",
15
+ },
16
+ {
17
+ label: "Group",
18
+ value: CHANNEL_TYPE.MPIM,
19
+ },
20
+ {
21
+ label: "User / Direct Message",
22
+ value: CHANNEL_TYPE.IM,
23
+ },
24
+ ];
25
+
11
26
  export default {
12
27
  MAX_RESOURCES,
13
28
  LIMIT,
14
29
  CHANNEL_TYPE,
30
+ CHANNEL_TYPE_OPTIONS,
15
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Pipedream Slack Components",
5
5
  "main": "slack.app.mjs",
6
6
  "keywords": [
package/slack.app.mjs CHANGED
@@ -181,12 +181,26 @@ export default {
181
181
 
182
182
  const options = channels
183
183
  .filter(channelsFilter)
184
- .map((c) => ({
185
- value: c.id,
186
- label: c.is_im
187
- ? `@${userNames[c.user]}`
188
- : c.name,
189
- }));
184
+ .map((c) => {
185
+ if (c.is_im) {
186
+ return {
187
+ label: `Direct messaging with: @${userNames[c.user]}`,
188
+ value: c.id,
189
+ };
190
+ } else if (c.is_mpim) {
191
+ return {
192
+ label: c.purpose.value,
193
+ value: c.id,
194
+ };
195
+ } else {
196
+ return {
197
+ label: `${c.is_private
198
+ ? "Private"
199
+ : "Public"} channel: ${c.name}`,
200
+ value: c.id,
201
+ };
202
+ }
203
+ });
190
204
 
191
205
  return {
192
206
  options,
@@ -338,7 +352,7 @@ export default {
338
352
  username: {
339
353
  type: "string",
340
354
  label: "Bot Username",
341
- description: "Optionally customize your bot's user name (default is `Pipedream`). Must be used in conjunction with `as_user` set to false, otherwise ignored.",
355
+ description: "Optionally customize your bot's user name (default is `Pipedream`). Must be used in conjunction with `Send as User` set to false, otherwise ignored.",
342
356
  optional: true,
343
357
  },
344
358
  blocks: {
@@ -350,7 +364,7 @@ export default {
350
364
  icon_emoji: {
351
365
  type: "string",
352
366
  label: "Icon (emoji)",
353
- description: "Optionally provide an emoji to use as the icon for this message. E.g., `:fire:` Overrides `icon_url`. Must be used in conjunction with `as_user` set to `false`, otherwise ignored.",
367
+ description: "Optionally provide an emoji to use as the icon for this message. E.g., `:fire:` Overrides `icon_url`. Must be used in conjunction with `Send as User` set to `false`, otherwise ignored.",
354
368
  optional: true,
355
369
  async options() {
356
370
  return await this.getCustomEmojis();
@@ -367,10 +381,10 @@ export default {
367
381
  description: "Find and link channel names and usernames.",
368
382
  optional: true,
369
383
  },
370
- reply_broadcast: {
384
+ thread_broadcast: {
371
385
  type: "boolean",
372
- label: "Reply Broadcasts",
373
- description: "Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.",
386
+ label: "Send Channel Message",
387
+ description: "If `true`, posts in the thread and channel. Used in conjunction with `Message Timestamp` and indicates whether reply should be made visible to everyone in the channel. Defaults to `false`.",
374
388
  default: false,
375
389
  optional: true,
376
390
  },
@@ -383,7 +397,7 @@ export default {
383
397
  icon_url: {
384
398
  type: "string",
385
399
  label: "Icon (image URL)",
386
- description: "Optionally provide an image URL to use as the icon for this message. Must be used in conjunction with `as_user` set to `false`, otherwise ignored.",
400
+ description: "Optionally provide an image URL to use as the icon for this message. Must be used in conjunction with `Send as User` set to `false`, otherwise ignored.",
387
401
  optional: true,
388
402
  },
389
403
  initial_comment: {
@@ -400,13 +414,13 @@ export default {
400
414
  metadata_event_type: {
401
415
  type: "string",
402
416
  label: "Metadata Event Type",
403
- description: "The name of the metadata event",
417
+ description: "The name of the metadata event. Example: `task_created`",
404
418
  optional: true,
405
419
  },
406
420
  metadata_event_payload: {
407
421
  type: "string",
408
422
  label: "Metadata Event Payload",
409
- description: "The payload of the metadata event. Must be a JSON string e.g. `{\"key\": \"value\"}`",
423
+ description: "The payload of the metadata event. Must be a JSON string. Example: `{ \"id\": \"11223\", \"title\": \"Redesign Homepage\"}`",
410
424
  optional: true,
411
425
  },
412
426
  ignoreMyself: {
@@ -5,7 +5,7 @@ export default {
5
5
  ...common,
6
6
  key: "slack-new-channel-created",
7
7
  name: "New Channel Created (Instant)",
8
- version: "0.0.3",
8
+ version: "0.0.5",
9
9
  description: "Emit new event when a new channel is created.",
10
10
  type: "source",
11
11
  dedupe: "unique",
@@ -5,7 +5,7 @@ export default {
5
5
  ...common,
6
6
  key: "slack-new-direct-message",
7
7
  name: "New Direct Message (Instant)",
8
- version: "1.0.15",
8
+ version: "1.0.17",
9
9
  description: "Emit new event when a message was posted in a direct message channel",
10
10
  type: "source",
11
11
  dedupe: "unique",
@@ -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.13",
6
+ version: "0.0.15",
7
7
  key: "slack-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",
@@ -6,7 +6,7 @@ export default {
6
6
  ...common,
7
7
  key: "slack-new-keyword-mention",
8
8
  name: "New Keyword Mention (Instant)",
9
- version: "0.0.1",
9
+ version: "0.0.3",
10
10
  description: "Emit new event when a specific keyword is mentioned in a channel",
11
11
  type: "source",
12
12
  dedupe: "unique",
@@ -6,7 +6,7 @@ export default {
6
6
  ...common,
7
7
  key: "slack-new-message-in-channels",
8
8
  name: "New Message In Channels (Instant)",
9
- version: "1.0.17",
9
+ version: "1.0.19",
10
10
  description: "Emit new event when a new message is posted to one or more channels",
11
11
  type: "source",
12
12
  dedupe: "unique",
@@ -5,7 +5,7 @@ export default {
5
5
  ...common,
6
6
  key: "slack-new-reaction-added",
7
7
  name: "New Reaction Added (Instant)",
8
- version: "1.1.19",
8
+ version: "1.1.21",
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",
@@ -6,7 +6,7 @@ export default {
6
6
  ...common,
7
7
  key: "slack-new-user-mention",
8
8
  name: "New User Mention (Instant)",
9
- version: "0.0.1",
9
+ version: "0.0.3",
10
10
  description: "Emit new event when a username or specific keyword is mentioned in a channel",
11
11
  type: "source",
12
12
  dedupe: "unique",