deno-slack-api icon indicating copy to clipboard operation
deno-slack-api copied to clipboard

Impl uploadv2

Open taiga533 opened this issue 2 years ago • 3 comments

Summary

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 test after making the changes.

taiga533 avatar Dec 15 '23 12:12 taiga533

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.

salesforce-cla[bot] avatar Dec 15 '23 12:12 salesforce-cla[bot]

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.

codecov[bot] avatar Dec 15 '23 19:12 codecov[bot]

@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.

taiga533 avatar Dec 18 '23 14:12 taiga533

Is this still being worked on?

aksel avatar Aug 22 '24 14:08 aksel

Closing in favour of #111; will continue building upon this PR in there so that @taiga533's commits will be honoured and used 🙇

filmaj avatar Aug 27 '24 21:08 filmaj