@pipedream/slack 0.6.4 → 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.
@@ -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.21",
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, is needed a valid \`/tmp\` path`);
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
- channels: this.conversation,
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.4",
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": "^2.0.0",
17
+ "@pipedream/platform": "^3.0.0",
18
18
  "@slack/web-api": "^7.0.4"
19
19
  }
20
20
  }
@@ -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
+ }