@aws-amplify/api-rest 2.0.29-webpack5.5 → 2.0.30-custom-pk.80
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 +150 -0
- package/dist/aws-amplify-api-rest.js +326 -220
- package/dist/aws-amplify-api-rest.js.map +1 -1
- package/dist/aws-amplify-api-rest.min.js +1 -1
- package/dist/aws-amplify-api-rest.min.js.map +1 -1
- package/lib/RestAPI.d.ts +6 -0
- package/lib/RestAPI.js +8 -0
- package/lib/RestAPI.js.map +1 -1
- package/lib/RestClient.d.ts +6 -0
- package/lib/RestClient.js +10 -1
- package/lib/RestClient.js.map +1 -1
- package/lib-esm/RestAPI.d.ts +6 -0
- package/lib-esm/RestAPI.js +8 -0
- package/lib-esm/RestAPI.js.map +1 -1
- package/lib-esm/RestClient.d.ts +6 -0
- package/lib-esm/RestClient.js +10 -1
- package/lib-esm/RestClient.js.map +1 -1
- package/package.json +4 -4
- package/src/RestAPI.ts +9 -0
- package/src/RestClient.ts +13 -5
|
@@ -97,9 +97,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/axios/index.js":
|
|
100
|
-
|
|
101
|
-
!*** /
|
|
102
|
-
|
|
100
|
+
/*!****************************************************!*\
|
|
101
|
+
!*** /root/amplify-js/node_modules/axios/index.js ***!
|
|
102
|
+
\****************************************************/
|
|
103
103
|
/*! no static exports found */
|
|
104
104
|
/***/ (function(module, exports, __webpack_require__) {
|
|
105
105
|
|
|
@@ -108,9 +108,9 @@ module.exports = __webpack_require__(/*! ./lib/axios */ "../../node_modules/axio
|
|
|
108
108
|
/***/ }),
|
|
109
109
|
|
|
110
110
|
/***/ "../../node_modules/axios/lib/adapters/xhr.js":
|
|
111
|
-
|
|
112
|
-
!*** /
|
|
113
|
-
|
|
111
|
+
/*!***************************************************************!*\
|
|
112
|
+
!*** /root/amplify-js/node_modules/axios/lib/adapters/xhr.js ***!
|
|
113
|
+
\***************************************************************/
|
|
114
114
|
/*! no static exports found */
|
|
115
115
|
/***/ (function(module, exports, __webpack_require__) {
|
|
116
116
|
|
|
@@ -125,12 +125,24 @@ var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../../node
|
|
|
125
125
|
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "../../node_modules/axios/lib/helpers/parseHeaders.js");
|
|
126
126
|
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "../../node_modules/axios/lib/helpers/isURLSameOrigin.js");
|
|
127
127
|
var createError = __webpack_require__(/*! ../core/createError */ "../../node_modules/axios/lib/core/createError.js");
|
|
128
|
+
var defaults = __webpack_require__(/*! ../defaults */ "../../node_modules/axios/lib/defaults.js");
|
|
129
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
128
130
|
|
|
129
131
|
module.exports = function xhrAdapter(config) {
|
|
130
132
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
131
133
|
var requestData = config.data;
|
|
132
134
|
var requestHeaders = config.headers;
|
|
133
135
|
var responseType = config.responseType;
|
|
136
|
+
var onCanceled;
|
|
137
|
+
function done() {
|
|
138
|
+
if (config.cancelToken) {
|
|
139
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (config.signal) {
|
|
143
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
134
146
|
|
|
135
147
|
if (utils.isFormData(requestData)) {
|
|
136
148
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
@@ -168,7 +180,13 @@ module.exports = function xhrAdapter(config) {
|
|
|
168
180
|
request: request
|
|
169
181
|
};
|
|
170
182
|
|
|
171
|
-
settle(
|
|
183
|
+
settle(function _resolve(value) {
|
|
184
|
+
resolve(value);
|
|
185
|
+
done();
|
|
186
|
+
}, function _reject(err) {
|
|
187
|
+
reject(err);
|
|
188
|
+
done();
|
|
189
|
+
}, response);
|
|
172
190
|
|
|
173
191
|
// Clean up request
|
|
174
192
|
request = null;
|
|
@@ -221,14 +239,15 @@ module.exports = function xhrAdapter(config) {
|
|
|
221
239
|
|
|
222
240
|
// Handle timeout
|
|
223
241
|
request.ontimeout = function handleTimeout() {
|
|
224
|
-
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
|
242
|
+
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
243
|
+
var transitional = config.transitional || defaults.transitional;
|
|
225
244
|
if (config.timeoutErrorMessage) {
|
|
226
245
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
227
246
|
}
|
|
228
247
|
reject(createError(
|
|
229
248
|
timeoutErrorMessage,
|
|
230
249
|
config,
|
|
231
|
-
|
|
250
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
232
251
|
request));
|
|
233
252
|
|
|
234
253
|
// Clean up request
|
|
@@ -282,18 +301,22 @@ module.exports = function xhrAdapter(config) {
|
|
|
282
301
|
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
283
302
|
}
|
|
284
303
|
|
|
285
|
-
if (config.cancelToken) {
|
|
304
|
+
if (config.cancelToken || config.signal) {
|
|
286
305
|
// Handle cancellation
|
|
287
|
-
|
|
306
|
+
// eslint-disable-next-line func-names
|
|
307
|
+
onCanceled = function(cancel) {
|
|
288
308
|
if (!request) {
|
|
289
309
|
return;
|
|
290
310
|
}
|
|
291
|
-
|
|
311
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
|
|
292
312
|
request.abort();
|
|
293
|
-
reject(cancel);
|
|
294
|
-
// Clean up request
|
|
295
313
|
request = null;
|
|
296
|
-
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
317
|
+
if (config.signal) {
|
|
318
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
319
|
+
}
|
|
297
320
|
}
|
|
298
321
|
|
|
299
322
|
if (!requestData) {
|
|
@@ -309,9 +332,9 @@ module.exports = function xhrAdapter(config) {
|
|
|
309
332
|
/***/ }),
|
|
310
333
|
|
|
311
334
|
/***/ "../../node_modules/axios/lib/axios.js":
|
|
312
|
-
|
|
313
|
-
!*** /
|
|
314
|
-
|
|
335
|
+
/*!********************************************************!*\
|
|
336
|
+
!*** /root/amplify-js/node_modules/axios/lib/axios.js ***!
|
|
337
|
+
\********************************************************/
|
|
315
338
|
/*! no static exports found */
|
|
316
339
|
/***/ (function(module, exports, __webpack_require__) {
|
|
317
340
|
|
|
@@ -340,6 +363,11 @@ function createInstance(defaultConfig) {
|
|
|
340
363
|
// Copy context to instance
|
|
341
364
|
utils.extend(instance, context);
|
|
342
365
|
|
|
366
|
+
// Factory for creating new instances
|
|
367
|
+
instance.create = function create(instanceConfig) {
|
|
368
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
369
|
+
};
|
|
370
|
+
|
|
343
371
|
return instance;
|
|
344
372
|
}
|
|
345
373
|
|
|
@@ -349,15 +377,11 @@ var axios = createInstance(defaults);
|
|
|
349
377
|
// Expose Axios class to allow class inheritance
|
|
350
378
|
axios.Axios = Axios;
|
|
351
379
|
|
|
352
|
-
// Factory for creating new instances
|
|
353
|
-
axios.create = function create(instanceConfig) {
|
|
354
|
-
return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
|
355
|
-
};
|
|
356
|
-
|
|
357
380
|
// Expose Cancel & CancelToken
|
|
358
381
|
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
359
382
|
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "../../node_modules/axios/lib/cancel/CancelToken.js");
|
|
360
383
|
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "../../node_modules/axios/lib/cancel/isCancel.js");
|
|
384
|
+
axios.VERSION = __webpack_require__(/*! ./env/data */ "../../node_modules/axios/lib/env/data.js").version;
|
|
361
385
|
|
|
362
386
|
// Expose all/spread
|
|
363
387
|
axios.all = function all(promises) {
|
|
@@ -377,9 +401,9 @@ module.exports.default = axios;
|
|
|
377
401
|
/***/ }),
|
|
378
402
|
|
|
379
403
|
/***/ "../../node_modules/axios/lib/cancel/Cancel.js":
|
|
380
|
-
|
|
381
|
-
!*** /
|
|
382
|
-
|
|
404
|
+
/*!****************************************************************!*\
|
|
405
|
+
!*** /root/amplify-js/node_modules/axios/lib/cancel/Cancel.js ***!
|
|
406
|
+
\****************************************************************/
|
|
383
407
|
/*! no static exports found */
|
|
384
408
|
/***/ (function(module, exports, __webpack_require__) {
|
|
385
409
|
|
|
@@ -408,9 +432,9 @@ module.exports = Cancel;
|
|
|
408
432
|
/***/ }),
|
|
409
433
|
|
|
410
434
|
/***/ "../../node_modules/axios/lib/cancel/CancelToken.js":
|
|
411
|
-
|
|
412
|
-
!*** /
|
|
413
|
-
|
|
435
|
+
/*!*********************************************************************!*\
|
|
436
|
+
!*** /root/amplify-js/node_modules/axios/lib/cancel/CancelToken.js ***!
|
|
437
|
+
\*********************************************************************/
|
|
414
438
|
/*! no static exports found */
|
|
415
439
|
/***/ (function(module, exports, __webpack_require__) {
|
|
416
440
|
|
|
@@ -431,11 +455,42 @@ function CancelToken(executor) {
|
|
|
431
455
|
}
|
|
432
456
|
|
|
433
457
|
var resolvePromise;
|
|
458
|
+
|
|
434
459
|
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
435
460
|
resolvePromise = resolve;
|
|
436
461
|
});
|
|
437
462
|
|
|
438
463
|
var token = this;
|
|
464
|
+
|
|
465
|
+
// eslint-disable-next-line func-names
|
|
466
|
+
this.promise.then(function(cancel) {
|
|
467
|
+
if (!token._listeners) return;
|
|
468
|
+
|
|
469
|
+
var i;
|
|
470
|
+
var l = token._listeners.length;
|
|
471
|
+
|
|
472
|
+
for (i = 0; i < l; i++) {
|
|
473
|
+
token._listeners[i](cancel);
|
|
474
|
+
}
|
|
475
|
+
token._listeners = null;
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
// eslint-disable-next-line func-names
|
|
479
|
+
this.promise.then = function(onfulfilled) {
|
|
480
|
+
var _resolve;
|
|
481
|
+
// eslint-disable-next-line func-names
|
|
482
|
+
var promise = new Promise(function(resolve) {
|
|
483
|
+
token.subscribe(resolve);
|
|
484
|
+
_resolve = resolve;
|
|
485
|
+
}).then(onfulfilled);
|
|
486
|
+
|
|
487
|
+
promise.cancel = function reject() {
|
|
488
|
+
token.unsubscribe(_resolve);
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
return promise;
|
|
492
|
+
};
|
|
493
|
+
|
|
439
494
|
executor(function cancel(message) {
|
|
440
495
|
if (token.reason) {
|
|
441
496
|
// Cancellation has already been requested
|
|
@@ -456,6 +511,37 @@ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
|
456
511
|
}
|
|
457
512
|
};
|
|
458
513
|
|
|
514
|
+
/**
|
|
515
|
+
* Subscribe to the cancel signal
|
|
516
|
+
*/
|
|
517
|
+
|
|
518
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
519
|
+
if (this.reason) {
|
|
520
|
+
listener(this.reason);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (this._listeners) {
|
|
525
|
+
this._listeners.push(listener);
|
|
526
|
+
} else {
|
|
527
|
+
this._listeners = [listener];
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Unsubscribe from the cancel signal
|
|
533
|
+
*/
|
|
534
|
+
|
|
535
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
536
|
+
if (!this._listeners) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
var index = this._listeners.indexOf(listener);
|
|
540
|
+
if (index !== -1) {
|
|
541
|
+
this._listeners.splice(index, 1);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
|
|
459
545
|
/**
|
|
460
546
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
461
547
|
* cancels the `CancelToken`.
|
|
@@ -477,9 +563,9 @@ module.exports = CancelToken;
|
|
|
477
563
|
/***/ }),
|
|
478
564
|
|
|
479
565
|
/***/ "../../node_modules/axios/lib/cancel/isCancel.js":
|
|
480
|
-
|
|
481
|
-
!*** /
|
|
482
|
-
|
|
566
|
+
/*!******************************************************************!*\
|
|
567
|
+
!*** /root/amplify-js/node_modules/axios/lib/cancel/isCancel.js ***!
|
|
568
|
+
\******************************************************************/
|
|
483
569
|
/*! no static exports found */
|
|
484
570
|
/***/ (function(module, exports, __webpack_require__) {
|
|
485
571
|
|
|
@@ -494,9 +580,9 @@ module.exports = function isCancel(value) {
|
|
|
494
580
|
/***/ }),
|
|
495
581
|
|
|
496
582
|
/***/ "../../node_modules/axios/lib/core/Axios.js":
|
|
497
|
-
|
|
498
|
-
!*** /
|
|
499
|
-
|
|
583
|
+
/*!*************************************************************!*\
|
|
584
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/Axios.js ***!
|
|
585
|
+
\*************************************************************/
|
|
500
586
|
/*! no static exports found */
|
|
501
587
|
/***/ (function(module, exports, __webpack_require__) {
|
|
502
588
|
|
|
@@ -529,14 +615,14 @@ function Axios(instanceConfig) {
|
|
|
529
615
|
*
|
|
530
616
|
* @param {Object} config The config specific for this request (merged with this.defaults)
|
|
531
617
|
*/
|
|
532
|
-
Axios.prototype.request = function request(config) {
|
|
618
|
+
Axios.prototype.request = function request(configOrUrl, config) {
|
|
533
619
|
/*eslint no-param-reassign:0*/
|
|
534
620
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
535
|
-
if (typeof
|
|
536
|
-
config = arguments[1] || {};
|
|
537
|
-
config.url = arguments[0];
|
|
538
|
-
} else {
|
|
621
|
+
if (typeof configOrUrl === 'string') {
|
|
539
622
|
config = config || {};
|
|
623
|
+
config.url = configOrUrl;
|
|
624
|
+
} else {
|
|
625
|
+
config = configOrUrl || {};
|
|
540
626
|
}
|
|
541
627
|
|
|
542
628
|
config = mergeConfig(this.defaults, config);
|
|
@@ -554,9 +640,9 @@ Axios.prototype.request = function request(config) {
|
|
|
554
640
|
|
|
555
641
|
if (transitional !== undefined) {
|
|
556
642
|
validator.assertOptions(transitional, {
|
|
557
|
-
silentJSONParsing: validators.transitional(validators.boolean
|
|
558
|
-
forcedJSONParsing: validators.transitional(validators.boolean
|
|
559
|
-
clarifyTimeoutError: validators.transitional(validators.boolean
|
|
643
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
644
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
645
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
560
646
|
}, false);
|
|
561
647
|
}
|
|
562
648
|
|
|
@@ -654,9 +740,9 @@ module.exports = Axios;
|
|
|
654
740
|
/***/ }),
|
|
655
741
|
|
|
656
742
|
/***/ "../../node_modules/axios/lib/core/InterceptorManager.js":
|
|
657
|
-
|
|
658
|
-
!*** /
|
|
659
|
-
|
|
743
|
+
/*!**************************************************************************!*\
|
|
744
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/InterceptorManager.js ***!
|
|
745
|
+
\**************************************************************************/
|
|
660
746
|
/*! no static exports found */
|
|
661
747
|
/***/ (function(module, exports, __webpack_require__) {
|
|
662
748
|
|
|
@@ -720,9 +806,9 @@ module.exports = InterceptorManager;
|
|
|
720
806
|
/***/ }),
|
|
721
807
|
|
|
722
808
|
/***/ "../../node_modules/axios/lib/core/buildFullPath.js":
|
|
723
|
-
|
|
724
|
-
!*** /
|
|
725
|
-
|
|
809
|
+
/*!*********************************************************************!*\
|
|
810
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/buildFullPath.js ***!
|
|
811
|
+
\*********************************************************************/
|
|
726
812
|
/*! no static exports found */
|
|
727
813
|
/***/ (function(module, exports, __webpack_require__) {
|
|
728
814
|
|
|
@@ -752,9 +838,9 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
|
|
|
752
838
|
/***/ }),
|
|
753
839
|
|
|
754
840
|
/***/ "../../node_modules/axios/lib/core/createError.js":
|
|
755
|
-
|
|
756
|
-
!*** /
|
|
757
|
-
|
|
841
|
+
/*!*******************************************************************!*\
|
|
842
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/createError.js ***!
|
|
843
|
+
\*******************************************************************/
|
|
758
844
|
/*! no static exports found */
|
|
759
845
|
/***/ (function(module, exports, __webpack_require__) {
|
|
760
846
|
|
|
@@ -782,9 +868,9 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
782
868
|
/***/ }),
|
|
783
869
|
|
|
784
870
|
/***/ "../../node_modules/axios/lib/core/dispatchRequest.js":
|
|
785
|
-
|
|
786
|
-
!*** /
|
|
787
|
-
|
|
871
|
+
/*!***********************************************************************!*\
|
|
872
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/dispatchRequest.js ***!
|
|
873
|
+
\***********************************************************************/
|
|
788
874
|
/*! no static exports found */
|
|
789
875
|
/***/ (function(module, exports, __webpack_require__) {
|
|
790
876
|
|
|
@@ -795,6 +881,7 @@ var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/
|
|
|
795
881
|
var transformData = __webpack_require__(/*! ./transformData */ "../../node_modules/axios/lib/core/transformData.js");
|
|
796
882
|
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "../../node_modules/axios/lib/cancel/isCancel.js");
|
|
797
883
|
var defaults = __webpack_require__(/*! ../defaults */ "../../node_modules/axios/lib/defaults.js");
|
|
884
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "../../node_modules/axios/lib/cancel/Cancel.js");
|
|
798
885
|
|
|
799
886
|
/**
|
|
800
887
|
* Throws a `Cancel` if cancellation has been requested.
|
|
@@ -803,6 +890,10 @@ function throwIfCancellationRequested(config) {
|
|
|
803
890
|
if (config.cancelToken) {
|
|
804
891
|
config.cancelToken.throwIfRequested();
|
|
805
892
|
}
|
|
893
|
+
|
|
894
|
+
if (config.signal && config.signal.aborted) {
|
|
895
|
+
throw new Cancel('canceled');
|
|
896
|
+
}
|
|
806
897
|
}
|
|
807
898
|
|
|
808
899
|
/**
|
|
@@ -876,9 +967,9 @@ module.exports = function dispatchRequest(config) {
|
|
|
876
967
|
/***/ }),
|
|
877
968
|
|
|
878
969
|
/***/ "../../node_modules/axios/lib/core/enhanceError.js":
|
|
879
|
-
|
|
880
|
-
!*** /
|
|
881
|
-
|
|
970
|
+
/*!********************************************************************!*\
|
|
971
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/enhanceError.js ***!
|
|
972
|
+
\********************************************************************/
|
|
882
973
|
/*! no static exports found */
|
|
883
974
|
/***/ (function(module, exports, __webpack_require__) {
|
|
884
975
|
|
|
@@ -920,7 +1011,8 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
920
1011
|
stack: this.stack,
|
|
921
1012
|
// Axios
|
|
922
1013
|
config: this.config,
|
|
923
|
-
code: this.code
|
|
1014
|
+
code: this.code,
|
|
1015
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
924
1016
|
};
|
|
925
1017
|
};
|
|
926
1018
|
return error;
|
|
@@ -930,9 +1022,9 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
930
1022
|
/***/ }),
|
|
931
1023
|
|
|
932
1024
|
/***/ "../../node_modules/axios/lib/core/mergeConfig.js":
|
|
933
|
-
|
|
934
|
-
!*** /
|
|
935
|
-
|
|
1025
|
+
/*!*******************************************************************!*\
|
|
1026
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/mergeConfig.js ***!
|
|
1027
|
+
\*******************************************************************/
|
|
936
1028
|
/*! no static exports found */
|
|
937
1029
|
/***/ (function(module, exports, __webpack_require__) {
|
|
938
1030
|
|
|
@@ -954,17 +1046,6 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
954
1046
|
config2 = config2 || {};
|
|
955
1047
|
var config = {};
|
|
956
1048
|
|
|
957
|
-
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
|
958
|
-
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
|
959
|
-
var defaultToConfig2Keys = [
|
|
960
|
-
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
|
961
|
-
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
|
962
|
-
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
|
963
|
-
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
|
964
|
-
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
|
965
|
-
];
|
|
966
|
-
var directMergeKeys = ['validateStatus'];
|
|
967
|
-
|
|
968
1049
|
function getMergedValue(target, source) {
|
|
969
1050
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
970
1051
|
return utils.merge(target, source);
|
|
@@ -976,51 +1057,74 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
976
1057
|
return source;
|
|
977
1058
|
}
|
|
978
1059
|
|
|
1060
|
+
// eslint-disable-next-line consistent-return
|
|
979
1061
|
function mergeDeepProperties(prop) {
|
|
980
1062
|
if (!utils.isUndefined(config2[prop])) {
|
|
981
|
-
|
|
1063
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
982
1064
|
} else if (!utils.isUndefined(config1[prop])) {
|
|
983
|
-
|
|
1065
|
+
return getMergedValue(undefined, config1[prop]);
|
|
984
1066
|
}
|
|
985
1067
|
}
|
|
986
1068
|
|
|
987
|
-
|
|
1069
|
+
// eslint-disable-next-line consistent-return
|
|
1070
|
+
function valueFromConfig2(prop) {
|
|
988
1071
|
if (!utils.isUndefined(config2[prop])) {
|
|
989
|
-
|
|
1072
|
+
return getMergedValue(undefined, config2[prop]);
|
|
990
1073
|
}
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
1074
|
+
}
|
|
994
1075
|
|
|
995
|
-
|
|
1076
|
+
// eslint-disable-next-line consistent-return
|
|
1077
|
+
function defaultToConfig2(prop) {
|
|
996
1078
|
if (!utils.isUndefined(config2[prop])) {
|
|
997
|
-
|
|
1079
|
+
return getMergedValue(undefined, config2[prop]);
|
|
998
1080
|
} else if (!utils.isUndefined(config1[prop])) {
|
|
999
|
-
|
|
1081
|
+
return getMergedValue(undefined, config1[prop]);
|
|
1000
1082
|
}
|
|
1001
|
-
}
|
|
1083
|
+
}
|
|
1002
1084
|
|
|
1003
|
-
|
|
1085
|
+
// eslint-disable-next-line consistent-return
|
|
1086
|
+
function mergeDirectKeys(prop) {
|
|
1004
1087
|
if (prop in config2) {
|
|
1005
|
-
|
|
1088
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
1006
1089
|
} else if (prop in config1) {
|
|
1007
|
-
|
|
1090
|
+
return getMergedValue(undefined, config1[prop]);
|
|
1008
1091
|
}
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
var axiosKeys = valueFromConfig2Keys
|
|
1012
|
-
.concat(mergeDeepPropertiesKeys)
|
|
1013
|
-
.concat(defaultToConfig2Keys)
|
|
1014
|
-
.concat(directMergeKeys);
|
|
1092
|
+
}
|
|
1015
1093
|
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1094
|
+
var mergeMap = {
|
|
1095
|
+
'url': valueFromConfig2,
|
|
1096
|
+
'method': valueFromConfig2,
|
|
1097
|
+
'data': valueFromConfig2,
|
|
1098
|
+
'baseURL': defaultToConfig2,
|
|
1099
|
+
'transformRequest': defaultToConfig2,
|
|
1100
|
+
'transformResponse': defaultToConfig2,
|
|
1101
|
+
'paramsSerializer': defaultToConfig2,
|
|
1102
|
+
'timeout': defaultToConfig2,
|
|
1103
|
+
'timeoutMessage': defaultToConfig2,
|
|
1104
|
+
'withCredentials': defaultToConfig2,
|
|
1105
|
+
'adapter': defaultToConfig2,
|
|
1106
|
+
'responseType': defaultToConfig2,
|
|
1107
|
+
'xsrfCookieName': defaultToConfig2,
|
|
1108
|
+
'xsrfHeaderName': defaultToConfig2,
|
|
1109
|
+
'onUploadProgress': defaultToConfig2,
|
|
1110
|
+
'onDownloadProgress': defaultToConfig2,
|
|
1111
|
+
'decompress': defaultToConfig2,
|
|
1112
|
+
'maxContentLength': defaultToConfig2,
|
|
1113
|
+
'maxBodyLength': defaultToConfig2,
|
|
1114
|
+
'transport': defaultToConfig2,
|
|
1115
|
+
'httpAgent': defaultToConfig2,
|
|
1116
|
+
'httpsAgent': defaultToConfig2,
|
|
1117
|
+
'cancelToken': defaultToConfig2,
|
|
1118
|
+
'socketPath': defaultToConfig2,
|
|
1119
|
+
'responseEncoding': defaultToConfig2,
|
|
1120
|
+
'validateStatus': mergeDirectKeys
|
|
1121
|
+
};
|
|
1022
1122
|
|
|
1023
|
-
utils.forEach(
|
|
1123
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
1124
|
+
var merge = mergeMap[prop] || mergeDeepProperties;
|
|
1125
|
+
var configValue = merge(prop);
|
|
1126
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
1127
|
+
});
|
|
1024
1128
|
|
|
1025
1129
|
return config;
|
|
1026
1130
|
};
|
|
@@ -1029,9 +1133,9 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
1029
1133
|
/***/ }),
|
|
1030
1134
|
|
|
1031
1135
|
/***/ "../../node_modules/axios/lib/core/settle.js":
|
|
1032
|
-
|
|
1033
|
-
!*** /
|
|
1034
|
-
|
|
1136
|
+
/*!**************************************************************!*\
|
|
1137
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/settle.js ***!
|
|
1138
|
+
\**************************************************************/
|
|
1035
1139
|
/*! no static exports found */
|
|
1036
1140
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1037
1141
|
|
|
@@ -1066,9 +1170,9 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
1066
1170
|
/***/ }),
|
|
1067
1171
|
|
|
1068
1172
|
/***/ "../../node_modules/axios/lib/core/transformData.js":
|
|
1069
|
-
|
|
1070
|
-
!*** /
|
|
1071
|
-
|
|
1173
|
+
/*!*********************************************************************!*\
|
|
1174
|
+
!*** /root/amplify-js/node_modules/axios/lib/core/transformData.js ***!
|
|
1175
|
+
\*********************************************************************/
|
|
1072
1176
|
/*! no static exports found */
|
|
1073
1177
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1074
1178
|
|
|
@@ -1100,9 +1204,9 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
1100
1204
|
/***/ }),
|
|
1101
1205
|
|
|
1102
1206
|
/***/ "../../node_modules/axios/lib/defaults.js":
|
|
1103
|
-
|
|
1104
|
-
!*** /
|
|
1105
|
-
|
|
1207
|
+
/*!***********************************************************!*\
|
|
1208
|
+
!*** /root/amplify-js/node_modules/axios/lib/defaults.js ***!
|
|
1209
|
+
\***********************************************************/
|
|
1106
1210
|
/*! no static exports found */
|
|
1107
1211
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1108
1212
|
|
|
@@ -1188,7 +1292,7 @@ var defaults = {
|
|
|
1188
1292
|
}],
|
|
1189
1293
|
|
|
1190
1294
|
transformResponse: [function transformResponse(data) {
|
|
1191
|
-
var transitional = this.transitional;
|
|
1295
|
+
var transitional = this.transitional || defaults.transitional;
|
|
1192
1296
|
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1193
1297
|
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1194
1298
|
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
@@ -1223,12 +1327,12 @@ var defaults = {
|
|
|
1223
1327
|
|
|
1224
1328
|
validateStatus: function validateStatus(status) {
|
|
1225
1329
|
return status >= 200 && status < 300;
|
|
1226
|
-
}
|
|
1227
|
-
};
|
|
1330
|
+
},
|
|
1228
1331
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1332
|
+
headers: {
|
|
1333
|
+
common: {
|
|
1334
|
+
'Accept': 'application/json, text/plain, */*'
|
|
1335
|
+
}
|
|
1232
1336
|
}
|
|
1233
1337
|
};
|
|
1234
1338
|
|
|
@@ -1246,10 +1350,23 @@ module.exports = defaults;
|
|
|
1246
1350
|
|
|
1247
1351
|
/***/ }),
|
|
1248
1352
|
|
|
1353
|
+
/***/ "../../node_modules/axios/lib/env/data.js":
|
|
1354
|
+
/*!***********************************************************!*\
|
|
1355
|
+
!*** /root/amplify-js/node_modules/axios/lib/env/data.js ***!
|
|
1356
|
+
\***********************************************************/
|
|
1357
|
+
/*! no static exports found */
|
|
1358
|
+
/***/ (function(module, exports) {
|
|
1359
|
+
|
|
1360
|
+
module.exports = {
|
|
1361
|
+
"version": "0.26.0"
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
/***/ }),
|
|
1365
|
+
|
|
1249
1366
|
/***/ "../../node_modules/axios/lib/helpers/bind.js":
|
|
1250
|
-
|
|
1251
|
-
!*** /
|
|
1252
|
-
|
|
1367
|
+
/*!***************************************************************!*\
|
|
1368
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/bind.js ***!
|
|
1369
|
+
\***************************************************************/
|
|
1253
1370
|
/*! no static exports found */
|
|
1254
1371
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1255
1372
|
|
|
@@ -1270,9 +1387,9 @@ module.exports = function bind(fn, thisArg) {
|
|
|
1270
1387
|
/***/ }),
|
|
1271
1388
|
|
|
1272
1389
|
/***/ "../../node_modules/axios/lib/helpers/buildURL.js":
|
|
1273
|
-
|
|
1274
|
-
!*** /
|
|
1275
|
-
|
|
1390
|
+
/*!*******************************************************************!*\
|
|
1391
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/buildURL.js ***!
|
|
1392
|
+
\*******************************************************************/
|
|
1276
1393
|
/*! no static exports found */
|
|
1277
1394
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1278
1395
|
|
|
@@ -1352,9 +1469,9 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
|
|
1352
1469
|
/***/ }),
|
|
1353
1470
|
|
|
1354
1471
|
/***/ "../../node_modules/axios/lib/helpers/combineURLs.js":
|
|
1355
|
-
|
|
1356
|
-
!*** /
|
|
1357
|
-
|
|
1472
|
+
/*!**********************************************************************!*\
|
|
1473
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/combineURLs.js ***!
|
|
1474
|
+
\**********************************************************************/
|
|
1358
1475
|
/*! no static exports found */
|
|
1359
1476
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1360
1477
|
|
|
@@ -1378,9 +1495,9 @@ module.exports = function combineURLs(baseURL, relativeURL) {
|
|
|
1378
1495
|
/***/ }),
|
|
1379
1496
|
|
|
1380
1497
|
/***/ "../../node_modules/axios/lib/helpers/cookies.js":
|
|
1381
|
-
|
|
1382
|
-
!*** /
|
|
1383
|
-
|
|
1498
|
+
/*!******************************************************************!*\
|
|
1499
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/cookies.js ***!
|
|
1500
|
+
\******************************************************************/
|
|
1384
1501
|
/*! no static exports found */
|
|
1385
1502
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1386
1503
|
|
|
@@ -1443,9 +1560,9 @@ module.exports = (
|
|
|
1443
1560
|
/***/ }),
|
|
1444
1561
|
|
|
1445
1562
|
/***/ "../../node_modules/axios/lib/helpers/isAbsoluteURL.js":
|
|
1446
|
-
|
|
1447
|
-
!*** /
|
|
1448
|
-
|
|
1563
|
+
/*!************************************************************************!*\
|
|
1564
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
|
|
1565
|
+
\************************************************************************/
|
|
1449
1566
|
/*! no static exports found */
|
|
1450
1567
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1451
1568
|
|
|
@@ -1462,22 +1579,24 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1462
1579
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
1463
1580
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
1464
1581
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
1465
|
-
return /^([a-z][a-z\d
|
|
1582
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1466
1583
|
};
|
|
1467
1584
|
|
|
1468
1585
|
|
|
1469
1586
|
/***/ }),
|
|
1470
1587
|
|
|
1471
1588
|
/***/ "../../node_modules/axios/lib/helpers/isAxiosError.js":
|
|
1472
|
-
|
|
1473
|
-
!*** /
|
|
1474
|
-
|
|
1589
|
+
/*!***********************************************************************!*\
|
|
1590
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/isAxiosError.js ***!
|
|
1591
|
+
\***********************************************************************/
|
|
1475
1592
|
/*! no static exports found */
|
|
1476
1593
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1477
1594
|
|
|
1478
1595
|
"use strict";
|
|
1479
1596
|
|
|
1480
1597
|
|
|
1598
|
+
var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/utils.js");
|
|
1599
|
+
|
|
1481
1600
|
/**
|
|
1482
1601
|
* Determines whether the payload is an error thrown by Axios
|
|
1483
1602
|
*
|
|
@@ -1485,16 +1604,16 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1485
1604
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
1486
1605
|
*/
|
|
1487
1606
|
module.exports = function isAxiosError(payload) {
|
|
1488
|
-
return (
|
|
1607
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
1489
1608
|
};
|
|
1490
1609
|
|
|
1491
1610
|
|
|
1492
1611
|
/***/ }),
|
|
1493
1612
|
|
|
1494
1613
|
/***/ "../../node_modules/axios/lib/helpers/isURLSameOrigin.js":
|
|
1495
|
-
|
|
1496
|
-
!*** /
|
|
1497
|
-
|
|
1614
|
+
/*!**************************************************************************!*\
|
|
1615
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
|
|
1616
|
+
\**************************************************************************/
|
|
1498
1617
|
/*! no static exports found */
|
|
1499
1618
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1500
1619
|
|
|
@@ -1572,9 +1691,9 @@ module.exports = (
|
|
|
1572
1691
|
/***/ }),
|
|
1573
1692
|
|
|
1574
1693
|
/***/ "../../node_modules/axios/lib/helpers/normalizeHeaderName.js":
|
|
1575
|
-
|
|
1576
|
-
!*** /
|
|
1577
|
-
|
|
1694
|
+
/*!******************************************************************************!*\
|
|
1695
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
|
|
1696
|
+
\******************************************************************************/
|
|
1578
1697
|
/*! no static exports found */
|
|
1579
1698
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1580
1699
|
|
|
@@ -1596,9 +1715,9 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
|
1596
1715
|
/***/ }),
|
|
1597
1716
|
|
|
1598
1717
|
/***/ "../../node_modules/axios/lib/helpers/parseHeaders.js":
|
|
1599
|
-
|
|
1600
|
-
!*** /
|
|
1601
|
-
|
|
1718
|
+
/*!***********************************************************************!*\
|
|
1719
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/parseHeaders.js ***!
|
|
1720
|
+
\***********************************************************************/
|
|
1602
1721
|
/*! no static exports found */
|
|
1603
1722
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1604
1723
|
|
|
@@ -1661,9 +1780,9 @@ module.exports = function parseHeaders(headers) {
|
|
|
1661
1780
|
/***/ }),
|
|
1662
1781
|
|
|
1663
1782
|
/***/ "../../node_modules/axios/lib/helpers/spread.js":
|
|
1664
|
-
|
|
1665
|
-
!*** /
|
|
1666
|
-
|
|
1783
|
+
/*!*****************************************************************!*\
|
|
1784
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/spread.js ***!
|
|
1785
|
+
\*****************************************************************/
|
|
1667
1786
|
/*! no static exports found */
|
|
1668
1787
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1669
1788
|
|
|
@@ -1700,16 +1819,16 @@ module.exports = function spread(callback) {
|
|
|
1700
1819
|
/***/ }),
|
|
1701
1820
|
|
|
1702
1821
|
/***/ "../../node_modules/axios/lib/helpers/validator.js":
|
|
1703
|
-
|
|
1704
|
-
!*** /
|
|
1705
|
-
|
|
1822
|
+
/*!********************************************************************!*\
|
|
1823
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/validator.js ***!
|
|
1824
|
+
\********************************************************************/
|
|
1706
1825
|
/*! no static exports found */
|
|
1707
1826
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1708
1827
|
|
|
1709
1828
|
"use strict";
|
|
1710
1829
|
|
|
1711
1830
|
|
|
1712
|
-
var
|
|
1831
|
+
var VERSION = __webpack_require__(/*! ../env/data */ "../../node_modules/axios/lib/env/data.js").version;
|
|
1713
1832
|
|
|
1714
1833
|
var validators = {};
|
|
1715
1834
|
|
|
@@ -1721,48 +1840,26 @@ var validators = {};
|
|
|
1721
1840
|
});
|
|
1722
1841
|
|
|
1723
1842
|
var deprecatedWarnings = {};
|
|
1724
|
-
var currentVerArr = pkg.version.split('.');
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* Compare package versions
|
|
1728
|
-
* @param {string} version
|
|
1729
|
-
* @param {string?} thanVersion
|
|
1730
|
-
* @returns {boolean}
|
|
1731
|
-
*/
|
|
1732
|
-
function isOlderVersion(version, thanVersion) {
|
|
1733
|
-
var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;
|
|
1734
|
-
var destVer = version.split('.');
|
|
1735
|
-
for (var i = 0; i < 3; i++) {
|
|
1736
|
-
if (pkgVersionArr[i] > destVer[i]) {
|
|
1737
|
-
return true;
|
|
1738
|
-
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
1739
|
-
return false;
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
return false;
|
|
1743
|
-
}
|
|
1744
1843
|
|
|
1745
1844
|
/**
|
|
1746
1845
|
* Transitional option validator
|
|
1747
|
-
* @param {function|boolean?} validator
|
|
1748
|
-
* @param {string?} version
|
|
1749
|
-
* @param {string} message
|
|
1846
|
+
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
|
1847
|
+
* @param {string?} version - deprecated version / removed since version
|
|
1848
|
+
* @param {string?} message - some message with additional info
|
|
1750
1849
|
* @returns {function}
|
|
1751
1850
|
*/
|
|
1752
1851
|
validators.transitional = function transitional(validator, version, message) {
|
|
1753
|
-
var isDeprecated = version && isOlderVersion(version);
|
|
1754
|
-
|
|
1755
1852
|
function formatMessage(opt, desc) {
|
|
1756
|
-
return '[Axios v' +
|
|
1853
|
+
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
1757
1854
|
}
|
|
1758
1855
|
|
|
1759
1856
|
// eslint-disable-next-line func-names
|
|
1760
1857
|
return function(value, opt, opts) {
|
|
1761
1858
|
if (validator === false) {
|
|
1762
|
-
throw new Error(formatMessage(opt, ' has been removed in ' + version));
|
|
1859
|
+
throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
|
|
1763
1860
|
}
|
|
1764
1861
|
|
|
1765
|
-
if (
|
|
1862
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
1766
1863
|
deprecatedWarnings[opt] = true;
|
|
1767
1864
|
// eslint-disable-next-line no-console
|
|
1768
1865
|
console.warn(
|
|
@@ -1808,7 +1905,6 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
1808
1905
|
}
|
|
1809
1906
|
|
|
1810
1907
|
module.exports = {
|
|
1811
|
-
isOlderVersion: isOlderVersion,
|
|
1812
1908
|
assertOptions: assertOptions,
|
|
1813
1909
|
validators: validators
|
|
1814
1910
|
};
|
|
@@ -1817,9 +1913,9 @@ module.exports = {
|
|
|
1817
1913
|
/***/ }),
|
|
1818
1914
|
|
|
1819
1915
|
/***/ "../../node_modules/axios/lib/utils.js":
|
|
1820
|
-
|
|
1821
|
-
!*** /
|
|
1822
|
-
|
|
1916
|
+
/*!********************************************************!*\
|
|
1917
|
+
!*** /root/amplify-js/node_modules/axios/lib/utils.js ***!
|
|
1918
|
+
\********************************************************/
|
|
1823
1919
|
/*! no static exports found */
|
|
1824
1920
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1825
1921
|
|
|
@@ -1839,7 +1935,7 @@ var toString = Object.prototype.toString;
|
|
|
1839
1935
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
1840
1936
|
*/
|
|
1841
1937
|
function isArray(val) {
|
|
1842
|
-
return
|
|
1938
|
+
return Array.isArray(val);
|
|
1843
1939
|
}
|
|
1844
1940
|
|
|
1845
1941
|
/**
|
|
@@ -1880,7 +1976,7 @@ function isArrayBuffer(val) {
|
|
|
1880
1976
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
1881
1977
|
*/
|
|
1882
1978
|
function isFormData(val) {
|
|
1883
|
-
return (
|
|
1979
|
+
return toString.call(val) === '[object FormData]';
|
|
1884
1980
|
}
|
|
1885
1981
|
|
|
1886
1982
|
/**
|
|
@@ -1894,7 +1990,7 @@ function isArrayBufferView(val) {
|
|
|
1894
1990
|
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
1895
1991
|
result = ArrayBuffer.isView(val);
|
|
1896
1992
|
} else {
|
|
1897
|
-
result = (val) && (val.buffer) && (val.buffer
|
|
1993
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
1898
1994
|
}
|
|
1899
1995
|
return result;
|
|
1900
1996
|
}
|
|
@@ -2001,7 +2097,7 @@ function isStream(val) {
|
|
|
2001
2097
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
2002
2098
|
*/
|
|
2003
2099
|
function isURLSearchParams(val) {
|
|
2004
|
-
return
|
|
2100
|
+
return toString.call(val) === '[object URLSearchParams]';
|
|
2005
2101
|
}
|
|
2006
2102
|
|
|
2007
2103
|
/**
|
|
@@ -2175,23 +2271,12 @@ module.exports = {
|
|
|
2175
2271
|
};
|
|
2176
2272
|
|
|
2177
2273
|
|
|
2178
|
-
/***/ }),
|
|
2179
|
-
|
|
2180
|
-
/***/ "../../node_modules/axios/package.json":
|
|
2181
|
-
/*!************************************************************************************************************************!*\
|
|
2182
|
-
!*** /private/var/folders/mk/36m2f9gx7h5bblhkkx68fv1ck8cth9/T/tmp.75LdrxOn/amplify-js/node_modules/axios/package.json ***!
|
|
2183
|
-
\************************************************************************************************************************/
|
|
2184
|
-
/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */
|
|
2185
|
-
/***/ (function(module) {
|
|
2186
|
-
|
|
2187
|
-
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\"}]}");
|
|
2188
|
-
|
|
2189
2274
|
/***/ }),
|
|
2190
2275
|
|
|
2191
2276
|
/***/ "../../node_modules/process/browser.js":
|
|
2192
|
-
|
|
2193
|
-
!*** /
|
|
2194
|
-
|
|
2277
|
+
/*!********************************************************!*\
|
|
2278
|
+
!*** /root/amplify-js/node_modules/process/browser.js ***!
|
|
2279
|
+
\********************************************************/
|
|
2195
2280
|
/*! no static exports found */
|
|
2196
2281
|
/***/ (function(module, exports) {
|
|
2197
2282
|
|
|
@@ -2384,9 +2469,9 @@ process.umask = function() { return 0; };
|
|
|
2384
2469
|
/***/ }),
|
|
2385
2470
|
|
|
2386
2471
|
/***/ "../../node_modules/punycode/punycode.js":
|
|
2387
|
-
|
|
2388
|
-
!*** /
|
|
2389
|
-
|
|
2472
|
+
/*!**********************************************************!*\
|
|
2473
|
+
!*** /root/amplify-js/node_modules/punycode/punycode.js ***!
|
|
2474
|
+
\**********************************************************/
|
|
2390
2475
|
/*! no static exports found */
|
|
2391
2476
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2392
2477
|
|
|
@@ -2915,9 +3000,9 @@ process.umask = function() { return 0; };
|
|
|
2915
3000
|
/***/ }),
|
|
2916
3001
|
|
|
2917
3002
|
/***/ "../../node_modules/querystring-es3/decode.js":
|
|
2918
|
-
|
|
2919
|
-
!*** /
|
|
2920
|
-
|
|
3003
|
+
/*!***************************************************************!*\
|
|
3004
|
+
!*** /root/amplify-js/node_modules/querystring-es3/decode.js ***!
|
|
3005
|
+
\***************************************************************/
|
|
2921
3006
|
/*! no static exports found */
|
|
2922
3007
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2923
3008
|
|
|
@@ -3011,9 +3096,9 @@ var isArray = Array.isArray || function (xs) {
|
|
|
3011
3096
|
/***/ }),
|
|
3012
3097
|
|
|
3013
3098
|
/***/ "../../node_modules/querystring-es3/encode.js":
|
|
3014
|
-
|
|
3015
|
-
!*** /
|
|
3016
|
-
|
|
3099
|
+
/*!***************************************************************!*\
|
|
3100
|
+
!*** /root/amplify-js/node_modules/querystring-es3/encode.js ***!
|
|
3101
|
+
\***************************************************************/
|
|
3017
3102
|
/*! no static exports found */
|
|
3018
3103
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3019
3104
|
|
|
@@ -3108,9 +3193,9 @@ var objectKeys = Object.keys || function (obj) {
|
|
|
3108
3193
|
/***/ }),
|
|
3109
3194
|
|
|
3110
3195
|
/***/ "../../node_modules/querystring-es3/index.js":
|
|
3111
|
-
|
|
3112
|
-
!*** /
|
|
3113
|
-
|
|
3196
|
+
/*!**************************************************************!*\
|
|
3197
|
+
!*** /root/amplify-js/node_modules/querystring-es3/index.js ***!
|
|
3198
|
+
\**************************************************************/
|
|
3114
3199
|
/*! no static exports found */
|
|
3115
3200
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3116
3201
|
|
|
@@ -3124,9 +3209,9 @@ exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "../../
|
|
|
3124
3209
|
/***/ }),
|
|
3125
3210
|
|
|
3126
3211
|
/***/ "../../node_modules/url/url.js":
|
|
3127
|
-
|
|
3128
|
-
!*** /
|
|
3129
|
-
|
|
3212
|
+
/*!************************************************!*\
|
|
3213
|
+
!*** /root/amplify-js/node_modules/url/url.js ***!
|
|
3214
|
+
\************************************************/
|
|
3130
3215
|
/*! no static exports found */
|
|
3131
3216
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3132
3217
|
|
|
@@ -3868,9 +3953,9 @@ Url.prototype.parseHost = function() {
|
|
|
3868
3953
|
/***/ }),
|
|
3869
3954
|
|
|
3870
3955
|
/***/ "../../node_modules/url/util.js":
|
|
3871
|
-
|
|
3872
|
-
!*** /
|
|
3873
|
-
|
|
3956
|
+
/*!*************************************************!*\
|
|
3957
|
+
!*** /root/amplify-js/node_modules/url/util.js ***!
|
|
3958
|
+
\*************************************************/
|
|
3874
3959
|
/*! no static exports found */
|
|
3875
3960
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3876
3961
|
|
|
@@ -4426,6 +4511,16 @@ function () {
|
|
|
4426
4511
|
RestAPIClass.prototype.cancel = function (request, message) {
|
|
4427
4512
|
return this._api.cancel(request, message);
|
|
4428
4513
|
};
|
|
4514
|
+
/**
|
|
4515
|
+
* Check if the request has a corresponding cancel token in the WeakMap.
|
|
4516
|
+
* @params request - The request promise
|
|
4517
|
+
* @return if the request has a corresponding cancel token.
|
|
4518
|
+
*/
|
|
4519
|
+
|
|
4520
|
+
|
|
4521
|
+
RestAPIClass.prototype.hasCancelToken = function (request) {
|
|
4522
|
+
return this._api.hasCancelToken(request);
|
|
4523
|
+
};
|
|
4429
4524
|
/**
|
|
4430
4525
|
* Getting endpoint for API
|
|
4431
4526
|
* @param {string} apiName - The name of the api
|
|
@@ -4991,9 +5086,20 @@ function () {
|
|
|
4991
5086
|
|
|
4992
5087
|
if (source) {
|
|
4993
5088
|
source.cancel(message);
|
|
5089
|
+
return true;
|
|
4994
5090
|
}
|
|
4995
5091
|
|
|
4996
|
-
return
|
|
5092
|
+
return false;
|
|
5093
|
+
};
|
|
5094
|
+
/**
|
|
5095
|
+
* Check if the request has a corresponding cancel token in the WeakMap.
|
|
5096
|
+
* @params request - The request promise
|
|
5097
|
+
* @return if the request has a corresponding cancel token.
|
|
5098
|
+
*/
|
|
5099
|
+
|
|
5100
|
+
|
|
5101
|
+
RestClient.prototype.hasCancelToken = function (request) {
|
|
5102
|
+
return this._cancelTokenMap.has(request);
|
|
4997
5103
|
};
|
|
4998
5104
|
/**
|
|
4999
5105
|
* Checks to see if an error thrown is from an api request cancellation
|