@activepieces/piece-slack 0.9.3 → 0.9.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-slack",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ai-sdk/anthropic": "1.2.12",
|
|
6
6
|
"@ai-sdk/google": "1.2.19",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"semver": "7.6.0",
|
|
19
19
|
"slackify-markdown": "4.4.0",
|
|
20
20
|
"zod": "3.25.67",
|
|
21
|
-
"@activepieces/pieces-common": "0.
|
|
22
|
-
"@activepieces/pieces-framework": "0.
|
|
23
|
-
"@activepieces/shared": "0.
|
|
21
|
+
"@activepieces/pieces-common": "0.6.0",
|
|
22
|
+
"@activepieces/pieces-framework": "0.15.0",
|
|
23
|
+
"@activepieces/shared": "0.17.0",
|
|
24
24
|
"tslib": "2.8.1"
|
|
25
25
|
},
|
|
26
26
|
"overrides": {
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Slack": "Slack",
|
|
3
|
+
"Channel-based messaging platform": "Channel-based messaging platform",
|
|
4
|
+
"Add Reaction to Message": "Add Reaction to Message",
|
|
5
|
+
"Send Message To A User": "Send Message To A User",
|
|
6
|
+
"Send Message To A Channel": "Send Message To A Channel",
|
|
7
|
+
"Request Approval from A User": "Request Approval from A User",
|
|
8
|
+
"Request Approval in a Channel": "Request Approval in a Channel",
|
|
9
|
+
"Request Action from A User": "Request Action from A User",
|
|
10
|
+
"Request Action in A Channel": "Request Action in A Channel",
|
|
11
|
+
"Upload file": "Upload file",
|
|
12
|
+
"Get File": "Get File",
|
|
13
|
+
"Search messages": "Search messages",
|
|
14
|
+
"Find User by Email": "Find User by Email",
|
|
15
|
+
"Find User by Handle": "Find User by Handle",
|
|
16
|
+
"Find User by ID": "Find User by ID",
|
|
17
|
+
"Update message": "Update message",
|
|
18
|
+
"Create Channel": "Create Channel",
|
|
19
|
+
"Update Profile": "Update Profile",
|
|
20
|
+
"Get channel history": "Get channel history",
|
|
21
|
+
"Set User Status": "Set User Status",
|
|
22
|
+
"Markdown to Slack format": "Markdown to Slack format",
|
|
23
|
+
"Retrieve Thread Messages": "Retrieve Thread Messages",
|
|
24
|
+
"Set Channel Topic": "Set Channel Topic",
|
|
25
|
+
"Get Message by Timestamp": "Get Message by Timestamp",
|
|
26
|
+
"Invite User to Channel": "Invite User to Channel",
|
|
27
|
+
"Custom API Call": "Custom API Call",
|
|
28
|
+
"Add an emoji reaction to a message.": "Add an emoji reaction to a message.",
|
|
29
|
+
"Send message to a user": "Send message to a user",
|
|
30
|
+
"Send message to a channel": "Send message to a channel",
|
|
31
|
+
"Send approval message to a user and then wait until the message is approved or disapproved": "Send approval message to a user and then wait until the message is approved or disapproved",
|
|
32
|
+
"Send approval message to a channel and then wait until the message is approved or disapproved": "Send approval message to a channel and then wait until the message is approved or disapproved",
|
|
33
|
+
"Send a message to a user and wait until the user selects an action": "Send a message to a user and wait until the user selects an action",
|
|
34
|
+
"Send a message in a channel and wait until an action is selected": "Send a message in a channel and wait until an action is selected",
|
|
35
|
+
"Upload file without sharing it to a channel or user": "Upload file without sharing it to a channel or user",
|
|
36
|
+
"Return information about a given file ID.": "Return information about a given file ID.",
|
|
37
|
+
"Searches for messages matching a query": "Searches for messages matching a query",
|
|
38
|
+
"Finds a user by matching against their email address.": "Finds a user by matching against their email address.",
|
|
39
|
+
"Finds a user by matching against their Slack handle.": "Finds a user by matching against their Slack handle.",
|
|
40
|
+
"Finds a user by their ID.": "Finds a user by their ID.",
|
|
41
|
+
"Update an existing message": "Update an existing message",
|
|
42
|
+
"Creates a new channel.": "Creates a new channel.",
|
|
43
|
+
"Update basic profile field such as name or title.": "Update basic profile field such as name or title.",
|
|
44
|
+
"Retrieve all messages from a specific channel (\"conversation\") between specified timestamps": "Retrieve all messages from a specific channel (\"conversation\") between specified timestamps",
|
|
45
|
+
"Sets a user's custom status": "Sets a user's custom status",
|
|
46
|
+
"Convert Markdown-formatted text to Slack's pseudo - markdown syntax": "Convert Markdown-formatted text to Slack's pseudo - markdown syntax",
|
|
47
|
+
"Retrieves thread messages by channel and thread timestamp.": "Retrieves thread messages by channel and thread timestamp.",
|
|
48
|
+
"Sets the topic on a selected channel.": "Sets the topic on a selected channel.",
|
|
49
|
+
"Retrieves a specific message from a channel history using the message's timestamp.": "Retrieves a specific message from a channel history using the message's timestamp.",
|
|
50
|
+
"Invites an existing User to an existing channel.": "Invites an existing User to an existing channel.",
|
|
51
|
+
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
52
|
+
"Markdown": "Markdown",
|
|
53
|
+
"Channel": "Channel",
|
|
54
|
+
"Message Timestamp": "Message Timestamp",
|
|
55
|
+
"Reaction (emoji) name": "Reaction (emoji) name",
|
|
56
|
+
"User": "User",
|
|
57
|
+
"Message": "Message",
|
|
58
|
+
"Username": "Username",
|
|
59
|
+
"Profile Picture": "Profile Picture",
|
|
60
|
+
"Block Kit blocks": "Block Kit blocks",
|
|
61
|
+
"Attachment": "Attachment",
|
|
62
|
+
"Thread ts": "Thread ts",
|
|
63
|
+
"Action Buttons": "Action Buttons",
|
|
64
|
+
"Title": "Title",
|
|
65
|
+
"Filename": "Filename",
|
|
66
|
+
"File ID": "File ID",
|
|
67
|
+
"Search query": "Search query",
|
|
68
|
+
"Email": "Email",
|
|
69
|
+
"Handle": "Handle",
|
|
70
|
+
"ID": "ID",
|
|
71
|
+
"Channel Name": "Channel Name",
|
|
72
|
+
"Is Private?": "Is Private?",
|
|
73
|
+
"First Name": "First Name",
|
|
74
|
+
"Last Name": "Last Name",
|
|
75
|
+
"Oldest": "Oldest",
|
|
76
|
+
"Latest": "Latest",
|
|
77
|
+
"Inclusive": "Inclusive",
|
|
78
|
+
"Include all metadata": "Include all metadata",
|
|
79
|
+
"Text": "Text",
|
|
80
|
+
"Emoji": "Emoji",
|
|
81
|
+
"Expires at": "Expires at",
|
|
82
|
+
"Markdown text": "Markdown text",
|
|
83
|
+
"Topic": "Topic",
|
|
84
|
+
"Method": "Method",
|
|
85
|
+
"Headers": "Headers",
|
|
86
|
+
"Query Parameters": "Query Parameters",
|
|
87
|
+
"Body": "Body",
|
|
88
|
+
"No Error on Failure": "No Error on Failure",
|
|
89
|
+
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
90
|
+
"Use user token": "Use user token",
|
|
91
|
+
"\n\tPlease make sure add the bot to the channel by following these steps:\n\t 1. Type /invite in the channel's chat.\n\t 2. Click on Add apps to this channel.\n\t 3. Search for and add the bot.\n \n**Note**: If you can't find the channel in the dropdown list (which fetches up to 2000 channels), please click on the **(F)** and type the channel ID directly.\n ": "\n\tPlease make sure add the bot to the channel by following these steps:\n\t 1. Type /invite in the channel's chat.\n\t 2. Click on Add apps to this channel.\n\t 3. Search for and add the bot.\n \n**Note**: If you can't find the channel in the dropdown list (which fetches up to 2000 channels), please click on the **(F)** and type the channel ID directly.\n ",
|
|
92
|
+
"You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'": "You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'",
|
|
93
|
+
"Please provide the timestamp of the message you wish to react, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.": "Please provide the timestamp of the message you wish to react, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.",
|
|
94
|
+
"e.g.`thumbsup`": "e.g.`thumbsup`",
|
|
95
|
+
"The username of the bot": "The username of the bot",
|
|
96
|
+
"The profile picture of the bot": "The profile picture of the bot",
|
|
97
|
+
"See https://api.slack.com/block-kit for specs": "See https://api.slack.com/block-kit for specs",
|
|
98
|
+
"The text of your message": "The text of your message",
|
|
99
|
+
"Provide the ts (timestamp) value of the **parent** message to make this message a reply. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Alternatively, you can easily obtain the message link by clicking on the three dots next to the parent message and selecting the `Copy link` option.": "Provide the ts (timestamp) value of the **parent** message to make this message a reply. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Alternatively, you can easily obtain the message link by clicking on the three dots next to the parent message and selecting the `Copy link` option.",
|
|
100
|
+
"You can pass the file ID from the New Message Trigger payload.": "You can pass the file ID from the New Message Trigger payload.",
|
|
101
|
+
"User handle (display name), without the leading @": "User handle (display name), without the leading @",
|
|
102
|
+
"Please provide the timestamp of the message you wish to update, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.": "Please provide the timestamp of the message you wish to update, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.",
|
|
103
|
+
"The updated text of your message": "The updated text of your message",
|
|
104
|
+
"Changing a user's email address will send an email to both the old and new addresses, and also post a slackbot message to the user informing them of the change.": "Changing a user's email address will send an email to both the old and new addresses, and also post a slackbot message to the user informing them of the change.",
|
|
105
|
+
"ID of user to change. This argument may only be specified by admins on paid teams.You can use **Find User by Email** action to retrieve ID.": "ID of user to change. This argument may only be specified by admins on paid teams.You can use **Find User by Email** action to retrieve ID.",
|
|
106
|
+
"Only messages after this timestamp will be included in results": "Only messages after this timestamp will be included in results",
|
|
107
|
+
"Only messages before this timestamp will be included in results. Default is the current time": "Only messages before this timestamp will be included in results. Default is the current time",
|
|
108
|
+
"Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified": "Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified",
|
|
109
|
+
"Return all metadata associated with each message": "Return all metadata associated with each message",
|
|
110
|
+
"Emoji shortname (standard or custom), e.g. :tada: or :train:": "Emoji shortname (standard or custom), e.g. :tada: or :train:",
|
|
111
|
+
"Unix timestamp - if not set, the status will not expire": "Unix timestamp - if not set, the status will not expire",
|
|
112
|
+
"Provide the ts (timestamp) value of the **parent** message to retrieve replies of this message. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Alternatively, you can easily obtain the message link by clicking on the three dots next to the parent message and selecting the `Copy link` option.": "Provide the ts (timestamp) value of the **parent** message to retrieve replies of this message. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Alternatively, you can easily obtain the message link by clicking on the three dots next to the parent message and selecting the `Copy link` option.",
|
|
113
|
+
"Please provide the timestamp of the message you wish to retrieve, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.": "Please provide the timestamp of the message you wish to retrieve, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.",
|
|
114
|
+
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
115
|
+
"Use user token instead of bot token": "Use user token instead of bot token",
|
|
116
|
+
"GET": "GET",
|
|
117
|
+
"POST": "POST",
|
|
118
|
+
"PATCH": "PATCH",
|
|
119
|
+
"PUT": "PUT",
|
|
120
|
+
"DELETE": "DELETE",
|
|
121
|
+
"HEAD": "HEAD",
|
|
122
|
+
"New Public Message Posted Anywhere": "New Public Message Posted Anywhere",
|
|
123
|
+
"New Message Posted to Channel": "New Message Posted to Channel",
|
|
124
|
+
"New Direct Message": "New Direct Message",
|
|
125
|
+
"New Mention in Channel": "New Mention in Channel",
|
|
126
|
+
"New Mention in Direct Message": "New Mention in Direct Message",
|
|
127
|
+
"New Reaction": "New Reaction",
|
|
128
|
+
"Channel created": "Channel created",
|
|
129
|
+
"New Command in Channel": "New Command in Channel",
|
|
130
|
+
"New Command in Direct Message": "New Command in Direct Message",
|
|
131
|
+
"New User": "New User",
|
|
132
|
+
"New Saved Message": "New Saved Message",
|
|
133
|
+
"New Team Custom Emoji": "New Team Custom Emoji",
|
|
134
|
+
"Triggers when a new message is posted to any channel.": "Triggers when a new message is posted to any channel.",
|
|
135
|
+
"Triggers when a new message is posted to a specific #channel you choose.": "Triggers when a new message is posted to a specific #channel you choose.",
|
|
136
|
+
"Triggers when a message was posted in a direct message channel.": "Triggers when a message was posted in a direct message channel.",
|
|
137
|
+
"Triggers when a username is mentioned.": "Triggers when a username is mentioned.",
|
|
138
|
+
"Triggers when a username is mentioned in a direct message channel.": "Triggers when a username is mentioned in a direct message channel.",
|
|
139
|
+
"Triggers when a new reaction is added to a message": "Triggers when a new reaction is added to a message",
|
|
140
|
+
"Triggers when a channel is created": "Triggers when a channel is created",
|
|
141
|
+
"Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2)": "Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2)",
|
|
142
|
+
"Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2) via Direct Message.": "Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2) via Direct Message.",
|
|
143
|
+
"Triggers when a new user is created / first joins your org.": "Triggers when a new user is created / first joins your org.",
|
|
144
|
+
"Triggers when you save a message.": "Triggers when you save a message.",
|
|
145
|
+
"Triggers when a custom emoji has been added to a team.": "Triggers when a custom emoji has been added to a team.",
|
|
146
|
+
"Ignore Bot Messages ?": "Ignore Bot Messages ?",
|
|
147
|
+
"Ignore Message from Yourself ?": "Ignore Message from Yourself ?",
|
|
148
|
+
"Channels": "Channels",
|
|
149
|
+
"Emojis (E.g fire, smile)": "Emojis (E.g fire, smile)",
|
|
150
|
+
"Commands": "Commands",
|
|
151
|
+
"\n\tPlease make sure add the bot to the channel by following these steps:\n\t 1. Type /invite in the channel's chat.\n\t 2. Click on Add apps to this channel.\n\t 3. Search for and add the bot.\n \n**Note**: If you can't find the channel in the dropdown list (which fetches up to 2000 channels), please click on the **(F)** and type the channel ID directly in an array like this: `{`{ ['your_channel_id_1', 'your_channel_id_2', ...] `}`}": "\n\tPlease make sure add the bot to the channel by following these steps:\n\t 1. Type /invite in the channel's chat.\n\t 2. Click on Add apps to this channel.\n\t 3. Search for and add the bot.\n \n**Note**: If you can't find the channel in the dropdown list (which fetches up to 2000 channels), please click on the **(F)** and type the channel ID directly in an array like this: `{`{ ['your_channel_id_1', 'your_channel_id_2', ...] `}`}",
|
|
152
|
+
"If no channel is selected, the flow will be triggered for username mentions in all channels": "If no channel is selected, the flow will be triggered for username mentions in all channels",
|
|
153
|
+
"Select emojis to trigger on": "Select emojis to trigger on",
|
|
154
|
+
"List of valid commands that the bot should respond to (e.g., help, ocr, remind)": "List of valid commands that the bot should respond to (e.g., help, ocr, remind)",
|
|
155
|
+
"If no channel is selected, the flow will be triggered for commands in all channels": "If no channel is selected, the flow will be triggered for commands in all channels"
|
|
156
|
+
}
|
package/src/index.js
CHANGED
|
@@ -41,6 +41,7 @@ const new_user_1 = require("./lib/triggers/new-user");
|
|
|
41
41
|
const new_saved_message_1 = require("./lib/triggers/new-saved-message");
|
|
42
42
|
const new_team_custom_emoji_1 = require("./lib/triggers/new-team-custom-emoji");
|
|
43
43
|
const invite_user_to_channel_1 = require("./lib/actions/invite-user-to-channel");
|
|
44
|
+
const list_users_1 = require("./lib/actions/list-users");
|
|
44
45
|
exports.slackAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
45
46
|
description: '',
|
|
46
47
|
authUrl: 'https://slack.com/oauth/v2/authorize?user_scope=search:read,users.profile:write,reactions:read,im:history,stars:read,channels:write,groups:write,im:write,mpim:write,channels:write.invites,groups:write.invites,channels:history,groups:history,chat:write,users:read',
|
|
@@ -135,6 +136,7 @@ exports.slack = (0, pieces_framework_1.createPiece)({
|
|
|
135
136
|
find_user_by_email_1.findUserByEmailAction,
|
|
136
137
|
find_user_by_handle_1.findUserByHandleAction,
|
|
137
138
|
find_user_by_id_1.findUserByIdAction,
|
|
139
|
+
list_users_1.listUsers,
|
|
138
140
|
update_message_1.updateMessage,
|
|
139
141
|
create_channel_1.createChannelAction,
|
|
140
142
|
update_profile_1.updateProfileAction,
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/slack/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAKwC;AACxC,iDAAqD;AACrD,sEAAiC;AACjC,+FAA+F;AAC/F,iFAAkF;AAClF,mGAAmG;AACnG,qFAA0F;AAC1F,yFAAwF;AACxF,2EAA2E;AAC3E,0EAAqE;AACrE,2DAAuD;AACvD,mEAA+D;AAC/D,iEAA6D;AAC7D,yEAAyE;AACzE,iEAAmE;AACnE,iEAAmE;AACnE,4DAA4D;AAC5D,mFAAkF;AAClF,2EAAsE;AACtE,2EAA2E;AAC3E,mEAAoE;AACpE,4DAAwD;AACxD,qFAA+E;AAC/E,4DAAwD;AACxD,qDAAuD;AACvD,4DAA+D;AAC/D,kFAAmF;AACnF,0EAA4E;AAC5E,qFAAgF;AAChF,gGAAgG;AAChG,gGAAgG;AAChG,uEAAwE;AACxE,2DAA6D;AAC7D,mEAAmE;AACnE,sDAAyD;AACzD,wEAA0E;AAC1E,gFAAiF;AACjF,iFAAiF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/slack/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAKwC;AACxC,iDAAqD;AACrD,sEAAiC;AACjC,+FAA+F;AAC/F,iFAAkF;AAClF,mGAAmG;AACnG,qFAA0F;AAC1F,yFAAwF;AACxF,2EAA2E;AAC3E,0EAAqE;AACrE,2DAAuD;AACvD,mEAA+D;AAC/D,iEAA6D;AAC7D,yEAAyE;AACzE,iEAAmE;AACnE,iEAAmE;AACnE,4DAA4D;AAC5D,mFAAkF;AAClF,2EAAsE;AACtE,2EAA2E;AAC3E,mEAAoE;AACpE,4DAAwD;AACxD,qFAA+E;AAC/E,4DAAwD;AACxD,qDAAuD;AACvD,4DAA+D;AAC/D,kFAAmF;AACnF,0EAA4E;AAC5E,qFAAgF;AAChF,gGAAgG;AAChG,gGAAgG;AAChG,uEAAwE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YACf,WAAW,EAAE,CAAO,IAAI,EAAE,UAAU,EAAE,EAAE;;gBACtC,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;oBAC5B,OAAO;wBACL,aAAa,EAAE,UACb,MAAC,IAA4B,CAAC,IAAI,CAAC,aAAa,CAAC,0CAAE,YACrD,EAAE;qBACH,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,OAAO;wBACL,aAAa,EAAE,UACZ,IAA4B,CAAC,YAChC,EAAE;qBACH,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;YACD,UAAU,EAAE;gBACV,YAAY,EAAE,2BAAQ,CAAC,QAAQ,CAAC;oBAC9B,WAAW,EAAE,gBAAgB;oBAC7B,WAAW,EAAE,qCAAqC;oBAClD,QAAQ,EAAE,IAAI;oBACd,YAAY,EAAE,KAAK;iBACpB,CAAC;aACH;SACF,CAAC;KACH;IACD,QAAQ,EAAE;QACR,+BAAiB;QACjB,mDAA0B;QAC1B,4CAAuB;QACvB,wBAAU;QACV,gEAAgC;QAChC,qCAAgB;QAChB,4BAAc;QACd,wBAAU;QACV,gEAAgC;QAChC,yBAAc;QACd,0CAAsB;QACtB,iDAAyB;KAC1B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const listUsers: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
includeBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
3
|
+
includeDisabled: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listUsers = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const web_api_1 = require("@slack/web-api");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
exports.listUsers = (0, pieces_framework_1.createAction)({
|
|
9
|
+
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
|
|
10
|
+
name: 'listUsers',
|
|
11
|
+
displayName: 'List users',
|
|
12
|
+
description: 'List all users of the workspace',
|
|
13
|
+
props: {
|
|
14
|
+
includeBots: pieces_framework_1.Property.Checkbox({
|
|
15
|
+
displayName: 'Include bots?',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
}),
|
|
19
|
+
includeDisabled: pieces_framework_1.Property.Checkbox({
|
|
20
|
+
displayName: 'Include disabled users?',
|
|
21
|
+
required: true,
|
|
22
|
+
defaultValue: false,
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
auth: __1.slackAuth,
|
|
26
|
+
run(_a) {
|
|
27
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
28
|
+
var _b, e_1, _c, _d;
|
|
29
|
+
const client = new web_api_1.WebClient(auth.access_token);
|
|
30
|
+
const results = [];
|
|
31
|
+
try {
|
|
32
|
+
for (var _e = true, _f = tslib_1.__asyncValues(client.paginate('users.list', {
|
|
33
|
+
limit: 1000, // Only limits page size, not total number of results
|
|
34
|
+
})), _g; _g = yield _f.next(), _b = _g.done, !_b; _e = true) {
|
|
35
|
+
_d = _g.value;
|
|
36
|
+
_e = false;
|
|
37
|
+
const page = _d;
|
|
38
|
+
const response = page;
|
|
39
|
+
if (response.members) {
|
|
40
|
+
results.push(...response.members.filter((member) => (propsValue.includeDisabled || !member.deleted) &&
|
|
41
|
+
(propsValue.includeBots || !member.is_bot)));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (!_e && !_b && (_c = _f.return)) yield _c.call(_f);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e_1) throw e_1.error; }
|
|
51
|
+
}
|
|
52
|
+
return results;
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=list-users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-users.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/list-users.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,4CAA8D;AAC9D,6BAAkC;AAGrB,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,2FAA2F;IAC3F,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACD,IAAI,EAAE,aAAS;IACT,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChD,MAAM,OAAO,GAAa,EAAE,CAAC;;gBAC7B,KAAyB,eAAA,KAAA,sBAAA,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE;oBACrD,KAAK,EAAE,IAAI,EAAE,qDAAqD;iBACnE,CAAC,CAAA,IAAA,sDAAE,CAAC;oBAFoB,cAEvB;oBAFuB,WAEvB;oBAFS,MAAM,IAAI,KAAA,CAAA;oBAGnB,MAAM,QAAQ,GAAG,IAAyB,CAAC;oBAC3C,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;wBACrB,OAAO,CA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