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

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 (62) hide show
  1. package/.jsii +211 -62
  2. package/.mergify.yml +60 -0
  3. package/cdk-iam-policy-builder-helper/go.mod +13 -0
  4. package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/jsii/jsii.go +2 -2
  5. package/cdk-iam-policy-builder-helper/version +1 -0
  6. package/lib/bin/download-actions-json.js +3 -7
  7. package/lib/constructs/Actions.d.ts +800 -61
  8. package/lib/constructs/Actions.js +801 -62
  9. package/lib/constructs/ManagedPolicies.d.ts +248 -40
  10. package/lib/constructs/ManagedPolicies.js +249 -41
  11. package/methods_list.txt +19274 -0
  12. package/node_modules/axios/CHANGELOG.md +257 -0
  13. package/node_modules/axios/README.md +71 -87
  14. package/node_modules/axios/dist/axios.js +303 -235
  15. package/node_modules/axios/dist/axios.js.map +1 -1
  16. package/node_modules/axios/dist/axios.min.js +2 -1
  17. package/node_modules/axios/dist/axios.min.js.map +1 -1
  18. package/node_modules/axios/dist/browser/axios.cjs +230 -177
  19. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  20. package/node_modules/axios/dist/esm/axios.js +230 -177
  21. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  22. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  23. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  24. package/node_modules/axios/dist/node/axios.cjs +268 -187
  25. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  26. package/node_modules/axios/index.d.cts +22 -6
  27. package/node_modules/axios/index.d.ts +14 -4
  28. package/node_modules/axios/lib/adapters/fetch.js +22 -22
  29. package/node_modules/axios/lib/adapters/http.js +7 -7
  30. package/node_modules/axios/lib/cancel/CancelToken.js +14 -0
  31. package/node_modules/axios/lib/core/Axios.js +20 -6
  32. package/node_modules/axios/lib/core/AxiosError.js +5 -2
  33. package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
  34. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  35. package/node_modules/axios/lib/core/mergeConfig.js +6 -6
  36. package/node_modules/axios/lib/env/data.js +1 -1
  37. package/node_modules/axios/lib/helpers/buildURL.js +7 -1
  38. package/node_modules/axios/lib/helpers/composeSignals.js +31 -29
  39. package/node_modules/axios/lib/helpers/formDataToStream.js +6 -5
  40. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +12 -65
  41. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  42. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  43. package/node_modules/axios/lib/helpers/toFormData.js +4 -0
  44. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  45. package/node_modules/axios/lib/helpers/trackStream.js +25 -5
  46. package/node_modules/axios/lib/helpers/validator.js +8 -0
  47. package/node_modules/axios/lib/platform/common/utils.js +5 -4
  48. package/node_modules/axios/lib/platform/node/index.js +26 -0
  49. package/node_modules/axios/lib/utils.js +48 -28
  50. package/node_modules/axios/package.json +14 -5
  51. package/node_modules/form-data/CHANGELOG.md +601 -0
  52. package/node_modules/form-data/{Readme.md → README.md} +34 -37
  53. package/node_modules/form-data/lib/browser.js +3 -1
  54. package/node_modules/form-data/lib/form_data.js +126 -135
  55. package/node_modules/form-data/lib/populate.js +5 -5
  56. package/node_modules/form-data/package.json +24 -16
  57. package/package.json +16 -10
  58. package/jjrawlinscdkiampolicybuilderhelper/go.mod +0 -13
  59. package/jjrawlinscdkiampolicybuilderhelper/version +0 -1
  60. package/node_modules/axios/SECURITY.md +0 -6
  61. /package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/LICENSE +0 -0
  62. /package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/README.md +0 -0
@@ -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 bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -9,6 +9,7 @@ function bind(fn, thisArg) {
9
9
 
10
10
  const {toString} = Object.prototype;
11
11
  const {getPrototypeOf} = Object;
12
+ const {iterator, toStringTag} = Symbol;
12
13
 
13
14
  const kindOf = (cache => thing => {
14
15
  const str = toString.call(thing);
@@ -135,7 +136,28 @@ const isPlainObject = (val) => {
135
136
  }
136
137
 
137
138
  const prototype = getPrototypeOf(val);
138
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
139
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
140
+ };
141
+
142
+ /**
143
+ * Determine if a value is an empty object (safely handles Buffers)
144
+ *
145
+ * @param {*} val The value to test
146
+ *
147
+ * @returns {boolean} True if value is an empty object, otherwise false
148
+ */
149
+ const isEmptyObject = (val) => {
150
+ // Early return for non-objects or Buffers to prevent RangeError
151
+ if (!isObject(val) || isBuffer(val)) {
152
+ return false;
153
+ }
154
+
155
+ try {
156
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
157
+ } catch (e) {
158
+ // Fallback for any other objects that might cause RangeError with Object.keys()
159
+ return false;
160
+ }
139
161
  };
140
162
 
141
163
  /**
@@ -260,6 +282,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
260
282
  fn.call(null, obj[i], i, obj);
261
283
  }
262
284
  } else {
285
+ // Buffer check
286
+ if (isBuffer(obj)) {
287
+ return;
288
+ }
289
+
263
290
  // Iterate over object keys
264
291
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
265
292
  const len = keys.length;
@@ -273,6 +300,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
273
300
  }
274
301
 
275
302
  function findKey(obj, key) {
303
+ if (isBuffer(obj)){
304
+ return null;
305
+ }
306
+
276
307
  key = key.toLowerCase();
277
308
  const keys = Object.keys(obj);
278
309
  let i = keys.length;
@@ -486,13 +517,13 @@ const isTypedArray = (TypedArray => {
486
517
  * @returns {void}
487
518
  */
488
519
  const forEachEntry = (obj, fn) => {
489
- const generator = obj && obj[Symbol.iterator];
520
+ const generator = obj && obj[iterator];
490
521
 
491
- const iterator = generator.call(obj);
522
+ const _iterator = generator.call(obj);
492
523
 
493
524
  let result;
494
525
 
495
- while ((result = iterator.next()) && !result.done) {
526
+ while ((result = _iterator.next()) && !result.done) {
496
527
  const pair = result.value;
497
528
  fn.call(obj, pair[0], pair[1]);
498
529
  }
@@ -605,26 +636,6 @@ const toFiniteNumber = (value, defaultValue) => {
605
636
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
606
637
  };
607
638
 
608
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
609
-
610
- const DIGIT = '0123456789';
611
-
612
- const ALPHABET = {
613
- DIGIT,
614
- ALPHA,
615
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
616
- };
617
-
618
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
619
- let str = '';
620
- const {length} = alphabet;
621
- while (size--) {
622
- str += alphabet[Math.random() * length|0];
623
- }
624
-
625
- return str;
626
- };
627
-
628
639
  /**
629
640
  * If the thing is a FormData object, return true, otherwise return false.
630
641
  *
@@ -633,7 +644,7 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
633
644
  * @returns {boolean}
634
645
  */
635
646
  function isSpecCompliantForm(thing) {
636
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
647
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
637
648
  }
638
649
 
639
650
  const toJSONObject = (obj) => {
@@ -646,6 +657,11 @@ const toJSONObject = (obj) => {
646
657
  return;
647
658
  }
648
659
 
660
+ //Buffer check
661
+ if (isBuffer(source)) {
662
+ return source;
663
+ }
664
+
649
665
  if(!('toJSON' in source)) {
650
666
  stack[i] = source;
651
667
  const target = isArray(source) ? [] : {};
@@ -702,6 +718,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
702
718
 
703
719
  // *********************
704
720
 
721
+
722
+ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
723
+
724
+
705
725
  const utils$1 = {
706
726
  isArray,
707
727
  isArrayBuffer,
@@ -713,6 +733,7 @@ const utils$1 = {
713
733
  isBoolean,
714
734
  isObject,
715
735
  isPlainObject,
736
+ isEmptyObject,
716
737
  isReadableStream,
717
738
  isRequest,
718
739
  isResponse,
@@ -752,14 +773,13 @@ const utils$1 = {
752
773
  findKey,
753
774
  global: _global,
754
775
  isContextDefined,
755
- ALPHABET,
756
- generateString,
757
776
  isSpecCompliantForm,
758
777
  toJSONObject,
759
778
  isAsyncFn,
760
779
  isThenable,
761
780
  setImmediate: _setImmediate,
762
- asap
781
+ asap,
782
+ isIterable
763
783
  };
764
784
 
765
785
  /**
@@ -787,7 +807,10 @@ function AxiosError$1(message, code, config, request, response) {
787
807
  code && (this.code = code);
788
808
  config && (this.config = config);
789
809
  request && (this.request = request);
790
- response && (this.response = response);
810
+ if (response) {
811
+ this.response = response;
812
+ this.status = response.status ? response.status : null;
813
+ }
791
814
  }
792
815
 
793
816
  utils$1.inherits(AxiosError$1, Error, {
@@ -807,7 +830,7 @@ utils$1.inherits(AxiosError$1, Error, {
807
830
  // Axios
808
831
  config: utils$1.toJSONObject(this.config),
809
832
  code: this.code,
810
- status: this.response && this.response.status ? this.response.status : null
833
+ status: this.status
811
834
  };
812
835
  }
813
836
  });
@@ -975,6 +998,10 @@ function toFormData$1(obj, formData, options) {
975
998
  return value.toISOString();
976
999
  }
977
1000
 
1001
+ if (utils$1.isBoolean(value)) {
1002
+ return value.toString();
1003
+ }
1004
+
978
1005
  if (!useBlob && utils$1.isBlob(value)) {
979
1006
  throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
980
1007
  }
@@ -1147,7 +1174,7 @@ function encode(val) {
1147
1174
  *
1148
1175
  * @param {string} url The base of the url (e.g., http://www.google.com)
1149
1176
  * @param {object} [params] The params to be appended
1150
- * @param {?object} options
1177
+ * @param {?(object|Function)} options
1151
1178
  *
1152
1179
  * @returns {string} The formatted url
1153
1180
  */
@@ -1159,6 +1186,12 @@ function buildURL(url, params, options) {
1159
1186
 
1160
1187
  const _encode = options && options.encode || encode;
1161
1188
 
1189
+ if (utils$1.isFunction(options)) {
1190
+ options = {
1191
+ serialize: options
1192
+ };
1193
+ }
1194
+
1162
1195
  const serializeFn = options && options.serialize;
1163
1196
 
1164
1197
  let serializedParams;
@@ -1275,6 +1308,8 @@ const platform$1 = {
1275
1308
 
1276
1309
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1277
1310
 
1311
+ const _navigator = typeof navigator === 'object' && navigator || undefined;
1312
+
1278
1313
  /**
1279
1314
  * Determine if we're running in a standard browser environment
1280
1315
  *
@@ -1292,10 +1327,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
1292
1327
  *
1293
1328
  * @returns {boolean}
1294
1329
  */
1295
- const hasStandardBrowserEnv = (
1296
- (product) => {
1297
- return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
1298
- })(typeof navigator !== 'undefined' && navigator.product);
1330
+ const hasStandardBrowserEnv = hasBrowserEnv &&
1331
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1299
1332
 
1300
1333
  /**
1301
1334
  * Determine if we're running in a standard browser webWorker environment
@@ -1322,6 +1355,7 @@ const utils = /*#__PURE__*/Object.freeze({
1322
1355
  hasBrowserEnv: hasBrowserEnv,
1323
1356
  hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1324
1357
  hasStandardBrowserEnv: hasStandardBrowserEnv,
1358
+ navigator: _navigator,
1325
1359
  origin: origin
1326
1360
  });
1327
1361
 
@@ -1331,7 +1365,7 @@ const platform = {
1331
1365
  };
1332
1366
 
1333
1367
  function toURLEncodedForm(data, options) {
1334
- return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
1368
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
1335
1369
  visitor: function(value, key, path, helpers) {
1336
1370
  if (platform.isNode && utils$1.isBuffer(value)) {
1337
1371
  this.append(key, value.toString('base64'));
@@ -1339,8 +1373,9 @@ function toURLEncodedForm(data, options) {
1339
1373
  }
1340
1374
 
1341
1375
  return helpers.defaultVisitor.apply(this, arguments);
1342
- }
1343
- }, options));
1376
+ },
1377
+ ...options
1378
+ });
1344
1379
  }
1345
1380
 
1346
1381
  /**
@@ -1734,10 +1769,18 @@ class AxiosHeaders$1 {
1734
1769
  setHeaders(header, valueOrRewrite);
1735
1770
  } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1736
1771
  setHeaders(parseHeaders(header), valueOrRewrite);
1737
- } else if (utils$1.isHeaders(header)) {
1738
- for (const [key, value] of header.entries()) {
1739
- setHeader(value, key, rewrite);
1772
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1773
+ let obj = {}, dest, key;
1774
+ for (const entry of header) {
1775
+ if (!utils$1.isArray(entry)) {
1776
+ throw TypeError('Object iterator must return a key-value pair');
1777
+ }
1778
+
1779
+ obj[key = entry[0]] = (dest = obj[key]) ?
1780
+ (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
1740
1781
  }
1782
+
1783
+ setHeaders(obj, valueOrRewrite);
1741
1784
  } else {
1742
1785
  header != null && setHeader(valueOrRewrite, header, rewrite);
1743
1786
  }
@@ -1879,6 +1922,10 @@ class AxiosHeaders$1 {
1879
1922
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
1880
1923
  }
1881
1924
 
1925
+ getSetCookie() {
1926
+ return this.get("set-cookie") || [];
1927
+ }
1928
+
1882
1929
  get [Symbol.toStringTag]() {
1883
1930
  return 'AxiosHeaders';
1884
1931
  }
@@ -2081,7 +2128,7 @@ function throttle(fn, freq) {
2081
2128
  clearTimeout(timer);
2082
2129
  timer = null;
2083
2130
  }
2084
- fn.apply(null, args);
2131
+ fn(...args);
2085
2132
  };
2086
2133
 
2087
2134
  const throttled = (...args) => {
@@ -2146,68 +2193,18 @@ const progressEventDecorator = (total, throttled) => {
2146
2193
 
2147
2194
  const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2148
2195
 
2149
- const isURLSameOrigin = platform.hasStandardBrowserEnv ?
2150
-
2151
- // Standard browser envs have full support of the APIs needed to test
2152
- // whether the request URL is of the same origin as current location.
2153
- (function standardBrowserEnv() {
2154
- const msie = /(msie|trident)/i.test(navigator.userAgent);
2155
- const urlParsingNode = document.createElement('a');
2156
- let originURL;
2157
-
2158
- /**
2159
- * Parse a URL to discover its components
2160
- *
2161
- * @param {String} url The URL to be parsed
2162
- * @returns {Object}
2163
- */
2164
- function resolveURL(url) {
2165
- let href = url;
2166
-
2167
- if (msie) {
2168
- // IE needs attribute set twice to normalize properties
2169
- urlParsingNode.setAttribute('href', href);
2170
- href = urlParsingNode.href;
2171
- }
2172
-
2173
- urlParsingNode.setAttribute('href', href);
2174
-
2175
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2176
- return {
2177
- href: urlParsingNode.href,
2178
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2179
- host: urlParsingNode.host,
2180
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2181
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2182
- hostname: urlParsingNode.hostname,
2183
- port: urlParsingNode.port,
2184
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2185
- urlParsingNode.pathname :
2186
- '/' + urlParsingNode.pathname
2187
- };
2188
- }
2196
+ const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
2197
+ url = new URL(url, platform.origin);
2189
2198
 
2190
- originURL = resolveURL(window.location.href);
2191
-
2192
- /**
2193
- * Determine if a URL shares the same origin as the current location
2194
- *
2195
- * @param {String} requestURL The URL to test
2196
- * @returns {boolean} True if URL shares the same origin, otherwise false
2197
- */
2198
- return function isURLSameOrigin(requestURL) {
2199
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2200
- return (parsed.protocol === originURL.protocol &&
2201
- parsed.host === originURL.host);
2202
- };
2203
- })() :
2204
-
2205
- // Non standard browser envs (web workers, react-native) lack needed support.
2206
- (function nonStandardBrowserEnv() {
2207
- return function isURLSameOrigin() {
2208
- return true;
2209
- };
2210
- })();
2199
+ return (
2200
+ origin.protocol === url.protocol &&
2201
+ origin.host === url.host &&
2202
+ (isMSIE || origin.port === url.port)
2203
+ );
2204
+ })(
2205
+ new URL(platform.origin),
2206
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
2207
+ ) : () => true;
2211
2208
 
2212
2209
  const cookies = platform.hasStandardBrowserEnv ?
2213
2210
 
@@ -2286,8 +2283,9 @@ function combineURLs(baseURL, relativeURL) {
2286
2283
  *
2287
2284
  * @returns {string} The combined full path
2288
2285
  */
2289
- function buildFullPath(baseURL, requestedURL) {
2290
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2286
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2287
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
2288
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2291
2289
  return combineURLs(baseURL, requestedURL);
2292
2290
  }
2293
2291
  return requestedURL;
@@ -2309,7 +2307,7 @@ function mergeConfig$1(config1, config2) {
2309
2307
  config2 = config2 || {};
2310
2308
  const config = {};
2311
2309
 
2312
- function getMergedValue(target, source, caseless) {
2310
+ function getMergedValue(target, source, prop, caseless) {
2313
2311
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2314
2312
  return utils$1.merge.call({caseless}, target, source);
2315
2313
  } else if (utils$1.isPlainObject(source)) {
@@ -2321,11 +2319,11 @@ function mergeConfig$1(config1, config2) {
2321
2319
  }
2322
2320
 
2323
2321
  // eslint-disable-next-line consistent-return
2324
- function mergeDeepProperties(a, b, caseless) {
2322
+ function mergeDeepProperties(a, b, prop , caseless) {
2325
2323
  if (!utils$1.isUndefined(b)) {
2326
- return getMergedValue(a, b, caseless);
2324
+ return getMergedValue(a, b, prop , caseless);
2327
2325
  } else if (!utils$1.isUndefined(a)) {
2328
- return getMergedValue(undefined, a, caseless);
2326
+ return getMergedValue(undefined, a, prop , caseless);
2329
2327
  }
2330
2328
  }
2331
2329
 
@@ -2383,10 +2381,10 @@ function mergeConfig$1(config1, config2) {
2383
2381
  socketPath: defaultToConfig2,
2384
2382
  responseEncoding: defaultToConfig2,
2385
2383
  validateStatus: mergeDirectKeys,
2386
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2384
+ headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
2387
2385
  };
2388
2386
 
2389
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2387
+ utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
2390
2388
  const merge = mergeMap[prop] || mergeDeepProperties;
2391
2389
  const configValue = merge(config1[prop], config2[prop], prop);
2392
2390
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -2402,7 +2400,7 @@ const resolveConfig = (config) => {
2402
2400
 
2403
2401
  newConfig.headers = headers = AxiosHeaders$2.from(headers);
2404
2402
 
2405
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
2403
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2406
2404
 
2407
2405
  // HTTP basic authentication
2408
2406
  if (auth) {
@@ -2631,45 +2629,46 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
2631
2629
  };
2632
2630
 
2633
2631
  const composeSignals = (signals, timeout) => {
2634
- let controller = new AbortController();
2632
+ const {length} = (signals = signals ? signals.filter(Boolean) : []);
2635
2633
 
2636
- let aborted;
2634
+ if (timeout || length) {
2635
+ let controller = new AbortController();
2637
2636
 
2638
- const onabort = function (cancel) {
2639
- if (!aborted) {
2640
- aborted = true;
2641
- unsubscribe();
2642
- const err = cancel instanceof Error ? cancel : this.reason;
2643
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2644
- }
2645
- };
2637
+ let aborted;
2646
2638
 
2647
- let timer = timeout && setTimeout(() => {
2648
- onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
2649
- }, timeout);
2639
+ const onabort = function (reason) {
2640
+ if (!aborted) {
2641
+ aborted = true;
2642
+ unsubscribe();
2643
+ const err = reason instanceof Error ? reason : this.reason;
2644
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2645
+ }
2646
+ };
2650
2647
 
2651
- const unsubscribe = () => {
2652
- if (signals) {
2653
- timer && clearTimeout(timer);
2648
+ let timer = timeout && setTimeout(() => {
2654
2649
  timer = null;
2655
- signals.forEach(signal => {
2656
- signal &&
2657
- (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
2658
- });
2659
- signals = null;
2660
- }
2661
- };
2650
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
2651
+ }, timeout);
2652
+
2653
+ const unsubscribe = () => {
2654
+ if (signals) {
2655
+ timer && clearTimeout(timer);
2656
+ timer = null;
2657
+ signals.forEach(signal => {
2658
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
2659
+ });
2660
+ signals = null;
2661
+ }
2662
+ };
2662
2663
 
2663
- signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
2664
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
2664
2665
 
2665
- const {signal} = controller;
2666
+ const {signal} = controller;
2666
2667
 
2667
- signal.unsubscribe = unsubscribe;
2668
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
2668
2669
 
2669
- return [signal, () => {
2670
- timer && clearTimeout(timer);
2671
- timer = null;
2672
- }];
2670
+ return signal;
2671
+ }
2673
2672
  };
2674
2673
 
2675
2674
  const composeSignals$1 = composeSignals;
@@ -2692,14 +2691,34 @@ const streamChunk = function* (chunk, chunkSize) {
2692
2691
  }
2693
2692
  };
2694
2693
 
2695
- const readBytes = async function* (iterable, chunkSize, encode) {
2696
- for await (const chunk of iterable) {
2697
- yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
2694
+ const readBytes = async function* (iterable, chunkSize) {
2695
+ for await (const chunk of readStream(iterable)) {
2696
+ yield* streamChunk(chunk, chunkSize);
2698
2697
  }
2699
2698
  };
2700
2699
 
2701
- const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
2702
- const iterator = readBytes(stream, chunkSize, encode);
2700
+ const readStream = async function* (stream) {
2701
+ if (stream[Symbol.asyncIterator]) {
2702
+ yield* stream;
2703
+ return;
2704
+ }
2705
+
2706
+ const reader = stream.getReader();
2707
+ try {
2708
+ for (;;) {
2709
+ const {done, value} = await reader.read();
2710
+ if (done) {
2711
+ break;
2712
+ }
2713
+ yield value;
2714
+ }
2715
+ } finally {
2716
+ await reader.cancel();
2717
+ }
2718
+ };
2719
+
2720
+ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
2721
+ const iterator = readBytes(stream, chunkSize);
2703
2722
 
2704
2723
  let bytes = 0;
2705
2724
  let done;
@@ -2802,7 +2821,11 @@ const getBodyLength = async (body) => {
2802
2821
  }
2803
2822
 
2804
2823
  if(utils$1.isSpecCompliantForm(body)) {
2805
- return (await new Request(body).arrayBuffer()).byteLength;
2824
+ const _request = new Request(platform.origin, {
2825
+ method: 'POST',
2826
+ body,
2827
+ });
2828
+ return (await _request.arrayBuffer()).byteLength;
2806
2829
  }
2807
2830
 
2808
2831
  if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
@@ -2842,18 +2865,13 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2842
2865
 
2843
2866
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
2844
2867
 
2845
- let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
2846
- composeSignals$1([signal, cancelToken], timeout) : [];
2847
-
2848
- let finished, request;
2868
+ let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
2849
2869
 
2850
- const onFinish = () => {
2851
- !finished && setTimeout(() => {
2852
- composedSignal && composedSignal.unsubscribe();
2853
- });
2870
+ let request;
2854
2871
 
2855
- finished = true;
2856
- };
2872
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
2873
+ composedSignal.unsubscribe();
2874
+ });
2857
2875
 
2858
2876
  let requestContentLength;
2859
2877
 
@@ -2880,7 +2898,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2880
2898
  progressEventReducer(asyncDecorator(onUploadProgress))
2881
2899
  );
2882
2900
 
2883
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
2901
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
2884
2902
  }
2885
2903
  }
2886
2904
 
@@ -2888,6 +2906,9 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2888
2906
  withCredentials = withCredentials ? 'include' : 'omit';
2889
2907
  }
2890
2908
 
2909
+ // Cloudflare Workers throws when credentials are defined
2910
+ // see https://github.com/cloudflare/workerd/issues/902
2911
+ const isCredentialsSupported = "credentials" in Request.prototype;
2891
2912
  request = new Request(url, {
2892
2913
  ...fetchOptions,
2893
2914
  signal: composedSignal,
@@ -2895,14 +2916,14 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2895
2916
  headers: headers.normalize().toJSON(),
2896
2917
  body: data,
2897
2918
  duplex: "half",
2898
- credentials: withCredentials
2919
+ credentials: isCredentialsSupported ? withCredentials : undefined
2899
2920
  });
2900
2921
 
2901
- let response = await fetch(request);
2922
+ let response = await fetch(request, fetchOptions);
2902
2923
 
2903
2924
  const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
2904
2925
 
2905
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
2926
+ if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
2906
2927
  const options = {};
2907
2928
 
2908
2929
  ['status', 'statusText', 'headers'].forEach(prop => {
@@ -2919,8 +2940,8 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2919
2940
  response = new Response(
2920
2941
  trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
2921
2942
  flush && flush();
2922
- isStreamResponse && onFinish();
2923
- }, encodeText),
2943
+ unsubscribe && unsubscribe();
2944
+ }),
2924
2945
  options
2925
2946
  );
2926
2947
  }
@@ -2929,9 +2950,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2929
2950
 
2930
2951
  let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
2931
2952
 
2932
- !isStreamResponse && onFinish();
2933
-
2934
- stopTimeout && stopTimeout();
2953
+ !isStreamResponse && unsubscribe && unsubscribe();
2935
2954
 
2936
2955
  return await new Promise((resolve, reject) => {
2937
2956
  settle(resolve, reject, {
@@ -2944,9 +2963,9 @@ const fetchAdapter = isFetchSupported && (async (config) => {
2944
2963
  });
2945
2964
  })
2946
2965
  } catch (err) {
2947
- onFinish();
2966
+ unsubscribe && unsubscribe();
2948
2967
 
2949
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
2968
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
2950
2969
  throw Object.assign(
2951
2970
  new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
2952
2971
  {
@@ -3106,7 +3125,7 @@ function dispatchRequest(config) {
3106
3125
  });
3107
3126
  }
3108
3127
 
3109
- const VERSION$1 = "1.7.4";
3128
+ const VERSION$1 = "1.11.0";
3110
3129
 
3111
3130
  const validators$1 = {};
3112
3131
 
@@ -3157,6 +3176,14 @@ validators$1.transitional = function transitional(validator, version, message) {
3157
3176
  };
3158
3177
  };
3159
3178
 
3179
+ validators$1.spelling = function spelling(correctSpelling) {
3180
+ return (value, opt) => {
3181
+ // eslint-disable-next-line no-console
3182
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
3183
+ return true;
3184
+ }
3185
+ };
3186
+
3160
3187
  /**
3161
3188
  * Assert object's properties type
3162
3189
  *
@@ -3206,7 +3233,7 @@ const validators = validator.validators;
3206
3233
  */
3207
3234
  class Axios$1 {
3208
3235
  constructor(instanceConfig) {
3209
- this.defaults = instanceConfig;
3236
+ this.defaults = instanceConfig || {};
3210
3237
  this.interceptors = {
3211
3238
  request: new InterceptorManager$1(),
3212
3239
  response: new InterceptorManager$1()
@@ -3226,9 +3253,9 @@ class Axios$1 {
3226
3253
  return await this._request(configOrUrl, config);
3227
3254
  } catch (err) {
3228
3255
  if (err instanceof Error) {
3229
- let dummy;
3256
+ let dummy = {};
3230
3257
 
3231
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
3258
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
3232
3259
 
3233
3260
  // slice off the Error: ... line
3234
3261
  const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -3283,6 +3310,18 @@ class Axios$1 {
3283
3310
  }
3284
3311
  }
3285
3312
 
3313
+ // Set config.allowAbsoluteUrls
3314
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3315
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3316
+ } else {
3317
+ config.allowAbsoluteUrls = true;
3318
+ }
3319
+
3320
+ validator.assertOptions(config, {
3321
+ baseUrl: validators.spelling('baseURL'),
3322
+ withXsrfToken: validators.spelling('withXSRFToken')
3323
+ }, true);
3324
+
3286
3325
  // Set config.method
3287
3326
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3288
3327
 
@@ -3325,8 +3364,8 @@ class Axios$1 {
3325
3364
 
3326
3365
  if (!synchronousRequestInterceptors) {
3327
3366
  const chain = [dispatchRequest.bind(this), undefined];
3328
- chain.unshift.apply(chain, requestInterceptorChain);
3329
- chain.push.apply(chain, responseInterceptorChain);
3367
+ chain.unshift(...requestInterceptorChain);
3368
+ chain.push(...responseInterceptorChain);
3330
3369
  len = chain.length;
3331
3370
 
3332
3371
  promise = Promise.resolve(config);
@@ -3373,7 +3412,7 @@ class Axios$1 {
3373
3412
 
3374
3413
  getUri(config) {
3375
3414
  config = mergeConfig$1(this.defaults, config);
3376
- const fullPath = buildFullPath(config.baseURL, config.url);
3415
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3377
3416
  return buildURL(fullPath, config.params, config.paramsSerializer);
3378
3417
  }
3379
3418
  }
@@ -3513,6 +3552,20 @@ class CancelToken$1 {
3513
3552
  }
3514
3553
  }
3515
3554
 
3555
+ toAbortSignal() {
3556
+ const controller = new AbortController();
3557
+
3558
+ const abort = (err) => {
3559
+ controller.abort(err);
3560
+ };
3561
+
3562
+ this.subscribe(abort);
3563
+
3564
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
3565
+
3566
+ return controller.signal;
3567
+ }
3568
+
3516
3569
  /**
3517
3570
  * Returns an object that contains a new `CancelToken` and a function that, when called,
3518
3571
  * cancels the `CancelToken`.