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): add path support to copy API #13104

Merged
merged 8 commits into from
Mar 20, 2024

Conversation

ashwinkumar6
Copy link
Member

@ashwinkumar6 ashwinkumar6 commented Mar 11, 2024

Description of changes

Update copy API to support path

Description of how you valdated changes

  • Tested all copy API's key and path combinations on sample app
  • Tested on gen1, gen2 backend

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.

@ashwinkumar6 ashwinkumar6 changed the title Feat: DownloadData refactor (#13073) feat(storage): add path supp to copy API Mar 11, 2024
@ashwinkumar6 ashwinkumar6 changed the title feat(storage): add path supp to copy API feat(storage): add path support to copy API Mar 11, 2024
@ashwinkumar6 ashwinkumar6 force-pushed the gen2-storage-copy branch 2 times, most recently from 3371ea9 to 511e83c Compare March 12, 2024 23:07
@ashwinkumar6 ashwinkumar6 marked this pull request as ready for review March 12, 2024 23:09
@ashwinkumar6 ashwinkumar6 requested a review from a team as a code owner March 12, 2024 23:09
packages/storage/src/providers/s3/apis/copy.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/apis/copy.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/types/inputs.ts Outdated Show resolved Hide resolved
packages/storage/src/types/inputs.ts Outdated Show resolved Hide resolved
packages/storage/src/types/inputs.ts Show resolved Hide resolved
packages/storage/src/providers/s3/apis/server/copy.ts Outdated Show resolved Hide resolved
packages/storage/src/providers/s3/apis/internal/copy.ts Outdated Show resolved Hide resolved
): Promise<CopyOutput> => {
): Promise<CopyOutput> =>
isCopyInputWithPath(input)
? copyWithPath(amplify, input)
Copy link
Member

Choose a reason for hiding this comment

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

why not just directly call isInputWithPath?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could do something like isInputWithPath(input.source) but we need to narrow the input types because copyWithPath expects CopyInputPath and copyWithKey expects CopyInputKey

Copy link
Member

Choose a reason for hiding this comment

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

I am thinking if we can use it and just cast as needed. i am wondering if there is any benefit to this approach over that

@ashwinkumar6 ashwinkumar6 requested a review from ashika112 March 15, 2024 23:02
@ashwinkumar6 ashwinkumar6 requested a review from cshfang March 18, 2024 23:21
cshfang
cshfang previously approved these changes Mar 19, 2024
@ashwinkumar6 ashwinkumar6 requested a review from a team as a code owner March 20, 2024 20:44
Copy link
Member

@ashika112 ashika112 left a comment

Choose a reason for hiding this comment

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

Looking great :shipit: Great work 🎉

@ashwinkumar6 ashwinkumar6 merged commit 3e6528d into aws-amplify:gen2-storage Mar 20, 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.

4 participants