@activepieces/piece-slack 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/i18n/translation.json +4 -0
- package/src/index.d.ts +5 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +17 -12
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-reaction-to-message.d.ts +8 -2
- package/src/lib/actions/add-reaction-to-message.d.ts.map +1 -1
- package/src/lib/actions/add-reaction-to-message.js +3 -3
- package/src/lib/actions/add-reaction-to-message.js.map +1 -1
- package/src/lib/actions/create-channel.d.ts +4 -1
- package/src/lib/actions/create-channel.d.ts.map +1 -1
- package/src/lib/actions/create-channel.js +2 -1
- package/src/lib/actions/create-channel.js.map +1 -1
- package/src/lib/actions/delete-message.d.ts +8 -2
- package/src/lib/actions/delete-message.d.ts.map +1 -1
- package/src/lib/actions/delete-message.js +4 -7
- package/src/lib/actions/delete-message.js.map +1 -1
- package/src/lib/actions/find-user-by-email.d.ts +4 -1
- package/src/lib/actions/find-user-by-email.d.ts.map +1 -1
- package/src/lib/actions/find-user-by-email.js +2 -1
- package/src/lib/actions/find-user-by-email.js.map +1 -1
- package/src/lib/actions/find-user-by-handle.d.ts +4 -1
- package/src/lib/actions/find-user-by-handle.d.ts.map +1 -1
- package/src/lib/actions/find-user-by-handle.js +2 -1
- package/src/lib/actions/find-user-by-handle.js.map +1 -1
- package/src/lib/actions/find-user-by-id.d.ts +4 -1
- package/src/lib/actions/find-user-by-id.d.ts.map +1 -1
- package/src/lib/actions/find-user-by-id.js +2 -1
- package/src/lib/actions/find-user-by-id.js.map +1 -1
- package/src/lib/actions/get-channel-history.d.ts +8 -2
- package/src/lib/actions/get-channel-history.d.ts.map +1 -1
- package/src/lib/actions/get-channel-history.js +2 -1
- package/src/lib/actions/get-channel-history.js.map +1 -1
- package/src/lib/actions/get-file.d.ts +4 -1
- package/src/lib/actions/get-file.d.ts.map +1 -1
- package/src/lib/actions/get-file.js +4 -2
- package/src/lib/actions/get-file.js.map +1 -1
- package/src/lib/actions/get-message.d.ts +8 -2
- package/src/lib/actions/get-message.d.ts.map +1 -1
- package/src/lib/actions/get-message.js +2 -1
- package/src/lib/actions/get-message.js.map +1 -1
- package/src/lib/actions/invite-user-to-channel.d.ts +12 -3
- package/src/lib/actions/invite-user-to-channel.d.ts.map +1 -1
- package/src/lib/actions/invite-user-to-channel.js +2 -1
- package/src/lib/actions/invite-user-to-channel.js.map +1 -1
- package/src/lib/actions/list-users.d.ts +4 -1
- package/src/lib/actions/list-users.d.ts.map +1 -1
- package/src/lib/actions/list-users.js +2 -1
- package/src/lib/actions/list-users.js.map +1 -1
- package/src/lib/actions/request-action-direct-message.d.ts +8 -2
- package/src/lib/actions/request-action-direct-message.d.ts.map +1 -1
- package/src/lib/actions/request-action-message.d.ts +8 -2
- package/src/lib/actions/request-action-message.d.ts.map +1 -1
- package/src/lib/actions/request-approval-direct-message.d.ts +8 -2
- package/src/lib/actions/request-approval-direct-message.d.ts.map +1 -1
- package/src/lib/actions/request-approval-direct-message.js +39 -9
- package/src/lib/actions/request-approval-direct-message.js.map +1 -1
- package/src/lib/actions/request-approval-message.d.ts +8 -2
- package/src/lib/actions/request-approval-message.d.ts.map +1 -1
- package/src/lib/actions/request-approval-message.js +37 -7
- package/src/lib/actions/request-approval-message.js.map +1 -1
- package/src/lib/actions/retrieve-thread-messages.d.ts +8 -2
- package/src/lib/actions/retrieve-thread-messages.d.ts.map +1 -1
- package/src/lib/actions/retrieve-thread-messages.js +2 -1
- package/src/lib/actions/retrieve-thread-messages.js.map +1 -1
- package/src/lib/actions/search-messages.d.ts +4 -1
- package/src/lib/actions/search-messages.d.ts.map +1 -1
- package/src/lib/actions/search-messages.js +5 -9
- package/src/lib/actions/search-messages.js.map +1 -1
- package/src/lib/actions/send-direct-message-action.d.ts +8 -2
- package/src/lib/actions/send-direct-message-action.d.ts.map +1 -1
- package/src/lib/actions/send-direct-message-action.js +2 -1
- package/src/lib/actions/send-direct-message-action.js.map +1 -1
- package/src/lib/actions/send-message-action.d.ts +8 -2
- package/src/lib/actions/send-message-action.d.ts.map +1 -1
- package/src/lib/actions/send-message-action.js +2 -2
- package/src/lib/actions/send-message-action.js.map +1 -1
- package/src/lib/actions/set-channel-topic.d.ts +8 -2
- package/src/lib/actions/set-channel-topic.d.ts.map +1 -1
- package/src/lib/actions/set-channel-topic.js +2 -1
- package/src/lib/actions/set-channel-topic.js.map +1 -1
- package/src/lib/actions/set-user-status.d.ts +4 -1
- package/src/lib/actions/set-user-status.d.ts.map +1 -1
- package/src/lib/actions/set-user-status.js +2 -2
- package/src/lib/actions/set-user-status.js.map +1 -1
- package/src/lib/actions/update-message.d.ts +8 -2
- package/src/lib/actions/update-message.d.ts.map +1 -1
- package/src/lib/actions/update-message.js +2 -1
- package/src/lib/actions/update-message.js.map +1 -1
- package/src/lib/actions/update-profile.d.ts +4 -1
- package/src/lib/actions/update-profile.d.ts.map +1 -1
- package/src/lib/actions/update-profile.js +2 -2
- package/src/lib/actions/update-profile.js.map +1 -1
- package/src/lib/actions/upload-file.d.ts +8 -2
- package/src/lib/actions/upload-file.d.ts.map +1 -1
- package/src/lib/actions/upload-file.js +2 -1
- package/src/lib/actions/upload-file.js.map +1 -1
- package/src/lib/auth.d.ts +5 -1
- package/src/lib/auth.d.ts.map +1 -1
- package/src/lib/auth.js +44 -3
- package/src/lib/auth.js.map +1 -1
- package/src/lib/common/auth-helpers.d.ts +9 -0
- package/src/lib/common/auth-helpers.d.ts.map +1 -0
- package/src/lib/common/auth-helpers.js +82 -0
- package/src/lib/common/auth-helpers.js.map +1 -0
- package/src/lib/common/props.d.ts +14 -2
- package/src/lib/common/props.d.ts.map +1 -1
- package/src/lib/common/props.js +3 -3
- package/src/lib/common/props.js.map +1 -1
- package/src/lib/common/request-action.d.ts.map +1 -1
- package/src/lib/common/request-action.js +2 -1
- package/src/lib/common/request-action.js.map +1 -1
- package/src/lib/triggers/new-channel.d.ts +13 -1
- package/src/lib/triggers/new-channel.d.ts.map +1 -1
- package/src/lib/triggers/new-channel.js +3 -4
- package/src/lib/triggers/new-channel.js.map +1 -1
- package/src/lib/triggers/new-command-in-direct-message.d.ts +32 -8
- package/src/lib/triggers/new-command-in-direct-message.d.ts.map +1 -1
- package/src/lib/triggers/new-command-in-direct-message.js +4 -4
- package/src/lib/triggers/new-command-in-direct-message.js.map +1 -1
- package/src/lib/triggers/new-command.d.ts +48 -12
- package/src/lib/triggers/new-command.d.ts.map +1 -1
- package/src/lib/triggers/new-command.js +3 -5
- package/src/lib/triggers/new-command.js.map +1 -1
- package/src/lib/triggers/new-direct-message.d.ts +16 -4
- package/src/lib/triggers/new-direct-message.d.ts.map +1 -1
- package/src/lib/triggers/new-direct-message.js +3 -4
- package/src/lib/triggers/new-direct-message.js.map +1 -1
- package/src/lib/triggers/new-mention-in-direct-message.d.ts +32 -8
- package/src/lib/triggers/new-mention-in-direct-message.d.ts.map +1 -1
- package/src/lib/triggers/new-mention-in-direct-message.js +5 -5
- package/src/lib/triggers/new-mention-in-direct-message.js.map +1 -1
- package/src/lib/triggers/new-mention.d.ts +48 -12
- package/src/lib/triggers/new-mention.d.ts.map +1 -1
- package/src/lib/triggers/new-mention.js +3 -5
- package/src/lib/triggers/new-mention.js.map +1 -1
- package/src/lib/triggers/new-message-in-channel.d.ts +32 -8
- package/src/lib/triggers/new-message-in-channel.d.ts.map +1 -1
- package/src/lib/triggers/new-message-in-channel.js +2 -3
- package/src/lib/triggers/new-message-in-channel.js.map +1 -1
- package/src/lib/triggers/new-message.d.ts +16 -4
- package/src/lib/triggers/new-message.d.ts.map +1 -1
- package/src/lib/triggers/new-message.js +2 -3
- package/src/lib/triggers/new-message.js.map +1 -1
- package/src/lib/triggers/new-modal-interaction.d.ts +16 -4
- package/src/lib/triggers/new-modal-interaction.d.ts.map +1 -1
- package/src/lib/triggers/new-modal-interaction.js +2 -3
- package/src/lib/triggers/new-modal-interaction.js.map +1 -1
- package/src/lib/triggers/new-reaction-added.d.ts +48 -12
- package/src/lib/triggers/new-reaction-added.d.ts.map +1 -1
- package/src/lib/triggers/new-reaction-added.js +3 -5
- package/src/lib/triggers/new-reaction-added.js.map +1 -1
- package/src/lib/triggers/new-saved-message.d.ts +13 -1
- package/src/lib/triggers/new-saved-message.d.ts.map +1 -1
- package/src/lib/triggers/new-saved-message.js +2 -3
- package/src/lib/triggers/new-saved-message.js.map +1 -1
- package/src/lib/triggers/new-team-custom-emoji.d.ts +13 -1
- package/src/lib/triggers/new-team-custom-emoji.d.ts.map +1 -1
- package/src/lib/triggers/new-team-custom-emoji.js +3 -4
- package/src/lib/triggers/new-team-custom-emoji.js.map +1 -1
- package/src/lib/triggers/new-user.d.ts +13 -1
- package/src/lib/triggers/new-user.d.ts.map +1 -1
- package/src/lib/triggers/new-user.js +3 -4
- package/src/lib/triggers/new-user.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-slack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@activepieces/pieces-common": "0.12.0",
|
|
8
8
|
"@activepieces/pieces-framework": "0.26.0",
|
|
9
|
-
"@activepieces/shared": "0.
|
|
9
|
+
"@activepieces/shared": "0.45.0",
|
|
10
10
|
"@slack/web-api": "7.9.0",
|
|
11
11
|
"slackify-markdown": "4.4.0",
|
|
12
12
|
"zod": "4.3.6",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"Channel": "Channel",
|
|
57
57
|
"Message Timestamp": "Message Timestamp",
|
|
58
58
|
"Reaction (emoji) name": "Reaction (emoji) name",
|
|
59
|
+
"React as user?": "React as user?",
|
|
59
60
|
"User": "User",
|
|
60
61
|
"Message": "Message",
|
|
61
62
|
"Username": "Username",
|
|
@@ -106,6 +107,7 @@
|
|
|
106
107
|
"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.'",
|
|
107
108
|
"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.",
|
|
108
109
|
"e.g.`thumbsup`": "e.g.`thumbsup`",
|
|
110
|
+
"If enabled, the reaction will be added as the authenticated user instead of the bot.": "If enabled, the reaction will be added as the authenticated user instead of the bot.",
|
|
109
111
|
"The username of the bot": "The username of the bot",
|
|
110
112
|
"The profile picture of the bot": "The profile picture of the bot",
|
|
111
113
|
"The icon emoji of the bot": "The icon emoji of the bot",
|
|
@@ -171,11 +173,13 @@
|
|
|
171
173
|
"Ignore Bot Messages ?": "Ignore Bot Messages ?",
|
|
172
174
|
"Ignore Message from Yourself ?": "Ignore Message from Yourself ?",
|
|
173
175
|
"Channels": "Channels",
|
|
176
|
+
"Remove Mention from Message": "Remove Mention from Message",
|
|
174
177
|
"Emojis (E.g fire, smile)": "Emojis (E.g fire, smile)",
|
|
175
178
|
"Commands": "Commands",
|
|
176
179
|
"Interaction Type": "Interaction Type",
|
|
177
180
|
"\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', ...] `}`}",
|
|
178
181
|
"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",
|
|
182
|
+
"If enabled, provides a clean_text field with the user mention removed from the message.": "If enabled, provides a clean_text field with the user mention removed from the message.",
|
|
179
183
|
"Select emojis to trigger on": "Select emojis to trigger on",
|
|
180
184
|
"If no channel is selected, the flow will be triggered for reactions in all channels the app has access to": "If no channel is selected, the flow will be triggered for reactions in all channels the app has access to",
|
|
181
185
|
"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)",
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { slackAuth, slackOAuth2Auth } from './lib/auth';
|
|
2
|
+
export declare const slack: import("@activepieces/pieces-framework").Piece<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
5
|
+
}>)[]>;
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,KAAK;;;MAiKhB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.slack = void 0;
|
|
3
|
+
exports.slack = exports.slackOAuth2Auth = exports.slackAuth = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
@@ -43,12 +43,16 @@ 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
44
|
const list_users_1 = require("./lib/actions/list-users");
|
|
45
45
|
const delete_message_1 = require("./lib/actions/delete-message");
|
|
46
|
-
const auth_1 = require("./lib/auth");
|
|
47
46
|
const new_modal_interaction_1 = require("./lib/triggers/new-modal-interaction");
|
|
47
|
+
const auth_1 = require("./lib/auth");
|
|
48
|
+
const auth_helpers_1 = require("./lib/common/auth-helpers");
|
|
49
|
+
var auth_2 = require("./lib/auth");
|
|
50
|
+
Object.defineProperty(exports, "slackAuth", { enumerable: true, get: function () { return auth_2.slackAuth; } });
|
|
51
|
+
Object.defineProperty(exports, "slackOAuth2Auth", { enumerable: true, get: function () { return auth_2.slackOAuth2Auth; } });
|
|
48
52
|
exports.slack = (0, pieces_framework_1.createPiece)({
|
|
49
53
|
displayName: 'Slack',
|
|
50
54
|
description: 'Channel-based messaging platform',
|
|
51
|
-
minimumSupportedRelease: '0.
|
|
55
|
+
minimumSupportedRelease: '0.79.0',
|
|
52
56
|
logoUrl: 'https://cdn.activepieces.com/pieces/slack.png',
|
|
53
57
|
categories: [shared_1.PieceCategory.COMMUNICATION],
|
|
54
58
|
auth: auth_1.slackAuth,
|
|
@@ -156,17 +160,18 @@ exports.slack = (0, pieces_framework_1.createPiece)({
|
|
|
156
160
|
},
|
|
157
161
|
auth: auth_1.slackAuth,
|
|
158
162
|
authMapping: (auth, propsValue) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
159
|
-
|
|
163
|
+
const typedAuth = auth;
|
|
160
164
|
if (propsValue.useUserToken) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
Authorization: `Bearer ${auth.access_token}`,
|
|
168
|
-
};
|
|
165
|
+
const userToken = (0, auth_helpers_1.getUserToken)(typedAuth);
|
|
166
|
+
if (userToken) {
|
|
167
|
+
return {
|
|
168
|
+
Authorization: `Bearer ${userToken}`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
169
171
|
}
|
|
172
|
+
return {
|
|
173
|
+
Authorization: `Bearer ${(0, auth_helpers_1.getBotToken)(typedAuth)}`,
|
|
174
|
+
};
|
|
170
175
|
}),
|
|
171
176
|
extraProps: {
|
|
172
177
|
useUserToken: pieces_framework_1.Property.Checkbox({
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAgG;AAChG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAgG;AAChG,qEAGwC;AAExC,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,s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E;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;QACzB,kDAA0B;KAC3B;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export declare const addRectionToMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const addRectionToMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
-
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
6
|
+
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
9
|
+
}>)[]>;
|
|
4
10
|
ts: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
11
|
reaction: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
12
|
reactAsUser: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-reaction-to-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-reaction-to-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAoDpC,CAAC"}
|
|
@@ -7,6 +7,7 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
7
7
|
const props_1 = require("../common/props");
|
|
8
8
|
const web_api_1 = require("@slack/web-api");
|
|
9
9
|
const utils_1 = require("../common/utils");
|
|
10
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
10
11
|
exports.addRectionToMessageAction = (0, pieces_framework_1.createAction)({
|
|
11
12
|
auth: auth_1.slackAuth,
|
|
12
13
|
name: 'slack-add-reaction-to-message',
|
|
@@ -34,11 +35,10 @@ exports.addRectionToMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
34
35
|
},
|
|
35
36
|
run(context) {
|
|
36
37
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
var _a, _b;
|
|
38
38
|
const { channel, ts, reaction, reactAsUser } = context.propsValue;
|
|
39
39
|
const token = reactAsUser
|
|
40
|
-
? (
|
|
41
|
-
: context.auth
|
|
40
|
+
? (0, auth_helpers_1.requireUserToken)(context.auth)
|
|
41
|
+
: (0, auth_helpers_1.getBotToken)(context.auth);
|
|
42
42
|
const slack = new web_api_1.WebClient(token);
|
|
43
43
|
const messageTimestamp = (0, utils_1.processMessageTimestamp)(ts);
|
|
44
44
|
if (messageTimestamp) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-reaction-to-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,2CAAwE;AAExE,4CAA2C;AAC3C,2CAA0D;
|
|
1
|
+
{"version":3,"file":"add-reaction-to-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,2CAAwE;AAExE,4CAA2C;AAC3C,2CAA0D;AAC1D,yDAKgC;AAEnB,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,qCAAqC;IAElD,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EACT,2OAA2O;YAC7O,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gBAAgB;SAC9B,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACT,sFAAsF;YACxF,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElE,MAAM,KAAK,GAAG,WAAW;gBACvB,CAAC,CAAC,IAAA,+BAAgB,EAAC,OAAO,CAAC,IAAsB,CAAC;gBAClD,CAAC,CAAC,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;YAEhD,MAAM,KAAK,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;YAEnC,MAAM,gBAAgB,GAAG,IAAA,+BAAuB,EAAC,EAAE,CAAC,CAAC;YAErD,IAAI,gBAAgB,EAAE,CAAC;gBACrB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;oBACzC,OAAO;oBACP,SAAS,EAAE,gBAAgB;oBAC3B,IAAI,EAAE,QAAQ;iBACf,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const createChannelAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const createChannelAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
channelName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
isPrivate: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
7
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-channel.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-channel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-channel.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-channel.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;;EAuB9B,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const web_api_1 = require("@slack/web-api");
|
|
8
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
8
9
|
exports.createChannelAction = (0, pieces_framework_1.createAction)({
|
|
9
10
|
auth: auth_1.slackAuth,
|
|
10
11
|
name: 'slack-create-channel',
|
|
@@ -23,7 +24,7 @@ exports.createChannelAction = (0, pieces_framework_1.createAction)({
|
|
|
23
24
|
},
|
|
24
25
|
run(_a) {
|
|
25
26
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
26
|
-
const client = new web_api_1.WebClient(
|
|
27
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
27
28
|
return yield client.conversations.create({
|
|
28
29
|
name: propsValue.channelName,
|
|
29
30
|
is_private: propsValue.isPrivate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;
|
|
1
|
+
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,wBAAwB;IACrC,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC,CAAC;YAClE,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;gBACvC,IAAI,EAAE,UAAU,CAAC,WAAW;gBAC5B,UAAU,EAAE,UAAU,CAAC,SAAS;aACjC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export declare const deleteMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const deleteMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
-
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
6
|
+
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
9
|
+
}>)[]>;
|
|
4
10
|
ts: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
11
|
}>;
|
|
6
12
|
//# sourceMappingURL=delete-message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;;;;EA0C9B,CAAC"}
|
|
@@ -7,6 +7,7 @@ const auth_1 = require("../auth");
|
|
|
7
7
|
const props_1 = require("../common/props");
|
|
8
8
|
const utils_1 = require("../common/utils");
|
|
9
9
|
const web_api_1 = require("@slack/web-api");
|
|
10
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
10
11
|
exports.deleteMessageAction = (0, pieces_framework_1.createAction)({
|
|
11
12
|
name: 'delete-message',
|
|
12
13
|
displayName: 'Delete Message',
|
|
@@ -23,12 +24,12 @@ exports.deleteMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
23
24
|
},
|
|
24
25
|
run(_a) {
|
|
25
26
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
26
|
-
var _b
|
|
27
|
+
var _b;
|
|
27
28
|
const messageTimestamp = (0, utils_1.processMessageTimestamp)(propsValue.ts);
|
|
28
29
|
if (!messageTimestamp) {
|
|
29
30
|
throw new Error('Invalid Timestamp Value.');
|
|
30
31
|
}
|
|
31
|
-
const userAccessToken = (
|
|
32
|
+
const userAccessToken = (0, auth_helpers_1.requireUserToken)(auth);
|
|
32
33
|
const client = new web_api_1.WebClient(userAccessToken);
|
|
33
34
|
const historyResponse = yield client.conversations.history({
|
|
34
35
|
channel: propsValue.channel,
|
|
@@ -36,14 +37,10 @@ exports.deleteMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
36
37
|
limit: 1,
|
|
37
38
|
inclusive: true,
|
|
38
39
|
});
|
|
39
|
-
const message = (
|
|
40
|
+
const message = (_b = historyResponse.messages) === null || _b === void 0 ? void 0 : _b[0];
|
|
40
41
|
if (!message) {
|
|
41
42
|
throw new Error('No message found for the provided timestamp.');
|
|
42
43
|
}
|
|
43
|
-
if (!userAccessToken) {
|
|
44
|
-
throw new Error('User access token is missing.');
|
|
45
|
-
}
|
|
46
|
-
// const userClient = new WebClient(userAccessToken);
|
|
47
44
|
return client.chat.delete({
|
|
48
45
|
channel: propsValue.channel,
|
|
49
46
|
ts: messageTimestamp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,2CAAwE;AACxE,2CAA0D;AAC1D,4CAA2C;
|
|
1
|
+
{"version":3,"file":"delete-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,2CAAwE;AACxE,2CAA0D;AAC1D,4CAA2C;AAC3C,yDAA0E;AAE7D,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,gBAAS;IACf,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EACT,8OAA8O;YAChP,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,gBAAgB,GAAG,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAChE,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9C,CAAC;YAED,MAAM,eAAe,GAAG,IAAA,+BAAgB,EAAC,IAAsB,CAAC,CAAC;YACjE,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,eAAe,CAAC,CAAC;YAE9C,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;gBACzD,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,MAAM,EAAE,gBAAgB;gBACxB,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,MAAA,eAAe,CAAC,QAAQ,0CAAG,CAAC,CAAC,CAAC;YAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAClE,CAAC;YAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBACxB,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,EAAE,EAAE,gBAAgB;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const findUserByEmailAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const findUserByEmailAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
}>;
|
|
4
7
|
//# sourceMappingURL=find-user-by-email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-email.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-user-by-email.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;EAkBhC,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const web_api_1 = require("@slack/web-api");
|
|
8
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
8
9
|
exports.findUserByEmailAction = (0, pieces_framework_1.createAction)({
|
|
9
10
|
auth: auth_1.slackAuth,
|
|
10
11
|
name: 'slack-find-user-by-email',
|
|
@@ -19,7 +20,7 @@ exports.findUserByEmailAction = (0, pieces_framework_1.createAction)({
|
|
|
19
20
|
run(_a) {
|
|
20
21
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
21
22
|
const email = propsValue.email;
|
|
22
|
-
const client = new web_api_1.WebClient(
|
|
23
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
23
24
|
return yield client.users.lookupByEmail({
|
|
24
25
|
email,
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;
|
|
1
|
+
{"version":3,"file":"find-user-by-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;YAC/B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC,CAAC;YAClE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;gBACtC,KAAK;aACN,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const findUserByHandleAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const findUserByHandleAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
handle: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
}>;
|
|
4
7
|
//# sourceMappingURL=find-user-by-handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-handle.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-handle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-user-by-handle.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-handle.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB;;;;;EA8BjC,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const web_api_1 = require("@slack/web-api");
|
|
8
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
8
9
|
exports.findUserByHandleAction = (0, pieces_framework_1.createAction)({
|
|
9
10
|
auth: auth_1.slackAuth,
|
|
10
11
|
name: 'slack-find-user-by-handle',
|
|
@@ -21,7 +22,7 @@ exports.findUserByHandleAction = (0, pieces_framework_1.createAction)({
|
|
|
21
22
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
22
23
|
var _b, e_1, _c, _d;
|
|
23
24
|
const handle = propsValue.handle.replace('@', '');
|
|
24
|
-
const client = new web_api_1.WebClient(
|
|
25
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
25
26
|
try {
|
|
26
27
|
for (var _e = true, _f = tslib_1.__asyncValues(client.paginate('users.list', {
|
|
27
28
|
limit: 1000, // Only limits page size, not total number of results
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-handle.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-handle.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA8D;
|
|
1
|
+
{"version":3,"file":"find-user-by-handle.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-handle.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AM,EAAE,CAAC,CAAC;QAChE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const findUserByIdAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const findUserByIdAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
}>;
|
|
4
7
|
//# sourceMappingURL=find-user-by-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-id.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-id.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-user-by-id.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-id.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;;;EAiB7B,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const web_api_1 = require("@slack/web-api");
|
|
8
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
8
9
|
exports.findUserByIdAction = (0, pieces_framework_1.createAction)({
|
|
9
10
|
auth: auth_1.slackAuth,
|
|
10
11
|
name: 'find-user-by-id',
|
|
@@ -18,7 +19,7 @@ exports.findUserByIdAction = (0, pieces_framework_1.createAction)({
|
|
|
18
19
|
},
|
|
19
20
|
run(_a) {
|
|
20
21
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
21
|
-
const client = new web_api_1.WebClient(
|
|
22
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
22
23
|
return yield client.users.profile.get({
|
|
23
24
|
user: propsValue.id,
|
|
24
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-id.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-id.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;
|
|
1
|
+
{"version":3,"file":"find-user-by-id.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user-by-id.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACN,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC,CAAC;YAClE,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;gBACrC,IAAI,EAAE,UAAU,CAAC,EAAE;aACnB,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export declare const getChannelHistory: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const getChannelHistory: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
-
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
6
|
+
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
9
|
+
}>)[]>;
|
|
4
10
|
oldest: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
11
|
latest: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
12
|
inclusive: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-history.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-channel-history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-channel-history.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-channel-history.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EAuD5B,CAAC"}
|
|
@@ -6,6 +6,7 @@ const web_api_1 = require("@slack/web-api");
|
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const auth_1 = require("../auth");
|
|
8
8
|
const props_1 = require("../common/props");
|
|
9
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
9
10
|
exports.getChannelHistory = (0, pieces_framework_1.createAction)({
|
|
10
11
|
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
|
|
11
12
|
name: 'getChannelHistory',
|
|
@@ -41,7 +42,7 @@ exports.getChannelHistory = (0, pieces_framework_1.createAction)({
|
|
|
41
42
|
run(_a) {
|
|
42
43
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
43
44
|
var _b, e_1, _c, _d;
|
|
44
|
-
const client = new web_api_1.WebClient(
|
|
45
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
45
46
|
const messages = [];
|
|
46
47
|
yield client.conversations.history({ channel: propsValue.channel });
|
|
47
48
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-history.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-channel-history.ts"],"names":[],"mappings":";;;;AAAA,4CAAyE;AACzE,qEAAwE;AACxE,kCAAoC;AACpC,2CAAwE;
|
|
1
|
+
{"version":3,"file":"get-channel-history.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-channel-history.ts"],"names":[],"mappings":";;;;AAAA,4CAAyE;AACzE,qEAAwE;AACxE,kCAAoC;AACpC,2CAAwE;AACxE,yDAAqE;AAExD,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,2FAA2F;IAC3F,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,gBAAS;IACf,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,6FAA6F;IAC/F,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,gEAAgE;YACl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,CAAC,QAAQ,EAAE,CAAC;wBACtB,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBACtC,CAAC;gBACH,CAAC;;;;;;;;;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const getFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const getFileAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
}>;
|
|
4
7
|
//# sourceMappingURL=get-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-file.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;EA0CxB,CAAC"}
|
|
@@ -6,6 +6,7 @@ const auth_1 = require("../auth");
|
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
8
|
const web_api_1 = require("@slack/web-api");
|
|
9
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
9
10
|
exports.getFileAction = (0, pieces_framework_1.createAction)({
|
|
10
11
|
auth: auth_1.slackAuth,
|
|
11
12
|
name: 'get-file',
|
|
@@ -21,7 +22,8 @@ exports.getFileAction = (0, pieces_framework_1.createAction)({
|
|
|
21
22
|
run(context) {
|
|
22
23
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
24
|
var _a, _b;
|
|
24
|
-
const
|
|
25
|
+
const botToken = (0, auth_helpers_1.getBotToken)(context.auth);
|
|
26
|
+
const client = new web_api_1.WebClient(botToken);
|
|
25
27
|
const fileData = yield client.files.info({ file: context.propsValue.fileId });
|
|
26
28
|
const fileDownloadUrl = (_a = fileData.file) === null || _a === void 0 ? void 0 : _a.url_private_download;
|
|
27
29
|
if (!fileDownloadUrl) {
|
|
@@ -32,7 +34,7 @@ exports.getFileAction = (0, pieces_framework_1.createAction)({
|
|
|
32
34
|
url: fileDownloadUrl,
|
|
33
35
|
authentication: {
|
|
34
36
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
35
|
-
token:
|
|
37
|
+
token: botToken,
|
|
36
38
|
},
|
|
37
39
|
responseType: 'arraybuffer',
|
|
38
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-file.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,+DAAyF;AACzF,qEAAwE;AACxE,4CAA2C;
|
|
1
|
+
{"version":3,"file":"get-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-file.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,+DAAyF;AACzF,qEAAwE;AACxE,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,2CAA2C;IACxD,KAAK,EAAE;QACN,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gEAAgE;SAC7E,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;;YAChB,MAAM,QAAQ,GAAG,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;YAC7D,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC;YAEvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;YAE9E,MAAM,eAAe,GAAG,MAAA,QAAQ,CAAC,IAAI,0CAAE,oBAAoB,CAAC;YAE5D,IAAI,CAAC,eAAe,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACrD,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC7C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,eAAe;gBACpB,cAAc,EAAE;oBACf,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,QAAQ;iBACf;gBACD,YAAY,EAAE,aAAa;aAC3B,CAAC,CAAC;YAEH,uCACI,QAAQ,CAAC,IAAI,KAChB,IAAI,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;oBAC/B,QAAQ,EAAE,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,IAAI,KAAI,MAAM;oBACvC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;iBAChC,CAAC,IACD;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export declare const getMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const getMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
3
|
-
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
6
|
+
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
|
|
9
|
+
}>)[]>;
|
|
4
10
|
ts: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
11
|
}>;
|
|
6
12
|
//# sourceMappingURL=get-message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-message.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;EA6B3B,CAAC"}
|
|
@@ -7,6 +7,7 @@ const auth_1 = require("../auth");
|
|
|
7
7
|
const props_1 = require("../common/props");
|
|
8
8
|
const utils_1 = require("../common/utils");
|
|
9
9
|
const web_api_1 = require("@slack/web-api");
|
|
10
|
+
const auth_helpers_1 = require("../common/auth-helpers");
|
|
10
11
|
exports.getMessageAction = (0, pieces_framework_1.createAction)({
|
|
11
12
|
name: 'get-message',
|
|
12
13
|
displayName: 'Get Message by Timestamp',
|
|
@@ -27,7 +28,7 @@ exports.getMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
27
28
|
if (!messageTimestamp) {
|
|
28
29
|
throw new Error('Invalid Timestamp Value.');
|
|
29
30
|
}
|
|
30
|
-
const client = new web_api_1.WebClient(
|
|
31
|
+
const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
|
|
31
32
|
return yield client.conversations.history({
|
|
32
33
|
channel: propsValue.channel,
|
|
33
34
|
oldest: messageTimestamp,
|