@activepieces/piece-slack 0.5.12 → 0.6.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/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-reaction-to-message.js +1 -1
- package/src/lib/actions/add-reaction-to-message.js.map +1 -1
- package/src/lib/actions/create-channel.js +8 -22
- package/src/lib/actions/create-channel.js.map +1 -1
- package/src/lib/actions/find-user-by-email.js +9 -21
- package/src/lib/actions/find-user-by-email.js.map +1 -1
- package/src/lib/actions/get-channel-history.js +1 -1
- package/src/lib/actions/get-channel-history.js.map +1 -1
- package/src/lib/actions/request-action-direct-message.d.ts +1 -1
- package/src/lib/actions/request-action-message.js +1 -1
- package/src/lib/actions/request-action-message.js.map +1 -1
- package/src/lib/actions/request-approval-direct-message.d.ts +1 -1
- package/src/lib/actions/request-approval-message.js +1 -1
- package/src/lib/actions/request-approval-message.js.map +1 -1
- package/src/lib/actions/search-messages.js +23 -26
- package/src/lib/actions/search-messages.js.map +1 -1
- package/src/lib/actions/send-direct-message-action.d.ts +1 -1
- package/src/lib/actions/send-message-action.js +1 -1
- package/src/lib/actions/send-message-action.js.map +1 -1
- package/src/lib/actions/update-message.js +9 -21
- package/src/lib/actions/update-message.js.map +1 -1
- package/src/lib/actions/update-profile.js +13 -30
- package/src/lib/actions/update-profile.js.map +1 -1
- package/src/lib/actions/upload-file.js +6 -26
- package/src/lib/actions/upload-file.js.map +1 -1
- package/src/lib/common/props.d.ts +2 -2
- package/src/lib/common/props.js +50 -42
- package/src/lib/common/props.js.map +1 -1
- package/src/lib/common/request-action.d.ts +1 -5
- package/src/lib/common/utils.d.ts +1 -5
- package/src/lib/common/utils.js +19 -60
- package/src/lib/common/utils.js.map +1 -1
- package/src/lib/triggers/new-channel.d.ts +1 -1
- package/src/lib/triggers/new-channel.js +52 -58
- package/src/lib/triggers/new-channel.js.map +1 -1
- package/src/lib/triggers/new-message.js +14 -17
- package/src/lib/triggers/new-message.js.map +1 -1
- package/src/lib/triggers/new-reaction-added.d.ts +6 -3
- package/src/lib/triggers/new-reaction-added.js +36 -6
- package/src/lib/triggers/new-reaction-added.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-slack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"@slack/web-api": "7.0.4",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"semver": "7.6.0",
|
|
12
12
|
"@activepieces/pieces-common": "0.2.15",
|
|
13
13
|
"@activepieces/pieces-framework": "0.7.32",
|
|
14
|
-
"@activepieces/shared": "0.10.
|
|
14
|
+
"@activepieces/shared": "0.10.110",
|
|
15
15
|
"tslib": "1.14.1"
|
|
16
16
|
},
|
|
17
17
|
"main": "./src/index.js",
|
package/src/index.js
CHANGED
|
@@ -118,6 +118,6 @@ exports.slack = (0, pieces_framework_1.createPiece)({
|
|
|
118
118
|
}),
|
|
119
119
|
}),
|
|
120
120
|
],
|
|
121
|
-
triggers: [new_message_1.newMessage, new_reaction_added_1.newReactionAdded, new_channel_1.
|
|
121
|
+
triggers: [new_message_1.newMessage, new_reaction_added_1.newReactionAdded, new_channel_1.channelCreated],
|
|
122
122
|
});
|
|
123
123
|
//# sourceMappingURL=index.js.map
|
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,qEAIwC;AACxC,iDAAqD;AACrD,sEAAiC;AACjC,+FAA+F;AAC/F,iFAAkF;AAClF,mGAAmG;AACnG,qFAA0F;AAC1F,yFAAwF;AACxF,2EAA2E;AAC3E,4DAAwD;AACxD,0EAAqE;AACrE,2DAAuD;AACvD,mEAA+D;AAC/D,iEAA6D;AAC7D,yEAAyE;AACzE,iEAAmE;AACnE,iEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/slack/src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -14,7 +14,7 @@ exports.addRectionToMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
description: 'Add an emoji reaction to a message.',
|
|
15
15
|
props: {
|
|
16
16
|
info: props_1.slackInfo,
|
|
17
|
-
channel: props_1.slackChannel,
|
|
17
|
+
channel: (0, props_1.slackChannel)(true),
|
|
18
18
|
ts: pieces_framework_1.Property.ShortText({
|
|
19
19
|
displayName: 'Message Timestamp',
|
|
20
20
|
description: '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.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-reaction-to-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE,2CAA0D;AAE1D,4CAA2C;AAC3C,2CAA0D;AAE7C,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,qCAAqC;IAElD,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,oBAAY;
|
|
1
|
+
{"version":3,"file":"add-reaction-to-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/add-reaction-to-message.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE,2CAA0D;AAE1D,4CAA2C;AAC3C,2CAA0D;AAE7C,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,qCAAqC;IAElD,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,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;KACH;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAErD,MAAM,KAAK,GAAG,IAAI,mBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEvD,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"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createChannelAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
5
|
const __1 = require("../../");
|
|
7
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const web_api_1 = require("@slack/web-api");
|
|
8
8
|
exports.createChannelAction = (0, pieces_framework_1.createAction)({
|
|
9
9
|
auth: __1.slackAuth,
|
|
10
10
|
name: 'slack-create-channel',
|
|
@@ -21,27 +21,13 @@ exports.createChannelAction = (0, pieces_framework_1.createAction)({
|
|
|
21
21
|
defaultValue: false,
|
|
22
22
|
}),
|
|
23
23
|
},
|
|
24
|
-
run(
|
|
25
|
-
return tslib_1.__awaiter(this,
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
authentication: {
|
|
32
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
33
|
-
token: context.auth.access_token,
|
|
34
|
-
},
|
|
35
|
-
body: {
|
|
36
|
-
name: channelName,
|
|
37
|
-
is_private: isPrivate,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
41
|
-
if (!response.body.ok) {
|
|
42
|
-
throw new Error(JSON.stringify(response.body, undefined, 2));
|
|
43
|
-
}
|
|
44
|
-
return response.body;
|
|
24
|
+
run(_a) {
|
|
25
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
26
|
+
const client = new web_api_1.WebClient(auth.access_token);
|
|
27
|
+
return yield client.conversations.create({
|
|
28
|
+
name: propsValue.channelName,
|
|
29
|
+
is_private: propsValue.isPrivate,
|
|
30
|
+
});
|
|
45
31
|
});
|
|
46
32
|
},
|
|
47
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE,4CAA2C;AAE9B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,aAAS;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,IAAI,CAAC,YAAY,CAAC,CAAC;YAChD,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"}
|
|
@@ -3,38 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.findUserByEmailAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const __1 = require("../../");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const web_api_1 = require("@slack/web-api");
|
|
8
8
|
exports.findUserByEmailAction = (0, pieces_framework_1.createAction)({
|
|
9
9
|
auth: __1.slackAuth,
|
|
10
10
|
name: 'slack-find-user-by-email',
|
|
11
11
|
displayName: 'Find User by Email',
|
|
12
|
-
description: 'Finds a user by matching against
|
|
12
|
+
description: 'Finds a user by matching against their email address.',
|
|
13
13
|
props: {
|
|
14
14
|
email: pieces_framework_1.Property.ShortText({
|
|
15
15
|
displayName: 'Email',
|
|
16
16
|
required: true,
|
|
17
17
|
}),
|
|
18
18
|
},
|
|
19
|
-
run(
|
|
20
|
-
return tslib_1.__awaiter(this,
|
|
21
|
-
const email =
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
email: email,
|
|
27
|
-
},
|
|
28
|
-
authentication: {
|
|
29
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
30
|
-
token: context.auth.access_token,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
34
|
-
if (!response.body.ok) {
|
|
35
|
-
throw new Error(JSON.stringify(response.body, undefined, 2));
|
|
36
|
-
}
|
|
37
|
-
return response.body;
|
|
19
|
+
run(_a) {
|
|
20
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
21
|
+
const email = propsValue.email;
|
|
22
|
+
const client = new web_api_1.WebClient(auth.access_token);
|
|
23
|
+
return yield client.users.lookupByEmail({
|
|
24
|
+
email,
|
|
25
|
+
});
|
|
38
26
|
});
|
|
39
27
|
},
|
|
40
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-user-by-email.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC
|
|
1
|
+
{"version":3,"file":"find-user-by-email.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/find-user-by-email.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE,4CAA2C;AAE9B,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,aAAS;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,IAAI,CAAC,YAAY,CAAC,CAAC;YAChD,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;gBACtC,KAAK;aACN,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ exports.getChannelHistory = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
description: 'Retrieve all messages from a specific channel ("conversation") between specified timestamps',
|
|
15
15
|
props: {
|
|
16
16
|
info: props_1.slackInfo,
|
|
17
|
-
channel: props_1.slackChannel,
|
|
17
|
+
channel: (0, props_1.slackChannel)(true),
|
|
18
18
|
oldest: pieces_framework_1.Property.Number({
|
|
19
19
|
displayName: 'Oldest',
|
|
20
20
|
description: 'Only messages after this timestamp will be included in results',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-history.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/get-channel-history.ts"],"names":[],"mappings":";;;;AAAA,4CAAyE;AACzE,qEAAwE;AACxE,6BAAkC;AAClC,2CAA0D;AAE7C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,2FAA2F;IAC3F,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,6FAA6F;IAC/F,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,oBAAY;
|
|
1
|
+
{"version":3,"file":"get-channel-history.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/get-channel-history.ts"],"names":[],"mappings":";;;;AAAA,4CAAyE;AACzE,qEAAwE;AACxE,6BAAkC;AAClC,2CAA0D;AAE7C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,2FAA2F;IAC3F,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,6FAA6F;IAC/F,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,8FAA8F;YAChG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,4GAA4G;YAC9G,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpC,WAAW,EAAE,sBAAsB;YACnC,WAAW,EAAE,kDAAkD;YAC/D,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChD,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;;gBACpE,KAAyB,eAAA,KAAA,sBAAA,MAAM,CAAC,QAAQ,CAAC,uBAAuB,EAAE;oBAChE,OAAO,EAAE,UAAU,CAAC,OAAO;oBAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;oBACzB,MAAM,EAAE,UAAU,CAAC,MAAM;oBACzB,KAAK,EAAE,GAAG,EAAE,wDAAwD;oBACpE,oBAAoB,EAAE,UAAU,CAAC,kBAAkB;oBACnD,SAAS,EAAE,UAAU,CAAC,SAAS;iBAChC,CAAC,CAAA,IAAA,sDAAE,CAAC;oBAPoB,cAOvB;oBAPuB,WAOvB;oBAPS,MAAM,IAAI,KAAA,CAAA;oBAQnB,MAAM,QAAQ,GAAG,IAAoC,CAAC;oBACtD,IAAI,QAAQ,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,5 +1,5 @@
|
|
|
1
1
|
export declare const requestActionDirectMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
userId: import("@activepieces/pieces-framework").DropdownProperty<string,
|
|
2
|
+
userId: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
4
|
actions: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
5
5
|
username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
@@ -14,7 +14,7 @@ exports.requestActionMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
description: 'Send a message in a channel and wait until an action is selected',
|
|
15
15
|
props: {
|
|
16
16
|
info: props_1.slackInfo,
|
|
17
|
-
channel: props_1.slackChannel,
|
|
17
|
+
channel: (0, props_1.slackChannel)(true),
|
|
18
18
|
text: props_1.text,
|
|
19
19
|
actions: props_1.actions,
|
|
20
20
|
username: props_1.username,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-action-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/request-action-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,6BAAkC;AAClC,iDAAgE;AAChE,2CAOyB;AACzB,6DAAyD;AAE5C,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EACT,kEAAkE;IACpE,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,oBAAY;
|
|
1
|
+
{"version":3,"file":"request-action-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/request-action-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,6BAAkC;AAClC,iDAAgE;AAChE,2CAOyB;AACzB,6DAAyD;AAE5C,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EACT,kEAAkE;IACpE,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,IAAI,EAAJ,YAAI;QACJ,OAAO,EAAP,eAAO;QACP,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;KACf;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACvC,IAAA,iCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE7C,OAAO,MAAM,IAAA,8BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const requestApprovalDirectMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
userId: import("@activepieces/pieces-framework").DropdownProperty<string,
|
|
2
|
+
userId: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
4
|
username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
5
|
profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
@@ -14,7 +14,7 @@ exports.requestSendApprovalMessageAction = (0, pieces_framework_1.createAction)(
|
|
|
14
14
|
description: 'Send approval message to a channel and then wait until the message is approved or disapproved',
|
|
15
15
|
props: {
|
|
16
16
|
info: props_1.slackInfo,
|
|
17
|
-
channel: props_1.slackChannel,
|
|
17
|
+
channel: (0, props_1.slackChannel)(true),
|
|
18
18
|
text: props_1.text,
|
|
19
19
|
username: props_1.username,
|
|
20
20
|
profilePicture: props_1.profilePicture,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-approval-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/request-approval-message.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"request-approval-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/request-approval-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,2CAAmD;AACnD,6BAAkC;AAClC,iDAI8B;AAC9B,2CAA0F;AAE7E,QAAA,gCAAgC,GAAG,IAAA,+BAAY,EAAC;IAC3D,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EACT,+FAA+F;IACjG,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,IAAI,EAAJ,YAAI;QACJ,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;KACf;IACK,GAAG,CAAC,OAAO;;YACf,IAAI,OAAO,CAAC,aAAa,KAAK,sBAAa,CAAC,KAAK,EAAE,CAAC;gBAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;oBAChB,aAAa,EAAE;wBACb,IAAI,EAAE,kBAAS,CAAC,OAAO;wBACvB,QAAQ,EAAE,EAAE;qBACb;iBACF,CAAC,CAAC;gBACH,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;gBACxC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;gBAEjE,IAAA,iCAAwB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBACzC,IAAA,iCAAwB,EAAC,YAAI,EAAE,MAAM,CAAC,CAAC;gBACvC,IAAA,iCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC;oBAC7C,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;iBACnC,CAAC,CAAC;gBACH,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;oBAChD,WAAW,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;iBACtC,CAAC,CAAC;gBAEH,OAAO,MAAM,IAAA,wBAAgB,EAAC;oBAC5B,KAAK;oBACL,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,gBAAgB,YAAY,mBAAmB,eAAe,EAAE;oBAChG,QAAQ;oBACR,cAAc;oBACd,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;6BACnC;yBACF;wBACD;4BACE,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,SAAS;4BACnB,QAAQ,EAAE;gCACR;oCACE,IAAI,EAAE,QAAQ;oCACd,IAAI,EAAE;wCACJ,IAAI,EAAE,YAAY;wCAClB,IAAI,EAAE,SAAS;qCAChB;oCACD,KAAK,EAAE,SAAS;oCAChB,GAAG,EAAE,YAAY;iCAClB;gCACD;oCACE,IAAI,EAAE,QAAQ;oCACd,IAAI,EAAE;wCACJ,IAAI,EAAE,YAAY;wCAClB,IAAI,EAAE,YAAY;qCACnB;oCACD,KAAK,EAAE,QAAQ;oCACf,GAAG,EAAE,eAAe;iCACrB;6BACF;yBACF;qBACF;oBACD,cAAc,EAAE,OAAO;iBACxB,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO;oBACL,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,SAAS;iBACpE,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.searchMessages = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const __1 = require("../..");
|
|
7
|
-
const
|
|
7
|
+
const web_api_1 = require("@slack/web-api");
|
|
8
8
|
exports.searchMessages = (0, pieces_framework_1.createAction)({
|
|
9
9
|
name: 'searchMessages',
|
|
10
10
|
displayName: 'Search messages',
|
|
@@ -18,36 +18,33 @@ exports.searchMessages = (0, pieces_framework_1.createAction)({
|
|
|
18
18
|
},
|
|
19
19
|
run(_a) {
|
|
20
20
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
21
|
-
var _b;
|
|
21
|
+
var _b, _c, _d, _e;
|
|
22
22
|
const userToken = (_b = auth.data['authed_user']) === null || _b === void 0 ? void 0 : _b.access_token;
|
|
23
23
|
if (userToken === undefined) {
|
|
24
|
-
throw new Error(
|
|
24
|
+
throw new Error(JSON.stringify({
|
|
25
|
+
message: 'Missing user token, please re-authenticate'
|
|
26
|
+
}));
|
|
25
27
|
}
|
|
26
|
-
const
|
|
27
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
28
|
-
url: 'https://slack.com/api/search.messages',
|
|
29
|
-
queryParams: {
|
|
30
|
-
query: propsValue.query,
|
|
31
|
-
count: '100',
|
|
32
|
-
},
|
|
33
|
-
authentication: {
|
|
34
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
35
|
-
token: userToken,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
let page = 1;
|
|
39
|
-
let pageCount = Infinity;
|
|
28
|
+
const client = new web_api_1.WebClient(userToken);
|
|
40
29
|
const matches = [];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
// We can't use the usual "for await ... of" syntax with client.paginate
|
|
31
|
+
// Because search.messages uses a bastardized version of cursor-based pagination
|
|
32
|
+
// Where you need to pass * as first cursor
|
|
33
|
+
// https://api.slack.com/methods/search.messages#arg_cursor
|
|
34
|
+
let cursor = '*';
|
|
35
|
+
do {
|
|
36
|
+
const page = yield client.search.messages({
|
|
37
|
+
query: propsValue.query,
|
|
38
|
+
count: 100,
|
|
39
|
+
// @ts-expect-error TS2353 - SDK is not aware cursor is actually supported
|
|
40
|
+
cursor,
|
|
41
|
+
});
|
|
42
|
+
if ((_c = page.messages) === null || _c === void 0 ? void 0 : _c.matches) {
|
|
43
|
+
matches.push(...page.messages.matches);
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
page
|
|
49
|
-
|
|
50
|
-
}
|
|
45
|
+
// @ts-expect-error TS2353 - SDK is not aware next_cursor is actually returned
|
|
46
|
+
cursor = (_e = (_d = page.messages) === null || _d === void 0 ? void 0 : _d.pagination) === null || _e === void 0 ? void 0 : _e.next_cursor;
|
|
47
|
+
} while (cursor);
|
|
51
48
|
return matches;
|
|
52
49
|
});
|
|
53
50
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/search-messages.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAkC;AAClC
|
|
1
|
+
{"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/search-messages.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAkC;AAClC,4CAA2C;AAE9B,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,wCAAwC;IACrD,IAAI,EAAE,aAAS;IACf,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,0CAAE,YAAY,CAAC;YACzD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAC5B;oBACE,OAAO,EAAE,4CAA4C;iBACtD,CACF,CAAC,CAAC;YACL,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,SAAS,CAAC,CAAC;YACxC,MAAM,OAAO,GAAG,EAAE,CAAC;YAEnB,wEAAwE;YACxE,gFAAgF;YAChF,2CAA2C;YAC3C,2DAA2D;YAC3D,IAAI,MAAM,GAAG,GAAG,CAAC;YACjB,GAAG,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;oBACxC,KAAK,EAAE,UAAU,CAAC,KAAK;oBACvB,KAAK,EAAE,GAAG;oBACV,0EAA0E;oBAC1E,MAAM;iBACP,CAAC,CAAC;gBACH,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE,CAAC;oBAC3B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;gBACD,8EAA8E;gBAC9E,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,0CAAE,WAAW,CAAC;YAClD,CAAC,QAAQ,MAAM,EAAE;YAEjB,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const slackSendDirectMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
userId: import("@activepieces/pieces-framework").DropdownProperty<string,
|
|
2
|
+
userId: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
4
|
username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
5
|
profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
@@ -13,7 +13,7 @@ exports.slackSendMessageAction = (0, pieces_framework_1.createAction)({
|
|
|
13
13
|
description: 'Send message to a channel',
|
|
14
14
|
props: {
|
|
15
15
|
info: props_1.slackInfo,
|
|
16
|
-
channel: props_1.slackChannel,
|
|
16
|
+
channel: (0, props_1.slackChannel)(true),
|
|
17
17
|
text: pieces_framework_1.Property.LongText({
|
|
18
18
|
displayName: 'Message',
|
|
19
19
|
description: 'The text of your message',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-message-action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/send-message-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAMyB;AACzB,2CAA4E;AAC5E,8BAAmC;AAEtB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,oBAAY;
|
|
1
|
+
{"version":3,"file":"send-message-action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/send-message-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAMyB;AACzB,2CAA4E;AAC5E,8BAAmC;AAEtB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;QACd,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,oVAAoV;YACtV,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAN,cAAM;KACP;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GACvE,OAAO,CAAC,UAAU,CAAC;YAErB,OAAO,IAAA,wBAAgB,EAAC;gBACtB,KAAK;gBACL,IAAI;gBACJ,QAAQ;gBACR,cAAc;gBACd,cAAc,EAAE,OAAO;gBACvB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAA,+BAAuB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;gBAClE,IAAI;gBACJ,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateMessage = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
6
|
const __1 = require("../..");
|
|
8
7
|
const props_1 = require("../common/props");
|
|
9
8
|
const utils_1 = require("../common/utils");
|
|
9
|
+
const web_api_1 = require("@slack/web-api");
|
|
10
10
|
exports.updateMessage = (0, pieces_framework_1.createAction)({
|
|
11
11
|
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
|
|
12
12
|
name: 'updateMessage',
|
|
@@ -15,7 +15,7 @@ exports.updateMessage = (0, pieces_framework_1.createAction)({
|
|
|
15
15
|
auth: __1.slackAuth,
|
|
16
16
|
props: {
|
|
17
17
|
info: props_1.slackInfo,
|
|
18
|
-
channel: props_1.slackChannel,
|
|
18
|
+
channel: (0, props_1.slackChannel)(true),
|
|
19
19
|
ts: pieces_framework_1.Property.ShortText({
|
|
20
20
|
displayName: 'Message Timestamp',
|
|
21
21
|
description: '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.',
|
|
@@ -34,25 +34,13 @@ exports.updateMessage = (0, pieces_framework_1.createAction)({
|
|
|
34
34
|
if (!messageTimestamp) {
|
|
35
35
|
throw new Error('Invalid Timestamp Value.');
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
blocks: propsValue.blocks,
|
|
45
|
-
},
|
|
46
|
-
authentication: {
|
|
47
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
48
|
-
token: auth.access_token,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
52
|
-
if (!response.body.ok) {
|
|
53
|
-
throw new Error(response.body.error);
|
|
54
|
-
}
|
|
55
|
-
return response.body;
|
|
37
|
+
const client = new web_api_1.WebClient(auth.access_token);
|
|
38
|
+
return yield client.chat.update({
|
|
39
|
+
channel: propsValue.channel,
|
|
40
|
+
ts: messageTimestamp,
|
|
41
|
+
text: propsValue.text,
|
|
42
|
+
blocks: propsValue.blocks,
|
|
43
|
+
});
|
|
56
44
|
});
|
|
57
45
|
},
|
|
58
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/update-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE
|
|
1
|
+
{"version":3,"file":"update-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/update-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAkC;AAClC,2CAAkE;AAClE,2CAA0D;AAC1D,4CAAkD;AAErC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,2FAA2F;IAC3F,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,4BAA4B;IACzC,IAAI,EAAE,aAAS;IACf,KAAK,EAAE;QACL,IAAI,EAAE,iBAAS;QACf,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EACT,4OAA4O;YAC9O,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAN,cAAM;KACP;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;YACD,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAChD,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC9B,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,EAAE,EAAE,gBAAgB;gBACpB,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,MAAM,EAAE,UAAU,CAAC,MAA4B;aAChD,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.updateProfileAction = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const __1 = require("../../");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const
|
|
7
|
+
const web_api_1 = require("@slack/web-api");
|
|
8
8
|
exports.updateProfileAction = (0, pieces_framework_1.createAction)({
|
|
9
9
|
auth: __1.slackAuth,
|
|
10
10
|
name: 'slack-update-profile',
|
|
@@ -26,39 +26,22 @@ exports.updateProfileAction = (0, pieces_framework_1.createAction)({
|
|
|
26
26
|
}),
|
|
27
27
|
userId: pieces_framework_1.Property.ShortText({
|
|
28
28
|
displayName: 'User',
|
|
29
|
-
description: '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
|
|
29
|
+
description: '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.',
|
|
30
30
|
required: false,
|
|
31
31
|
}),
|
|
32
32
|
},
|
|
33
|
-
run(
|
|
34
|
-
return tslib_1.__awaiter(this,
|
|
35
|
-
var
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
43
|
-
url: 'https://slack.com/api/users.profile.set',
|
|
44
|
-
authentication: {
|
|
45
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
46
|
-
token: userToken,
|
|
33
|
+
run(_a) {
|
|
34
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
35
|
+
var _b;
|
|
36
|
+
const client = new web_api_1.WebClient((_b = auth.data['authed_user']) === null || _b === void 0 ? void 0 : _b.access_token);
|
|
37
|
+
return client.users.profile.set({
|
|
38
|
+
profile: {
|
|
39
|
+
first_name: propsValue.firstName,
|
|
40
|
+
last_name: propsValue.lastName,
|
|
41
|
+
email: propsValue.email,
|
|
47
42
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
first_name: firstName,
|
|
51
|
-
last_name: lastName,
|
|
52
|
-
email,
|
|
53
|
-
},
|
|
54
|
-
user: userId,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
58
|
-
if (!response.body.ok) {
|
|
59
|
-
throw new Error(JSON.stringify(response.body, undefined, 2));
|
|
60
|
-
}
|
|
61
|
-
return response.body;
|
|
43
|
+
user: propsValue.userId,
|
|
44
|
+
});
|
|
62
45
|
});
|
|
63
46
|
},
|
|
64
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-profile.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/update-profile.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE
|
|
1
|
+
{"version":3,"file":"update-profile.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/update-profile.ts"],"names":[],"mappings":";;;;AAAA,8BAAmC;AACnC,qEAAwE;AACxE,4CAA2C;AAE9B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kKAAkK;YAC/K,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,6IAA6I;YAC/I,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,0CAAE,YAAY,CAAC,CAAC;YACrE,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC9B,OAAO,EAAE;oBACP,UAAU,EAAE,UAAU,CAAC,SAAS;oBAChC,SAAS,EAAE,UAAU,CAAC,QAAQ;oBAC9B,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB;gBACD,IAAI,EAAE,UAAU,CAAC,MAAM;aACxB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.uploadFile = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const index_1 = require("../../index");
|
|
7
|
-
const
|
|
7
|
+
const web_api_1 = require("@slack/web-api");
|
|
8
8
|
exports.uploadFile = (0, pieces_framework_1.createAction)({
|
|
9
9
|
auth: index_1.slackAuth,
|
|
10
10
|
name: 'uploadFile',
|
|
@@ -28,31 +28,11 @@ exports.uploadFile = (0, pieces_framework_1.createAction)({
|
|
|
28
28
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const token = context.auth.access_token;
|
|
30
30
|
const { file, title, filename } = context.propsValue;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
if (filename !== undefined) {
|
|
37
|
-
formData.append('filename', filename);
|
|
38
|
-
}
|
|
39
|
-
const request = {
|
|
40
|
-
url: `https://slack.com/api/files.upload`,
|
|
41
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
42
|
-
body: formData,
|
|
43
|
-
headers: {
|
|
44
|
-
'Content-Type': 'multipart/form-data',
|
|
45
|
-
},
|
|
46
|
-
authentication: {
|
|
47
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
48
|
-
token,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
52
|
-
if (!response.body.ok) {
|
|
53
|
-
throw new Error(response.body.error);
|
|
54
|
-
}
|
|
55
|
-
return response.body;
|
|
31
|
+
const client = new web_api_1.WebClient(token);
|
|
32
|
+
return yield client.files.uploadV2({
|
|
33
|
+
file_uploads: [{ file: file.data, filename: filename || file.filename }],
|
|
34
|
+
title: title,
|
|
35
|
+
});
|
|
56
36
|
});
|
|
57
37
|
},
|
|
58
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAAwC;AACxC
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/slack/src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAAwC;AACxC,4CAA2C;AAE9B,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,iBAAS;IACf,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,qDAAqD;IAClE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;YACxC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACrD,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;YACpC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;gBACjC,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACxE,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const slackInfo: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
2
|
-
export declare const slackChannel: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
2
|
+
export declare const slackChannel: <R extends boolean>(required: R) => R extends true ? import("@activepieces/pieces-framework").DropdownProperty<string, true> : import("@activepieces/pieces-framework").DropdownProperty<string, false>;
|
|
3
3
|
export declare const username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
4
|
export declare const profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
5
|
export declare const blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
6
|
-
export declare const userId: import("@activepieces/pieces-framework").DropdownProperty<string,
|
|
6
|
+
export declare const userId: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
7
7
|
export declare const text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
8
|
export declare const actions: import("@activepieces/pieces-framework").ArrayProperty<true>;
|