@pipedream/slack_v2 1.0.0 → 1.1.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.
Files changed (62) hide show
  1. package/actions/add-emoji-reaction/add-emoji-reaction.mjs +1 -1
  2. package/actions/add-reaction/add-reaction.mjs +1 -1
  3. package/actions/archive-channel/archive-channel.mjs +1 -1
  4. package/actions/browse-files/browse-files.mjs +1 -1
  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/edit-message/edit-message.mjs +1 -1
  10. package/actions/find-message/find-message.mjs +14 -3
  11. package/actions/find-user-by-email/find-user-by-email.mjs +1 -1
  12. package/actions/find-user-by-id/find-user-by-id.mjs +1 -1
  13. package/actions/get-channel-details/get-channel-details.mjs +1 -1
  14. package/actions/get-channel-history/get-channel-history.mjs +1 -1
  15. package/actions/get-current-user/get-current-user.mjs +1 -1
  16. package/actions/get-file/get-file.mjs +1 -1
  17. package/actions/get-thread-replies/get-thread-replies.mjs +1 -1
  18. package/actions/get-user-details/get-user-details.mjs +1 -1
  19. package/actions/invite-user-to-channel/invite-user-to-channel.mjs +1 -1
  20. package/actions/kick-user/kick-user.mjs +1 -1
  21. package/actions/list-channels/list-channels.mjs +1 -1
  22. package/actions/list-emojis/list-emojis.mjs +1 -1
  23. package/actions/list-files/list-files.mjs +1 -1
  24. package/actions/list-group-conversations/list-group-conversations.mjs +1 -1
  25. package/actions/list-group-members/list-group-members.mjs +1 -1
  26. package/actions/list-icon-emoji-options/list-icon-emoji-options.mjs +1 -1
  27. package/actions/list-members-in-channel/list-members-in-channel.mjs +1 -1
  28. package/actions/list-messages/list-messages.mjs +1 -1
  29. package/actions/list-reminder-options/list-reminder-options.mjs +1 -1
  30. package/actions/list-replies/list-replies.mjs +1 -1
  31. package/actions/list-teams/list-teams.mjs +1 -1
  32. package/actions/list-user-group-options/list-user-group-options.mjs +1 -1
  33. package/actions/list-users/list-users.mjs +1 -1
  34. package/actions/post-message/post-message.mjs +2 -2
  35. package/actions/reply-to-a-message/reply-to-a-message.mjs +1 -1
  36. package/actions/search/search.mjs +7 -2
  37. package/actions/send-block-kit-message/send-block-kit-message.mjs +1 -1
  38. package/actions/send-large-message/send-large-message.mjs +1 -1
  39. package/actions/send-message/send-message.mjs +1 -1
  40. package/actions/send-message-advanced/send-message-advanced.mjs +1 -1
  41. package/actions/send-message-to-channel/send-message-to-channel.mjs +1 -1
  42. package/actions/send-message-to-user-or-group/send-message-to-user-or-group.mjs +1 -1
  43. package/actions/set-channel-description/set-channel-description.mjs +1 -1
  44. package/actions/set-channel-topic/set-channel-topic.mjs +1 -1
  45. package/actions/set-status/set-status.mjs +1 -1
  46. package/actions/update-group-members/update-group-members.mjs +1 -1
  47. package/actions/update-message/update-message.mjs +1 -1
  48. package/actions/update-profile/update-profile.mjs +1 -1
  49. package/actions/upload-file/upload-file.mjs +1 -1
  50. package/actions/verify-slack-signature/verify-slack-signature.mjs +1 -1
  51. package/common/utils.mjs +81 -1
  52. package/package.json +1 -1
  53. package/slack_v2.app.mjs +1 -1
  54. package/sources/new-channel-created/new-channel-created.mjs +1 -1
  55. package/sources/new-interaction-event-received/new-interaction-event-received.mjs +1 -1
  56. package/sources/new-keyword-mention/new-keyword-mention.mjs +1 -1
  57. package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -1
  58. package/sources/new-private-channel-created/new-private-channel-created.mjs +1 -1
  59. package/sources/new-reaction-added/new-reaction-added.mjs +1 -1
  60. package/sources/new-saved-message/new-saved-message.mjs +1 -1
  61. package/sources/new-user-added/new-user-added.mjs +1 -1
  62. package/sources/new-user-mention/new-user-mention.mjs +1 -1
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-add-emoji-reaction",
6
6
  name: "Add Emoji Reaction",
7
7
  description: "Add an emoji reaction to a message. [See the documentation](https://api.slack.com/methods/reactions.add)",
8
- version: "0.0.24",
8
+ version: "0.0.25",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -10,7 +10,7 @@ export default {
10
10
  + " Use **Get Channel History** or **Search** to find the message timestamp."
11
11
  + " Emoji name should be without colons (e.g. `thumbsup`, `fire`, `heart`)."
12
12
  + " [See the documentation](https://api.slack.com/methods/reactions.add)",
13
- version: "0.0.4",
13
+ version: "0.0.5",
14
14
  type: "action",
15
15
  annotations: {
16
16
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-archive-channel",
6
6
  name: "Archive Channel",
7
7
  description: "Archive a public or private channel. Direct messages and group DMs can't be archived — pass a channel ID (e.g. `C1234567890`), not a user or group ID. [See the documentation](https://api.slack.com/methods/conversations.archive)",
8
- version: "0.0.32",
8
+ version: "0.0.33",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -10,7 +10,7 @@ export default {
10
10
  + " Filter by file type (e.g. `images`, `pdfs`, `snippets`)."
11
11
  + " Returns file metadata including name, type, size, and download URL."
12
12
  + " [See the documentation](https://api.slack.com/methods/files.list)",
13
- version: "0.0.4",
13
+ version: "0.0.5",
14
14
  type: "action",
15
15
  annotations: {
16
16
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-create-channel",
6
6
  name: "Create a Channel",
7
7
  description: "Create a new channel. [See the documentation](https://api.slack.com/methods/conversations.create)",
8
- version: "0.0.32",
8
+ version: "0.0.33",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-create-reminder",
6
6
  name: "Create Reminder",
7
7
  description: "Create a reminder. [See the documentation](https://api.slack.com/methods/reminders.add)",
8
- version: "0.0.33",
8
+ version: "0.0.34",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-delete-file",
6
6
  name: "Delete File",
7
7
  description: "Delete a file. [See the documentation](https://api.slack.com/methods/files.delete)",
8
- version: "0.0.32",
8
+ version: "0.0.33",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -13,7 +13,7 @@ export default {
13
13
  + " lets an identity delete its own messages, so this deletes as whichever identity posted:"
14
14
  + " it retries automatically with the other identity if the first attempt returns"
15
15
  + " `cant_delete_message`. [See the documentation](https://api.slack.com/methods/chat.delete)",
16
- version: "0.2.2",
16
+ version: "0.2.3",
17
17
  annotations: {
18
18
  destructiveHint: true,
19
19
  openWorldHint: true,
@@ -11,7 +11,7 @@ export default {
11
11
  + " Requires the message timestamp (`ts`) from **Get Channel History** or **Post Message**."
12
12
  + " You can only edit messages posted by the same token/user."
13
13
  + " [See the documentation](https://api.slack.com/methods/chat.update)",
14
- version: "0.0.4",
14
+ version: "0.0.5",
15
15
  type: "action",
16
16
  annotations: {
17
17
  destructiveHint: false,
@@ -1,11 +1,22 @@
1
1
  // x-pd-ai: optimized
2
+ import utils from "../../common/utils.mjs";
2
3
  import slack from "../../slack_v2.app.mjs";
3
4
 
4
5
  export default {
5
6
  key: "slack_v2-find-message",
6
7
  name: "Find Message",
7
- description: "Find a Slack message. [See the documentation](https://api.slack.com/methods/assistant.search.context)",
8
- version: "0.1.6",
8
+ description: "Find a Slack message by keyword or natural-language query across public and private channels."
9
+ + " Returns matching messages with channel context, timestamps, and permalinks."
10
+ + " Pass the returned `message_ts` to **Reply to a Message** to answer in thread,"
11
+ + " or to **Get Thread Replies** to read the rest of that conversation."
12
+ + " Use **Search** instead when you need file results or want to restrict `channelTypes`;"
13
+ + " use this action when you want to order results with `sort` / `sortDirection`."
14
+ + " User mentions come back in the canonical `<@U123>` form; echo it verbatim to post a real mention."
15
+ + " Display names are returned separately as `mentions`, an array of `{ id, name }` objects,"
16
+ + " omitted when no mention carried a name."
17
+ + " Do NOT splice a name back inline: Slack renders `<@U123|Name>` as literal text, not a mention."
18
+ + " [See the documentation](https://api.slack.com/methods/assistant.search.context)",
19
+ version: "0.2.0",
9
20
  annotations: {
10
21
  destructiveHint: false,
11
22
  openWorldHint: true,
@@ -63,7 +74,7 @@ export default {
63
74
  cursor = response.response_metadata?.next_cursor;
64
75
  } while (cursor && matches.length < maxResults);
65
76
 
66
- return matches.slice(0, maxResults);
77
+ return utils.normalizeSearchMessages(matches.slice(0, maxResults));
67
78
  },
68
79
  },
69
80
  async run({ $ }) {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-find-user-by-email",
6
6
  name: "Find User by Email",
7
7
  description: "Find a user by matching against their email. [See the documentation](https://api.slack.com/methods/users.lookupByEmail)",
8
- version: "0.0.31",
8
+ version: "0.0.32",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-find-user-by-id",
6
6
  name: "Find User by ID",
7
7
  description: "Find a user by their ID — including a specific user you already have the Slack ID for, whether or not it's your own. Returns user profile information including name, email (requires `users:read.email` scope), timezone, and status. If you only have an email address, use **Find User by Email** instead. [See the documentation](https://api.slack.com/methods/users.info)",
8
- version: "0.0.8",
8
+ version: "0.0.9",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-get-channel-details",
6
6
  name: "Get Channel Details",
7
7
  description: "Retrieve details for a Slack channel, specified by ID or by name — names are resolved automatically. [See the documentation](https://api.slack.com/methods/conversations.info)",
8
- version: "0.1.2",
8
+ version: "0.1.3",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -16,7 +16,7 @@ export default {
16
16
  + " messages carry blocks, attachments and edit metadata, so a busy channel can run to tens"
17
17
  + " of thousands of characters and be truncated before you see any of it."
18
18
  + " [See the documentation](https://api.slack.com/methods/conversations.history)",
19
- version: "0.2.1",
19
+ version: "0.2.2",
20
20
  type: "action",
21
21
  annotations: {
22
22
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-get-current-user",
6
6
  name: "Get Current User",
7
7
  description: "Do NOT use for a plain \"who am I\" / \"what's my user ID\" question — call **Get User Details** for that; it answers the same question with a far smaller payload. Do NOT use to look up a DIFFERENT, specifically-identified user (by ID or email) — this only ever describes the authenticated caller; use **Find User by ID** / **Find User by Email** for someone else. Do NOT use to enumerate multiple teams/workspaces (e.g. Enterprise Grid) — use **List Teams** for that; this returns only the caller's own current team. Use this ONLY when you specifically need the full member profile: locale, timezone, presence/status, admin and owner flags, name variants, or workspace domain and enterprise metadata. Combines `auth.test`, `users.info`, `users.profile.get` and `team.info`. [See Slack API docs](https://api.slack.com/methods/auth.test).",
8
- version: "0.0.7",
8
+ version: "0.0.8",
9
9
  type: "action",
10
10
  annotations: {
11
11
  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.7",
8
+ version: "0.1.8",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -14,7 +14,7 @@ export default {
14
14
  + " Slack messages carry blocks, attachments and edit metadata, so a long thread can run"
15
15
  + " to tens of thousands of characters and be truncated before you see any of it."
16
16
  + " [See the documentation](https://api.slack.com/methods/conversations.replies)",
17
- version: "0.1.2",
17
+ version: "0.1.3",
18
18
  type: "action",
19
19
  annotations: {
20
20
  destructiveHint: false,
@@ -14,7 +14,7 @@ export default {
14
14
  + " Prefer this over **Get Current User**, which returns a much larger payload and is only"
15
15
  + " needed for full profile detail (locale, status, admin flags)."
16
16
  + " [See the documentation](https://api.slack.com/methods/auth.test)",
17
- version: "0.0.4",
17
+ version: "0.0.5",
18
18
  type: "action",
19
19
  annotations: {
20
20
  destructiveHint: false,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack_v2-invite-user-to-channel",
7
7
  name: "Invite User to Channel",
8
8
  description: "Invite one or more users to an existing channel. Accepts a channel ID or NAME, and a user ID, EMAIL address or display name — all resolved automatically. Pass several users as a comma-separated list. [See the documentation](https://api.slack.com/methods/conversations.invite)",
9
- version: "0.1.2",
9
+ version: "0.1.3",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  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.32",
8
+ version: "0.0.33",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -16,7 +16,7 @@ export default {
16
16
  + " fetched — when you see that, raise `numPages` (or pass `cursor`) before answering"
17
17
  + " any 'how many' or 'list every' question, otherwise your answer is silently incomplete."
18
18
  + " [See the documentation](https://api.slack.com/methods/conversations.list)",
19
- version: "0.3.0",
19
+ version: "0.3.1",
20
20
  annotations: {
21
21
  destructiveHint: false,
22
22
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "List Emojis",
7
7
  description:
8
8
  "List all available emojis in the Slack workspace. Optionally include emoji image URLs. [See the documentation](https://api.slack.com/methods/emoji.list)",
9
- version: "0.0.6",
9
+ version: "0.0.7",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  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.7",
8
+ version: "0.1.8",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -11,7 +11,7 @@ export default {
11
11
  + " Returns `has_more: true` and `next_cursor` when more conversations exist than were"
12
12
  + " fetched — raise `numPages` (or pass `cursor`) to see the rest."
13
13
  + " [See the documentation](https://api.slack.com/methods/conversations.list)",
14
- version: "0.0.1",
14
+ version: "0.0.2",
15
15
  annotations: {
16
16
  destructiveHint: false,
17
17
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-group-members",
6
6
  name: "List Group Members",
7
7
  description: "List all users in a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.list)",
8
- version: "0.0.16",
8
+ version: "0.0.17",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-icon-emoji-options",
6
6
  name: "List Icon (emoji) Options",
7
7
  description: "Retrieves available options for the Icon (emoji) field. [See the documentation](https://api.slack.com/methods/emoji.list)",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-members-in-channel",
6
6
  name: "List Members in Channel",
7
7
  description: "Retrieve members of a channel. Accepts a channel ID or NAME (e.g. general or #general) — names are resolved automatically. [See the documentation](https://api.slack.com/methods/conversations.members)",
8
- version: "0.1.2",
8
+ version: "0.1.3",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -10,7 +10,7 @@ export default {
10
10
  + " selection to keep responses small, and returns the same message data."
11
11
  + " This legacy tool remains only for existing workflows: it accepts a raw conversation ID and"
12
12
  + " returns full, untrimmed message objects. [See the documentation](https://api.slack.com/methods/conversations.history)",
13
- version: "0.0.7",
13
+ version: "0.0.8",
14
14
  annotations: {
15
15
  destructiveHint: false,
16
16
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-reminder-options",
6
6
  name: "List Reminder Options",
7
7
  description: "Retrieves available options for the Reminder field. [See the documentation](https://docs.slack.dev/reference/methods/reminders.list)",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -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.32",
8
+ version: "0.0.33",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -15,7 +15,7 @@ export default {
15
15
  + " Returns `has_more: true` and `next_cursor` when more teams exist than were"
16
16
  + " fetched — raise `numPages` (or pass `cursor`) to see the rest."
17
17
  + " [See the documentation](https://api.slack.com/methods/auth.teams.list)",
18
- version: "0.0.1",
18
+ version: "0.0.2",
19
19
  annotations: {
20
20
  destructiveHint: false,
21
21
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-user-group-options",
6
6
  name: "List User Group Options",
7
7
  description: "Retrieves available options for the User Group field. [See the documentation](https://docs.slack.dev/reference/methods/usergroups.list)",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-list-users",
6
6
  name: "List Users",
7
7
  description: "Return a list of all users in a workspace. [See the documentation](https://api.slack.com/methods/users.list)",
8
- version: "0.0.31",
8
+ version: "0.0.32",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -12,7 +12,7 @@ export default {
12
12
  + " To reply to a thread, provide `threadTs` (Slack calls this `thread_ts`) from **Get Channel History**."
13
13
  + " Supports plain text with Slack mrkdwn formatting and Block Kit blocks."
14
14
  + " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
15
- version: "0.0.4",
15
+ version: "0.0.5",
16
16
  type: "action",
17
17
  annotations: {
18
18
  destructiveHint: false,
@@ -29,7 +29,7 @@ export default {
29
29
  text: {
30
30
  type: "string",
31
31
  label: "Text",
32
- description: "The message text. Supports Slack mrkdwn formatting (e.g. `*bold*`, `_italic_`, `<https://example.com|link>`).",
32
+ description: "The message text. Supports Slack mrkdwn formatting (e.g. `*bold*`, `_italic_`, `<https://example.com|link>`). To mention a user, use `<@U123>` with their user ID. Do NOT append a display name after a pipe: Slack renders `<@U123|Name>` as literal text, not a mention.",
33
33
  },
34
34
  blocks: {
35
35
  type: "string",
@@ -14,7 +14,7 @@ export default {
14
14
  + " (e.g. `1403051575.000407`); get it from **Get Channel History** or an incoming event's"
15
15
  + " `ts` field. For a plain, non-threaded message use **Post Message** instead."
16
16
  + " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
17
- version: "0.2.7",
17
+ version: "0.2.8",
18
18
  annotations: {
19
19
  destructiveHint: false,
20
20
  openWorldHint: true,
@@ -1,4 +1,5 @@
1
1
  // x-pd-ai: optimized
2
+ import utils from "../../common/utils.mjs";
2
3
  import slack from "../../slack_v2.app.mjs";
3
4
 
4
5
  export default {
@@ -9,8 +10,12 @@ export default {
9
10
  + " Supports keyword and semantic search across public and private channels."
10
11
  + " Use **Get User Details** first to find your user ID for filtering by 'my' messages."
11
12
  + " Returns matching messages with channel context, timestamps, and permalinks."
13
+ + " User mentions come back in the canonical `<@U123>` form; echo it verbatim to post a real mention."
14
+ + " Display names are returned separately as `mentions`, an array of `{ id, name }` objects,"
15
+ + " omitted when no mention carried a name."
16
+ + " Do NOT splice a name back inline: Slack renders `<@U123|Name>` as literal text, not a mention."
12
17
  + " [See the documentation](https://api.slack.com/methods/assistant.search.context)",
13
- version: "0.0.4",
18
+ version: "0.1.0",
14
19
  type: "action",
15
20
  annotations: {
16
21
  destructiveHint: false,
@@ -54,7 +59,7 @@ export default {
54
59
  cursor = response.response_metadata?.next_cursor;
55
60
  } while (cursor && matches.length < maxResults);
56
61
 
57
- const results = matches.slice(0, maxResults);
62
+ const results = utils.normalizeSearchMessages(matches.slice(0, maxResults));
58
63
 
59
64
  $.export("$summary", `Found ${results.length} result${results.length === 1
60
65
  ? ""
@@ -8,7 +8,7 @@ export default {
8
8
  key: "slack_v2-send-block-kit-message",
9
9
  name: "Build and Send a Block Kit Message",
10
10
  description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).",
11
- version: "0.5.7",
11
+ version: "0.5.8",
12
12
  annotations: {
13
13
  destructiveHint: false,
14
14
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack_v2-send-large-message",
7
7
  name: "Send a Large Message (3000+ characters)",
8
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",
9
- version: "0.1.7",
9
+ version: "0.1.8",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -7,7 +7,7 @@ export default {
7
7
  key: "slack_v2-send-message",
8
8
  name: "Send Message",
9
9
  description: "Send a message to a user, group, private channel or public channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
10
- version: "0.2.0",
10
+ version: "0.2.1",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "slack_v2-send-message-advanced",
10
10
  name: "Send Message (Advanced)",
11
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",
12
- version: "0.1.7",
12
+ version: "0.1.8",
13
13
  annotations: {
14
14
  destructiveHint: false,
15
15
  openWorldHint: true,
@@ -12,7 +12,7 @@ export default {
12
12
  + " replies and unfurl settings. Use this tool only if a workflow specifically needs to"
13
13
  + " target a channel exclusively, without the user/group support **Post Message** offers."
14
14
  + " [See the documentation](https://api.slack.com/methods/chat.postMessage)",
15
- version: "0.2.0",
15
+ version: "0.2.1",
16
16
  annotations: {
17
17
  destructiveHint: false,
18
18
  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.2.0",
10
+ version: "0.2.1",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-set-channel-description",
6
6
  name: "Set Channel Description",
7
7
  description: "Change the description or purpose of a channel. [See the documentation](https://api.slack.com/methods/conversations.setPurpose)",
8
- version: "0.0.17",
8
+ version: "0.0.18",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-set-channel-topic",
6
6
  name: "Set Channel Topic",
7
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)",
8
- version: "0.1.2",
8
+ version: "0.1.3",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-set-status",
6
6
  name: "Set Status",
7
7
  description: "Set the current status for a user. [See the documentation](https://api.slack.com/methods/users.profile.set)",
8
- version: "0.0.16",
8
+ version: "0.0.17",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-update-group-members",
6
6
  name: "Update Group Members",
7
7
  description: "Update the list of users for a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.update)",
8
- version: "0.0.17",
8
+ version: "0.0.18",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "slack_v2-update-message",
6
6
  name: "Update Message",
7
7
  description: "Update a message. [See the documentation](https://api.slack.com/methods/chat.update)",
8
- version: "0.2.7",
8
+ version: "0.2.8",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack_v2-update-profile",
7
7
  name: "Update Profile",
8
8
  description: "Update basic profile field such as name or title. [See the documentation](https://api.slack.com/methods/users.profile.set)",
9
- version: "0.0.32",
9
+ version: "0.0.33",
10
10
  annotations: {
11
11
  destructiveHint: true,
12
12
  openWorldHint: true,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "slack_v2-upload-file",
10
10
  name: "Upload File",
11
11
  description: "Upload a file. [See the documentation](https://api.slack.com/messaging/files#uploading_files)",
12
- version: "0.1.11",
12
+ version: "0.1.12",
13
13
  annotations: {
14
14
  destructiveHint: false,
15
15
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "slack_v2-verify-slack-signature",
7
7
  name: "Verify Slack Signature",
8
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
+ version: "1.0.1",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
package/common/utils.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Shared helpers for the `fields` projection offered by the list/history actions.
2
+ * Shared helpers for the `fields` projection offered by the list/history actions, and for
3
+ * normalizing the user-mention encoding that `assistant.search.context` returns.
3
4
  *
4
5
  * Three actions (Get Channel History, Get Thread Replies, List Channels) let the caller
5
6
  * name the properties they want back. Both halves of that feature — normalizing the prop
@@ -62,8 +63,87 @@ export function projectFields(records, value) {
62
63
  : records;
63
64
  }
64
65
 
66
+ /**
67
+ * A user mention as Slack encodes it in message text.
68
+ * `[UW]` because Enterprise Grid mints both prefixes and they coexist in one message:
69
+ * `W`-prefixed ids are the older grid format, `U`-prefixed the current one.
70
+ */
71
+ const USER_MENTION = /<@([UW][A-Z0-9]{8,})(?:\|([^>]*))?>/g;
72
+
73
+ /**
74
+ * Slack does not render the pipe form on the write path: `chat.postMessage` prints it
75
+ * as literal text, so the reader sees a raw `<@U123|Display Name>` where a mention belonged.
76
+ *
77
+ * Normalizing on the read side means every read tool hands the agent the one encoding
78
+ * that is safe to echo back.
79
+ *
80
+ * The display name is not discarded: the names travel alongside the text as a compact
81
+ * `{id, name}` list instead of inline.
82
+ *
83
+ * @param {string} text - message text as Slack returned it
84
+ * @returns {{text: string, mentions: {id: string, name: string}[]}} normalized text, plus
85
+ * one entry per distinct mentioned user that carried a display name
86
+ */
87
+ export function normalizeUserMentions(text) {
88
+ if (typeof text !== "string" || !text.includes("<@")) {
89
+ return {
90
+ text,
91
+ mentions: [],
92
+ };
93
+ }
94
+
95
+ const named = new Map();
96
+
97
+ const normalized = text.replace(USER_MENTION, (match, id, label) => {
98
+ const name = label?.trim();
99
+ if (name && !named.has(id)) {
100
+ named.set(id, name);
101
+ }
102
+ return `<@${id}>`;
103
+ });
104
+
105
+ return {
106
+ text: normalized,
107
+ mentions: [
108
+ ...named,
109
+ ].map(([
110
+ id,
111
+ name,
112
+ ]) => ({
113
+ id,
114
+ name,
115
+ })),
116
+ };
117
+ }
118
+
119
+ /**
120
+ * @param {object[]} messages - search result messages
121
+ * @returns {object[]} messages with normalized `content`, plus `mentions` where present
122
+ */
123
+ export function normalizeSearchMessages(messages) {
124
+ return messages.map((message) => {
125
+ if (typeof message?.content !== "string") {
126
+ return message;
127
+ }
128
+ const {
129
+ text, mentions,
130
+ } = normalizeUserMentions(message.content);
131
+ return {
132
+ ...message,
133
+ content: text,
134
+ ...(mentions.length
135
+ ? {
136
+ mentions,
137
+ }
138
+ : {}),
139
+ };
140
+ });
141
+ }
142
+
65
143
  export default {
66
144
  parseFields,
67
145
  pickFields,
68
146
  projectFields,
147
+ normalizeUserMentions,
148
+ normalizeSearchMessages,
69
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack_v2",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pipedream Slack_v2 Components",
5
5
  "main": "slack_v2.app.mjs",
6
6
  "keywords": [
package/slack_v2.app.mjs CHANGED
@@ -52,7 +52,7 @@ export default {
52
52
  text: {
53
53
  type: "string",
54
54
  label: "Text",
55
- description: "Text of the message to send (see Slack's [formatting docs](https://api.slack.com/reference/surfaces/formatting)). This field is usually necessary, unless you're providing only attachments instead.",
55
+ description: "Text of the message to send (see Slack's [formatting docs](https://api.slack.com/reference/surfaces/formatting)). This field is usually necessary, unless you're providing only attachments instead. To mention a user, use `<@U123>` with their user ID. Do NOT append a display name after a pipe: Slack renders `<@U123|Name>` as literal text, not a mention.",
56
56
  },
57
57
  topic: {
58
58
  type: "string",
@@ -5,7 +5,7 @@ export default {
5
5
  ...common,
6
6
  key: "slack_v2-new-channel-created",
7
7
  name: "New Channel Created (Instant)",
8
- version: "0.0.17",
8
+ version: "0.0.18",
9
9
  description: "Emit new event when a new channel is created.",
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.28",
6
+ version: "0.0.29",
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.7",
10
+ version: "0.1.8",
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.7",
10
+ version: "1.1.8",
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",
7
+ version: "0.0.8",
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.7",
8
+ version: "1.2.8",
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.13",
8
+ version: "0.0.14",
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",
@@ -5,7 +5,7 @@ export default {
5
5
  ...common,
6
6
  key: "slack_v2-new-user-added",
7
7
  name: "New User Added (Instant)",
8
- version: "0.0.11",
8
+ version: "0.0.12",
9
9
  description: "Emit new event when a new member joins a workspace.",
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.7",
10
+ version: "0.1.8",
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",