Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web-api(fix): allow typed token overrides in supported methods #1872

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

zimeg
Copy link
Member

@zimeg zimeg commented Aug 14, 2024

Summary

Fixes #1871 and allows token overrides with a few other methods to match the documented arguments:

  • admins.apps.clearResolution
  • admin.apps.uninstall
  • apps.uninstall

Reviewers

Confirm this builds without errors in a TypeScript application:

client.apps.uninstall({
  token: 'xoxb-example',
  client_id: 'example',
  client_secret: '123',
});
$ npx tsc

Notes

⚠️ Please let me know if these weren't included on purpose! It raised some suspicion that both uninstall methods didn't include token but I believe it's alright to include as an argument.

Requirements

Fixes slackapi#1871 with a few other methods:

- admins.apps.clearResolution
- admin.apps.uninstall
- apps.uninstall
@zimeg zimeg added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch area:typescript issues that specifically impact using the package from typescript projects pkg:web-api applies to `@slack/web-api` labels Aug 14, 2024
@zimeg zimeg added this to the [email protected] milestone Aug 14, 2024
@zimeg zimeg requested a review from filmaj August 14, 2024 17:41
@zimeg zimeg self-assigned this Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.85%. Comparing base (3a7d3b5) to head (ef12bb1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1872   +/-   ##
=======================================
  Coverage   89.85%   89.85%           
=======================================
  Files          34       34           
  Lines        7648     7648           
  Branches      374      374           
=======================================
  Hits         6872     6872           
  Misses        764      764           
  Partials       12       12           
Flag Coverage Δ
cli-hooks 94.94% <ø> (ø)
cli-test 94.77% <ø> (ø)
oauth 76.53% <ø> (ø)
socket-mode 59.59% <ø> (ø)
web-api 96.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent a regression here, can we add a type test for this?

@zimeg
Copy link
Member Author

zimeg commented Aug 14, 2024

@filmaj always a good call! Added! 🧪 🔍

@zimeg zimeg requested a review from filmaj August 14, 2024 18:26
Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👨‍🍳 💋 much obliged 🙇

@filmaj filmaj merged commit 5fbb3bd into slackapi:main Aug 14, 2024
30 checks passed
@zimeg zimeg deleted the zimeg-webapi-fix-types-token-override branch August 14, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typescript issues that specifically impact using the package from typescript projects bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` semver:patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration to web‐api v7 - Unexpected token argument in apps.uninstall method
2 participants