@activepieces/piece-slack 0.5.2 → 0.5.3
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 +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/actions/send-direct-message-action.d.ts +1 -1
- package/src/lib/actions/send-message-action.d.ts +1 -1
- package/src/lib/actions/update-message.d.ts +6 -0
- package/src/lib/actions/update-message.js +53 -0
- package/src/lib/actions/update-message.js.map +1 -0
- package/src/lib/common/props.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-slack",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.6.7",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"nanoid": "3.3.6",
|
|
11
11
|
"semver": "7.6.0",
|
|
12
12
|
"@activepieces/pieces-common": "0.2.12",
|
|
13
|
-
"@activepieces/pieces-framework": "0.7.
|
|
13
|
+
"@activepieces/pieces-framework": "0.7.28",
|
|
14
14
|
"@activepieces/shared": "0.10.98",
|
|
15
15
|
"tslib": "1.14.1"
|
|
16
16
|
},
|
package/src/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const new_message_1 = require("./lib/triggers/new-message");
|
|
|
16
16
|
const new_reaction_added_1 = require("./lib/triggers/new-reaction-added");
|
|
17
17
|
const upload_file_1 = require("./lib/actions/upload-file");
|
|
18
18
|
const search_messages_1 = require("./lib/actions/search-messages");
|
|
19
|
+
const update_message_1 = require("./lib/actions/update-message");
|
|
19
20
|
exports.slackAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
20
21
|
description: '',
|
|
21
22
|
authUrl: 'https://slack.com/oauth/v2/authorize?user_scope=search:read',
|
|
@@ -87,6 +88,7 @@ exports.slack = (0, pieces_framework_1.createPiece)({
|
|
|
87
88
|
request_action_message_1.requestActionMessageAction,
|
|
88
89
|
upload_file_1.uploadFile,
|
|
89
90
|
search_messages_1.searchMessages,
|
|
91
|
+
update_message_1.updateMessage,
|
|
90
92
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
91
93
|
baseUrl: () => {
|
|
92
94
|
return 'https://slack.com/api';
|
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;
|
|
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;AAEhD,QAAA,SAAS,GAAG,4BAAS,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,6DAA6D;IACtE,QAAQ,EAAE,uCAAuC;IACjD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,WAAW;QACX,YAAY;QACZ,aAAa;QACb,YAAY;KACb;CACF,CAAC,CAAC;AAEU,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC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qBAAqB;QACrB,YAAY;QACZ,WAAW;QACX,sBAAsB;QACtB,eAAe;QACf,UAAU;KACX;IACD,OAAO,EAAE;QACP,yDAA4B;QAC5B,4CAAsB;QACtB,oEAAkC;QAClC,2DAAgC;QAChC,gEAAgC;QAChC,mDAA0B;QAC1B,wBAAU;QACV,gCAAc;QACd,8BAAa;QACb,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,uBAAuB,CAAC;YACjC,CAAC;YACD,IAAI,EAAE,iBAAS;YACf,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;gBACpB,OAAO;oBACL,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACtE,CAAC;YACJ,CAAC;SACF,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,wBAAU,EAAE,qCAAgB,CAAC;CACzC,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@ export declare const slackSendDirectMessageAction: import("@activepieces/pieces-
|
|
|
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>;
|
|
6
|
-
blocks: import("
|
|
6
|
+
blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
7
7
|
}>;
|
|
@@ -5,5 +5,5 @@ export declare const slackSendMessageAction: import("@activepieces/pieces-framew
|
|
|
5
5
|
username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
6
|
profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
7
|
file: import("@activepieces/pieces-framework").FileProperty<false>;
|
|
8
|
-
blocks: import("
|
|
8
|
+
blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
9
9
|
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const updateMessage: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
channel: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
ts: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
|
+
blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateMessage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const props_1 = require("../common/props");
|
|
9
|
+
exports.updateMessage = (0, pieces_framework_1.createAction)({
|
|
10
|
+
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
|
|
11
|
+
name: 'updateMessage',
|
|
12
|
+
displayName: 'Update message',
|
|
13
|
+
description: 'Update an existing message',
|
|
14
|
+
auth: __1.slackAuth,
|
|
15
|
+
props: {
|
|
16
|
+
channel: props_1.slackChannel,
|
|
17
|
+
ts: pieces_framework_1.Property.ShortText({
|
|
18
|
+
displayName: 'Message ts',
|
|
19
|
+
description: 'Provide the ts (timestamp) value of the message to update, e.g. `1710304378.475129`.',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
text: pieces_framework_1.Property.LongText({
|
|
23
|
+
displayName: 'Message',
|
|
24
|
+
description: 'The updated text of your message',
|
|
25
|
+
required: true,
|
|
26
|
+
}),
|
|
27
|
+
blocks: props_1.blocks,
|
|
28
|
+
},
|
|
29
|
+
run({ auth, propsValue }) {
|
|
30
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const request = {
|
|
32
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
33
|
+
url: 'https://slack.com/api/chat.update',
|
|
34
|
+
body: {
|
|
35
|
+
channel: propsValue.channel,
|
|
36
|
+
ts: propsValue.ts,
|
|
37
|
+
text: propsValue.text,
|
|
38
|
+
blocks: propsValue.blocks,
|
|
39
|
+
},
|
|
40
|
+
authentication: {
|
|
41
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
42
|
+
token: auth.access_token,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
46
|
+
if (!response.body.ok) {
|
|
47
|
+
throw new Error(response.body.error);
|
|
48
|
+
}
|
|
49
|
+
return response.body;
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=update-message.js.map
|
|
@@ -0,0 +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,+DAKqC;AACrC,6BAAkC;AAClC,2CAAuD;AAE1C,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,OAAO,EAAE,oBAAY;QACrB,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,sFAAsF;YACxF,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,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,mCAAmC;gBACxC,IAAI,EAAE;oBACJ,OAAO,EAAE,UAAU,CAAC,OAAO;oBAC3B,EAAE,EAAE,UAAU,CAAC,EAAE;oBACjB,IAAI,EAAE,UAAU,CAAC,IAAI;oBACrB,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC1B;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI,CAAC,YAAY;iBACzB;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvC,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const slackChannel: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
2
2
|
export declare const username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
3
3
|
export declare const profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
export declare const blocks: import("
|
|
4
|
+
export declare const blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
5
5
|
export declare const userId: import("@activepieces/pieces-framework").DropdownProperty<string, true> | import("@activepieces/pieces-framework").DropdownProperty<string, false>;
|
|
6
6
|
export declare const text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
7
7
|
export declare const actions: import("@activepieces/pieces-framework").ArrayProperty<true>;
|