-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: add support for list pagination in list capability invocations #184
feat: add support for list pagination in list capability invocations #184
Conversation
Deploying with Cloudflare Pages
|
8291f4c
to
6fa28b8
Compare
@@ -328,6 +328,7 @@ describe('upload capabilities', function () { | |||
audience: w3, | |||
with: account.did(), | |||
proofs: [await any], | |||
nb: {}, |
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.
Types require empty object when all nb properties are optional. need to look
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 should not happen theres a lot of infer types in ucanto to mitigate this. Did you open an issue in ucanto ?
55d7949
to
57d5cc5
Compare
@@ -130,6 +130,18 @@ export const list = base.derive({ | |||
* be stored. | |||
*/ | |||
with: URI.match({ protocol: 'did:' }), | |||
nb: { | |||
/** | |||
* Item where a previous list operation stopped, inclusive of the previous |
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 sounds specific to the particular implementation backing this. Maybe this could be more generic?
3b953fe
to
df2c7a9
Compare
BREAKING CHANGE: store/list and upload/list types now require nb object with optional properties
Co-authored-by: Alan Shaw <[email protected]>
9615cde
to
28e6761
Compare
28e6761
to
2b20085
Compare
* 'main' of https://github.com/web3-storage/w3-protocol: feat: add support for list pagination in list capability invocations (#184)
🤖 I have created a release *beep* *boop* --- ## [6.0.0](access-v5.0.2...access-v6.0.0) (2022-11-22) ### ⚠ BREAKING CHANGES * **access-client:** bump to major * store/list and upload/list types now require nb object with optional properties ### Features * [#153](#153) ([#177](#177)) ([d6d448c](d6d448c)) * **access-client:** bump to major ([4d5899f](4d5899f)) * account recover with email ([#149](#149)) ([6c659ba](6c659ba)) * add support for list pagination in list capability invocations ([#184](#184)) ([ced23db](ced23db)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…184) Adds support for list pagination in `store/list` and `upload/list`. Relevant notes on decisions made: - unfortunately, Databases like DynamoDB does not support pagination by just giving `pageNumber` and `size`. Aiming to have something generic (that works in DynamoDB, but also other DBs), chosen approach is to rely on `cursor` and `size` . - at first, attempted to make `cursor` a Link property of the capability. And it worked well for `store/list`, but then I got to use cases (`upload/list` for instance) where it cannot be a link. This is because Upload Table primary key contains `${dataCid}#${carCid}` to be unique. So, in this case that is the cursor we need to have. There might be other kind of use cases, so having this as string is really the most flexible approach to support pagination. BREAKING CHANGE: store/list and upload/list types now require nb object with optional properties
* 'main' of https://github.com/web3-storage/w3-protocol: feat: add support for list pagination in list capability invocations (#184)
🤖 I have created a release *beep* *boop* --- ## [6.0.0](access-v5.0.2...access-v6.0.0) (2022-11-22) ### ⚠ BREAKING CHANGES * **access-client:** bump to major * store/list and upload/list types now require nb object with optional properties ### Features * [#153](#153) ([#177](#177)) ([7fbf2a1](7fbf2a1)) * **access-client:** bump to major ([7be598d](7be598d)) * account recover with email ([#149](#149)) ([91ad47d](91ad47d)) * add support for list pagination in list capability invocations ([#184](#184)) ([23206ad](23206ad)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [2.0.1](storacha/w3ui@vue-uploads-list-v2.0.0...vue-uploads-list-v2.0.1) (2022-12-15) ### Bug Fixes * update dependencies ([996871f](storacha/w3ui@996871f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [2.0.1](storacha/w3ui@vue-uploads-list-v2.0.0...vue-uploads-list-v2.0.1) (2022-12-15) ### Bug Fixes * update dependencies ([c4752b0](storacha/w3ui@c4752b0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Adds support for list pagination in
store/list
andupload/list
.Relevant notes on decisions made:
pageNumber
andsize
. Aiming to have something generic (that works in DynamoDB, but also other DBs), chosen approach is to rely oncursor
andsize
.cursor
a Link property of the capability. And it worked well forstore/list
, but then I got to use cases (upload/list
for instance) where it cannot be a link. This is because Upload Table primary key contains${dataCid}#${carCid}
to be unique. So, in this case that is the cursor we need to have. There might be other kind of use cases, so having this as string is really the most flexible approach to support pagination.Note:
BREAKING CHANGE: store/list and upload/list types now require nb object with optional properties