@activepieces/piece-slack 0.9.3 → 0.9.5
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 +7 -6
- package/src/i18n/ca.json +156 -0
- package/src/i18n/de.json +156 -0
- package/src/i18n/es.json +156 -0
- package/src/i18n/fr.json +156 -0
- package/src/i18n/hi.json +156 -0
- package/src/i18n/id.json +156 -0
- package/src/i18n/ja.json +156 -0
- package/src/i18n/nl.json +156 -0
- package/src/i18n/pt.json +156 -0
- package/src/i18n/ru.json +156 -0
- package/src/i18n/translation.json +156 -0
- package/src/i18n/vi.json +156 -0
- package/src/i18n/zh.json +156 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/actions/list-users.d.ts +4 -0
- package/src/lib/actions/list-users.js +56 -0
- package/src/lib/actions/list-users.js.map +1 -0
package/src/i18n/zh.json
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Slack": "Slack",
|
|
3
|
+
"Channel-based messaging platform": "基於頻道的消息傳遞平台",
|
|
4
|
+
"Add Reaction to Message": "新增表情反應到消息",
|
|
5
|
+
"Send Message To A User": "發送消息給用戶",
|
|
6
|
+
"Send Message To A Channel": "發送消息到頻道",
|
|
7
|
+
"Request Approval from A User": "向用戶請求批准",
|
|
8
|
+
"Request Approval in a Channel": "在頻道中請求批准",
|
|
9
|
+
"Request Action from A User": "向用戶要求行動",
|
|
10
|
+
"Request Action in A Channel": "在頻道中要求行動",
|
|
11
|
+
"Upload file": "上傳文件",
|
|
12
|
+
"Get File": "獲取文件",
|
|
13
|
+
"Search messages": "搜索消息",
|
|
14
|
+
"Find User by Email": "通過郵件查找用戶",
|
|
15
|
+
"Find User by Handle": "通過用戶名查找用戶",
|
|
16
|
+
"Find User by ID": "通過ID查找用戶",
|
|
17
|
+
"Update message": "更新消息",
|
|
18
|
+
"Create Channel": "創建頻道",
|
|
19
|
+
"Update Profile": "更新個人資料",
|
|
20
|
+
"Get channel history": "獲取頻道歷史",
|
|
21
|
+
"Set User Status": "設置用戶狀態",
|
|
22
|
+
"Markdown to Slack format": "將 Markdown 轉換為 Slack 格式",
|
|
23
|
+
"Retrieve Thread Messages": "檢索線程消息",
|
|
24
|
+
"Set Channel Topic": "設置頻道主題",
|
|
25
|
+
"Get Message by Timestamp": "通過時間戳獲取消息",
|
|
26
|
+
"Invite User to Channel": "邀請用戶進入頻道",
|
|
27
|
+
"Custom API Call": "自定义 API 呼叫",
|
|
28
|
+
"Add an emoji reaction to a message.": "新增一個表情反應到消息。",
|
|
29
|
+
"Send message to a user": "發送消息給用戶",
|
|
30
|
+
"Send message to a channel": "發送消息到頻道",
|
|
31
|
+
"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": "發送批准消息到頻道,然後等待消息被批准或拒絕",
|
|
33
|
+
"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": "在頻道中發送消息並等待選擇操作",
|
|
35
|
+
"Upload file without sharing it to a channel or user": "上傳文件而不將其共享到頻道或用戶",
|
|
36
|
+
"Return information about a given file ID.": "返回給定文件ID的相關信息。",
|
|
37
|
+
"Searches for messages matching a query": "搜索符合查詢條件的消息",
|
|
38
|
+
"Finds a user by matching against their email address.": "根據郵件地址查找用戶。",
|
|
39
|
+
"Finds a user by matching against their Slack handle.": "根據 Slack 名稱查找用戶。",
|
|
40
|
+
"Finds a user by their ID.": "通過ID查找用戶。",
|
|
41
|
+
"Update an existing message": "更新已有消息",
|
|
42
|
+
"Creates a new channel.": "創建新頻道。",
|
|
43
|
+
"Update basic profile field such as name or title.": "更新基本資料字段如名字或職稱。",
|
|
44
|
+
"Retrieve all messages from a specific channel (\"conversation\") between specified timestamps": "從指定頻道中檢索特定時間範圍內的所有消息(\"對話\")",
|
|
45
|
+
"Sets a user's custom status": "設置用戶的自定義狀態",
|
|
46
|
+
"Convert Markdown-formatted text to Slack's pseudo - markdown syntax": "將 Markdown 格式的文字轉換為 Slack 的偽 Markdown 語法",
|
|
47
|
+
"Retrieves thread messages by channel and thread timestamp.": "通過頻道和線程時間戳檢索線程消息。",
|
|
48
|
+
"Sets the topic on a selected channel.": "設置所選頻道的主題。",
|
|
49
|
+
"Retrieves a specific message from a channel history using the message's timestamp.": "通過消息的時間戳從頻道歷史中檢索特定消息。",
|
|
50
|
+
"Invites an existing User to an existing channel.": "邀請現有用戶進入現有頻道。",
|
|
51
|
+
"Make a custom API call to a specific endpoint": "將一個自定義 API 調用到一個特定的終點",
|
|
52
|
+
"Markdown": "Markdown",
|
|
53
|
+
"Channel": "頻道",
|
|
54
|
+
"Message Timestamp": "消息時間戳",
|
|
55
|
+
"Reaction (emoji) name": "反應表情名稱",
|
|
56
|
+
"User": "用戶",
|
|
57
|
+
"Message": "消息",
|
|
58
|
+
"Username": "用戶名",
|
|
59
|
+
"Profile Picture": "個人資料照片",
|
|
60
|
+
"Block Kit blocks": "Block Kit 模塊",
|
|
61
|
+
"Attachment": "附件",
|
|
62
|
+
"Thread ts": "線程 ts",
|
|
63
|
+
"Action Buttons": "動作按鈕",
|
|
64
|
+
"Title": "標題",
|
|
65
|
+
"Filename": "文件名",
|
|
66
|
+
"File ID": "文件ID",
|
|
67
|
+
"Search query": "搜索查詢",
|
|
68
|
+
"Email": "電子郵件",
|
|
69
|
+
"Handle": "處理",
|
|
70
|
+
"ID": "ID",
|
|
71
|
+
"Channel Name": "頻道名稱",
|
|
72
|
+
"Is Private?": "是私密的嗎?",
|
|
73
|
+
"First Name": "名字",
|
|
74
|
+
"Last Name": "姓氏",
|
|
75
|
+
"Oldest": "最早",
|
|
76
|
+
"Latest": "最新",
|
|
77
|
+
"Inclusive": "包含",
|
|
78
|
+
"Include all metadata": "包含所有元數據",
|
|
79
|
+
"Text": "文本",
|
|
80
|
+
"Emoji": "表情",
|
|
81
|
+
"Expires at": "過期時間",
|
|
82
|
+
"Markdown text": "Markdown 文本",
|
|
83
|
+
"Topic": "主題",
|
|
84
|
+
"Method": "方法",
|
|
85
|
+
"Headers": "信頭",
|
|
86
|
+
"Query Parameters": "查詢參數",
|
|
87
|
+
"Body": "正文內容",
|
|
88
|
+
"No Error on Failure": "失敗時沒有錯誤",
|
|
89
|
+
"Timeout (in seconds)": "超時(秒)",
|
|
90
|
+
"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\t請確保通過以下步驟將機器人添加到頻道:\n\t 1. 在頻道的聊天中輸入 /invite。\n\t 2. 點擊將應用添加到此頻道。\n\t 3. 搜索並添加機器人。\n \n**注意**:如果您在下拉列表中找不到頻道(該列表最多可獲取 2000 個頻道),請單擊 **(F)** 並直接輸入頻道 ID。\n ",
|
|
92
|
+
"You can get the Channel ID by right-clicking on the channel and selecting 'View Channel Details.'": "您可以通過右鍵單擊頻道並選擇 '查看頻道詳情' 獲取頻道 ID。",
|
|
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.": "請提供您希望反應的消息的時間戳,例如 `1710304378.475129`。或者,您可以通過單擊消息旁邊的三個點並選擇 `複製鏈接` 選項來輕鬆獲取消息鏈接。",
|
|
94
|
+
"e.g.`thumbsup`": "例如`thumbsup`",
|
|
95
|
+
"The username of the bot": "機器人的用戶名",
|
|
96
|
+
"The profile picture of the bot": "機器人的個人資料圖片",
|
|
97
|
+
"See https://api.slack.com/block-kit for specs": "查看 https://api.slack.com/block-kit 以了解規格",
|
|
98
|
+
"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.": "提供**父**消息的 ts (時間戳) 值以使此消息成為回覆。不要使用回覆本身的 ts 值;請使用其父值。例如 `1710304378.475129`。或者,您可以通過單擊父消息旁邊的三個點並選擇 `複製鏈接` 選項來輕鬆獲取消息鏈接。",
|
|
100
|
+
"You can pass the file ID from the New Message Trigger payload.": "您可以從新消息觸發器有效負載中傳遞文件 ID。",
|
|
101
|
+
"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.": "請提供您希望更新的消息的時間戳,例如 `1710304378.475129`。或者,您可以通過單擊消息旁邊的三個點並選擇 `複製鏈接` 選項來輕鬆獲取消息鏈接。",
|
|
103
|
+
"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.": "更改用戶的郵件地址會向舊地址和新地址發送郵件,並通過 slackbot 向用戶發送郵件提醒他們變更。",
|
|
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。此參數僅可由付費團隊的管理員指定。您可以使用 **通過郵件查找用戶** 操作來檢索 ID。",
|
|
106
|
+
"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": "\"\u001d只有在此時間戳之前的消息才會被包括在結果中。默認值是當前時間\"",
|
|
108
|
+
"Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified": "將包含具有最早或最新時間戳的消息。除非指定了任一個時間戳,否則忽略",
|
|
109
|
+
"Return all metadata associated with each message": "返回與每條消息相關的所有元數據",
|
|
110
|
+
"Emoji shortname (standard or custom), e.g. :tada: or :train:": "\"\u001d表情簡稱(標準或自定義),例如 :tada: 或 :train:",
|
|
111
|
+
"Unix timestamp - if not set, the status will not expire": "如果未設置 Unix 時間戳,狀態不會過期",
|
|
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.": "提供**父**消息的 ts (時間戳) 值以檢索這個消息的回覆。不要使用回覆本身的 ts 值;請使用其父值。例如 `1710304378.475129`。或者,您可以通過單擊父消息旁邊的三個點並選擇 `複製鏈接` 選項來輕鬆獲取消息鏈接。",
|
|
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.": "請提供您希望檢索的消息的時間戳,例如 `1710304378.475129`。或者,您可以通過單擊消息旁邊的三個點並選擇 `複製鏈接` 選項來輕鬆獲取消息鏈接。",
|
|
114
|
+
"Authorization headers are injected automatically from your connection.": "授權頭自動從您的連接中注入。",
|
|
115
|
+
"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": "任何地方發表新公共消息",
|
|
123
|
+
"New Message Posted to Channel": "新消息發布到頻道",
|
|
124
|
+
"New Direct Message": "新直郵",
|
|
125
|
+
"New Mention in Channel": "頻道中新提到",
|
|
126
|
+
"New Mention in Direct Message": "新提到在直郵中",
|
|
127
|
+
"New Reaction": "新反應",
|
|
128
|
+
"Channel created": "通道已創建",
|
|
129
|
+
"New Command in Channel": "頻道中的新命令",
|
|
130
|
+
"New Command in Direct Message": "直郵中的新命令",
|
|
131
|
+
"New User": "新用戶",
|
|
132
|
+
"New Saved Message": "新保存的消息",
|
|
133
|
+
"New Team Custom Emoji": "團隊自定義表情",
|
|
134
|
+
"Triggers when a new message is posted to any channel.": "\"在發佈新消息到任何頻道時觸發。\"",
|
|
135
|
+
"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.": "\"在直接消息通道中發佈消息時觸發。\"",
|
|
137
|
+
"Triggers when a username is mentioned.": "\"在提到用戶名字時觸發。\"",
|
|
138
|
+
"Triggers when a username is mentioned in a direct message channel.": "\"當用戶名在直接消息通道中被提及時觸發。\"",
|
|
139
|
+
"Triggers when a new reaction is added to a message": "添加新反應到消息時觸發",
|
|
140
|
+
"Triggers when a channel is created": "當創建頻道時觸發",
|
|
141
|
+
"Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2)": "\"在向機器人發送特定命令時觸發(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.": "\"當向機器人發送特定命令時觸發(e.g., @bot command arg1 arg2) 通過直接消息。\"",
|
|
143
|
+
"Triggers when a new user is created / first joins your org.": "\"新用戶被創建/首次加入您的組織時觸發。\"",
|
|
144
|
+
"Triggers when you save a message.": "\"當您保存消息時觸發。\"",
|
|
145
|
+
"Triggers when a custom emoji has been added to a team.": "\"當自定義表情被添加到團隊時觸發。\"",
|
|
146
|
+
"Ignore Bot Messages ?": "忽略機器人消息嗎?",
|
|
147
|
+
"Ignore Message from Yourself ?": "忽略來自自己的消息嗎?",
|
|
148
|
+
"Channels": "頻道",
|
|
149
|
+
"Emojis (E.g fire, smile)": "表情(例如火,微笑)",
|
|
150
|
+
"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\t請確保通過以下步驟將機器人添加到頻道:\n\t 1. 在頻道的聊天中輸入 /invite。\n\t 2. 點擊將應用添加到此頻道。\n\t 3. 搜索並添加機器人。\n \n**注意**:如果您在下拉列表中找不到頻道(該列表最多可獲取 2000 個頻道),請單擊 **(F)** 並直接在如下陣列中鍵入頻道 ID: `{`{ ['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": "如果未選擇頻道,則會針對所有頻道中的用戶名提及觸發流程",
|
|
153
|
+
"Select emojis to trigger on": "選擇要觸發的表情",
|
|
154
|
+
"List of valid commands that the bot should respond to (e.g., help, ocr, remind)": "\"列出機器人應響應的有效命令(例如,幫助, ocr ,提醒)\"",
|
|
155
|
+
"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;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;QACb,oCAAmB;QACnB,oCAAmB;QACnB,uCAAiB;QACjB,qCAAmB;QACnB,gDAAqB;QACrB,iDAAsB;QACtB,yCAAqB;QACrB,8BAAgB;QAChB,kDAAyB;QACzB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,uBAAuB,CAAC;YACjC,CAAC;YACD,IAAI,EAAE,iBAAS;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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