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

feat: add list() method #82

Merged
merged 6 commits into from
Oct 26, 2023
Merged

feat: add list() method #82

merged 6 commits into from
Oct 26, 2023

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Oct 24, 2023

Which problem is this pull request solving?

Adds a list() endpoint. Check the modified README for more information about the API.

Closes https://github.com/netlify/pillar-runtime/issues/753.

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant
@eduardoboucas eduardoboucas requested a review from a team as a code owner October 24, 2023 15:54
@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 6788743
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/653a37e57cc1190008b0fa2f
😎 Deploy Preview https://deploy-preview-82--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Oct 24, 2023

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant
README.md Outdated
await store.delete('my-key')
```

### `list(options?: { cursor?: string, paginate?: boolean. prefix?: string }): Promise<{ blobs: BlobResult[] }>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing directories

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Done in 3c662f2.

Copy link
Contributor

Choose a reason for hiding this comment

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

It needs the option as well as the response

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 6788743.

README.md Outdated
Comment on lines 287 to 288
Optionally, you can choose to group blobs together under a common prefix and then browse them hierarchically when
listing a store. To do this, use the `/` character in your keys to group them into multiple levels.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be explicit in saying that this is like traversing a directory structure, as we are calling it directories

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 6788743. Let me know if it's clearer.

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant
README.md Outdated
To drill down into a directory and get a list of its items, you can use the directory name as the `prefix` value.

```javascript
const { blobs, directories } = await store.list({ directories: true, prefix: 'mice/' })
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a note calling out the fact that they need to always include the trailing slash

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 6788743.

Verified

This commit was signed with the committer’s verified signature.
BurntSushi Andrew Gallant
@eduardoboucas eduardoboucas merged commit 00db5ff into main Oct 26, 2023
@eduardoboucas eduardoboucas deleted the feat/list-endpoint branch October 26, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants