web3.storage
web3.storage copied to clipboard
Add user/uploads API pagination and sorting to the js client
Related to: https://app.zenhub.com/workspaces/web3storage-product-6106d25b58fccc00105aedcb/issues/web3-storage/web3.storage/1362
Once PR 1501 is merged the GET user/uploads
endpoint will then support additional functionality.
This additional functionality should be documented and added to the JS client. Acceptance Criteria:
As a user, I can
- [ ] Request pages of uploads
- [ ] Sort my uploads by date and name, ascending and descending
- [ ] Filter my results before of after a given date
Pagination Can be achieved by supplying the endpoint with
-
size: number
Number of results returned by a page (default25
) -
page: number
The page number (default1
)
Sorting Uploads can now be sorted on the API with
-
sortBy: 'Name' | 'Date'
The table to sort by name being the file name, date being the date the upload was created - theinserted_at
column. (default'Name'
). -
sortOrder
'asc' | 'desc': Orders results by ascending or descending (default
'desc'`)
Filtering (optional)
Existing filtering functionality exists with before
, but now we can also filter with after
-
before: ISO 8601 string
: A date to filter all results prior to. -
after: ISO 8601 string
: A date to filter all results post to.
Just confirming - this is net of #1408 (which looks like it's just for the API)? Did the behavior of the JS client change after merging #1408? Just looking to see how to prioritize this (though this issue seems like it could be a pretty quick win)
Ooh, and for users using the w3
CLI, do you know if updating the client will automatically get it into the CLI, or do we need to do this in addition? (see: #1610) cc @mbommerez
We need to do an investigation into this, what it currrently does.
Also, since we migrate to w3up and its new CLI, not sure how much time we should spend on this?
Yes, let's say we're not doing this.
Okay thanks, closing this out.