@aws-amplify/api 4.0.7-geo.18 → 4.0.7-geo.25
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 +72 -0
- package/dist/aws-amplify-api.js +304 -61
- package/dist/aws-amplify-api.js.map +1 -1
- package/dist/aws-amplify-api.min.js +3 -3
- package/dist/aws-amplify-api.min.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,78 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.15...@aws-amplify/api@4.0.16) (2021-09-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.0.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.14...@aws-amplify/api@4.0.15) (2021-09-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [4.0.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.13...@aws-amplify/api@4.0.14) (2021-09-07)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [4.0.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.12...@aws-amplify/api@4.0.13) (2021-09-04)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [4.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.11...@aws-amplify/api@4.0.12) (2021-09-02)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [4.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.10...@aws-amplify/api@4.0.11) (2021-08-26)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [4.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.9...@aws-amplify/api@4.0.10) (2021-08-19)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [4.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.8...@aws-amplify/api@4.0.9) (2021-08-12)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## [4.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.7...@aws-amplify/api@4.0.8) (2021-07-28)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @aws-amplify/api
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
6
78
|
## [4.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.6...@aws-amplify/api@4.0.7) (2021-07-22)
|
|
7
79
|
|
|
8
80
|
**Note:** Version bump only for package @aws-amplify/api
|
package/dist/aws-amplify-api.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("
|
|
3
|
+
module.exports = factory(require("@aws-amplify/auth"), require("@aws-amplify/cache"), require("@aws-amplify/core"), require("graphql"), require("graphql/language/parser"), require("graphql/language/printer"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define("aws_amplify_api", ["
|
|
5
|
+
define("aws_amplify_api", ["@aws-amplify/auth", "@aws-amplify/cache", "@aws-amplify/core", "graphql", "graphql/language/parser", "graphql/language/printer"], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["aws_amplify_api"] = factory(require("
|
|
7
|
+
exports["aws_amplify_api"] = factory(require("@aws-amplify/auth"), require("@aws-amplify/cache"), require("@aws-amplify/core"), require("graphql"), require("graphql/language/parser"), require("graphql/language/printer"));
|
|
8
8
|
else
|
|
9
|
-
root["aws_amplify_api"] = factory(root["
|
|
9
|
+
root["aws_amplify_api"] = factory(root["@aws-amplify/auth"], root["@aws-amplify/cache"], root["@aws-amplify/core"], root["graphql"], root["graphql/language/parser"], root["graphql/language/printer"]);
|
|
10
10
|
})(this, function(__WEBPACK_EXTERNAL_MODULE__aws_amplify_auth__, __WEBPACK_EXTERNAL_MODULE__aws_amplify_cache__, __WEBPACK_EXTERNAL_MODULE__aws_amplify_core__, __WEBPACK_EXTERNAL_MODULE_graphql__, __WEBPACK_EXTERNAL_MODULE_graphql_language_parser__, __WEBPACK_EXTERNAL_MODULE_graphql_language_printer__) {
|
|
11
11
|
return /******/ (function(modules) { // webpackBootstrap
|
|
12
12
|
/******/ // The module cache
|
|
@@ -130,6 +130,7 @@ module.exports = function xhrAdapter(config) {
|
|
|
130
130
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
131
131
|
var requestData = config.data;
|
|
132
132
|
var requestHeaders = config.headers;
|
|
133
|
+
var responseType = config.responseType;
|
|
133
134
|
|
|
134
135
|
if (utils.isFormData(requestData)) {
|
|
135
136
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
@@ -150,23 +151,14 @@ module.exports = function xhrAdapter(config) {
|
|
|
150
151
|
// Set the request timeout in MS
|
|
151
152
|
request.timeout = config.timeout;
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (!request || request.readyState !== 4) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// The request errored out and we didn't get a response, this will be
|
|
160
|
-
// handled by onerror instead
|
|
161
|
-
// With one exception: request that using file: protocol, most browsers
|
|
162
|
-
// will return status as 0 even though it's a successful request
|
|
163
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
154
|
+
function onloadend() {
|
|
155
|
+
if (!request) {
|
|
164
156
|
return;
|
|
165
157
|
}
|
|
166
|
-
|
|
167
158
|
// Prepare the response
|
|
168
159
|
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
169
|
-
var responseData = !
|
|
160
|
+
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
161
|
+
request.responseText : request.response;
|
|
170
162
|
var response = {
|
|
171
163
|
data: responseData,
|
|
172
164
|
status: request.status,
|
|
@@ -180,7 +172,30 @@ module.exports = function xhrAdapter(config) {
|
|
|
180
172
|
|
|
181
173
|
// Clean up request
|
|
182
174
|
request = null;
|
|
183
|
-
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if ('onloadend' in request) {
|
|
178
|
+
// Use onloadend if available
|
|
179
|
+
request.onloadend = onloadend;
|
|
180
|
+
} else {
|
|
181
|
+
// Listen for ready state to emulate onloadend
|
|
182
|
+
request.onreadystatechange = function handleLoad() {
|
|
183
|
+
if (!request || request.readyState !== 4) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// The request errored out and we didn't get a response, this will be
|
|
188
|
+
// handled by onerror instead
|
|
189
|
+
// With one exception: request that using file: protocol, most browsers
|
|
190
|
+
// will return status as 0 even though it's a successful request
|
|
191
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
195
|
+
// so we should call onloadend on the next 'tick'
|
|
196
|
+
setTimeout(onloadend);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
184
199
|
|
|
185
200
|
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
186
201
|
request.onabort = function handleAbort() {
|
|
@@ -210,7 +225,10 @@ module.exports = function xhrAdapter(config) {
|
|
|
210
225
|
if (config.timeoutErrorMessage) {
|
|
211
226
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
212
227
|
}
|
|
213
|
-
reject(createError(
|
|
228
|
+
reject(createError(
|
|
229
|
+
timeoutErrorMessage,
|
|
230
|
+
config,
|
|
231
|
+
config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
214
232
|
request));
|
|
215
233
|
|
|
216
234
|
// Clean up request
|
|
@@ -250,16 +268,8 @@ module.exports = function xhrAdapter(config) {
|
|
|
250
268
|
}
|
|
251
269
|
|
|
252
270
|
// Add responseType to request if needed
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
request.responseType = config.responseType;
|
|
256
|
-
} catch (e) {
|
|
257
|
-
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
|
|
258
|
-
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
|
|
259
|
-
if (config.responseType !== 'json') {
|
|
260
|
-
throw e;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
271
|
+
if (responseType && responseType !== 'json') {
|
|
272
|
+
request.responseType = config.responseType;
|
|
263
273
|
}
|
|
264
274
|
|
|
265
275
|
// Handle progress if needed
|
|
@@ -498,7 +508,9 @@ var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "../../node_module
|
|
|
498
508
|
var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "../../node_modules/axios/lib/core/InterceptorManager.js");
|
|
499
509
|
var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "../../node_modules/axios/lib/core/dispatchRequest.js");
|
|
500
510
|
var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "../../node_modules/axios/lib/core/mergeConfig.js");
|
|
511
|
+
var validator = __webpack_require__(/*! ../helpers/validator */ "../../node_modules/axios/lib/helpers/validator.js");
|
|
501
512
|
|
|
513
|
+
var validators = validator.validators;
|
|
502
514
|
/**
|
|
503
515
|
* Create a new instance of Axios
|
|
504
516
|
*
|
|
@@ -538,20 +550,71 @@ Axios.prototype.request = function request(config) {
|
|
|
538
550
|
config.method = 'get';
|
|
539
551
|
}
|
|
540
552
|
|
|
541
|
-
|
|
542
|
-
var chain = [dispatchRequest, undefined];
|
|
543
|
-
var promise = Promise.resolve(config);
|
|
553
|
+
var transitional = config.transitional;
|
|
544
554
|
|
|
555
|
+
if (transitional !== undefined) {
|
|
556
|
+
validator.assertOptions(transitional, {
|
|
557
|
+
silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
|
|
558
|
+
forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),
|
|
559
|
+
clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')
|
|
560
|
+
}, false);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// filter out skipped interceptors
|
|
564
|
+
var requestInterceptorChain = [];
|
|
565
|
+
var synchronousRequestInterceptors = true;
|
|
545
566
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
546
|
-
|
|
567
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
572
|
+
|
|
573
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
547
574
|
});
|
|
548
575
|
|
|
576
|
+
var responseInterceptorChain = [];
|
|
549
577
|
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
550
|
-
|
|
578
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
551
579
|
});
|
|
552
580
|
|
|
553
|
-
|
|
554
|
-
|
|
581
|
+
var promise;
|
|
582
|
+
|
|
583
|
+
if (!synchronousRequestInterceptors) {
|
|
584
|
+
var chain = [dispatchRequest, undefined];
|
|
585
|
+
|
|
586
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
587
|
+
chain = chain.concat(responseInterceptorChain);
|
|
588
|
+
|
|
589
|
+
promise = Promise.resolve(config);
|
|
590
|
+
while (chain.length) {
|
|
591
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return promise;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
var newConfig = config;
|
|
599
|
+
while (requestInterceptorChain.length) {
|
|
600
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
601
|
+
var onRejected = requestInterceptorChain.shift();
|
|
602
|
+
try {
|
|
603
|
+
newConfig = onFulfilled(newConfig);
|
|
604
|
+
} catch (error) {
|
|
605
|
+
onRejected(error);
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
try {
|
|
611
|
+
promise = dispatchRequest(newConfig);
|
|
612
|
+
} catch (error) {
|
|
613
|
+
return Promise.reject(error);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
while (responseInterceptorChain.length) {
|
|
617
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
555
618
|
}
|
|
556
619
|
|
|
557
620
|
return promise;
|
|
@@ -614,10 +677,12 @@ function InterceptorManager() {
|
|
|
614
677
|
*
|
|
615
678
|
* @return {Number} An ID used to remove interceptor later
|
|
616
679
|
*/
|
|
617
|
-
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
|
680
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
618
681
|
this.handlers.push({
|
|
619
682
|
fulfilled: fulfilled,
|
|
620
|
-
rejected: rejected
|
|
683
|
+
rejected: rejected,
|
|
684
|
+
synchronous: options ? options.synchronous : false,
|
|
685
|
+
runWhen: options ? options.runWhen : null
|
|
621
686
|
});
|
|
622
687
|
return this.handlers.length - 1;
|
|
623
688
|
};
|
|
@@ -753,7 +818,8 @@ module.exports = function dispatchRequest(config) {
|
|
|
753
818
|
config.headers = config.headers || {};
|
|
754
819
|
|
|
755
820
|
// Transform request data
|
|
756
|
-
config.data = transformData(
|
|
821
|
+
config.data = transformData.call(
|
|
822
|
+
config,
|
|
757
823
|
config.data,
|
|
758
824
|
config.headers,
|
|
759
825
|
config.transformRequest
|
|
@@ -779,7 +845,8 @@ module.exports = function dispatchRequest(config) {
|
|
|
779
845
|
throwIfCancellationRequested(config);
|
|
780
846
|
|
|
781
847
|
// Transform response data
|
|
782
|
-
response.data = transformData(
|
|
848
|
+
response.data = transformData.call(
|
|
849
|
+
config,
|
|
783
850
|
response.data,
|
|
784
851
|
response.headers,
|
|
785
852
|
config.transformResponse
|
|
@@ -792,7 +859,8 @@ module.exports = function dispatchRequest(config) {
|
|
|
792
859
|
|
|
793
860
|
// Transform response data
|
|
794
861
|
if (reason && reason.response) {
|
|
795
|
-
reason.response.data = transformData(
|
|
862
|
+
reason.response.data = transformData.call(
|
|
863
|
+
config,
|
|
796
864
|
reason.response.data,
|
|
797
865
|
reason.response.headers,
|
|
798
866
|
config.transformResponse
|
|
@@ -1008,6 +1076,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
1008
1076
|
|
|
1009
1077
|
|
|
1010
1078
|
var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/utils.js");
|
|
1079
|
+
var defaults = __webpack_require__(/*! ./../defaults */ "../../node_modules/axios/lib/defaults.js");
|
|
1011
1080
|
|
|
1012
1081
|
/**
|
|
1013
1082
|
* Transform the data for a request or a response
|
|
@@ -1018,9 +1087,10 @@ var utils = __webpack_require__(/*! ./../utils */ "../../node_modules/axios/lib/
|
|
|
1018
1087
|
* @returns {*} The resulting transformed data
|
|
1019
1088
|
*/
|
|
1020
1089
|
module.exports = function transformData(data, headers, fns) {
|
|
1090
|
+
var context = this || defaults;
|
|
1021
1091
|
/*eslint no-param-reassign:0*/
|
|
1022
1092
|
utils.forEach(fns, function transform(fn) {
|
|
1023
|
-
data = fn(data, headers);
|
|
1093
|
+
data = fn.call(context, data, headers);
|
|
1024
1094
|
});
|
|
1025
1095
|
|
|
1026
1096
|
return data;
|
|
@@ -1041,6 +1111,7 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
1041
1111
|
|
|
1042
1112
|
var utils = __webpack_require__(/*! ./utils */ "../../node_modules/axios/lib/utils.js");
|
|
1043
1113
|
var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "../../node_modules/axios/lib/helpers/normalizeHeaderName.js");
|
|
1114
|
+
var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "../../node_modules/axios/lib/core/enhanceError.js");
|
|
1044
1115
|
|
|
1045
1116
|
var DEFAULT_CONTENT_TYPE = {
|
|
1046
1117
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
@@ -1064,12 +1135,35 @@ function getDefaultAdapter() {
|
|
|
1064
1135
|
return adapter;
|
|
1065
1136
|
}
|
|
1066
1137
|
|
|
1138
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
1139
|
+
if (utils.isString(rawValue)) {
|
|
1140
|
+
try {
|
|
1141
|
+
(parser || JSON.parse)(rawValue);
|
|
1142
|
+
return utils.trim(rawValue);
|
|
1143
|
+
} catch (e) {
|
|
1144
|
+
if (e.name !== 'SyntaxError') {
|
|
1145
|
+
throw e;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1067
1153
|
var defaults = {
|
|
1154
|
+
|
|
1155
|
+
transitional: {
|
|
1156
|
+
silentJSONParsing: true,
|
|
1157
|
+
forcedJSONParsing: true,
|
|
1158
|
+
clarifyTimeoutError: false
|
|
1159
|
+
},
|
|
1160
|
+
|
|
1068
1161
|
adapter: getDefaultAdapter(),
|
|
1069
1162
|
|
|
1070
1163
|
transformRequest: [function transformRequest(data, headers) {
|
|
1071
1164
|
normalizeHeaderName(headers, 'Accept');
|
|
1072
1165
|
normalizeHeaderName(headers, 'Content-Type');
|
|
1166
|
+
|
|
1073
1167
|
if (utils.isFormData(data) ||
|
|
1074
1168
|
utils.isArrayBuffer(data) ||
|
|
1075
1169
|
utils.isBuffer(data) ||
|
|
@@ -1086,20 +1180,32 @@ var defaults = {
|
|
|
1086
1180
|
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
1087
1181
|
return data.toString();
|
|
1088
1182
|
}
|
|
1089
|
-
if (utils.isObject(data)) {
|
|
1090
|
-
setContentTypeIfUnset(headers, 'application/json
|
|
1091
|
-
return
|
|
1183
|
+
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
|
1184
|
+
setContentTypeIfUnset(headers, 'application/json');
|
|
1185
|
+
return stringifySafely(data);
|
|
1092
1186
|
}
|
|
1093
1187
|
return data;
|
|
1094
1188
|
}],
|
|
1095
1189
|
|
|
1096
1190
|
transformResponse: [function transformResponse(data) {
|
|
1097
|
-
|
|
1098
|
-
|
|
1191
|
+
var transitional = this.transitional;
|
|
1192
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1193
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1194
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
1195
|
+
|
|
1196
|
+
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
|
1099
1197
|
try {
|
|
1100
|
-
|
|
1101
|
-
} catch (e) {
|
|
1198
|
+
return JSON.parse(data);
|
|
1199
|
+
} catch (e) {
|
|
1200
|
+
if (strictJSONParsing) {
|
|
1201
|
+
if (e.name === 'SyntaxError') {
|
|
1202
|
+
throw enhanceError(e, this, 'E_JSON_PARSE');
|
|
1203
|
+
}
|
|
1204
|
+
throw e;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1102
1207
|
}
|
|
1208
|
+
|
|
1103
1209
|
return data;
|
|
1104
1210
|
}],
|
|
1105
1211
|
|
|
@@ -1591,6 +1697,123 @@ module.exports = function spread(callback) {
|
|
|
1591
1697
|
};
|
|
1592
1698
|
|
|
1593
1699
|
|
|
1700
|
+
/***/ }),
|
|
1701
|
+
|
|
1702
|
+
/***/ "../../node_modules/axios/lib/helpers/validator.js":
|
|
1703
|
+
/*!********************************************************************!*\
|
|
1704
|
+
!*** /root/amplify-js/node_modules/axios/lib/helpers/validator.js ***!
|
|
1705
|
+
\********************************************************************/
|
|
1706
|
+
/*! no static exports found */
|
|
1707
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1708
|
+
|
|
1709
|
+
"use strict";
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
var pkg = __webpack_require__(/*! ./../../package.json */ "../../node_modules/axios/package.json");
|
|
1713
|
+
|
|
1714
|
+
var validators = {};
|
|
1715
|
+
|
|
1716
|
+
// eslint-disable-next-line func-names
|
|
1717
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
|
|
1718
|
+
validators[type] = function validator(thing) {
|
|
1719
|
+
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
1720
|
+
};
|
|
1721
|
+
});
|
|
1722
|
+
|
|
1723
|
+
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
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Transitional option validator
|
|
1747
|
+
* @param {function|boolean?} validator
|
|
1748
|
+
* @param {string?} version
|
|
1749
|
+
* @param {string} message
|
|
1750
|
+
* @returns {function}
|
|
1751
|
+
*/
|
|
1752
|
+
validators.transitional = function transitional(validator, version, message) {
|
|
1753
|
+
var isDeprecated = version && isOlderVersion(version);
|
|
1754
|
+
|
|
1755
|
+
function formatMessage(opt, desc) {
|
|
1756
|
+
return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
// eslint-disable-next-line func-names
|
|
1760
|
+
return function(value, opt, opts) {
|
|
1761
|
+
if (validator === false) {
|
|
1762
|
+
throw new Error(formatMessage(opt, ' has been removed in ' + version));
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
if (isDeprecated && !deprecatedWarnings[opt]) {
|
|
1766
|
+
deprecatedWarnings[opt] = true;
|
|
1767
|
+
// eslint-disable-next-line no-console
|
|
1768
|
+
console.warn(
|
|
1769
|
+
formatMessage(
|
|
1770
|
+
opt,
|
|
1771
|
+
' has been deprecated since v' + version + ' and will be removed in the near future'
|
|
1772
|
+
)
|
|
1773
|
+
);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
return validator ? validator(value, opt, opts) : true;
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Assert object's properties type
|
|
1782
|
+
* @param {object} options
|
|
1783
|
+
* @param {object} schema
|
|
1784
|
+
* @param {boolean?} allowUnknown
|
|
1785
|
+
*/
|
|
1786
|
+
|
|
1787
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
1788
|
+
if (typeof options !== 'object') {
|
|
1789
|
+
throw new TypeError('options must be an object');
|
|
1790
|
+
}
|
|
1791
|
+
var keys = Object.keys(options);
|
|
1792
|
+
var i = keys.length;
|
|
1793
|
+
while (i-- > 0) {
|
|
1794
|
+
var opt = keys[i];
|
|
1795
|
+
var validator = schema[opt];
|
|
1796
|
+
if (validator) {
|
|
1797
|
+
var value = options[opt];
|
|
1798
|
+
var result = value === undefined || validator(value, opt, options);
|
|
1799
|
+
if (result !== true) {
|
|
1800
|
+
throw new TypeError('option ' + opt + ' must be ' + result);
|
|
1801
|
+
}
|
|
1802
|
+
continue;
|
|
1803
|
+
}
|
|
1804
|
+
if (allowUnknown !== true) {
|
|
1805
|
+
throw Error('Unknown option ' + opt);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
module.exports = {
|
|
1811
|
+
isOlderVersion: isOlderVersion,
|
|
1812
|
+
assertOptions: assertOptions,
|
|
1813
|
+
validators: validators
|
|
1814
|
+
};
|
|
1815
|
+
|
|
1816
|
+
|
|
1594
1817
|
/***/ }),
|
|
1595
1818
|
|
|
1596
1819
|
/***/ "../../node_modules/axios/lib/utils.js":
|
|
@@ -1605,8 +1828,6 @@ module.exports = function spread(callback) {
|
|
|
1605
1828
|
|
|
1606
1829
|
var bind = __webpack_require__(/*! ./helpers/bind */ "../../node_modules/axios/lib/helpers/bind.js");
|
|
1607
1830
|
|
|
1608
|
-
/*global toString:true*/
|
|
1609
|
-
|
|
1610
1831
|
// utils is a library of generic helper functions non-specific to axios
|
|
1611
1832
|
|
|
1612
1833
|
var toString = Object.prototype.toString;
|
|
@@ -1790,7 +2011,7 @@ function isURLSearchParams(val) {
|
|
|
1790
2011
|
* @returns {String} The String freed of excess whitespace
|
|
1791
2012
|
*/
|
|
1792
2013
|
function trim(str) {
|
|
1793
|
-
return str.
|
|
2014
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
1794
2015
|
}
|
|
1795
2016
|
|
|
1796
2017
|
/**
|
|
@@ -1954,6 +2175,17 @@ module.exports = {
|
|
|
1954
2175
|
};
|
|
1955
2176
|
|
|
1956
2177
|
|
|
2178
|
+
/***/ }),
|
|
2179
|
+
|
|
2180
|
+
/***/ "../../node_modules/axios/package.json":
|
|
2181
|
+
/*!********************************************************!*\
|
|
2182
|
+
!*** /root/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
|
+
|
|
1957
2189
|
/***/ }),
|
|
1958
2190
|
|
|
1959
2191
|
/***/ "../../node_modules/base64-js/index.js":
|
|
@@ -14894,6 +15126,17 @@ var PubSubClass = function () {
|
|
|
14894
15126
|
});
|
|
14895
15127
|
});
|
|
14896
15128
|
};
|
|
15129
|
+
/**
|
|
15130
|
+
* remove plugin from PubSub category
|
|
15131
|
+
* @param providerName - the name of the plugin
|
|
15132
|
+
*/
|
|
15133
|
+
|
|
15134
|
+
|
|
15135
|
+
PubSubClass.prototype.removePluggable = function (providerName) {
|
|
15136
|
+
this._pluggables = this._pluggables.filter(function (pluggable) {
|
|
15137
|
+
return pluggable.getProviderName() !== providerName;
|
|
15138
|
+
});
|
|
15139
|
+
};
|
|
14897
15140
|
|
|
14898
15141
|
PubSubClass.prototype.getProviderByName = function (providerName) {
|
|
14899
15142
|
if (providerName === _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"]) {
|
|
@@ -15476,9 +15719,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15476
15719
|
/***/ }),
|
|
15477
15720
|
|
|
15478
15721
|
/***/ "@aws-amplify/auth":
|
|
15479
|
-
|
|
15480
|
-
!*** external "
|
|
15481
|
-
|
|
15722
|
+
/*!************************************!*\
|
|
15723
|
+
!*** external "@aws-amplify/auth" ***!
|
|
15724
|
+
\************************************/
|
|
15482
15725
|
/*! no static exports found */
|
|
15483
15726
|
/***/ (function(module, exports) {
|
|
15484
15727
|
|
|
@@ -15487,9 +15730,9 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_amplify_auth__;
|
|
|
15487
15730
|
/***/ }),
|
|
15488
15731
|
|
|
15489
15732
|
/***/ "@aws-amplify/cache":
|
|
15490
|
-
|
|
15491
|
-
!*** external "
|
|
15492
|
-
|
|
15733
|
+
/*!*************************************!*\
|
|
15734
|
+
!*** external "@aws-amplify/cache" ***!
|
|
15735
|
+
\*************************************/
|
|
15493
15736
|
/*! no static exports found */
|
|
15494
15737
|
/***/ (function(module, exports) {
|
|
15495
15738
|
|
|
@@ -15498,9 +15741,9 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__aws_amplify_cache__;
|
|
|
15498
15741
|
/***/ }),
|
|
15499
15742
|
|
|
15500
15743
|
/***/ "@aws-amplify/core":
|
|
15501
|
-
|
|
15502
|
-
!*** external "
|
|
15503
|
-
|
|
15744
|
+
/*!************************************!*\
|
|
15745
|
+
!*** external "@aws-amplify/core" ***!
|
|
15746
|
+
\************************************/
|
|
15504
15747
|
/*! no static exports found */
|
|
15505
15748
|
/***/ (function(module, exports) {
|
|
15506
15749
|
|