Skip to content

Commit a86bb52

Browse files
dbanksdesigncalebpollman
authored andcommitted
feat(storagemanager): add useAccelerateEndpoint (#5501)
1 parent 5b81f0e commit a86bb52

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.changeset/healthy-baboons-film.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@aws-amplify/ui-react-storage": minor
3+
---
4+
5+
feat(storagemanager): add useAccelerateEndpoint
6+
7+
```jsx
8+
<StorageManager
9+
acceptedFileTypes={['image/*']}
10+
path="public/"
11+
useAccelerateEndpoint
12+
/>
13+
```

docs/src/pages/[platform]/connected-components/storage/fileuploader/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export const FILE_UPLOADER = [
106106
description: 'Use the accelerated S3 endpoint to upload files.',
107107
type: 'boolean',
108108
},
109+
{
110+
name: `useAccelerateEndpoint?`,
111+
description: 'Use the accelerated S3 endpoint to upload files.',
112+
type: 'boolean',
113+
},
109114
{
110115
name: `components?.Container?`,
111116
description: 'The container the FileUploader is wrapped in.',

packages/react-storage/src/components/StorageManager/utils/getInput.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface GetInputParams {
1616
onProgress: NonNullable<UploadDataWithPathInput['options']>['onProgress'];
1717
path: string | PathCallback | undefined;
1818
processFile: ProcessFile | undefined;
19+
useAccelerateEndpoint?: boolean;
1920
}
2021

2122
export const getInput = ({
@@ -26,6 +27,7 @@ export const getInput = ({
2627
onProgress,
2728
path,
2829
processFile,
30+
useAccelerateEndpoint,
2931
}: GetInputParams) => {
3032
return async (): Promise<PathInput | UploadDataInput> => {
3133
const hasCallbackPath = isTypedFunction<PathCallback>(path);
@@ -42,7 +44,7 @@ export const getInput = ({
4244
const contentType = file.type || 'binary/octet-stream';
4345

4446
// IMPORTANT: always pass `...rest` here for backwards compatibility
45-
const options = { contentType, onProgress, ...rest };
47+
const options = { contentType, onProgress, useAccelerateEndpoint, ...rest };
4648

4749
let inputResult: PathInput | UploadDataInput;
4850
if (hasKeyInput) {

0 commit comments

Comments
 (0)