@aws-amplify/storage 6.4.5-unstable.c9a1dbd.0 → 6.4.5

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 (43) hide show
  1. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.browser.js +2 -6
  2. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.browser.js.map +1 -1
  3. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js +1 -5
  4. package/dist/cjs/providers/s3/utils/client/runtime/base64/index.native.js.map +1 -1
  5. package/dist/cjs/providers/s3/utils/client/runtime/index.browser.js +1 -2
  6. package/dist/cjs/providers/s3/utils/client/runtime/index.browser.js.map +1 -1
  7. package/dist/cjs/providers/s3/utils/client/runtime/index.js +1 -2
  8. package/dist/cjs/providers/s3/utils/client/runtime/index.js.map +1 -1
  9. package/dist/cjs/providers/s3/utils/client/runtime/index.native.js +1 -2
  10. package/dist/cjs/providers/s3/utils/client/runtime/index.native.js.map +1 -1
  11. package/dist/cjs/providers/s3/utils/client/utils/index.js +1 -2
  12. package/dist/cjs/providers/s3/utils/client/utils/index.js.map +1 -1
  13. package/dist/cjs/providers/s3/utils/md5.js +16 -26
  14. package/dist/cjs/providers/s3/utils/md5.js.map +1 -1
  15. package/dist/cjs/providers/s3/utils/md5.native.js +28 -17
  16. package/dist/cjs/providers/s3/utils/md5.native.js.map +1 -1
  17. package/dist/esm/providers/s3/utils/client/runtime/base64/index.browser.d.ts +0 -1
  18. package/dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs +2 -5
  19. package/dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs.map +1 -1
  20. package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.d.ts +0 -1
  21. package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs +1 -4
  22. package/dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs.map +1 -1
  23. package/dist/esm/providers/s3/utils/client/runtime/index.browser.d.ts +1 -1
  24. package/dist/esm/providers/s3/utils/client/runtime/index.browser.mjs +1 -1
  25. package/dist/esm/providers/s3/utils/client/runtime/index.d.ts +1 -1
  26. package/dist/esm/providers/s3/utils/client/runtime/index.mjs +1 -1
  27. package/dist/esm/providers/s3/utils/client/runtime/index.native.d.ts +1 -1
  28. package/dist/esm/providers/s3/utils/client/runtime/index.native.mjs +1 -1
  29. package/dist/esm/providers/s3/utils/client/utils/index.d.ts +1 -1
  30. package/dist/esm/providers/s3/utils/client/utils/index.mjs +1 -1
  31. package/dist/esm/providers/s3/utils/md5.mjs +17 -27
  32. package/dist/esm/providers/s3/utils/md5.mjs.map +1 -1
  33. package/dist/esm/providers/s3/utils/md5.native.mjs +28 -17
  34. package/dist/esm/providers/s3/utils/md5.native.mjs.map +1 -1
  35. package/package.json +107 -107
  36. package/src/providers/s3/utils/client/runtime/base64/index.browser.ts +1 -5
  37. package/src/providers/s3/utils/client/runtime/base64/index.native.ts +0 -4
  38. package/src/providers/s3/utils/client/runtime/index.browser.ts +1 -1
  39. package/src/providers/s3/utils/client/runtime/index.native.ts +1 -1
  40. package/src/providers/s3/utils/client/runtime/index.ts +1 -1
  41. package/src/providers/s3/utils/client/utils/index.ts +0 -1
  42. package/src/providers/s3/utils/md5.native.ts +28 -14
  43. package/src/providers/s3/utils/md5.ts +9 -19
@@ -3,18 +3,14 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.toBase64 = exports.utf8Encode = void 0;
6
+ exports.toBase64 = void 0;
7
7
  function bytesToBase64(bytes) {
8
8
  const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');
9
9
  return btoa(base64Str);
10
10
  }
11
- function utf8Encode(input) {
12
- return new TextEncoder().encode(input);
13
- }
14
- exports.utf8Encode = utf8Encode;
15
11
  function toBase64(input) {
16
12
  if (typeof input === 'string') {
17
- return bytesToBase64(utf8Encode(input));
13
+ return bytesToBase64(new TextEncoder().encode(input));
18
14
  }
19
15
  return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));
20
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.browser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = exports.utf8Encode = void 0;\nfunction bytesToBase64(bytes) {\n const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');\n return btoa(base64Str);\n}\nfunction utf8Encode(input) {\n return new TextEncoder().encode(input);\n}\nexports.utf8Encode = utf8Encode;\nfunction toBase64(input) {\n if (typeof input === 'string') {\n return bytesToBase64(utf8Encode(input));\n }\n return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));\n}\nexports.toBase64 = toBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC;AAC/C,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/E,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AACD,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,OAAO,aAAa,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"index.browser.js","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.browser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = void 0;\nfunction bytesToBase64(bytes) {\n const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');\n return btoa(base64Str);\n}\nfunction toBase64(input) {\n if (typeof input === 'string') {\n return bytesToBase64(new TextEncoder().encode(input));\n }\n return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));\n}\nexports.toBase64 = toBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;AAC1B,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/E,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AACD,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,aAAa,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,aAAa,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
@@ -3,12 +3,8 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.toBase64 = exports.utf8Encode = void 0;
6
+ exports.toBase64 = void 0;
7
7
  const buffer_1 = require("buffer");
8
- function utf8Encode(input) {
9
- return buffer_1.Buffer.from(input, 'utf-8');
10
- }
11
- exports.utf8Encode = utf8Encode;
12
8
  function toBase64(input) {
13
9
  if (typeof input === 'string') {
14
10
  return buffer_1.Buffer.from(input, 'utf-8').toString('base64');
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = exports.utf8Encode = void 0;\nconst buffer_1 = require(\"buffer\");\nfunction utf8Encode(input) {\n return buffer_1.Buffer.from(input, 'utf-8');\n}\nexports.utf8Encode = utf8Encode;\nfunction toBase64(input) {\n if (typeof input === 'string') {\n return buffer_1.Buffer.from(input, 'utf-8').toString('base64');\n }\n return buffer_1.Buffer.from(input.buffer).toString('base64');\n}\nexports.toBase64 = toBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACnC,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AACD,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjE,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"index.native.js","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = void 0;\nconst buffer_1 = require(\"buffer\");\nfunction toBase64(input) {\n if (typeof input === 'string') {\n return buffer_1.Buffer.from(input, 'utf-8').toString('base64');\n }\n return buffer_1.Buffer.from(input.buffer).toString('base64');\n}\nexports.toBase64 = toBase64;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;AAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACnC,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjE,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
6
+ exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
7
7
  // Entry point for browser-specific S3 client utilities. It's used where DOMParser is available.
8
8
  var constants_1 = require("./constants");
9
9
  Object.defineProperty(exports, "SEND_DOWNLOAD_PROGRESS_EVENT", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });
@@ -16,5 +16,4 @@ var dom_1 = require("./xmlParser/dom");
16
16
  Object.defineProperty(exports, "parser", { enumerable: true, get: function () { return dom_1.parser; } });
17
17
  var index_browser_1 = require("./base64/index.browser");
18
18
  Object.defineProperty(exports, "toBase64", { enumerable: true, get: function () { return index_browser_1.toBase64; } });
19
- Object.defineProperty(exports, "utf8Encode", { enumerable: true, get: function () { return index_browser_1.utf8Encode; } });
20
19
  //# sourceMappingURL=index.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.browser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for browser-specific S3 client utilities. It's used where DOMParser is available.\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar xhr_1 = require(\"./s3TransferHandler/xhr\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return xhr_1.s3TransferHandler; } });\nvar dom_1 = require(\"./xmlParser/dom\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return dom_1.parser; } });\nvar index_browser_1 = require(\"./base64/index.browser\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_browser_1.toBase64; } });\nObject.defineProperty(exports, \"utf8Encode\", { enumerable: true, get: function () { return index_browser_1.utf8Encode; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,GAAG,KAAK,CAAC,CAAC;AACzO;AACA,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC;AACxJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,qBAAqB,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9I,IAAI,KAAK,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChI,IAAI,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1G,IAAI,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;AACxH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.browser.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.browser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for browser-specific S3 client utilities. It's used where DOMParser is available.\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar xhr_1 = require(\"./s3TransferHandler/xhr\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return xhr_1.s3TransferHandler; } });\nvar dom_1 = require(\"./xmlParser/dom\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return dom_1.parser; } });\nvar index_browser_1 = require(\"./base64/index.browser\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_browser_1.toBase64; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,GAAG,KAAK,CAAC,CAAC;AACpN;AACA,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC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
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
6
+ exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
7
7
  // Entry point for Node.js-specific S3 client utilities
8
8
  // This behavior is not guaranteed in v5.
9
9
  var constants_1 = require("./constants");
@@ -17,5 +17,4 @@ var pureJs_1 = require("./xmlParser/pureJs");
17
17
  Object.defineProperty(exports, "parser", { enumerable: true, get: function () { return pureJs_1.parser; } });
18
18
  var index_native_1 = require("./index.native");
19
19
  Object.defineProperty(exports, "toBase64", { enumerable: true, get: function () { return index_native_1.toBase64; } });
20
- Object.defineProperty(exports, "utf8Encode", { enumerable: true, get: function () { return index_native_1.utf8Encode; } });
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for Node.js-specific S3 client utilities\n// This behavior is not guaranteed in v5.\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar fetch_1 = require(\"./s3TransferHandler/fetch\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return fetch_1.s3TransferHandler; } });\nvar pureJs_1 = require(\"./xmlParser/pureJs\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return pureJs_1.parser; } });\nvar index_native_1 = require(\"./index.native\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_native_1.toBase64; } });\nObject.defineProperty(exports, \"utf8Encode\", { enumerable: true, get: function () { return index_native_1.utf8Encode; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,GAAG,KAAK,CAAC,CAAC;AACzO;AACA;AACA,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,4BAA4B,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AAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for Node.js-specific S3 client utilities\n// This behavior is not guaranteed in v5.\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar fetch_1 = require(\"./s3TransferHandler/fetch\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return fetch_1.s3TransferHandler; } });\nvar pureJs_1 = require(\"./xmlParser/pureJs\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return pureJs_1.parser; } });\nvar index_native_1 = require(\"./index.native\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_native_1.toBase64; } });\n"],"names":[],"mappings":";;AACA;AACA;AAC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AAC,EAAE,EAAE,CAAC,CAAC;AAClI,IAAI,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
6
+ exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;
7
7
  // Entry point for ReactNative-specific S3 client utilities
8
8
  var constants_1 = require("./constants");
9
9
  Object.defineProperty(exports, "SEND_DOWNLOAD_PROGRESS_EVENT", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });
@@ -16,5 +16,4 @@ var pureJs_1 = require("./xmlParser/pureJs");
16
16
  Object.defineProperty(exports, "parser", { enumerable: true, get: function () { return pureJs_1.parser; } });
17
17
  var index_native_1 = require("./base64/index.native");
18
18
  Object.defineProperty(exports, "toBase64", { enumerable: true, get: function () { return index_native_1.toBase64; } });
19
- Object.defineProperty(exports, "utf8Encode", { enumerable: true, get: function () { return index_native_1.utf8Encode; } });
20
19
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.utf8Encode = exports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for ReactNative-specific S3 client utilities\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar xhr_1 = require(\"./s3TransferHandler/xhr\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return xhr_1.s3TransferHandler; } });\nvar pureJs_1 = require(\"./xmlParser/pureJs\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return pureJs_1.parser; } });\nvar index_native_1 = require(\"./base64/index.native\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_native_1.toBase64; } });\nObject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C,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChI,IAAI,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,IAAI,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACtD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;AACvH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.native.js","sources":["../../../../../../../src/providers/s3/utils/client/runtime/index.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = exports.parser = exports.s3TransferHandler = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = void 0;\n// Entry point for ReactNative-specific S3 client utilities\nvar constants_1 = require(\"./constants\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return constants_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return constants_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return constants_1.CONTENT_SHA256_HEADER; } });\nvar xhr_1 = require(\"./s3TransferHandler/xhr\");\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return xhr_1.s3TransferHandler; } });\nvar pureJs_1 = require(\"./xmlParser/pureJs\");\nObject.defineProperty(exports, \"parser\", { enumerable: true, get: function () { return pureJs_1.parser; } });\nvar index_native_1 = require(\"./base64/index.native\");\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return index_native_1.toBase64; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,GAAG,KAAK,CAAC,CAAC;AACpN;AACA,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC;AACxJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,qBAAqB,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9I,IAAI,KAAK,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChI,IAAI,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,IAAI,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACtD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = exports.map = exports.emptyArrayGuard = exports.deserializeTimestamp = exports.deserializeNumber = exports.deserializeMetadata = exports.deserializeBoolean = exports.buildStorageServiceError = exports.utf8Encode = exports.toBase64 = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.s3TransferHandler = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = exports.parseXmlError = exports.parseXmlBody = void 0;
6
+ exports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = exports.map = exports.emptyArrayGuard = exports.deserializeTimestamp = exports.deserializeNumber = exports.deserializeMetadata = exports.deserializeBoolean = exports.buildStorageServiceError = exports.toBase64 = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.s3TransferHandler = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = exports.parseXmlError = exports.parseXmlBody = void 0;
7
7
  var parsePayload_1 = require("./parsePayload");
8
8
  Object.defineProperty(exports, "parseXmlBody", { enumerable: true, get: function () { return parsePayload_1.parseXmlBody; } });
9
9
  Object.defineProperty(exports, "parseXmlError", { enumerable: true, get: function () { return parsePayload_1.parseXmlError; } });
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "s3TransferHandler", { enumerable: true, get: fun
14
14
  Object.defineProperty(exports, "CANCELED_ERROR_MESSAGE", { enumerable: true, get: function () { return runtime_1.CANCELED_ERROR_MESSAGE; } });
15
15
  Object.defineProperty(exports, "CONTENT_SHA256_HEADER", { enumerable: true, get: function () { return runtime_1.CONTENT_SHA256_HEADER; } });
16
16
  Object.defineProperty(exports, "toBase64", { enumerable: true, get: function () { return runtime_1.toBase64; } });
17
- Object.defineProperty(exports, "utf8Encode", { enumerable: true, get: function () { return runtime_1.utf8Encode; } });
18
17
  var deserializeHelpers_1 = require("./deserializeHelpers");
19
18
  Object.defineProperty(exports, "buildStorageServiceError", { enumerable: true, get: function () { return deserializeHelpers_1.buildStorageServiceError; } });
20
19
  Object.defineProperty(exports, "deserializeBoolean", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeBoolean; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = exports.map = exports.emptyArrayGuard = exports.deserializeTimestamp = exports.deserializeNumber = exports.deserializeMetadata = exports.deserializeBoolean = exports.buildStorageServiceError = exports.utf8Encode = exports.toBase64 = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.s3TransferHandler = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = exports.parseXmlError = exports.parseXmlBody = void 0;\nvar parsePayload_1 = require(\"./parsePayload\");\nObject.defineProperty(exports, \"parseXmlBody\", { enumerable: true, get: function () { return parsePayload_1.parseXmlBody; } });\nObject.defineProperty(exports, \"parseXmlError\", { enumerable: true, get: function () { return parsePayload_1.parseXmlError; } });\nvar runtime_1 = require(\"../runtime\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return runtime_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return runtime_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return runtime_1.s3TransferHandler; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return runtime_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return runtime_1.CONTENT_SHA256_HEADER; } });\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return runtime_1.toBase64; } });\nObject.defineProperty(exports, \"utf8Encode\", { enumerable: true, get: function () { return runtime_1.utf8Encode; } });\nvar deserializeHelpers_1 = require(\"./deserializeHelpers\");\nObject.defineProperty(exports, \"buildStorageServiceError\", { enumerable: true, get: function () { return deserializeHelpers_1.buildStorageServiceError; } });\nObject.defineProperty(exports, \"deserializeBoolean\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeBoolean; } });\nObject.defineProperty(exports, \"deserializeMetadata\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeMetadata; } });\nObject.defineProperty(exports, \"deserializeNumber\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeNumber; } });\nObject.defineProperty(exports, \"deserializeTimestamp\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeTimestamp; } });\nObject.defineProperty(exports, \"emptyArrayGuard\", { enumerable: true, get: function () { return deserializeHelpers_1.emptyArrayGuard; } });\nObject.defineProperty(exports, \"map\", { enumerable: true, get: function () { return deserializeHelpers_1.map; } });\nvar serializeHelpers_1 = require(\"./serializeHelpers\");\nObject.defineProperty(exports, \"assignStringVariables\", { enumerable: true, get: function () { return serializeHelpers_1.assignStringVariables; } });\nObject.defineProperty(exports, \"serializeObjectConfigsToHeaders\", { enumerable: true, get: function () { return serializeHelpers_1.serializeObjectConfigsToHeaders; } });\nObject.defineProperty(exports, \"serializePathnameObjectKey\", { enumerable: true, get: function () { return serializeHelpers_1.serializePathnameObjectKey; } });\nObject.defineProperty(exports, \"validateS3RequiredParameter\", { enumerable: true, get: function () { return serializeHelpers_1.validateS3RequiredParameter; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KA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EAAE,iCAAiC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC;AACzK,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,6BAA6B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/providers/s3/utils/client/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateS3RequiredParameter = exports.serializePathnameObjectKey = exports.serializeObjectConfigsToHeaders = exports.assignStringVariables = exports.map = exports.emptyArrayGuard = exports.deserializeTimestamp = exports.deserializeNumber = exports.deserializeMetadata = exports.deserializeBoolean = exports.buildStorageServiceError = exports.toBase64 = exports.CONTENT_SHA256_HEADER = exports.CANCELED_ERROR_MESSAGE = exports.s3TransferHandler = exports.SEND_UPLOAD_PROGRESS_EVENT = exports.SEND_DOWNLOAD_PROGRESS_EVENT = exports.parseXmlError = exports.parseXmlBody = void 0;\nvar parsePayload_1 = require(\"./parsePayload\");\nObject.defineProperty(exports, \"parseXmlBody\", { enumerable: true, get: function () { return parsePayload_1.parseXmlBody; } });\nObject.defineProperty(exports, \"parseXmlError\", { enumerable: true, get: function () { return parsePayload_1.parseXmlError; } });\nvar runtime_1 = require(\"../runtime\");\nObject.defineProperty(exports, \"SEND_DOWNLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return runtime_1.SEND_DOWNLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"SEND_UPLOAD_PROGRESS_EVENT\", { enumerable: true, get: function () { return runtime_1.SEND_UPLOAD_PROGRESS_EVENT; } });\nObject.defineProperty(exports, \"s3TransferHandler\", { enumerable: true, get: function () { return runtime_1.s3TransferHandler; } });\nObject.defineProperty(exports, \"CANCELED_ERROR_MESSAGE\", { enumerable: true, get: function () { return runtime_1.CANCELED_ERROR_MESSAGE; } });\nObject.defineProperty(exports, \"CONTENT_SHA256_HEADER\", { enumerable: true, get: function () { return runtime_1.CONTENT_SHA256_HEADER; } });\nObject.defineProperty(exports, \"toBase64\", { enumerable: true, get: function () { return runtime_1.toBase64; } });\nvar deserializeHelpers_1 = require(\"./deserializeHelpers\");\nObject.defineProperty(exports, \"buildStorageServiceError\", { enumerable: true, get: function () { return deserializeHelpers_1.buildStorageServiceError; } });\nObject.defineProperty(exports, \"deserializeBoolean\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeBoolean; } });\nObject.defineProperty(exports, \"deserializeMetadata\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeMetadata; } });\nObject.defineProperty(exports, \"deserializeNumber\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeNumber; } });\nObject.defineProperty(exports, \"deserializeTimestamp\", { enumerable: true, get: function () { return deserializeHelpers_1.deserializeTimestamp; } });\nObject.defineProperty(exports, \"emptyArrayGuard\", { enumerable: true, get: function () { return deserializeHelpers_1.emptyArrayGuard; } });\nObject.defineProperty(exports, \"map\", { enumerable: true, get: function () { return deserializeHelpers_1.map; } });\nvar serializeHelpers_1 = require(\"./serializeHelpers\");\nObject.defineProperty(exports, \"assignStringVariables\", { enumerable: true, get: function () { return serializeHelpers_1.assignStringVariables; } });\nObject.defineProperty(exports, \"serializeObjectConfigsToHeaders\", { enumerable: true, get: function () { return serializeHelpers_1.serializeObjectConfigsToHeaders; } });\nObject.defineProperty(exports, \"serializePathnameObjectKey\", { enumerable: true, get: function () { return serializeHelpers_1.serializePathnameObjectKey; } });\nObject.defineProperty(exports, \"validateS3RequiredParameter\", { enumerable: true, get: function () { return serializeHelpers_1.validateS3RequiredParameter; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,+BAA+B,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;AACxkB,IAAI,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC/C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/H,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;AACjI,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACtC,MAAM,CAAC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AACrJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iCAAiC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC;AACzK,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,4BAA4B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/J,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,6BAA6B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,EAAE,EAAE,CAAC;;"}
@@ -13,38 +13,28 @@ const calculateContentMd5 = async (content) => {
13
13
  }
14
14
  else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {
15
15
  const blob = new Blob([content]);
16
- const buffer = await readFileToBase64(blob);
16
+ const buffer = await readFile(blob);
17
17
  hasher.update(buffer);
18
18
  }
19
19
  else {
20
- const buffer = await readFileToBase64(content);
21
- hasher.update((0, utils_1.utf8Encode)(buffer));
20
+ const buffer = await readFile(content);
21
+ hasher.update(buffer);
22
22
  }
23
23
  const digest = await hasher.digest();
24
24
  return (0, utils_1.toBase64)(digest);
25
25
  };
26
26
  exports.calculateContentMd5 = calculateContentMd5;
27
- const readFileToBase64 = (blob) => {
28
- return new Promise((resolve, reject) => {
29
- const reader = new FileReader();
30
- reader.onloadend = () => {
31
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
32
- // response from readAsDataURL is always prepended with "data:*/*;base64,"
33
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState
34
- if (reader.readyState !== 2) {
35
- reject(new Error('Reader aborted too early'));
36
- return;
37
- }
38
- resolve(reader.result.split(',')[1]);
39
- };
40
- reader.onabort = () => {
41
- reject(new Error('Read aborted'));
42
- };
43
- reader.onerror = () => {
44
- reject(reader.error);
45
- };
46
- // reader.readAsArrayBuffer is not available in RN
47
- reader.readAsDataURL(blob);
48
- });
49
- };
27
+ const readFile = (file) => new Promise((resolve, reject) => {
28
+ const reader = new FileReader();
29
+ reader.onload = () => {
30
+ resolve(reader.result);
31
+ };
32
+ reader.onabort = () => {
33
+ reject(new Error('Read aborted'));
34
+ };
35
+ reader.onerror = () => {
36
+ reject(reader.error);
37
+ };
38
+ reader.readAsArrayBuffer(file);
39
+ });
50
40
  //# sourceMappingURL=md5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"md5.js","sources":["../../../../../src/providers/s3/utils/md5.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.calculateContentMd5 = void 0;\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFileToBase64(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFileToBase64(content);\n hasher.update((0, utils_1.utf8Encode)(buffer));\n }\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\nconst readFileToBase64 = (blob) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState\n if (reader.readyState !== 2) {\n reject(new Error('Reader aborted too early'));\n return;\n }\n resolve(reader.result.split(',')[1]);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n // reader.readAsArrayBuffer is not available in RN\n reader.readAsDataURL(blob);\n });\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK;AAC/C,IAAI,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;AACtC,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,KAAK;AACL,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,WAAW,EAAE;AAC5E,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,QAAQ,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACpD,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACvD,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AACvD,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;AACzC,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC,CAAC;AACF,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AAClD,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK;AACnC,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5C,QAAQ,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AACxC,QAAQ,MAAM,CAAC,SAAS,GAAG,MAAM;AACjC;AACA;AACA;AACA,YAAY,IAAI,MAAM,CAAC,UAAU,KAAK,CAAC,EAAE;AACzC,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAC9D,gBAAgB,OAAO;AACvB,aAAa;AACb,YAAY,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,OAAO,GAAG,MAAM;AAC/B,YAAY,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC9C,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,OAAO,GAAG,MAAM;AAC/B,YAAY,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,SAAS,CAAC;AACV;AACA,QAAQ,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,CAAC;;"}
1
+ {"version":3,"file":"md5.js","sources":["../../../../../src/providers/s3/utils/md5.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.calculateContentMd5 = void 0;\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsArrayBuffer(file);\n});\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK;AAC/C,IAAI,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;AACtC,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,KAAK;AACL,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,WAAW,EAAE;AAC5E,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,QAAQ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5C,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;AACzC,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC,CAAC;AACF,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AAClD,MAAM,QAAQ,GAAG,CAAC,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5D,IAAI,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AACpC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1C,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;;"}
@@ -4,8 +4,12 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.calculateContentMd5 = void 0;
7
+ const buffer_1 = require("buffer");
7
8
  const md5_js_1 = require("@smithy/md5-js");
8
9
  const utils_1 = require("./client/utils");
10
+ // The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accomodates this
11
+ // by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.
12
+ // TODO: This file should be removable when we drop support for React Native 0.71
9
13
  const calculateContentMd5 = async (content) => {
10
14
  const hasher = new md5_js_1.Md5();
11
15
  if (typeof content === 'string') {
@@ -24,22 +28,29 @@ const calculateContentMd5 = async (content) => {
24
28
  return (0, utils_1.toBase64)(digest);
25
29
  };
26
30
  exports.calculateContentMd5 = calculateContentMd5;
27
- const readFile = (file) => {
28
- return new Promise((resolve, reject) => {
29
- const reader = new FileReader();
30
- reader.onloadend = () => {
31
- if (reader.result) {
32
- resolve(reader.result);
33
- }
34
- reader.onabort = () => {
35
- reject(new Error('Read aborted'));
36
- };
37
- reader.onerror = () => {
38
- reject(reader.error);
39
- };
31
+ const readFile = (file) => new Promise((resolve, reject) => {
32
+ const reader = new FileReader();
33
+ reader.onload = () => {
34
+ resolve(reader.result);
35
+ };
36
+ reader.onabort = () => {
37
+ reject(new Error('Read aborted'));
38
+ };
39
+ reader.onerror = () => {
40
+ reject(reader.error);
41
+ };
42
+ try {
43
+ reader.readAsArrayBuffer(file);
44
+ }
45
+ catch (e) {
46
+ reader.onload = () => {
47
+ // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
48
+ // response from readAsDataURL is always prepended with "data:*/*;base64,"
49
+ const [, base64Data] = reader.result.split(',');
50
+ const arrayBuffer = buffer_1.Buffer.from(base64Data, 'base64');
51
+ resolve(arrayBuffer);
40
52
  };
41
- if (file !== undefined)
42
- reader.readAsArrayBuffer(file);
43
- });
44
- };
53
+ reader.readAsDataURL(file);
54
+ }
55
+ });
45
56
  //# sourceMappingURL=md5.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"md5.native.js","sources":["../../../../../src/providers/s3/utils/md5.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.calculateContentMd5 = void 0;\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\nconst readFile = (file) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n if (reader.result) {\n resolve(reader.result);\n }\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n };\n if (file !== undefined)\n reader.readAsArrayBuffer(file);\n });\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK;AAC/C,IAAI,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;AACtC,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,KAAK;AACL,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,WAAW,EAAE;AAC5E,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,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providers/s3/utils/md5.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.calculateContentMd5 = void 0;\nconst buffer_1 = require(\"buffer\");\nconst md5_js_1 = require(\"@smithy/md5-js\");\nconst utils_1 = require(\"./client/utils\");\n// The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accomodates this\n// by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.\n// TODO: This file should be removable when we drop support for React Native 0.71\nconst calculateContentMd5 = async (content) => {\n const hasher = new md5_js_1.Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return (0, utils_1.toBase64)(digest);\n};\nexports.calculateContentMd5 = calculateContentMd5;\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n try {\n reader.readAsArrayBuffer(file);\n }\n catch (e) {\n reader.onload = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n const [, base64Data] = reader.result.split(',');\n const arrayBuffer = buffer_1.Buffer.from(base64Data, 'base64');\n resolve(arrayBuffer);\n };\n reader.readAsDataURL(file);\n }\n});\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;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AC,MAAM,GAAG,MAAM;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1C,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,KAAK,CAAC;AACN,IAAI,IAAI;AACR,QAAQ,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACvC,KAAK;AACL,IAAI,OAAO,CAAC,EAAE;AACd,QAAQ,MAAM,CAAC,MAAM,GAAG,MAAM;AAC9B;AACA;AACA,YAAY,MAAM,GAAG,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5D,YAAY,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC3E,YAAY,OAAO,CAAC,WAAW,CAAC,CAAC;AACjC,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK;AACL,CAAC,CAAC;;"}
@@ -1,2 +1 @@
1
- export declare function utf8Encode(input: string): Uint8Array;
2
1
  export declare function toBase64(input: string | ArrayBufferView): string;
@@ -4,15 +4,12 @@ function bytesToBase64(bytes) {
4
4
  const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');
5
5
  return btoa(base64Str);
6
6
  }
7
- function utf8Encode(input) {
8
- return new TextEncoder().encode(input);
9
- }
10
7
  function toBase64(input) {
11
8
  if (typeof input === 'string') {
12
- return bytesToBase64(utf8Encode(input));
9
+ return bytesToBase64(new TextEncoder().encode(input));
13
10
  }
14
11
  return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));
15
12
  }
16
13
 
17
- export { toBase64, utf8Encode };
14
+ export { toBase64 };
18
15
  //# sourceMappingURL=index.browser.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.mjs","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.browser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction bytesToBase64(bytes) {\n const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');\n return btoa(base64Str);\n}\nexport function utf8Encode(input) {\n return new TextEncoder().encode(input);\n}\nexport function toBase64(input) {\n if (typeof input === 'string') {\n return bytesToBase64(utf8Encode(input));\n }\n return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/E,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AACM,SAAS,UAAU,CAAC,KAAK,EAAE;AAClC,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AACM,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,OAAO,aAAa,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F;;;;"}
1
+ {"version":3,"file":"index.browser.mjs","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.browser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction bytesToBase64(bytes) {\n const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');\n return btoa(base64Str);\n}\nexport function toBase64(input) {\n if (typeof input === 'string') {\n return bytesToBase64(new TextEncoder().encode(input));\n }\n return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/E,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC;AACM,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,aAAa,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,aAAa,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F;;;;"}
@@ -1,2 +1 @@
1
- export declare function utf8Encode(input: string): Uint8Array;
2
1
  export declare function toBase64(input: string | ArrayBufferView): string;
@@ -2,9 +2,6 @@ import { Buffer } from 'buffer';
2
2
 
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
- function utf8Encode(input) {
6
- return Buffer.from(input, 'utf-8');
7
- }
8
5
  function toBase64(input) {
9
6
  if (typeof input === 'string') {
10
7
  return Buffer.from(input, 'utf-8').toString('base64');
@@ -12,5 +9,5 @@ function toBase64(input) {
12
9
  return Buffer.from(input.buffer).toString('base64');
13
10
  }
14
11
 
15
- export { toBase64, utf8Encode };
12
+ export { toBase64 };
16
13
  //# sourceMappingURL=index.native.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.mjs","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Buffer } from 'buffer';\nexport function utf8Encode(input) {\n return Buffer.from(input, 'utf-8');\n}\nexport function toBase64(input) {\n if (typeof input === 'string') {\n return Buffer.from(input, 'utf-8').toString('base64');\n }\n return Buffer.from(input.buffer).toString('base64');\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,SAAS,UAAU,CAAC,KAAK,EAAE;AAClC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AACM,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxD;;;;"}
1
+ {"version":3,"file":"index.native.mjs","sources":["../../../../../../../../src/providers/s3/utils/client/runtime/base64/index.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Buffer } from 'buffer';\nexport function toBase64(input) {\n if (typeof input === 'string') {\n return Buffer.from(input, 'utf-8').toString('base64');\n }\n return Buffer.from(input.buffer).toString('base64');\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEO,SAAS,QAAQ,CAAC,KAAK,EAAE;AAChC,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9D,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxD;;;;"}
@@ -1,4 +1,4 @@
1
1
  export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, } from './constants';
2
2
  export { s3TransferHandler } from './s3TransferHandler/xhr';
3
3
  export { parser } from './xmlParser/dom';
4
- export { toBase64, utf8Encode } from './base64/index.browser';
4
+ export { toBase64 } from './base64/index.browser';
@@ -1,5 +1,5 @@
1
1
  export { CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT } from './constants.mjs';
2
2
  export { s3TransferHandler } from './s3TransferHandler/xhr.mjs';
3
3
  export { parser } from './xmlParser/dom.mjs';
4
- export { toBase64, utf8Encode } from './base64/index.browser.mjs';
4
+ export { toBase64 } from './base64/index.browser.mjs';
5
5
  //# sourceMappingURL=index.browser.mjs.map
@@ -1,4 +1,4 @@
1
1
  export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, } from './constants';
2
2
  export { s3TransferHandler } from './s3TransferHandler/fetch';
3
3
  export { parser } from './xmlParser/pureJs';
4
- export { toBase64, utf8Encode } from './index.native';
4
+ export { toBase64 } from './index.native';
@@ -2,5 +2,5 @@ export { CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, SEND_DOWNLOAD_PROGRESS_E
2
2
  export { s3TransferHandler } from './s3TransferHandler/fetch.mjs';
3
3
  export { parser } from './xmlParser/pureJs.mjs';
4
4
  import './s3TransferHandler/xhr.mjs';
5
- export { toBase64, utf8Encode } from './base64/index.native.mjs';
5
+ export { toBase64 } from './base64/index.native.mjs';
6
6
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
1
  export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, } from './constants';
2
2
  export { s3TransferHandler } from './s3TransferHandler/xhr';
3
3
  export { parser } from './xmlParser/pureJs';
4
- export { toBase64, utf8Encode } from './base64/index.native';
4
+ export { toBase64 } from './base64/index.native';
@@ -1,5 +1,5 @@
1
1
  export { CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT } from './constants.mjs';
2
2
  export { s3TransferHandler } from './s3TransferHandler/xhr.mjs';
3
3
  export { parser } from './xmlParser/pureJs.mjs';
4
- export { toBase64, utf8Encode } from './base64/index.native.mjs';
4
+ export { toBase64 } from './base64/index.native.mjs';
5
5
  //# sourceMappingURL=index.native.mjs.map
@@ -1,4 +1,4 @@
1
1
  export { parseXmlBody, parseXmlError } from './parsePayload';
2
- export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, s3TransferHandler, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, toBase64, utf8Encode, } from '../runtime';
2
+ export { SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT, s3TransferHandler, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, toBase64, } from '../runtime';
3
3
  export { buildStorageServiceError, deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map, } from './deserializeHelpers';
4
4
  export { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, validateS3RequiredParameter, } from './serializeHelpers';
@@ -3,7 +3,7 @@ export { CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, SEND_DOWNLOAD_PROGRESS_E
3
3
  export { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';
4
4
  import 'fast-xml-parser';
5
5
  import '../runtime/s3TransferHandler/xhr.mjs';
6
- export { toBase64, utf8Encode } from '../runtime/base64/index.native.mjs';
6
+ export { toBase64 } from '../runtime/base64/index.native.mjs';
7
7
  export { buildStorageServiceError, deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map } from './deserializeHelpers.mjs';
8
8
  export { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, validateS3RequiredParameter } from './serializeHelpers.mjs';
9
9
  //# sourceMappingURL=index.mjs.map
@@ -3,7 +3,7 @@ import '@aws-amplify/core/internals/aws-client-utils';
3
3
  import './client/runtime/s3TransferHandler/fetch.mjs';
4
4
  import 'fast-xml-parser';
5
5
  import './client/runtime/s3TransferHandler/xhr.mjs';
6
- import { utf8Encode, toBase64 } from './client/runtime/base64/index.native.mjs';
6
+ import { toBase64 } from './client/runtime/base64/index.native.mjs';
7
7
  import '@aws-amplify/core/internals/utils';
8
8
 
9
9
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -15,39 +15,29 @@ const calculateContentMd5 = async (content) => {
15
15
  }
16
16
  else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {
17
17
  const blob = new Blob([content]);
18
- const buffer = await readFileToBase64(blob);
18
+ const buffer = await readFile(blob);
19
19
  hasher.update(buffer);
20
20
  }
21
21
  else {
22
- const buffer = await readFileToBase64(content);
23
- hasher.update(utf8Encode(buffer));
22
+ const buffer = await readFile(content);
23
+ hasher.update(buffer);
24
24
  }
25
25
  const digest = await hasher.digest();
26
26
  return toBase64(digest);
27
27
  };
28
- const readFileToBase64 = (blob) => {
29
- return new Promise((resolve, reject) => {
30
- const reader = new FileReader();
31
- reader.onloadend = () => {
32
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
33
- // response from readAsDataURL is always prepended with "data:*/*;base64,"
34
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState
35
- if (reader.readyState !== 2) {
36
- reject(new Error('Reader aborted too early'));
37
- return;
38
- }
39
- resolve(reader.result.split(',')[1]);
40
- };
41
- reader.onabort = () => {
42
- reject(new Error('Read aborted'));
43
- };
44
- reader.onerror = () => {
45
- reject(reader.error);
46
- };
47
- // reader.readAsArrayBuffer is not available in RN
48
- reader.readAsDataURL(blob);
49
- });
50
- };
28
+ const readFile = (file) => new Promise((resolve, reject) => {
29
+ const reader = new FileReader();
30
+ reader.onload = () => {
31
+ resolve(reader.result);
32
+ };
33
+ reader.onabort = () => {
34
+ reject(new Error('Read aborted'));
35
+ };
36
+ reader.onerror = () => {
37
+ reject(reader.error);
38
+ };
39
+ reader.readAsArrayBuffer(file);
40
+ });
51
41
 
52
42
  export { calculateContentMd5 };
53
43
  //# sourceMappingURL=md5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"md5.mjs","sources":["../../../../../src/providers/s3/utils/md5.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Md5 } from '@smithy/md5-js';\nimport { toBase64, utf8Encode } from './client/utils';\nexport const calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFileToBase64(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFileToBase64(content);\n hasher.update(utf8Encode(buffer));\n }\n const digest = await hasher.digest();\n return toBase64(digest);\n};\nconst readFileToBase64 = (blob) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState\n if (reader.readyState !== 2) {\n reject(new Error('Reader aborted too early'));\n return;\n }\n resolve(reader.result.split(',')[1]);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n // reader.readAsArrayBuffer is not available in RN\n reader.readAsDataURL(blob);\n });\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAGY,MAAC,mBAAmB,GAAG,OAAO,OAAO,KAAK;AACtD,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;AAC7B,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,KAAK;AACL,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,WAAW,EAAE;AAC5E,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,QAAQ,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACpD,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACvD,QAAQ,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;AACzC,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5B,EAAE;AACF,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK;AACnC,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5C,QAAQ,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AACxC,QAAQ,MAAM,CAAC,SAAS,GAAG,MAAM;AACjC;AACA;AACA;AACA,YAAY,IAAI,MAAM,CAAC,UAAU,KAAK,CAAC,EAAE;AACzC,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAC9D,gBAAgB,OAAO;AACvB,aAAa;AACb,YAAY,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,OAAO,GAAG,MAAM;AAC/B,YAAY,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC9C,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,OAAO,GAAG,MAAM;AAC/B,YAAY,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC,SAAS,CAAC;AACV;AACA,QAAQ,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
1
+ {"version":3,"file":"md5.mjs","sources":["../../../../../src/providers/s3/utils/md5.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Md5 } from '@smithy/md5-js';\nimport { toBase64 } from './client/utils';\nexport const calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return toBase64(digest);\n};\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsArrayBuffer(file);\n});\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAGY,MAAC,mBAAmB,GAAG,OAAO,OAAO,KAAK;AACtD,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;AAC7B,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,KAAK;AACL,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,YAAY,WAAW,EAAE;AAC5E,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,QAAQ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5C,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;AACzC,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5B,EAAE;AACF,MAAM,QAAQ,GAAG,CAAC,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5D,IAAI,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AACpC,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1C,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import { Buffer } from 'buffer';
1
2
  import { Md5 } from '@smithy/md5-js';
2
3
  import '@aws-amplify/core/internals/aws-client-utils';
3
4
  import './client/runtime/s3TransferHandler/fetch.mjs';
@@ -8,6 +9,9 @@ import '@aws-amplify/core/internals/utils';
8
9
 
9
10
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
10
11
  // SPDX-License-Identifier: Apache-2.0
12
+ // The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accomodates this
13
+ // by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.
14
+ // TODO: This file should be removable when we drop support for React Native 0.71
11
15
  const calculateContentMd5 = async (content) => {
12
16
  const hasher = new Md5();
13
17
  if (typeof content === 'string') {
@@ -25,24 +29,31 @@ const calculateContentMd5 = async (content) => {
25
29
  const digest = await hasher.digest();
26
30
  return toBase64(digest);
27
31
  };
28
- const readFile = (file) => {
29
- return new Promise((resolve, reject) => {
30
- const reader = new FileReader();
31
- reader.onloadend = () => {
32
- if (reader.result) {
33
- resolve(reader.result);
34
- }
35
- reader.onabort = () => {
36
- reject(new Error('Read aborted'));
37
- };
38
- reader.onerror = () => {
39
- reject(reader.error);
40
- };
32
+ const readFile = (file) => new Promise((resolve, reject) => {
33
+ const reader = new FileReader();
34
+ reader.onload = () => {
35
+ resolve(reader.result);
36
+ };
37
+ reader.onabort = () => {
38
+ reject(new Error('Read aborted'));
39
+ };
40
+ reader.onerror = () => {
41
+ reject(reader.error);
42
+ };
43
+ try {
44
+ reader.readAsArrayBuffer(file);
45
+ }
46
+ catch (e) {
47
+ reader.onload = () => {
48
+ // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
49
+ // response from readAsDataURL is always prepended with "data:*/*;base64,"
50
+ const [, base64Data] = reader.result.split(',');
51
+ const arrayBuffer = Buffer.from(base64Data, 'base64');
52
+ resolve(arrayBuffer);
41
53
  };
42
- if (file !== undefined)
43
- reader.readAsArrayBuffer(file);
44
- });
45
- };
54
+ reader.readAsDataURL(file);
55
+ }
56
+ });
46
57
 
47
58
  export { calculateContentMd5 };
48
59
  //# sourceMappingURL=md5.native.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"md5.native.mjs","sources":["../../../../../src/providers/s3/utils/md5.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Md5 } from '@smithy/md5-js';\nimport { toBase64 } from './client/utils';\nexport const calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return toBase64(digest);\n};\nconst readFile = (file) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n if (reader.result) {\n resolve(reader.result);\n }\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n };\n if (file !== undefined)\n reader.readAsArrayBuffer(file);\n });\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAGY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,CAAC;AACd,YAAY,MAAM,CAAC,OAAO,GAAG,MAAM;AACnC,gBAAgB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,aAAa,CAAC;AACd,SAAS,CAAC;AACV,QAAQ,IAAI,IAAI,KAAK,SAAS;AAC9B,YAAY,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAC3C,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
1
+ {"version":3,"file":"md5.native.mjs","sources":["../../../../../src/providers/s3/utils/md5.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Buffer } from 'buffer';\nimport { Md5 } from '@smithy/md5-js';\nimport { toBase64 } from './client/utils';\n// The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accomodates this\n// by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.\n// TODO: This file should be removable when we drop support for React Native 0.71\nexport const calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n if (typeof content === 'string') {\n hasher.update(content);\n }\n else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {\n const blob = new Blob([content]);\n const buffer = await readFile(blob);\n hasher.update(buffer);\n }\n else {\n const buffer = await readFile(content);\n hasher.update(buffer);\n }\n const digest = await hasher.digest();\n return toBase64(digest);\n};\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n try {\n reader.readAsArrayBuffer(file);\n }\n catch (e) {\n reader.onload = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n const [, base64Data] = reader.result.split(',');\n const arrayBuffer = Buffer.from(base64Data, 'base64');\n resolve(arrayBuffer);\n };\n reader.readAsDataURL(file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C1C,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,OAAO,GAAG,MAAM;AAC3B,QAAQ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,KAAK,CAAC;AACN,IAAI,IAAI;AACR,QAAQ,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACvC,KAAK;AACL,IAAI,OAAO,CAAC,EAAE;AACd,QAAQ,MAAM,CAAC,MAAM,GAAG,MAAM;AAC9B;AACA;AACA,YAAY,MAAM,GAAG,UAAU,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5D,YAAY,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAClE,YAAY,OAAO,CAAC,WAAW,CAAC,CAAC;AACjC,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACnC,KAAK;AACL,CAAC,CAAC;;;;"}
package/package.json CHANGED
@@ -1,109 +1,109 @@
1
1
  {
2
- "name": "@aws-amplify/storage",
3
- "version": "6.4.5-unstable.c9a1dbd.0+c9a1dbd",
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 --forceExit -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.3.2-unstable.c9a1dbd.0+c9a1dbd"
102
- },
103
- "devDependencies": {
104
- "@aws-amplify/core": "6.3.2-unstable.c9a1dbd.0+c9a1dbd",
105
- "@aws-amplify/react-native": "1.1.2-unstable.c9a1dbd.0+c9a1dbd",
106
- "typescript": "5.0.2"
107
- },
108
- "gitHead": "c9a1dbdcc2613394da4d5a9f408b236bb0bdabe4"
2
+ "name": "@aws-amplify/storage",
3
+ "version": "6.4.5",
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 --forceExit -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.1.0"
102
+ },
103
+ "devDependencies": {
104
+ "@aws-amplify/core": "6.3.1",
105
+ "@aws-amplify/react-native": "1.1.1",
106
+ "typescript": "5.0.2"
107
+ },
108
+ "gitHead": "19c8eea1e80a643573f47fa99a6cd011d5dae281"
109
109
  }
@@ -7,13 +7,9 @@ function bytesToBase64(bytes: Uint8Array): string {
7
7
  return btoa(base64Str);
8
8
  }
9
9
 
10
- export function utf8Encode(input: string): Uint8Array {
11
- return new TextEncoder().encode(input);
12
- }
13
-
14
10
  export function toBase64(input: string | ArrayBufferView): string {
15
11
  if (typeof input === 'string') {
16
- return bytesToBase64(utf8Encode(input));
12
+ return bytesToBase64(new TextEncoder().encode(input));
17
13
  }
18
14
 
19
15
  return bytesToBase64(
@@ -3,10 +3,6 @@
3
3
 
4
4
  import { Buffer } from 'buffer';
5
5
 
6
- export function utf8Encode(input: string): Uint8Array {
7
- return Buffer.from(input, 'utf-8');
8
- }
9
-
10
6
  export function toBase64(input: string | ArrayBufferView): string {
11
7
  if (typeof input === 'string') {
12
8
  return Buffer.from(input, 'utf-8').toString('base64');
@@ -10,4 +10,4 @@ export {
10
10
  } from './constants';
11
11
  export { s3TransferHandler } from './s3TransferHandler/xhr';
12
12
  export { parser } from './xmlParser/dom';
13
- export { toBase64, utf8Encode } from './base64/index.browser';
13
+ export { toBase64 } from './base64/index.browser';
@@ -10,4 +10,4 @@ export {
10
10
  } from './constants';
11
11
  export { s3TransferHandler } from './s3TransferHandler/xhr';
12
12
  export { parser } from './xmlParser/pureJs';
13
- export { toBase64, utf8Encode } from './base64/index.native';
13
+ export { toBase64 } from './base64/index.native';
@@ -11,4 +11,4 @@ export {
11
11
  } from './constants';
12
12
  export { s3TransferHandler } from './s3TransferHandler/fetch';
13
13
  export { parser } from './xmlParser/pureJs';
14
- export { toBase64, utf8Encode } from './index.native';
14
+ export { toBase64 } from './index.native';
@@ -9,7 +9,6 @@ export {
9
9
  CANCELED_ERROR_MESSAGE,
10
10
  CONTENT_SHA256_HEADER,
11
11
  toBase64,
12
- utf8Encode,
13
12
  } from '../runtime';
14
13
  export {
15
14
  buildStorageServiceError,
@@ -1,10 +1,15 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ import { Buffer } from 'buffer';
5
+
4
6
  import { Md5 } from '@smithy/md5-js';
5
7
 
6
8
  import { toBase64 } from './client/utils';
7
9
 
10
+ // The FileReader in React Native 0.71 did not support `readAsArrayBuffer`. This native implementation accomodates this
11
+ // by attempting to use `readAsArrayBuffer` and changing the file reading strategy if it throws an error.
12
+ // TODO: This file should be removable when we drop support for React Native 0.71
8
13
  export const calculateContentMd5 = async (
9
14
  content: Blob | string | ArrayBuffer | ArrayBufferView,
10
15
  ): Promise<string> => {
@@ -24,20 +29,29 @@ export const calculateContentMd5 = async (
24
29
  return toBase64(digest);
25
30
  };
26
31
 
27
- const readFile = (file: Blob): Promise<ArrayBuffer> => {
28
- return new Promise((resolve, reject) => {
32
+ const readFile = (file: Blob): Promise<ArrayBuffer> =>
33
+ new Promise((resolve, reject) => {
29
34
  const reader = new FileReader();
30
- reader.onloadend = () => {
31
- if (reader.result) {
32
- resolve(reader.result as ArrayBuffer);
33
- }
34
- reader.onabort = () => {
35
- reject(new Error('Read aborted'));
36
- };
37
- reader.onerror = () => {
38
- reject(reader.error);
39
- };
35
+ reader.onload = () => {
36
+ resolve(reader.result as ArrayBuffer);
37
+ };
38
+ reader.onabort = () => {
39
+ reject(new Error('Read aborted'));
40
40
  };
41
- if (file !== undefined) reader.readAsArrayBuffer(file);
41
+ reader.onerror = () => {
42
+ reject(reader.error);
43
+ };
44
+
45
+ try {
46
+ reader.readAsArrayBuffer(file);
47
+ } catch (e) {
48
+ reader.onload = () => {
49
+ // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
50
+ // response from readAsDataURL is always prepended with "data:*/*;base64,"
51
+ const [, base64Data] = (reader.result as string).split(',');
52
+ const arrayBuffer = Buffer.from(base64Data, 'base64');
53
+ resolve(arrayBuffer);
54
+ };
55
+ reader.readAsDataURL(file);
56
+ }
42
57
  });
43
- };
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { Md5 } from '@smithy/md5-js';
5
5
 
6
- import { toBase64, utf8Encode } from './client/utils';
6
+ import { toBase64 } from './client/utils';
7
7
 
8
8
  export const calculateContentMd5 = async (
9
9
  content: Blob | string | ArrayBuffer | ArrayBufferView,
@@ -13,30 +13,22 @@ export const calculateContentMd5 = async (
13
13
  hasher.update(content);
14
14
  } else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) {
15
15
  const blob = new Blob([content]);
16
- const buffer = await readFileToBase64(blob);
16
+ const buffer = await readFile(blob);
17
17
  hasher.update(buffer);
18
18
  } else {
19
- const buffer = await readFileToBase64(content);
20
- hasher.update(utf8Encode(buffer));
19
+ const buffer = await readFile(content);
20
+ hasher.update(buffer);
21
21
  }
22
22
  const digest = await hasher.digest();
23
23
 
24
24
  return toBase64(digest);
25
25
  };
26
26
 
27
- const readFileToBase64 = (blob: Blob): Promise<string> => {
28
- return new Promise((resolve, reject) => {
27
+ const readFile = (file: Blob): Promise<ArrayBuffer> =>
28
+ new Promise((resolve, reject) => {
29
29
  const reader = new FileReader();
30
- reader.onloadend = () => {
31
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
32
- // response from readAsDataURL is always prepended with "data:*/*;base64,"
33
- // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState
34
- if (reader.readyState !== 2) {
35
- reject(new Error('Reader aborted too early'));
36
-
37
- return;
38
- }
39
- resolve((reader.result as string).split(',')[1]);
30
+ reader.onload = () => {
31
+ resolve(reader.result as ArrayBuffer);
40
32
  };
41
33
  reader.onabort = () => {
42
34
  reject(new Error('Read aborted'));
@@ -44,7 +36,5 @@ const readFileToBase64 = (blob: Blob): Promise<string> => {
44
36
  reader.onerror = () => {
45
37
  reject(reader.error);
46
38
  };
47
- // reader.readAsArrayBuffer is not available in RN
48
- reader.readAsDataURL(blob);
39
+ reader.readAsArrayBuffer(file);
49
40
  });
50
- };