@pipedream/slack_v2 2.0.0 → 2.1.0

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.
@@ -7,8 +7,11 @@ import slack from "../../slack_v2.app.mjs";
7
7
  export default {
8
8
  key: "slack_v2-upload-file",
9
9
  name: "Upload File",
10
- description: "Upload a file. [See the documentation](https://api.slack.com/messaging/files#uploading_files)",
11
- version: "0.1.18",
10
+ description: "Upload a file (document, image, audio, etc.) to a Slack channel, group, or direct message, optionally with a comment."
11
+ + " Use **Send Message** instead for text-only messages with no attachment."
12
+ + " `Content` can be a path to a file in `/tmp` or a URL; if the URL is a signed/presigned link whose path ends in an opaque ID or token rather than the real file name (e.g. a Google Cloud Storage or S3 URL with a `?X-Goog-Signature=...` query string), Slack can't infer the file type from it and will show the upload as an unreadable binary — set `File Name` explicitly in that case."
13
+ + " [See the documentation](https://api.slack.com/messaging/files#uploading_files)",
14
+ version: "0.2.0",
12
15
  annotations: {
13
16
  destructiveHint: false,
14
17
  openWorldHint: true,
@@ -29,9 +32,16 @@ export default {
29
32
  slack,
30
33
  "content",
31
34
  ],
35
+ description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`). If the URL is a signed/presigned link (e.g. from Google Cloud Storage or S3), also set `File Name` — see this action's description for why.",
36
+ },
37
+ filename: {
38
+ type: "string",
39
+ label: "File Name",
40
+ description: "The name to give the uploaded file, including its extension (e.g. `myFile.pdf`). Defaults to the source file's name. Set this when `Content` is a signed/presigned URL whose path doesn't end in the real file name — otherwise Slack stores the file under whatever opaque ID or token is in the URL and can't tell its type.",
41
+ optional: true,
32
42
  },
33
43
  initialComment: {
34
- description: "Will be added as an initial comment before the image",
44
+ description: "Message text to post alongside the file, introducing or describing it (e.g. `Weekly sales report attached.`).",
35
45
  propDefinition: [
36
46
  slack,
37
47
  "initial_comment",
@@ -54,7 +64,7 @@ export default {
54
64
  stream, metadata,
55
65
  } = await getFileStreamAndMetadata(this.content);
56
66
 
57
- const filename = this.content.split("/").pop();
67
+ const filename = this.filename || metadata.name;
58
68
 
59
69
  // Get an upload URL from Slack
60
70
  const getUploadUrlResponse = await this.slack.getUploadUrl({
@@ -103,7 +113,7 @@ export default {
103
113
  throw new Error(`Error completing upload: ${JSON.stringify(completeUploadResponse)}`);
104
114
  }
105
115
 
106
- $.export("$summary", "Successfully uploaded file");
116
+ $.export("$summary", `Successfully uploaded "${filename}" to ${this.conversation}`);
107
117
  return completeUploadResponse;
108
118
  },
109
119
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/slack_v2",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Pipedream Slack_v2 Components",
5
5
  "main": "slack_v2.app.mjs",
6
6
  "keywords": [