@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.
Files changed (185) hide show
  1. package/dist/cjs/providers/s3/apis/internal/getProperties.js +1 -1
  2. package/dist/cjs/providers/s3/apis/internal/getProperties.js.map +1 -1
  3. package/dist/cjs/providers/s3/apis/internal/getUrl.js +6 -6
  4. package/dist/cjs/providers/s3/apis/internal/getUrl.js.map +1 -1
  5. package/dist/cjs/providers/s3/apis/internal/list.js +2 -2
  6. package/dist/cjs/providers/s3/apis/internal/list.js.map +1 -1
  7. package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js +1 -1
  8. package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js.map +1 -1
  9. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js +25 -25
  10. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js.map +1 -1
  11. package/dist/cjs/providers/s3/utils/client/base.js +1 -1
  12. package/dist/cjs/providers/s3/utils/client/base.js.map +1 -1
  13. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js +1 -1
  14. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js.map +1 -1
  15. package/dist/cjs/providers/s3/utils/client/runtime/contentSha256middleware.js +3 -3
  16. package/dist/cjs/providers/s3/utils/client/runtime/contentSha256middleware.js.map +1 -1
  17. package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/fetch.js +1 -1
  18. package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/fetch.js.map +1 -1
  19. package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/xhr.js +4 -4
  20. package/dist/cjs/providers/s3/utils/client/runtime/s3TransferHandler/xhr.js.map +1 -1
  21. package/dist/cjs/providers/s3/utils/client/runtime/xhrTransferHandler.js +4 -4
  22. package/dist/cjs/providers/s3/utils/client/runtime/xhrTransferHandler.js.map +1 -1
  23. package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/dom.js +4 -7
  24. package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/dom.js.map +1 -1
  25. package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/pureJs.js +6 -5
  26. package/dist/cjs/providers/s3/utils/client/runtime/xmlParser/pureJs.js.map +1 -1
  27. package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js +1 -1
  28. package/dist/cjs/providers/s3/utils/client/utils/deserializeHelpers.js.map +1 -1
  29. package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js +2 -2
  30. package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js.map +1 -1
  31. package/dist/cjs/providers/s3/utils/md5.js +8 -3
  32. package/dist/cjs/providers/s3/utils/md5.js.map +1 -1
  33. package/dist/cjs/providers/s3/utils/md5.native.js +6 -2
  34. package/dist/cjs/providers/s3/utils/md5.native.js.map +1 -1
  35. package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js +1 -1
  36. package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js.map +1 -1
  37. package/dist/cjs/providers/s3/utils/transferTask.js +10 -4
  38. package/dist/cjs/providers/s3/utils/transferTask.js.map +1 -1
  39. package/dist/esm/providers/s3/apis/getProperties.d.ts +1 -1
  40. package/dist/esm/providers/s3/apis/internal/getProperties.mjs +1 -1
  41. package/dist/esm/providers/s3/apis/internal/getProperties.mjs.map +1 -1
  42. package/dist/esm/providers/s3/apis/internal/getUrl.mjs +3 -3
  43. package/dist/esm/providers/s3/apis/internal/getUrl.mjs.map +1 -1
  44. package/dist/esm/providers/s3/apis/internal/list.d.ts +1 -1
  45. package/dist/esm/providers/s3/apis/internal/list.mjs +2 -2
  46. package/dist/esm/providers/s3/apis/internal/list.mjs.map +1 -1
  47. package/dist/esm/providers/s3/apis/list.d.ts +3 -3
  48. package/dist/esm/providers/s3/apis/server/list.d.ts +3 -3
  49. package/dist/esm/providers/s3/apis/uploadData/multipart/getDataChunker.d.ts +2 -2
  50. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.d.ts +4 -4
  51. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs +1 -1
  52. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs.map +1 -1
  53. package/dist/esm/providers/s3/apis/uploadData/multipart/progressTracker.d.ts +3 -3
  54. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadCache.d.ts +6 -6
  55. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs +25 -25
  56. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs.map +1 -1
  57. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadPartExecutor.d.ts +5 -5
  58. package/dist/esm/providers/s3/types/inputs.d.ts +2 -2
  59. package/dist/esm/providers/s3/types/options.d.ts +11 -11
  60. package/dist/esm/providers/s3/types/outputs.d.ts +1 -1
  61. package/dist/esm/providers/s3/utils/client/abortMultipartUpload.d.ts +2 -2
  62. package/dist/esm/providers/s3/utils/client/base.mjs +1 -1
  63. package/dist/esm/providers/s3/utils/client/base.mjs.map +1 -1
  64. package/dist/esm/providers/s3/utils/client/completeMultipartUpload.d.ts +2 -2
  65. package/dist/esm/providers/s3/utils/client/copyObject.d.ts +2 -2
  66. package/dist/esm/providers/s3/utils/client/copyObject.mjs.map +1 -1
  67. package/dist/esm/providers/s3/utils/client/createMultipartUpload.d.ts +3 -3
  68. package/dist/esm/providers/s3/utils/client/createMultipartUpload.mjs.map +1 -1
  69. package/dist/esm/providers/s3/utils/client/deleteObject.d.ts +2 -2
  70. package/dist/esm/providers/s3/utils/client/getObject.d.ts +3 -3
  71. package/dist/esm/providers/s3/utils/client/getObject.mjs.map +1 -1
  72. package/dist/esm/providers/s3/utils/client/headObject.d.ts +2 -2
  73. package/dist/esm/providers/s3/utils/client/listObjectsV2.d.ts +3 -3
  74. package/dist/esm/providers/s3/utils/client/listParts.d.ts +2 -2
  75. package/dist/esm/providers/s3/utils/client/listParts.mjs.map +1 -1
  76. package/dist/esm/providers/s3/utils/client/putObject.d.ts +2 -2
  77. package/dist/esm/providers/s3/utils/client/putObject.mjs.map +1 -1
  78. package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs +1 -1
  79. package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs.map +1 -1
  80. package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.d.ts +2 -2
  81. package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs +2 -2
  82. package/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs.map +1 -1
  83. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.d.ts +2 -2
  84. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs +2 -2
  85. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs.map +1 -1
  86. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.d.ts +2 -2
  87. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs +6 -6
  88. package/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs.map +1 -1
  89. package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.d.ts +2 -2
  90. package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs +4 -4
  91. package/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs.map +1 -1
  92. package/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs +4 -7
  93. package/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs.map +1 -1
  94. package/dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs +6 -5
  95. package/dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs.map +1 -1
  96. package/dist/esm/providers/s3/utils/client/types.d.ts +11 -22
  97. package/dist/esm/providers/s3/utils/client/uploadPart.d.ts +2 -2
  98. package/dist/esm/providers/s3/utils/client/uploadPart.mjs.map +1 -1
  99. package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.d.ts +1 -3
  100. package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs +1 -1
  101. package/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs.map +1 -1
  102. package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs +2 -2
  103. package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs.map +1 -1
  104. package/dist/esm/providers/s3/utils/client/utils/serializeHelpers.d.ts +1 -1
  105. package/dist/esm/providers/s3/utils/md5.mjs +8 -3
  106. package/dist/esm/providers/s3/utils/md5.mjs.map +1 -1
  107. package/dist/esm/providers/s3/utils/md5.native.mjs +6 -2
  108. package/dist/esm/providers/s3/utils/md5.native.mjs.map +1 -1
  109. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.d.ts +4 -4
  110. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs +1 -1
  111. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs.map +1 -1
  112. package/dist/esm/providers/s3/utils/transferTask.d.ts +10 -10
  113. package/dist/esm/providers/s3/utils/transferTask.mjs +10 -4
  114. package/dist/esm/providers/s3/utils/transferTask.mjs.map +1 -1
  115. package/dist/esm/types/common.d.ts +7 -7
  116. package/dist/esm/types/inputs.d.ts +9 -9
  117. package/dist/esm/types/options.d.ts +2 -2
  118. package/dist/esm/types/outputs.d.ts +6 -6
  119. package/dist/esm/utils/resolvePrefix.d.ts +2 -2
  120. package/package.json +107 -106
  121. package/src/errors/CanceledError.ts +1 -0
  122. package/src/errors/utils/assertValidationError.ts +1 -1
  123. package/src/providers/s3/apis/copy.ts +3 -1
  124. package/src/providers/s3/apis/downloadData.ts +5 -3
  125. package/src/providers/s3/apis/getProperties.ts +5 -2
  126. package/src/providers/s3/apis/getUrl.ts +3 -0
  127. package/src/providers/s3/apis/internal/copy.ts +5 -4
  128. package/src/providers/s3/apis/internal/getProperties.ts +8 -6
  129. package/src/providers/s3/apis/internal/getUrl.ts +11 -9
  130. package/src/providers/s3/apis/internal/list.ts +13 -10
  131. package/src/providers/s3/apis/internal/remove.ts +5 -3
  132. package/src/providers/s3/apis/list.ts +8 -4
  133. package/src/providers/s3/apis/remove.ts +4 -1
  134. package/src/providers/s3/apis/server/copy.ts +2 -1
  135. package/src/providers/s3/apis/server/getProperties.ts +3 -2
  136. package/src/providers/s3/apis/server/getUrl.ts +2 -1
  137. package/src/providers/s3/apis/server/list.ts +10 -7
  138. package/src/providers/s3/apis/server/remove.ts +2 -1
  139. package/src/providers/s3/apis/uploadData/byteLength.ts +1 -0
  140. package/src/providers/s3/apis/uploadData/index.ts +5 -2
  141. package/src/providers/s3/apis/uploadData/multipart/calculatePartSize.ts +1 -0
  142. package/src/providers/s3/apis/uploadData/multipart/getDataChunker.ts +6 -4
  143. package/src/providers/s3/apis/uploadData/multipart/initialUpload.ts +12 -9
  144. package/src/providers/s3/apis/uploadData/multipart/progressTracker.ts +5 -4
  145. package/src/providers/s3/apis/uploadData/multipart/uploadCache.ts +15 -12
  146. package/src/providers/s3/apis/uploadData/multipart/uploadHandlers.ts +42 -36
  147. package/src/providers/s3/apis/uploadData/multipart/uploadPartExecutor.ts +7 -6
  148. package/src/providers/s3/apis/uploadData/putObjectJob.ts +2 -2
  149. package/src/providers/s3/types/inputs.ts +4 -4
  150. package/src/providers/s3/types/options.ts +11 -11
  151. package/src/providers/s3/types/outputs.ts +1 -1
  152. package/src/providers/s3/utils/client/abortMultipartUpload.ts +5 -4
  153. package/src/providers/s3/utils/client/base.ts +8 -6
  154. package/src/providers/s3/utils/client/completeMultipartUpload.ts +14 -6
  155. package/src/providers/s3/utils/client/copyObject.ts +7 -4
  156. package/src/providers/s3/utils/client/createMultipartUpload.ts +7 -5
  157. package/src/providers/s3/utils/client/deleteObject.ts +6 -5
  158. package/src/providers/s3/utils/client/getObject.ts +14 -12
  159. package/src/providers/s3/utils/client/headObject.ts +6 -5
  160. package/src/providers/s3/utils/client/listObjectsV2.ts +6 -3
  161. package/src/providers/s3/utils/client/listParts.ts +9 -6
  162. package/src/providers/s3/utils/client/putObject.ts +6 -5
  163. package/src/providers/s3/utils/client/runtime/base64/index.browser.ts +2 -1
  164. package/src/providers/s3/utils/client/runtime/base64/index.native.ts +1 -1
  165. package/src/providers/s3/utils/client/runtime/contentSha256middleware.ts +6 -4
  166. package/src/providers/s3/utils/client/runtime/s3TransferHandler/fetch.ts +7 -5
  167. package/src/providers/s3/utils/client/runtime/s3TransferHandler/xhr.ts +11 -11
  168. package/src/providers/s3/utils/client/runtime/xhrTransferHandler.ts +21 -14
  169. package/src/providers/s3/utils/client/runtime/xmlParser/dom.ts +6 -7
  170. package/src/providers/s3/utils/client/runtime/xmlParser/pureJs.ts +10 -5
  171. package/src/providers/s3/utils/client/types.ts +12 -14
  172. package/src/providers/s3/utils/client/uploadPart.ts +6 -5
  173. package/src/providers/s3/utils/client/utils/deserializeHelpers.ts +13 -8
  174. package/src/providers/s3/utils/client/utils/parsePayload.ts +6 -4
  175. package/src/providers/s3/utils/client/utils/serializeHelpers.ts +8 -5
  176. package/src/providers/s3/utils/md5.native.ts +9 -3
  177. package/src/providers/s3/utils/md5.ts +12 -4
  178. package/src/providers/s3/utils/resolveS3ConfigAndInput.ts +10 -8
  179. package/src/providers/s3/utils/transferTask.ts +26 -14
  180. package/src/providers/s3/utils/userAgent.ts +1 -1
  181. package/src/types/common.ts +7 -7
  182. package/src/types/inputs.ts +11 -11
  183. package/src/types/options.ts +2 -2
  184. package/src/types/outputs.ts +6 -6
  185. package/src/utils/resolvePrefix.ts +7 -4
package/package.json CHANGED
@@ -1,108 +1,109 @@
1
1
  {
2
- "name": "@aws-amplify/storage",
3
- "version": "6.0.17-unstable.e316a2e.0+e316a2e",
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": "tslint 'src/**/*.ts' && npm run ts-coverage",
35
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
36
- },
37
- "typesVersions": {
38
- ">=4.2": {
39
- "s3": [
40
- "./dist/esm/providers/s3/index.d.ts"
41
- ],
42
- "server": [
43
- "./dist/esm/server.d.ts"
44
- ],
45
- "s3/server": [
46
- "./dist/esm/providers/s3/server.d.ts"
47
- ]
48
- }
49
- },
50
- "repository": {
51
- "type": "git",
52
- "url": "https://github.com/aws-amplify/amplify-js.git"
53
- },
54
- "author": "Amazon Web Services",
55
- "license": "Apache-2.0",
56
- "bugs": {
57
- "url": "https://github.com/aws/aws-amplify/issues"
58
- },
59
- "homepage": "https://aws-amplify.github.io/",
60
- "files": [
61
- "dist/cjs",
62
- "dist/esm",
63
- "src",
64
- "server",
65
- "s3"
66
- ],
67
- "dependencies": {
68
- "@aws-sdk/types": "3.398.0",
69
- "@smithy/md5-js": "2.0.7",
70
- "buffer": "4.9.2",
71
- "fast-xml-parser": "^4.2.5",
72
- "tslib": "^2.5.0"
73
- },
74
- "exports": {
75
- ".": {
76
- "types": "./dist/esm/index.d.ts",
77
- "import": "./dist/esm/index.mjs",
78
- "require": "./dist/cjs/index.js",
79
- "react-native": "./src/index.ts"
80
- },
81
- "./server": {
82
- "types": "./dist/esm/server.d.ts",
83
- "import": "./dist/esm/server.mjs",
84
- "require": "./dist/cjs/server.js"
85
- },
86
- "./s3": {
87
- "types": "./dist/esm/providers/s3/index.d.ts",
88
- "import": "./dist/esm/providers/s3/index.mjs",
89
- "require": "./dist/cjs/providers/s3/index.js",
90
- "react-native": "./src/providers/s3/index.ts"
91
- },
92
- "./s3/server": {
93
- "types": "./dist/esm/providers/s3/server.d.ts",
94
- "import": "./dist/esm/providers/s3/server.mjs",
95
- "require": "./dist/cjs/providers/s3/server.js"
96
- },
97
- "./package.json": "./package.json"
98
- },
99
- "peerDependencies": {
100
- "@aws-amplify/core": "6.0.17-unstable.e316a2e.0+e316a2e"
101
- },
102
- "devDependencies": {
103
- "@aws-amplify/core": "6.0.17-unstable.e316a2e.0+e316a2e",
104
- "@aws-amplify/react-native": "1.0.17-unstable.e316a2e.0+e316a2e",
105
- "typescript": "5.0.2"
106
- },
107
- "gitHead": "e316a2eb6129a30a16008892e7cdc17aefd914f9"
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
  }
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
5
+
5
6
  import { StorageError } from './StorageError';
6
7
 
7
8
  /**
@@ -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
- import { GetPropertiesOutput, GetPropertiesInput, S3Exception } from '../types';
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 function (
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
- export const getUrl = async function (
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
- type ListInputArgs = {
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
- ? await _listAll({ s3Config, listParams, prefix })
59
- : await _list({ s3Config, listParams, prefix });
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
- type ListApi = {
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
- import { RemoveInput, RemoveOutput } from '../types';
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
  };