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 new internal downloadData api #13887

Open
wants to merge 4 commits into
base: storage-browser/integrity
Choose a base branch
from

Conversation

ashwinkumar6
Copy link
Member

@ashwinkumar6 ashwinkumar6 commented Oct 4, 2024

Description of changes

  • moves existing downloadData implementation from src/providers/s3/apis/downloadData.ts to src/providers/s3/apis/internal/downloadData.ts
    • contains no public interface changes for standard downloadData API
  • Adds new internals/ API at src/internals/apis/downloadData.ts

Description of how you validated changes

  • integ tests locally
  • testApp locally

Checklist

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

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

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

// TODO: Remove this interface when we move to public advanced APIs.
import { DownloadDataInput as DownloadDataWithPathInputWithAdvancedOptions } from '../../../../internals/types/inputs';

export const downloadData = (
Copy link
Member Author

Choose a reason for hiding this comment

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

other src/providers/s3/apis/internal/<api> take Amplify singleton as their first input param. We haven't added it here because downloadData isn't supported in SSR and hence isn't required atm

@@ -0,0 +1,90 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Member Author

Choose a reason for hiding this comment

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

existing code moved as is with the addition of DownloadDataWithPathInputWithAdvancedOptions type in input.

* @internal
*/
export const downloadData = (input: DownloadDataInput): DownloadDataOutput =>
downloadDataInternal({
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 pass down the whole input?

Copy link
Member

Choose a reason for hiding this comment

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

There was a discussion this is better ATM

packages/storage/src/internals/apis/downloadData.ts Outdated Show resolved Hide resolved
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.

3 participants