@aws-amplify/storage 6.0.28 → 6.0.29-gen2-storage.e54bfa9.0

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 (194) hide show
  1. package/dist/cjs/errors/types/validation.js +22 -2
  2. package/dist/cjs/errors/types/validation.js.map +1 -1
  3. package/dist/cjs/providers/s3/apis/copy.js +2 -12
  4. package/dist/cjs/providers/s3/apis/copy.js.map +1 -1
  5. package/dist/cjs/providers/s3/apis/downloadData.js +13 -38
  6. package/dist/cjs/providers/s3/apis/downloadData.js.map +1 -1
  7. package/dist/cjs/providers/s3/apis/getProperties.js +2 -11
  8. package/dist/cjs/providers/s3/apis/getProperties.js.map +1 -1
  9. package/dist/cjs/providers/s3/apis/getUrl.js +2 -18
  10. package/dist/cjs/providers/s3/apis/getUrl.js.map +1 -1
  11. package/dist/cjs/providers/s3/apis/internal/copy.js +41 -7
  12. package/dist/cjs/providers/s3/apis/internal/copy.js.map +1 -1
  13. package/dist/cjs/providers/s3/apis/internal/getProperties.js +10 -6
  14. package/dist/cjs/providers/s3/apis/internal/getProperties.js.map +1 -1
  15. package/dist/cjs/providers/s3/apis/internal/getUrl.js +8 -6
  16. package/dist/cjs/providers/s3/apis/internal/getUrl.js.map +1 -1
  17. package/dist/cjs/providers/s3/apis/internal/list.js +86 -16
  18. package/dist/cjs/providers/s3/apis/internal/list.js.map +1 -1
  19. package/dist/cjs/providers/s3/apis/internal/remove.js +20 -7
  20. package/dist/cjs/providers/s3/apis/internal/remove.js.map +1 -1
  21. package/dist/cjs/providers/s3/apis/list.js +4 -4
  22. package/dist/cjs/providers/s3/apis/list.js.map +1 -1
  23. package/dist/cjs/providers/s3/apis/remove.js +2 -9
  24. package/dist/cjs/providers/s3/apis/remove.js.map +1 -1
  25. package/dist/cjs/providers/s3/apis/server/copy.js +4 -4
  26. package/dist/cjs/providers/s3/apis/server/copy.js.map +1 -1
  27. package/dist/cjs/providers/s3/apis/server/getProperties.js +2 -2
  28. package/dist/cjs/providers/s3/apis/server/getProperties.js.map +1 -1
  29. package/dist/cjs/providers/s3/apis/server/getUrl.js +2 -2
  30. package/dist/cjs/providers/s3/apis/server/getUrl.js.map +1 -1
  31. package/dist/cjs/providers/s3/apis/server/list.js +4 -4
  32. package/dist/cjs/providers/s3/apis/server/list.js.map +1 -1
  33. package/dist/cjs/providers/s3/apis/server/remove.js +2 -2
  34. package/dist/cjs/providers/s3/apis/server/remove.js.map +1 -1
  35. package/dist/cjs/providers/s3/apis/uploadData/index.js +4 -50
  36. package/dist/cjs/providers/s3/apis/uploadData/index.js.map +1 -1
  37. package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js +1 -1
  38. package/dist/cjs/providers/s3/apis/uploadData/multipart/initialUpload.js.map +1 -1
  39. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadCache.js +8 -1
  40. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadCache.js.map +1 -1
  41. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js +28 -13
  42. package/dist/cjs/providers/s3/apis/uploadData/multipart/uploadHandlers.js.map +1 -1
  43. package/dist/cjs/providers/s3/apis/uploadData/putObjectJob.js +10 -5
  44. package/dist/cjs/providers/s3/apis/uploadData/putObjectJob.js.map +1 -1
  45. package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js +1 -1
  46. package/dist/cjs/providers/s3/utils/client/utils/parsePayload.js.map +1 -1
  47. package/dist/cjs/providers/s3/utils/constants.js +4 -1
  48. package/dist/cjs/providers/s3/utils/constants.js.map +1 -1
  49. package/dist/cjs/providers/s3/utils/index.js +7 -1
  50. package/dist/cjs/providers/s3/utils/index.js.map +1 -1
  51. package/dist/cjs/providers/s3/utils/isInputWithPath.js +11 -0
  52. package/dist/cjs/providers/s3/utils/isInputWithPath.js.map +1 -0
  53. package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js +2 -1
  54. package/dist/cjs/providers/s3/utils/resolveS3ConfigAndInput.js.map +1 -1
  55. package/dist/cjs/providers/s3/utils/validateStorageOperationInput.js +31 -0
  56. package/dist/cjs/providers/s3/utils/validateStorageOperationInput.js.map +1 -0
  57. package/dist/cjs/providers/s3/utils/validateStorageOperationInputWithPrefix.js +32 -0
  58. package/dist/cjs/providers/s3/utils/validateStorageOperationInputWithPrefix.js.map +1 -0
  59. package/dist/esm/errors/types/validation.d.ts +7 -2
  60. package/dist/esm/errors/types/validation.mjs +22 -2
  61. package/dist/esm/errors/types/validation.mjs.map +1 -1
  62. package/dist/esm/index.d.ts +2 -2
  63. package/dist/esm/providers/s3/apis/copy.d.ts +22 -9
  64. package/dist/esm/providers/s3/apis/copy.mjs +2 -12
  65. package/dist/esm/providers/s3/apis/copy.mjs.map +1 -1
  66. package/dist/esm/providers/s3/apis/downloadData.d.ts +41 -7
  67. package/dist/esm/providers/s3/apis/downloadData.mjs +15 -39
  68. package/dist/esm/providers/s3/apis/downloadData.mjs.map +1 -1
  69. package/dist/esm/providers/s3/apis/getProperties.d.ts +18 -5
  70. package/dist/esm/providers/s3/apis/getProperties.mjs +2 -11
  71. package/dist/esm/providers/s3/apis/getProperties.mjs.map +1 -1
  72. package/dist/esm/providers/s3/apis/getUrl.d.ts +27 -7
  73. package/dist/esm/providers/s3/apis/getUrl.mjs +2 -18
  74. package/dist/esm/providers/s3/apis/getUrl.mjs.map +1 -1
  75. package/dist/esm/providers/s3/apis/internal/copy.d.ts +4 -2
  76. package/dist/esm/providers/s3/apis/internal/copy.mjs +41 -6
  77. package/dist/esm/providers/s3/apis/internal/copy.mjs.map +1 -1
  78. package/dist/esm/providers/s3/apis/internal/getProperties.d.ts +2 -2
  79. package/dist/esm/providers/s3/apis/internal/getProperties.mjs +11 -6
  80. package/dist/esm/providers/s3/apis/internal/getProperties.mjs.map +1 -1
  81. package/dist/esm/providers/s3/apis/internal/getUrl.d.ts +2 -2
  82. package/dist/esm/providers/s3/apis/internal/getUrl.mjs +10 -7
  83. package/dist/esm/providers/s3/apis/internal/getUrl.mjs.map +1 -1
  84. package/dist/esm/providers/s3/apis/internal/list.d.ts +2 -2
  85. package/dist/esm/providers/s3/apis/internal/list.mjs +87 -16
  86. package/dist/esm/providers/s3/apis/internal/list.mjs.map +1 -1
  87. package/dist/esm/providers/s3/apis/internal/remove.d.ts +2 -2
  88. package/dist/esm/providers/s3/apis/internal/remove.mjs +21 -7
  89. package/dist/esm/providers/s3/apis/internal/remove.mjs.map +1 -1
  90. package/dist/esm/providers/s3/apis/list.d.ts +39 -22
  91. package/dist/esm/providers/s3/apis/list.mjs +2 -2
  92. package/dist/esm/providers/s3/apis/list.mjs.map +1 -1
  93. package/dist/esm/providers/s3/apis/remove.d.ts +18 -5
  94. package/dist/esm/providers/s3/apis/remove.mjs +2 -9
  95. package/dist/esm/providers/s3/apis/remove.mjs.map +1 -1
  96. package/dist/esm/providers/s3/apis/server/copy.d.ts +27 -2
  97. package/dist/esm/providers/s3/apis/server/copy.mjs +2 -2
  98. package/dist/esm/providers/s3/apis/server/copy.mjs.map +1 -1
  99. package/dist/esm/providers/s3/apis/server/getProperties.d.ts +26 -2
  100. package/dist/esm/providers/s3/apis/server/getProperties.mjs +2 -2
  101. package/dist/esm/providers/s3/apis/server/getProperties.mjs.map +1 -1
  102. package/dist/esm/providers/s3/apis/server/getUrl.d.ts +40 -2
  103. package/dist/esm/providers/s3/apis/server/getUrl.mjs +2 -2
  104. package/dist/esm/providers/s3/apis/server/getUrl.mjs.map +1 -1
  105. package/dist/esm/providers/s3/apis/server/list.d.ts +41 -22
  106. package/dist/esm/providers/s3/apis/server/list.mjs +2 -2
  107. package/dist/esm/providers/s3/apis/server/list.mjs.map +1 -1
  108. package/dist/esm/providers/s3/apis/server/remove.d.ts +24 -2
  109. package/dist/esm/providers/s3/apis/server/remove.mjs +2 -2
  110. package/dist/esm/providers/s3/apis/server/remove.mjs.map +1 -1
  111. package/dist/esm/providers/s3/apis/uploadData/index.d.ts +64 -7
  112. package/dist/esm/providers/s3/apis/uploadData/index.mjs +4 -50
  113. package/dist/esm/providers/s3/apis/uploadData/index.mjs.map +1 -1
  114. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.d.ts +2 -2
  115. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs +1 -1
  116. package/dist/esm/providers/s3/apis/uploadData/multipart/initialUpload.mjs.map +1 -1
  117. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadCache.d.ts +1 -1
  118. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadCache.mjs +8 -1
  119. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadCache.mjs.map +1 -1
  120. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.d.ts +4 -4
  121. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs +30 -14
  122. package/dist/esm/providers/s3/apis/uploadData/multipart/uploadHandlers.mjs.map +1 -1
  123. package/dist/esm/providers/s3/apis/uploadData/putObjectJob.d.ts +3 -3
  124. package/dist/esm/providers/s3/apis/uploadData/putObjectJob.mjs +11 -5
  125. package/dist/esm/providers/s3/apis/uploadData/putObjectJob.mjs.map +1 -1
  126. package/dist/esm/providers/s3/index.d.ts +2 -2
  127. package/dist/esm/providers/s3/types/index.d.ts +3 -3
  128. package/dist/esm/providers/s3/types/inputs.d.ts +51 -11
  129. package/dist/esm/providers/s3/types/options.d.ts +41 -10
  130. package/dist/esm/providers/s3/types/outputs.d.ts +68 -13
  131. package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs +1 -1
  132. package/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs.map +1 -1
  133. package/dist/esm/providers/s3/utils/constants.d.ts +3 -0
  134. package/dist/esm/providers/s3/utils/constants.mjs +4 -1
  135. package/dist/esm/providers/s3/utils/constants.mjs.map +1 -1
  136. package/dist/esm/providers/s3/utils/index.d.ts +3 -0
  137. package/dist/esm/providers/s3/utils/index.mjs +3 -0
  138. package/dist/esm/providers/s3/utils/index.mjs.map +1 -1
  139. package/dist/esm/providers/s3/utils/isInputWithPath.d.ts +2 -0
  140. package/dist/esm/providers/s3/utils/isInputWithPath.mjs +8 -0
  141. package/dist/esm/providers/s3/utils/isInputWithPath.mjs.map +1 -0
  142. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.d.ts +2 -1
  143. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs +2 -1
  144. package/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs.map +1 -1
  145. package/dist/esm/providers/s3/utils/validateStorageOperationInput.d.ts +5 -0
  146. package/dist/esm/providers/s3/utils/validateStorageOperationInput.mjs +29 -0
  147. package/dist/esm/providers/s3/utils/validateStorageOperationInput.mjs.map +1 -0
  148. package/dist/esm/providers/s3/utils/validateStorageOperationInputWithPrefix.d.ts +5 -0
  149. package/dist/esm/providers/s3/utils/validateStorageOperationInputWithPrefix.mjs +30 -0
  150. package/dist/esm/providers/s3/utils/validateStorageOperationInputWithPrefix.mjs.map +1 -0
  151. package/dist/esm/types/index.d.ts +2 -2
  152. package/dist/esm/types/inputs.d.ts +41 -13
  153. package/dist/esm/types/options.d.ts +1 -0
  154. package/dist/esm/types/outputs.d.ts +26 -6
  155. package/package.json +107 -107
  156. package/src/errors/types/validation.ts +23 -2
  157. package/src/index.ts +16 -0
  158. package/src/providers/s3/apis/copy.ts +30 -11
  159. package/src/providers/s3/apis/downloadData.ts +78 -19
  160. package/src/providers/s3/apis/getProperties.ts +31 -8
  161. package/src/providers/s3/apis/getUrl.ts +37 -10
  162. package/src/providers/s3/apis/internal/copy.ts +89 -8
  163. package/src/providers/s3/apis/internal/getProperties.ts +27 -12
  164. package/src/providers/s3/apis/internal/getUrl.ts +28 -14
  165. package/src/providers/s3/apis/internal/list.ts +135 -29
  166. package/src/providers/s3/apis/internal/remove.ts +36 -13
  167. package/src/providers/s3/apis/list.ts +54 -26
  168. package/src/providers/s3/apis/remove.ts +28 -7
  169. package/src/providers/s3/apis/server/copy.ts +42 -5
  170. package/src/providers/s3/apis/server/getProperties.ts +41 -4
  171. package/src/providers/s3/apis/server/getUrl.ts +55 -4
  172. package/src/providers/s3/apis/server/list.ts +64 -32
  173. package/src/providers/s3/apis/server/remove.ts +39 -4
  174. package/src/providers/s3/apis/uploadData/index.ts +77 -8
  175. package/src/providers/s3/apis/uploadData/multipart/initialUpload.ts +4 -3
  176. package/src/providers/s3/apis/uploadData/multipart/uploadCache.ts +11 -2
  177. package/src/providers/s3/apis/uploadData/multipart/uploadHandlers.ts +50 -20
  178. package/src/providers/s3/apis/uploadData/putObjectJob.ts +23 -9
  179. package/src/providers/s3/index.ts +16 -0
  180. package/src/providers/s3/types/index.ts +37 -14
  181. package/src/providers/s3/types/inputs.ts +95 -26
  182. package/src/providers/s3/types/options.ts +73 -27
  183. package/src/providers/s3/types/outputs.ts +80 -13
  184. package/src/providers/s3/utils/client/utils/parsePayload.ts +1 -1
  185. package/src/providers/s3/utils/constants.ts +4 -0
  186. package/src/providers/s3/utils/index.ts +3 -0
  187. package/src/providers/s3/utils/isInputWithPath.ts +13 -0
  188. package/src/providers/s3/utils/resolveS3ConfigAndInput.ts +3 -2
  189. package/src/providers/s3/utils/validateStorageOperationInput.ts +39 -0
  190. package/src/providers/s3/utils/validateStorageOperationInputWithPrefix.ts +46 -0
  191. package/src/types/index.ts +16 -8
  192. package/src/types/inputs.ts +73 -20
  193. package/src/types/options.ts +1 -0
  194. package/src/types/outputs.ts +29 -6
@@ -1 +1 @@
1
- {"version":3,"file":"validation.mjs","sources":["../../../../src/errors/types/validation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nexport const validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n};\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC,2BAA2B;AACtC,CAAC,UAAU,0BAA0B,EAAE;AACvC,IAAI,0BAA0B,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AAClE,IAAI,0BAA0B,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;AAChE,IAAI,0BAA0B,CAAC,OAAO,CAAC,GAAG,OAAO,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gDAAgD;AACjE,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,gBAAgB,GAAG;AACnD,QAAQ,OAAO,EAAE,6CAA6C;AAC9D,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,mBAAmB,GAAG;AACtD,QAAQ,OAAO,EAAE,8EAA8E;AAC/F,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"validation.mjs","sources":["../../../../src/errors/types/validation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoSourcePath\"] = \"NoSourcePath\";\n StorageValidationErrorCode[\"NoDestinationPath\"] = \"NoDestinationPath\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"InvalidStorageOperationPrefixInput\"] = \"InvalidStorageOperationPrefixInput\";\n StorageValidationErrorCode[\"InvalidStorageOperationInput\"] = \"InvalidStorageOperationInput\";\n StorageValidationErrorCode[\"InvalidStoragePathInput\"] = \"InvalidStoragePathInput\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nexport const validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoSourcePath]: {\n message: 'Missing source path in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationPath]: {\n message: 'Missing destination path in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationInput]: {\n message: 'Path or key parameter must be specified in the input. Both can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationPrefixInput]: {\n message: 'Both path and prefix can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStoragePathInput]: {\n message: 'Input `path` does not allow a leading slash (/).',\n },\n};\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC,2BAA2B;AACtC,CAAC,UAAU,0BAA0B,EAAE;AACvC,IAAI,0BAA0B,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AAClE,IAAI,0BAA0B,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;AAChE,IAAI,0BAA0B,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAClD,IAAI,0BAA0B,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;AAC9D,IA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,CAAC,YAAY,GAAG;AAC/C,QAAQ,OAAO,EAAE,uCAAuC;AACxD,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,iBAAiB,GAAG;AACpD,QAAQ,OAAO,EAAE,4CAA4C;AAC7D,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,QAAQ,GAAG;AAC3C,QAAQ,OAAO,EAAE,6CAA6C;AAC9D,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,QAAQ,GAAG;AAC3C,QAAQ,OAAO,EAAE,wCAAwC;AACzD,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,2BAA2B,GAAG;AAC9D,QAAQ,OAAO,EAAE,gDAAgD;AACjE,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,gBAAgB,GAAG;AACnD,QAAQ,OAAO,EAAE,6CAA6C;AAC9D,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,mBAAmB,GAAG;AACtD,QAAQ,OAAO,EAAE,8EAA8E;AAC/F,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,4BAA4B,GAAG;AAC/D,QAAQ,OAAO,EAAE,mGAAmG;AACpH,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,kCAAkC,GAAG;AACrE,QAAQ,OAAO,EAAE,6DAA6D;AAC9E,KAAK;AACL,IAAI,CAAC,0BAA0B,CAAC,uBAAuB,GAAG;AAC1D,QAAQ,OAAO,EAAE,kDAAkD;AACnE,KAAK;AACL;;;;"}
@@ -1,6 +1,6 @@
1
1
  export { uploadData, downloadData, remove, list, getProperties, copy, getUrl, } from './providers/s3';
2
- export { UploadDataInput, DownloadDataInput, RemoveInput, ListAllInput, ListPaginateInput, GetPropertiesInput, CopyInput, GetUrlInput, } from './providers/s3/types/inputs';
3
- export { UploadDataOutput, DownloadDataOutput, RemoveOutput, ListAllOutput, ListPaginateOutput, GetPropertiesOutput, CopyOutput, GetUrlOutput, } from './providers/s3/types/outputs';
2
+ export { UploadDataInput, UploadDataWithPathInput, DownloadDataInput, DownloadDataWithPathInput, RemoveInput, RemoveWithPathInput, ListAllInput, ListAllWithPathInput, ListPaginateInput, ListPaginateWithPathInput, GetPropertiesInput, GetPropertiesWithPathInput, CopyInput, CopyWithPathInput, GetUrlInput, GetUrlWithPathInput, } from './providers/s3/types/inputs';
3
+ export { UploadDataOutput, UploadDataWithPathOutput, DownloadDataOutput, DownloadDataWithPathOutput, RemoveOutput, RemoveWithPathOutput, ListAllOutput, ListAllWithPathOutput, ListPaginateOutput, ListPaginateWithPathOutput, GetPropertiesOutput, GetPropertiesWithPathOutput, CopyOutput, CopyWithPathOutput, GetUrlOutput, GetUrlWithPathOutput, } from './providers/s3/types/outputs';
4
4
  export { TransferProgressEvent } from './types';
5
5
  export { isCancelError } from './errors/CanceledError';
6
6
  export { StorageError } from './errors/StorageError';
@@ -1,12 +1,25 @@
1
- import { CopyInput, CopyOutput } from '../types';
1
+ import { CopyInput, CopyOutput, CopyWithPathInput, CopyWithPathOutput } from '../types';
2
2
  /**
3
- * Copy an object from a source object to a new object within the same bucket. Can optionally copy files across
4
- * different level or identityId (if source object's level is 'protected').
3
+ * Copy an object from a source to a destination object within the same bucket.
5
4
  *
6
- * @param input - The CopyInput object.
7
- * @returns Output containing the destination key.
8
- * @throws service: {@link S3Exception} - Thrown when checking for existence of the object
9
- * @throws validation: {@link StorageValidationErrorCode } - Thrown when
10
- * source or destination key are not defined.
5
+ * @param input - The `CopyWithPathInput` object.
6
+ * @returns Output containing the destination object path.
7
+ * @throws service: `S3Exception` - Thrown when checking for existence of the object
8
+ * @throws validation: `StorageValidationErrorCode` - Thrown when
9
+ * source or destination path is not defined.
11
10
  */
12
- export declare const copy: (input: CopyInput) => Promise<CopyOutput>;
11
+ export declare function copy(input: CopyWithPathInput): Promise<CopyWithPathOutput>;
12
+ /**
13
+ * @deprecated The `key` and `accessLevel` parameters are deprecated and may be removed in the next major version.
14
+ * Please use {@link https://docs.amplify.aws/react/build-a-backend/storage/copy | path} instead.
15
+ *
16
+ * Copy an object from a source to a destination object within the same bucket. Can optionally copy files across
17
+ * different accessLevel or identityId (if source object's accessLevel is 'protected').
18
+ *
19
+ * @param input - The `CopyInput` object.
20
+ * @returns Output containing the destination object key.
21
+ * @throws service: `S3Exception` - Thrown when checking for existence of the object
22
+ * @throws validation: `StorageValidationErrorCode` - Thrown when
23
+ * source or destination key is not defined.
24
+ */
25
+ export declare function copy(input: CopyInput): Promise<CopyOutput>;
@@ -3,19 +3,9 @@ import { copy as copy$1 } from './internal/copy.mjs';
3
3
 
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
- /**
7
- * Copy an object from a source object to a new object within the same bucket. Can optionally copy files across
8
- * different level or identityId (if source object's level is 'protected').
9
- *
10
- * @param input - The CopyInput object.
11
- * @returns Output containing the destination key.
12
- * @throws service: {@link S3Exception} - Thrown when checking for existence of the object
13
- * @throws validation: {@link StorageValidationErrorCode } - Thrown when
14
- * source or destination key are not defined.
15
- */
16
- const copy = async (input) => {
6
+ function copy(input) {
17
7
  return copy$1(Amplify, input);
18
- };
8
+ }
19
9
 
20
10
  export { copy };
21
11
  //# sourceMappingURL=copy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy.mjs","sources":["../../../../../src/providers/s3/apis/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { copy as copyInternal } from './internal/copy';\n/**\n * Copy an object from a source object to a new object within the same bucket. Can optionally copy files across\n * different level or identityId (if source object's level is 'protected').\n *\n * @param input - The CopyInput object.\n * @returns Output containing the destination key.\n * @throws service: {@link S3Exception} - Thrown when checking for existence of the object\n * @throws validation: {@link StorageValidationErrorCode } - Thrown when\n * source or destination key are not defined.\n */\nexport const copy = async (input) => {\n return copyInternal(Amplify, input);\n};\n"],"names":["copyInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,OAAO,KAAK,KAAK;AACrC,IAAI,OAAOA,MAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxC;;;;"}
1
+ {"version":3,"file":"copy.mjs","sources":["../../../../../src/providers/s3/apis/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { copy as copyInternal } from './internal/copy';\nexport function copy(input) {\n return copyInternal(Amplify, input);\n}\n"],"names":["copyInternal"],"mappings":";;;AAAA;AACA;AAGO,SAAS,IAAI,CAAC,KAAK,EAAE;AAC5B,IAAI,OAAOA,MAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxC;;;;"}
@@ -1,23 +1,23 @@
1
- import { DownloadDataInput, DownloadDataOutput } from '../types';
1
+ import { DownloadDataInput, DownloadDataOutput, DownloadDataWithPathInput, DownloadDataWithPathOutput } from '../types';
2
2
  /**
3
3
  * Download S3 object data to memory
4
4
  *
5
- * @param input - The DownloadDataInput object.
5
+ * @param input - The `DownloadDataWithPathInput` object.
6
6
  * @returns A cancelable task exposing result promise from `result` property.
7
- * @throws service: {@link S3Exception} - thrown when checking for existence of the object
8
- * @throws validation: {@link StorageValidationErrorCode } - Validation errors
7
+ * @throws service: `S3Exception` - thrown when checking for existence of the object
8
+ * @throws validation: `StorageValidationErrorCode` - Validation errors
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
12
  * // Download a file from s3 bucket
13
- * const { body, eTag } = await downloadData({ key, data: file, options: {
13
+ * const { body, eTag } = await downloadData({ path, options: {
14
14
  * onProgress, // Optional progress callback.
15
15
  * } }).result;
16
16
  * ```
17
17
  * @example
18
18
  * ```ts
19
19
  * // Cancel a task
20
- * const downloadTask = downloadData({ key, data: file });
20
+ * const downloadTask = downloadData({ path });
21
21
  * //...
22
22
  * downloadTask.cancel();
23
23
  * try {
@@ -29,4 +29,38 @@ import { DownloadDataInput, DownloadDataOutput } from '../types';
29
29
  * }
30
30
  *```
31
31
  */
32
- export declare const downloadData: (input: DownloadDataInput) => DownloadDataOutput;
32
+ export declare function downloadData(input: DownloadDataWithPathInput): DownloadDataWithPathOutput;
33
+ /**
34
+ * @deprecated The `key` and `accessLevel` parameters are deprecated and may be removed in the next major version.
35
+ * Please use {@link https://docs.amplify.aws/react/build-a-backend/storage/download/#downloaddata | path} instead.
36
+ *
37
+ * Download S3 object data to memory
38
+ *
39
+ * @param input - The `DownloadDataInput` object.
40
+ * @returns A cancelable task exposing result promise from `result` property.
41
+ * @throws service: `S3Exception` - thrown when checking for existence of the object
42
+ * @throws validation: `StorageValidationErrorCode` - Validation errors
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * // Download a file from s3 bucket
47
+ * const { body, eTag } = await downloadData({ key, options: {
48
+ * onProgress, // Optional progress callback.
49
+ * } }).result;
50
+ * ```
51
+ * @example
52
+ * ```ts
53
+ * // Cancel a task
54
+ * const downloadTask = downloadData({ key });
55
+ * //...
56
+ * downloadTask.cancel();
57
+ * try {
58
+ * await downloadTask.result;
59
+ * } catch (error) {
60
+ * if(isCancelError(error)) {
61
+ * // Handle error thrown by task cancelation.
62
+ * }
63
+ * }
64
+ *```
65
+ */
66
+ export declare function downloadData(input: DownloadDataInput): DownloadDataOutput;
@@ -8,6 +8,9 @@ import 'fast-xml-parser';
8
8
  import '../utils/client/runtime/s3TransferHandler/xhr.mjs';
9
9
  import 'buffer';
10
10
  import { createDownloadTask } from '../utils/transferTask.mjs';
11
+ import { validateStorageOperationInput } from '../utils/validateStorageOperationInput.mjs';
12
+ import '../../../errors/types/validation.mjs';
13
+ import { STORAGE_INPUT_KEY } from '../utils/constants.mjs';
11
14
  import '../utils/client/base.mjs';
12
15
  import { getObject } from '../utils/client/getObject.mjs';
13
16
  import '../utils/client/listObjectsV2.mjs';
@@ -21,42 +24,11 @@ import '../utils/client/copyObject.mjs';
21
24
  import '../utils/client/headObject.mjs';
22
25
  import '../utils/client/deleteObject.mjs';
23
26
  import { getStorageUserAgentValue } from '../utils/userAgent.mjs';
24
- import '../../../errors/types/validation.mjs';
25
27
  import { logger } from '../../../utils/logger.mjs';
26
28
 
27
29
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
28
30
  // SPDX-License-Identifier: Apache-2.0
29
- /**
30
- * Download S3 object data to memory
31
- *
32
- * @param input - The DownloadDataInput object.
33
- * @returns A cancelable task exposing result promise from `result` property.
34
- * @throws service: {@link S3Exception} - thrown when checking for existence of the object
35
- * @throws validation: {@link StorageValidationErrorCode } - Validation errors
36
- *
37
- * @example
38
- * ```ts
39
- * // Download a file from s3 bucket
40
- * const { body, eTag } = await downloadData({ key, data: file, options: {
41
- * onProgress, // Optional progress callback.
42
- * } }).result;
43
- * ```
44
- * @example
45
- * ```ts
46
- * // Cancel a task
47
- * const downloadTask = downloadData({ key, data: file });
48
- * //...
49
- * downloadTask.cancel();
50
- * try {
51
- * await downloadTask.result;
52
- * } catch (error) {
53
- * if(isCancelError(error)) {
54
- * // Handle error thrown by task cancelation.
55
- * }
56
- * }
57
- *```
58
- */
59
- const downloadData = (input) => {
31
+ function downloadData(input) {
60
32
  const abortController = new AbortController();
61
33
  const downloadTask = createDownloadTask({
62
34
  job: downloadDataJob(input, abortController.signal),
@@ -65,11 +37,13 @@ const downloadData = (input) => {
65
37
  },
66
38
  });
67
39
  return downloadTask;
68
- };
69
- const downloadDataJob = ({ options: downloadDataOptions, key }, abortSignal) => async () => {
70
- const { bucket, keyPrefix, s3Config } = await resolveS3ConfigAndInput(Amplify, downloadDataOptions);
71
- const finalKey = keyPrefix + key;
72
- logger.debug(`download ${key} from ${finalKey}.`);
40
+ }
41
+ const downloadDataJob = (downloadDataInput, abortSignal) => async () => {
42
+ const { options: downloadDataOptions } = downloadDataInput;
43
+ const { bucket, keyPrefix, s3Config, identityId } = await resolveS3ConfigAndInput(Amplify, downloadDataOptions);
44
+ const { inputType, objectKey } = validateStorageOperationInput(downloadDataInput, identityId);
45
+ const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;
46
+ logger.debug(`download ${objectKey} from ${finalKey}.`);
73
47
  const { Body: body, LastModified: lastModified, ContentLength: size, ETag: eTag, Metadata: metadata, VersionId: versionId, ContentType: contentType, } = await getObject({
74
48
  ...s3Config,
75
49
  abortSignal,
@@ -82,8 +56,7 @@ const downloadDataJob = ({ options: downloadDataOptions, key }, abortSignal) =>
82
56
  Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,
83
57
  }),
84
58
  });
85
- return {
86
- key,
59
+ const result = {
87
60
  body,
88
61
  lastModified,
89
62
  size,
@@ -92,6 +65,9 @@ const downloadDataJob = ({ options: downloadDataOptions, key }, abortSignal) =>
92
65
  metadata,
93
66
  versionId,
94
67
  };
68
+ return inputType === STORAGE_INPUT_KEY
69
+ ? { key: objectKey, ...result }
70
+ : { path: objectKey, ...result };
95
71
  };
96
72
 
97
73
  export { downloadData };
@@ -1 +1 @@
1
- {"version":3,"file":"downloadData.mjs","sources":["../../../../../src/providers/s3/apis/downloadData.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { resolveS3ConfigAndInput } from '../utils/resolveS3ConfigAndInput';\nimport { createDownloadTask } from '../utils';\nimport { getObject } from '../utils/client';\nimport { getStorageUserAgentValue } from '../utils/userAgent';\nimport { logger } from '../../../utils';\n/**\n * Download S3 object data to memory\n *\n * @param input - The DownloadDataInput object.\n * @returns A cancelable task exposing result promise from `result` property.\n * @throws service: {@link S3Exception} - thrown when checking for existence of the object\n * @throws validation: {@link StorageValidationErrorCode } - Validation errors\n *\n * @example\n * ```ts\n * // Download a file from s3 bucket\n * const { body, eTag } = await downloadData({ key, data: file, options: {\n * onProgress, // Optional progress callback.\n * } }).result;\n * ```\n * @example\n * ```ts\n * // Cancel a task\n * const downloadTask = downloadData({ key, data: file });\n * //...\n * downloadTask.cancel();\n * try {\n * \tawait downloadTask.result;\n * } catch (error) {\n * \tif(isCancelError(error)) {\n * // Handle error thrown by task cancelation.\n * \t}\n * }\n *```\n */\nexport const downloadData = (input) => {\n const abortController = new AbortController();\n const downloadTask = createDownloadTask({\n job: downloadDataJob(input, abortController.signal),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n return downloadTask;\n};\nconst downloadDataJob = ({ options: downloadDataOptions, key }, abortSignal) => async () => {\n const { bucket, keyPrefix, s3Config } = await resolveS3ConfigAndInput(Amplify, downloadDataOptions);\n const finalKey = keyPrefix + key;\n logger.debug(`download ${key} from ${finalKey}.`);\n const { Body: body, LastModified: lastModified, ContentLength: size, ETag: eTag, Metadata: metadata, VersionId: versionId, ContentType: contentType, } = await getObject({\n ...s3Config,\n abortSignal,\n onDownloadProgress: downloadDataOptions?.onProgress,\n userAgentValue: getStorageUserAgentValue(StorageAction.DownloadData),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(downloadDataOptions?.bytesRange && {\n Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,\n }),\n });\n return {\n key,\n body,\n lastModified,\n size,\n contentType,\n eTag,\n metadata,\n versionId,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,IAAI,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAClD,IAAI,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC5C,QAAQ,GAAG,EA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C,UAAU,CAAC,GAAG,CAAC,CAAC;AACxG,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,GAAG;AACX,QAAQ,IAAI;AACZ,QAAQ,YAAY;AACpB,QAAQ,IAAI;AACZ,QAAQ,WAAW;AACnB,QAAQ,IAAI;AACZ,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,KAAK,CAAC;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"downloadData.mjs","sources":["../../../../../src/providers/s3/apis/downloadData.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { resolveS3ConfigAndInput } from '../utils/resolveS3ConfigAndInput';\nimport { createDownloadTask, validateStorageOperationInput } from '../utils';\nimport { getObject } from '../utils/client';\nimport { getStorageUserAgentValue } from '../utils/userAgent';\nimport { logger } from '../../../utils';\nimport { STORAGE_INPUT_KEY } from '../utils/constants';\nexport function downloadData(input) {\n const abortController = new AbortController();\n const downloadTask = createDownloadTask({\n job: downloadDataJob(input, abortController.signal),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n return downloadTask;\n}\nconst downloadDataJob = (downloadDataInput, abortSignal) => async () => {\n const { options: downloadDataOptions } = downloadDataInput;\n const { bucket, keyPrefix, s3Config, identityId } = await resolveS3ConfigAndInput(Amplify, downloadDataOptions);\n const { inputType, objectKey } = validateStorageOperationInput(downloadDataInput, identityId);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n logger.debug(`download ${objectKey} from ${finalKey}.`);\n const { Body: body, LastModified: lastModified, ContentLength: size, ETag: eTag, Metadata: metadata, VersionId: versionId, ContentType: contentType, } = await getObject({\n ...s3Config,\n abortSignal,\n onDownloadProgress: downloadDataOptions?.onProgress,\n userAgentValue: getStorageUserAgentValue(StorageAction.DownloadData),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(downloadDataOptions?.bytesRange && {\n Range: `bytes=${downloadDataOptions.bytesRange.start}-${downloadDataOptions.bytesRange.end}`,\n }),\n });\n const result = {\n body,\n lastModified,\n size,\n contentType,\n eTag,\n metadata,\n versionId,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AASO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAClD,IAAI,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC5C,QAAQ,GAAG,EAAE,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC;AAC3D,QAAQ,QAAQ,EAAE,CAAC,OAAO,KAAK;AAC/B,YAAY,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3C,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,YAAY,CAAC;AACxB,CAAC;AACD,MAAM,eAAe,GAAG,CAAC,iBAAiB,EAAE,WAAW,KAAK,YAAY;AACxE,IAAI,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,GAAG,iBAAiB,CAAC;AAC/D,IAAI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AACpH,IAAI,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,6BAA6B,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAClG,IAAI,MAAM,QAAQ,GAAG,SAAS,KAAK,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AACzF,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,GAAG,MAAM,SAAS,CAAC;AAC7K,QAAQ,GAAG,QAAQ;AACnB,QAAQ,WAAW;AACnB,QAAQ,kBAAkB,EAAE,mBAAmB,EAAE,UAAU;AAC3D,QAAQ,cAAc,EAAE,wBAAwB,CAAC,aAAa,CAAC,YAAY,CAAC;AAC5E,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,GAAG,EAAE,QAAQ;AACrB,QAAQ,IAAI,mBAAmB,EAAE,UAAU,IAAI;AAC/C,YAAY,KAAK,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACxG,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,IAAI;AACZ,QAAQ,YAAY;AACpB,QAAQ,IAAI;AACZ,QAAQ,WAAW;AACnB,QAAQ,IAAI;AACZ,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,KAAK,iBAAiB;AAC1C,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE;AACvC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC;AACzC,CAAC;;;;"}
@@ -1,11 +1,24 @@
1
- import { GetPropertiesInput, GetPropertiesOutput } from '../types';
1
+ import { GetPropertiesInput, GetPropertiesOutput, GetPropertiesWithPathInput, GetPropertiesWithPathOutput } from '../types';
2
2
  /**
3
3
  * Gets the properties of a file. The properties include S3 system metadata and
4
4
  * the user metadata that was provided when uploading the file.
5
5
  *
6
- * @param input - The GetPropertiesInput object.
6
+ * @param input - The `GetPropertiesWithPathInput` object.
7
7
  * @returns Requested object properties.
8
- * @throws A {@link S3Exception} when the underlying S3 service returned error.
9
- * @throws A {@link StorageValidationErrorCode} when API call parameters are invalid.
8
+ * @throws An `S3Exception` when the underlying S3 service returned error.
9
+ * @throws A `StorageValidationErrorCode` when API call parameters are invalid.
10
10
  */
11
- export declare const getProperties: (input: GetPropertiesInput) => Promise<GetPropertiesOutput>;
11
+ export declare function getProperties(input: GetPropertiesWithPathInput): Promise<GetPropertiesWithPathOutput>;
12
+ /**
13
+ * @deprecated The `key` and `accessLevel` parameters are deprecated and may be removed in the next major version.
14
+ * Please use {@link https://docs.amplify.aws/javascript/build-a-backend/storage/get-properties/ | path} instead.
15
+ *
16
+ * Gets the properties of a file. The properties include S3 system metadata and
17
+ * the user metadata that was provided when uploading the file.
18
+ *
19
+ * @param input - The `GetPropertiesInput` object.
20
+ * @returns Requested object properties.
21
+ * @throws An `S3Exception` when the underlying S3 service returned error.
22
+ * @throws A `StorageValidationErrorCode` when API call parameters are invalid.
23
+ */
24
+ export declare function getProperties(input: GetPropertiesInput): Promise<GetPropertiesOutput>;
@@ -3,18 +3,9 @@ import { getProperties as getProperties$1 } from './internal/getProperties.mjs';
3
3
 
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
- /**
7
- * Gets the properties of a file. The properties include S3 system metadata and
8
- * the user metadata that was provided when uploading the file.
9
- *
10
- * @param input - The GetPropertiesInput object.
11
- * @returns Requested object properties.
12
- * @throws A {@link S3Exception} when the underlying S3 service returned error.
13
- * @throws A {@link StorageValidationErrorCode} when API call parameters are invalid.
14
- */
15
- const getProperties = (input) => {
6
+ function getProperties(input) {
16
7
  return getProperties$1(Amplify, input);
17
- };
8
+ }
18
9
 
19
10
  export { getProperties };
20
11
  //# sourceMappingURL=getProperties.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getProperties.mjs","sources":["../../../../../src/providers/s3/apis/getProperties.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { getProperties as getPropertiesInternal } from './internal/getProperties';\n/**\n * Gets the properties of a file. The properties include S3 system metadata and\n * the user metadata that was provided when uploading the file.\n *\n * @param input - The GetPropertiesInput object.\n * @returns Requested object properties.\n * @throws A {@link S3Exception} when the underlying S3 service returned error.\n * @throws A {@link StorageValidationErrorCode} when API call parameters are invalid.\n */\nexport const getProperties = (input) => {\n return getPropertiesInternal(Amplify, input);\n};\n"],"names":["getPropertiesInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,KAAK,KAAK;AACxC,IAAI,OAAOA,eAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD;;;;"}
1
+ {"version":3,"file":"getProperties.mjs","sources":["../../../../../src/providers/s3/apis/getProperties.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { getProperties as getPropertiesInternal } from './internal/getProperties';\nexport function getProperties(input) {\n return getPropertiesInternal(Amplify, input);\n}\n"],"names":["getPropertiesInternal"],"mappings":";;;AAAA;AACA;AAGO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAOA,eAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD;;;;"}
@@ -1,4 +1,4 @@
1
- import { GetUrlInput, GetUrlOutput } from '../types';
1
+ import { GetUrlInput, GetUrlOutput, GetUrlWithPathInput, GetUrlWithPathOutput } from '../types';
2
2
  /**
3
3
  * Get a temporary presigned URL to download the specified S3 object.
4
4
  * The presigned URL expires when the associated role used to sign the request expires or
@@ -6,13 +6,33 @@ import { GetUrlInput, GetUrlOutput } from '../types';
6
6
  *
7
7
  * By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`
8
8
  * to true, this method will verify the given object already exists in S3 before returning a presigned
9
- * URL, and will throw {@link StorageError} if the object does not exist.
9
+ * URL, and will throw `StorageError` if the object does not exist.
10
10
  *
11
- * @param input - The GetUrlInput object.
12
- * @returns Presigned URL and timestamp when the URL MAY expire.
13
- * @throws service: {@link S3Exception} - thrown when checking for existence of the object
14
- * @throws validation: {@link StorageValidationErrorCode } - Validation errors
11
+ * @param input - The `GetUrlWithPathInput` object.
12
+ * @returns Presigned URL and timestamp when the URL may expire.
13
+ * @throws service: `S3Exception` - thrown when checking for existence of the object
14
+ * @throws validation: `StorageValidationErrorCode` - Validation errors
15
15
  * thrown either username or key are not defined.
16
16
  *
17
17
  */
18
- export declare const getUrl: (input: GetUrlInput) => Promise<GetUrlOutput>;
18
+ export declare function getUrl(input: GetUrlWithPathInput): Promise<GetUrlWithPathOutput>;
19
+ /**
20
+ * @deprecated The `key` and `accessLevel` parameters are deprecated and may be removed in the next major version.
21
+ * Please use {@link https://docs.amplify.aws/javascript/build-a-backend/storage/download/#generate-a-download-url | path} instead.
22
+ *
23
+ * Get a temporary presigned URL to download the specified S3 object.
24
+ * The presigned URL expires when the associated role used to sign the request expires or
25
+ * the option `expiresIn` is reached. The `expiresAt` property in the output object indicates when the URL MAY expire.
26
+ *
27
+ * By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`
28
+ * to true, this method will verify the given object already exists in S3 before returning a presigned
29
+ * URL, and will throw `StorageError` if the object does not exist.
30
+ *
31
+ * @param input - The `GetUrlInput` object.
32
+ * @returns Presigned URL and timestamp when the URL may expire.
33
+ * @throws service: `S3Exception` - thrown when checking for existence of the object
34
+ * @throws validation: `StorageValidationErrorCode` - Validation errors
35
+ * thrown either username or key are not defined.
36
+ *
37
+ */
38
+ export declare function getUrl(input: GetUrlInput): Promise<GetUrlOutput>;
@@ -3,25 +3,9 @@ import { getUrl as getUrl$1 } from './internal/getUrl.mjs';
3
3
 
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
- /**
7
- * Get a temporary presigned URL to download the specified S3 object.
8
- * The presigned URL expires when the associated role used to sign the request expires or
9
- * the option `expiresIn` is reached. The `expiresAt` property in the output object indicates when the URL MAY expire.
10
- *
11
- * By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`
12
- * to true, this method will verify the given object already exists in S3 before returning a presigned
13
- * URL, and will throw {@link StorageError} if the object does not exist.
14
- *
15
- * @param input - The GetUrlInput object.
16
- * @returns Presigned URL and timestamp when the URL MAY expire.
17
- * @throws service: {@link S3Exception} - thrown when checking for existence of the object
18
- * @throws validation: {@link StorageValidationErrorCode } - Validation errors
19
- * thrown either username or key are not defined.
20
- *
21
- */
22
- const getUrl = (input) => {
6
+ function getUrl(input) {
23
7
  return getUrl$1(Amplify, input);
24
- };
8
+ }
25
9
 
26
10
  export { getUrl };
27
11
  //# sourceMappingURL=getUrl.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUrl.mjs","sources":["../../../../../src/providers/s3/apis/getUrl.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { getUrl as getUrlInternal } from './internal/getUrl';\n/**\n * Get a temporary presigned URL to download the specified S3 object.\n * The presigned URL expires when the associated role used to sign the request expires or\n * the option `expiresIn` is reached. The `expiresAt` property in the output object indicates when the URL MAY expire.\n *\n * By default, it will not validate the object that exists in S3. If you set the `options.validateObjectExistence`\n * to true, this method will verify the given object already exists in S3 before returning a presigned\n * URL, and will throw {@link StorageError} if the object does not exist.\n *\n * @param input - The GetUrlInput object.\n * @returns Presigned URL and timestamp when the URL MAY expire.\n * @throws service: {@link S3Exception} - thrown when checking for existence of the object\n * @throws validation: {@link StorageValidationErrorCode } - Validation errors\n * thrown either username or key are not defined.\n *\n */\nexport const getUrl = (input) => {\n return getUrlInternal(Amplify, input);\n};\n"],"names":["getUrlInternal"],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG,CAAC,KAAK,KAAK;AACjC,IAAI,OAAOA,QAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C;;;;"}
1
+ {"version":3,"file":"getUrl.mjs","sources":["../../../../../src/providers/s3/apis/getUrl.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { getUrl as getUrlInternal } from './internal/getUrl';\nexport function getUrl(input) {\n return getUrlInternal(Amplify, input);\n}\n"],"names":["getUrlInternal"],"mappings":";;;AAAA;AACA;AAGO,SAAS,MAAM,CAAC,KAAK,EAAE;AAC9B,IAAI,OAAOA,QAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C;;;;"}
@@ -1,3 +1,5 @@
1
1
  import { AmplifyClassV6 } from '@aws-amplify/core';
2
- import { CopyInput, CopyOutput } from '../../types';
3
- export declare const copy: (amplify: AmplifyClassV6, input: CopyInput) => Promise<CopyOutput>;
2
+ import { CopyInput, CopyOutput, CopyWithPathInput, CopyWithPathOutput } from '../../types';
3
+ export declare const copy: (amplify: AmplifyClassV6, input: CopyInput | CopyWithPathInput) => Promise<CopyOutput | CopyWithPathOutput>;
4
+ /** @deprecated Use {@link copyWithPath} instead. */
5
+ export declare const copyWithKey: (amplify: AmplifyClassV6, input: CopyInput) => Promise<CopyOutput>;
@@ -9,6 +9,8 @@ import { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs
9
9
  import { assertValidationError } from '../../../../errors/utils/assertValidationError.mjs';
10
10
  import { StorageValidationErrorCode } from '../../../../errors/types/validation.mjs';
11
11
  import { logger } from '../../../../utils/logger.mjs';
12
+ import { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';
13
+ import { isInputWithPath } from '../../utils/isInputWithPath.mjs';
12
14
  import '../../utils/client/base.mjs';
13
15
  import '../../utils/client/getObject.mjs';
14
16
  import '../../utils/client/listObjectsV2.mjs';
@@ -25,7 +27,32 @@ import { getStorageUserAgentValue } from '../../utils/userAgent.mjs';
25
27
 
26
28
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
29
  // SPDX-License-Identifier: Apache-2.0
30
+ const isCopyInputWithPath = (input) => isInputWithPath(input.source);
28
31
  const copy = async (amplify, input) => {
32
+ return isCopyInputWithPath(input)
33
+ ? copyWithPath(amplify, input)
34
+ : copyWithKey(amplify, input);
35
+ };
36
+ const copyWithPath = async (amplify, input) => {
37
+ const { source, destination } = input;
38
+ const { s3Config, bucket, identityId } = await resolveS3ConfigAndInput(amplify);
39
+ assertValidationError(!!source.path, StorageValidationErrorCode.NoSourcePath);
40
+ assertValidationError(!!destination.path, StorageValidationErrorCode.NoDestinationPath);
41
+ const { objectKey: sourcePath } = validateStorageOperationInput(source, identityId);
42
+ const { objectKey: destinationPath } = validateStorageOperationInput(destination, identityId);
43
+ const finalCopySource = `${bucket}/${sourcePath}`;
44
+ const finalCopyDestination = destinationPath;
45
+ logger.debug(`copying "${finalCopySource}" to "${finalCopyDestination}".`);
46
+ await serviceCopy({
47
+ source: finalCopySource,
48
+ destination: finalCopyDestination,
49
+ bucket,
50
+ s3Config,
51
+ });
52
+ return { path: finalCopyDestination };
53
+ };
54
+ /** @deprecated Use {@link copyWithPath} instead. */
55
+ const copyWithKey = async (amplify, input) => {
29
56
  const { source: { key: sourceKey }, destination: { key: destinationKey }, } = input;
30
57
  assertValidationError(!!sourceKey, StorageValidationErrorCode.NoSourceKey);
31
58
  assertValidationError(!!destinationKey, StorageValidationErrorCode.NoDestinationKey);
@@ -35,19 +62,27 @@ const copy = async (amplify, input) => {
35
62
  const finalCopySource = `${bucket}/${sourceKeyPrefix}${sourceKey}`;
36
63
  const finalCopyDestination = `${destinationKeyPrefix}${destinationKey}`;
37
64
  logger.debug(`copying "${finalCopySource}" to "${finalCopyDestination}".`);
65
+ await serviceCopy({
66
+ source: finalCopySource,
67
+ destination: finalCopyDestination,
68
+ bucket,
69
+ s3Config,
70
+ });
71
+ return {
72
+ key: destinationKey,
73
+ };
74
+ };
75
+ const serviceCopy = async ({ source, destination, bucket, s3Config, }) => {
38
76
  await copyObject({
39
77
  ...s3Config,
40
78
  userAgentValue: getStorageUserAgentValue(StorageAction.Copy),
41
79
  }, {
42
80
  Bucket: bucket,
43
- CopySource: finalCopySource,
44
- Key: finalCopyDestination,
81
+ CopySource: source,
82
+ Key: destination,
45
83
  MetadataDirective: 'COPY', // Copies over metadata like contentType as well
46
84
  });
47
- return {
48
- key: destinationKey,
49
- };
50
85
  };
51
86
 
52
- export { copy };
87
+ export { copy, copyWithKey };
53
88
  //# sourceMappingURL=copy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy.mjs","sources":["../../../../../../src/providers/s3/apis/internal/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { resolveS3ConfigAndInput } from '../../utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError';\nimport { copyObject } from '../../utils/client';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nexport const copy = async (amplify, input) => {\n const { source: { key: sourceKey }, destination: { key: destinationKey }, } = input;\n assertValidationError(!!sourceKey, StorageValidationErrorCode.NoSourceKey);\n assertValidationError(!!destinationKey, StorageValidationErrorCode.NoDestinationKey);\n const { s3Config, bucket, keyPrefix: sourceKeyPrefix, } = await resolveS3ConfigAndInput(amplify, input.source);\n const { keyPrefix: destinationKeyPrefix } = await resolveS3ConfigAndInput(amplify, input.destination); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n // TODO(ashwinkumar6) V6-logger: warn `You may copy files from another user if the source level is \"protected\", currently it's ${srcLevel}`\n const finalCopySource = `${bucket}/${sourceKeyPrefix}${sourceKey}`;\n const finalCopyDestination = `${destinationKeyPrefix}${destinationKey}`;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await copyObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(StorageAction.Copy),\n }, {\n Bucket: bucket,\n CopySource: finalCopySource,\n Key: finalCopyDestination,\n MetadataDirective: 'COPY', // Copies over metadata like contentType as well\n });\n return {\n key: destinationKey,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAQY,MAAC,IAAI,GAAG,OAAO,OAAO,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,GAAG,KAAK,CAAC;AACxF,IAAI,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;AAC/E,IAAI,qBAAqB,CAAC,CAAC,CAAC,cAAc,EAAE,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;AACzF,IAAI,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,GAAG,GAAG,MAAM,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AACnH,IAAI,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,GAAG,MAAM,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;AAC1G;AACA,IAAI,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AACvE,IAAI,MAAM,oBAAoB,GAAG,CAAC,EAAE,oBAAoB,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,eAAe,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,IAAI,MAAM,UAAU,CAAC;AACrB,QAAQ,GAAG,QAAQ;AACnB,QAAQ,cAAc,EAAE,wBAAwB,CAAC,aAAa,CAAC,IAAI,CAAC;AACpE,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,UAAU,EAAE,eAAe;AACnC,QAAQ,GAAG,EAAE,oBAAoB;AACjC,QAAQ,iBAAiB,EAAE,MAAM;AACjC,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,GAAG,EAAE,cAAc;AAC3B,KAAK,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"copy.mjs","sources":["../../../../../../src/providers/s3/apis/internal/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { isInputWithPath, resolveS3ConfigAndInput, validateStorageOperationInput, } from '../../utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError';\nimport { copyObject } from '../../utils/client';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nconst isCopyInputWithPath = (input) => isInputWithPath(input.source);\nexport const copy = async (amplify, input) => {\n return isCopyInputWithPath(input)\n ? copyWithPath(amplify, input)\n : copyWithKey(amplify, input);\n};\nconst copyWithPath = async (amplify, input) => {\n const { source, destination } = input;\n const { s3Config, bucket, identityId } = await resolveS3ConfigAndInput(amplify);\n assertValidationError(!!source.path, StorageValidationErrorCode.NoSourcePath);\n assertValidationError(!!destination.path, StorageValidationErrorCode.NoDestinationPath);\n const { objectKey: sourcePath } = validateStorageOperationInput(source, identityId);\n const { objectKey: destinationPath } = validateStorageOperationInput(destination, identityId);\n const finalCopySource = `${bucket}/${sourcePath}`;\n const finalCopyDestination = destinationPath;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket,\n s3Config,\n });\n return { path: finalCopyDestination };\n};\n/** @deprecated Use {@link copyWithPath} instead. */\nexport const copyWithKey = async (amplify, input) => {\n const { source: { key: sourceKey }, destination: { key: destinationKey }, } = input;\n assertValidationError(!!sourceKey, StorageValidationErrorCode.NoSourceKey);\n assertValidationError(!!destinationKey, StorageValidationErrorCode.NoDestinationKey);\n const { s3Config, bucket, keyPrefix: sourceKeyPrefix, } = await resolveS3ConfigAndInput(amplify, input.source);\n const { keyPrefix: destinationKeyPrefix } = await resolveS3ConfigAndInput(amplify, input.destination); // resolveS3ConfigAndInput does not make extra API calls or storage access if called repeatedly.\n // TODO(ashwinkumar6) V6-logger: warn `You may copy files from another user if the source level is \"protected\", currently it's ${srcLevel}`\n const finalCopySource = `${bucket}/${sourceKeyPrefix}${sourceKey}`;\n const finalCopyDestination = `${destinationKeyPrefix}${destinationKey}`;\n logger.debug(`copying \"${finalCopySource}\" to \"${finalCopyDestination}\".`);\n await serviceCopy({\n source: finalCopySource,\n destination: finalCopyDestination,\n bucket,\n s3Config,\n });\n return {\n key: destinationKey,\n };\n};\nconst serviceCopy = async ({ source, destination, bucket, s3Config, }) => {\n await copyObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(StorageAction.Copy),\n }, {\n Bucket: bucket,\n CopySource: source,\n Key: destination,\n MetadataDirective: 'COPY', // Copies over metadata like contentType as well\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;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AE,oBAAoB;AACzC,QAAQ,MAAM;AACd,QAAQ,QAAQ;AAChB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,GAAG,EAAE,cAAc;AAC3B,KAAK,CAAC;AACN,EAAE;AACF,MAAM,WAAW,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,KAAK;AAC1E,IAAI,MAAM,UAAU,CAAC;AACrB,QAAQ,GAAG,QAAQ;AACnB,QAAQ,cAAc,EAAE,wBAAwB,CAAC,aAAa,CAAC,IAAI,CAAC;AACpE,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,UAAU,EAAE,MAAM;AAC1B,QAAQ,GAAG,EAAE,WAAW;AACxB,QAAQ,iBAAiB,EAAE,MAAM;AACjC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
1
  import { AmplifyClassV6 } from '@aws-amplify/core';
2
2
  import { StorageAction } from '@aws-amplify/core/internals/utils';
3
- import { GetPropertiesInput, GetPropertiesOutput } from '../../types';
4
- export declare const getProperties: (amplify: AmplifyClassV6, input: GetPropertiesInput, action?: StorageAction) => Promise<GetPropertiesOutput>;
3
+ import { GetPropertiesInput, GetPropertiesOutput, GetPropertiesWithPathInput, GetPropertiesWithPathOutput } from '../../types';
4
+ export declare const getProperties: (amplify: AmplifyClassV6, input: GetPropertiesInput | GetPropertiesWithPathInput, action?: StorageAction) => Promise<GetPropertiesOutput | GetPropertiesWithPathOutput>;
@@ -8,6 +8,8 @@ import 'buffer';
8
8
  import { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';
9
9
  import '../../../../errors/types/validation.mjs';
10
10
  import { logger } from '../../../../utils/logger.mjs';
11
+ import { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';
12
+ import { STORAGE_INPUT_KEY } from '../../utils/constants.mjs';
11
13
  import '../../utils/client/base.mjs';
12
14
  import '../../utils/client/getObject.mjs';
13
15
  import '../../utils/client/listObjectsV2.mjs';
@@ -25,10 +27,11 @@ import { getStorageUserAgentValue } from '../../utils/userAgent.mjs';
25
27
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
26
28
  // SPDX-License-Identifier: Apache-2.0
27
29
  const getProperties = async (amplify, input, action) => {
28
- const { key, options } = input;
29
- const { s3Config, bucket, keyPrefix } = await resolveS3ConfigAndInput(amplify, options);
30
- const finalKey = `${keyPrefix}${key}`;
31
- logger.debug(`get properties of ${key} from ${finalKey}`);
30
+ const { options: getPropertiesOptions } = input;
31
+ const { s3Config, bucket, keyPrefix, identityId } = await resolveS3ConfigAndInput(amplify, getPropertiesOptions);
32
+ const { inputType, objectKey } = validateStorageOperationInput(input, identityId);
33
+ const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;
34
+ logger.debug(`get properties of ${objectKey} from ${finalKey}`);
32
35
  const response = await headObject({
33
36
  ...s3Config,
34
37
  userAgentValue: getStorageUserAgentValue(action ?? StorageAction.GetProperties),
@@ -36,8 +39,7 @@ const getProperties = async (amplify, input, action) => {
36
39
  Bucket: bucket,
37
40
  Key: finalKey,
38
41
  });
39
- return {
40
- key,
42
+ const result = {
41
43
  contentType: response.ContentType,
42
44
  size: response.ContentLength,
43
45
  eTag: response.ETag,
@@ -45,6 +47,9 @@ const getProperties = async (amplify, input, action) => {
45
47
  metadata: response.Metadata,
46
48
  versionId: response.VersionId,
47
49
  };
50
+ return inputType === STORAGE_INPUT_KEY
51
+ ? { key: objectKey, ...result }
52
+ : { path: objectKey, ...result };
48
53
  };
49
54
 
50
55
  export { getProperties };
@@ -1 +1 @@
1
- {"version":3,"file":"getProperties.mjs","sources":["../../../../../../src/providers/s3/apis/internal/getProperties.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { resolveS3ConfigAndInput } from '../../utils';\nimport { headObject } from '../../utils/client';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nexport const getProperties = async (amplify, input, action) => {\n const { key, options } = input;\n const { s3Config, bucket, keyPrefix } = await resolveS3ConfigAndInput(amplify, options);\n const finalKey = `${keyPrefix}${key}`;\n logger.debug(`get properties of ${key} from ${finalKey}`);\n const response = await headObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(action ?? StorageAction.GetProperties),\n }, {\n Bucket: bucket,\n Key: finalKey,\n });\n return {\n key,\n contentType: response.ContentType,\n size: response.ContentLength,\n eTag: response.ETag,\n lastModified: response.LastModified,\n metadata: response.Metadata,\n versionId: response.VersionId,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAMY,MAAC,aAAa,GAAG,OAAO,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK;AAC/D,IAAI,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AACnC,IAAI,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5F,IAAI,MAAM,QAAQ,GAAG,CAAC,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1C,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC9D,IAAI,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC;AACtC,QAAQ,GAAG,QAAQ;AACnB,QAAQ,cAAc,EAAE,wBAAwB,CAAC,MAAM,IAAI,aAAa,CAAC,aAAa,CAAC;AACvF,KAAK,EAAE;AACP,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,GAAG,EAAE,QAAQ;AACrB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,GAAG;AACX,QAAQ,WAAW,EAAE,QAAQ,CAAC,WAAW;AACzC,QAAQ,IAAI,EAAE,QAAQ,CAAC,aAAa;AACpC,QAAQ,IAAI,EAAE,QAAQ,CAAC,IAAI;AAC3B,QAAQ,YAAY,EAAE,QAAQ,CAAC,YAAY;AAC3C,QAAQ,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AACnC,QAAQ,SAAS,EAAE,QAAQ,CAAC,SAAS;AACrC,KAAK,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"getProperties.mjs","sources":["../../../../../../src/providers/s3/apis/internal/getProperties.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { resolveS3ConfigAndInput, validateStorageOperationInput, } from '../../utils';\nimport { headObject } from '../../utils/client';\nimport { getStorageUserAgentValue } from '../../utils/userAgent';\nimport { logger } from '../../../../utils';\nimport { STORAGE_INPUT_KEY } from '../../utils/constants';\nexport const getProperties = async (amplify, input, action) => {\n const { options: getPropertiesOptions } = input;\n const { s3Config, bucket, keyPrefix, identityId } = await resolveS3ConfigAndInput(amplify, getPropertiesOptions);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n logger.debug(`get properties of ${objectKey} from ${finalKey}`);\n const response = await headObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(action ?? StorageAction.GetProperties),\n }, {\n Bucket: bucket,\n Key: finalKey,\n });\n const result = {\n contentType: response.ContentType,\n size: response.ContentLength,\n eTag: response.ETag,\n lastModified: response.LastModified,\n metadata: response.Metadata,\n versionId: response.VersionId,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;A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