@aws-amplify/storage 4.5.2-size-improvement.21 → 4.5.2

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.
@@ -47474,13 +47474,12 @@ module.exports = g;
47474
47474
  "use strict";
47475
47475
  __webpack_require__.r(__webpack_exports__);
47476
47476
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Storage", function() { return Storage; });
47477
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
47478
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
47479
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
47480
- /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers */ "./lib-esm/providers/index.js");
47481
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
47482
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
47483
- /* harmony import */ var _providers_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./providers/AWSS3UploadTask */ "./lib-esm/providers/AWSS3UploadTask.js");
47477
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
47478
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
47479
+ /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./providers */ "./lib-esm/providers/index.js");
47480
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
47481
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);
47482
+ /* harmony import */ var _providers_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./providers/AWSS3UploadTask */ "./lib-esm/providers/AWSS3UploadTask.js");
47484
47483
  /*
47485
47484
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
47486
47485
  *
@@ -47493,12 +47492,54 @@ __webpack_require__.r(__webpack_exports__);
47493
47492
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
47494
47493
  * and limitations under the License.
47495
47494
  */
47495
+ var __assign = undefined && undefined.__assign || function () {
47496
+ __assign = Object.assign || function (t) {
47497
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
47498
+ s = arguments[i];
47499
+
47500
+ for (var p in s) {
47501
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
47502
+ }
47503
+ }
47504
+
47505
+ return t;
47506
+ };
47507
+
47508
+ return __assign.apply(this, arguments);
47509
+ };
47510
+
47511
+ var __read = undefined && undefined.__read || function (o, n) {
47512
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
47513
+ if (!m) return o;
47514
+ var i = m.call(o),
47515
+ r,
47516
+ ar = [],
47517
+ e;
47518
+
47519
+ try {
47520
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
47521
+ ar.push(r.value);
47522
+ }
47523
+ } catch (error) {
47524
+ e = {
47525
+ error: error
47526
+ };
47527
+ } finally {
47528
+ try {
47529
+ if (r && !r.done && (m = i["return"])) m.call(i);
47530
+ } finally {
47531
+ if (e) throw e.error;
47532
+ }
47533
+ }
47534
+
47535
+ return ar;
47536
+ };
47496
47537
 
47497
47538
 
47498
47539
 
47499
47540
 
47500
47541
 
47501
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["ConsoleLogger"]('StorageClass');
47542
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('StorageClass');
47502
47543
  var DEFAULT_PROVIDER = 'AWSS3';
47503
47544
  /**
47504
47545
  * Provide storage methods to use AWS S3
@@ -47580,7 +47621,7 @@ function () {
47580
47621
 
47581
47622
  logger.debug('configure Storage');
47582
47623
  if (!config) return this._config;
47583
- var amplifyConfig = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Parser"].parseMobilehubConfig(config);
47624
+ var amplifyConfig = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Parser"].parseMobilehubConfig(config);
47584
47625
  var storageKeysFromConfig = Object.keys(amplifyConfig.Storage);
47585
47626
  var storageArrayKeys = ['bucket', 'region', 'level', 'track', 'customPrefix', 'serverSideEncryption', 'SSECustomerAlgorithm', 'SSECustomerKey', 'SSECustomerKeyMD5', 'SSEKMSKeyId'];
47586
47627
 
@@ -47601,7 +47642,7 @@ function () {
47601
47642
  }
47602
47643
 
47603
47644
  Object.entries(amplifyConfig.Storage).map(function (_a) {
47604
- var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a, 2),
47645
+ var _b = __read(_a, 2),
47605
47646
  key = _b[0],
47606
47647
  value = _b[1];
47607
47648
 
@@ -47613,7 +47654,7 @@ function () {
47613
47654
 
47614
47655
  Object.keys(amplifyConfig.Storage).forEach(function (providerName) {
47615
47656
  if (typeof amplifyConfig.Storage[providerName] !== 'string') {
47616
- _this._config[providerName] = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, _this._config[providerName]), amplifyConfig.Storage[providerName]);
47657
+ _this._config[providerName] = __assign(__assign({}, _this._config[providerName]), amplifyConfig.Storage[providerName]);
47617
47658
  }
47618
47659
  });
47619
47660
 
@@ -47622,14 +47663,14 @@ function () {
47622
47663
  });
47623
47664
 
47624
47665
  if (this._pluggables.length === 0) {
47625
- this.addPluggable(new _providers__WEBPACK_IMPORTED_MODULE_2__["AWSS3Provider"]());
47666
+ this.addPluggable(new _providers__WEBPACK_IMPORTED_MODULE_1__["AWSS3Provider"]());
47626
47667
  }
47627
47668
 
47628
47669
  return this._config;
47629
47670
  };
47630
47671
 
47631
47672
  Storage.prototype.getCancellableTokenSource = function () {
47632
- return axios__WEBPACK_IMPORTED_MODULE_3___default.a.CancelToken.source();
47673
+ return axios__WEBPACK_IMPORTED_MODULE_2___default.a.CancelToken.source();
47633
47674
  };
47634
47675
 
47635
47676
  Storage.prototype.updateRequestToBeCancellable = function (request, cancelTokenSource) {
@@ -47641,7 +47682,7 @@ function () {
47641
47682
  };
47642
47683
 
47643
47684
  Storage.prototype.cancel = function (request, message) {
47644
- if (request instanceof _providers_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_4__["AWSS3UploadTask"]) {
47685
+ if (request instanceof _providers_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_3__["AWSS3UploadTask"]) {
47645
47686
  return request._cancel();
47646
47687
  }
47647
47688
 
@@ -47672,7 +47713,7 @@ function () {
47672
47713
  return Promise.reject(".copy is not implemented on provider " + prov.getProviderName());
47673
47714
  }
47674
47715
 
47675
- var responsePromise = prov.copy(src, dest, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, config), {
47716
+ var responsePromise = prov.copy(src, dest, __assign(__assign({}, config), {
47676
47717
  cancelTokenSource: cancelTokenSource
47677
47718
  }));
47678
47719
  this.updateRequestToBeCancellable(responsePromise, cancelTokenSource);
@@ -47692,7 +47733,7 @@ function () {
47692
47733
  }
47693
47734
 
47694
47735
  var cancelTokenSource = this.getCancellableTokenSource();
47695
- var responsePromise = prov.get(key, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, config), {
47736
+ var responsePromise = prov.get(key, __assign(__assign({}, config), {
47696
47737
  cancelTokenSource: cancelTokenSource
47697
47738
  }));
47698
47739
  this.updateRequestToBeCancellable(responsePromise, cancelTokenSource);
@@ -47700,7 +47741,7 @@ function () {
47700
47741
  };
47701
47742
 
47702
47743
  Storage.prototype.isCancelError = function (error) {
47703
- return axios__WEBPACK_IMPORTED_MODULE_3___default.a.isCancel(error);
47744
+ return axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error);
47704
47745
  };
47705
47746
 
47706
47747
  Storage.prototype.put = function (key, object, config) {
@@ -47716,7 +47757,7 @@ function () {
47716
47757
  }
47717
47758
 
47718
47759
  var cancelTokenSource = this.getCancellableTokenSource();
47719
- var response = prov.put(key, object, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, config), {
47760
+ var response = prov.put(key, object, __assign(__assign({}, config), {
47720
47761
  cancelTokenSource: cancelTokenSource
47721
47762
  }));
47722
47763
 
@@ -47785,18 +47826,175 @@ __webpack_require__.r(__webpack_exports__);
47785
47826
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prefixMiddlewareOptions", function() { return prefixMiddlewareOptions; });
47786
47827
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "credentialsProvider", function() { return credentialsProvider; });
47787
47828
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createS3Client", function() { return createS3Client; });
47788
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
47789
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
47790
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
47791
- /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
47792
- /* harmony import */ var _providers_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../providers/axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
47793
- /* harmony import */ var _StorageConstants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./StorageConstants */ "./lib-esm/common/StorageConstants.js");
47829
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
47830
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
47831
+ /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
47832
+ /* harmony import */ var _providers_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../providers/axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
47833
+ /* harmony import */ var _StorageConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./StorageConstants */ "./lib-esm/common/StorageConstants.js");
47834
+ var __assign = undefined && undefined.__assign || function () {
47835
+ __assign = Object.assign || function (t) {
47836
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
47837
+ s = arguments[i];
47838
+
47839
+ for (var p in s) {
47840
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
47841
+ }
47842
+ }
47843
+
47844
+ return t;
47845
+ };
47846
+
47847
+ return __assign.apply(this, arguments);
47848
+ };
47849
+
47850
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
47851
+ function adopt(value) {
47852
+ return value instanceof P ? value : new P(function (resolve) {
47853
+ resolve(value);
47854
+ });
47855
+ }
47794
47856
 
47857
+ return new (P || (P = Promise))(function (resolve, reject) {
47858
+ function fulfilled(value) {
47859
+ try {
47860
+ step(generator.next(value));
47861
+ } catch (e) {
47862
+ reject(e);
47863
+ }
47864
+ }
47795
47865
 
47866
+ function rejected(value) {
47867
+ try {
47868
+ step(generator["throw"](value));
47869
+ } catch (e) {
47870
+ reject(e);
47871
+ }
47872
+ }
47796
47873
 
47874
+ function step(result) {
47875
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
47876
+ }
47797
47877
 
47878
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
47879
+ });
47880
+ };
47798
47881
 
47799
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Logger"]('S3ClientUtils'); // placeholder credentials in order to satisfy type requirement, always results in 403 when used
47882
+ var __generator = undefined && undefined.__generator || function (thisArg, body) {
47883
+ var _ = {
47884
+ label: 0,
47885
+ sent: function sent() {
47886
+ if (t[0] & 1) throw t[1];
47887
+ return t[1];
47888
+ },
47889
+ trys: [],
47890
+ ops: []
47891
+ },
47892
+ f,
47893
+ y,
47894
+ t,
47895
+ g;
47896
+ return g = {
47897
+ next: verb(0),
47898
+ "throw": verb(1),
47899
+ "return": verb(2)
47900
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
47901
+ return this;
47902
+ }), g;
47903
+
47904
+ function verb(n) {
47905
+ return function (v) {
47906
+ return step([n, v]);
47907
+ };
47908
+ }
47909
+
47910
+ function step(op) {
47911
+ if (f) throw new TypeError("Generator is already executing.");
47912
+
47913
+ while (_) {
47914
+ try {
47915
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47916
+ if (y = 0, t) op = [op[0] & 2, t.value];
47917
+
47918
+ switch (op[0]) {
47919
+ case 0:
47920
+ case 1:
47921
+ t = op;
47922
+ break;
47923
+
47924
+ case 4:
47925
+ _.label++;
47926
+ return {
47927
+ value: op[1],
47928
+ done: false
47929
+ };
47930
+
47931
+ case 5:
47932
+ _.label++;
47933
+ y = op[1];
47934
+ op = [0];
47935
+ continue;
47936
+
47937
+ case 7:
47938
+ op = _.ops.pop();
47939
+
47940
+ _.trys.pop();
47941
+
47942
+ continue;
47943
+
47944
+ default:
47945
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
47946
+ _ = 0;
47947
+ continue;
47948
+ }
47949
+
47950
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
47951
+ _.label = op[1];
47952
+ break;
47953
+ }
47954
+
47955
+ if (op[0] === 6 && _.label < t[1]) {
47956
+ _.label = t[1];
47957
+ t = op;
47958
+ break;
47959
+ }
47960
+
47961
+ if (t && _.label < t[2]) {
47962
+ _.label = t[2];
47963
+
47964
+ _.ops.push(op);
47965
+
47966
+ break;
47967
+ }
47968
+
47969
+ if (t[2]) _.ops.pop();
47970
+
47971
+ _.trys.pop();
47972
+
47973
+ continue;
47974
+ }
47975
+
47976
+ op = body.call(thisArg, _);
47977
+ } catch (e) {
47978
+ op = [6, e];
47979
+ y = 0;
47980
+ } finally {
47981
+ f = t = 0;
47982
+ }
47983
+ }
47984
+
47985
+ if (op[0] & 5) throw op[1];
47986
+ return {
47987
+ value: op[0] ? op[1] : void 0,
47988
+ done: true
47989
+ };
47990
+ }
47991
+ };
47992
+
47993
+
47994
+
47995
+
47996
+
47997
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Logger"]('S3ClientUtils'); // placeholder credentials in order to satisfy type requirement, always results in 403 when used
47800
47998
 
47801
47999
  var INVALID_CRED = {
47802
48000
  accessKeyId: '',
@@ -47827,19 +48025,19 @@ var getPrefix = function getPrefix(config) {
47827
48025
  var createPrefixMiddleware = function createPrefixMiddleware(opt, key) {
47828
48026
  return function (next, _context) {
47829
48027
  return function (args) {
47830
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
48028
+ return __awaiter(void 0, void 0, void 0, function () {
47831
48029
  var credentials, cred, prefix, clonedInput, result;
47832
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
48030
+ return __generator(this, function (_a) {
47833
48031
  switch (_a.label) {
47834
48032
  case 0:
47835
48033
  return [4
47836
48034
  /*yield*/
47837
- , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get()];
48035
+ , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].get()];
47838
48036
 
47839
48037
  case 1:
47840
48038
  credentials = _a.sent();
47841
- cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].shear(credentials);
47842
- prefix = getPrefix(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, opt), {
48039
+ cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].shear(credentials);
48040
+ prefix = getPrefix(__assign(__assign({}, opt), {
47843
48041
  credentials: cred
47844
48042
  }));
47845
48043
  clonedInput = Object.assign({}, args.input);
@@ -47871,9 +48069,9 @@ var isTimeSkewedError = function isTimeSkewedError(err) {
47871
48069
  var autoAdjustClockskewMiddleware = function autoAdjustClockskewMiddleware(config) {
47872
48070
  return function (next, _context) {
47873
48071
  return function (args) {
47874
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
48072
+ return __awaiter(void 0, void 0, void 0, function () {
47875
48073
  var err_1, serverDate;
47876
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
48074
+ return __generator(this, function (_a) {
47877
48075
  switch (_a.label) {
47878
48076
  case 0:
47879
48077
  _a.trys.push([0, 2,, 3]);
@@ -47916,23 +48114,23 @@ var prefixMiddlewareOptions = {
47916
48114
  name: 'addPrefixMiddleware'
47917
48115
  };
47918
48116
  var credentialsProvider = function credentialsProvider() {
47919
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
48117
+ return __awaiter(void 0, void 0, void 0, function () {
47920
48118
  var credentials, cred, error_1;
47921
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
48119
+ return __generator(this, function (_a) {
47922
48120
  switch (_a.label) {
47923
48121
  case 0:
47924
48122
  _a.trys.push([0, 2,, 3]);
47925
48123
 
47926
48124
  return [4
47927
48125
  /*yield*/
47928
- , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get()];
48126
+ , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].get()];
47929
48127
 
47930
48128
  case 1:
47931
48129
  credentials = _a.sent();
47932
48130
  if (!credentials) return [2
47933
48131
  /*return*/
47934
48132
  , INVALID_CRED];
47935
- cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].shear(credentials);
48133
+ cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].shear(credentials);
47936
48134
  logger.debug('credentials provider get credentials', cred);
47937
48135
  return [2
47938
48136
  /*return*/
@@ -47962,24 +48160,24 @@ var createS3Client = function createS3Client(config, emitter) {
47962
48160
 
47963
48161
  if (dangerouslyConnectToHttpEndpointForTesting) {
47964
48162
  localTestingConfig = {
47965
- endpoint: _StorageConstants__WEBPACK_IMPORTED_MODULE_4__["localTestingStorageEndpoint"],
48163
+ endpoint: _StorageConstants__WEBPACK_IMPORTED_MODULE_3__["localTestingStorageEndpoint"],
47966
48164
  tls: false,
47967
48165
  bucketEndpoint: false,
47968
48166
  forcePathStyle: true
47969
48167
  };
47970
48168
  }
47971
48169
 
47972
- var s3client = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["S3Client"](Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({
48170
+ var s3client = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["S3Client"](__assign(__assign({
47973
48171
  region: region,
47974
48172
  // Using provider instead of a static credentials, so that if an upload task was in progress, but credentials gets
47975
48173
  // changed or invalidated (e.g user signed out), the subsequent requests will fail.
47976
48174
  credentials: credentialsProvider,
47977
- customUserAgent: Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["getAmplifyUserAgent"])()
48175
+ customUserAgent: Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["getAmplifyUserAgent"])()
47978
48176
  }, localTestingConfig), {
47979
- requestHandler: new _providers_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__["AxiosHttpHandler"]({}, emitter, cancelTokenSource),
48177
+ requestHandler: new _providers_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__["AxiosHttpHandler"]({}, emitter, cancelTokenSource),
47980
48178
  useAccelerateEndpoint: useAccelerateEndpoint
47981
48179
  }));
47982
- s3client.middlewareStack.remove(_StorageConstants__WEBPACK_IMPORTED_MODULE_4__["SET_CONTENT_LENGTH_HEADER"]);
48180
+ s3client.middlewareStack.remove(_StorageConstants__WEBPACK_IMPORTED_MODULE_3__["SET_CONTENT_LENGTH_HEADER"]);
47983
48181
  return s3client;
47984
48182
  };
47985
48183
 
@@ -48113,14 +48311,13 @@ var isArrayBuffer = function isArrayBuffer(x) {
48113
48311
  "use strict";
48114
48312
  __webpack_require__.r(__webpack_exports__);
48115
48313
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Storage", function() { return Storage; });
48116
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
48117
- /* harmony import */ var _Storage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Storage */ "./lib-esm/Storage.js");
48118
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StorageClass", function() { return _Storage__WEBPACK_IMPORTED_MODULE_1__["Storage"]; });
48314
+ /* harmony import */ var _Storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Storage */ "./lib-esm/Storage.js");
48315
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StorageClass", function() { return _Storage__WEBPACK_IMPORTED_MODULE_0__["Storage"]; });
48119
48316
 
48120
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
48121
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__);
48122
- /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./providers */ "./lib-esm/providers/index.js");
48123
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSS3Provider", function() { return _providers__WEBPACK_IMPORTED_MODULE_3__["AWSS3Provider"]; });
48317
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
48318
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
48319
+ /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers */ "./lib-esm/providers/index.js");
48320
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AWSS3Provider", function() { return _providers__WEBPACK_IMPORTED_MODULE_2__["AWSS3Provider"]; });
48124
48321
 
48125
48322
  /*
48126
48323
  * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -48134,10 +48331,25 @@ __webpack_require__.r(__webpack_exports__);
48134
48331
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
48135
48332
  * and limitations under the License.
48136
48333
  */
48334
+ var __assign = undefined && undefined.__assign || function () {
48335
+ __assign = Object.assign || function (t) {
48336
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
48337
+ s = arguments[i];
48338
+
48339
+ for (var p in s) {
48340
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48341
+ }
48342
+ }
48343
+
48344
+ return t;
48345
+ };
48137
48346
 
48347
+ return __assign.apply(this, arguments);
48348
+ };
48138
48349
 
48139
48350
 
48140
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('Storage');
48351
+
48352
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["ConsoleLogger"]('Storage');
48141
48353
  var _instance = null;
48142
48354
 
48143
48355
  var getInstance = function getInstance() {
@@ -48146,19 +48358,19 @@ var getInstance = function getInstance() {
48146
48358
  }
48147
48359
 
48148
48360
  logger.debug('Create Storage Instance, debug');
48149
- _instance = new _Storage__WEBPACK_IMPORTED_MODULE_1__["Storage"]();
48150
- _instance.vault = new _Storage__WEBPACK_IMPORTED_MODULE_1__["Storage"]();
48361
+ _instance = new _Storage__WEBPACK_IMPORTED_MODULE_0__["Storage"]();
48362
+ _instance.vault = new _Storage__WEBPACK_IMPORTED_MODULE_0__["Storage"]();
48151
48363
  var old_configure = _instance.configure;
48152
48364
 
48153
48365
  _instance.configure = function (options) {
48154
48366
  logger.debug('storage configure called');
48155
48367
 
48156
- var vaultConfig = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, old_configure.call(_instance, options)); // set level private for each provider for the vault
48368
+ var vaultConfig = __assign({}, old_configure.call(_instance, options)); // set level private for each provider for the vault
48157
48369
 
48158
48370
 
48159
48371
  Object.keys(vaultConfig).forEach(function (providerName) {
48160
48372
  if (typeof vaultConfig[providerName] !== 'string') {
48161
- vaultConfig[providerName] = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, vaultConfig[providerName]), {
48373
+ vaultConfig[providerName] = __assign(__assign({}, vaultConfig[providerName]), {
48162
48374
  level: 'private'
48163
48375
  });
48164
48376
  }
@@ -48172,7 +48384,7 @@ var getInstance = function getInstance() {
48172
48384
  };
48173
48385
 
48174
48386
  var Storage = getInstance();
48175
- _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Amplify"].register(Storage);
48387
+ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Amplify"].register(Storage);
48176
48388
  /**
48177
48389
  * @deprecated use named import
48178
48390
  */
@@ -48193,22 +48405,21 @@ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Amplify"].register(Storage);
48193
48405
  "use strict";
48194
48406
  __webpack_require__.r(__webpack_exports__);
48195
48407
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWSS3Provider", function() { return AWSS3Provider; });
48196
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
48197
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
48198
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
48199
- /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
48200
- /* harmony import */ var _aws_sdk_util_format_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-sdk/util-format-url */ "./node_modules/@aws-sdk/util-format-url/dist/es/index.js");
48201
- /* harmony import */ var _aws_sdk_util_create_request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-sdk/util-create-request */ "./node_modules/@aws-sdk/util-create-request/dist/es/index.js");
48202
- /* harmony import */ var _aws_sdk_s3_request_presigner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @aws-sdk/s3-request-presigner */ "../../node_modules/@aws-sdk/s3-request-presigner/dist/es/index.js");
48203
- /* harmony import */ var _axios_http_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
48204
- /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
48205
- /* harmony import */ var _common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/StorageUtils */ "./lib-esm/common/StorageUtils.js");
48206
- /* harmony import */ var _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/S3ClientUtils */ "./lib-esm/common/S3ClientUtils.js");
48207
- /* harmony import */ var _AWSS3ProviderManagedUpload__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AWSS3ProviderManagedUpload */ "./lib-esm/providers/AWSS3ProviderManagedUpload.js");
48208
- /* harmony import */ var _AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AWSS3UploadTask */ "./lib-esm/providers/AWSS3UploadTask.js");
48209
- /* harmony import */ var _common_StorageConstants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/StorageConstants */ "./lib-esm/common/StorageConstants.js");
48210
- /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
48211
- /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_13__);
48408
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
48409
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
48410
+ /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
48411
+ /* harmony import */ var _aws_sdk_util_format_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-sdk/util-format-url */ "./node_modules/@aws-sdk/util-format-url/dist/es/index.js");
48412
+ /* harmony import */ var _aws_sdk_util_create_request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-sdk/util-create-request */ "./node_modules/@aws-sdk/util-create-request/dist/es/index.js");
48413
+ /* harmony import */ var _aws_sdk_s3_request_presigner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-sdk/s3-request-presigner */ "../../node_modules/@aws-sdk/s3-request-presigner/dist/es/index.js");
48414
+ /* harmony import */ var _axios_http_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
48415
+ /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
48416
+ /* harmony import */ var _common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/StorageUtils */ "./lib-esm/common/StorageUtils.js");
48417
+ /* harmony import */ var _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/S3ClientUtils */ "./lib-esm/common/S3ClientUtils.js");
48418
+ /* harmony import */ var _AWSS3ProviderManagedUpload__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AWSS3ProviderManagedUpload */ "./lib-esm/providers/AWSS3ProviderManagedUpload.js");
48419
+ /* harmony import */ var _AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AWSS3UploadTask */ "./lib-esm/providers/AWSS3UploadTask.js");
48420
+ /* harmony import */ var _common_StorageConstants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/StorageConstants */ "./lib-esm/common/StorageConstants.js");
48421
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
48422
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_12__);
48212
48423
  function _typeof(obj) {
48213
48424
  "@babel/helpers - typeof";
48214
48425
 
@@ -48219,7 +48430,199 @@ function _typeof(obj) {
48219
48430
  }, _typeof(obj);
48220
48431
  }
48221
48432
 
48433
+ var __assign = undefined && undefined.__assign || function () {
48434
+ __assign = Object.assign || function (t) {
48435
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
48436
+ s = arguments[i];
48437
+
48438
+ for (var p in s) {
48439
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48440
+ }
48441
+ }
48442
+
48443
+ return t;
48444
+ };
48445
+
48446
+ return __assign.apply(this, arguments);
48447
+ };
48448
+
48449
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
48450
+ function adopt(value) {
48451
+ return value instanceof P ? value : new P(function (resolve) {
48452
+ resolve(value);
48453
+ });
48454
+ }
48455
+
48456
+ return new (P || (P = Promise))(function (resolve, reject) {
48457
+ function fulfilled(value) {
48458
+ try {
48459
+ step(generator.next(value));
48460
+ } catch (e) {
48461
+ reject(e);
48462
+ }
48463
+ }
48464
+
48465
+ function rejected(value) {
48466
+ try {
48467
+ step(generator["throw"](value));
48468
+ } catch (e) {
48469
+ reject(e);
48470
+ }
48471
+ }
48472
+
48473
+ function step(result) {
48474
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
48475
+ }
48476
+
48477
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48478
+ });
48479
+ };
48480
+
48481
+ var __generator = undefined && undefined.__generator || function (thisArg, body) {
48482
+ var _ = {
48483
+ label: 0,
48484
+ sent: function sent() {
48485
+ if (t[0] & 1) throw t[1];
48486
+ return t[1];
48487
+ },
48488
+ trys: [],
48489
+ ops: []
48490
+ },
48491
+ f,
48492
+ y,
48493
+ t,
48494
+ g;
48495
+ return g = {
48496
+ next: verb(0),
48497
+ "throw": verb(1),
48498
+ "return": verb(2)
48499
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
48500
+ return this;
48501
+ }), g;
48502
+
48503
+ function verb(n) {
48504
+ return function (v) {
48505
+ return step([n, v]);
48506
+ };
48507
+ }
48508
+
48509
+ function step(op) {
48510
+ if (f) throw new TypeError("Generator is already executing.");
48511
+
48512
+ while (_) {
48513
+ try {
48514
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
48515
+ if (y = 0, t) op = [op[0] & 2, t.value];
48516
+
48517
+ switch (op[0]) {
48518
+ case 0:
48519
+ case 1:
48520
+ t = op;
48521
+ break;
48522
+
48523
+ case 4:
48524
+ _.label++;
48525
+ return {
48526
+ value: op[1],
48527
+ done: false
48528
+ };
48529
+
48530
+ case 5:
48531
+ _.label++;
48532
+ y = op[1];
48533
+ op = [0];
48534
+ continue;
48535
+
48536
+ case 7:
48537
+ op = _.ops.pop();
48538
+
48539
+ _.trys.pop();
48540
+
48541
+ continue;
48542
+
48543
+ default:
48544
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
48545
+ _ = 0;
48546
+ continue;
48547
+ }
48548
+
48549
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
48550
+ _.label = op[1];
48551
+ break;
48552
+ }
48553
+
48554
+ if (op[0] === 6 && _.label < t[1]) {
48555
+ _.label = t[1];
48556
+ t = op;
48557
+ break;
48558
+ }
48559
+
48560
+ if (t && _.label < t[2]) {
48561
+ _.label = t[2];
48562
+
48563
+ _.ops.push(op);
48564
+
48565
+ break;
48566
+ }
48567
+
48568
+ if (t[2]) _.ops.pop();
48569
+
48570
+ _.trys.pop();
48571
+
48572
+ continue;
48573
+ }
48222
48574
 
48575
+ op = body.call(thisArg, _);
48576
+ } catch (e) {
48577
+ op = [6, e];
48578
+ y = 0;
48579
+ } finally {
48580
+ f = t = 0;
48581
+ }
48582
+ }
48583
+
48584
+ if (op[0] & 5) throw op[1];
48585
+ return {
48586
+ value: op[0] ? op[1] : void 0,
48587
+ done: true
48588
+ };
48589
+ }
48590
+ };
48591
+
48592
+ var __read = undefined && undefined.__read || function (o, n) {
48593
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
48594
+ if (!m) return o;
48595
+ var i = m.call(o),
48596
+ r,
48597
+ ar = [],
48598
+ e;
48599
+
48600
+ try {
48601
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
48602
+ ar.push(r.value);
48603
+ }
48604
+ } catch (error) {
48605
+ e = {
48606
+ error: error
48607
+ };
48608
+ } finally {
48609
+ try {
48610
+ if (r && !r.done && (m = i["return"])) m.call(i);
48611
+ } finally {
48612
+ if (e) throw e.error;
48613
+ }
48614
+ }
48615
+
48616
+ return ar;
48617
+ };
48618
+
48619
+ var __spread = undefined && undefined.__spread || function () {
48620
+ for (var ar = [], i = 0; i < arguments.length; i++) {
48621
+ ar = ar.concat(__read(arguments[i]));
48622
+ }
48623
+
48624
+ return ar;
48625
+ };
48223
48626
  /*
48224
48627
  * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
48225
48628
  *
@@ -48246,7 +48649,8 @@ function _typeof(obj) {
48246
48649
 
48247
48650
 
48248
48651
 
48249
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["ConsoleLogger"]('AWSS3Provider');
48652
+
48653
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('AWSS3Provider');
48250
48654
  var DEFAULT_STORAGE_LEVEL = 'public';
48251
48655
  var DEFAULT_PRESIGN_EXPIRATION = 900;
48252
48656
  /**
@@ -48264,12 +48668,12 @@ function () {
48264
48668
  var _this = this;
48265
48669
 
48266
48670
  this._config = config ? config : {};
48267
- this._storage = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["StorageHelper"]().getStorage();
48268
- _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Hub"].listen('auth', function (data) {
48671
+ this._storage = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["StorageHelper"]().getStorage();
48672
+ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Hub"].listen('auth', function (data) {
48269
48673
  var payload = data.payload;
48270
48674
 
48271
48675
  if (payload.event === 'signOut' || payload.event === 'signIn') {
48272
- _this._storage.removeItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_12__["UPLOADS_STORAGE_KEY"]);
48676
+ _this._storage.removeItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_11__["UPLOADS_STORAGE_KEY"]);
48273
48677
  }
48274
48678
  });
48275
48679
  logger.debug('Storage Options', this._config);
@@ -48300,7 +48704,7 @@ function () {
48300
48704
  AWSS3Provider.prototype.configure = function (config) {
48301
48705
  logger.debug('configure Storage', config);
48302
48706
  if (!config) return this._config;
48303
- var amplifyConfig = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Parser"].parseMobilehubConfig(config);
48707
+ var amplifyConfig = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Parser"].parseMobilehubConfig(config);
48304
48708
  this._config = Object.assign({}, this._config, amplifyConfig.Storage);
48305
48709
 
48306
48710
  if (!this._config.bucket) {
@@ -48323,10 +48727,10 @@ function () {
48323
48727
  track = _a === void 0 ? false : _a;
48324
48728
 
48325
48729
  if (!(file instanceof Blob)) {
48326
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].INVALID_BLOB);
48730
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].INVALID_BLOB);
48327
48731
  }
48328
48732
 
48329
- emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_11__["TaskEvents"].UPLOAD_PROGRESS, function (event) {
48733
+ emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_10__["TaskEvents"].UPLOAD_PROGRESS, function (event) {
48330
48734
  if (progressCallback) {
48331
48735
  if (typeof progressCallback === 'function') {
48332
48736
  progressCallback(event);
@@ -48335,7 +48739,7 @@ function () {
48335
48739
  }
48336
48740
  }
48337
48741
  });
48338
- emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_11__["TaskEvents"].UPLOAD_COMPLETE, function (event) {
48742
+ emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_10__["TaskEvents"].UPLOAD_COMPLETE, function (event) {
48339
48743
  if (completeCallback) {
48340
48744
  if (typeof completeCallback === 'function') {
48341
48745
  completeCallback(event);
@@ -48344,7 +48748,7 @@ function () {
48344
48748
  }
48345
48749
  }
48346
48750
  });
48347
- emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_11__["TaskEvents"].ERROR, function (err) {
48751
+ emitter.on(_AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_10__["TaskEvents"].ERROR, function (err) {
48348
48752
  if (errorCallback) {
48349
48753
  if (typeof errorCallback === 'function') {
48350
48754
  errorCallback(err);
@@ -48355,13 +48759,13 @@ function () {
48355
48759
  }); // we want to keep this function sync so we defer this promise to AWSS3UploadTask to resolve when it's needed
48356
48760
  // when its doing a final check with _listSingleFile function
48357
48761
 
48358
- var prefixPromise = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get().then(function (credentials) {
48359
- var cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].shear(credentials);
48360
- return Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["getPrefix"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, config), {
48762
+ var prefixPromise = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].get().then(function (credentials) {
48763
+ var cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].shear(credentials);
48764
+ return Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["getPrefix"])(__assign(__assign({}, config), {
48361
48765
  credentials: cred
48362
48766
  }));
48363
48767
  });
48364
- var task = new _AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_11__["AWSS3UploadTask"]({
48768
+ var task = new _AWSS3UploadTask__WEBPACK_IMPORTED_MODULE_10__["AWSS3UploadTask"]({
48365
48769
  s3Client: s3Client,
48366
48770
  file: file,
48367
48771
  emitter: emitter,
@@ -48370,7 +48774,7 @@ function () {
48370
48774
  params: params,
48371
48775
  prefixPromise: prefixPromise
48372
48776
  });
48373
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'upload', {
48777
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'upload', {
48374
48778
  method: 'put',
48375
48779
  result: 'success'
48376
48780
  }, null, "Upload Task created successfully for " + key); // automatically start the upload task
@@ -48391,10 +48795,10 @@ function () {
48391
48795
 
48392
48796
 
48393
48797
  AWSS3Provider.prototype.copy = function (src, dest, config) {
48394
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
48798
+ return __awaiter(this, void 0, void 0, function () {
48395
48799
  var credentialsOK, opt, acl, bucket, cacheControl, expires, track, serverSideEncryption, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, SSEKMSKeyId, _a, srcLevel, srcIdentityId, srcKey, _b, destLevel, destKey, srcPrefix, destPrefix, finalSrcKey, finalDestKey, params, s3, error_1;
48396
48800
 
48397
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_c) {
48801
+ return __generator(this, function (_c) {
48398
48802
  switch (_c.label) {
48399
48803
  case 0:
48400
48804
  return [4
@@ -48405,7 +48809,7 @@ function () {
48405
48809
  credentialsOK = _c.sent();
48406
48810
 
48407
48811
  if (!credentialsOK || !this._isWithCredentials(this._config)) {
48408
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_CREDENTIALS);
48812
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_CREDENTIALS);
48409
48813
  }
48410
48814
 
48411
48815
  opt = Object.assign({}, this._config, config);
@@ -48414,23 +48818,23 @@ function () {
48414
48818
  _b = dest.level, destLevel = _b === void 0 ? DEFAULT_STORAGE_LEVEL : _b, destKey = dest.key;
48415
48819
 
48416
48820
  if (!srcKey || typeof srcKey !== 'string') {
48417
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_SRC_KEY);
48821
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_SRC_KEY);
48418
48822
  }
48419
48823
 
48420
48824
  if (!destKey || typeof destKey !== 'string') {
48421
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_DEST_KEY);
48825
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_DEST_KEY);
48422
48826
  }
48423
48827
 
48424
48828
  if (srcLevel !== 'protected' && srcIdentityId) {
48425
48829
  logger.warn("You may copy files from another user if the source level is \"protected\", currently it's " + srcLevel);
48426
48830
  }
48427
48831
 
48428
- srcPrefix = this._prefix(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, opt), {
48832
+ srcPrefix = this._prefix(__assign(__assign(__assign({}, opt), {
48429
48833
  level: srcLevel
48430
48834
  }), srcIdentityId && {
48431
48835
  identityId: srcIdentityId
48432
48836
  }));
48433
- destPrefix = this._prefix(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, opt), {
48837
+ destPrefix = this._prefix(__assign(__assign({}, opt), {
48434
48838
  level: destLevel
48435
48839
  }));
48436
48840
  finalSrcKey = bucket + "/" + srcPrefix + srcKey;
@@ -48475,12 +48879,12 @@ function () {
48475
48879
 
48476
48880
  return [4
48477
48881
  /*yield*/
48478
- , s3.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["CopyObjectCommand"](params))];
48882
+ , s3.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CopyObjectCommand"](params))];
48479
48883
 
48480
48884
  case 3:
48481
48885
  _c.sent();
48482
48886
 
48483
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'copy', {
48887
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'copy', {
48484
48888
  method: 'copy',
48485
48889
  result: 'success'
48486
48890
  }, null, "Copy success from " + srcKey + " to " + destKey);
@@ -48492,7 +48896,7 @@ function () {
48492
48896
 
48493
48897
  case 4:
48494
48898
  error_1 = _c.sent();
48495
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'copy', {
48899
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'copy', {
48496
48900
  method: 'copy',
48497
48901
  result: 'failed'
48498
48902
  }, null, "Copy failed from " + srcKey + " to " + destKey);
@@ -48508,10 +48912,10 @@ function () {
48508
48912
  };
48509
48913
 
48510
48914
  AWSS3Provider.prototype.get = function (key, config) {
48511
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
48915
+ return __awaiter(this, void 0, void 0, function () {
48512
48916
  var credentialsOK, opt, bucket, download, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, expires, track, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, progressCallback, prefix, final_key, emitter, s3, params, getObjectCommand, response, error_2, signer, request, url, _a, error_3;
48513
48917
 
48514
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) {
48918
+ return __generator(this, function (_b) {
48515
48919
  switch (_b.label) {
48516
48920
  case 0:
48517
48921
  return [4
@@ -48522,14 +48926,14 @@ function () {
48522
48926
  credentialsOK = _b.sent();
48523
48927
 
48524
48928
  if (!credentialsOK || !this._isWithCredentials(this._config)) {
48525
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_CREDENTIALS);
48929
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_CREDENTIALS);
48526
48930
  }
48527
48931
 
48528
48932
  opt = Object.assign({}, this._config, config);
48529
48933
  bucket = opt.bucket, download = opt.download, cacheControl = opt.cacheControl, contentDisposition = opt.contentDisposition, contentEncoding = opt.contentEncoding, contentLanguage = opt.contentLanguage, contentType = opt.contentType, expires = opt.expires, track = opt.track, SSECustomerAlgorithm = opt.SSECustomerAlgorithm, SSECustomerKey = opt.SSECustomerKey, SSECustomerKeyMD5 = opt.SSECustomerKeyMD5, progressCallback = opt.progressCallback;
48530
48934
  prefix = this._prefix(opt);
48531
48935
  final_key = prefix + key;
48532
- emitter = new events__WEBPACK_IMPORTED_MODULE_13__["EventEmitter"]();
48936
+ emitter = new events__WEBPACK_IMPORTED_MODULE_12__["EventEmitter"]();
48533
48937
  s3 = this._createNewS3Client(opt, emitter);
48534
48938
  logger.debug('get ' + key + ' from ' + final_key);
48535
48939
  params = {
@@ -48558,7 +48962,7 @@ function () {
48558
48962
  if (!(download === true)) return [3
48559
48963
  /*break*/
48560
48964
  , 5];
48561
- getObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["GetObjectCommand"](params);
48965
+ getObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["GetObjectCommand"](params);
48562
48966
  _b.label = 2;
48563
48967
 
48564
48968
  case 2:
@@ -48566,7 +48970,7 @@ function () {
48566
48970
 
48567
48971
  if (progressCallback) {
48568
48972
  if (typeof progressCallback === 'function') {
48569
- emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_6__["SEND_DOWNLOAD_PROGRESS_EVENT"], function (progress) {
48973
+ emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_5__["SEND_DOWNLOAD_PROGRESS_EVENT"], function (progress) {
48570
48974
  progressCallback(progress);
48571
48975
  });
48572
48976
  } else {
@@ -48580,8 +48984,8 @@ function () {
48580
48984
 
48581
48985
  case 3:
48582
48986
  response = _b.sent();
48583
- emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_6__["SEND_DOWNLOAD_PROGRESS_EVENT"]);
48584
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'download', {
48987
+ emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_5__["SEND_DOWNLOAD_PROGRESS_EVENT"]);
48988
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'download', {
48585
48989
  method: 'get',
48586
48990
  result: 'success'
48587
48991
  }, {
@@ -48593,7 +48997,7 @@ function () {
48593
48997
 
48594
48998
  case 4:
48595
48999
  error_2 = _b.sent();
48596
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'download', {
49000
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'download', {
48597
49001
  method: 'get',
48598
49002
  result: 'failed'
48599
49003
  }, null, "Download failed with " + error_2.message);
@@ -48602,14 +49006,14 @@ function () {
48602
49006
  case 5:
48603
49007
  _b.trys.push([5, 8,, 9]);
48604
49008
 
48605
- signer = new _aws_sdk_s3_request_presigner__WEBPACK_IMPORTED_MODULE_5__["S3RequestPresigner"](Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, s3.config));
49009
+ signer = new _aws_sdk_s3_request_presigner__WEBPACK_IMPORTED_MODULE_4__["S3RequestPresigner"](__assign({}, s3.config));
48606
49010
  return [4
48607
49011
  /*yield*/
48608
- , Object(_aws_sdk_util_create_request__WEBPACK_IMPORTED_MODULE_4__["createRequest"])(s3, new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["GetObjectCommand"](params))];
49012
+ , Object(_aws_sdk_util_create_request__WEBPACK_IMPORTED_MODULE_3__["createRequest"])(s3, new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["GetObjectCommand"](params))];
48609
49013
 
48610
49014
  case 6:
48611
49015
  request = _b.sent();
48612
- _a = _aws_sdk_util_format_url__WEBPACK_IMPORTED_MODULE_3__["formatUrl"];
49016
+ _a = _aws_sdk_util_format_url__WEBPACK_IMPORTED_MODULE_2__["formatUrl"];
48613
49017
  return [4
48614
49018
  /*yield*/
48615
49019
  , signer.presign(request, {
@@ -48618,7 +49022,7 @@ function () {
48618
49022
 
48619
49023
  case 7:
48620
49024
  url = _a.apply(void 0, [_b.sent()]);
48621
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'getSignedUrl', {
49025
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'getSignedUrl', {
48622
49026
  method: 'get',
48623
49027
  result: 'success'
48624
49028
  }, null, "Signed URL: " + url);
@@ -48629,7 +49033,7 @@ function () {
48629
49033
  case 8:
48630
49034
  error_3 = _b.sent();
48631
49035
  logger.warn('get signed url error', error_3);
48632
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'getSignedUrl', {
49036
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'getSignedUrl', {
48633
49037
  method: 'get',
48634
49038
  result: 'failed'
48635
49039
  }, null, "Could not get a signed URL for " + key);
@@ -48725,8 +49129,8 @@ function () {
48725
49129
  params.SSEKMSKeyId = SSEKMSKeyId;
48726
49130
  }
48727
49131
 
48728
- var emitter = new events__WEBPACK_IMPORTED_MODULE_13__["EventEmitter"]();
48729
- var uploader = new _AWSS3ProviderManagedUpload__WEBPACK_IMPORTED_MODULE_10__["AWSS3ProviderManagedUpload"](params, opt, emitter);
49132
+ var emitter = new events__WEBPACK_IMPORTED_MODULE_12__["EventEmitter"]();
49133
+ var uploader = new _AWSS3ProviderManagedUpload__WEBPACK_IMPORTED_MODULE_9__["AWSS3ProviderManagedUpload"](params, opt, emitter);
48730
49134
 
48731
49135
  if (acl) {
48732
49136
  params.ACL = acl;
@@ -48737,7 +49141,7 @@ function () {
48737
49141
  // this._ensureCredentials() which allows us to make this function sync so we can return non-Promise like UploadTask
48738
49142
 
48739
49143
 
48740
- s3Client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["createPrefixMiddleware"])(opt, key), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["prefixMiddlewareOptions"]);
49144
+ s3Client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["createPrefixMiddleware"])(opt, key), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["prefixMiddlewareOptions"]);
48741
49145
  var addTaskInput = {
48742
49146
  bucket: bucket,
48743
49147
  key: key,
@@ -48754,7 +49158,7 @@ function () {
48754
49158
  try {
48755
49159
  if (progressCallback) {
48756
49160
  if (typeof progressCallback === 'function') {
48757
- emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_6__["SEND_UPLOAD_PROGRESS_EVENT"], function (progress) {
49161
+ emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_5__["SEND_UPLOAD_PROGRESS_EVENT"], function (progress) {
48758
49162
  progressCallback(progress);
48759
49163
  });
48760
49164
  } else {
@@ -48764,7 +49168,7 @@ function () {
48764
49168
 
48765
49169
  return uploader.upload().then(function (response) {
48766
49170
  logger.debug('upload result', response);
48767
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'upload', {
49171
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'upload', {
48768
49172
  method: 'put',
48769
49173
  result: 'success'
48770
49174
  }, null, "Upload success for " + key);
@@ -48774,7 +49178,7 @@ function () {
48774
49178
  });
48775
49179
  } catch (error) {
48776
49180
  logger.warn('error uploading', error);
48777
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'upload', {
49181
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'upload', {
48778
49182
  method: 'put',
48779
49183
  result: 'failed'
48780
49184
  }, null, "Error uploading " + key);
@@ -48790,9 +49194,9 @@ function () {
48790
49194
 
48791
49195
 
48792
49196
  AWSS3Provider.prototype.remove = function (key, config) {
48793
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49197
+ return __awaiter(this, void 0, void 0, function () {
48794
49198
  var credentialsOK, opt, bucket, track, prefix, final_key, s3, params, deleteObjectCommand, response, error_4;
48795
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49199
+ return __generator(this, function (_a) {
48796
49200
  switch (_a.label) {
48797
49201
  case 0:
48798
49202
  return [4
@@ -48803,7 +49207,7 @@ function () {
48803
49207
  credentialsOK = _a.sent();
48804
49208
 
48805
49209
  if (!credentialsOK || !this._isWithCredentials(this._config)) {
48806
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_CREDENTIALS);
49210
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_CREDENTIALS);
48807
49211
  }
48808
49212
 
48809
49213
  opt = Object.assign({}, this._config, config);
@@ -48816,7 +49220,7 @@ function () {
48816
49220
  Bucket: bucket,
48817
49221
  Key: final_key
48818
49222
  };
48819
- deleteObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["DeleteObjectCommand"](params);
49223
+ deleteObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["DeleteObjectCommand"](params);
48820
49224
  _a.label = 2;
48821
49225
 
48822
49226
  case 2:
@@ -48828,7 +49232,7 @@ function () {
48828
49232
 
48829
49233
  case 3:
48830
49234
  response = _a.sent();
48831
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'delete', {
49235
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'delete', {
48832
49236
  method: 'remove',
48833
49237
  result: 'success'
48834
49238
  }, null, "Deleted " + key + " successfully");
@@ -48838,7 +49242,7 @@ function () {
48838
49242
 
48839
49243
  case 4:
48840
49244
  error_4 = _a.sent();
48841
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'delete', {
49245
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'delete', {
48842
49246
  method: 'remove',
48843
49247
  result: 'failed'
48844
49248
  }, null, "Deletion of " + key + " failed with " + error_4);
@@ -48854,9 +49258,9 @@ function () {
48854
49258
  };
48855
49259
 
48856
49260
  AWSS3Provider.prototype._list = function (params, opt, prefix) {
48857
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49261
+ return __awaiter(this, void 0, void 0, function () {
48858
49262
  var result, s3, listObjectsV2Command, response;
48859
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49263
+ return __generator(this, function (_a) {
48860
49264
  switch (_a.label) {
48861
49265
  case 0:
48862
49266
  result = {
@@ -48864,7 +49268,7 @@ function () {
48864
49268
  nextToken: ''
48865
49269
  };
48866
49270
  s3 = this._createNewS3Client(opt);
48867
- listObjectsV2Command = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["ListObjectsV2Command"](Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, params));
49271
+ listObjectsV2Command = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["ListObjectsV2Command"](__assign({}, params));
48868
49272
  return [4
48869
49273
  /*yield*/
48870
49274
  , s3.send(listObjectsV2Command)];
@@ -48901,9 +49305,9 @@ function () {
48901
49305
 
48902
49306
 
48903
49307
  AWSS3Provider.prototype.list = function (path, config) {
48904
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49308
+ return __awaiter(this, void 0, void 0, function () {
48905
49309
  var credentialsOK, opt, bucket, track, maxKeys, prefix, final_path, list, token, listResult, params, error_5;
48906
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49310
+ return __generator(this, function (_a) {
48907
49311
  switch (_a.label) {
48908
49312
  case 0:
48909
49313
  return [4
@@ -48914,7 +49318,7 @@ function () {
48914
49318
  credentialsOK = _a.sent();
48915
49319
 
48916
49320
  if (!credentialsOK || !this._isWithCredentials(this._config)) {
48917
- throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_7__["StorageErrorStrings"].NO_CREDENTIALS);
49321
+ throw new Error(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_6__["StorageErrorStrings"].NO_CREDENTIALS);
48918
49322
  }
48919
49323
 
48920
49324
  opt = Object.assign({}, this._config, config);
@@ -48949,7 +49353,7 @@ function () {
48949
49353
 
48950
49354
  case 4:
48951
49355
  listResult = _a.sent();
48952
- list.push.apply(list, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(listResult.contents));
49356
+ list.push.apply(list, __spread(listResult.contents));
48953
49357
  if (listResult.nextToken) token = listResult.nextToken;
48954
49358
  _a.label = 5;
48955
49359
 
@@ -48972,12 +49376,12 @@ function () {
48972
49376
 
48973
49377
  case 8:
48974
49378
  listResult = _a.sent();
48975
- list.push.apply(list, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(listResult.contents));
49379
+ list.push.apply(list, __spread(listResult.contents));
48976
49380
  if (maxKeys > 1000) logger.warn("maxkeys can be from 0 - 1000 or 'ALL'. To list all files you can set maxKeys to 'ALL'.");
48977
49381
  _a.label = 9;
48978
49382
 
48979
49383
  case 9:
48980
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'list', {
49384
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'list', {
48981
49385
  method: 'list',
48982
49386
  result: 'success'
48983
49387
  }, null, list.length + " items returned from list operation");
@@ -48989,7 +49393,7 @@ function () {
48989
49393
  case 10:
48990
49394
  error_5 = _a.sent();
48991
49395
  logger.warn('list error', error_5);
48992
- Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_8__["dispatchStorageEvent"])(track, 'list', {
49396
+ Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'list', {
48993
49397
  method: 'list',
48994
49398
  result: 'failed'
48995
49399
  }, null, "Listing items failed: " + error_5.message);
@@ -49005,23 +49409,23 @@ function () {
49005
49409
  };
49006
49410
 
49007
49411
  AWSS3Provider.prototype._ensureCredentials = function () {
49008
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49412
+ return __awaiter(this, void 0, void 0, function () {
49009
49413
  var credentials, cred, error_6;
49010
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49414
+ return __generator(this, function (_a) {
49011
49415
  switch (_a.label) {
49012
49416
  case 0:
49013
49417
  _a.trys.push([0, 2,, 3]);
49014
49418
 
49015
49419
  return [4
49016
49420
  /*yield*/
49017
- , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].get()];
49421
+ , _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].get()];
49018
49422
 
49019
49423
  case 1:
49020
49424
  credentials = _a.sent();
49021
49425
  if (!credentials) return [2
49022
49426
  /*return*/
49023
49427
  , false];
49024
- cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Credentials"].shear(credentials);
49428
+ cred = _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Credentials"].shear(credentials);
49025
49429
  logger.debug('set credentials for storage', cred);
49026
49430
  this._config.credentials = cred;
49027
49431
  return [2
@@ -49074,8 +49478,8 @@ function () {
49074
49478
 
49075
49479
 
49076
49480
  AWSS3Provider.prototype._createNewS3Client = function (config, emitter) {
49077
- var s3client = Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["createS3Client"])(config, emitter);
49078
- s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["autoAdjustClockskewMiddleware"])(s3client.config), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_9__["autoAdjustClockskewMiddlewareOptions"]);
49481
+ var s3client = Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["createS3Client"])(config, emitter);
49482
+ s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["autoAdjustClockskewMiddleware"])(s3client.config), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_8__["autoAdjustClockskewMiddlewareOptions"]);
49079
49483
  return s3client;
49080
49484
  };
49081
49485
 
@@ -49103,14 +49507,13 @@ function () {
49103
49507
  "use strict";
49104
49508
  __webpack_require__.r(__webpack_exports__);
49105
49509
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWSS3ProviderManagedUpload", function() { return AWSS3ProviderManagedUpload; });
49106
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
49107
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
49108
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
49109
- /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
49110
- /* harmony import */ var _axios_http_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
49111
- /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
49112
- /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_4__);
49113
- /* harmony import */ var _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/S3ClientUtils */ "./lib-esm/common/S3ClientUtils.js");
49510
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
49511
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
49512
+ /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
49513
+ /* harmony import */ var _axios_http_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./axios-http-handler */ "./lib-esm/providers/axios-http-handler.js");
49514
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! events */ "../../node_modules/events/events.js");
49515
+ /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_3__);
49516
+ /* harmony import */ var _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/S3ClientUtils */ "./lib-esm/common/S3ClientUtils.js");
49114
49517
  function _typeof(obj) {
49115
49518
  "@babel/helpers - typeof";
49116
49519
 
@@ -49134,13 +49537,171 @@ function _typeof(obj) {
49134
49537
  */
49135
49538
 
49136
49539
 
49540
+ var __assign = undefined && undefined.__assign || function () {
49541
+ __assign = Object.assign || function (t) {
49542
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
49543
+ s = arguments[i];
49544
+
49545
+ for (var p in s) {
49546
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
49547
+ }
49548
+ }
49549
+
49550
+ return t;
49551
+ };
49552
+
49553
+ return __assign.apply(this, arguments);
49554
+ };
49555
+
49556
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
49557
+ function adopt(value) {
49558
+ return value instanceof P ? value : new P(function (resolve) {
49559
+ resolve(value);
49560
+ });
49561
+ }
49562
+
49563
+ return new (P || (P = Promise))(function (resolve, reject) {
49564
+ function fulfilled(value) {
49565
+ try {
49566
+ step(generator.next(value));
49567
+ } catch (e) {
49568
+ reject(e);
49569
+ }
49570
+ }
49571
+
49572
+ function rejected(value) {
49573
+ try {
49574
+ step(generator["throw"](value));
49575
+ } catch (e) {
49576
+ reject(e);
49577
+ }
49578
+ }
49579
+
49580
+ function step(result) {
49581
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
49582
+ }
49583
+
49584
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
49585
+ });
49586
+ };
49587
+
49588
+ var __generator = undefined && undefined.__generator || function (thisArg, body) {
49589
+ var _ = {
49590
+ label: 0,
49591
+ sent: function sent() {
49592
+ if (t[0] & 1) throw t[1];
49593
+ return t[1];
49594
+ },
49595
+ trys: [],
49596
+ ops: []
49597
+ },
49598
+ f,
49599
+ y,
49600
+ t,
49601
+ g;
49602
+ return g = {
49603
+ next: verb(0),
49604
+ "throw": verb(1),
49605
+ "return": verb(2)
49606
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49607
+ return this;
49608
+ }), g;
49609
+
49610
+ function verb(n) {
49611
+ return function (v) {
49612
+ return step([n, v]);
49613
+ };
49614
+ }
49615
+
49616
+ function step(op) {
49617
+ if (f) throw new TypeError("Generator is already executing.");
49618
+
49619
+ while (_) {
49620
+ try {
49621
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
49622
+ if (y = 0, t) op = [op[0] & 2, t.value];
49623
+
49624
+ switch (op[0]) {
49625
+ case 0:
49626
+ case 1:
49627
+ t = op;
49628
+ break;
49629
+
49630
+ case 4:
49631
+ _.label++;
49632
+ return {
49633
+ value: op[1],
49634
+ done: false
49635
+ };
49636
+
49637
+ case 5:
49638
+ _.label++;
49639
+ y = op[1];
49640
+ op = [0];
49641
+ continue;
49642
+
49643
+ case 7:
49644
+ op = _.ops.pop();
49645
+
49646
+ _.trys.pop();
49647
+
49648
+ continue;
49649
+
49650
+ default:
49651
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
49652
+ _ = 0;
49653
+ continue;
49654
+ }
49655
+
49656
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
49657
+ _.label = op[1];
49658
+ break;
49659
+ }
49660
+
49661
+ if (op[0] === 6 && _.label < t[1]) {
49662
+ _.label = t[1];
49663
+ t = op;
49664
+ break;
49665
+ }
49666
+
49667
+ if (t && _.label < t[2]) {
49668
+ _.label = t[2];
49669
+
49670
+ _.ops.push(op);
49137
49671
 
49672
+ break;
49673
+ }
49674
+
49675
+ if (t[2]) _.ops.pop();
49676
+
49677
+ _.trys.pop();
49678
+
49679
+ continue;
49680
+ }
49681
+
49682
+ op = body.call(thisArg, _);
49683
+ } catch (e) {
49684
+ op = [6, e];
49685
+ y = 0;
49686
+ } finally {
49687
+ f = t = 0;
49688
+ }
49689
+ }
49138
49690
 
49691
+ if (op[0] & 5) throw op[1];
49692
+ return {
49693
+ value: op[0] ? op[1] : void 0,
49694
+ done: true
49695
+ };
49696
+ }
49697
+ };
49139
49698
 
49140
49699
 
49141
49700
 
49142
49701
 
49143
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["ConsoleLogger"]('AWSS3ProviderManagedUpload');
49702
+
49703
+
49704
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('AWSS3ProviderManagedUpload');
49144
49705
 
49145
49706
  var AWSS3ProviderManagedUpload =
49146
49707
  /** @class */
@@ -49167,12 +49728,12 @@ function () {
49167
49728
  }
49168
49729
 
49169
49730
  AWSS3ProviderManagedUpload.prototype.upload = function () {
49170
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49731
+ return __awaiter(this, void 0, void 0, function () {
49171
49732
  var _a, putObjectCommand, _b, numberOfPartsToUpload, parts, start, error_1;
49172
49733
 
49173
49734
  var _this = this;
49174
49735
 
49175
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_c) {
49736
+ return __generator(this, function (_c) {
49176
49737
  switch (_c.label) {
49177
49738
  case 0:
49178
49739
  _c.trys.push([0, 10,, 12]);
@@ -49190,7 +49751,7 @@ function () {
49190
49751
  , 2]; // Multipart upload is not required. Upload the sanitized body as is
49191
49752
 
49192
49753
  this.params.Body = this.body;
49193
- putObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["PutObjectCommand"](this.params);
49754
+ putObjectCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["PutObjectCommand"](this.params);
49194
49755
  return [2
49195
49756
  /*return*/
49196
49757
  , this.s3client.send(putObjectCommand)];
@@ -49282,7 +49843,7 @@ function () {
49282
49843
  parts.push({
49283
49844
  bodyPart: this.body.slice(bodyStart, bodyEnd),
49284
49845
  partNumber: parts.length + 1,
49285
- emitter: new events__WEBPACK_IMPORTED_MODULE_4__["EventEmitter"](),
49846
+ emitter: new events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"](),
49286
49847
  _lastUploadedBytes: 0
49287
49848
  });
49288
49849
  bodyStart += this.minPartSize;
@@ -49296,14 +49857,14 @@ function () {
49296
49857
  };
49297
49858
 
49298
49859
  AWSS3ProviderManagedUpload.prototype.createMultiPartUpload = function () {
49299
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49860
+ return __awaiter(this, void 0, void 0, function () {
49300
49861
  var createMultiPartUploadCommand, response, error_2;
49301
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49862
+ return __generator(this, function (_a) {
49302
49863
  switch (_a.label) {
49303
49864
  case 0:
49304
49865
  _a.trys.push([0, 2,, 3]);
49305
49866
 
49306
- createMultiPartUploadCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["CreateMultipartUploadCommand"](this.params);
49867
+ createMultiPartUploadCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CreateMultipartUploadCommand"](this.params);
49307
49868
  return [4
49308
49869
  /*yield*/
49309
49870
  , this.s3client.send(createMultiPartUploadCommand)];
@@ -49335,12 +49896,12 @@ function () {
49335
49896
 
49336
49897
 
49337
49898
  AWSS3ProviderManagedUpload.prototype.uploadParts = function (uploadId, parts) {
49338
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49899
+ return __awaiter(this, void 0, void 0, function () {
49339
49900
  var allResults, i, error_3;
49340
49901
 
49341
49902
  var _this = this;
49342
49903
 
49343
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49904
+ return __generator(this, function (_a) {
49344
49905
  switch (_a.label) {
49345
49906
  case 0:
49346
49907
  _a.trys.push([0, 2,, 3]);
@@ -49348,10 +49909,10 @@ function () {
49348
49909
  return [4
49349
49910
  /*yield*/
49350
49911
  , Promise.all(parts.map(function (part) {
49351
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(_this, void 0, void 0, function () {
49912
+ return __awaiter(_this, void 0, void 0, function () {
49352
49913
  var options, _a, Key, Bucket, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, res;
49353
49914
 
49354
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) {
49915
+ return __generator(this, function (_b) {
49355
49916
  switch (_b.label) {
49356
49917
  case 0:
49357
49918
  this.setupEventListener(part);
@@ -49361,7 +49922,7 @@ function () {
49361
49922
  _a = this.params, Key = _a.Key, Bucket = _a.Bucket, SSECustomerAlgorithm = _a.SSECustomerAlgorithm, SSECustomerKey = _a.SSECustomerKey, SSECustomerKeyMD5 = _a.SSECustomerKeyMD5;
49362
49923
  return [4
49363
49924
  /*yield*/
49364
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["UploadPartCommand"](Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({
49925
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["UploadPartCommand"](__assign(__assign(__assign({
49365
49926
  PartNumber: part.partNumber,
49366
49927
  Body: part.bodyPart,
49367
49928
  UploadId: uploadId,
@@ -49414,9 +49975,9 @@ function () {
49414
49975
  };
49415
49976
 
49416
49977
  AWSS3ProviderManagedUpload.prototype.finishMultiPartUpload = function (uploadId) {
49417
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49978
+ return __awaiter(this, void 0, void 0, function () {
49418
49979
  var input, completeUploadCommand, data, error_4;
49419
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
49980
+ return __generator(this, function (_a) {
49420
49981
  switch (_a.label) {
49421
49982
  case 0:
49422
49983
  input = {
@@ -49427,7 +49988,7 @@ function () {
49427
49988
  Parts: this.completedParts
49428
49989
  }
49429
49990
  };
49430
- completeUploadCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["CompleteMultipartUploadCommand"](input);
49991
+ completeUploadCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CompleteMultipartUploadCommand"](input);
49431
49992
  _a.label = 1;
49432
49993
 
49433
49994
  case 1:
@@ -49458,9 +50019,9 @@ function () {
49458
50019
  };
49459
50020
 
49460
50021
  AWSS3ProviderManagedUpload.prototype.cleanup = function (uploadId) {
49461
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50022
+ return __awaiter(this, void 0, void 0, function () {
49462
50023
  var input, data;
49463
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50024
+ return __generator(this, function (_a) {
49464
50025
  switch (_a.label) {
49465
50026
  case 0:
49466
50027
  // Reset this's state
@@ -49475,14 +50036,14 @@ function () {
49475
50036
  };
49476
50037
  return [4
49477
50038
  /*yield*/
49478
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["AbortMultipartUploadCommand"](input))];
50039
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["AbortMultipartUploadCommand"](input))];
49479
50040
 
49480
50041
  case 1:
49481
50042
  _a.sent();
49482
50043
 
49483
50044
  return [4
49484
50045
  /*yield*/
49485
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_2__["ListPartsCommand"](input))];
50046
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["ListPartsCommand"](input))];
49486
50047
 
49487
50048
  case 2:
49488
50049
  data = _a.sent();
@@ -49500,14 +50061,14 @@ function () {
49500
50061
  };
49501
50062
 
49502
50063
  AWSS3ProviderManagedUpload.prototype.removeEventListener = function (part) {
49503
- part.emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__["SEND_UPLOAD_PROGRESS_EVENT"]);
49504
- part.emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__["SEND_DOWNLOAD_PROGRESS_EVENT"]);
50064
+ part.emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__["SEND_UPLOAD_PROGRESS_EVENT"]);
50065
+ part.emitter.removeAllListeners(_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__["SEND_DOWNLOAD_PROGRESS_EVENT"]);
49505
50066
  };
49506
50067
 
49507
50068
  AWSS3ProviderManagedUpload.prototype.setupEventListener = function (part) {
49508
50069
  var _this = this;
49509
50070
 
49510
- part.emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__["SEND_UPLOAD_PROGRESS_EVENT"], function (progress) {
50071
+ part.emitter.on(_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__["SEND_UPLOAD_PROGRESS_EVENT"], function (progress) {
49511
50072
  _this.progressChanged(part.partNumber, progress.loaded - part._lastUploadedBytes);
49512
50073
 
49513
50074
  part._lastUploadedBytes = progress.loaded;
@@ -49516,7 +50077,7 @@ function () {
49516
50077
 
49517
50078
  AWSS3ProviderManagedUpload.prototype.progressChanged = function (partNumber, incrementalUpdate) {
49518
50079
  this.bytesUploaded += incrementalUpdate;
49519
- this.emitter.emit(_axios_http_handler__WEBPACK_IMPORTED_MODULE_3__["SEND_UPLOAD_PROGRESS_EVENT"], {
50080
+ this.emitter.emit(_axios_http_handler__WEBPACK_IMPORTED_MODULE_2__["SEND_UPLOAD_PROGRESS_EVENT"], {
49520
50081
  loaded: this.bytesUploaded,
49521
50082
  total: this.totalBytesToUpload,
49522
50083
  part: partNumber,
@@ -49543,8 +50104,8 @@ function () {
49543
50104
  };
49544
50105
 
49545
50106
  AWSS3ProviderManagedUpload.prototype.validateAndSanitizeBody = function (body) {
49546
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49547
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50107
+ return __awaiter(this, void 0, void 0, function () {
50108
+ return __generator(this, function (_a) {
49548
50109
  if (this.isGenericObject(body)) {
49549
50110
  // Any javascript object
49550
50111
  return [2
@@ -49579,9 +50140,9 @@ function () {
49579
50140
  };
49580
50141
 
49581
50142
  AWSS3ProviderManagedUpload.prototype._createNewS3Client = function (config, emitter) {
49582
- var s3client = Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__["createS3Client"])(config, emitter);
49583
- s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__["createPrefixMiddleware"])(this.opts, this.params.Key), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__["prefixMiddlewareOptions"]);
49584
- s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__["autoAdjustClockskewMiddleware"])(s3client.config), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_5__["autoAdjustClockskewMiddlewareOptions"]);
50143
+ var s3client = Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__["createS3Client"])(config, emitter);
50144
+ s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__["createPrefixMiddleware"])(this.opts, this.params.Key), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__["prefixMiddlewareOptions"]);
50145
+ s3client.middlewareStack.add(Object(_common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__["autoAdjustClockskewMiddleware"])(s3client.config), _common_S3ClientUtils__WEBPACK_IMPORTED_MODULE_4__["autoAdjustClockskewMiddlewareOptions"]);
49585
50146
  return s3client;
49586
50147
  };
49587
50148
 
@@ -49604,15 +50165,191 @@ __webpack_require__.r(__webpack_exports__);
49604
50165
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWSS3UploadTaskState", function() { return AWSS3UploadTaskState; });
49605
50166
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TaskEvents", function() { return TaskEvents; });
49606
50167
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWSS3UploadTask", function() { return AWSS3UploadTask; });
49607
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
49608
- /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
49609
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
49610
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);
49611
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
49612
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
49613
- /* harmony import */ var _common_StorageUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/StorageUtils */ "./lib-esm/common/StorageUtils.js");
49614
- /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
49615
- /* harmony import */ var _common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/StorageConstants */ "./lib-esm/common/StorageConstants.js");
50168
+ /* harmony import */ var _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-sdk/client-s3 */ "../../node_modules/@aws-sdk/client-s3/dist/es/index.js");
50169
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
50170
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
50171
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
50172
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__);
50173
+ /* harmony import */ var _common_StorageUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/StorageUtils */ "./lib-esm/common/StorageUtils.js");
50174
+ /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
50175
+ /* harmony import */ var _common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/StorageConstants */ "./lib-esm/common/StorageConstants.js");
50176
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
50177
+ function adopt(value) {
50178
+ return value instanceof P ? value : new P(function (resolve) {
50179
+ resolve(value);
50180
+ });
50181
+ }
50182
+
50183
+ return new (P || (P = Promise))(function (resolve, reject) {
50184
+ function fulfilled(value) {
50185
+ try {
50186
+ step(generator.next(value));
50187
+ } catch (e) {
50188
+ reject(e);
50189
+ }
50190
+ }
50191
+
50192
+ function rejected(value) {
50193
+ try {
50194
+ step(generator["throw"](value));
50195
+ } catch (e) {
50196
+ reject(e);
50197
+ }
50198
+ }
50199
+
50200
+ function step(result) {
50201
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
50202
+ }
50203
+
50204
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
50205
+ });
50206
+ };
50207
+
50208
+ var __generator = undefined && undefined.__generator || function (thisArg, body) {
50209
+ var _ = {
50210
+ label: 0,
50211
+ sent: function sent() {
50212
+ if (t[0] & 1) throw t[1];
50213
+ return t[1];
50214
+ },
50215
+ trys: [],
50216
+ ops: []
50217
+ },
50218
+ f,
50219
+ y,
50220
+ t,
50221
+ g;
50222
+ return g = {
50223
+ next: verb(0),
50224
+ "throw": verb(1),
50225
+ "return": verb(2)
50226
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
50227
+ return this;
50228
+ }), g;
50229
+
50230
+ function verb(n) {
50231
+ return function (v) {
50232
+ return step([n, v]);
50233
+ };
50234
+ }
50235
+
50236
+ function step(op) {
50237
+ if (f) throw new TypeError("Generator is already executing.");
50238
+
50239
+ while (_) {
50240
+ try {
50241
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
50242
+ if (y = 0, t) op = [op[0] & 2, t.value];
50243
+
50244
+ switch (op[0]) {
50245
+ case 0:
50246
+ case 1:
50247
+ t = op;
50248
+ break;
50249
+
50250
+ case 4:
50251
+ _.label++;
50252
+ return {
50253
+ value: op[1],
50254
+ done: false
50255
+ };
50256
+
50257
+ case 5:
50258
+ _.label++;
50259
+ y = op[1];
50260
+ op = [0];
50261
+ continue;
50262
+
50263
+ case 7:
50264
+ op = _.ops.pop();
50265
+
50266
+ _.trys.pop();
50267
+
50268
+ continue;
50269
+
50270
+ default:
50271
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
50272
+ _ = 0;
50273
+ continue;
50274
+ }
50275
+
50276
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
50277
+ _.label = op[1];
50278
+ break;
50279
+ }
50280
+
50281
+ if (op[0] === 6 && _.label < t[1]) {
50282
+ _.label = t[1];
50283
+ t = op;
50284
+ break;
50285
+ }
50286
+
50287
+ if (t && _.label < t[2]) {
50288
+ _.label = t[2];
50289
+
50290
+ _.ops.push(op);
50291
+
50292
+ break;
50293
+ }
50294
+
50295
+ if (t[2]) _.ops.pop();
50296
+
50297
+ _.trys.pop();
50298
+
50299
+ continue;
50300
+ }
50301
+
50302
+ op = body.call(thisArg, _);
50303
+ } catch (e) {
50304
+ op = [6, e];
50305
+ y = 0;
50306
+ } finally {
50307
+ f = t = 0;
50308
+ }
50309
+ }
50310
+
50311
+ if (op[0] & 5) throw op[1];
50312
+ return {
50313
+ value: op[0] ? op[1] : void 0,
50314
+ done: true
50315
+ };
50316
+ }
50317
+ };
50318
+
50319
+ var __read = undefined && undefined.__read || function (o, n) {
50320
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
50321
+ if (!m) return o;
50322
+ var i = m.call(o),
50323
+ r,
50324
+ ar = [],
50325
+ e;
50326
+
50327
+ try {
50328
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
50329
+ ar.push(r.value);
50330
+ }
50331
+ } catch (error) {
50332
+ e = {
50333
+ error: error
50334
+ };
50335
+ } finally {
50336
+ try {
50337
+ if (r && !r.done && (m = i["return"])) m.call(i);
50338
+ } finally {
50339
+ if (e) throw e.error;
50340
+ }
50341
+ }
50342
+
50343
+ return ar;
50344
+ };
50345
+
50346
+ var __spread = undefined && undefined.__spread || function () {
50347
+ for (var ar = [], i = 0; i < arguments.length; i++) {
50348
+ ar = ar.concat(__read(arguments[i]));
50349
+ }
50350
+
50351
+ return ar;
50352
+ };
49616
50353
 
49617
50354
 
49618
50355
 
@@ -49620,7 +50357,7 @@ __webpack_require__.r(__webpack_exports__);
49620
50357
 
49621
50358
 
49622
50359
 
49623
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["Logger"]('AWSS3UploadTask');
50360
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Logger"]('AWSS3UploadTask');
49624
50361
  var AWSS3UploadTaskState;
49625
50362
 
49626
50363
  (function (AWSS3UploadTaskState) {
@@ -49672,7 +50409,7 @@ function () {
49672
50409
  this.state = AWSS3UploadTaskState.INIT;
49673
50410
  this.prefixPromise = prefixPromise;
49674
50411
  this.s3client = s3Client;
49675
- this.s3client.middlewareStack.remove(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__["SET_CONTENT_LENGTH_HEADER"]);
50412
+ this.s3client.middlewareStack.remove(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__["SET_CONTENT_LENGTH_HEADER"]);
49676
50413
  this.storage = storage;
49677
50414
  this.storageSync = Promise.resolve();
49678
50415
 
@@ -49713,15 +50450,15 @@ function () {
49713
50450
  AWSS3UploadTask.prototype._listSingleFile = function (_a) {
49714
50451
  var key = _a.key,
49715
50452
  bucket = _a.bucket;
49716
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50453
+ return __awaiter(this, void 0, void 0, function () {
49717
50454
  var listObjectRes, _b, Contents, prefix, obj;
49718
50455
 
49719
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_c) {
50456
+ return __generator(this, function (_c) {
49720
50457
  switch (_c.label) {
49721
50458
  case 0:
49722
50459
  return [4
49723
50460
  /*yield*/
49724
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["ListObjectsV2Command"]({
50461
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["ListObjectsV2Command"]({
49725
50462
  Bucket: bucket,
49726
50463
  Prefix: key
49727
50464
  }))];
@@ -49748,7 +50485,7 @@ function () {
49748
50485
 
49749
50486
  AWSS3UploadTask.prototype._getFileId = function (level) {
49750
50487
  // We should check if it's a File first because File is also instance of a Blob
49751
- if (Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_4__["isFile"])(this.file)) {
50488
+ if (Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_3__["isFile"])(this.file)) {
49752
50489
  return [this.file.name, this.file.lastModified, this.file.size, this.file.type, this.params.Bucket, level, this.params.Key].join('-');
49753
50490
  } else {
49754
50491
  return [this.file.size, this.file.type, this.params.Bucket, level, this.params.Key].join('-');
@@ -49756,9 +50493,9 @@ function () {
49756
50493
  };
49757
50494
 
49758
50495
  AWSS3UploadTask.prototype._findCachedUploadParts = function () {
49759
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50496
+ return __awaiter(this, void 0, void 0, function () {
49760
50497
  var uploadRequests, cachedUploadFileData, listPartsOutput;
49761
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50498
+ return __generator(this, function (_a) {
49762
50499
  switch (_a.label) {
49763
50500
  case 0:
49764
50501
  return [4
@@ -49779,10 +50516,10 @@ function () {
49779
50516
 
49780
50517
  cachedUploadFileData = uploadRequests[this.fileId];
49781
50518
  cachedUploadFileData.lastTouched = Date.now();
49782
- this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
50519
+ this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
49783
50520
  return [4
49784
50521
  /*yield*/
49785
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["ListPartsCommand"]({
50522
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["ListPartsCommand"]({
49786
50523
  Bucket: this.params.Bucket,
49787
50524
  Key: this.params.Key,
49788
50525
  UploadId: cachedUploadFileData.uploadId
@@ -49812,9 +50549,9 @@ function () {
49812
50549
  };
49813
50550
 
49814
50551
  AWSS3UploadTask.prototype._listCachedUploadTasks = function () {
49815
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50552
+ return __awaiter(this, void 0, void 0, function () {
49816
50553
  var tasks;
49817
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50554
+ return __generator(this, function (_a) {
49818
50555
  switch (_a.label) {
49819
50556
  case 0:
49820
50557
  return [4
@@ -49824,7 +50561,7 @@ function () {
49824
50561
  case 1:
49825
50562
  _a.sent();
49826
50563
 
49827
- tasks = this.storage.getItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__["UPLOADS_STORAGE_KEY"]) || '{}';
50564
+ tasks = this.storage.getItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__["UPLOADS_STORAGE_KEY"]) || '{}';
49828
50565
  return [2
49829
50566
  /*return*/
49830
50567
  , JSON.parse(tasks)];
@@ -49834,9 +50571,9 @@ function () {
49834
50571
  };
49835
50572
 
49836
50573
  AWSS3UploadTask.prototype._cache = function (fileMetadata) {
49837
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50574
+ return __awaiter(this, void 0, void 0, function () {
49838
50575
  var uploadRequests;
49839
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50576
+ return __generator(this, function (_a) {
49840
50577
  switch (_a.label) {
49841
50578
  case 0:
49842
50579
  return [4
@@ -49846,7 +50583,7 @@ function () {
49846
50583
  case 1:
49847
50584
  uploadRequests = _a.sent();
49848
50585
  uploadRequests[this.fileId] = fileMetadata;
49849
- this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
50586
+ this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
49850
50587
  return [2
49851
50588
  /*return*/
49852
50589
  ];
@@ -49856,10 +50593,10 @@ function () {
49856
50593
  };
49857
50594
 
49858
50595
  AWSS3UploadTask.prototype._isCached = function () {
49859
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50596
+ return __awaiter(this, void 0, void 0, function () {
49860
50597
  var _a, _b;
49861
50598
 
49862
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_c) {
50599
+ return __generator(this, function (_c) {
49863
50600
  switch (_c.label) {
49864
50601
  case 0:
49865
50602
  _b = (_a = Object.prototype.hasOwnProperty).call;
@@ -49877,9 +50614,9 @@ function () {
49877
50614
  };
49878
50615
 
49879
50616
  AWSS3UploadTask.prototype._removeFromCache = function () {
49880
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50617
+ return __awaiter(this, void 0, void 0, function () {
49881
50618
  var uploadRequests;
49882
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50619
+ return __generator(this, function (_a) {
49883
50620
  switch (_a.label) {
49884
50621
  case 0:
49885
50622
  return [4
@@ -49889,7 +50626,7 @@ function () {
49889
50626
  case 1:
49890
50627
  uploadRequests = _a.sent();
49891
50628
  delete uploadRequests[this.fileId];
49892
- this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_6__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
50629
+ this.storage.setItem(_common_StorageConstants__WEBPACK_IMPORTED_MODULE_5__["UPLOADS_STORAGE_KEY"], JSON.stringify(uploadRequests));
49893
50630
  return [2
49894
50631
  /*return*/
49895
50632
  ];
@@ -49902,13 +50639,13 @@ function () {
49902
50639
  var eTag = _a.eTag,
49903
50640
  partNumber = _a.partNumber,
49904
50641
  chunk = _a.chunk;
49905
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
49906
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) {
50642
+ return __awaiter(this, void 0, void 0, function () {
50643
+ return __generator(this, function (_b) {
49907
50644
  this.completedParts.push({
49908
50645
  ETag: eTag,
49909
50646
  PartNumber: partNumber
49910
50647
  });
49911
- this.bytesUploaded += Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_4__["byteLength"])(chunk);
50648
+ this.bytesUploaded += Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_3__["byteLength"])(chunk);
49912
50649
 
49913
50650
  this._emitEvent(TaskEvents.UPLOAD_PROGRESS, {
49914
50651
  loaded: this.bytesUploaded,
@@ -49929,16 +50666,16 @@ function () {
49929
50666
  };
49930
50667
 
49931
50668
  AWSS3UploadTask.prototype._completeUpload = function () {
49932
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50669
+ return __awaiter(this, void 0, void 0, function () {
49933
50670
  var err_1;
49934
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50671
+ return __generator(this, function (_a) {
49935
50672
  switch (_a.label) {
49936
50673
  case 0:
49937
50674
  _a.trys.push([0, 2,, 3]);
49938
50675
 
49939
50676
  return [4
49940
50677
  /*yield*/
49941
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CompleteMultipartUploadCommand"]({
50678
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["CompleteMultipartUploadCommand"]({
49942
50679
  Bucket: this.params.Bucket,
49943
50680
  Key: this.params.Key,
49944
50681
  UploadId: this.uploadId,
@@ -49984,16 +50721,16 @@ function () {
49984
50721
  };
49985
50722
 
49986
50723
  AWSS3UploadTask.prototype._makeUploadPartRequest = function (input, cancelTokenSource) {
49987
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50724
+ return __awaiter(this, void 0, void 0, function () {
49988
50725
  var res, err_2;
49989
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50726
+ return __generator(this, function (_a) {
49990
50727
  switch (_a.label) {
49991
50728
  case 0:
49992
50729
  _a.trys.push([0, 3,, 4]);
49993
50730
 
49994
50731
  return [4
49995
50732
  /*yield*/
49996
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["UploadPartCommand"](input), {
50733
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["UploadPartCommand"](input), {
49997
50734
  cancelTokenSource: cancelTokenSource
49998
50735
  })];
49999
50736
 
@@ -50027,7 +50764,7 @@ function () {
50027
50764
  // expected behavior
50028
50765
 
50029
50766
 
50030
- if (!axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(err_2) && err_2.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_5__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
50767
+ if (!axios__WEBPACK_IMPORTED_MODULE_1___default.a.isCancel(err_2) && err_2.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
50031
50768
  this._emitEvent(TaskEvents.ERROR, err_2);
50032
50769
 
50033
50770
  this.pause();
@@ -50048,7 +50785,7 @@ function () {
50048
50785
 
50049
50786
  AWSS3UploadTask.prototype._startNextPart = function () {
50050
50787
  if (this.queued.length > 0 && this.state !== AWSS3UploadTaskState.PAUSED) {
50051
- var cancelTokenSource = axios__WEBPACK_IMPORTED_MODULE_2___default.a.CancelToken.source();
50788
+ var cancelTokenSource = axios__WEBPACK_IMPORTED_MODULE_1___default.a.CancelToken.source();
50052
50789
  var nextPart = this.queued.shift();
50053
50790
  this.inProgress.push({
50054
50791
  uploadPartInput: nextPart,
@@ -50066,9 +50803,9 @@ function () {
50066
50803
 
50067
50804
 
50068
50805
  AWSS3UploadTask.prototype._verifyFileSize = function () {
50069
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50806
+ return __awaiter(this, void 0, void 0, function () {
50070
50807
  var obj, valid;
50071
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50808
+ return __generator(this, function (_a) {
50072
50809
  switch (_a.label) {
50073
50810
  case 0:
50074
50811
  return [4
@@ -50142,14 +50879,14 @@ function () {
50142
50879
  };
50143
50880
 
50144
50881
  AWSS3UploadTask.prototype._initMultipartUpload = function () {
50145
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50882
+ return __awaiter(this, void 0, void 0, function () {
50146
50883
  var res;
50147
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
50884
+ return __generator(this, function (_a) {
50148
50885
  switch (_a.label) {
50149
50886
  case 0:
50150
50887
  return [4
50151
50888
  /*yield*/
50152
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CreateMultipartUploadCommand"](this.params))];
50889
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["CreateMultipartUploadCommand"](this.params))];
50153
50890
 
50154
50891
  case 1:
50155
50892
  res = _a.sent();
@@ -50171,10 +50908,10 @@ function () {
50171
50908
  };
50172
50909
 
50173
50910
  AWSS3UploadTask.prototype._initializeUploadTask = function () {
50174
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
50911
+ return __awaiter(this, void 0, void 0, function () {
50175
50912
  var _a, parts, uploadId, uploadId, err_3;
50176
50913
 
50177
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) {
50914
+ return __generator(this, function (_b) {
50178
50915
  switch (_b.label) {
50179
50916
  case 0:
50180
50917
  this.state = AWSS3UploadTaskState.IN_PROGRESS;
@@ -50233,7 +50970,7 @@ function () {
50233
50970
  case 7:
50234
50971
  err_3 = _b.sent();
50235
50972
 
50236
- if (!axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(err_3)) {
50973
+ if (!axios__WEBPACK_IMPORTED_MODULE_1___default.a.isCancel(err_3)) {
50237
50974
  logger.error('Error initializing the upload task', err_3);
50238
50975
  }
50239
50976
 
@@ -50274,9 +51011,9 @@ function () {
50274
51011
  };
50275
51012
 
50276
51013
  AWSS3UploadTask.prototype._cancel = function () {
50277
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () {
51014
+ return __awaiter(this, void 0, void 0, function () {
50278
51015
  var err_4;
50279
- return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
51016
+ return __generator(this, function (_a) {
50280
51017
  switch (_a.label) {
50281
51018
  case 0:
50282
51019
  if (!(this.state === AWSS3UploadTaskState.CANCELLED)) return [3
@@ -50309,7 +51046,7 @@ function () {
50309
51046
 
50310
51047
  return [4
50311
51048
  /*yield*/
50312
- , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["AbortMultipartUploadCommand"]({
51049
+ , this.s3client.send(new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_0__["AbortMultipartUploadCommand"]({
50313
51050
  Bucket: this.params.Bucket,
50314
51051
  Key: this.params.Key,
50315
51052
  UploadId: this.uploadId
@@ -50365,10 +51102,10 @@ function () {
50365
51102
 
50366
51103
  var removedInProgressReq = this.inProgress.splice(0, this.inProgress.length);
50367
51104
  removedInProgressReq.forEach(function (req) {
50368
- req.cancel(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_5__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE);
51105
+ req.cancel(_common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE);
50369
51106
  }); // Put all removed in progress parts back into the queue
50370
51107
 
50371
- (_a = this.queued).unshift.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(removedInProgressReq.map(function (req) {
51108
+ (_a = this.queued).unshift.apply(_a, __spread(removedInProgressReq.map(function (req) {
50372
51109
  return req.uploadPartInput;
50373
51110
  })));
50374
51111
  };
@@ -50393,14 +51130,13 @@ __webpack_require__.r(__webpack_exports__);
50393
51130
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SEND_DOWNLOAD_PROGRESS_EVENT", function() { return SEND_DOWNLOAD_PROGRESS_EVENT; });
50394
51131
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reactNativeRequestTransformer", function() { return reactNativeRequestTransformer; });
50395
51132
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxiosHttpHandler", function() { return AxiosHttpHandler; });
50396
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
50397
- /* harmony import */ var _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/protocol-http */ "../../node_modules/@aws-sdk/protocol-http/dist/es/index.js");
50398
- /* harmony import */ var _aws_sdk_querystring_builder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-sdk/querystring-builder */ "./node_modules/@aws-sdk/querystring-builder/dist/es/index.js");
50399
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
50400
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
50401
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
50402
- /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__);
50403
- /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
51133
+ /* harmony import */ var _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-sdk/protocol-http */ "../../node_modules/@aws-sdk/protocol-http/dist/es/index.js");
51134
+ /* harmony import */ var _aws_sdk_querystring_builder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/querystring-builder */ "./node_modules/@aws-sdk/querystring-builder/dist/es/index.js");
51135
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "../../node_modules/axios/index.js");
51136
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);
51137
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
51138
+ /* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
51139
+ /* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
50404
51140
  /*
50405
51141
  * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
50406
51142
  *
@@ -50413,13 +51149,56 @@ __webpack_require__.r(__webpack_exports__);
50413
51149
  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
50414
51150
  * and limitations under the License.
50415
51151
  */
51152
+ var __values = undefined && undefined.__values || function (o) {
51153
+ var s = typeof Symbol === "function" && Symbol.iterator,
51154
+ m = s && o[s],
51155
+ i = 0;
51156
+ if (m) return m.call(o);
51157
+ if (o && typeof o.length === "number") return {
51158
+ next: function next() {
51159
+ if (o && i >= o.length) o = void 0;
51160
+ return {
51161
+ value: o && o[i++],
51162
+ done: !o
51163
+ };
51164
+ }
51165
+ };
51166
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
51167
+ };
51168
+
51169
+ var __read = undefined && undefined.__read || function (o, n) {
51170
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
51171
+ if (!m) return o;
51172
+ var i = m.call(o),
51173
+ r,
51174
+ ar = [],
51175
+ e;
51176
+
51177
+ try {
51178
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
51179
+ ar.push(r.value);
51180
+ }
51181
+ } catch (error) {
51182
+ e = {
51183
+ error: error
51184
+ };
51185
+ } finally {
51186
+ try {
51187
+ if (r && !r.done && (m = i["return"])) m.call(i);
51188
+ } finally {
51189
+ if (e) throw e.error;
51190
+ }
51191
+ }
51192
+
51193
+ return ar;
51194
+ };
50416
51195
 
50417
51196
 
50418
51197
 
50419
51198
 
50420
51199
 
50421
51200
 
50422
- var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["ConsoleLogger"]('axios-http-handler');
51201
+ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]('axios-http-handler');
50423
51202
  var SEND_UPLOAD_PROGRESS_EVENT = 'sendUploadProgress';
50424
51203
  var SEND_DOWNLOAD_PROGRESS_EVENT = 'sendDownloadProgress';
50425
51204
 
@@ -50435,8 +51214,8 @@ var normalizeHeaders = function normalizeHeaders(headers, normalizedName) {
50435
51214
  var e_1, _a;
50436
51215
 
50437
51216
  try {
50438
- for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.entries(headers)), _c = _b.next(); !_c.done; _c = _b.next()) {
50439
- var _d = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_c.value, 2),
51217
+ for (var _b = __values(Object.entries(headers)), _c = _b.next(); !_c.done; _c = _b.next()) {
51218
+ var _d = __read(_c.value, 2),
50440
51219
  k = _d[0],
50441
51220
  v = _d[1];
50442
51221
 
@@ -50466,7 +51245,7 @@ var reactNativeRequestTransformer = [function (data, headers) {
50466
51245
  } // Axios' default transformRequest is an array
50467
51246
 
50468
51247
 
50469
- return axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.transformRequest[0].call(null, data, headers);
51248
+ return axios__WEBPACK_IMPORTED_MODULE_2___default.a.defaults.transformRequest[0].call(null, data, headers);
50470
51249
  }];
50471
51250
 
50472
51251
  var AxiosHttpHandler =
@@ -50494,7 +51273,7 @@ function () {
50494
51273
  var path = request.path;
50495
51274
 
50496
51275
  if (request.query) {
50497
- var queryString = Object(_aws_sdk_querystring_builder__WEBPACK_IMPORTED_MODULE_2__["buildQueryString"])(request.query);
51276
+ var queryString = Object(_aws_sdk_querystring_builder__WEBPACK_IMPORTED_MODULE_1__["buildQueryString"])(request.query);
50498
51277
 
50499
51278
  if (queryString) {
50500
51279
  path += "?" + queryString;
@@ -50563,13 +51342,13 @@ function () {
50563
51342
  // Axios to treat Blobs as generic Javascript objects. Therefore we need a to use a custom request transformer
50564
51343
  // to correctly handle Blob in React Native.
50565
51344
 
50566
- if (_aws_amplify_core__WEBPACK_IMPORTED_MODULE_4__["Platform"].isReactNative) {
51345
+ if (_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["Platform"].isReactNative) {
50567
51346
  axiosRequest.transformRequest = reactNativeRequestTransformer;
50568
51347
  }
50569
51348
 
50570
- var raceOfPromises = [axios__WEBPACK_IMPORTED_MODULE_3___default.a.request(axiosRequest).then(function (response) {
51349
+ var raceOfPromises = [axios__WEBPACK_IMPORTED_MODULE_2___default.a.request(axiosRequest).then(function (response) {
50571
51350
  return {
50572
- response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"]({
51351
+ response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__["HttpResponse"]({
50573
51352
  headers: response.headers,
50574
51353
  statusCode: response.status,
50575
51354
  body: response.data
@@ -50579,7 +51358,7 @@ function () {
50579
51358
  var _a, _b; // Error
50580
51359
 
50581
51360
 
50582
- if (error.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_5__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
51361
+ if (error.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
50583
51362
  logger.error(error.message);
50584
51363
  } // for axios' cancel error, we should re-throw it back so it's not considered an s3client error
50585
51364
  // if we return empty, or an abitrary error HttpResponse, it will be hard to debug down the line.
@@ -50589,14 +51368,14 @@ function () {
50589
51368
  // consider the request successful by mistake. In this case we should also re-throw the error.
50590
51369
 
50591
51370
 
50592
- if (axios__WEBPACK_IMPORTED_MODULE_3___default.a.isCancel(error) || !hasErrorResponse(error)) {
51371
+ if (axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error) || !hasErrorResponse(error)) {
50593
51372
  throw error;
50594
51373
  } // otherwise, we should re-construct an HttpResponse from the error, so that it can be passed down to other
50595
51374
  // aws sdk middleware (e.g retry, clock skew correction, error message serializing)
50596
51375
 
50597
51376
 
50598
51377
  return {
50599
- response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"]({
51378
+ response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__["HttpResponse"]({
50600
51379
  statusCode: error.response.status,
50601
51380
  body: (_a = error.response) === null || _a === void 0 ? void 0 : _a.data,
50602
51381
  headers: (_b = error.response) === null || _b === void 0 ? void 0 : _b.headers