Impl uploadv2
Summary
- Implement the fileUploadV2 method, which allows for the uploading of multiple files.
- Implement the files.getUploadURLExternal method.
- Implement the files.completeUploadExternal method.
testing
If you want to test with the actual Slack API, you could run a script like this.
// run your local machine
import { SlackAPI } from "./../deno-slack-api/src/mod.ts";
const token =
"your-token-here";
// initialize Slack API client
const slack = SlackAPI(token);
console.log(
await slack.fileUploadV2({
file_uploads: [
{
file: "sample",
length: "6",
filename: "sample.txt",
},
],
}),
);
Special notes
Based on this issue, I implemented it.
Requirements
- [x] I've read and understood the Contributing Guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've ran
deno task testafter making the changes.
Thanks for the contribution! Unfortunately we can't verify the commit author(s): kawasaki.taiga <k***@r***.n***.jp>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
7476afc) 100.00% compared to head (b735fec) 100.00%.
:exclamation: Current head b735fec differs from pull request most recent head be9ee11. Consider uploading reports for the commit be9ee11 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #90 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 36 36
Lines 1091 1155 +64
Branches 13 22 +9
=========================================
+ Hits 1091 1155 +64
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@WilliamBergamin Thank you for your review! :smile: ⭐
My implementation, while referencing the node-slack-api, avoids implementing fields that will not be supported in the future and includes fields that will become mandatory as mandatory fields.
Since node-slack-api has been around for a long time, there's a benefit to aligning the fields used in fileUploadV2 with those used in files.upload. However, in deno-slack-api, files.upload is currently not usable, so I thought there was no need to implement fields like content or filetype.
Is this still being worked on?
Closing in favour of #111; will continue building upon this PR in there so that @taiga533's commits will be honoured and used 🙇