@pipedream/slack 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) 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/send-message.mjs +4 -1
  4. package/actions/create-channel/create-channel.mjs +1 -1
  5. package/actions/create-reminder/create-reminder.mjs +1 -1
  6. package/actions/delete-file/delete-file.mjs +1 -1
  7. package/actions/delete-message/delete-message.mjs +1 -1
  8. package/actions/find-message/find-message.mjs +1 -1
  9. package/actions/find-user-by-email/find-user-by-email.mjs +1 -1
  10. package/actions/get-file/get-file.mjs +1 -1
  11. package/actions/invite-user-to-channel/invite-user-to-channel.mjs +1 -1
  12. package/actions/kick-user/kick-user.mjs +1 -1
  13. package/actions/list-channels/list-channels.mjs +1 -1
  14. package/actions/list-files/list-files.mjs +1 -1
  15. package/actions/list-group-members/list-group-members.mjs +1 -1
  16. package/actions/list-members-in-channel/list-members-in-channel.mjs +1 -1
  17. package/actions/list-replies/list-replies.mjs +1 -1
  18. package/actions/list-users/list-users.mjs +1 -1
  19. package/actions/reply-to-a-message/reply-to-a-message.mjs +1 -1
  20. package/actions/send-block-kit-message/send-block-kit-message.mjs +1 -1
  21. package/actions/send-large-message/send-large-message.mjs +1 -1
  22. package/actions/send-message/send-message.mjs +1 -1
  23. package/actions/send-message-advanced/send-message-advanced.mjs +1 -1
  24. package/actions/send-message-to-channel/send-message-to-channel.mjs +40 -0
  25. package/actions/send-message-to-user-or-group/send-message-to-user-or-group.mjs +73 -0
  26. package/actions/set-channel-description/set-channel-description.mjs +1 -1
  27. package/actions/set-channel-topic/set-channel-topic.mjs +1 -1
  28. package/actions/set-status/set-status.mjs +1 -1
  29. package/actions/update-group-members/update-group-members.mjs +1 -1
  30. package/actions/update-message/update-message.mjs +1 -1
  31. package/actions/update-profile/update-profile.mjs +1 -1
  32. package/actions/upload-file/upload-file.mjs +1 -1
  33. package/actions/verify-slack-signature/verify-slack-signature.mjs +1 -1
  34. package/package.json +1 -1
  35. package/slack.app.mjs +1 -1
  36. package/sources/new-channel-created/new-channel-created.mjs +1 -1
  37. package/sources/new-direct-message/new-direct-message.mjs +1 -1
  38. package/sources/new-interaction-event-received/new-interaction-event-received.mjs +1 -1
  39. package/sources/new-keyword-mention/new-keyword-mention.mjs +1 -1
  40. package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
  41. package/sources/new-reaction-added/new-reaction-added.mjs +1 -1
  42. package/sources/new-saved-message/new-saved-message.mjs +1 -1
  43. 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.11",
7
+ version: "0.0.12",
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.19",
8
+ version: "0.0.20",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
@@ -170,6 +170,9 @@ export default {
170
170
  },
171
171
  };
172
172
  },
173
+ getChannelId() {
174
+ return this.conversation ?? this.reply_channel;
175
+ },
173
176
  },
174
177
  async run({ $ }) {
175
178
  let blocks = this.blocks;
@@ -207,7 +210,7 @@ export default {
207
210
 
208
211
  const obj = {
209
212
  text: this.text,
210
- channel: this.conversation ?? this.reply_channel,
213
+ channel: await this.getChannelId(),
211
214
  attachments: this.attachments,
212
215
  unfurl_links: this.unfurl_links,
213
216
  unfurl_media: this.unfurl_media,
@@ -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.20",
7
+ version: "0.0.21",
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.20",
7
+ version: "0.0.21",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
8
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.47",
7
+ version: "0.0.48",
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.4",
7
+ version: "0.0.5",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.19",
7
+ version: "0.0.20",
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.24",
9
+ version: "0.1.25",
10
10
  type: "action",
11
11
  props: {
12
12
  slack: common.props.slack,
@@ -7,7 +7,7 @@ export default {
7
7
  key: "slack-send-block-kit-message",
8
8
  name: "Build and Send a Block Kit Message",
9
9
  description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).",
10
- version: "0.4.0",
10
+ version: "0.4.1",
11
11
  type: "action",
12
12
  props: {
13
13
  slack: common.props.slack,
@@ -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.19",
8
+ version: "0.0.20",
9
9
  type: "action",
10
10
  props: {
11
11
  slack: common.props.slack,
@@ -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.15",
9
+ version: "0.0.16",
10
10
  type: "action",
11
11
  props: {
12
12
  slack: common.props.slack,
@@ -7,7 +7,7 @@ export default {
7
7
  key: "slack-send-message-advanced",
8
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.0.2",
10
+ version: "0.0.3",
11
11
  type: "action",
12
12
  props: {
13
13
  slack: common.props.slack,
@@ -0,0 +1,40 @@
1
+ import common from "../common/send-message.mjs";
2
+ import constants from "../../common/constants.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "slack-send-message-to-channel",
7
+ name: "Send Message to Channel",
8
+ description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
9
+ version: "0.0.1",
10
+ type: "action",
11
+ props: {
12
+ slack: common.props.slack,
13
+ conversation: {
14
+ propDefinition: [
15
+ common.props.slack,
16
+ "conversation",
17
+ () => ({
18
+ types: [
19
+ constants.CHANNEL_TYPE.PUBLIC,
20
+ constants.CHANNEL_TYPE.PRIVATE,
21
+ ],
22
+ }),
23
+ ],
24
+ description: "Select a public or private channel",
25
+ },
26
+ text: {
27
+ propDefinition: [
28
+ common.props.slack,
29
+ "text",
30
+ ],
31
+ },
32
+ mrkdwn: {
33
+ propDefinition: [
34
+ common.props.slack,
35
+ "mrkdwn",
36
+ ],
37
+ },
38
+ ...common.props,
39
+ },
40
+ };
@@ -0,0 +1,73 @@
1
+ import common from "../common/send-message.mjs";
2
+ import constants from "../../common/constants.mjs";
3
+ import { ConfigurationError } from "@pipedream/platform";
4
+
5
+ export default {
6
+ ...common,
7
+ key: "slack-send-message-to-user-or-group",
8
+ name: "Send Message to User or Group",
9
+ description: "Send a message to a user or group. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
10
+ version: "0.0.1",
11
+ type: "action",
12
+ props: {
13
+ slack: common.props.slack,
14
+ users: {
15
+ propDefinition: [
16
+ common.props.slack,
17
+ "user",
18
+ ],
19
+ type: "string[]",
20
+ label: "Users",
21
+ description: "Select the user(s) to message",
22
+ optional: true,
23
+ },
24
+ conversation: {
25
+ propDefinition: [
26
+ common.props.slack,
27
+ "conversation",
28
+ () => ({
29
+ types: [
30
+ constants.CHANNEL_TYPE.MPIM,
31
+ ],
32
+ }),
33
+ ],
34
+ description: "Select the group to message",
35
+ optional: true,
36
+ },
37
+ text: {
38
+ propDefinition: [
39
+ common.props.slack,
40
+ "text",
41
+ ],
42
+ },
43
+ mrkdwn: {
44
+ propDefinition: [
45
+ common.props.slack,
46
+ "mrkdwn",
47
+ ],
48
+ },
49
+ ...common.props,
50
+ },
51
+ methods: {
52
+ ...common.methods,
53
+ openConversation(args = {}) {
54
+ return this.slack.makeRequest({
55
+ method: "conversations.open",
56
+ ...args,
57
+ });
58
+ },
59
+ async getChannelId() {
60
+ if (!this.conversation && !this.users?.length) {
61
+ throw new ConfigurationError("Must select a group or user(s) to message");
62
+ }
63
+
64
+ if (this.conversation) {
65
+ return this.conversation;
66
+ }
67
+ const { channel: { id } } = await this.openConversation({
68
+ users: this.users.join(),
69
+ });
70
+ return id;
71
+ },
72
+ },
73
+ };
@@ -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.4",
7
+ version: "0.0.5",
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.19",
7
+ version: "0.0.20",
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.4",
7
+ version: "0.0.5",
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.4",
7
+ version: "0.0.5",
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.19",
7
+ version: "0.1.20",
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.19",
8
+ version: "0.0.20",
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.23",
9
+ version: "0.0.24",
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.12",
8
+ version: "0.0.13",
9
9
  type: "action",
10
10
  props: {
11
11
  slack,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Pipedream Slack Components",
5
5
  "main": "slack.app.mjs",
6
6
  "keywords": [
package/slack.app.mjs CHANGED
@@ -119,7 +119,7 @@ export default {
119
119
  }
120
120
  }
121
121
  const [
122
- userNames,
122
+ userNames = await this.userNames(),
123
123
  conversationsResp,
124
124
  ] = await Promise.all([
125
125
  userNamesOrPromise,
@@ -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.6",
8
+ version: "0.0.7",
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.19",
8
+ version: "1.0.20",
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.16",
6
+ version: "0.0.17",
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.4",
9
+ version: "0.0.5",
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.21",
9
+ version: "1.0.22",
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.22",
8
+ version: "1.1.23",
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-new-saved-message",
7
7
  name: "New Saved Message (Instant)",
8
- version: "0.0.2",
8
+ version: "0.0.3",
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",
@@ -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.4",
9
+ version: "0.0.5",
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",