slackapi / node-slack-sdk

Slack Developer Kit for Node.js
https://slack.dev/node-slack-sdk
MIT License
3.26k stars 656 forks source link

web-api(docs): prefer filesUploadV2 for uploading files #1802

Closed zimeg closed 1 month ago

zimeg commented 1 month ago

Summary

This PR makes a few changes to the docs around file uploading to suggest using the filesUploadV2 method first and sharing migration steps later. Response details are also added and a header fix is made for the sidebar navigation.

Preview

I had some trouble running a local copy of the docs... Will look into this later but the supported ruby and gem versions for github pages aren't such well supported versions.

I'd recommend building the site if you can, but reading markdown is always an option! If you can build on your machine, a check of the sidebar would be super appreciated too.

Current: https://slack.dev/node-slack-sdk/web-api#upload-a-file

Testing

The code snippets in the docs can be useful for testing, but your own token would be needed.

Notes

Found some confusion in the result.files of the response from filesUploadV2. Will write more in an issue, but these docs are purposely vague on the exact response shape.

Requirements

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.63%. Comparing base (1938408) to head (8358a43).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1802 +/- ## ======================================= Coverage 81.63% 81.63% ======================================= Files 35 35 Lines 7668 7668 Branches 316 316 ======================================= Hits 6260 6260 Misses 1396 1396 Partials 12 12 ``` | [Flag](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | Coverage Δ | | |---|---|---| | [cli-hooks](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `95.07% <ø> (ø)` | | | [cli-test](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `53.55% <ø> (ø)` | | | [oauth](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `76.51% <ø> (ø)` | | | [socket-mode](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `59.41% <ø> (ø)` | | | [web-api](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `96.48% <ø> (ø)` | | | [webhook](https://app.codecov.io/gh/slackapi/node-slack-sdk/pull/1802/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi) | `95.20% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=slackapi#carryforward-flags-in-the-pull-request-comment) to find out more.
filmaj commented 1 month ago

BTW I can build the docs just fine on my machine - hit me up if you need help with getting that set up.

zimeg commented 1 month ago

@filmaj and thank you for reviewing! I added all of the additional detail from your suggestions - this is super helpful context to share! 🙌 Going to go ahead with merging! 🚀

I'm also planning to spend a few quality hours with the dotfiles this weekend, but will let ya know once I realize the troubles I've gotten myself into are too much to fix 😳 I have a not-so-easy fix planned for pages and dependencies...