-
Notifications
You must be signed in to change notification settings - Fork 679
web-api(fix):Update SearchMessagesArguments to support cursor pagination #2361
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2361 +/- ##
=======================================
Coverage 93.01% 93.01%
=======================================
Files 40 40
Lines 11111 11111
Branches 713 713
=======================================
Hits 10335 10335
Misses 764 764
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
52ed286 to
7350c81
Compare
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vegeris LGTM! This seems good to merge when the time is right but it might be nice to add a type test for this before? 🧪
node-slack-sdk/packages/web-api/test/types/methods/search.test-d.ts
Lines 28 to 37 in 893a37d
| // search.messages | |
| // -- sad path | |
| expectError(web.search.messages()); // lacking argument | |
| expectError(web.search.messages({})); // empty argument | |
| // -- happy path | |
| expectAssignable<Parameters<typeof web.search.messages>>([ | |
| { | |
| query: '1234', // must specify query | |
| }, | |
| ]); |
I left a few other comments too!
| * @description Paginate through collections of data by setting the `cursor` parameter to `*` for the first "page" | ||
| * or a `next_cursor` attribute returned by a previous request's `response_metadata`. | ||
| * Use the `count` parameter to set the number of items to return per page rather than `limit`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧮 praise: Thank you for including this.
| extends TokenOverridable, | ||
| TraditionalPagingEnabled, | ||
| Searchable, | ||
| SearchMessagesCursorPagination {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👁️🗨️ suggestion(non-blocking): I don't believe a similar cursor is used elsewhere? Might be nice to inline this IMO but no blocker!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how Biome wants it to look 😛
Yeah, I think an API-specific interface makes sense here. The same count param from the TraditionalPagingEnabled interface is reused for cursor pagination
f8936ad to
db6bdbb
Compare
Summary
Requirements ()