@pipedream/slack_v2 0.8.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.
- 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 +15 -3
- 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 +30 -4
- package/actions/reply-to-a-message/reply-to-a-message.mjs +13 -12
- package/actions/search/search.mjs +7 -2
- 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/common/utils.mjs +81 -1
- package/package.json +2 -2
- package/slack_v2.app.mjs +21 -370
- 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,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-get-current-user",
|
|
5
6
|
name: "Get Current User",
|
|
6
|
-
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. 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).",
|
|
7
|
-
version: "0.0.
|
|
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.8",
|
|
8
9
|
type: "action",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
2
|
import slack from "../../slack_v2.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "slack_v2-get-file",
|
|
6
6
|
name: "Get File",
|
|
7
7
|
description: "Return information about a file. [See the documentation](https://api.slack.com/methods/files.info)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.8",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -18,14 +18,7 @@ export default {
|
|
|
18
18
|
propDefinition: [
|
|
19
19
|
slack,
|
|
20
20
|
"conversation",
|
|
21
|
-
() => ({
|
|
22
|
-
types: [
|
|
23
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
24
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
25
|
-
],
|
|
26
|
-
}),
|
|
27
21
|
],
|
|
28
|
-
description: "Select a public or private channel",
|
|
29
22
|
},
|
|
30
23
|
addToChannel: {
|
|
31
24
|
propDefinition: [
|
|
@@ -37,9 +30,6 @@ export default {
|
|
|
37
30
|
propDefinition: [
|
|
38
31
|
slack,
|
|
39
32
|
"file",
|
|
40
|
-
(c) => ({
|
|
41
|
-
channel: c.conversation,
|
|
42
|
-
}),
|
|
43
33
|
],
|
|
44
34
|
},
|
|
45
35
|
},
|
|
@@ -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.
|
|
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.
|
|
17
|
+
version: "0.0.5",
|
|
18
18
|
type: "action",
|
|
19
19
|
annotations: {
|
|
20
20
|
destructiveHint: false,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import { ConfigurationError } from "@pipedream/platform";
|
|
2
3
|
import slack from "../../slack_v2.app.mjs";
|
|
3
4
|
|
|
@@ -5,7 +6,7 @@ export default {
|
|
|
5
6
|
key: "slack_v2-invite-user-to-channel",
|
|
6
7
|
name: "Invite User to Channel",
|
|
7
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)",
|
|
8
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.3",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
|
-
import constants from "../../common/constants.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "slack_v2-kick-user",
|
|
6
6
|
name: "Kick User",
|
|
7
7
|
description: "Remove a user from a conversation. [See the documentation](https://api.slack.com/methods/conversations.kick)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.33",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -18,22 +18,12 @@ export default {
|
|
|
18
18
|
propDefinition: [
|
|
19
19
|
slack,
|
|
20
20
|
"conversation",
|
|
21
|
-
() => ({
|
|
22
|
-
types: [
|
|
23
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
24
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
25
|
-
constants.CHANNEL_TYPE.MPIM,
|
|
26
|
-
],
|
|
27
|
-
}),
|
|
28
21
|
],
|
|
29
22
|
},
|
|
30
23
|
user: {
|
|
31
24
|
propDefinition: [
|
|
32
25
|
slack,
|
|
33
26
|
"user",
|
|
34
|
-
(c) => ({
|
|
35
|
-
channelId: c.conversation,
|
|
36
|
-
}),
|
|
37
27
|
],
|
|
38
28
|
},
|
|
39
29
|
},
|
|
@@ -7,15 +7,16 @@ export default {
|
|
|
7
7
|
name: "List Channels",
|
|
8
8
|
description:
|
|
9
9
|
"Return a list of channels in a workspace."
|
|
10
|
-
+ "
|
|
11
|
-
+ " a full channel object is ~1KB, so a workspace of any real size
|
|
12
|
-
+ " large enough to be truncated
|
|
13
|
-
+ "
|
|
10
|
+
+ " Pass `fields` (e.g. `[\"id\",\"name\"]`) to limit the returned properties —"
|
|
11
|
+
+ " a full channel object is ~1KB, so a workspace of any real size can return a payload"
|
|
12
|
+
+ " large enough to be truncated. Omit `fields` when you need the complete channel objects."
|
|
13
|
+
+ " Use `namePrefix` to filter results to channels whose names start with a given string"
|
|
14
|
+
+ " (e.g. `dev-`) without a client-side filter loop."
|
|
14
15
|
+ " Returns `has_more: true` and `next_cursor` when more channels exist than were"
|
|
15
16
|
+ " fetched — when you see that, raise `numPages` (or pass `cursor`) before answering"
|
|
16
17
|
+ " any 'how many' or 'list every' question, otherwise your answer is silently incomplete."
|
|
17
18
|
+ " [See the documentation](https://api.slack.com/methods/conversations.list)",
|
|
18
|
-
version: "0.
|
|
19
|
+
version: "0.3.1",
|
|
19
20
|
annotations: {
|
|
20
21
|
destructiveHint: false,
|
|
21
22
|
openWorldHint: true,
|
|
@@ -27,7 +28,7 @@ export default {
|
|
|
27
28
|
channelTypes: {
|
|
28
29
|
type: "string",
|
|
29
30
|
label: "Channel Types",
|
|
30
|
-
description: "
|
|
31
|
+
description: "Which channel types to list. Pass `public_channel` for public channels only, `private_channel` for private channels only, or `public_channel,private_channel` for both (default).",
|
|
31
32
|
options: [
|
|
32
33
|
{
|
|
33
34
|
label: "Public Channels",
|
|
@@ -67,9 +68,15 @@ export default {
|
|
|
67
68
|
],
|
|
68
69
|
},
|
|
69
70
|
cursor: {
|
|
71
|
+
propDefinition: [
|
|
72
|
+
slack,
|
|
73
|
+
"cursor",
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
namePrefix: {
|
|
70
77
|
type: "string",
|
|
71
|
-
label: "
|
|
72
|
-
description: "
|
|
78
|
+
label: "Name Prefix",
|
|
79
|
+
description: "Return only channels whose names start with this prefix (case-insensitive). Example: `dev-`. When set, ALL pages are fetched regardless of `Number of Pages` so the filter is applied across the full workspace channel list.",
|
|
73
80
|
optional: true,
|
|
74
81
|
},
|
|
75
82
|
},
|
|
@@ -86,15 +93,26 @@ export default {
|
|
|
86
93
|
let page = 0;
|
|
87
94
|
let nextCursor;
|
|
88
95
|
|
|
96
|
+
// namePrefix filters each page as it arrives (rather than accumulating the full
|
|
97
|
+
// workspace and filtering once at the end) so memory stays bounded by the match
|
|
98
|
+
// count, not the workspace size, on large workspaces.
|
|
99
|
+
const prefix = this.namePrefix?.toLowerCase();
|
|
100
|
+
|
|
89
101
|
do {
|
|
90
102
|
const {
|
|
91
103
|
channels, response_metadata: metadata,
|
|
92
104
|
} = await this.slack.conversationsList(params);
|
|
93
|
-
|
|
105
|
+
const pageChannels = prefix
|
|
106
|
+
? channels.filter((c) => c.name?.toLowerCase().startsWith(prefix))
|
|
107
|
+
: channels;
|
|
108
|
+
allChannels.push(...pageChannels);
|
|
94
109
|
nextCursor = metadata?.next_cursor;
|
|
95
110
|
params.cursor = nextCursor;
|
|
96
111
|
page++;
|
|
97
|
-
|
|
112
|
+
// When namePrefix is active, fetch ALL pages so the filter can be applied
|
|
113
|
+
// across the full workspace channel list — matching channels may live on
|
|
114
|
+
// any page and would be silently missing if capped at numPages.
|
|
115
|
+
} while (params.cursor && (this.namePrefix || page < this.numPages));
|
|
98
116
|
|
|
99
117
|
// `fields` is ADDITIVE: omitted returns exactly what this action has always
|
|
100
118
|
// returned, so existing workflows are unaffected. Supplied, it plucks per channel —
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
@@ -5,7 +6,7 @@ export default {
|
|
|
5
6
|
name: "List Emojis",
|
|
6
7
|
description:
|
|
7
8
|
"List all available emojis in the Slack workspace. Optionally include emoji image URLs. [See the documentation](https://api.slack.com/methods/emoji.list)",
|
|
8
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
11
12
|
openWorldHint: true,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
2
|
import slack from "../../slack_v2.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "slack_v2-list-files",
|
|
6
6
|
name: "List Files",
|
|
7
7
|
description: "Return a list of files within a team. [See the documentation](https://api.slack.com/methods/files.list)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.8",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -18,14 +18,7 @@ export default {
|
|
|
18
18
|
propDefinition: [
|
|
19
19
|
slack,
|
|
20
20
|
"conversation",
|
|
21
|
-
() => ({
|
|
22
|
-
types: [
|
|
23
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
24
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
25
|
-
],
|
|
26
|
-
}),
|
|
27
21
|
],
|
|
28
|
-
description: "Select a public or private channel",
|
|
29
22
|
},
|
|
30
23
|
addToChannel: {
|
|
31
24
|
propDefinition: [
|
|
@@ -61,15 +54,17 @@ export default {
|
|
|
61
54
|
},
|
|
62
55
|
},
|
|
63
56
|
async run({ $ }) {
|
|
57
|
+
const channel = await this.slack.resolveChannelId(this.conversation);
|
|
58
|
+
|
|
64
59
|
if (this.addToChannel) {
|
|
65
60
|
await this.slack.maybeAddAppToChannels([
|
|
66
|
-
|
|
61
|
+
channel,
|
|
67
62
|
]);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
const allFiles = [];
|
|
71
66
|
const params = {
|
|
72
|
-
channel
|
|
67
|
+
channel,
|
|
73
68
|
user: this.user,
|
|
74
69
|
team_id: this.team_id,
|
|
75
70
|
page: 1,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
|
+
import slack from "../../slack_v2.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "slack_v2-list-group-conversations",
|
|
6
|
+
name: "List Group Conversations",
|
|
7
|
+
description:
|
|
8
|
+
"Return a list of multi-person direct message (group DM) conversations the connected"
|
|
9
|
+
+ " account is a member of. Use the returned `id` (e.g. `G1234567890`) wherever a Group"
|
|
10
|
+
+ " conversation ID is required."
|
|
11
|
+
+ " Returns `has_more: true` and `next_cursor` when more conversations exist than were"
|
|
12
|
+
+ " fetched — raise `numPages` (or pass `cursor`) to see the rest."
|
|
13
|
+
+ " [See the documentation](https://api.slack.com/methods/conversations.list)",
|
|
14
|
+
version: "0.0.2",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
},
|
|
20
|
+
type: "action",
|
|
21
|
+
props: {
|
|
22
|
+
slack,
|
|
23
|
+
pageSize: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
slack,
|
|
26
|
+
"pageSize",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
numPages: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
slack,
|
|
32
|
+
"numPages",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
cursor: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
slack,
|
|
38
|
+
"cursor",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
async run({ $ }) {
|
|
43
|
+
const groups = [];
|
|
44
|
+
const params = {
|
|
45
|
+
types: "mpim",
|
|
46
|
+
limit: this.pageSize,
|
|
47
|
+
cursor: this.cursor,
|
|
48
|
+
};
|
|
49
|
+
let page = 0;
|
|
50
|
+
let nextCursor;
|
|
51
|
+
|
|
52
|
+
do {
|
|
53
|
+
const {
|
|
54
|
+
channels, response_metadata: metadata,
|
|
55
|
+
} = await this.slack.conversationsList(params);
|
|
56
|
+
groups.push(...channels.map(({
|
|
57
|
+
id, purpose, is_archived: isArchived,
|
|
58
|
+
}) => ({
|
|
59
|
+
id,
|
|
60
|
+
purpose: purpose?.value,
|
|
61
|
+
is_archived: isArchived,
|
|
62
|
+
})));
|
|
63
|
+
nextCursor = metadata?.next_cursor;
|
|
64
|
+
params.cursor = nextCursor;
|
|
65
|
+
page++;
|
|
66
|
+
} while (params.cursor && page < this.numPages);
|
|
67
|
+
|
|
68
|
+
const hasMore = Boolean(nextCursor);
|
|
69
|
+
|
|
70
|
+
$.export("$summary", `Successfully found ${groups.length} group conversation${groups.length === 1
|
|
71
|
+
? ""
|
|
72
|
+
: "s"}${hasMore
|
|
73
|
+
? " (more available — raise Number of Pages or pass the cursor)"
|
|
74
|
+
: ""}`);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
groups,
|
|
78
|
+
has_more: hasMore,
|
|
79
|
+
...(hasMore
|
|
80
|
+
? {
|
|
81
|
+
next_cursor: nextCursor,
|
|
82
|
+
}
|
|
83
|
+
: {}),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -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-list-group-members",
|
|
5
6
|
name: "List Group Members",
|
|
6
7
|
description: "List all users in a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.list)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.17",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: false,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -25,7 +26,7 @@ export default {
|
|
|
25
26
|
"team",
|
|
26
27
|
],
|
|
27
28
|
optional: true,
|
|
28
|
-
description: "
|
|
29
|
+
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.",
|
|
29
30
|
},
|
|
30
31
|
pageSize: {
|
|
31
32
|
propDefinition: [
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack_v2 from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-list-icon-emoji-options",
|
|
5
6
|
name: "List Icon (emoji) Options",
|
|
6
|
-
description: "Retrieves available options for the Icon (emoji) field.",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
description: "Retrieves available options for the Icon (emoji) field. [See the documentation](https://api.slack.com/methods/emoji.list)",
|
|
8
|
+
version: "0.0.5",
|
|
8
9
|
type: "action",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
@@ -15,7 +16,9 @@ export default {
|
|
|
15
16
|
slack_v2,
|
|
16
17
|
},
|
|
17
18
|
async run({ $ }) {
|
|
18
|
-
const options = await slack_v2.
|
|
19
|
+
const options = await this.slack_v2.getCustomEmojis({
|
|
20
|
+
throwRateLimitError: true,
|
|
21
|
+
});
|
|
19
22
|
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
23
|
? ""
|
|
21
24
|
: "s"}`);
|
|
@@ -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-list-members-in-channel",
|
|
5
6
|
name: "List Members in Channel",
|
|
6
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)",
|
|
7
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.3",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: false,
|
|
10
11
|
openWorldHint: true,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
@@ -9,7 +10,7 @@ export default {
|
|
|
9
10
|
+ " selection to keep responses small, and returns the same message data."
|
|
10
11
|
+ " This legacy tool remains only for existing workflows: it accepts a raw conversation ID and"
|
|
11
12
|
+ " returns full, untrimmed message objects. [See the documentation](https://api.slack.com/methods/conversations.history)",
|
|
12
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.8",
|
|
13
14
|
annotations: {
|
|
14
15
|
destructiveHint: false,
|
|
15
16
|
openWorldHint: true,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack_v2 from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-list-reminder-options",
|
|
5
6
|
name: "List Reminder Options",
|
|
6
|
-
description: "Retrieves available options for the Reminder field.",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
description: "Retrieves available options for the Reminder field. [See the documentation](https://docs.slack.dev/reference/methods/reminders.list)",
|
|
8
|
+
version: "0.0.5",
|
|
8
9
|
type: "action",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
@@ -15,7 +16,13 @@ export default {
|
|
|
15
16
|
slack_v2,
|
|
16
17
|
},
|
|
17
18
|
async run({ $ }) {
|
|
18
|
-
const
|
|
19
|
+
const { reminders } = await this.slack_v2.remindersList({
|
|
20
|
+
throwRateLimitError: true,
|
|
21
|
+
});
|
|
22
|
+
const options = reminders.map((r) => ({
|
|
23
|
+
label: r.text,
|
|
24
|
+
value: r.id,
|
|
25
|
+
}));
|
|
19
26
|
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
27
|
? ""
|
|
21
28
|
: "s"}`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
2
|
import slack from "../../slack_v2.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "slack_v2-list-replies",
|
|
6
6
|
name: "List Replies",
|
|
7
7
|
description: "Retrieve a thread of messages posted to a conversation. [See the documentation](https://api.slack.com/methods/conversations.replies)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.33",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -18,14 +18,7 @@ export default {
|
|
|
18
18
|
propDefinition: [
|
|
19
19
|
slack,
|
|
20
20
|
"conversation",
|
|
21
|
-
() => ({
|
|
22
|
-
types: [
|
|
23
|
-
constants.CHANNEL_TYPE.PUBLIC,
|
|
24
|
-
constants.CHANNEL_TYPE.PRIVATE,
|
|
25
|
-
],
|
|
26
|
-
}),
|
|
27
21
|
],
|
|
28
|
-
description: "Select a public or private channel",
|
|
29
22
|
},
|
|
30
23
|
timestamp: {
|
|
31
24
|
propDefinition: [
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
2
|
+
import slack from "../../slack_v2.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "slack_v2-list-teams",
|
|
6
|
+
name: "List Teams",
|
|
7
|
+
description:
|
|
8
|
+
"Return the full list of teams (workspaces) accessible to the connected account,"
|
|
9
|
+
+ " with pagination (`has_more`/`next_cursor`) so you know whether there could be more"
|
|
10
|
+
+ " than what came back. Use this — not **Get User Details** or **Get Current User**, which"
|
|
11
|
+
+ " only ever describe the caller's single current team — whenever the task asks to"
|
|
12
|
+
+ " enumerate, count, or check for multiple teams/workspaces, especially on an"
|
|
13
|
+
+ " Enterprise Grid org-wide token. Use the returned `id` (e.g. `T1234567890`)"
|
|
14
|
+
+ " wherever a Team ID is required."
|
|
15
|
+
+ " Returns `has_more: true` and `next_cursor` when more teams exist than were"
|
|
16
|
+
+ " fetched — raise `numPages` (or pass `cursor`) to see the rest."
|
|
17
|
+
+ " [See the documentation](https://api.slack.com/methods/auth.teams.list)",
|
|
18
|
+
version: "0.0.2",
|
|
19
|
+
annotations: {
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
openWorldHint: true,
|
|
22
|
+
readOnlyHint: true,
|
|
23
|
+
},
|
|
24
|
+
type: "action",
|
|
25
|
+
props: {
|
|
26
|
+
slack,
|
|
27
|
+
pageSize: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
slack,
|
|
30
|
+
"pageSize",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
numPages: {
|
|
34
|
+
propDefinition: [
|
|
35
|
+
slack,
|
|
36
|
+
"numPages",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
cursor: {
|
|
40
|
+
propDefinition: [
|
|
41
|
+
slack,
|
|
42
|
+
"cursor",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
async run({ $ }) {
|
|
47
|
+
const teams = [];
|
|
48
|
+
const params = {
|
|
49
|
+
limit: this.pageSize,
|
|
50
|
+
cursor: this.cursor,
|
|
51
|
+
};
|
|
52
|
+
let page = 0;
|
|
53
|
+
let nextCursor;
|
|
54
|
+
|
|
55
|
+
do {
|
|
56
|
+
const {
|
|
57
|
+
teams: fetched, response_metadata: metadata,
|
|
58
|
+
} = await this.slack.authTeamsList(params);
|
|
59
|
+
teams.push(...fetched.map(({
|
|
60
|
+
id, name,
|
|
61
|
+
}) => ({
|
|
62
|
+
id,
|
|
63
|
+
name,
|
|
64
|
+
})));
|
|
65
|
+
nextCursor = metadata?.next_cursor;
|
|
66
|
+
params.cursor = nextCursor;
|
|
67
|
+
page++;
|
|
68
|
+
} while (params.cursor && page < this.numPages);
|
|
69
|
+
|
|
70
|
+
const hasMore = Boolean(nextCursor);
|
|
71
|
+
|
|
72
|
+
$.export("$summary", `Successfully found ${teams.length} team${teams.length === 1
|
|
73
|
+
? ""
|
|
74
|
+
: "s"}${hasMore
|
|
75
|
+
? " (more available — raise Number of Pages or pass the cursor)"
|
|
76
|
+
: ""}`);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
teams,
|
|
80
|
+
has_more: hasMore,
|
|
81
|
+
...(hasMore
|
|
82
|
+
? {
|
|
83
|
+
next_cursor: nextCursor,
|
|
84
|
+
}
|
|
85
|
+
: {}),
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// x-pd-ai: optimized
|
|
1
2
|
import slack_v2 from "../../slack_v2.app.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "slack_v2-list-user-group-options",
|
|
5
6
|
name: "List User Group Options",
|
|
6
|
-
description: "Retrieves available options for the User Group field.",
|
|
7
|
-
version: "0.0.
|
|
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.5",
|
|
8
9
|
type: "action",
|
|
9
10
|
annotations: {
|
|
10
11
|
destructiveHint: false,
|
|
@@ -15,7 +16,13 @@ export default {
|
|
|
15
16
|
slack_v2,
|
|
16
17
|
},
|
|
17
18
|
async run({ $ }) {
|
|
18
|
-
const
|
|
19
|
+
const { usergroups } = await this.slack_v2.usergroupsList({
|
|
20
|
+
throwRateLimitError: true,
|
|
21
|
+
});
|
|
22
|
+
const options = usergroups.map((g) => ({
|
|
23
|
+
label: g.name,
|
|
24
|
+
value: g.id,
|
|
25
|
+
}));
|
|
19
26
|
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
27
|
? ""
|
|
21
28
|
: "s"}`);
|
|
@@ -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-list-users",
|
|
5
6
|
name: "List Users",
|
|
6
7
|
description: "Return a list of all users in a workspace. [See the documentation](https://api.slack.com/methods/users.list)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.32",
|
|
8
9
|
annotations: {
|
|
9
10
|
destructiveHint: false,
|
|
10
11
|
openWorldHint: true,
|