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

Add a helper method for generating a PaginationCursor #513

Merged
merged 11 commits into from
May 8, 2024

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented May 3, 2024

Currently the only way to get a pagination cursor is from a query response that has more than the number of records you've queried for.

However there could be some cases where the user wants to keep track of the last record they have retrieved and retrieve subsequent records.

Added some helper methods to agent in order to build/return the data needed, and a convenience method to the Record class in api that utilizes them.

Copy link

changeset-bot bot commented May 3, 2024

🦋 Changeset detected

Latest commit: 2ff15c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@web5/identity-agent Patch
@web5/proxy-agent Patch
@web5/user-agent Patch
@web5/agent Patch
@web5/api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented May 3, 2024

TBDocs Report

✅ No errors or warnings

@web5/api

  • Project entry file: packages/api/src/index.ts

@web5/crypto

  • Project entry file: packages/crypto/src/index.ts

@web5/crypto-aws-kms

  • Project entry file: packages/crypto-aws-kms/src/index.ts

@web5/dids

  • Project entry file: packages/dids/src/index.ts

@web5/credentials

  • Project entry file: packages/credentials/src/index.ts

TBDocs Report Updated at 2024-05-08T01:29:54Z 2ff15c6

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.06%. Comparing base (ca7f53b) to head (2ff15c6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
+ Coverage   91.04%   91.06%   +0.01%     
==========================================
  Files         116      116              
  Lines       29562    29603      +41     
  Branches     2177     2185       +8     
==========================================
+ Hits        26915    26958      +43     
+ Misses       2612     2610       -2     
  Partials       35       35              
Components Coverage Δ
agent 80.70% <100.00%> (+0.07%) ⬆️
api 97.93% <100.00%> (+0.01%) ⬆️
common 98.68% <ø> (ø)
credentials 95.26% <ø> (ø)
crypto 93.81% <ø> (ø)
dids 97.69% <ø> (ø)
identity-agent 96.70% <ø> (ø)
crypto-aws-kms 100.00% <ø> (ø)
proxy-agent 96.70% <ø> (ø)
user-agent 96.70% <ø> (ø)

@LiranCohen LiranCohen marked this pull request as ready for review May 3, 2024 22:15
@LiranCohen LiranCohen requested a review from diehuxx as a code owner May 7, 2024 14:36
packages/agent/src/utils.ts Show resolved Hide resolved
packages/api/src/record.ts Show resolved Hide resolved
shamilovtim
shamilovtim previously approved these changes May 7, 2024
@LiranCohen LiranCohen force-pushed the lirancohen/message-cid-pagination-tools branch from 60ef86a to c367517 Compare May 8, 2024 01:19
@LiranCohen LiranCohen merged commit 82fe049 into main May 8, 2024
11 checks passed
@LiranCohen LiranCohen deleted the lirancohen/message-cid-pagination-tools branch May 8, 2024 03:57
@github-actions github-actions bot mentioned this pull request May 8, 2024
nitro-neal pushed a commit that referenced this pull request May 13, 2024
Currently the only way to get a pagination cursor is from a query response that has more than the number of records you've queried for.

However there could be some cases where the user wants to keep track of the last record they have retrieved and retrieve subsequent records.

Added some helper methods to `agent` in order to build/return the data needed, and a convenience method to the `Record` class in `api` that utilizes them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants