@pipedream/slack 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/upload-file/upload-file.mjs +5 -6
- package/package.json +2 -2
- package/sources/new-direct-message/new-direct-message.mjs +11 -5
- package/sources/new-message-in-channels/new-message-in-channels.mjs +1 -2
- package/sources/new-saved-message/new-saved-message.mjs +32 -0
- package/sources/new-saved-message/test-event.mjs +37 -0
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "slack-upload-file",
|
|
7
7
|
name: "Upload File",
|
|
8
8
|
description: "Upload a file. [See the documentation](https://api.slack.com/methods/files.upload)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.22",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
slack,
|
|
@@ -23,7 +23,6 @@ export default {
|
|
|
23
23
|
],
|
|
24
24
|
},
|
|
25
25
|
initialComment: {
|
|
26
|
-
label: "Report Name",
|
|
27
26
|
description: "Will be added as an initial comment before the image",
|
|
28
27
|
propDefinition: [
|
|
29
28
|
slack,
|
|
@@ -34,13 +33,13 @@ export default {
|
|
|
34
33
|
},
|
|
35
34
|
async run({ $ }) {
|
|
36
35
|
if (!fs.existsSync(this.content)) {
|
|
37
|
-
throw new ConfigurationError(`\`${this.content}\` not found,
|
|
36
|
+
throw new ConfigurationError(`\`${this.content}\` not found, a valid \`/tmp\` path is needed`);
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
const response = await this.slack.sdk().files.upload({
|
|
38
|
+
const response = await this.slack.sdk().filesUploadV2({
|
|
41
39
|
file: fs.createReadStream(this.content),
|
|
42
|
-
|
|
40
|
+
channel_id: this.conversation,
|
|
43
41
|
initial_comment: this.initialComment,
|
|
42
|
+
filename: this.content.split("/").pop(),
|
|
44
43
|
});
|
|
45
44
|
$.export("$summary", "Successfully uploaded file");
|
|
46
45
|
return response;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/slack",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Pipedream Slack Components",
|
|
5
5
|
"main": "slack.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pipedream/platform": "^
|
|
17
|
+
"@pipedream/platform": "^3.0.0",
|
|
18
18
|
"@slack/web-api": "^7.0.4"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
...common,
|
|
6
6
|
key: "slack-new-direct-message",
|
|
7
7
|
name: "New Direct Message (Instant)",
|
|
8
|
-
version: "1.0.
|
|
8
|
+
version: "1.0.18",
|
|
9
9
|
description: "Emit new event when a message was posted in a direct message channel",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
@@ -27,6 +27,13 @@ export default {
|
|
|
27
27
|
"ignoreBot",
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
|
+
ignoreSelf: {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
label: "Ignore Messages from Yourself",
|
|
33
|
+
description: "Ignores messages sent to yourself",
|
|
34
|
+
default: false,
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
30
37
|
},
|
|
31
38
|
methods: {
|
|
32
39
|
...common.methods,
|
|
@@ -34,10 +41,9 @@ export default {
|
|
|
34
41
|
return "New direct message received";
|
|
35
42
|
},
|
|
36
43
|
processEvent(event) {
|
|
37
|
-
if (event.user == this.slack.mySlackId())
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
|
|
44
|
+
if ((this.ignoreSelf && event.user == this.slack.mySlackId())
|
|
45
|
+
|| ((this.ignoreBot) && (event.subtype === "bot_message" || event.bot_id))
|
|
46
|
+
|| (event.subtype === "message_changed")) {
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
49
|
return event;
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
key: "slack-new-message-in-channels",
|
|
8
8
|
name: "New Message In Channels (Instant)",
|
|
9
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.20",
|
|
10
10
|
description: "Emit new event when a new message is posted to one or more channels",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
@@ -72,7 +72,6 @@ export default {
|
|
|
72
72
|
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
console.log(event.s);
|
|
76
75
|
// There is no thread message type only the thread_ts field
|
|
77
76
|
// indicates if the message is part of a thread in the event.
|
|
78
77
|
if (this.ignoreThreads && event.thread_ts) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
import sampleEmit from "./test-event.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "slack-new-saved-message",
|
|
7
|
+
name: "New Saved Message (Instant)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
description: "Emit new event when a message is saved. Note: The endpoint is marked as deprecated, and Slack might shut this off at some point down the line.",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
props: {
|
|
13
|
+
...common.props,
|
|
14
|
+
// eslint-disable-next-line pipedream/props-description,pipedream/props-label
|
|
15
|
+
slackApphook: {
|
|
16
|
+
type: "$.interface.apphook",
|
|
17
|
+
appProp: "slack",
|
|
18
|
+
async eventNames() {
|
|
19
|
+
return [
|
|
20
|
+
"star_added",
|
|
21
|
+
];
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
...common.methods,
|
|
27
|
+
getSummary() {
|
|
28
|
+
return "New saved message";
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
sampleEmit,
|
|
32
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"type": "star_added",
|
|
3
|
+
"user": "US676PZLY",
|
|
4
|
+
"item": {
|
|
5
|
+
"type": "message",
|
|
6
|
+
"channel": "C055ECVUMLN",
|
|
7
|
+
"message": {
|
|
8
|
+
"user": "US676PZLY",
|
|
9
|
+
"type": "message",
|
|
10
|
+
"ts": "1718379912.272779",
|
|
11
|
+
"client_msg_id": "def19b3b-4283-47bd-a2da-f32b35c0329c",
|
|
12
|
+
"text": "hello",
|
|
13
|
+
"team": "TS8319547",
|
|
14
|
+
"blocks": [
|
|
15
|
+
{
|
|
16
|
+
"type": "rich_text",
|
|
17
|
+
"block_id": "ZL1yL",
|
|
18
|
+
"elements": [
|
|
19
|
+
{
|
|
20
|
+
"type": "rich_text_section",
|
|
21
|
+
"elements": [
|
|
22
|
+
{
|
|
23
|
+
"type": "text",
|
|
24
|
+
"text": "hello"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"permalink": "https://michellestest-j1q3506.slack.com/archives/C055ECVUMLN/p1718379912272779"
|
|
32
|
+
},
|
|
33
|
+
"date_create": 1718385156
|
|
34
|
+
},
|
|
35
|
+
"event_ts": "1718385156.694322",
|
|
36
|
+
"pipedream_msg_id": "pd_1718385158733_tl8yx25evl"
|
|
37
|
+
}
|