@jjrawlins/cdk-iam-policy-builder-helper 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.jsii +210 -62
  2. package/.mergify.yml +60 -0
  3. package/jjrawlinscdkiampolicybuilderhelper/jsii/jsii.go +2 -2
  4. package/jjrawlinscdkiampolicybuilderhelper/version +1 -1
  5. package/lib/constructs/Actions.d.ts +799 -61
  6. package/lib/constructs/Actions.js +800 -62
  7. package/methods_list.txt +19274 -0
  8. package/node_modules/axios/CHANGELOG.md +257 -0
  9. package/node_modules/axios/README.md +71 -87
  10. package/node_modules/axios/dist/axios.js +303 -235
  11. package/node_modules/axios/dist/axios.js.map +1 -1
  12. package/node_modules/axios/dist/axios.min.js +2 -1
  13. package/node_modules/axios/dist/axios.min.js.map +1 -1
  14. package/node_modules/axios/dist/browser/axios.cjs +230 -177
  15. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  16. package/node_modules/axios/dist/esm/axios.js +230 -177
  17. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  18. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  19. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  20. package/node_modules/axios/dist/node/axios.cjs +268 -187
  21. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  22. package/node_modules/axios/index.d.cts +22 -6
  23. package/node_modules/axios/index.d.ts +14 -4
  24. package/node_modules/axios/lib/adapters/fetch.js +22 -22
  25. package/node_modules/axios/lib/adapters/http.js +7 -7
  26. package/node_modules/axios/lib/cancel/CancelToken.js +14 -0
  27. package/node_modules/axios/lib/core/Axios.js +20 -6
  28. package/node_modules/axios/lib/core/AxiosError.js +5 -2
  29. package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
  30. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  31. package/node_modules/axios/lib/core/mergeConfig.js +6 -6
  32. package/node_modules/axios/lib/env/data.js +1 -1
  33. package/node_modules/axios/lib/helpers/buildURL.js +7 -1
  34. package/node_modules/axios/lib/helpers/composeSignals.js +31 -29
  35. package/node_modules/axios/lib/helpers/formDataToStream.js +6 -5
  36. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +12 -65
  37. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  38. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  39. package/node_modules/axios/lib/helpers/toFormData.js +4 -0
  40. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  41. package/node_modules/axios/lib/helpers/trackStream.js +25 -5
  42. package/node_modules/axios/lib/helpers/validator.js +8 -0
  43. package/node_modules/axios/lib/platform/common/utils.js +5 -4
  44. package/node_modules/axios/lib/platform/node/index.js +26 -0
  45. package/node_modules/axios/lib/utils.js +48 -28
  46. package/node_modules/axios/package.json +14 -5
  47. package/node_modules/form-data/CHANGELOG.md +601 -0
  48. package/node_modules/form-data/{Readme.md → README.md} +34 -37
  49. package/node_modules/form-data/lib/browser.js +3 -1
  50. package/node_modules/form-data/lib/form_data.js +126 -135
  51. package/node_modules/form-data/lib/populate.js +5 -5
  52. package/node_modules/form-data/package.json +24 -16
  53. package/package.json +15 -10
  54. package/node_modules/axios/SECURITY.md +0 -6
@@ -1,4 +1,4 @@
1
- // Axios v1.7.4 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ /*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -681,6 +681,8 @@
681
681
 
682
682
  var toString = Object.prototype.toString;
683
683
  var getPrototypeOf = Object.getPrototypeOf;
684
+ var iterator = Symbol.iterator,
685
+ toStringTag = Symbol.toStringTag;
684
686
  var kindOf = function (cache) {
685
687
  return function (thing) {
686
688
  var str = toString.call(thing);
@@ -813,7 +815,27 @@
813
815
  return false;
814
816
  }
815
817
  var prototype = getPrototypeOf(val);
816
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
818
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
819
+ };
820
+
821
+ /**
822
+ * Determine if a value is an empty object (safely handles Buffers)
823
+ *
824
+ * @param {*} val The value to test
825
+ *
826
+ * @returns {boolean} True if value is an empty object, otherwise false
827
+ */
828
+ var isEmptyObject = function isEmptyObject(val) {
829
+ // Early return for non-objects or Buffers to prevent RangeError
830
+ if (!isObject(val) || isBuffer(val)) {
831
+ return false;
832
+ }
833
+ try {
834
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
835
+ } catch (e) {
836
+ // Fallback for any other objects that might cause RangeError with Object.keys()
837
+ return false;
838
+ }
817
839
  };
818
840
 
819
841
  /**
@@ -940,6 +962,11 @@
940
962
  fn.call(null, obj[i], i, obj);
941
963
  }
942
964
  } else {
965
+ // Buffer check
966
+ if (isBuffer(obj)) {
967
+ return;
968
+ }
969
+
943
970
  // Iterate over object keys
944
971
  var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
945
972
  var len = keys.length;
@@ -951,6 +978,9 @@
951
978
  }
952
979
  }
953
980
  function findKey(obj, key) {
981
+ if (isBuffer(obj)) {
982
+ return null;
983
+ }
954
984
  key = key.toLowerCase();
955
985
  var keys = Object.keys(obj);
956
986
  var i = keys.length;
@@ -1165,10 +1195,10 @@
1165
1195
  * @returns {void}
1166
1196
  */
1167
1197
  var forEachEntry = function forEachEntry(obj, fn) {
1168
- var generator = obj && obj[Symbol.iterator];
1169
- var iterator = generator.call(obj);
1198
+ var generator = obj && obj[iterator];
1199
+ var _iterator = generator.call(obj);
1170
1200
  var result;
1171
- while ((result = iterator.next()) && !result.done) {
1201
+ while ((result = _iterator.next()) && !result.done) {
1172
1202
  var pair = result.value;
1173
1203
  fn.call(obj, pair[0], pair[1]);
1174
1204
  }
@@ -1266,23 +1296,6 @@
1266
1296
  var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
1267
1297
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
1268
1298
  };
1269
- var ALPHA = 'abcdefghijklmnopqrstuvwxyz';
1270
- var DIGIT = '0123456789';
1271
- var ALPHABET = {
1272
- DIGIT: DIGIT,
1273
- ALPHA: ALPHA,
1274
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
1275
- };
1276
- var generateString = function generateString() {
1277
- var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16;
1278
- var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT;
1279
- var str = '';
1280
- var length = alphabet.length;
1281
- while (size--) {
1282
- str += alphabet[Math.random() * length | 0];
1283
- }
1284
- return str;
1285
- };
1286
1299
 
1287
1300
  /**
1288
1301
  * If the thing is a FormData object, return true, otherwise return false.
@@ -1292,7 +1305,7 @@
1292
1305
  * @returns {boolean}
1293
1306
  */
1294
1307
  function isSpecCompliantForm(thing) {
1295
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
1308
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
1296
1309
  }
1297
1310
  var toJSONObject = function toJSONObject(obj) {
1298
1311
  var stack = new Array(10);
@@ -1301,6 +1314,11 @@
1301
1314
  if (stack.indexOf(source) >= 0) {
1302
1315
  return;
1303
1316
  }
1317
+
1318
+ //Buffer check
1319
+ if (isBuffer(source)) {
1320
+ return source;
1321
+ }
1304
1322
  if (!('toJSON' in source)) {
1305
1323
  stack[i] = source;
1306
1324
  var target = isArray(source) ? [] : {};
@@ -1348,6 +1366,9 @@
1348
1366
 
1349
1367
  // *********************
1350
1368
 
1369
+ var isIterable = function isIterable(thing) {
1370
+ return thing != null && isFunction(thing[iterator]);
1371
+ };
1351
1372
  var utils$1 = {
1352
1373
  isArray: isArray,
1353
1374
  isArrayBuffer: isArrayBuffer,
@@ -1359,6 +1380,7 @@
1359
1380
  isBoolean: isBoolean,
1360
1381
  isObject: isObject,
1361
1382
  isPlainObject: isPlainObject,
1383
+ isEmptyObject: isEmptyObject,
1362
1384
  isReadableStream: isReadableStream,
1363
1385
  isRequest: isRequest,
1364
1386
  isResponse: isResponse,
@@ -1399,14 +1421,13 @@
1399
1421
  findKey: findKey,
1400
1422
  global: _global,
1401
1423
  isContextDefined: isContextDefined,
1402
- ALPHABET: ALPHABET,
1403
- generateString: generateString,
1404
1424
  isSpecCompliantForm: isSpecCompliantForm,
1405
1425
  toJSONObject: toJSONObject,
1406
1426
  isAsyncFn: isAsyncFn,
1407
1427
  isThenable: isThenable,
1408
1428
  setImmediate: _setImmediate,
1409
- asap: asap
1429
+ asap: asap,
1430
+ isIterable: isIterable
1410
1431
  };
1411
1432
 
1412
1433
  /**
@@ -1432,7 +1453,10 @@
1432
1453
  code && (this.code = code);
1433
1454
  config && (this.config = config);
1434
1455
  request && (this.request = request);
1435
- response && (this.response = response);
1456
+ if (response) {
1457
+ this.response = response;
1458
+ this.status = response.status ? response.status : null;
1459
+ }
1436
1460
  }
1437
1461
  utils$1.inherits(AxiosError, Error, {
1438
1462
  toJSON: function toJSON() {
@@ -1451,7 +1475,7 @@
1451
1475
  // Axios
1452
1476
  config: utils$1.toJSONObject(this.config),
1453
1477
  code: this.code,
1454
- status: this.response && this.response.status ? this.response.status : null
1478
+ status: this.status
1455
1479
  };
1456
1480
  }
1457
1481
  });
@@ -1596,6 +1620,9 @@
1596
1620
  if (utils$1.isDate(value)) {
1597
1621
  return value.toISOString();
1598
1622
  }
1623
+ if (utils$1.isBoolean(value)) {
1624
+ return value.toString();
1625
+ }
1599
1626
  if (!useBlob && utils$1.isBlob(value)) {
1600
1627
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1601
1628
  }
@@ -1732,7 +1759,7 @@
1732
1759
  *
1733
1760
  * @param {string} url The base of the url (e.g., http://www.google.com)
1734
1761
  * @param {object} [params] The params to be appended
1735
- * @param {?object} options
1762
+ * @param {?(object|Function)} options
1736
1763
  *
1737
1764
  * @returns {string} The formatted url
1738
1765
  */
@@ -1742,6 +1769,11 @@
1742
1769
  return url;
1743
1770
  }
1744
1771
  var _encode = options && options.encode || encode;
1772
+ if (utils$1.isFunction(options)) {
1773
+ options = {
1774
+ serialize: options
1775
+ };
1776
+ }
1745
1777
  var serializeFn = options && options.serialize;
1746
1778
  var serializedParams;
1747
1779
  if (serializeFn) {
@@ -1860,6 +1892,7 @@
1860
1892
  };
1861
1893
 
1862
1894
  var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1895
+ var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && navigator || undefined;
1863
1896
 
1864
1897
  /**
1865
1898
  * Determine if we're running in a standard browser environment
@@ -1878,9 +1911,7 @@
1878
1911
  *
1879
1912
  * @returns {boolean}
1880
1913
  */
1881
- var hasStandardBrowserEnv = function (product) {
1882
- return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0;
1883
- }(typeof navigator !== 'undefined' && navigator.product);
1914
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1884
1915
 
1885
1916
  /**
1886
1917
  * Determine if we're running in a standard browser webWorker environment
@@ -1903,13 +1934,14 @@
1903
1934
  hasBrowserEnv: hasBrowserEnv,
1904
1935
  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1905
1936
  hasStandardBrowserEnv: hasStandardBrowserEnv,
1937
+ navigator: _navigator,
1906
1938
  origin: origin
1907
1939
  });
1908
1940
 
1909
1941
  var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
1910
1942
 
1911
1943
  function toURLEncodedForm(data, options) {
1912
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1944
+ return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({
1913
1945
  visitor: function visitor(value, key, path, helpers) {
1914
1946
  if (platform.isNode && utils$1.isBuffer(value)) {
1915
1947
  this.append(key, value.toString('base64'));
@@ -2238,21 +2270,26 @@
2238
2270
  setHeaders(header, valueOrRewrite);
2239
2271
  } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
2240
2272
  setHeaders(parseHeaders(header), valueOrRewrite);
2241
- } else if (utils$1.isHeaders(header)) {
2242
- var _iterator = _createForOfIteratorHelper(header.entries()),
2273
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
2274
+ var obj = {},
2275
+ dest,
2276
+ key;
2277
+ var _iterator = _createForOfIteratorHelper(header),
2243
2278
  _step;
2244
2279
  try {
2245
2280
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
2246
- var _step$value = _slicedToArray(_step.value, 2),
2247
- key = _step$value[0],
2248
- value = _step$value[1];
2249
- setHeader(value, key, rewrite);
2281
+ var entry = _step.value;
2282
+ if (!utils$1.isArray(entry)) {
2283
+ throw TypeError('Object iterator must return a key-value pair');
2284
+ }
2285
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
2250
2286
  }
2251
2287
  } catch (err) {
2252
2288
  _iterator.e(err);
2253
2289
  } finally {
2254
2290
  _iterator.f();
2255
2291
  }
2292
+ setHeaders(obj, valueOrRewrite);
2256
2293
  } else {
2257
2294
  header != null && setHeader(valueOrRewrite, header, rewrite);
2258
2295
  }
@@ -2383,6 +2420,11 @@
2383
2420
  return header + ': ' + value;
2384
2421
  }).join('\n');
2385
2422
  }
2423
+ }, {
2424
+ key: "getSetCookie",
2425
+ value: function getSetCookie() {
2426
+ return this.get("set-cookie") || [];
2427
+ }
2386
2428
  }, {
2387
2429
  key: _Symbol$toStringTag,
2388
2430
  get: function get() {
@@ -2568,7 +2610,7 @@
2568
2610
  clearTimeout(timer);
2569
2611
  timer = null;
2570
2612
  }
2571
- fn.apply(null, args);
2613
+ fn.apply(void 0, _toConsumableArray(args));
2572
2614
  };
2573
2615
  var throttled = function throttled() {
2574
2616
  var now = Date.now();
@@ -2639,60 +2681,14 @@
2639
2681
  };
2640
2682
  };
2641
2683
 
2642
- var isURLSameOrigin = platform.hasStandardBrowserEnv ?
2643
- // Standard browser envs have full support of the APIs needed to test
2644
- // whether the request URL is of the same origin as current location.
2645
- function standardBrowserEnv() {
2646
- var msie = /(msie|trident)/i.test(navigator.userAgent);
2647
- var urlParsingNode = document.createElement('a');
2648
- var originURL;
2649
-
2650
- /**
2651
- * Parse a URL to discover its components
2652
- *
2653
- * @param {String} url The URL to be parsed
2654
- * @returns {Object}
2655
- */
2656
- function resolveURL(url) {
2657
- var href = url;
2658
- if (msie) {
2659
- // IE needs attribute set twice to normalize properties
2660
- urlParsingNode.setAttribute('href', href);
2661
- href = urlParsingNode.href;
2662
- }
2663
- urlParsingNode.setAttribute('href', href);
2664
-
2665
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2666
- return {
2667
- href: urlParsingNode.href,
2668
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2669
- host: urlParsingNode.host,
2670
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2671
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2672
- hostname: urlParsingNode.hostname,
2673
- port: urlParsingNode.port,
2674
- pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
2675
- };
2676
- }
2677
- originURL = resolveURL(window.location.href);
2678
-
2679
- /**
2680
- * Determine if a URL shares the same origin as the current location
2681
- *
2682
- * @param {String} requestURL The URL to test
2683
- * @returns {boolean} True if URL shares the same origin, otherwise false
2684
- */
2685
- return function isURLSameOrigin(requestURL) {
2686
- var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
2687
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
2684
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) {
2685
+ return function (url) {
2686
+ url = new URL(url, platform.origin);
2687
+ return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
2688
2688
  };
2689
- }() :
2690
- // Non standard browser envs (web workers, react-native) lack needed support.
2691
- function nonStandardBrowserEnv() {
2692
- return function isURLSameOrigin() {
2693
- return true;
2694
- };
2695
- }();
2689
+ }(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () {
2690
+ return true;
2691
+ };
2696
2692
 
2697
2693
  var cookies = platform.hasStandardBrowserEnv ?
2698
2694
  // Standard browser envs support document.cookie
@@ -2758,8 +2754,9 @@
2758
2754
  *
2759
2755
  * @returns {string} The combined full path
2760
2756
  */
2761
- function buildFullPath(baseURL, requestedURL) {
2762
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2757
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2758
+ var isRelativeUrl = !isAbsoluteURL(requestedURL);
2759
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2763
2760
  return combineURLs(baseURL, requestedURL);
2764
2761
  }
2765
2762
  return requestedURL;
@@ -2782,7 +2779,7 @@
2782
2779
  // eslint-disable-next-line no-param-reassign
2783
2780
  config2 = config2 || {};
2784
2781
  var config = {};
2785
- function getMergedValue(target, source, caseless) {
2782
+ function getMergedValue(target, source, prop, caseless) {
2786
2783
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2787
2784
  return utils$1.merge.call({
2788
2785
  caseless: caseless
@@ -2796,11 +2793,11 @@
2796
2793
  }
2797
2794
 
2798
2795
  // eslint-disable-next-line consistent-return
2799
- function mergeDeepProperties(a, b, caseless) {
2796
+ function mergeDeepProperties(a, b, prop, caseless) {
2800
2797
  if (!utils$1.isUndefined(b)) {
2801
- return getMergedValue(a, b, caseless);
2798
+ return getMergedValue(a, b, prop, caseless);
2802
2799
  } else if (!utils$1.isUndefined(a)) {
2803
- return getMergedValue(undefined, a, caseless);
2800
+ return getMergedValue(undefined, a, prop, caseless);
2804
2801
  }
2805
2802
  }
2806
2803
 
@@ -2857,11 +2854,11 @@
2857
2854
  socketPath: defaultToConfig2,
2858
2855
  responseEncoding: defaultToConfig2,
2859
2856
  validateStatus: mergeDirectKeys,
2860
- headers: function headers(a, b) {
2861
- return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
2857
+ headers: function headers(a, b, prop) {
2858
+ return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
2862
2859
  }
2863
2860
  };
2864
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2861
+ utils$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
2865
2862
  var merge = mergeMap[prop] || mergeDeepProperties;
2866
2863
  var configValue = merge(config1[prop], config2[prop], prop);
2867
2864
  utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
@@ -2878,7 +2875,7 @@
2878
2875
  headers = newConfig.headers,
2879
2876
  auth = newConfig.auth;
2880
2877
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
2881
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2878
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2882
2879
 
2883
2880
  // HTTP basic authentication
2884
2881
  if (auth) {
@@ -3090,38 +3087,42 @@
3090
3087
  };
3091
3088
 
3092
3089
  var composeSignals = function composeSignals(signals, timeout) {
3093
- var controller = new AbortController();
3094
- var aborted;
3095
- var onabort = function onabort(cancel) {
3096
- if (!aborted) {
3097
- aborted = true;
3098
- unsubscribe();
3099
- var err = cancel instanceof Error ? cancel : this.reason;
3100
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3101
- }
3102
- };
3103
- var timer = timeout && setTimeout(function () {
3104
- onabort(new AxiosError("timeout ".concat(timeout, " of ms exceeded"), AxiosError.ETIMEDOUT));
3105
- }, timeout);
3106
- var unsubscribe = function unsubscribe() {
3107
- if (signals) {
3108
- timer && clearTimeout(timer);
3090
+ var _signals = signals = signals ? signals.filter(Boolean) : [],
3091
+ length = _signals.length;
3092
+ if (timeout || length) {
3093
+ var controller = new AbortController();
3094
+ var aborted;
3095
+ var onabort = function onabort(reason) {
3096
+ if (!aborted) {
3097
+ aborted = true;
3098
+ unsubscribe();
3099
+ var err = reason instanceof Error ? reason : this.reason;
3100
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3101
+ }
3102
+ };
3103
+ var timer = timeout && setTimeout(function () {
3109
3104
  timer = null;
3110
- signals.forEach(function (signal) {
3111
- signal && (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
3112
- });
3113
- signals = null;
3114
- }
3115
- };
3116
- signals.forEach(function (signal) {
3117
- return signal && signal.addEventListener && signal.addEventListener('abort', onabort);
3118
- });
3119
- var signal = controller.signal;
3120
- signal.unsubscribe = unsubscribe;
3121
- return [signal, function () {
3122
- timer && clearTimeout(timer);
3123
- timer = null;
3124
- }];
3105
+ onabort(new AxiosError("timeout ".concat(timeout, " of ms exceeded"), AxiosError.ETIMEDOUT));
3106
+ }, timeout);
3107
+ var unsubscribe = function unsubscribe() {
3108
+ if (signals) {
3109
+ timer && clearTimeout(timer);
3110
+ timer = null;
3111
+ signals.forEach(function (signal) {
3112
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
3113
+ });
3114
+ signals = null;
3115
+ }
3116
+ };
3117
+ signals.forEach(function (signal) {
3118
+ return signal.addEventListener('abort', onabort);
3119
+ });
3120
+ var signal = controller.signal;
3121
+ signal.unsubscribe = function () {
3122
+ return utils$1.asap(unsubscribe);
3123
+ };
3124
+ return signal;
3125
+ }
3125
3126
  };
3126
3127
  var composeSignals$1 = composeSignals;
3127
3128
 
@@ -3160,7 +3161,7 @@
3160
3161
  }, streamChunk);
3161
3162
  });
3162
3163
  var readBytes = /*#__PURE__*/function () {
3163
- var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable, chunkSize, encode) {
3164
+ var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable, chunkSize) {
3164
3165
  var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk;
3165
3166
  return _regeneratorRuntime().wrap(function _callee$(_context2) {
3166
3167
  while (1) switch (_context2.prev = _context2.next) {
@@ -3168,82 +3169,111 @@
3168
3169
  _iteratorAbruptCompletion = false;
3169
3170
  _didIteratorError = false;
3170
3171
  _context2.prev = 2;
3171
- _iterator = _asyncIterator(iterable);
3172
+ _iterator = _asyncIterator(readStream(iterable));
3172
3173
  case 4:
3173
3174
  _context2.next = 6;
3174
3175
  return _awaitAsyncGenerator(_iterator.next());
3175
3176
  case 6:
3176
3177
  if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
3177
- _context2.next = 27;
3178
+ _context2.next = 12;
3178
3179
  break;
3179
3180
  }
3180
3181
  chunk = _step.value;
3181
- _context2.t0 = _asyncGeneratorDelegate;
3182
- _context2.t1 = _asyncIterator;
3183
- _context2.t2 = streamChunk;
3184
- if (!ArrayBuffer.isView(chunk)) {
3185
- _context2.next = 15;
3186
- break;
3187
- }
3188
- _context2.t3 = chunk;
3189
- _context2.next = 18;
3190
- break;
3191
- case 15:
3192
- _context2.next = 17;
3193
- return _awaitAsyncGenerator(encode(String(chunk)));
3194
- case 17:
3195
- _context2.t3 = _context2.sent;
3196
- case 18:
3197
- _context2.t4 = _context2.t3;
3198
- _context2.t5 = chunkSize;
3199
- _context2.t6 = (0, _context2.t2)(_context2.t4, _context2.t5);
3200
- _context2.t7 = (0, _context2.t1)(_context2.t6);
3201
- _context2.t8 = _awaitAsyncGenerator;
3202
- return _context2.delegateYield((0, _context2.t0)(_context2.t7, _context2.t8), "t9", 24);
3203
- case 24:
3182
+ return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize))), "t0", 9);
3183
+ case 9:
3204
3184
  _iteratorAbruptCompletion = false;
3205
3185
  _context2.next = 4;
3206
3186
  break;
3207
- case 27:
3208
- _context2.next = 33;
3187
+ case 12:
3188
+ _context2.next = 18;
3209
3189
  break;
3210
- case 29:
3211
- _context2.prev = 29;
3212
- _context2.t10 = _context2["catch"](2);
3190
+ case 14:
3191
+ _context2.prev = 14;
3192
+ _context2.t1 = _context2["catch"](2);
3213
3193
  _didIteratorError = true;
3214
- _iteratorError = _context2.t10;
3215
- case 33:
3216
- _context2.prev = 33;
3217
- _context2.prev = 34;
3194
+ _iteratorError = _context2.t1;
3195
+ case 18:
3196
+ _context2.prev = 18;
3197
+ _context2.prev = 19;
3218
3198
  if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
3219
- _context2.next = 38;
3199
+ _context2.next = 23;
3220
3200
  break;
3221
3201
  }
3222
- _context2.next = 38;
3202
+ _context2.next = 23;
3223
3203
  return _awaitAsyncGenerator(_iterator["return"]());
3224
- case 38:
3225
- _context2.prev = 38;
3204
+ case 23:
3205
+ _context2.prev = 23;
3226
3206
  if (!_didIteratorError) {
3227
- _context2.next = 41;
3207
+ _context2.next = 26;
3228
3208
  break;
3229
3209
  }
3230
3210
  throw _iteratorError;
3231
- case 41:
3232
- return _context2.finish(38);
3233
- case 42:
3234
- return _context2.finish(33);
3235
- case 43:
3211
+ case 26:
3212
+ return _context2.finish(23);
3213
+ case 27:
3214
+ return _context2.finish(18);
3215
+ case 28:
3236
3216
  case "end":
3237
3217
  return _context2.stop();
3238
3218
  }
3239
- }, _callee, null, [[2, 29, 33, 43], [34,, 38, 42]]);
3219
+ }, _callee, null, [[2, 14, 18, 28], [19,, 23, 27]]);
3240
3220
  }));
3241
- return function readBytes(_x, _x2, _x3) {
3221
+ return function readBytes(_x, _x2) {
3242
3222
  return _ref.apply(this, arguments);
3243
3223
  };
3244
3224
  }();
3245
- var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish, encode) {
3246
- var iterator = readBytes(stream, chunkSize, encode);
3225
+ var readStream = /*#__PURE__*/function () {
3226
+ var _ref2 = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(stream) {
3227
+ var reader, _yield$_awaitAsyncGen, done, value;
3228
+ return _regeneratorRuntime().wrap(function _callee2$(_context3) {
3229
+ while (1) switch (_context3.prev = _context3.next) {
3230
+ case 0:
3231
+ if (!stream[Symbol.asyncIterator]) {
3232
+ _context3.next = 3;
3233
+ break;
3234
+ }
3235
+ return _context3.delegateYield(_asyncGeneratorDelegate(_asyncIterator(stream)), "t0", 2);
3236
+ case 2:
3237
+ return _context3.abrupt("return");
3238
+ case 3:
3239
+ reader = stream.getReader();
3240
+ _context3.prev = 4;
3241
+ case 5:
3242
+ _context3.next = 7;
3243
+ return _awaitAsyncGenerator(reader.read());
3244
+ case 7:
3245
+ _yield$_awaitAsyncGen = _context3.sent;
3246
+ done = _yield$_awaitAsyncGen.done;
3247
+ value = _yield$_awaitAsyncGen.value;
3248
+ if (!done) {
3249
+ _context3.next = 12;
3250
+ break;
3251
+ }
3252
+ return _context3.abrupt("break", 16);
3253
+ case 12:
3254
+ _context3.next = 14;
3255
+ return value;
3256
+ case 14:
3257
+ _context3.next = 5;
3258
+ break;
3259
+ case 16:
3260
+ _context3.prev = 16;
3261
+ _context3.next = 19;
3262
+ return _awaitAsyncGenerator(reader.cancel());
3263
+ case 19:
3264
+ return _context3.finish(16);
3265
+ case 20:
3266
+ case "end":
3267
+ return _context3.stop();
3268
+ }
3269
+ }, _callee2, null, [[4,, 16, 20]]);
3270
+ }));
3271
+ return function readStream(_x3) {
3272
+ return _ref2.apply(this, arguments);
3273
+ };
3274
+ }();
3275
+ var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) {
3276
+ var iterator = readBytes(stream, chunkSize);
3247
3277
  var bytes = 0;
3248
3278
  var done;
3249
3279
  var _onFinish = function _onFinish(e) {
@@ -3254,25 +3284,25 @@
3254
3284
  };
3255
3285
  return new ReadableStream({
3256
3286
  pull: function pull(controller) {
3257
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3287
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3258
3288
  var _yield$iterator$next, _done, value, len, loadedBytes;
3259
- return _regeneratorRuntime().wrap(function _callee2$(_context3) {
3260
- while (1) switch (_context3.prev = _context3.next) {
3289
+ return _regeneratorRuntime().wrap(function _callee3$(_context4) {
3290
+ while (1) switch (_context4.prev = _context4.next) {
3261
3291
  case 0:
3262
- _context3.prev = 0;
3263
- _context3.next = 3;
3292
+ _context4.prev = 0;
3293
+ _context4.next = 3;
3264
3294
  return iterator.next();
3265
3295
  case 3:
3266
- _yield$iterator$next = _context3.sent;
3296
+ _yield$iterator$next = _context4.sent;
3267
3297
  _done = _yield$iterator$next.done;
3268
3298
  value = _yield$iterator$next.value;
3269
3299
  if (!_done) {
3270
- _context3.next = 10;
3300
+ _context4.next = 10;
3271
3301
  break;
3272
3302
  }
3273
3303
  _onFinish();
3274
3304
  controller.close();
3275
- return _context3.abrupt("return");
3305
+ return _context4.abrupt("return");
3276
3306
  case 10:
3277
3307
  len = value.byteLength;
3278
3308
  if (onProgress) {
@@ -3280,18 +3310,18 @@
3280
3310
  onProgress(loadedBytes);
3281
3311
  }
3282
3312
  controller.enqueue(new Uint8Array(value));
3283
- _context3.next = 19;
3313
+ _context4.next = 19;
3284
3314
  break;
3285
3315
  case 15:
3286
- _context3.prev = 15;
3287
- _context3.t0 = _context3["catch"](0);
3288
- _onFinish(_context3.t0);
3289
- throw _context3.t0;
3316
+ _context4.prev = 15;
3317
+ _context4.t0 = _context4["catch"](0);
3318
+ _onFinish(_context4.t0);
3319
+ throw _context4.t0;
3290
3320
  case 19:
3291
3321
  case "end":
3292
- return _context3.stop();
3322
+ return _context4.stop();
3293
3323
  }
3294
- }, _callee2, null, [[0, 15]]);
3324
+ }, _callee3, null, [[0, 15]]);
3295
3325
  }))();
3296
3326
  },
3297
3327
  cancel: function cancel(reason) {
@@ -3374,6 +3404,7 @@
3374
3404
  }(new Response());
3375
3405
  var getBodyLength = /*#__PURE__*/function () {
3376
3406
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body) {
3407
+ var _request;
3377
3408
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3378
3409
  while (1) switch (_context2.prev = _context2.next) {
3379
3410
  case 0:
@@ -3390,32 +3421,36 @@
3390
3421
  return _context2.abrupt("return", body.size);
3391
3422
  case 4:
3392
3423
  if (!utils$1.isSpecCompliantForm(body)) {
3393
- _context2.next = 8;
3424
+ _context2.next = 9;
3394
3425
  break;
3395
3426
  }
3396
- _context2.next = 7;
3397
- return new Request(body).arrayBuffer();
3398
- case 7:
3399
- return _context2.abrupt("return", _context2.sent.byteLength);
3427
+ _request = new Request(platform.origin, {
3428
+ method: 'POST',
3429
+ body: body
3430
+ });
3431
+ _context2.next = 8;
3432
+ return _request.arrayBuffer();
3400
3433
  case 8:
3434
+ return _context2.abrupt("return", _context2.sent.byteLength);
3435
+ case 9:
3401
3436
  if (!(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body))) {
3402
- _context2.next = 10;
3437
+ _context2.next = 11;
3403
3438
  break;
3404
3439
  }
3405
3440
  return _context2.abrupt("return", body.byteLength);
3406
- case 10:
3441
+ case 11:
3407
3442
  if (utils$1.isURLSearchParams(body)) {
3408
3443
  body = body + '';
3409
3444
  }
3410
3445
  if (!utils$1.isString(body)) {
3411
- _context2.next = 15;
3446
+ _context2.next = 16;
3412
3447
  break;
3413
3448
  }
3414
- _context2.next = 14;
3449
+ _context2.next = 15;
3415
3450
  return encodeText(body);
3416
- case 14:
3417
- return _context2.abrupt("return", _context2.sent.byteLength);
3418
3451
  case 15:
3452
+ return _context2.abrupt("return", _context2.sent.byteLength);
3453
+ case 16:
3419
3454
  case "end":
3420
3455
  return _context2.stop();
3421
3456
  }
@@ -3445,18 +3480,15 @@
3445
3480
  }();
3446
3481
  var fetchAdapter = isFetchSupported && ( /*#__PURE__*/function () {
3447
3482
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(config) {
3448
- var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, _ref5, _ref6, composedSignal, stopTimeout, finished, request, onFinish, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, response, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, responseData;
3483
+ var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, response, isStreamResponse, options, responseContentLength, _ref5, _ref6, _onProgress, _flush, responseData;
3449
3484
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3450
3485
  while (1) switch (_context4.prev = _context4.next) {
3451
3486
  case 0:
3452
3487
  _resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
3453
3488
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
3454
- _ref5 = signal || cancelToken || timeout ? composeSignals$1([signal, cancelToken], timeout) : [], _ref6 = _slicedToArray(_ref5, 2), composedSignal = _ref6[0], stopTimeout = _ref6[1];
3455
- onFinish = function onFinish() {
3456
- !finished && setTimeout(function () {
3457
- composedSignal && composedSignal.unsubscribe();
3458
- });
3459
- finished = true;
3489
+ composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
3490
+ unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
3491
+ composedSignal.unsubscribe();
3460
3492
  };
3461
3493
  _context4.prev = 4;
3462
3494
  _context4.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head';
@@ -3484,44 +3516,47 @@
3484
3516
  }
3485
3517
  if (_request.body) {
3486
3518
  _progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
3487
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
3519
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3488
3520
  }
3489
3521
  case 15:
3490
3522
  if (!utils$1.isString(withCredentials)) {
3491
3523
  withCredentials = withCredentials ? 'include' : 'omit';
3492
3524
  }
3525
+
3526
+ // Cloudflare Workers throws when credentials are defined
3527
+ // see https://github.com/cloudflare/workerd/issues/902
3528
+ isCredentialsSupported = "credentials" in Request.prototype;
3493
3529
  request = new Request(url, _objectSpread2(_objectSpread2({}, fetchOptions), {}, {
3494
3530
  signal: composedSignal,
3495
3531
  method: method.toUpperCase(),
3496
3532
  headers: headers.normalize().toJSON(),
3497
3533
  body: data,
3498
3534
  duplex: "half",
3499
- credentials: withCredentials
3535
+ credentials: isCredentialsSupported ? withCredentials : undefined
3500
3536
  }));
3501
- _context4.next = 19;
3502
- return fetch(request);
3503
- case 19:
3537
+ _context4.next = 20;
3538
+ return fetch(request, fetchOptions);
3539
+ case 20:
3504
3540
  response = _context4.sent;
3505
3541
  isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3506
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
3542
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
3507
3543
  options = {};
3508
3544
  ['status', 'statusText', 'headers'].forEach(function (prop) {
3509
3545
  options[prop] = response[prop];
3510
3546
  });
3511
3547
  responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3512
- _ref7 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref8 = _slicedToArray(_ref7, 2), _onProgress = _ref8[0], _flush = _ref8[1];
3548
+ _ref5 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref6 = _slicedToArray(_ref5, 2), _onProgress = _ref6[0], _flush = _ref6[1];
3513
3549
  response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
3514
3550
  _flush && _flush();
3515
- isStreamResponse && onFinish();
3516
- }, encodeText), options);
3551
+ unsubscribe && unsubscribe();
3552
+ }), options);
3517
3553
  }
3518
3554
  responseType = responseType || 'text';
3519
- _context4.next = 25;
3555
+ _context4.next = 26;
3520
3556
  return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
3521
- case 25:
3557
+ case 26:
3522
3558
  responseData = _context4.sent;
3523
- !isStreamResponse && onFinish();
3524
- stopTimeout && stopTimeout();
3559
+ !isStreamResponse && unsubscribe && unsubscribe();
3525
3560
  _context4.next = 30;
3526
3561
  return new Promise(function (resolve, reject) {
3527
3562
  settle(resolve, reject, {
@@ -3538,8 +3573,8 @@
3538
3573
  case 33:
3539
3574
  _context4.prev = 33;
3540
3575
  _context4.t2 = _context4["catch"](4);
3541
- onFinish();
3542
- if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /fetch/i.test(_context4.t2.message))) {
3576
+ unsubscribe && unsubscribe();
3577
+ if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) {
3543
3578
  _context4.next = 38;
3544
3579
  break;
3545
3580
  }
@@ -3676,7 +3711,7 @@
3676
3711
  });
3677
3712
  }
3678
3713
 
3679
- var VERSION = "1.7.4";
3714
+ var VERSION = "1.11.0";
3680
3715
 
3681
3716
  var validators$1 = {};
3682
3717
 
@@ -3715,6 +3750,13 @@
3715
3750
  return validator ? validator(value, opt, opts) : true;
3716
3751
  };
3717
3752
  };
3753
+ validators$1.spelling = function spelling(correctSpelling) {
3754
+ return function (value, opt) {
3755
+ // eslint-disable-next-line no-console
3756
+ console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling));
3757
+ return true;
3758
+ };
3759
+ };
3718
3760
 
3719
3761
  /**
3720
3762
  * Assert object's properties type
@@ -3765,7 +3807,7 @@
3765
3807
  var Axios = /*#__PURE__*/function () {
3766
3808
  function Axios(instanceConfig) {
3767
3809
  _classCallCheck(this, Axios);
3768
- this.defaults = instanceConfig;
3810
+ this.defaults = instanceConfig || {};
3769
3811
  this.interceptors = {
3770
3812
  request: new InterceptorManager$1(),
3771
3813
  response: new InterceptorManager$1()
@@ -3797,7 +3839,8 @@
3797
3839
  _context.prev = 6;
3798
3840
  _context.t0 = _context["catch"](0);
3799
3841
  if (_context.t0 instanceof Error) {
3800
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
3842
+ dummy = {};
3843
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
3801
3844
 
3802
3845
  // slice off the Error: ... line
3803
3846
  stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -3860,6 +3903,17 @@
3860
3903
  }
3861
3904
  }
3862
3905
 
3906
+ // Set config.allowAbsoluteUrls
3907
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3908
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3909
+ } else {
3910
+ config.allowAbsoluteUrls = true;
3911
+ }
3912
+ validator.assertOptions(config, {
3913
+ baseUrl: validators.spelling('baseURL'),
3914
+ withXsrfToken: validators.spelling('withXSRFToken')
3915
+ }, true);
3916
+
3863
3917
  // Set config.method
3864
3918
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3865
3919
 
@@ -3927,7 +3981,7 @@
3927
3981
  key: "getUri",
3928
3982
  value: function getUri(config) {
3929
3983
  config = mergeConfig(this.defaults, config);
3930
- var fullPath = buildFullPath(config.baseURL, config.url);
3984
+ var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3931
3985
  return buildURL(fullPath, config.params, config.paramsSerializer);
3932
3986
  }
3933
3987
  }]);
@@ -4057,6 +4111,20 @@
4057
4111
  this._listeners.splice(index, 1);
4058
4112
  }
4059
4113
  }
4114
+ }, {
4115
+ key: "toAbortSignal",
4116
+ value: function toAbortSignal() {
4117
+ var _this = this;
4118
+ var controller = new AbortController();
4119
+ var abort = function abort(err) {
4120
+ controller.abort(err);
4121
+ };
4122
+ this.subscribe(abort);
4123
+ controller.signal.unsubscribe = function () {
4124
+ return _this.unsubscribe(abort);
4125
+ };
4126
+ return controller.signal;
4127
+ }
4060
4128
 
4061
4129
  /**
4062
4130
  * Returns an object that contains a new `CancelToken` and a function that, when called,