@aws-amplify/storage 6.0.17-unstable.e316a2e.0 → 6.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/providers/s3/apis/internal/getProperties.js +1 -1
- package/dist/cjs/providers/s3/apis/internal/getProperties.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/getUrl.js +6 -6
- package/dist/cjs/providers/s3/apis/internal/getUrl.js.map +1 -1
- package/dist/cjs/providers/s3/apis/internal/list.js +2 -2
- package/dist/cjs/providers/s3/apis/internal/list.js.map +1 -1
- package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js +1 -1
- package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js.map +1 -1
- package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js +25 -25
- package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/base.js +1 -1
- package/dist/cjs/providers/s3/utils/client/base.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/contentSha256middleware.js +3 -3
- package/dist/cjs/providers/s3/utils/client/runtime/contentSha256middleware.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/fetch.js +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/fetch.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/xhr.js +4 -4
- package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/xhr.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xhrTransferHandler.js +4 -4
- package/dist/cjs/providers/s3/utils/client/runtime/xhrTransferHandler.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/dom.js +4 -7
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/dom.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/pureJs.js +6 -5
- package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/pureJs.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js.map +1 -1
- package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js +2 -2
- package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js.map +1 -1
- package/dist/cjs/providers/s3/utils/md5.js +8 -3
- package/dist/cjs/providers/s3/utils/md5.js.map +1 -1
- package/dist/cjs/providers/s3/utils/md5.native.js +6 -2
- package/dist/cjs/providers/s3/utils/md5.native.js.map +1 -1
- package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js +1 -1
- package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js.map +1 -1
- package/dist/cjs/providers/s3/utils/transferTask.js +10 -4
- package/dist/cjs/providers/s3/utils/transferTask.js.map +1 -1
- package/dist/esm/providers/s3/apis/getProperties.d.ts +1 -1
- package/dist/esm/providers/s3/apis/internal/getProperties.mjs +1 -1
- package/dist/esm/providers/s3/apis/internal/getProperties.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/getUrl.mjs +3 -3
- package/dist/esm/providers/s3/apis/internal/getUrl.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/internal/list.d.ts +1 -1
- package/dist/esm/providers/s3/apis/internal/list.mjs +2 -2
- package/dist/esm/providers/s3/apis/internal/list.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/list.d.ts +3 -3
- package/dist/esm/providers/s3/apis/server/list.d.ts +3 -3
- package/dist/esm/providers/s3/apis/uploadData/multipart/getDataChunker.d.ts +2 -2
- package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.d.ts +4 -4
- package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs +1 -1
- package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/uploadData/multipart/progressTracker.d.ts +3 -3
- package/dist/esm/providers/s3/apis/uploadData/multipart/uploadCache.d.ts +6 -6
- package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs +25 -25
- package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs.map +1 -1
- package/dist/esm/providers/s3/apis/uploadData/multipart/uploadPartExecutor.d.ts +5 -5
- package/dist/esm/providers/s3/types/inputs.d.ts +2 -2
- package/dist/esm/providers/s3/types/options.d.ts +11 -11
- package/dist/esm/providers/s3/types/outputs.d.ts +1 -1
- package/dist/esm/providers/s3/utils/client/abortMultipartUpload.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/base.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/base.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/completeMultipartUpload.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/copyObject.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/copyObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/createMultipartUpload.d.ts +3 -3
- package/dist/esm/providers/s3/utils/client/createMultipartUpload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/deleteObject.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/getObject.d.ts +3 -3
- package/dist/esm/providers/s3/utils/client/getObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/headObject.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/listObjectsV2.d.ts +3 -3
- package/dist/esm/providers/s3/utils/client/listParts.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/listParts.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/putObject.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/putObject.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs +6 -6
- package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs +4 -4
- package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs +4 -7
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs +6 -5
- package/dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/types.d.ts +11 -22
- package/dist/esm/providers/s3/utils/client/uploadPart.d.ts +2 -2
- package/dist/esm/providers/s3/utils/client/uploadPart.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.d.ts +1 -3
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs +1 -1
- package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs +2 -2
- package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/client/utils/serializeHelpers.d.ts +1 -1
- package/dist/esm/providers/s3/utils/md5.mjs +8 -3
- package/dist/esm/providers/s3/utils/md5.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/md5.native.mjs +6 -2
- package/dist/esm/providers/s3/utils/md5.native.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.d.ts +4 -4
- package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs +1 -1
- package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs.map +1 -1
- package/dist/esm/providers/s3/utils/transferTask.d.ts +10 -10
- package/dist/esm/providers/s3/utils/transferTask.mjs +10 -4
- package/dist/esm/providers/s3/utils/transferTask.mjs.map +1 -1
- package/dist/esm/types/common.d.ts +7 -7
- package/dist/esm/types/inputs.d.ts +9 -9
- package/dist/esm/types/options.d.ts +2 -2
- package/dist/esm/types/outputs.d.ts +6 -6
- package/dist/esm/utils/resolvePrefix.d.ts +2 -2
- package/package.json +107 -106
- package/src/errors/CanceledError.ts +1 -0
- package/src/errors/utils/assertValidationError.ts +1 -1
- package/src/providers/s3/apis/copy.ts +3 -1
- package/src/providers/s3/apis/downloadData.ts +5 -3
- package/src/providers/s3/apis/getProperties.ts +5 -2
- package/src/providers/s3/apis/getUrl.ts +3 -0
- package/src/providers/s3/apis/internal/copy.ts +5 -4
- package/src/providers/s3/apis/internal/getProperties.ts +8 -6
- package/src/providers/s3/apis/internal/getUrl.ts +11 -9
- package/src/providers/s3/apis/internal/list.ts +13 -10
- package/src/providers/s3/apis/internal/remove.ts +5 -3
- package/src/providers/s3/apis/list.ts +8 -4
- package/src/providers/s3/apis/remove.ts +4 -1
- package/src/providers/s3/apis/server/copy.ts +2 -1
- package/src/providers/s3/apis/server/getProperties.ts +3 -2
- package/src/providers/s3/apis/server/getUrl.ts +2 -1
- package/src/providers/s3/apis/server/list.ts +10 -7
- package/src/providers/s3/apis/server/remove.ts +2 -1
- package/src/providers/s3/apis/uploadData/byteLength.ts +1 -0
- package/src/providers/s3/apis/uploadData/index.ts +5 -2
- package/src/providers/s3/apis/uploadData/multipart/calculatePartSize.ts +1 -0
- package/src/providers/s3/apis/uploadData/multipart/getDataChunker.ts +6 -4
- package/src/providers/s3/apis/uploadData/multipart/initialUpload.ts +12 -9
- package/src/providers/s3/apis/uploadData/multipart/progressTracker.ts +5 -4
- package/src/providers/s3/apis/uploadData/multipart/uploadCache.ts +15 -12
- package/src/providers/s3/apis/uploadData/multipart/uploadHandlers.ts +42 -36
- package/src/providers/s3/apis/uploadData/multipart/uploadPartExecutor.ts +7 -6
- package/src/providers/s3/apis/uploadData/putObjectJob.ts +2 -2
- package/src/providers/s3/types/inputs.ts +4 -4
- package/src/providers/s3/types/options.ts +11 -11
- package/src/providers/s3/types/outputs.ts +1 -1
- package/src/providers/s3/utils/client/abortMultipartUpload.ts +5 -4
- package/src/providers/s3/utils/client/base.ts +8 -6
- package/src/providers/s3/utils/client/completeMultipartUpload.ts +14 -6
- package/src/providers/s3/utils/client/copyObject.ts +7 -4
- package/src/providers/s3/utils/client/createMultipartUpload.ts +7 -5
- package/src/providers/s3/utils/client/deleteObject.ts +6 -5
- package/src/providers/s3/utils/client/getObject.ts +14 -12
- package/src/providers/s3/utils/client/headObject.ts +6 -5
- package/src/providers/s3/utils/client/listObjectsV2.ts +6 -3
- package/src/providers/s3/utils/client/listParts.ts +9 -6
- package/src/providers/s3/utils/client/putObject.ts +6 -5
- package/src/providers/s3/utils/client/runtime/base64/index.browser.ts +2 -1
- package/src/providers/s3/utils/client/runtime/base64/index.native.ts +1 -1
- package/src/providers/s3/utils/client/runtime/contentSha256middleware.ts +6 -4
- package/src/providers/s3/utils/client/runtime/s3TransferHandler/fetch.ts +7 -5
- package/src/providers/s3/utils/client/runtime/s3TransferHandler/xhr.ts +11 -11
- package/src/providers/s3/utils/client/runtime/xhrTransferHandler.ts +21 -14
- package/src/providers/s3/utils/client/runtime/xmlParser/dom.ts +6 -7
- package/src/providers/s3/utils/client/runtime/xmlParser/pureJs.ts +10 -5
- package/src/providers/s3/utils/client/types.ts +12 -14
- package/src/providers/s3/utils/client/uploadPart.ts +6 -5
- package/src/providers/s3/utils/client/utils/deserializeHelpers.ts +13 -8
- package/src/providers/s3/utils/client/utils/parsePayload.ts +6 -4
- package/src/providers/s3/utils/client/utils/serializeHelpers.ts +8 -5
- package/src/providers/s3/utils/md5.native.ts +9 -3
- package/src/providers/s3/utils/md5.ts +12 -4
- package/src/providers/s3/utils/resolveS3ConfigAndInput.ts +10 -8
- package/src/providers/s3/utils/transferTask.ts +26 -14
- package/src/providers/s3/utils/userAgent.ts +1 -1
- package/src/types/common.ts +7 -7
- package/src/types/inputs.ts +11 -11
- package/src/types/options.ts +2 -2
- package/src/types/outputs.ts +6 -6
- package/src/utils/resolvePrefix.ts +7 -4
package/package.json
CHANGED
|
@@ -1,108 +1,109 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
2
|
+
"name": "@aws-amplify/storage",
|
|
3
|
+
"version": "6.0.17",
|
|
4
|
+
"description": "Storage category of aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"react-native": {
|
|
8
|
+
"./dist/cjs/index": "./src/index.ts",
|
|
9
|
+
"fast-xml-parser": "fast-xml-parser",
|
|
10
|
+
"buffer": "buffer"
|
|
11
|
+
},
|
|
12
|
+
"typings": "./dist/esm/index.d.ts",
|
|
13
|
+
"browser": {
|
|
14
|
+
"./dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs": "./dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs",
|
|
15
|
+
"./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs": "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs",
|
|
16
|
+
"./dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs": "./dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs",
|
|
17
|
+
"fast-xml-parser": false,
|
|
18
|
+
"buffer": false
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
|
|
26
|
+
"build-with-test": "npm test && npm run build",
|
|
27
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
28
|
+
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
29
|
+
"build:watch": "npm run build:esm-cjs -- --watch",
|
|
30
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
31
|
+
"clean": "npm run clean:size && rimraf lib-esm lib dist",
|
|
32
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
33
|
+
"format": "echo \"Not implemented\"",
|
|
34
|
+
"lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
|
|
35
|
+
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
36
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
|
|
37
|
+
},
|
|
38
|
+
"typesVersions": {
|
|
39
|
+
">=4.2": {
|
|
40
|
+
"s3": [
|
|
41
|
+
"./dist/esm/providers/s3/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"server": [
|
|
44
|
+
"./dist/esm/server.d.ts"
|
|
45
|
+
],
|
|
46
|
+
"s3/server": [
|
|
47
|
+
"./dist/esm/providers/s3/server.d.ts"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
54
|
+
},
|
|
55
|
+
"author": "Amazon Web Services",
|
|
56
|
+
"license": "Apache-2.0",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
61
|
+
"files": [
|
|
62
|
+
"dist/cjs",
|
|
63
|
+
"dist/esm",
|
|
64
|
+
"src",
|
|
65
|
+
"server",
|
|
66
|
+
"s3"
|
|
67
|
+
],
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@aws-sdk/types": "3.398.0",
|
|
70
|
+
"@smithy/md5-js": "2.0.7",
|
|
71
|
+
"buffer": "4.9.2",
|
|
72
|
+
"fast-xml-parser": "^4.2.5",
|
|
73
|
+
"tslib": "^2.5.0"
|
|
74
|
+
},
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"types": "./dist/esm/index.d.ts",
|
|
78
|
+
"import": "./dist/esm/index.mjs",
|
|
79
|
+
"require": "./dist/cjs/index.js",
|
|
80
|
+
"react-native": "./src/index.ts"
|
|
81
|
+
},
|
|
82
|
+
"./server": {
|
|
83
|
+
"types": "./dist/esm/server.d.ts",
|
|
84
|
+
"import": "./dist/esm/server.mjs",
|
|
85
|
+
"require": "./dist/cjs/server.js"
|
|
86
|
+
},
|
|
87
|
+
"./s3": {
|
|
88
|
+
"types": "./dist/esm/providers/s3/index.d.ts",
|
|
89
|
+
"import": "./dist/esm/providers/s3/index.mjs",
|
|
90
|
+
"require": "./dist/cjs/providers/s3/index.js",
|
|
91
|
+
"react-native": "./src/providers/s3/index.ts"
|
|
92
|
+
},
|
|
93
|
+
"./s3/server": {
|
|
94
|
+
"types": "./dist/esm/providers/s3/server.d.ts",
|
|
95
|
+
"import": "./dist/esm/providers/s3/server.mjs",
|
|
96
|
+
"require": "./dist/cjs/providers/s3/server.js"
|
|
97
|
+
},
|
|
98
|
+
"./package.json": "./package.json"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@aws-amplify/core": "^6.0.0"
|
|
102
|
+
},
|
|
103
|
+
"devDependencies": {
|
|
104
|
+
"@aws-amplify/core": "6.0.17",
|
|
105
|
+
"@aws-amplify/react-native": "1.0.17",
|
|
106
|
+
"typescript": "5.0.2"
|
|
107
|
+
},
|
|
108
|
+
"gitHead": "c54a19c8a654a47d559cb0fd41c74bd2c3eb79ca"
|
|
108
109
|
}
|
|
@@ -9,7 +9,7 @@ import { StorageError } from '../StorageError';
|
|
|
9
9
|
|
|
10
10
|
export function assertValidationError(
|
|
11
11
|
assertion: boolean,
|
|
12
|
-
name: StorageValidationErrorCode
|
|
12
|
+
name: StorageValidationErrorCode,
|
|
13
13
|
): asserts assertion {
|
|
14
14
|
const { message, recoverySuggestion } = validationErrorMap[name];
|
|
15
15
|
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Amplify } from '@aws-amplify/core';
|
|
5
|
+
|
|
5
6
|
import { CopyInput, CopyOutput, S3Exception } from '../types';
|
|
6
|
-
import { copy as copyInternal } from './internal/copy';
|
|
7
7
|
import { StorageValidationErrorCode } from '../../../errors/types/validation';
|
|
8
8
|
|
|
9
|
+
import { copy as copyInternal } from './internal/copy';
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* Copy an object from a source object to a new object within the same bucket. Can optionally copy files across
|
|
11
13
|
* different level or identityId (if source object's level is 'protected').
|
|
@@ -51,18 +51,19 @@ export const downloadData = (input: DownloadDataInput): DownloadDataOutput => {
|
|
|
51
51
|
abortController.abort(message);
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
|
+
|
|
54
55
|
return downloadTask;
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
const downloadDataJob =
|
|
58
59
|
(
|
|
59
60
|
{ options: downloadDataOptions, key }: DownloadDataInput,
|
|
60
|
-
abortSignal: AbortSignal
|
|
61
|
+
abortSignal: AbortSignal,
|
|
61
62
|
) =>
|
|
62
63
|
async () => {
|
|
63
64
|
const { bucket, keyPrefix, s3Config } = await resolveS3ConfigAndInput(
|
|
64
65
|
Amplify,
|
|
65
|
-
downloadDataOptions
|
|
66
|
+
downloadDataOptions,
|
|
66
67
|
);
|
|
67
68
|
const finalKey = keyPrefix + key;
|
|
68
69
|
|
|
@@ -89,8 +90,9 @@ const downloadDataJob =
|
|
|
89
90
|
...(downloadDataOptions?.bytesRange && {
|
|
90
91
|
Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,
|
|
91
92
|
}),
|
|
92
|
-
}
|
|
93
|
+
},
|
|
93
94
|
);
|
|
95
|
+
|
|
94
96
|
return {
|
|
95
97
|
key,
|
|
96
98
|
body,
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Amplify } from '@aws-amplify/core';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { GetPropertiesInput, GetPropertiesOutput, S3Exception } from '../types';
|
|
7
|
+
import { StorageValidationErrorCode } from '../../../errors/types/validation';
|
|
8
|
+
|
|
6
9
|
import { getProperties as getPropertiesInternal } from './internal/getProperties';
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -15,7 +18,7 @@ import { getProperties as getPropertiesInternal } from './internal/getProperties
|
|
|
15
18
|
* @throws A {@link StorageValidationErrorCode} when API call parameters are invalid.
|
|
16
19
|
*/
|
|
17
20
|
export const getProperties = (
|
|
18
|
-
input: GetPropertiesInput
|
|
21
|
+
input: GetPropertiesInput,
|
|
19
22
|
): Promise<GetPropertiesOutput> => {
|
|
20
23
|
return getPropertiesInternal(Amplify, input);
|
|
21
24
|
};
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Amplify } from '@aws-amplify/core';
|
|
5
|
+
|
|
5
6
|
import { StorageValidationErrorCode } from '../../../errors/types/validation';
|
|
6
7
|
import { GetUrlInput, GetUrlOutput, S3Exception } from '../types';
|
|
8
|
+
import { StorageError } from '../../../errors/StorageError';
|
|
9
|
+
|
|
7
10
|
import { getUrl as getUrlInternal } from './internal/getUrl';
|
|
8
11
|
|
|
9
12
|
/**
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
5
5
|
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
6
7
|
import { CopyInput, CopyOutput } from '../../types';
|
|
7
8
|
import { resolveS3ConfigAndInput } from '../../utils';
|
|
8
9
|
import { StorageValidationErrorCode } from '../../../../errors/types/validation';
|
|
@@ -13,7 +14,7 @@ import { logger } from '../../../../utils';
|
|
|
13
14
|
|
|
14
15
|
export const copy = async (
|
|
15
16
|
amplify: AmplifyClassV6,
|
|
16
|
-
input: CopyInput
|
|
17
|
+
input: CopyInput,
|
|
17
18
|
): Promise<CopyOutput> => {
|
|
18
19
|
const {
|
|
19
20
|
source: { key: sourceKey },
|
|
@@ -23,7 +24,7 @@ export const copy = async (
|
|
|
23
24
|
assertValidationError(!!sourceKey, StorageValidationErrorCode.NoSourceKey);
|
|
24
25
|
assertValidationError(
|
|
25
26
|
!!destinationKey,
|
|
26
|
-
StorageValidationErrorCode.NoDestinationKey
|
|
27
|
+
StorageValidationErrorCode.NoDestinationKey,
|
|
27
28
|
);
|
|
28
29
|
|
|
29
30
|
const {
|
|
@@ -33,7 +34,7 @@ export const copy = async (
|
|
|
33
34
|
} = await resolveS3ConfigAndInput(amplify, input.source);
|
|
34
35
|
const { keyPrefix: destinationKeyPrefix } = await resolveS3ConfigAndInput(
|
|
35
36
|
amplify,
|
|
36
|
-
input.destination
|
|
37
|
+
input.destination,
|
|
37
38
|
); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.
|
|
38
39
|
|
|
39
40
|
// TODO(ashwinkumar6) V6-logger: warn `You may copy files from another user if the source level is "protected", currently it's ${srcLevel}`
|
|
@@ -50,7 +51,7 @@ export const copy = async (
|
|
|
50
51
|
CopySource: finalCopySource,
|
|
51
52
|
Key: finalCopyDestination,
|
|
52
53
|
MetadataDirective: 'COPY', // Copies over metadata like contentType as well
|
|
53
|
-
}
|
|
54
|
+
},
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
return {
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
5
5
|
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
6
7
|
import { GetPropertiesInput, GetPropertiesOutput } from '../../types';
|
|
7
8
|
import { resolveS3ConfigAndInput } from '../../utils';
|
|
8
9
|
import { headObject } from '../../utils/client';
|
|
9
10
|
import { getStorageUserAgentValue } from '../../utils/userAgent';
|
|
10
11
|
import { logger } from '../../../../utils';
|
|
11
12
|
|
|
12
|
-
export const getProperties = async
|
|
13
|
+
export const getProperties = async (
|
|
13
14
|
amplify: AmplifyClassV6,
|
|
14
15
|
input: GetPropertiesInput,
|
|
15
|
-
action?: StorageAction
|
|
16
|
-
): Promise<GetPropertiesOutput> {
|
|
16
|
+
action?: StorageAction,
|
|
17
|
+
): Promise<GetPropertiesOutput> => {
|
|
17
18
|
const { key, options } = input;
|
|
18
19
|
const { s3Config, bucket, keyPrefix } = await resolveS3ConfigAndInput(
|
|
19
20
|
amplify,
|
|
20
|
-
options
|
|
21
|
+
options,
|
|
21
22
|
);
|
|
22
23
|
const finalKey = `${keyPrefix}${key}`;
|
|
23
24
|
|
|
@@ -26,14 +27,15 @@ export const getProperties = async function (
|
|
|
26
27
|
{
|
|
27
28
|
...s3Config,
|
|
28
29
|
userAgentValue: getStorageUserAgentValue(
|
|
29
|
-
action ?? StorageAction.GetProperties
|
|
30
|
+
action ?? StorageAction.GetProperties,
|
|
30
31
|
),
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
Bucket: bucket,
|
|
34
35
|
Key: finalKey,
|
|
35
|
-
}
|
|
36
|
+
},
|
|
36
37
|
);
|
|
38
|
+
|
|
37
39
|
return {
|
|
38
40
|
key,
|
|
39
41
|
contentType: response.ContentType,
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
5
|
+
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
5
7
|
import { GetUrlInput, GetUrlOutput } from '../../types';
|
|
6
8
|
import { StorageValidationErrorCode } from '../../../../errors/types/validation';
|
|
7
9
|
import { getPresignedGetObjectUrl } from '../../utils/client';
|
|
8
|
-
import { getProperties } from './getProperties';
|
|
9
10
|
import { resolveS3ConfigAndInput } from '../../utils';
|
|
10
11
|
import { assertValidationError } from '../../../../errors/utils/assertValidationError';
|
|
11
12
|
import {
|
|
12
13
|
DEFAULT_PRESIGN_EXPIRATION,
|
|
13
14
|
MAX_URL_EXPIRATION,
|
|
14
15
|
} from '../../utils/constants';
|
|
15
|
-
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
import { getProperties } from './getProperties';
|
|
18
|
+
|
|
19
|
+
export const getUrl = async (
|
|
18
20
|
amplify: AmplifyClassV6,
|
|
19
|
-
input: GetUrlInput
|
|
20
|
-
): Promise<GetUrlOutput> {
|
|
21
|
+
input: GetUrlInput,
|
|
22
|
+
): Promise<GetUrlOutput> => {
|
|
21
23
|
const { key, options } = input;
|
|
22
24
|
|
|
23
25
|
if (options?.validateObjectExistence) {
|
|
@@ -26,21 +28,21 @@ export const getUrl = async function (
|
|
|
26
28
|
|
|
27
29
|
const { s3Config, keyPrefix, bucket } = await resolveS3ConfigAndInput(
|
|
28
30
|
amplify,
|
|
29
|
-
options
|
|
31
|
+
options,
|
|
30
32
|
);
|
|
31
33
|
|
|
32
34
|
let urlExpirationInSec = options?.expiresIn ?? DEFAULT_PRESIGN_EXPIRATION;
|
|
33
35
|
const awsCredExpiration = s3Config.credentials?.expiration;
|
|
34
36
|
if (awsCredExpiration) {
|
|
35
37
|
const awsCredExpirationInSec = Math.floor(
|
|
36
|
-
(awsCredExpiration.getTime() - Date.now()) / 1000
|
|
38
|
+
(awsCredExpiration.getTime() - Date.now()) / 1000,
|
|
37
39
|
);
|
|
38
40
|
urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);
|
|
39
41
|
}
|
|
40
42
|
const maxUrlExpirationInSec = MAX_URL_EXPIRATION / 1000;
|
|
41
43
|
assertValidationError(
|
|
42
44
|
urlExpirationInSec <= maxUrlExpirationInSec,
|
|
43
|
-
StorageValidationErrorCode.UrlExpirationMaxLimitExceed
|
|
45
|
+
StorageValidationErrorCode.UrlExpirationMaxLimitExceed,
|
|
44
46
|
);
|
|
45
47
|
|
|
46
48
|
// expiresAt is the minimum of credential expiration and url expiration
|
|
@@ -53,7 +55,7 @@ export const getUrl = async function (
|
|
|
53
55
|
{
|
|
54
56
|
Bucket: bucket,
|
|
55
57
|
Key: `${keyPrefix}${key}`,
|
|
56
|
-
}
|
|
58
|
+
},
|
|
57
59
|
),
|
|
58
60
|
expiresAt: new Date(Date.now() + urlExpirationInSec * 1000),
|
|
59
61
|
};
|
|
@@ -3,34 +3,35 @@
|
|
|
3
3
|
|
|
4
4
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
5
5
|
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
6
7
|
import {
|
|
7
8
|
ListAllInput,
|
|
8
|
-
ListPaginateInput,
|
|
9
9
|
ListAllOutput,
|
|
10
|
-
ListPaginateOutput,
|
|
11
10
|
ListOutputItem,
|
|
11
|
+
ListPaginateInput,
|
|
12
|
+
ListPaginateOutput,
|
|
12
13
|
} from '../../types';
|
|
13
14
|
import { resolveS3ConfigAndInput } from '../../utils';
|
|
14
15
|
import { ResolvedS3Config } from '../../types/options';
|
|
15
16
|
import {
|
|
16
|
-
listObjectsV2,
|
|
17
17
|
ListObjectsV2Input,
|
|
18
18
|
ListObjectsV2Output,
|
|
19
|
+
listObjectsV2,
|
|
19
20
|
} from '../../utils/client';
|
|
20
21
|
import { getStorageUserAgentValue } from '../../utils/userAgent';
|
|
21
22
|
import { logger } from '../../../../utils';
|
|
22
23
|
|
|
23
24
|
const MAX_PAGE_SIZE = 1000;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
interface ListInputArgs {
|
|
26
27
|
s3Config: ResolvedS3Config;
|
|
27
28
|
listParams: ListObjectsV2Input;
|
|
28
29
|
prefix: string;
|
|
29
|
-
}
|
|
30
|
+
}
|
|
30
31
|
|
|
31
32
|
export const list = async (
|
|
32
33
|
amplify: AmplifyClassV6,
|
|
33
|
-
input?: ListAllInput | ListPaginateInput
|
|
34
|
+
input?: ListAllInput | ListPaginateInput,
|
|
34
35
|
): Promise<ListAllOutput | ListPaginateOutput> => {
|
|
35
36
|
const { options = {}, prefix: path = '' } = input ?? {};
|
|
36
37
|
const {
|
|
@@ -44,7 +45,7 @@ export const list = async (
|
|
|
44
45
|
logger.debug(
|
|
45
46
|
`listAll is set to true, ignoring ${
|
|
46
47
|
anyOptions?.pageSize ? `pageSize: ${anyOptions?.pageSize}` : ''
|
|
47
|
-
} ${anyOptions?.nextToken ? `nextToken: ${anyOptions?.nextToken}` : ''}
|
|
48
|
+
} ${anyOptions?.nextToken ? `nextToken: ${anyOptions?.nextToken}` : ''}.`,
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
51
|
const listParams = {
|
|
@@ -54,9 +55,10 @@ export const list = async (
|
|
|
54
55
|
ContinuationToken: options?.listAll ? undefined : options?.nextToken,
|
|
55
56
|
};
|
|
56
57
|
logger.debug(`listing items from "${listParams.Prefix}"`);
|
|
58
|
+
|
|
57
59
|
return options.listAll
|
|
58
|
-
?
|
|
59
|
-
:
|
|
60
|
+
? _listAll({ s3Config, listParams, prefix })
|
|
61
|
+
: _list({ s3Config, listParams, prefix });
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
const _listAll = async ({
|
|
@@ -101,7 +103,7 @@ const _list = async ({
|
|
|
101
103
|
...s3Config,
|
|
102
104
|
userAgentValue: getStorageUserAgentValue(StorageAction.List),
|
|
103
105
|
},
|
|
104
|
-
listParamsClone
|
|
106
|
+
listParamsClone,
|
|
105
107
|
);
|
|
106
108
|
|
|
107
109
|
if (!response?.Contents) {
|
|
@@ -116,6 +118,7 @@ const _list = async ({
|
|
|
116
118
|
lastModified: item.LastModified,
|
|
117
119
|
size: item.Size,
|
|
118
120
|
}));
|
|
121
|
+
|
|
119
122
|
return {
|
|
120
123
|
items: listResult,
|
|
121
124
|
nextToken: response.NextContinuationToken,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
5
5
|
import { StorageAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
6
7
|
import { RemoveInput, RemoveOutput } from '../../types';
|
|
7
8
|
import { resolveS3ConfigAndInput } from '../../utils';
|
|
8
9
|
import { deleteObject } from '../../utils/client';
|
|
@@ -11,12 +12,12 @@ import { logger } from '../../../../utils';
|
|
|
11
12
|
|
|
12
13
|
export const remove = async (
|
|
13
14
|
amplify: AmplifyClassV6,
|
|
14
|
-
input: RemoveInput
|
|
15
|
+
input: RemoveInput,
|
|
15
16
|
): Promise<RemoveOutput> => {
|
|
16
17
|
const { key, options = {} } = input;
|
|
17
18
|
const { s3Config, keyPrefix, bucket } = await resolveS3ConfigAndInput(
|
|
18
19
|
amplify,
|
|
19
|
-
options
|
|
20
|
+
options,
|
|
20
21
|
);
|
|
21
22
|
|
|
22
23
|
const finalKey = `${keyPrefix}${key}`;
|
|
@@ -29,8 +30,9 @@ export const remove = async (
|
|
|
29
30
|
{
|
|
30
31
|
Bucket: bucket,
|
|
31
32
|
Key: finalKey,
|
|
32
|
-
}
|
|
33
|
+
},
|
|
33
34
|
);
|
|
35
|
+
|
|
34
36
|
return {
|
|
35
37
|
key,
|
|
36
38
|
};
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Amplify } from '@aws-amplify/core';
|
|
5
|
+
|
|
5
6
|
import {
|
|
6
7
|
ListAllInput,
|
|
7
|
-
ListPaginateInput,
|
|
8
8
|
ListAllOutput,
|
|
9
|
+
ListPaginateInput,
|
|
9
10
|
ListPaginateOutput,
|
|
11
|
+
S3Exception,
|
|
10
12
|
} from '../types';
|
|
13
|
+
import { StorageValidationErrorCode } from '../../../errors/types/validation';
|
|
14
|
+
|
|
11
15
|
import { list as listInternal } from './internal/list';
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
interface ListApi {
|
|
14
18
|
/**
|
|
15
19
|
* List files with given prefix in pages
|
|
16
20
|
* pageSize defaulted to 1000. Additionally, the result will include a nextToken if there are more items to retrieve.
|
|
@@ -28,10 +32,10 @@ type ListApi = {
|
|
|
28
32
|
* @throws validation: {@link StorageValidationErrorCode } - thrown when there are issues with credentials
|
|
29
33
|
*/
|
|
30
34
|
(input?: ListAllInput): Promise<ListAllOutput>;
|
|
31
|
-
}
|
|
35
|
+
}
|
|
32
36
|
|
|
33
37
|
export const list: ListApi = (
|
|
34
|
-
input?: ListAllInput | ListPaginateInput
|
|
38
|
+
input?: ListAllInput | ListPaginateInput,
|
|
35
39
|
): Promise<ListAllOutput | ListPaginateOutput> => {
|
|
36
40
|
return listInternal(Amplify, input ?? {});
|
|
37
41
|
};
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { Amplify } from '@aws-amplify/core';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { RemoveInput, RemoveOutput, S3Exception } from '../types';
|
|
7
|
+
import { StorageValidationErrorCode } from '../../../errors/types/validation';
|
|
8
|
+
|
|
6
9
|
import { remove as removeInternal } from './internal/remove';
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
AmplifyServer,
|
|
6
6
|
getAmplifyServerContext,
|
|
7
7
|
} from '@aws-amplify/core/internals/adapter-core';
|
|
8
|
+
|
|
8
9
|
import { CopyInput, CopyOutput } from '../../types';
|
|
9
10
|
import { copy as copyInternal } from '../internal/copy';
|
|
10
11
|
|
|
11
12
|
export const copy = async (
|
|
12
13
|
contextSpec: AmplifyServer.ContextSpec,
|
|
13
|
-
input: CopyInput
|
|
14
|
+
input: CopyInput,
|
|
14
15
|
): Promise<CopyOutput> => {
|
|
15
16
|
return copyInternal(getAmplifyServerContext(contextSpec).amplify, input);
|
|
16
17
|
};
|