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(storage): list API to accept both prefix and path #13100

Merged

Conversation

Samaritan1011001
Copy link
Member

@Samaritan1011001 Samaritan1011001 commented Mar 9, 2024

Description of changes

List API will now accept either prefix or path as input. Depending on which is given, their respective types are suggested in the IDE and output has key or path respectively.
Some notes,

  • If prefix is given, options show the accessLevel, targetIdentityId (this is as is currently in V6)
  • if no input object is given or its empty, default guest prefix is assumed (this is as is currently in V6).
  • If path is given, options does not show accessLevel, targetIdentityId (gen2 feature)

Below table shows the different type changes in index.ts.

Note: None of the exposed type names have changed. Only the first two rows are the ones exposed via aws-amplify/storage.

file feature branch(gen2-storage) PR change
src/index.ts ListAllInput, ListPaginateInput,
ListAllOutput, ListPaginateOutput
No change
src/providers/s3/index.ts ListAllInput, ListPaginateInput,
ListAllOutput, ListPaginateOutput
No change
src/types/index.ts StorageListInput StorageListInputPrefix, StorageListInputPath
(options) src/providers/s3/types/index.ts ListAllOptions, ListPaginateOptions ListAllOptionsPrefix, ListPaginateOptionsPrefix,
ListAllOptionsPath, ListPaginateOptionsPath
(inputs) src/providers/s3/types/index.ts ListAllInput, ListPaginateInput ListAllInput, ListPaginateInput,
ListAllInputPath, ListPaginateInputPath,
ListAllInputPrefix,ListPaginateInputPrefix
(outputs) src/providers/s3/types/index.ts ListOutputItem, ListAllOutput, ListPaginateOutput ListOutputItemKey, ListOutputItemPath
ListAllOutput, ListPaginateOutput
ListAllOutputPrefix, ListAllOutputPath
ListPaginateOutputPath, ListPaginateOutputPrefix

Issue #, if available

Description of how you validated changes

Linked to a sample app and could complete the list operation both ways

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Samaritan1011001 Samaritan1011001 requested review from a team as code owners March 9, 2024 01:57
packages/storage/src/index.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/types/options.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/types/inputs.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/types/outputs.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/apis/list.ts Outdated Show resolved Hide resolved
jimblanc
jimblanc previously approved these changes Mar 25, 2024
ashwinkumar6
ashwinkumar6 previously approved these changes Mar 26, 2024
ashika112
ashika112 previously approved these changes Mar 26, 2024
jimblanc
jimblanc previously approved these changes Mar 26, 2024
Copy link
Contributor

@jimblanc jimblanc left a comment

Choose a reason for hiding this comment

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

LGTM one small nit

packages/storage/src/errors/types/validation.ts Outdated Show resolved Hide resolved
@Samaritan1011001 Samaritan1011001 merged commit 872a817 into aws-amplify:gen2-storage Mar 26, 2024
28 checks passed
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.

5 participants