@aws-amplify/storage 4.4.12 → 4.4.13-custom-pk.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +146 -0
- package/dist/aws-amplify-storage.js +316 -248
- package/dist/aws-amplify-storage.js.map +1 -1
- package/dist/aws-amplify-storage.min.js +4 -18
- package/dist/aws-amplify-storage.min.js.map +1 -1
- package/lib/providers/AWSS3ProviderManagedUpload.d.ts +1 -3
- package/lib/providers/AWSS3ProviderManagedUpload.js +66 -86
- package/lib/providers/AWSS3ProviderManagedUpload.js.map +1 -1
- package/lib/providers/axios-http-handler.d.ts +18 -1
- package/lib/providers/axios-http-handler.js +20 -7
- package/lib/providers/axios-http-handler.js.map +1 -1
- package/lib-esm/providers/AWSS3ProviderManagedUpload.d.ts +1 -3
- package/lib-esm/providers/AWSS3ProviderManagedUpload.js +66 -86
- package/lib-esm/providers/AWSS3ProviderManagedUpload.js.map +1 -1
- package/lib-esm/providers/axios-http-handler.d.ts +18 -1
- package/lib-esm/providers/axios-http-handler.js +20 -7
- package/lib-esm/providers/axios-http-handler.js.map +1 -1
- package/package.json +5 -6
- package/src/providers/AWSS3ProviderManagedUpload.ts +75 -89
- package/src/providers/axios-http-handler.ts +38 -7
|
@@ -31617,7 +31617,7 @@ var waitForObjectExists = function (params, input) { return Object(tslib__WEBPAC
|
|
|
31617
31617
|
/*!****************************************************************************************!*\
|
|
31618
31618
|
!*** /root/amplify-js/node_modules/@aws-sdk/client-s3/node_modules/tslib/tslib.es6.js ***!
|
|
31619
31619
|
\****************************************************************************************/
|
|
31620
|
-
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
|
|
31620
|
+
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn */
|
|
31621
31621
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
31622
31622
|
|
|
31623
31623
|
"use strict";
|
|
@@ -31646,7 +31646,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31646
31646
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
|
|
31647
31647
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
|
|
31648
31648
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
|
|
31649
|
-
|
|
31649
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldIn", function() { return __classPrivateFieldIn; });
|
|
31650
|
+
/******************************************************************************
|
|
31650
31651
|
Copyright (c) Microsoft Corporation.
|
|
31651
31652
|
|
|
31652
31653
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -31755,7 +31756,11 @@ function __generator(thisArg, body) {
|
|
|
31755
31756
|
|
|
31756
31757
|
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
31757
31758
|
if (k2 === undefined) k2 = k;
|
|
31758
|
-
Object.
|
|
31759
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31760
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
31761
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
31762
|
+
}
|
|
31763
|
+
Object.defineProperty(o, k2, desc);
|
|
31759
31764
|
}) : (function(o, m, k, k2) {
|
|
31760
31765
|
if (k2 === undefined) k2 = k;
|
|
31761
31766
|
o[k2] = m[k];
|
|
@@ -31885,6 +31890,11 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
|
31885
31890
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
31886
31891
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
31887
31892
|
}
|
|
31893
|
+
|
|
31894
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
31895
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
31896
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
31897
|
+
}
|
|
31888
31898
|
|
|
31889
31899
|
|
|
31890
31900
|
/***/ }),
|
|
@@ -40244,12 +40254,24 @@ var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../../node
|
|
|
40244
40254
|
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "../../node_modules/axios/lib/helpers/parseHeaders.js");
|
|
40245
40255
|
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "../../node_modules/axios/lib/helpers/isURLSameOrigin.js");
|
|
40246
40256
|
var createError = __webpack_require__(/*! ../core/createError */ "../../node_modules/axios/lib/core/createError.js");
|
|
40257
|
+
var defaults = __webpack_require__(/*! ../defaults */ "../../node_modules/axios/lib/defaults.js");
|
|
40258
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
40247
40259
|
|
|
40248
40260
|
module.exports = function xhrAdapter(config) {
|
|
40249
40261
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
40250
40262
|
var requestData = config.data;
|
|
40251
40263
|
var requestHeaders = config.headers;
|
|
40252
40264
|
var responseType = config.responseType;
|
|
40265
|
+
var onCanceled;
|
|
40266
|
+
function done() {
|
|
40267
|
+
if (config.cancelToken) {
|
|
40268
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
40269
|
+
}
|
|
40270
|
+
|
|
40271
|
+
if (config.signal) {
|
|
40272
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
40273
|
+
}
|
|
40274
|
+
}
|
|
40253
40275
|
|
|
40254
40276
|
if (utils.isFormData(requestData)) {
|
|
40255
40277
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
@@ -40287,7 +40309,13 @@ module.exports = function xhrAdapter(config) {
|
|
|
40287
40309
|
request: request
|
|
40288
40310
|
};
|
|
40289
40311
|
|
|
40290
|
-
settle(
|
|
40312
|
+
settle(function _resolve(value) {
|
|
40313
|
+
resolve(value);
|
|
40314
|
+
done();
|
|
40315
|
+
}, function _reject(err) {
|
|
40316
|
+
reject(err);
|
|
40317
|
+
done();
|
|
40318
|
+
}, response);
|
|
40291
40319
|
|
|
40292
40320
|
// Clean up request
|
|
40293
40321
|
request = null;
|
|
@@ -40340,14 +40368,15 @@ module.exports = function xhrAdapter(config) {
|
|
|
40340
40368
|
|
|
40341
40369
|
// Handle timeout
|
|
40342
40370
|
request.ontimeout = function handleTimeout() {
|
|
40343
|
-
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
|
40371
|
+
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
40372
|
+
var transitional = config.transitional || defaults.transitional;
|
|
40344
40373
|
if (config.timeoutErrorMessage) {
|
|
40345
40374
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
40346
40375
|
}
|
|
40347
40376
|
reject(createError(
|
|
40348
40377
|
timeoutErrorMessage,
|
|
40349
40378
|
config,
|
|
40350
|
-
|
|
40379
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
40351
40380
|
request));
|
|
40352
40381
|
|
|
40353
40382
|
// Clean up request
|
|
@@ -40401,18 +40430,22 @@ module.exports = function xhrAdapter(config) {
|
|
|
40401
40430
|
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
40402
40431
|
}
|
|
40403
40432
|
|
|
40404
|
-
if (config.cancelToken) {
|
|
40433
|
+
if (config.cancelToken || config.signal) {
|
|
40405
40434
|
// Handle cancellation
|
|
40406
|
-
|
|
40435
|
+
// eslint-disable-next-line func-names
|
|
40436
|
+
onCanceled = function(cancel) {
|
|
40407
40437
|
if (!request) {
|
|
40408
40438
|
return;
|
|
40409
40439
|
}
|
|
40410
|
-
|
|
40440
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
|
|
40411
40441
|
request.abort();
|
|
40412
|
-
reject(cancel);
|
|
40413
|
-
// Clean up request
|
|
40414
40442
|
request = null;
|
|
40415
|
-
}
|
|
40443
|
+
};
|
|
40444
|
+
|
|
40445
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
40446
|
+
if (config.signal) {
|
|
40447
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
40448
|
+
}
|
|
40416
40449
|
}
|
|
40417
40450
|
|
|
40418
40451
|
if (!requestData) {
|
|
@@ -40459,6 +40492,11 @@ function createInstance(defaultConfig) {
|
|
|
40459
40492
|
// Copy context to instance
|
|
40460
40493
|
utils.extend(instance, context);
|
|
40461
40494
|
|
|
40495
|
+
// Factory for creating new instances
|
|
40496
|
+
instance.create = function create(instanceConfig) {
|
|
40497
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
40498
|
+
};
|
|
40499
|
+
|
|
40462
40500
|
return instance;
|
|
40463
40501
|
}
|
|
40464
40502
|
|
|
@@ -40468,15 +40506,11 @@ var axios = createInstance(defaults);
|
|
|
40468
40506
|
// Expose Axios class to allow class inheritance
|
|
40469
40507
|
axios.Axios = Axios;
|
|
40470
40508
|
|
|
40471
|
-
// Factory for creating new instances
|
|
40472
|
-
axios.create = function create(instanceConfig) {
|
|
40473
|
-
return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
|
40474
|
-
};
|
|
40475
|
-
|
|
40476
40509
|
// Expose Cancel & CancelToken
|
|
40477
40510
|
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
40478
40511
|
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "../../node_modules/axios/lib/cancel/CancelToken.js");
|
|
40479
40512
|
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "../../node_modules/axios/lib/cancel/isCancel.js");
|
|
40513
|
+
axios.VERSION = __webpack_require__(/*! ./env/data */ "../../node_modules/axios/lib/env/data.js").version;
|
|
40480
40514
|
|
|
40481
40515
|
// Expose all/spread
|
|
40482
40516
|
axios.all = function all(promises) {
|
|
@@ -40550,11 +40584,42 @@ function CancelToken(executor) {
|
|
|
40550
40584
|
}
|
|
40551
40585
|
|
|
40552
40586
|
var resolvePromise;
|
|
40587
|
+
|
|
40553
40588
|
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
40554
40589
|
resolvePromise = resolve;
|
|
40555
40590
|
});
|
|
40556
40591
|
|
|
40557
40592
|
var token = this;
|
|
40593
|
+
|
|
40594
|
+
// eslint-disable-next-line func-names
|
|
40595
|
+
this.promise.then(function(cancel) {
|
|
40596
|
+
if (!token._listeners) return;
|
|
40597
|
+
|
|
40598
|
+
var i;
|
|
40599
|
+
var l = token._listeners.length;
|
|
40600
|
+
|
|
40601
|
+
for (i = 0; i < l; i++) {
|
|
40602
|
+
token._listeners[i](cancel);
|
|
40603
|
+
}
|
|
40604
|
+
token._listeners = null;
|
|
40605
|
+
});
|
|
40606
|
+
|
|
40607
|
+
// eslint-disable-next-line func-names
|
|
40608
|
+
this.promise.then = function(onfulfilled) {
|
|
40609
|
+
var _resolve;
|
|
40610
|
+
// eslint-disable-next-line func-names
|
|
40611
|
+
var promise = new Promise(function(resolve) {
|
|
40612
|
+
token.subscribe(resolve);
|
|
40613
|
+
_resolve = resolve;
|
|
40614
|
+
}).then(onfulfilled);
|
|
40615
|
+
|
|
40616
|
+
promise.cancel = function reject() {
|
|
40617
|
+
token.unsubscribe(_resolve);
|
|
40618
|
+
};
|
|
40619
|
+
|
|
40620
|
+
return promise;
|
|
40621
|
+
};
|
|
40622
|
+
|
|
40558
40623
|
executor(function cancel(message) {
|
|
40559
40624
|
if (token.reason) {
|
|
40560
40625
|
// Cancellation has already been requested
|
|
@@ -40575,6 +40640,37 @@ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
|
40575
40640
|
}
|
|
40576
40641
|
};
|
|
40577
40642
|
|
|
40643
|
+
/**
|
|
40644
|
+
* Subscribe to the cancel signal
|
|
40645
|
+
*/
|
|
40646
|
+
|
|
40647
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
40648
|
+
if (this.reason) {
|
|
40649
|
+
listener(this.reason);
|
|
40650
|
+
return;
|
|
40651
|
+
}
|
|
40652
|
+
|
|
40653
|
+
if (this._listeners) {
|
|
40654
|
+
this._listeners.push(listener);
|
|
40655
|
+
} else {
|
|
40656
|
+
this._listeners = [listener];
|
|
40657
|
+
}
|
|
40658
|
+
};
|
|
40659
|
+
|
|
40660
|
+
/**
|
|
40661
|
+
* Unsubscribe from the cancel signal
|
|
40662
|
+
*/
|
|
40663
|
+
|
|
40664
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
40665
|
+
if (!this._listeners) {
|
|
40666
|
+
return;
|
|
40667
|
+
}
|
|
40668
|
+
var index = this._listeners.indexOf(listener);
|
|
40669
|
+
if (index !== -1) {
|
|
40670
|
+
this._listeners.splice(index, 1);
|
|
40671
|
+
}
|
|
40672
|
+
};
|
|
40673
|
+
|
|
40578
40674
|
/**
|
|
40579
40675
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
40580
40676
|
* cancels the `CancelToken`.
|
|
@@ -40648,14 +40744,14 @@ function Axios(instanceConfig) {
|
|
|
40648
40744
|
*
|
|
40649
40745
|
* @param {Object} config The config specific for this request (merged with this.defaults)
|
|
40650
40746
|
*/
|
|
40651
|
-
Axios.prototype.request = function request(config) {
|
|
40747
|
+
Axios.prototype.request = function request(configOrUrl, config) {
|
|
40652
40748
|
/*eslint no-param-reassign:0*/
|
|
40653
40749
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
40654
|
-
if (typeof
|
|
40655
|
-
config = arguments[1] || {};
|
|
40656
|
-
config.url = arguments[0];
|
|
40657
|
-
} else {
|
|
40750
|
+
if (typeof configOrUrl === 'string') {
|
|
40658
40751
|
config = config || {};
|
|
40752
|
+
config.url = configOrUrl;
|
|
40753
|
+
} else {
|
|
40754
|
+
config = configOrUrl || {};
|
|
40659
40755
|
}
|
|
40660
40756
|
|
|
40661
40757
|
config = mergeConfig(this.defaults, config);
|
|
@@ -40673,9 +40769,9 @@ Axios.prototype.request = function request(config) {
|
|
|
40673
40769
|
|
|
40674
40770
|
if (transitional !== undefined) {
|
|
40675
40771
|
validator.assertOptions(transitional, {
|
|
40676
|
-
silentJSONParsing: validators.transitional(validators.boolean
|
|
40677
|
-
forcedJSONParsing: validators.transitional(validators.boolean
|
|
40678
|
-
clarifyTimeoutError: validators.transitional(validators.boolean
|
|
40772
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
40773
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
40774
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
40679
40775
|
}, false);
|
|
40680
40776
|
}
|
|
40681
40777
|
|
|
@@ -40914,6 +41010,7 @@ var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/
|
|
|
40914
41010
|
var transformData = __webpack_require__(/*! ./transformData */ "../../node_modules/axios/lib/core/transformData.js");
|
|
40915
41011
|
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "../../node_modules/axios/lib/cancel/isCancel.js");
|
|
40916
41012
|
var defaults = __webpack_require__(/*! ../defaults */ "../../node_modules/axios/lib/defaults.js");
|
|
41013
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
40917
41014
|
|
|
40918
41015
|
/**
|
|
40919
41016
|
* Throws a `Cancel` if cancellation has been requested.
|
|
@@ -40922,6 +41019,10 @@ function throwIfCancellationRequested(config) {
|
|
|
40922
41019
|
if (config.cancelToken) {
|
|
40923
41020
|
config.cancelToken.throwIfRequested();
|
|
40924
41021
|
}
|
|
41022
|
+
|
|
41023
|
+
if (config.signal && config.signal.aborted) {
|
|
41024
|
+
throw new Cancel('canceled');
|
|
41025
|
+
}
|
|
40925
41026
|
}
|
|
40926
41027
|
|
|
40927
41028
|
/**
|
|
@@ -41039,7 +41140,8 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
41039
41140
|
stack: this.stack,
|
|
41040
41141
|
// Axios
|
|
41041
41142
|
config: this.config,
|
|
41042
|
-
code: this.code
|
|
41143
|
+
code: this.code,
|
|
41144
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
41043
41145
|
};
|
|
41044
41146
|
};
|
|
41045
41147
|
return error;
|
|
@@ -41073,17 +41175,6 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
41073
41175
|
config2 = config2 || {};
|
|
41074
41176
|
var config = {};
|
|
41075
41177
|
|
|
41076
|
-
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
|
41077
|
-
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
|
41078
|
-
var defaultToConfig2Keys = [
|
|
41079
|
-
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
|
41080
|
-
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
|
41081
|
-
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
|
41082
|
-
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
|
41083
|
-
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
|
41084
|
-
];
|
|
41085
|
-
var directMergeKeys = ['validateStatus'];
|
|
41086
|
-
|
|
41087
41178
|
function getMergedValue(target, source) {
|
|
41088
41179
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
41089
41180
|
return utils.merge(target, source);
|
|
@@ -41095,51 +41186,74 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
41095
41186
|
return source;
|
|
41096
41187
|
}
|
|
41097
41188
|
|
|
41189
|
+
// eslint-disable-next-line consistent-return
|
|
41098
41190
|
function mergeDeepProperties(prop) {
|
|
41099
41191
|
if (!utils.isUndefined(config2[prop])) {
|
|
41100
|
-
|
|
41192
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
41101
41193
|
} else if (!utils.isUndefined(config1[prop])) {
|
|
41102
|
-
|
|
41194
|
+
return getMergedValue(undefined, config1[prop]);
|
|
41103
41195
|
}
|
|
41104
41196
|
}
|
|
41105
41197
|
|
|
41106
|
-
|
|
41198
|
+
// eslint-disable-next-line consistent-return
|
|
41199
|
+
function valueFromConfig2(prop) {
|
|
41107
41200
|
if (!utils.isUndefined(config2[prop])) {
|
|
41108
|
-
|
|
41201
|
+
return getMergedValue(undefined, config2[prop]);
|
|
41109
41202
|
}
|
|
41110
|
-
}
|
|
41111
|
-
|
|
41112
|
-
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
41203
|
+
}
|
|
41113
41204
|
|
|
41114
|
-
|
|
41205
|
+
// eslint-disable-next-line consistent-return
|
|
41206
|
+
function defaultToConfig2(prop) {
|
|
41115
41207
|
if (!utils.isUndefined(config2[prop])) {
|
|
41116
|
-
|
|
41208
|
+
return getMergedValue(undefined, config2[prop]);
|
|
41117
41209
|
} else if (!utils.isUndefined(config1[prop])) {
|
|
41118
|
-
|
|
41210
|
+
return getMergedValue(undefined, config1[prop]);
|
|
41119
41211
|
}
|
|
41120
|
-
}
|
|
41212
|
+
}
|
|
41121
41213
|
|
|
41122
|
-
|
|
41214
|
+
// eslint-disable-next-line consistent-return
|
|
41215
|
+
function mergeDirectKeys(prop) {
|
|
41123
41216
|
if (prop in config2) {
|
|
41124
|
-
|
|
41217
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
41125
41218
|
} else if (prop in config1) {
|
|
41126
|
-
|
|
41127
|
-
}
|
|
41128
|
-
}
|
|
41129
|
-
|
|
41130
|
-
var
|
|
41131
|
-
|
|
41132
|
-
|
|
41133
|
-
|
|
41134
|
-
|
|
41135
|
-
|
|
41136
|
-
|
|
41137
|
-
|
|
41138
|
-
|
|
41139
|
-
|
|
41140
|
-
|
|
41219
|
+
return getMergedValue(undefined, config1[prop]);
|
|
41220
|
+
}
|
|
41221
|
+
}
|
|
41222
|
+
|
|
41223
|
+
var mergeMap = {
|
|
41224
|
+
'url': valueFromConfig2,
|
|
41225
|
+
'method': valueFromConfig2,
|
|
41226
|
+
'data': valueFromConfig2,
|
|
41227
|
+
'baseURL': defaultToConfig2,
|
|
41228
|
+
'transformRequest': defaultToConfig2,
|
|
41229
|
+
'transformResponse': defaultToConfig2,
|
|
41230
|
+
'paramsSerializer': defaultToConfig2,
|
|
41231
|
+
'timeout': defaultToConfig2,
|
|
41232
|
+
'timeoutMessage': defaultToConfig2,
|
|
41233
|
+
'withCredentials': defaultToConfig2,
|
|
41234
|
+
'adapter': defaultToConfig2,
|
|
41235
|
+
'responseType': defaultToConfig2,
|
|
41236
|
+
'xsrfCookieName': defaultToConfig2,
|
|
41237
|
+
'xsrfHeaderName': defaultToConfig2,
|
|
41238
|
+
'onUploadProgress': defaultToConfig2,
|
|
41239
|
+
'onDownloadProgress': defaultToConfig2,
|
|
41240
|
+
'decompress': defaultToConfig2,
|
|
41241
|
+
'maxContentLength': defaultToConfig2,
|
|
41242
|
+
'maxBodyLength': defaultToConfig2,
|
|
41243
|
+
'transport': defaultToConfig2,
|
|
41244
|
+
'httpAgent': defaultToConfig2,
|
|
41245
|
+
'httpsAgent': defaultToConfig2,
|
|
41246
|
+
'cancelToken': defaultToConfig2,
|
|
41247
|
+
'socketPath': defaultToConfig2,
|
|
41248
|
+
'responseEncoding': defaultToConfig2,
|
|
41249
|
+
'validateStatus': mergeDirectKeys
|
|
41250
|
+
};
|
|
41141
41251
|
|
|
41142
|
-
utils.forEach(
|
|
41252
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
41253
|
+
var merge = mergeMap[prop] || mergeDeepProperties;
|
|
41254
|
+
var configValue = merge(prop);
|
|
41255
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
41256
|
+
});
|
|
41143
41257
|
|
|
41144
41258
|
return config;
|
|
41145
41259
|
};
|
|
@@ -41307,7 +41421,7 @@ var defaults = {
|
|
|
41307
41421
|
}],
|
|
41308
41422
|
|
|
41309
41423
|
transformResponse: [function transformResponse(data) {
|
|
41310
|
-
var transitional = this.transitional;
|
|
41424
|
+
var transitional = this.transitional || defaults.transitional;
|
|
41311
41425
|
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
41312
41426
|
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
41313
41427
|
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
@@ -41342,12 +41456,12 @@ var defaults = {
|
|
|
41342
41456
|
|
|
41343
41457
|
validateStatus: function validateStatus(status) {
|
|
41344
41458
|
return status >= 200 && status < 300;
|
|
41345
|
-
}
|
|
41346
|
-
};
|
|
41459
|
+
},
|
|
41347
41460
|
|
|
41348
|
-
|
|
41349
|
-
|
|
41350
|
-
|
|
41461
|
+
headers: {
|
|
41462
|
+
common: {
|
|
41463
|
+
'Accept': 'application/json, text/plain, */*'
|
|
41464
|
+
}
|
|
41351
41465
|
}
|
|
41352
41466
|
};
|
|
41353
41467
|
|
|
@@ -41365,6 +41479,19 @@ module.exports = defaults;
|
|
|
41365
41479
|
|
|
41366
41480
|
/***/ }),
|
|
41367
41481
|
|
|
41482
|
+
/***/ "../../node_modules/axios/lib/env/data.js":
|
|
41483
|
+
/*!***********************************************************!*\
|
|
41484
|
+
!*** /root/amplify-js/node_modules/axios/lib/env/data.js ***!
|
|
41485
|
+
\***********************************************************/
|
|
41486
|
+
/*! no static exports found */
|
|
41487
|
+
/***/ (function(module, exports) {
|
|
41488
|
+
|
|
41489
|
+
module.exports = {
|
|
41490
|
+
"version": "0.26.0"
|
|
41491
|
+
};
|
|
41492
|
+
|
|
41493
|
+
/***/ }),
|
|
41494
|
+
|
|
41368
41495
|
/***/ "../../node_modules/axios/lib/helpers/bind.js":
|
|
41369
41496
|
/*!***************************************************************!*\
|
|
41370
41497
|
!*** /root/amplify-js/node_modules/axios/lib/helpers/bind.js ***!
|
|
@@ -41581,7 +41708,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
41581
41708
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
41582
41709
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
41583
41710
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
41584
|
-
return /^([a-z][a-z\d
|
|
41711
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
41585
41712
|
};
|
|
41586
41713
|
|
|
41587
41714
|
|
|
@@ -41597,6 +41724,8 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
41597
41724
|
"use strict";
|
|
41598
41725
|
|
|
41599
41726
|
|
|
41727
|
+
var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/utils.js");
|
|
41728
|
+
|
|
41600
41729
|
/**
|
|
41601
41730
|
* Determines whether the payload is an error thrown by Axios
|
|
41602
41731
|
*
|
|
@@ -41604,7 +41733,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
41604
41733
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
41605
41734
|
*/
|
|
41606
41735
|
module.exports = function isAxiosError(payload) {
|
|
41607
|
-
return (
|
|
41736
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
41608
41737
|
};
|
|
41609
41738
|
|
|
41610
41739
|
|
|
@@ -41828,7 +41957,7 @@ module.exports = function spread(callback) {
|
|
|
41828
41957
|
"use strict";
|
|
41829
41958
|
|
|
41830
41959
|
|
|
41831
|
-
var
|
|
41960
|
+
var VERSION = __webpack_require__(/*! ../env/data */ "../../node_modules/axios/lib/env/data.js").version;
|
|
41832
41961
|
|
|
41833
41962
|
var validators = {};
|
|
41834
41963
|
|
|
@@ -41840,48 +41969,26 @@ var validators = {};
|
|
|
41840
41969
|
});
|
|
41841
41970
|
|
|
41842
41971
|
var deprecatedWarnings = {};
|
|
41843
|
-
var currentVerArr = pkg.version.split('.');
|
|
41844
|
-
|
|
41845
|
-
/**
|
|
41846
|
-
* Compare package versions
|
|
41847
|
-
* @param {string} version
|
|
41848
|
-
* @param {string?} thanVersion
|
|
41849
|
-
* @returns {boolean}
|
|
41850
|
-
*/
|
|
41851
|
-
function isOlderVersion(version, thanVersion) {
|
|
41852
|
-
var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;
|
|
41853
|
-
var destVer = version.split('.');
|
|
41854
|
-
for (var i = 0; i < 3; i++) {
|
|
41855
|
-
if (pkgVersionArr[i] > destVer[i]) {
|
|
41856
|
-
return true;
|
|
41857
|
-
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
41858
|
-
return false;
|
|
41859
|
-
}
|
|
41860
|
-
}
|
|
41861
|
-
return false;
|
|
41862
|
-
}
|
|
41863
41972
|
|
|
41864
41973
|
/**
|
|
41865
41974
|
* Transitional option validator
|
|
41866
|
-
* @param {function|boolean?} validator
|
|
41867
|
-
* @param {string?} version
|
|
41868
|
-
* @param {string} message
|
|
41975
|
+
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
|
41976
|
+
* @param {string?} version - deprecated version / removed since version
|
|
41977
|
+
* @param {string?} message - some message with additional info
|
|
41869
41978
|
* @returns {function}
|
|
41870
41979
|
*/
|
|
41871
41980
|
validators.transitional = function transitional(validator, version, message) {
|
|
41872
|
-
var isDeprecated = version && isOlderVersion(version);
|
|
41873
|
-
|
|
41874
41981
|
function formatMessage(opt, desc) {
|
|
41875
|
-
return '[Axios v' +
|
|
41982
|
+
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
41876
41983
|
}
|
|
41877
41984
|
|
|
41878
41985
|
// eslint-disable-next-line func-names
|
|
41879
41986
|
return function(value, opt, opts) {
|
|
41880
41987
|
if (validator === false) {
|
|
41881
|
-
throw new Error(formatMessage(opt, ' has been removed in ' + version));
|
|
41988
|
+
throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
|
|
41882
41989
|
}
|
|
41883
41990
|
|
|
41884
|
-
if (
|
|
41991
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
41885
41992
|
deprecatedWarnings[opt] = true;
|
|
41886
41993
|
// eslint-disable-next-line no-console
|
|
41887
41994
|
console.warn(
|
|
@@ -41927,7 +42034,6 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
41927
42034
|
}
|
|
41928
42035
|
|
|
41929
42036
|
module.exports = {
|
|
41930
|
-
isOlderVersion: isOlderVersion,
|
|
41931
42037
|
assertOptions: assertOptions,
|
|
41932
42038
|
validators: validators
|
|
41933
42039
|
};
|
|
@@ -41958,7 +42064,7 @@ var toString = Object.prototype.toString;
|
|
|
41958
42064
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
41959
42065
|
*/
|
|
41960
42066
|
function isArray(val) {
|
|
41961
|
-
return
|
|
42067
|
+
return Array.isArray(val);
|
|
41962
42068
|
}
|
|
41963
42069
|
|
|
41964
42070
|
/**
|
|
@@ -41999,7 +42105,7 @@ function isArrayBuffer(val) {
|
|
|
41999
42105
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
42000
42106
|
*/
|
|
42001
42107
|
function isFormData(val) {
|
|
42002
|
-
return (
|
|
42108
|
+
return toString.call(val) === '[object FormData]';
|
|
42003
42109
|
}
|
|
42004
42110
|
|
|
42005
42111
|
/**
|
|
@@ -42013,7 +42119,7 @@ function isArrayBufferView(val) {
|
|
|
42013
42119
|
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
42014
42120
|
result = ArrayBuffer.isView(val);
|
|
42015
42121
|
} else {
|
|
42016
|
-
result = (val) && (val.buffer) && (val.buffer
|
|
42122
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
42017
42123
|
}
|
|
42018
42124
|
return result;
|
|
42019
42125
|
}
|
|
@@ -42120,7 +42226,7 @@ function isStream(val) {
|
|
|
42120
42226
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
42121
42227
|
*/
|
|
42122
42228
|
function isURLSearchParams(val) {
|
|
42123
|
-
return
|
|
42229
|
+
return toString.call(val) === '[object URLSearchParams]';
|
|
42124
42230
|
}
|
|
42125
42231
|
|
|
42126
42232
|
/**
|
|
@@ -42294,17 +42400,6 @@ module.exports = {
|
|
|
42294
42400
|
};
|
|
42295
42401
|
|
|
42296
42402
|
|
|
42297
|
-
/***/ }),
|
|
42298
|
-
|
|
42299
|
-
/***/ "../../node_modules/axios/package.json":
|
|
42300
|
-
/*!********************************************************!*\
|
|
42301
|
-
!*** /root/amplify-js/node_modules/axios/package.json ***!
|
|
42302
|
-
\********************************************************/
|
|
42303
|
-
/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */
|
|
42304
|
-
/***/ (function(module) {
|
|
42305
|
-
|
|
42306
|
-
module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}");
|
|
42307
|
-
|
|
42308
42403
|
/***/ }),
|
|
42309
42404
|
|
|
42310
42405
|
/***/ "../../node_modules/base64-js/index.js":
|
|
@@ -49523,7 +49618,7 @@ function () {
|
|
|
49523
49618
|
this.params = null;
|
|
49524
49619
|
this.opts = null;
|
|
49525
49620
|
this.completedParts = [];
|
|
49526
|
-
this.
|
|
49621
|
+
this.uploadId = null; // Progress reporting
|
|
49527
49622
|
|
|
49528
49623
|
this.bytesUploaded = 0;
|
|
49529
49624
|
this.totalBytesToUpload = 0;
|
|
@@ -49536,20 +49631,22 @@ function () {
|
|
|
49536
49631
|
|
|
49537
49632
|
AWSS3ProviderManagedUpload.prototype.upload = function () {
|
|
49538
49633
|
return __awaiter(this, void 0, void 0, function () {
|
|
49539
|
-
var _a, putObjectCommand,
|
|
49634
|
+
var _a, putObjectCommand, _b, numberOfPartsToUpload, parts, start, error_1;
|
|
49540
49635
|
|
|
49541
49636
|
var _this = this;
|
|
49542
49637
|
|
|
49543
|
-
return __generator(this, function (
|
|
49544
|
-
switch (
|
|
49638
|
+
return __generator(this, function (_c) {
|
|
49639
|
+
switch (_c.label) {
|
|
49545
49640
|
case 0:
|
|
49641
|
+
_c.trys.push([0, 10,, 12]);
|
|
49642
|
+
|
|
49546
49643
|
_a = this;
|
|
49547
49644
|
return [4
|
|
49548
49645
|
/*yield*/
|
|
49549
49646
|
, this.validateAndSanitizeBody(this.params.Body)];
|
|
49550
49647
|
|
|
49551
49648
|
case 1:
|
|
49552
|
-
_a.body =
|
|
49649
|
+
_a.body = _c.sent();
|
|
49553
49650
|
this.totalBytesToUpload = this.byteLength(this.body);
|
|
49554
49651
|
if (!(this.totalBytesToUpload <= this.minPartSize)) return [3
|
|
49555
49652
|
/*break*/
|
|
@@ -49562,107 +49659,113 @@ function () {
|
|
|
49562
49659
|
, this.s3client.send(putObjectCommand)];
|
|
49563
49660
|
|
|
49564
49661
|
case 2:
|
|
49662
|
+
// Step 1: Initiate the multi part upload
|
|
49663
|
+
_b = this;
|
|
49565
49664
|
return [4
|
|
49566
49665
|
/*yield*/
|
|
49567
49666
|
, this.createMultiPartUpload()];
|
|
49568
49667
|
|
|
49569
49668
|
case 3:
|
|
49570
|
-
|
|
49669
|
+
// Step 1: Initiate the multi part upload
|
|
49670
|
+
_b.uploadId = _c.sent();
|
|
49571
49671
|
numberOfPartsToUpload = Math.ceil(this.totalBytesToUpload / this.minPartSize);
|
|
49572
49672
|
parts = this.createParts();
|
|
49573
49673
|
start = 0;
|
|
49574
|
-
|
|
49674
|
+
_c.label = 4;
|
|
49575
49675
|
|
|
49576
49676
|
case 4:
|
|
49577
49677
|
if (!(start < numberOfPartsToUpload)) return [3
|
|
49578
49678
|
/*break*/
|
|
49579
|
-
,
|
|
49580
|
-
/** This first block will try to cancel the upload if the cancel
|
|
49581
|
-
* request came before any parts uploads have started.
|
|
49582
|
-
**/
|
|
49679
|
+
, 7]; // Upload as many as `queueSize` parts simultaneously
|
|
49583
49680
|
|
|
49584
49681
|
return [4
|
|
49585
49682
|
/*yield*/
|
|
49586
|
-
, this.
|
|
49683
|
+
, this.uploadParts(this.uploadId, parts.slice(start, start + this.queueSize))];
|
|
49587
49684
|
|
|
49588
49685
|
case 5:
|
|
49589
|
-
/** This first block will try to cancel the upload if the cancel
|
|
49590
|
-
* request came before any parts uploads have started.
|
|
49591
|
-
**/
|
|
49592
|
-
_b.sent(); // Upload as many as `queueSize` parts simultaneously
|
|
49593
|
-
|
|
49594
|
-
|
|
49595
|
-
return [4
|
|
49596
|
-
/*yield*/
|
|
49597
|
-
, this.uploadParts(uploadId, parts.slice(start, start + this.queueSize))];
|
|
49598
|
-
|
|
49599
|
-
case 6:
|
|
49600
49686
|
// Upload as many as `queueSize` parts simultaneously
|
|
49601
|
-
|
|
49602
|
-
/** Call cleanup a second time in case there were part upload requests
|
|
49603
|
-
* in flight. This is to ensure that all parts are cleaned up.
|
|
49604
|
-
*/
|
|
49605
|
-
|
|
49606
|
-
|
|
49607
|
-
return [4
|
|
49608
|
-
/*yield*/
|
|
49609
|
-
, this.checkIfUploadCancelled(uploadId)];
|
|
49610
|
-
|
|
49611
|
-
case 7:
|
|
49612
|
-
/** Call cleanup a second time in case there were part upload requests
|
|
49613
|
-
* in flight. This is to ensure that all parts are cleaned up.
|
|
49614
|
-
*/
|
|
49615
|
-
_b.sent();
|
|
49687
|
+
_c.sent();
|
|
49616
49688
|
|
|
49617
|
-
|
|
49689
|
+
_c.label = 6;
|
|
49618
49690
|
|
|
49619
|
-
case
|
|
49691
|
+
case 6:
|
|
49620
49692
|
start += this.queueSize;
|
|
49621
49693
|
return [3
|
|
49622
49694
|
/*break*/
|
|
49623
49695
|
, 4];
|
|
49624
49696
|
|
|
49625
|
-
case
|
|
49697
|
+
case 7:
|
|
49626
49698
|
parts.map(function (part) {
|
|
49627
49699
|
_this.removeEventListener(part);
|
|
49628
49700
|
});
|
|
49629
49701
|
return [4
|
|
49630
49702
|
/*yield*/
|
|
49631
|
-
, this.finishMultiPartUpload(uploadId)];
|
|
49703
|
+
, this.finishMultiPartUpload(this.uploadId)];
|
|
49632
49704
|
|
|
49633
|
-
case
|
|
49705
|
+
case 8:
|
|
49634
49706
|
// Step 3: Finalize the upload such that S3 can recreate the file
|
|
49635
49707
|
return [2
|
|
49636
49708
|
/*return*/
|
|
49637
|
-
,
|
|
49709
|
+
, _c.sent()];
|
|
49710
|
+
|
|
49711
|
+
case 9:
|
|
49712
|
+
return [3
|
|
49713
|
+
/*break*/
|
|
49714
|
+
, 12];
|
|
49715
|
+
|
|
49716
|
+
case 10:
|
|
49717
|
+
error_1 = _c.sent(); // if any error is thrown, call cleanup
|
|
49718
|
+
|
|
49719
|
+
return [4
|
|
49720
|
+
/*yield*/
|
|
49721
|
+
, this.cleanup(this.uploadId)];
|
|
49722
|
+
|
|
49723
|
+
case 11:
|
|
49724
|
+
// if any error is thrown, call cleanup
|
|
49725
|
+
_c.sent();
|
|
49726
|
+
|
|
49727
|
+
logger.error('Error. Cancelling the multipart upload.');
|
|
49728
|
+
throw error_1;
|
|
49729
|
+
|
|
49730
|
+
case 12:
|
|
49731
|
+
return [2
|
|
49732
|
+
/*return*/
|
|
49733
|
+
];
|
|
49638
49734
|
}
|
|
49639
49735
|
});
|
|
49640
49736
|
});
|
|
49641
49737
|
};
|
|
49642
49738
|
|
|
49643
49739
|
AWSS3ProviderManagedUpload.prototype.createParts = function () {
|
|
49644
|
-
|
|
49740
|
+
try {
|
|
49741
|
+
var parts = [];
|
|
49742
|
+
|
|
49743
|
+
for (var bodyStart = 0; bodyStart < this.totalBytesToUpload;) {
|
|
49744
|
+
var bodyEnd = Math.min(bodyStart + this.minPartSize, this.totalBytesToUpload);
|
|
49745
|
+
parts.push({
|
|
49746
|
+
bodyPart: this.body.slice(bodyStart, bodyEnd),
|
|
49747
|
+
partNumber: parts.length + 1,
|
|
49748
|
+
emitter: new events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"](),
|
|
49749
|
+
_lastUploadedBytes: 0
|
|
49750
|
+
});
|
|
49751
|
+
bodyStart += this.minPartSize;
|
|
49752
|
+
}
|
|
49645
49753
|
|
|
49646
|
-
|
|
49647
|
-
|
|
49648
|
-
|
|
49649
|
-
|
|
49650
|
-
partNumber: parts.length + 1,
|
|
49651
|
-
emitter: new events__WEBPACK_IMPORTED_MODULE_3__["EventEmitter"](),
|
|
49652
|
-
_lastUploadedBytes: 0
|
|
49653
|
-
});
|
|
49654
|
-
bodyStart += this.minPartSize;
|
|
49754
|
+
return parts;
|
|
49755
|
+
} catch (error) {
|
|
49756
|
+
logger.error(error);
|
|
49757
|
+
throw error;
|
|
49655
49758
|
}
|
|
49656
|
-
|
|
49657
|
-
return parts;
|
|
49658
49759
|
};
|
|
49659
49760
|
|
|
49660
49761
|
AWSS3ProviderManagedUpload.prototype.createMultiPartUpload = function () {
|
|
49661
49762
|
return __awaiter(this, void 0, void 0, function () {
|
|
49662
|
-
var createMultiPartUploadCommand, response;
|
|
49763
|
+
var createMultiPartUploadCommand, response, error_2;
|
|
49663
49764
|
return __generator(this, function (_a) {
|
|
49664
49765
|
switch (_a.label) {
|
|
49665
49766
|
case 0:
|
|
49767
|
+
_a.trys.push([0, 2,, 3]);
|
|
49768
|
+
|
|
49666
49769
|
createMultiPartUploadCommand = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["CreateMultipartUploadCommand"](this.params);
|
|
49667
49770
|
return [4
|
|
49668
49771
|
/*yield*/
|
|
@@ -49674,6 +49777,16 @@ function () {
|
|
|
49674
49777
|
return [2
|
|
49675
49778
|
/*return*/
|
|
49676
49779
|
, response.UploadId];
|
|
49780
|
+
|
|
49781
|
+
case 2:
|
|
49782
|
+
error_2 = _a.sent();
|
|
49783
|
+
logger.error(error_2);
|
|
49784
|
+
throw error_2;
|
|
49785
|
+
|
|
49786
|
+
case 3:
|
|
49787
|
+
return [2
|
|
49788
|
+
/*return*/
|
|
49789
|
+
];
|
|
49677
49790
|
}
|
|
49678
49791
|
});
|
|
49679
49792
|
});
|
|
@@ -49686,7 +49799,7 @@ function () {
|
|
|
49686
49799
|
|
|
49687
49800
|
AWSS3ProviderManagedUpload.prototype.uploadParts = function (uploadId, parts) {
|
|
49688
49801
|
return __awaiter(this, void 0, void 0, function () {
|
|
49689
|
-
var allResults, i,
|
|
49802
|
+
var allResults, i, error_3;
|
|
49690
49803
|
|
|
49691
49804
|
var _this = this;
|
|
49692
49805
|
|
|
@@ -49750,12 +49863,9 @@ function () {
|
|
|
49750
49863
|
, 3];
|
|
49751
49864
|
|
|
49752
49865
|
case 2:
|
|
49753
|
-
|
|
49754
|
-
logger.error('
|
|
49755
|
-
|
|
49756
|
-
return [2
|
|
49757
|
-
/*return*/
|
|
49758
|
-
];
|
|
49866
|
+
error_3 = _a.sent();
|
|
49867
|
+
logger.error('Error happened while uploading a part. Cancelling the multipart upload');
|
|
49868
|
+
throw error_3;
|
|
49759
49869
|
|
|
49760
49870
|
case 3:
|
|
49761
49871
|
return [2
|
|
@@ -49768,7 +49878,7 @@ function () {
|
|
|
49768
49878
|
|
|
49769
49879
|
AWSS3ProviderManagedUpload.prototype.finishMultiPartUpload = function (uploadId) {
|
|
49770
49880
|
return __awaiter(this, void 0, void 0, function () {
|
|
49771
|
-
var input, completeUploadCommand, data,
|
|
49881
|
+
var input, completeUploadCommand, data, error_4;
|
|
49772
49882
|
return __generator(this, function (_a) {
|
|
49773
49883
|
switch (_a.label) {
|
|
49774
49884
|
case 0:
|
|
@@ -49797,59 +49907,11 @@ function () {
|
|
|
49797
49907
|
, data.Key];
|
|
49798
49908
|
|
|
49799
49909
|
case 3:
|
|
49800
|
-
|
|
49801
|
-
logger.error('
|
|
49802
|
-
|
|
49803
|
-
return [2
|
|
49804
|
-
/*return*/
|
|
49805
|
-
];
|
|
49806
|
-
|
|
49807
|
-
case 4:
|
|
49808
|
-
return [2
|
|
49809
|
-
/*return*/
|
|
49810
|
-
];
|
|
49811
|
-
}
|
|
49812
|
-
});
|
|
49813
|
-
});
|
|
49814
|
-
};
|
|
49815
|
-
|
|
49816
|
-
AWSS3ProviderManagedUpload.prototype.checkIfUploadCancelled = function (uploadId) {
|
|
49817
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
49818
|
-
var errorMessage, error_3;
|
|
49819
|
-
return __generator(this, function (_a) {
|
|
49820
|
-
switch (_a.label) {
|
|
49821
|
-
case 0:
|
|
49822
|
-
if (!this.cancel) return [3
|
|
49823
|
-
/*break*/
|
|
49824
|
-
, 5];
|
|
49825
|
-
errorMessage = 'Upload was cancelled.';
|
|
49826
|
-
_a.label = 1;
|
|
49827
|
-
|
|
49828
|
-
case 1:
|
|
49829
|
-
_a.trys.push([1, 3,, 4]);
|
|
49830
|
-
|
|
49831
|
-
return [4
|
|
49832
|
-
/*yield*/
|
|
49833
|
-
, this.cleanup(uploadId)];
|
|
49834
|
-
|
|
49835
|
-
case 2:
|
|
49836
|
-
_a.sent();
|
|
49837
|
-
|
|
49838
|
-
return [3
|
|
49839
|
-
/*break*/
|
|
49840
|
-
, 4];
|
|
49841
|
-
|
|
49842
|
-
case 3:
|
|
49843
|
-
error_3 = _a.sent();
|
|
49844
|
-
errorMessage += " " + error_3.message;
|
|
49845
|
-
return [3
|
|
49846
|
-
/*break*/
|
|
49847
|
-
, 4];
|
|
49910
|
+
error_4 = _a.sent();
|
|
49911
|
+
logger.error('Error happened while finishing the upload.');
|
|
49912
|
+
throw error_4;
|
|
49848
49913
|
|
|
49849
49914
|
case 4:
|
|
49850
|
-
throw new Error(errorMessage);
|
|
49851
|
-
|
|
49852
|
-
case 5:
|
|
49853
49915
|
return [2
|
|
49854
49916
|
/*return*/
|
|
49855
49917
|
];
|
|
@@ -49858,10 +49920,6 @@ function () {
|
|
|
49858
49920
|
});
|
|
49859
49921
|
};
|
|
49860
49922
|
|
|
49861
|
-
AWSS3ProviderManagedUpload.prototype.cancelUpload = function () {
|
|
49862
|
-
this.cancel = true;
|
|
49863
|
-
};
|
|
49864
|
-
|
|
49865
49923
|
AWSS3ProviderManagedUpload.prototype.cleanup = function (uploadId) {
|
|
49866
49924
|
return __awaiter(this, void 0, void 0, function () {
|
|
49867
49925
|
var input, data;
|
|
@@ -49893,7 +49951,7 @@ function () {
|
|
|
49893
49951
|
data = _a.sent();
|
|
49894
49952
|
|
|
49895
49953
|
if (data && data.Parts && data.Parts.length > 0) {
|
|
49896
|
-
throw new Error('
|
|
49954
|
+
throw new Error('Multipart upload clean up failed.');
|
|
49897
49955
|
}
|
|
49898
49956
|
|
|
49899
49957
|
return [2
|
|
@@ -50982,7 +51040,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50982
51040
|
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
50983
51041
|
/* harmony import */ var _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/StorageErrorStrings */ "./lib-esm/common/StorageErrorStrings.js");
|
|
50984
51042
|
/*
|
|
50985
|
-
* Copyright 2017-
|
|
51043
|
+
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
50986
51044
|
*
|
|
50987
51045
|
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
50988
51046
|
* the License. A copy of the License is located at
|
|
@@ -51050,6 +51108,10 @@ function isBlob(body) {
|
|
|
51050
51108
|
return typeof Blob !== 'undefined' && body instanceof Blob;
|
|
51051
51109
|
}
|
|
51052
51110
|
|
|
51111
|
+
function hasErrorResponse(error) {
|
|
51112
|
+
return typeof error !== 'undefined' && Object.prototype.hasOwnProperty.call(error, 'response') && typeof error.response !== 'undefined' && Object.prototype.hasOwnProperty.call(error.response, 'status') && typeof error.response.status === 'number';
|
|
51113
|
+
}
|
|
51114
|
+
|
|
51053
51115
|
var normalizeHeaders = function normalizeHeaders(headers, normalizedName) {
|
|
51054
51116
|
var e_1, _a;
|
|
51055
51117
|
|
|
@@ -51154,10 +51216,12 @@ function () {
|
|
|
51154
51216
|
}
|
|
51155
51217
|
|
|
51156
51218
|
if (emitter) {
|
|
51219
|
+
// TODO: Unify linting rules across JS repo
|
|
51157
51220
|
axiosRequest.onUploadProgress = function (event) {
|
|
51158
51221
|
emitter.emit(SEND_UPLOAD_PROGRESS_EVENT, event);
|
|
51159
51222
|
logger.debug(event);
|
|
51160
|
-
};
|
|
51223
|
+
}; // TODO: Unify linting rules across JS repo
|
|
51224
|
+
|
|
51161
51225
|
|
|
51162
51226
|
axiosRequest.onDownloadProgress = function (event) {
|
|
51163
51227
|
emitter.emit(SEND_DOWNLOAD_PROGRESS_EVENT, event);
|
|
@@ -51193,16 +51257,20 @@ function () {
|
|
|
51193
51257
|
})
|
|
51194
51258
|
};
|
|
51195
51259
|
})["catch"](function (error) {
|
|
51196
|
-
var _a, _b
|
|
51260
|
+
var _a, _b; // Error
|
|
51197
51261
|
|
|
51198
51262
|
|
|
51199
51263
|
if (error.message !== _common_StorageErrorStrings__WEBPACK_IMPORTED_MODULE_4__["AWSS3ProviderUploadErrorStrings"].UPLOAD_PAUSED_MESSAGE) {
|
|
51200
51264
|
logger.error(error.message);
|
|
51201
51265
|
} // for axios' cancel error, we should re-throw it back so it's not considered an s3client error
|
|
51202
|
-
// if we return empty, or an abitrary error HttpResponse, it will be hard to debug down the line
|
|
51266
|
+
// if we return empty, or an abitrary error HttpResponse, it will be hard to debug down the line.
|
|
51267
|
+
//
|
|
51268
|
+
// for errors that does not have a 'response' object, it's very likely that it is an unexpected error for
|
|
51269
|
+
// example a disconnect. Without it we cannot meaningfully reconstruct a HttpResponse, and the AWS SDK might
|
|
51270
|
+
// consider the request successful by mistake. In this case we should also re-throw the error.
|
|
51203
51271
|
|
|
51204
51272
|
|
|
51205
|
-
if (axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error)) {
|
|
51273
|
+
if (axios__WEBPACK_IMPORTED_MODULE_2___default.a.isCancel(error) || !hasErrorResponse(error)) {
|
|
51206
51274
|
throw error;
|
|
51207
51275
|
} // otherwise, we should re-construct an HttpResponse from the error, so that it can be passed down to other
|
|
51208
51276
|
// aws sdk middleware (e.g retry, clock skew correction, error message serializing)
|
|
@@ -51210,9 +51278,9 @@ function () {
|
|
|
51210
51278
|
|
|
51211
51279
|
return {
|
|
51212
51280
|
response: new _aws_sdk_protocol_http__WEBPACK_IMPORTED_MODULE_0__["HttpResponse"]({
|
|
51213
|
-
statusCode:
|
|
51214
|
-
body: (
|
|
51215
|
-
headers: (
|
|
51281
|
+
statusCode: error.response.status,
|
|
51282
|
+
body: (_a = error.response) === null || _a === void 0 ? void 0 : _a.data,
|
|
51283
|
+
headers: (_b = error.response) === null || _b === void 0 ? void 0 : _b.headers
|
|
51216
51284
|
})
|
|
51217
51285
|
};
|
|
51218
51286
|
}), requestTimeout(requestTimeoutInMs)];
|