@bigbinary/neeto-audit-frontend 2.3.1 → 2.4.1

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 (2) hide show
  1. package/dist/index.js +705 -385
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10,13 +10,14 @@ import require$$4 from 'process';
10
10
  import { readFile, mkdir, lstat, writeFile } from 'fs/promises';
11
11
  import require$$0$3 from 'assert';
12
12
  import require$$1$1 from 'tty';
13
- import require$$1$2 from 'util';
13
+ import util$3 from 'util';
14
14
  import require$$0$4 from 'os';
15
15
  import stream, { Readable } from 'stream';
16
16
  import require$$3$1 from 'http';
17
17
  import require$$4$1 from 'https';
18
18
  import require$$0$5 from 'url';
19
19
  import require$$8 from 'crypto';
20
+ import http2 from 'http2';
20
21
  import zlib from 'zlib';
21
22
 
22
23
  const ANSI_BACKGROUND_OFFSET = 10;
@@ -10942,7 +10943,7 @@ function requireNode () {
10942
10943
  hasRequiredNode = 1;
10943
10944
  (function (module, exports) {
10944
10945
  const tty = require$$1$1;
10945
- const util = require$$1$2;
10946
+ const util = util$3;
10946
10947
 
10947
10948
  /**
10948
10949
  * This is the Node.js implementation of `debug()`.
@@ -15414,7 +15415,7 @@ const REMOTE_URL_PREFIXES = [
15414
15415
  "github.com/neetozone/",
15415
15416
  ];
15416
15417
 
15417
- const run$1 = require$$1$2.promisify(exec);
15418
+ const run$1 = util$3.promisify(exec);
15418
15419
 
15419
15420
  const execute = async (command, debug) => {
15420
15421
  await run$1(command);
@@ -16176,6 +16177,13 @@ var widget = {
16176
16177
 
16177
16178
  var recommendedDependencies = { common, extension, frontend, nano, widget };
16178
16179
 
16180
+ /**
16181
+ * Create a bound version of a function with a specified `this` context
16182
+ *
16183
+ * @param {Function} fn - The function to bind
16184
+ * @param {*} thisArg - The value to be passed as the `this` parameter
16185
+ * @returns {Function} A new function that will call the original function with the specified `this` context
16186
+ */
16179
16187
  function bind$2(fn, thisArg) {
16180
16188
  return function wrap() {
16181
16189
  return fn.apply(thisArg, arguments);
@@ -16184,30 +16192,30 @@ function bind$2(fn, thisArg) {
16184
16192
 
16185
16193
  // utils is a library of generic helper functions non-specific to axios
16186
16194
 
16187
- const {toString} = Object.prototype;
16188
- const {getPrototypeOf} = Object;
16189
- const {iterator, toStringTag: toStringTag$1} = Symbol;
16195
+ const { toString } = Object.prototype;
16196
+ const { getPrototypeOf } = Object;
16197
+ const { iterator, toStringTag: toStringTag$1 } = Symbol;
16190
16198
 
16191
- const kindOf = (cache => thing => {
16192
- const str = toString.call(thing);
16193
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
16199
+ const kindOf = ((cache) => (thing) => {
16200
+ const str = toString.call(thing);
16201
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
16194
16202
  })(Object.create(null));
16195
16203
 
16196
16204
  const kindOfTest = (type) => {
16197
16205
  type = type.toLowerCase();
16198
- return (thing) => kindOf(thing) === type
16206
+ return (thing) => kindOf(thing) === type;
16199
16207
  };
16200
16208
 
16201
- const typeOfTest = type => thing => typeof thing === type;
16209
+ const typeOfTest = (type) => (thing) => typeof thing === type;
16202
16210
 
16203
16211
  /**
16204
- * Determine if a value is an Array
16212
+ * Determine if a value is a non-null object
16205
16213
  *
16206
16214
  * @param {Object} val The value to test
16207
16215
  *
16208
16216
  * @returns {boolean} True if value is an Array, otherwise false
16209
16217
  */
16210
- const {isArray} = Array;
16218
+ const { isArray } = Array;
16211
16219
 
16212
16220
  /**
16213
16221
  * Determine if a value is undefined
@@ -16216,7 +16224,7 @@ const {isArray} = Array;
16216
16224
  *
16217
16225
  * @returns {boolean} True if the value is undefined, otherwise false
16218
16226
  */
16219
- const isUndefined = typeOfTest('undefined');
16227
+ const isUndefined = typeOfTest("undefined");
16220
16228
 
16221
16229
  /**
16222
16230
  * Determine if a value is a Buffer
@@ -16226,8 +16234,14 @@ const isUndefined = typeOfTest('undefined');
16226
16234
  * @returns {boolean} True if value is a Buffer, otherwise false
16227
16235
  */
16228
16236
  function isBuffer$1(val) {
16229
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
16230
- && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
16237
+ return (
16238
+ val !== null &&
16239
+ !isUndefined(val) &&
16240
+ val.constructor !== null &&
16241
+ !isUndefined(val.constructor) &&
16242
+ isFunction$2(val.constructor.isBuffer) &&
16243
+ val.constructor.isBuffer(val)
16244
+ );
16231
16245
  }
16232
16246
 
16233
16247
  /**
@@ -16237,8 +16251,7 @@ function isBuffer$1(val) {
16237
16251
  *
16238
16252
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
16239
16253
  */
16240
- const isArrayBuffer = kindOfTest('ArrayBuffer');
16241
-
16254
+ const isArrayBuffer = kindOfTest("ArrayBuffer");
16242
16255
 
16243
16256
  /**
16244
16257
  * Determine if a value is a view on an ArrayBuffer
@@ -16249,10 +16262,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
16249
16262
  */
16250
16263
  function isArrayBufferView(val) {
16251
16264
  let result;
16252
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
16265
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
16253
16266
  result = ArrayBuffer.isView(val);
16254
16267
  } else {
16255
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
16268
+ result = val && val.buffer && isArrayBuffer(val.buffer);
16256
16269
  }
16257
16270
  return result;
16258
16271
  }
@@ -16264,7 +16277,7 @@ function isArrayBufferView(val) {
16264
16277
  *
16265
16278
  * @returns {boolean} True if value is a String, otherwise false
16266
16279
  */
16267
- const isString$1 = typeOfTest('string');
16280
+ const isString$1 = typeOfTest("string");
16268
16281
 
16269
16282
  /**
16270
16283
  * Determine if a value is a Function
@@ -16272,7 +16285,7 @@ const isString$1 = typeOfTest('string');
16272
16285
  * @param {*} val The value to test
16273
16286
  * @returns {boolean} True if value is a Function, otherwise false
16274
16287
  */
16275
- const isFunction$2 = typeOfTest('function');
16288
+ const isFunction$2 = typeOfTest("function");
16276
16289
 
16277
16290
  /**
16278
16291
  * Determine if a value is a Number
@@ -16281,7 +16294,7 @@ const isFunction$2 = typeOfTest('function');
16281
16294
  *
16282
16295
  * @returns {boolean} True if value is a Number, otherwise false
16283
16296
  */
16284
- const isNumber = typeOfTest('number');
16297
+ const isNumber = typeOfTest("number");
16285
16298
 
16286
16299
  /**
16287
16300
  * Determine if a value is an Object
@@ -16290,7 +16303,7 @@ const isNumber = typeOfTest('number');
16290
16303
  *
16291
16304
  * @returns {boolean} True if value is an Object, otherwise false
16292
16305
  */
16293
- const isObject = (thing) => thing !== null && typeof thing === 'object';
16306
+ const isObject = (thing) => thing !== null && typeof thing === "object";
16294
16307
 
16295
16308
  /**
16296
16309
  * Determine if a value is a Boolean
@@ -16298,7 +16311,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
16298
16311
  * @param {*} thing The value to test
16299
16312
  * @returns {boolean} True if value is a Boolean, otherwise false
16300
16313
  */
16301
- const isBoolean = thing => thing === true || thing === false;
16314
+ const isBoolean = (thing) => thing === true || thing === false;
16302
16315
 
16303
16316
  /**
16304
16317
  * Determine if a value is a plain Object
@@ -16308,12 +16321,18 @@ const isBoolean = thing => thing === true || thing === false;
16308
16321
  * @returns {boolean} True if value is a plain Object, otherwise false
16309
16322
  */
16310
16323
  const isPlainObject = (val) => {
16311
- if (kindOf(val) !== 'object') {
16324
+ if (kindOf(val) !== "object") {
16312
16325
  return false;
16313
16326
  }
16314
16327
 
16315
16328
  const prototype = getPrototypeOf(val);
16316
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag$1 in val) && !(iterator in val);
16329
+ return (
16330
+ (prototype === null ||
16331
+ prototype === Object.prototype ||
16332
+ Object.getPrototypeOf(prototype) === null) &&
16333
+ !(toStringTag$1 in val) &&
16334
+ !(iterator in val)
16335
+ );
16317
16336
  };
16318
16337
 
16319
16338
  /**
@@ -16330,7 +16349,10 @@ const isEmptyObject = (val) => {
16330
16349
  }
16331
16350
 
16332
16351
  try {
16333
- return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
16352
+ return (
16353
+ Object.keys(val).length === 0 &&
16354
+ Object.getPrototypeOf(val) === Object.prototype
16355
+ );
16334
16356
  } catch (e) {
16335
16357
  // Fallback for any other objects that might cause RangeError with Object.keys()
16336
16358
  return false;
@@ -16344,7 +16366,7 @@ const isEmptyObject = (val) => {
16344
16366
  *
16345
16367
  * @returns {boolean} True if value is a Date, otherwise false
16346
16368
  */
16347
- const isDate = kindOfTest('Date');
16369
+ const isDate = kindOfTest("Date");
16348
16370
 
16349
16371
  /**
16350
16372
  * Determine if a value is a File
@@ -16353,7 +16375,7 @@ const isDate = kindOfTest('Date');
16353
16375
  *
16354
16376
  * @returns {boolean} True if value is a File, otherwise false
16355
16377
  */
16356
- const isFile = kindOfTest('File');
16378
+ const isFile = kindOfTest("File");
16357
16379
 
16358
16380
  /**
16359
16381
  * Determine if a value is a Blob
@@ -16362,7 +16384,7 @@ const isFile = kindOfTest('File');
16362
16384
  *
16363
16385
  * @returns {boolean} True if value is a Blob, otherwise false
16364
16386
  */
16365
- const isBlob = kindOfTest('Blob');
16387
+ const isBlob = kindOfTest("Blob");
16366
16388
 
16367
16389
  /**
16368
16390
  * Determine if a value is a FileList
@@ -16371,7 +16393,7 @@ const isBlob = kindOfTest('Blob');
16371
16393
  *
16372
16394
  * @returns {boolean} True if value is a File, otherwise false
16373
16395
  */
16374
- const isFileList = kindOfTest('FileList');
16396
+ const isFileList = kindOfTest("FileList");
16375
16397
 
16376
16398
  /**
16377
16399
  * Determine if a value is a Stream
@@ -16391,15 +16413,16 @@ const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
16391
16413
  */
16392
16414
  const isFormData = (thing) => {
16393
16415
  let kind;
16394
- return thing && (
16395
- (typeof FormData === 'function' && thing instanceof FormData) || (
16396
- isFunction$2(thing.append) && (
16397
- (kind = kindOf(thing)) === 'formdata' ||
16398
- // detect form-data instance
16399
- (kind === 'object' && isFunction$2(thing.toString) && thing.toString() === '[object FormData]')
16400
- )
16401
- )
16402
- )
16416
+ return (
16417
+ thing &&
16418
+ ((typeof FormData === "function" && thing instanceof FormData) ||
16419
+ (isFunction$2(thing.append) &&
16420
+ ((kind = kindOf(thing)) === "formdata" ||
16421
+ // detect form-data instance
16422
+ (kind === "object" &&
16423
+ isFunction$2(thing.toString) &&
16424
+ thing.toString() === "[object FormData]"))))
16425
+ );
16403
16426
  };
16404
16427
 
16405
16428
  /**
@@ -16409,9 +16432,14 @@ const isFormData = (thing) => {
16409
16432
  *
16410
16433
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
16411
16434
  */
16412
- const isURLSearchParams = kindOfTest('URLSearchParams');
16435
+ const isURLSearchParams = kindOfTest("URLSearchParams");
16413
16436
 
16414
- const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
16437
+ const [isReadableStream, isRequest, isResponse, isHeaders] = [
16438
+ "ReadableStream",
16439
+ "Request",
16440
+ "Response",
16441
+ "Headers",
16442
+ ].map(kindOfTest);
16415
16443
 
16416
16444
  /**
16417
16445
  * Trim excess whitespace off the beginning and end of a string
@@ -16420,8 +16448,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
16420
16448
  *
16421
16449
  * @returns {String} The String freed of excess whitespace
16422
16450
  */
16423
- const trim = (str) => str.trim ?
16424
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
16451
+ const trim = (str) =>
16452
+ str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
16425
16453
 
16426
16454
  /**
16427
16455
  * Iterate over an Array or an Object invoking a function for each item.
@@ -16432,15 +16460,16 @@ const trim = (str) => str.trim ?
16432
16460
  * If 'obj' is an Object callback will be called passing
16433
16461
  * the value, key, and complete object for each property.
16434
16462
  *
16435
- * @param {Object|Array} obj The object to iterate
16463
+ * @param {Object|Array<unknown>} obj The object to iterate
16436
16464
  * @param {Function} fn The callback to invoke for each item
16437
16465
  *
16438
- * @param {Boolean} [allOwnKeys = false]
16466
+ * @param {Object} [options]
16467
+ * @param {Boolean} [options.allOwnKeys = false]
16439
16468
  * @returns {any}
16440
16469
  */
16441
- function forEach(obj, fn, {allOwnKeys = false} = {}) {
16470
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
16442
16471
  // Don't bother if no value provided
16443
- if (obj === null || typeof obj === 'undefined') {
16472
+ if (obj === null || typeof obj === "undefined") {
16444
16473
  return;
16445
16474
  }
16446
16475
 
@@ -16448,7 +16477,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
16448
16477
  let l;
16449
16478
 
16450
16479
  // Force an array if not already something iterable
16451
- if (typeof obj !== 'object') {
16480
+ if (typeof obj !== "object") {
16452
16481
  /*eslint no-param-reassign:0*/
16453
16482
  obj = [obj];
16454
16483
  }
@@ -16465,7 +16494,9 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
16465
16494
  }
16466
16495
 
16467
16496
  // Iterate over object keys
16468
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
16497
+ const keys = allOwnKeys
16498
+ ? Object.getOwnPropertyNames(obj)
16499
+ : Object.keys(obj);
16469
16500
  const len = keys.length;
16470
16501
  let key;
16471
16502
 
@@ -16477,7 +16508,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
16477
16508
  }
16478
16509
 
16479
16510
  function findKey(obj, key) {
16480
- if (isBuffer$1(obj)){
16511
+ if (isBuffer$1(obj)) {
16481
16512
  return null;
16482
16513
  }
16483
16514
 
@@ -16497,10 +16528,15 @@ function findKey(obj, key) {
16497
16528
  const _global = (() => {
16498
16529
  /*eslint no-undef:0*/
16499
16530
  if (typeof globalThis !== "undefined") return globalThis;
16500
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
16531
+ return typeof self !== "undefined"
16532
+ ? self
16533
+ : typeof window !== "undefined"
16534
+ ? window
16535
+ : global;
16501
16536
  })();
16502
16537
 
16503
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
16538
+ const isContextDefined = (context) =>
16539
+ !isUndefined(context) && context !== _global;
16504
16540
 
16505
16541
  /**
16506
16542
  * Accepts varargs expecting each argument to be an object, then
@@ -16512,7 +16548,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
16512
16548
  * Example:
16513
16549
  *
16514
16550
  * ```js
16515
- * var result = merge({foo: 123}, {foo: 456});
16551
+ * const result = merge({foo: 123}, {foo: 456});
16516
16552
  * console.log(result.foo); // outputs 456
16517
16553
  * ```
16518
16554
  *
@@ -16521,20 +16557,23 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
16521
16557
  * @returns {Object} Result of all merge properties
16522
16558
  */
16523
16559
  function merge(/* obj1, obj2, obj3, ... */) {
16524
- const {caseless, skipUndefined} = isContextDefined(this) && this || {};
16560
+ const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
16525
16561
  const result = {};
16526
16562
  const assignValue = (val, key) => {
16527
- const targetKey = caseless && findKey(result, key) || key;
16563
+ // Skip dangerous property names to prevent prototype pollution
16564
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
16565
+ return;
16566
+ }
16567
+
16568
+ const targetKey = (caseless && findKey(result, key)) || key;
16528
16569
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
16529
16570
  result[targetKey] = merge(result[targetKey], val);
16530
16571
  } else if (isPlainObject(val)) {
16531
16572
  result[targetKey] = merge({}, val);
16532
16573
  } else if (isArray(val)) {
16533
16574
  result[targetKey] = val.slice();
16534
- } else {
16535
- if (!skipUndefined || !isUndefined(val)) {
16536
- result[targetKey] = val;
16537
- }
16575
+ } else if (!skipUndefined || !isUndefined(val)) {
16576
+ result[targetKey] = val;
16538
16577
  }
16539
16578
  };
16540
16579
 
@@ -16551,17 +16590,32 @@ function merge(/* obj1, obj2, obj3, ... */) {
16551
16590
  * @param {Object} b The object to copy properties from
16552
16591
  * @param {Object} thisArg The object to bind function to
16553
16592
  *
16554
- * @param {Boolean} [allOwnKeys]
16593
+ * @param {Object} [options]
16594
+ * @param {Boolean} [options.allOwnKeys]
16555
16595
  * @returns {Object} The resulting value of object a
16556
16596
  */
16557
- const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
16558
- forEach(b, (val, key) => {
16559
- if (thisArg && isFunction$2(val)) {
16560
- a[key] = bind$2(val, thisArg);
16561
- } else {
16562
- a[key] = val;
16563
- }
16564
- }, {allOwnKeys});
16597
+ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
16598
+ forEach(
16599
+ b,
16600
+ (val, key) => {
16601
+ if (thisArg && isFunction$2(val)) {
16602
+ Object.defineProperty(a, key, {
16603
+ value: bind$2(val, thisArg),
16604
+ writable: true,
16605
+ enumerable: true,
16606
+ configurable: true,
16607
+ });
16608
+ } else {
16609
+ Object.defineProperty(a, key, {
16610
+ value: val,
16611
+ writable: true,
16612
+ enumerable: true,
16613
+ configurable: true,
16614
+ });
16615
+ }
16616
+ },
16617
+ { allOwnKeys },
16618
+ );
16565
16619
  return a;
16566
16620
  };
16567
16621
 
@@ -16573,7 +16627,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
16573
16627
  * @returns {string} content value without BOM
16574
16628
  */
16575
16629
  const stripBOM = (content) => {
16576
- if (content.charCodeAt(0) === 0xFEFF) {
16630
+ if (content.charCodeAt(0) === 0xfeff) {
16577
16631
  content = content.slice(1);
16578
16632
  }
16579
16633
  return content;
@@ -16589,10 +16643,18 @@ const stripBOM = (content) => {
16589
16643
  * @returns {void}
16590
16644
  */
16591
16645
  const inherits = (constructor, superConstructor, props, descriptors) => {
16592
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
16593
- constructor.prototype.constructor = constructor;
16594
- Object.defineProperty(constructor, 'super', {
16595
- value: superConstructor.prototype
16646
+ constructor.prototype = Object.create(
16647
+ superConstructor.prototype,
16648
+ descriptors,
16649
+ );
16650
+ Object.defineProperty(constructor.prototype, "constructor", {
16651
+ value: constructor,
16652
+ writable: true,
16653
+ enumerable: false,
16654
+ configurable: true,
16655
+ });
16656
+ Object.defineProperty(constructor, "super", {
16657
+ value: superConstructor.prototype,
16596
16658
  });
16597
16659
  props && Object.assign(constructor.prototype, props);
16598
16660
  };
@@ -16621,13 +16683,20 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
16621
16683
  i = props.length;
16622
16684
  while (i-- > 0) {
16623
16685
  prop = props[i];
16624
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
16686
+ if (
16687
+ (!propFilter || propFilter(prop, sourceObj, destObj)) &&
16688
+ !merged[prop]
16689
+ ) {
16625
16690
  destObj[prop] = sourceObj[prop];
16626
16691
  merged[prop] = true;
16627
16692
  }
16628
16693
  }
16629
16694
  sourceObj = filter !== false && getPrototypeOf(sourceObj);
16630
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
16695
+ } while (
16696
+ sourceObj &&
16697
+ (!filter || filter(sourceObj, destObj)) &&
16698
+ sourceObj !== Object.prototype
16699
+ );
16631
16700
 
16632
16701
  return destObj;
16633
16702
  };
@@ -16651,7 +16720,6 @@ const endsWith = (str, searchString, position) => {
16651
16720
  return lastIndex !== -1 && lastIndex === position;
16652
16721
  };
16653
16722
 
16654
-
16655
16723
  /**
16656
16724
  * Returns new array from array like object or null if failed
16657
16725
  *
@@ -16680,12 +16748,12 @@ const toArray = (thing) => {
16680
16748
  * @returns {Array}
16681
16749
  */
16682
16750
  // eslint-disable-next-line func-names
16683
- const isTypedArray = (TypedArray => {
16751
+ const isTypedArray = ((TypedArray) => {
16684
16752
  // eslint-disable-next-line func-names
16685
- return thing => {
16753
+ return (thing) => {
16686
16754
  return TypedArray && thing instanceof TypedArray;
16687
16755
  };
16688
- })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
16756
+ })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
16689
16757
 
16690
16758
  /**
16691
16759
  * For each entry in the object, call the function with the key and value.
@@ -16728,18 +16796,22 @@ const matchAll = (regExp, str) => {
16728
16796
  };
16729
16797
 
16730
16798
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
16731
- const isHTMLForm = kindOfTest('HTMLFormElement');
16799
+ const isHTMLForm = kindOfTest("HTMLFormElement");
16732
16800
 
16733
- const toCamelCase = str => {
16734
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
16735
- function replacer(m, p1, p2) {
16801
+ const toCamelCase = (str) => {
16802
+ return str
16803
+ .toLowerCase()
16804
+ .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
16736
16805
  return p1.toUpperCase() + p2;
16737
- }
16738
- );
16806
+ });
16739
16807
  };
16740
16808
 
16741
16809
  /* Creating a function that will check if an object has a property. */
16742
- const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
16810
+ const hasOwnProperty = (
16811
+ ({ hasOwnProperty }) =>
16812
+ (obj, prop) =>
16813
+ hasOwnProperty.call(obj, prop)
16814
+ )(Object.prototype);
16743
16815
 
16744
16816
  /**
16745
16817
  * Determine if a value is a RegExp object
@@ -16748,7 +16820,7 @@ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call
16748
16820
  *
16749
16821
  * @returns {boolean} True if value is a RegExp object, otherwise false
16750
16822
  */
16751
- const isRegExp = kindOfTest('RegExp');
16823
+ const isRegExp = kindOfTest("RegExp");
16752
16824
 
16753
16825
  const reduceDescriptors = (obj, reducer) => {
16754
16826
  const descriptors = Object.getOwnPropertyDescriptors(obj);
@@ -16772,7 +16844,10 @@ const reduceDescriptors = (obj, reducer) => {
16772
16844
  const freezeMethods = (obj) => {
16773
16845
  reduceDescriptors(obj, (descriptor, name) => {
16774
16846
  // skip restricted props in strict mode
16775
- if (isFunction$2(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
16847
+ if (
16848
+ isFunction$2(obj) &&
16849
+ ["arguments", "caller", "callee"].indexOf(name) !== -1
16850
+ ) {
16776
16851
  return false;
16777
16852
  }
16778
16853
 
@@ -16782,14 +16857,14 @@ const freezeMethods = (obj) => {
16782
16857
 
16783
16858
  descriptor.enumerable = false;
16784
16859
 
16785
- if ('writable' in descriptor) {
16860
+ if ("writable" in descriptor) {
16786
16861
  descriptor.writable = false;
16787
16862
  return;
16788
16863
  }
16789
16864
 
16790
16865
  if (!descriptor.set) {
16791
16866
  descriptor.set = () => {
16792
- throw Error('Can not rewrite read-only method \'' + name + '\'');
16867
+ throw Error("Can not rewrite read-only method '" + name + "'");
16793
16868
  };
16794
16869
  }
16795
16870
  });
@@ -16799,12 +16874,14 @@ const toObjectSet = (arrayOrString, delimiter) => {
16799
16874
  const obj = {};
16800
16875
 
16801
16876
  const define = (arr) => {
16802
- arr.forEach(value => {
16877
+ arr.forEach((value) => {
16803
16878
  obj[value] = true;
16804
16879
  });
16805
16880
  };
16806
16881
 
16807
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
16882
+ isArray(arrayOrString)
16883
+ ? define(arrayOrString)
16884
+ : define(String(arrayOrString).split(delimiter));
16808
16885
 
16809
16886
  return obj;
16810
16887
  };
@@ -16812,11 +16889,11 @@ const toObjectSet = (arrayOrString, delimiter) => {
16812
16889
  const noop$1 = () => {};
16813
16890
 
16814
16891
  const toFiniteNumber = (value, defaultValue) => {
16815
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
16892
+ return value != null && Number.isFinite((value = +value))
16893
+ ? value
16894
+ : defaultValue;
16816
16895
  };
16817
16896
 
16818
-
16819
-
16820
16897
  /**
16821
16898
  * If the thing is a FormData object, return true, otherwise return false.
16822
16899
  *
@@ -16825,14 +16902,18 @@ const toFiniteNumber = (value, defaultValue) => {
16825
16902
  * @returns {boolean}
16826
16903
  */
16827
16904
  function isSpecCompliantForm(thing) {
16828
- return !!(thing && isFunction$2(thing.append) && thing[toStringTag$1] === 'FormData' && thing[iterator]);
16905
+ return !!(
16906
+ thing &&
16907
+ isFunction$2(thing.append) &&
16908
+ thing[toStringTag$1] === "FormData" &&
16909
+ thing[iterator]
16910
+ );
16829
16911
  }
16830
16912
 
16831
16913
  const toJSONObject = (obj) => {
16832
16914
  const stack = new Array(10);
16833
16915
 
16834
16916
  const visit = (source, i) => {
16835
-
16836
16917
  if (isObject(source)) {
16837
16918
  if (stack.indexOf(source) >= 0) {
16838
16919
  return;
@@ -16843,7 +16924,7 @@ const toJSONObject = (obj) => {
16843
16924
  return source;
16844
16925
  }
16845
16926
 
16846
- if(!('toJSON' in source)) {
16927
+ if (!("toJSON" in source)) {
16847
16928
  stack[i] = source;
16848
16929
  const target = isArray(source) ? [] : {};
16849
16930
 
@@ -16864,10 +16945,13 @@ const toJSONObject = (obj) => {
16864
16945
  return visit(obj, 0);
16865
16946
  };
16866
16947
 
16867
- const isAsyncFn = kindOfTest('AsyncFunction');
16948
+ const isAsyncFn = kindOfTest("AsyncFunction");
16868
16949
 
16869
16950
  const isThenable = (thing) =>
16870
- thing && (isObject(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch);
16951
+ thing &&
16952
+ (isObject(thing) || isFunction$2(thing)) &&
16953
+ isFunction$2(thing.then) &&
16954
+ isFunction$2(thing.catch);
16871
16955
 
16872
16956
  // original code
16873
16957
  // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
@@ -16877,32 +16961,35 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
16877
16961
  return setImmediate;
16878
16962
  }
16879
16963
 
16880
- return postMessageSupported ? ((token, callbacks) => {
16881
- _global.addEventListener("message", ({source, data}) => {
16882
- if (source === _global && data === token) {
16883
- callbacks.length && callbacks.shift()();
16884
- }
16885
- }, false);
16964
+ return postMessageSupported
16965
+ ? ((token, callbacks) => {
16966
+ _global.addEventListener(
16967
+ "message",
16968
+ ({ source, data }) => {
16969
+ if (source === _global && data === token) {
16970
+ callbacks.length && callbacks.shift()();
16971
+ }
16972
+ },
16973
+ false,
16974
+ );
16886
16975
 
16887
- return (cb) => {
16888
- callbacks.push(cb);
16889
- _global.postMessage(token, "*");
16890
- }
16891
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
16892
- })(
16893
- typeof setImmediate === 'function',
16894
- isFunction$2(_global.postMessage)
16895
- );
16976
+ return (cb) => {
16977
+ callbacks.push(cb);
16978
+ _global.postMessage(token, "*");
16979
+ };
16980
+ })(`axios@${Math.random()}`, [])
16981
+ : (cb) => setTimeout(cb);
16982
+ })(typeof setImmediate === "function", isFunction$2(_global.postMessage));
16896
16983
 
16897
- const asap = typeof queueMicrotask !== 'undefined' ?
16898
- queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
16984
+ const asap =
16985
+ typeof queueMicrotask !== "undefined"
16986
+ ? queueMicrotask.bind(_global)
16987
+ : (typeof process !== "undefined" && process.nextTick) || _setImmediate;
16899
16988
 
16900
16989
  // *********************
16901
16990
 
16902
-
16903
16991
  const isIterable = (thing) => thing != null && isFunction$2(thing[iterator]);
16904
16992
 
16905
-
16906
16993
  var utils$1 = {
16907
16994
  isArray,
16908
16995
  isArrayBuffer,
@@ -16960,116 +17047,79 @@ var utils$1 = {
16960
17047
  isThenable,
16961
17048
  setImmediate: _setImmediate,
16962
17049
  asap,
16963
- isIterable
17050
+ isIterable,
16964
17051
  };
16965
17052
 
16966
- /**
16967
- * Create an Error with the specified message, config, error code, request and response.
16968
- *
16969
- * @param {string} message The error message.
16970
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
16971
- * @param {Object} [config] The config.
16972
- * @param {Object} [request] The request.
16973
- * @param {Object} [response] The response.
16974
- *
16975
- * @returns {Error} The created error.
16976
- */
16977
- function AxiosError(message, code, config, request, response) {
16978
- Error.call(this);
17053
+ class AxiosError extends Error {
17054
+ static from(error, code, config, request, response, customProps) {
17055
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
17056
+ axiosError.cause = error;
17057
+ axiosError.name = error.name;
17058
+ customProps && Object.assign(axiosError, customProps);
17059
+ return axiosError;
17060
+ }
16979
17061
 
16980
- if (Error.captureStackTrace) {
16981
- Error.captureStackTrace(this, this.constructor);
16982
- } else {
16983
- this.stack = (new Error()).stack;
16984
- }
17062
+ /**
17063
+ * Create an Error with the specified message, config, error code, request and response.
17064
+ *
17065
+ * @param {string} message The error message.
17066
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
17067
+ * @param {Object} [config] The config.
17068
+ * @param {Object} [request] The request.
17069
+ * @param {Object} [response] The response.
17070
+ *
17071
+ * @returns {Error} The created error.
17072
+ */
17073
+ constructor(message, code, config, request, response) {
17074
+ super(message);
17075
+ this.name = 'AxiosError';
17076
+ this.isAxiosError = true;
17077
+ code && (this.code = code);
17078
+ config && (this.config = config);
17079
+ request && (this.request = request);
17080
+ if (response) {
17081
+ this.response = response;
17082
+ this.status = response.status;
17083
+ }
17084
+ }
16985
17085
 
16986
- this.message = message;
16987
- this.name = 'AxiosError';
16988
- code && (this.code = code);
16989
- config && (this.config = config);
16990
- request && (this.request = request);
16991
- if (response) {
16992
- this.response = response;
16993
- this.status = response.status ? response.status : null;
16994
- }
17086
+ toJSON() {
17087
+ return {
17088
+ // Standard
17089
+ message: this.message,
17090
+ name: this.name,
17091
+ // Microsoft
17092
+ description: this.description,
17093
+ number: this.number,
17094
+ // Mozilla
17095
+ fileName: this.fileName,
17096
+ lineNumber: this.lineNumber,
17097
+ columnNumber: this.columnNumber,
17098
+ stack: this.stack,
17099
+ // Axios
17100
+ config: utils$1.toJSONObject(this.config),
17101
+ code: this.code,
17102
+ status: this.status,
17103
+ };
17104
+ }
16995
17105
  }
16996
17106
 
16997
- utils$1.inherits(AxiosError, Error, {
16998
- toJSON: function toJSON() {
16999
- return {
17000
- // Standard
17001
- message: this.message,
17002
- name: this.name,
17003
- // Microsoft
17004
- description: this.description,
17005
- number: this.number,
17006
- // Mozilla
17007
- fileName: this.fileName,
17008
- lineNumber: this.lineNumber,
17009
- columnNumber: this.columnNumber,
17010
- stack: this.stack,
17011
- // Axios
17012
- config: utils$1.toJSONObject(this.config),
17013
- code: this.code,
17014
- status: this.status
17015
- };
17016
- }
17017
- });
17018
-
17019
- const prototype$1 = AxiosError.prototype;
17020
- const descriptors = {};
17021
-
17022
- [
17023
- 'ERR_BAD_OPTION_VALUE',
17024
- 'ERR_BAD_OPTION',
17025
- 'ECONNABORTED',
17026
- 'ETIMEDOUT',
17027
- 'ERR_NETWORK',
17028
- 'ERR_FR_TOO_MANY_REDIRECTS',
17029
- 'ERR_DEPRECATED',
17030
- 'ERR_BAD_RESPONSE',
17031
- 'ERR_BAD_REQUEST',
17032
- 'ERR_CANCELED',
17033
- 'ERR_NOT_SUPPORT',
17034
- 'ERR_INVALID_URL'
17035
- // eslint-disable-next-line func-names
17036
- ].forEach(code => {
17037
- descriptors[code] = {value: code};
17038
- });
17039
-
17040
- Object.defineProperties(AxiosError, descriptors);
17041
- Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
17042
-
17043
- // eslint-disable-next-line func-names
17044
- AxiosError.from = (error, code, config, request, response, customProps) => {
17045
- const axiosError = Object.create(prototype$1);
17046
-
17047
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
17048
- return obj !== Error.prototype;
17049
- }, prop => {
17050
- return prop !== 'isAxiosError';
17051
- });
17052
-
17053
- const msg = error && error.message ? error.message : 'Error';
17054
-
17055
- // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
17056
- const errCode = code == null && error ? error.code : code;
17057
- AxiosError.call(axiosError, msg, errCode, config, request, response);
17058
-
17059
- // Chain the original error on the standard field; non-enumerable to avoid JSON noise
17060
- if (error && axiosError.cause == null) {
17061
- Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
17062
- }
17063
-
17064
- axiosError.name = (error && error.name) || 'Error';
17065
-
17066
- customProps && Object.assign(axiosError, customProps);
17067
-
17068
- return axiosError;
17069
- };
17107
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
17108
+ AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
17109
+ AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
17110
+ AxiosError.ECONNABORTED = 'ECONNABORTED';
17111
+ AxiosError.ETIMEDOUT = 'ETIMEDOUT';
17112
+ AxiosError.ERR_NETWORK = 'ERR_NETWORK';
17113
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
17114
+ AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
17115
+ AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
17116
+ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
17117
+ AxiosError.ERR_CANCELED = 'ERR_CANCELED';
17118
+ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
17119
+ AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
17070
17120
 
17071
17121
  var Stream$2 = stream.Stream;
17072
- var util$2 = require$$1$2;
17122
+ var util$2 = util$3;
17073
17123
 
17074
17124
  var delayed_stream = DelayedStream$1;
17075
17125
  function DelayedStream$1() {
@@ -17176,7 +17226,7 @@ DelayedStream$1.prototype._checkIfMaxDataSizeExceeded = function() {
17176
17226
  this.emit('error', new Error(message));
17177
17227
  };
17178
17228
 
17179
- var util$1 = require$$1$2;
17229
+ var util$1 = util$3;
17180
17230
  var Stream$1 = stream.Stream;
17181
17231
  var DelayedStream = delayed_stream;
17182
17232
 
@@ -29556,7 +29606,7 @@ var populate$1 = function (dst, src) {
29556
29606
  };
29557
29607
 
29558
29608
  var CombinedStream = combined_stream;
29559
- var util = require$$1$2;
29609
+ var util = util$3;
29560
29610
  var path = path$2;
29561
29611
  var http$1 = require$$3$1;
29562
29612
  var https$1 = require$$4$1;
@@ -30019,7 +30069,7 @@ FormData$1.prototype.submit = function (params, cb) {
30019
30069
  request.removeListener('error', callback);
30020
30070
  request.removeListener('response', onResponse);
30021
30071
 
30022
- return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
30072
+ return cb.call(this, error, responce);
30023
30073
  };
30024
30074
 
30025
30075
  onResponse = callback.bind(this, null);
@@ -30043,7 +30093,7 @@ FormData$1.prototype._error = function (err) {
30043
30093
  FormData$1.prototype.toString = function () {
30044
30094
  return '[object FormData]';
30045
30095
  };
30046
- setToStringTag(FormData$1, 'FormData');
30096
+ setToStringTag(FormData$1.prototype, 'FormData');
30047
30097
 
30048
30098
  // Public API
30049
30099
  var form_data = FormData$1;
@@ -30344,29 +30394,26 @@ function encode(val) {
30344
30394
  * @returns {string} The formatted url
30345
30395
  */
30346
30396
  function buildURL(url, params, options) {
30347
- /*eslint no-param-reassign:0*/
30348
30397
  if (!params) {
30349
30398
  return url;
30350
30399
  }
30351
-
30400
+
30352
30401
  const _encode = options && options.encode || encode;
30353
30402
 
30354
- if (utils$1.isFunction(options)) {
30355
- options = {
30356
- serialize: options
30357
- };
30358
- }
30403
+ const _options = utils$1.isFunction(options) ? {
30404
+ serialize: options
30405
+ } : options;
30359
30406
 
30360
- const serializeFn = options && options.serialize;
30407
+ const serializeFn = _options && _options.serialize;
30361
30408
 
30362
30409
  let serializedParams;
30363
30410
 
30364
30411
  if (serializeFn) {
30365
- serializedParams = serializeFn(params, options);
30412
+ serializedParams = serializeFn(params, _options);
30366
30413
  } else {
30367
30414
  serializedParams = utils$1.isURLSearchParams(params) ?
30368
30415
  params.toString() :
30369
- new AxiosURLSearchParams(params, options).toString(_encode);
30416
+ new AxiosURLSearchParams(params, _options).toString(_encode);
30370
30417
  }
30371
30418
 
30372
30419
  if (serializedParams) {
@@ -30391,6 +30438,7 @@ class InterceptorManager {
30391
30438
  *
30392
30439
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
30393
30440
  * @param {Function} rejected The function to handle `reject` for a `Promise`
30441
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
30394
30442
  *
30395
30443
  * @return {Number} An ID used to remove interceptor later
30396
30444
  */
@@ -30409,7 +30457,7 @@ class InterceptorManager {
30409
30457
  *
30410
30458
  * @param {Number} id The ID that was returned by `use`
30411
30459
  *
30412
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
30460
+ * @returns {void}
30413
30461
  */
30414
30462
  eject(id) {
30415
30463
  if (this.handlers[id]) {
@@ -30450,7 +30498,8 @@ class InterceptorManager {
30450
30498
  var transitionalDefaults = {
30451
30499
  silentJSONParsing: true,
30452
30500
  forcedJSONParsing: true,
30453
- clarifyTimeoutError: false
30501
+ clarifyTimeoutError: false,
30502
+ legacyInterceptorReqResOrdering: true
30454
30503
  };
30455
30504
 
30456
30505
  var URLSearchParams = require$$0$5.URLSearchParams;
@@ -31189,25 +31238,23 @@ function isCancel(value) {
31189
31238
  return !!(value && value.__CANCEL__);
31190
31239
  }
31191
31240
 
31192
- /**
31193
- * A `CanceledError` is an object that is thrown when an operation is canceled.
31194
- *
31195
- * @param {string=} message The message.
31196
- * @param {Object=} config The config.
31197
- * @param {Object=} request The request.
31198
- *
31199
- * @returns {CanceledError} The created error.
31200
- */
31201
- function CanceledError(message, config, request) {
31202
- // eslint-disable-next-line no-eq-null,eqeqeq
31203
- AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
31204
- this.name = 'CanceledError';
31241
+ class CanceledError extends AxiosError {
31242
+ /**
31243
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
31244
+ *
31245
+ * @param {string=} message The message.
31246
+ * @param {Object=} config The config.
31247
+ * @param {Object=} request The request.
31248
+ *
31249
+ * @returns {CanceledError} The created error.
31250
+ */
31251
+ constructor(message, config, request) {
31252
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
31253
+ this.name = 'CanceledError';
31254
+ this.__CANCEL__ = true;
31255
+ }
31205
31256
  }
31206
31257
 
31207
- utils$1.inherits(CanceledError, AxiosError, {
31208
- __CANCEL__: true
31209
- });
31210
-
31211
31258
  /**
31212
31259
  * Resolve or reject a Promise based on response status.
31213
31260
  *
@@ -31243,6 +31290,10 @@ function isAbsoluteURL(url) {
31243
31290
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
31244
31291
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
31245
31292
  // by any combination of letters, digits, plus, period, or hyphen.
31293
+ if (typeof url !== 'string') {
31294
+ return false;
31295
+ }
31296
+
31246
31297
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
31247
31298
  }
31248
31299
 
@@ -32095,7 +32146,7 @@ followRedirects$1.exports.wrap = wrap;
32095
32146
  var followRedirectsExports = followRedirects$1.exports;
32096
32147
  var followRedirects = /*@__PURE__*/getDefaultExportFromCjs(followRedirectsExports);
32097
32148
 
32098
- const VERSION = "1.12.0";
32149
+ const VERSION = "1.13.5";
32099
32150
 
32100
32151
  function parseProtocol(url) {
32101
32152
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -32303,7 +32354,7 @@ const readBlob = async function* (blob) {
32303
32354
 
32304
32355
  const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
32305
32356
 
32306
- const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new require$$1$2.TextEncoder();
32357
+ const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util$3.TextEncoder();
32307
32358
 
32308
32359
  const CRLF = '\r\n';
32309
32360
  const CRLF_BYTES = textEncoder.encode(CRLF);
@@ -32681,6 +32732,101 @@ const flushOnFinish = (stream, [throttled, flush]) => {
32681
32732
  return throttled;
32682
32733
  };
32683
32734
 
32735
+ class Http2Sessions {
32736
+ constructor() {
32737
+ this.sessions = Object.create(null);
32738
+ }
32739
+
32740
+ getSession(authority, options) {
32741
+ options = Object.assign({
32742
+ sessionTimeout: 1000
32743
+ }, options);
32744
+
32745
+ let authoritySessions = this.sessions[authority];
32746
+
32747
+ if (authoritySessions) {
32748
+ let len = authoritySessions.length;
32749
+
32750
+ for (let i = 0; i < len; i++) {
32751
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
32752
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util$3.isDeepStrictEqual(sessionOptions, options)) {
32753
+ return sessionHandle;
32754
+ }
32755
+ }
32756
+ }
32757
+
32758
+ const session = http2.connect(authority, options);
32759
+
32760
+ let removed;
32761
+
32762
+ const removeSession = () => {
32763
+ if (removed) {
32764
+ return;
32765
+ }
32766
+
32767
+ removed = true;
32768
+
32769
+ let entries = authoritySessions, len = entries.length, i = len;
32770
+
32771
+ while (i--) {
32772
+ if (entries[i][0] === session) {
32773
+ if (len === 1) {
32774
+ delete this.sessions[authority];
32775
+ } else {
32776
+ entries.splice(i, 1);
32777
+ }
32778
+ return;
32779
+ }
32780
+ }
32781
+ };
32782
+
32783
+ const originalRequestFn = session.request;
32784
+
32785
+ const {sessionTimeout} = options;
32786
+
32787
+ if(sessionTimeout != null) {
32788
+
32789
+ let timer;
32790
+ let streamsCount = 0;
32791
+
32792
+ session.request = function () {
32793
+ const stream = originalRequestFn.apply(this, arguments);
32794
+
32795
+ streamsCount++;
32796
+
32797
+ if (timer) {
32798
+ clearTimeout(timer);
32799
+ timer = null;
32800
+ }
32801
+
32802
+ stream.once('close', () => {
32803
+ if (!--streamsCount) {
32804
+ timer = setTimeout(() => {
32805
+ timer = null;
32806
+ removeSession();
32807
+ }, sessionTimeout);
32808
+ }
32809
+ });
32810
+
32811
+ return stream;
32812
+ };
32813
+ }
32814
+
32815
+ session.once('close', removeSession);
32816
+
32817
+ let entry = [
32818
+ session,
32819
+ options
32820
+ ];
32821
+
32822
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
32823
+
32824
+ return session;
32825
+ }
32826
+ }
32827
+
32828
+ const http2Sessions = new Http2Sessions();
32829
+
32684
32830
 
32685
32831
  /**
32686
32832
  * If the proxy or config beforeRedirects functions are defined, call them with the options
@@ -32724,12 +32870,16 @@ function setProxy(options, configProxy, location) {
32724
32870
 
32725
32871
  if (proxy.auth) {
32726
32872
  // Support proxy auth object form
32727
- if (proxy.auth.username || proxy.auth.password) {
32873
+ const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
32874
+
32875
+ if (validProxyAuth) {
32728
32876
  proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
32877
+ } else if (typeof proxy.auth === 'object') {
32878
+ throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, { proxy });
32729
32879
  }
32730
- const base64 = Buffer
32731
- .from(proxy.auth, 'utf8')
32732
- .toString('base64');
32880
+
32881
+ const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64');
32882
+
32733
32883
  options.headers['Proxy-Authorization'] = 'Basic ' + base64;
32734
32884
  }
32735
32885
 
@@ -32793,16 +32943,76 @@ const resolveFamily = ({address, family}) => {
32793
32943
 
32794
32944
  const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
32795
32945
 
32946
+ const http2Transport = {
32947
+ request(options, cb) {
32948
+ const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80));
32949
+
32950
+
32951
+ const {http2Options, headers} = options;
32952
+
32953
+ const session = http2Sessions.getSession(authority, http2Options);
32954
+
32955
+ const {
32956
+ HTTP2_HEADER_SCHEME,
32957
+ HTTP2_HEADER_METHOD,
32958
+ HTTP2_HEADER_PATH,
32959
+ HTTP2_HEADER_STATUS
32960
+ } = http2.constants;
32961
+
32962
+ const http2Headers = {
32963
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
32964
+ [HTTP2_HEADER_METHOD]: options.method,
32965
+ [HTTP2_HEADER_PATH]: options.path,
32966
+ };
32967
+
32968
+ utils$1.forEach(headers, (header, name) => {
32969
+ name.charAt(0) !== ':' && (http2Headers[name] = header);
32970
+ });
32971
+
32972
+ const req = session.request(http2Headers);
32973
+
32974
+ req.once('response', (responseHeaders) => {
32975
+ const response = req; //duplex
32976
+
32977
+ responseHeaders = Object.assign({}, responseHeaders);
32978
+
32979
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
32980
+
32981
+ delete responseHeaders[HTTP2_HEADER_STATUS];
32982
+
32983
+ response.headers = responseHeaders;
32984
+
32985
+ response.statusCode = +status;
32986
+
32987
+ cb(response);
32988
+ });
32989
+
32990
+ return req;
32991
+ }
32992
+ };
32993
+
32796
32994
  /*eslint consistent-return:0*/
32797
32995
  var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32798
32996
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
32799
- let {data, lookup, family} = config;
32997
+ let {data, lookup, family, httpVersion = 1, http2Options} = config;
32800
32998
  const {responseType, responseEncoding} = config;
32801
32999
  const method = config.method.toUpperCase();
32802
33000
  let isDone;
32803
33001
  let rejected = false;
32804
33002
  let req;
32805
33003
 
33004
+ httpVersion = +httpVersion;
33005
+
33006
+ if (Number.isNaN(httpVersion)) {
33007
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
33008
+ }
33009
+
33010
+ if (httpVersion !== 1 && httpVersion !== 2) {
33011
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
33012
+ }
33013
+
33014
+ const isHttp2 = httpVersion === 2;
33015
+
32806
33016
  if (lookup) {
32807
33017
  const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
32808
33018
  // hotfix to support opt.all option which is required for node 20.x
@@ -32819,8 +33029,17 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32819
33029
  };
32820
33030
  }
32821
33031
 
32822
- // temporary internal emitter until the AxiosRequest class will be implemented
32823
- const emitter = new EventEmitter$1();
33032
+ const abortEmitter = new EventEmitter$1();
33033
+
33034
+ function abort(reason) {
33035
+ try {
33036
+ abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
33037
+ } catch(err) {
33038
+ console.warn('emit error', err);
33039
+ }
33040
+ }
33041
+
33042
+ abortEmitter.once('abort', reject);
32824
33043
 
32825
33044
  const onFinished = () => {
32826
33045
  if (config.cancelToken) {
@@ -32831,29 +33050,40 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32831
33050
  config.signal.removeEventListener('abort', abort);
32832
33051
  }
32833
33052
 
32834
- emitter.removeAllListeners();
33053
+ abortEmitter.removeAllListeners();
32835
33054
  };
32836
33055
 
32837
- onDone((value, isRejected) => {
33056
+ if (config.cancelToken || config.signal) {
33057
+ config.cancelToken && config.cancelToken.subscribe(abort);
33058
+ if (config.signal) {
33059
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
33060
+ }
33061
+ }
33062
+
33063
+ onDone((response, isRejected) => {
32838
33064
  isDone = true;
33065
+
32839
33066
  if (isRejected) {
32840
33067
  rejected = true;
32841
33068
  onFinished();
33069
+ return;
33070
+ }
33071
+
33072
+ const {data} = response;
33073
+
33074
+ if (data instanceof stream.Readable || data instanceof stream.Duplex) {
33075
+ const offListeners = stream.finished(data, () => {
33076
+ offListeners();
33077
+ onFinished();
33078
+ });
33079
+ } else {
33080
+ onFinished();
32842
33081
  }
32843
33082
  });
32844
33083
 
32845
- function abort(reason) {
32846
- emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
32847
- }
32848
33084
 
32849
- emitter.once('abort', reject);
32850
33085
 
32851
- if (config.cancelToken || config.signal) {
32852
- config.cancelToken && config.cancelToken.subscribe(abort);
32853
- if (config.signal) {
32854
- config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
32855
- }
32856
- }
33086
+
32857
33087
 
32858
33088
  // Parse url
32859
33089
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
@@ -32951,7 +33181,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32951
33181
 
32952
33182
  if (!headers.hasContentLength()) {
32953
33183
  try {
32954
- const knownLength = await require$$1$2.promisify(data.getLength).call(data);
33184
+ const knownLength = await util$3.promisify(data.getLength).call(data);
32955
33185
  Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
32956
33186
  /*eslint no-empty:0*/
32957
33187
  } catch (e) {
@@ -33059,7 +33289,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33059
33289
  protocol,
33060
33290
  family,
33061
33291
  beforeRedirect: dispatchBeforeRedirect,
33062
- beforeRedirects: {}
33292
+ beforeRedirects: {},
33293
+ http2Options
33063
33294
  };
33064
33295
 
33065
33296
  // cacheable-lookup integration hotfix
@@ -33076,18 +33307,23 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33076
33307
  let transport;
33077
33308
  const isHttpsRequest = isHttps.test(options.protocol);
33078
33309
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
33079
- if (config.transport) {
33080
- transport = config.transport;
33081
- } else if (config.maxRedirects === 0) {
33082
- transport = isHttpsRequest ? require$$4$1 : require$$3$1;
33310
+
33311
+ if (isHttp2) {
33312
+ transport = http2Transport;
33083
33313
  } else {
33084
- if (config.maxRedirects) {
33085
- options.maxRedirects = config.maxRedirects;
33086
- }
33087
- if (config.beforeRedirect) {
33088
- options.beforeRedirects.config = config.beforeRedirect;
33314
+ if (config.transport) {
33315
+ transport = config.transport;
33316
+ } else if (config.maxRedirects === 0) {
33317
+ transport = isHttpsRequest ? require$$4$1 : require$$3$1;
33318
+ } else {
33319
+ if (config.maxRedirects) {
33320
+ options.maxRedirects = config.maxRedirects;
33321
+ }
33322
+ if (config.beforeRedirect) {
33323
+ options.beforeRedirects.config = config.beforeRedirect;
33324
+ }
33325
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
33089
33326
  }
33090
- transport = isHttpsRequest ? httpsFollow : httpFollow;
33091
33327
  }
33092
33328
 
33093
33329
  if (config.maxBodyLength > -1) {
@@ -33107,7 +33343,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33107
33343
 
33108
33344
  const streams = [res];
33109
33345
 
33110
- const responseLength = +res.headers['content-length'];
33346
+ const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
33111
33347
 
33112
33348
  if (onDownloadProgress || maxDownloadRate) {
33113
33349
  const transformStream = new AxiosTransformStream({
@@ -33170,10 +33406,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33170
33406
 
33171
33407
  responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
33172
33408
 
33173
- const offListeners = stream.finished(responseStream, () => {
33174
- offListeners();
33175
- onFinished();
33176
- });
33409
+
33177
33410
 
33178
33411
  const response = {
33179
33412
  status: res.statusCode,
@@ -33199,7 +33432,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33199
33432
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
33200
33433
  rejected = true;
33201
33434
  responseStream.destroy();
33202
- reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
33435
+ abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
33203
33436
  AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
33204
33437
  }
33205
33438
  });
@@ -33241,7 +33474,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33241
33474
  });
33242
33475
  }
33243
33476
 
33244
- emitter.once('abort', err => {
33477
+ abortEmitter.once('abort', err => {
33245
33478
  if (!responseStream.destroyed) {
33246
33479
  responseStream.emit('error', err);
33247
33480
  responseStream.destroy();
@@ -33249,15 +33482,16 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33249
33482
  });
33250
33483
  });
33251
33484
 
33252
- emitter.once('abort', err => {
33253
- reject(err);
33254
- req.destroy(err);
33485
+ abortEmitter.once('abort', err => {
33486
+ if (req.close) {
33487
+ req.close();
33488
+ } else {
33489
+ req.destroy(err);
33490
+ }
33255
33491
  });
33256
33492
 
33257
33493
  // Handle errors
33258
33494
  req.on('error', function handleRequestError(err) {
33259
- // @todo remove
33260
- // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
33261
33495
  reject(AxiosError.from(err, null, config, req));
33262
33496
  });
33263
33497
 
@@ -33273,7 +33507,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33273
33507
  const timeout = parseInt(config.timeout, 10);
33274
33508
 
33275
33509
  if (Number.isNaN(timeout)) {
33276
- reject(new AxiosError(
33510
+ abort(new AxiosError(
33277
33511
  'error trying to parse `config.timeout` to int',
33278
33512
  AxiosError.ERR_BAD_OPTION_VALUE,
33279
33513
  config,
@@ -33295,14 +33529,16 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33295
33529
  if (config.timeoutErrorMessage) {
33296
33530
  timeoutErrorMessage = config.timeoutErrorMessage;
33297
33531
  }
33298
- reject(new AxiosError(
33532
+ abort(new AxiosError(
33299
33533
  timeoutErrorMessage,
33300
33534
  transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
33301
33535
  config,
33302
33536
  req
33303
33537
  ));
33304
- abort();
33305
33538
  });
33539
+ } else {
33540
+ // explicitly reset the socket timeout value for a possible `keep-alive` request
33541
+ req.setTimeout(0);
33306
33542
  }
33307
33543
 
33308
33544
 
@@ -33328,7 +33564,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
33328
33564
 
33329
33565
  data.pipe(req);
33330
33566
  } else {
33331
- req.end(data);
33567
+ data && req.write(data);
33568
+ req.end();
33332
33569
  }
33333
33570
  });
33334
33571
  };
@@ -33350,27 +33587,38 @@ var cookies = platform.hasStandardBrowserEnv ?
33350
33587
 
33351
33588
  // Standard browser envs support document.cookie
33352
33589
  {
33353
- write(name, value, expires, path, domain, secure) {
33354
- const cookie = [name + '=' + encodeURIComponent(value)];
33355
-
33356
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
33590
+ write(name, value, expires, path, domain, secure, sameSite) {
33591
+ if (typeof document === 'undefined') return;
33357
33592
 
33358
- utils$1.isString(path) && cookie.push('path=' + path);
33593
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
33359
33594
 
33360
- utils$1.isString(domain) && cookie.push('domain=' + domain);
33361
-
33362
- secure === true && cookie.push('secure');
33595
+ if (utils$1.isNumber(expires)) {
33596
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
33597
+ }
33598
+ if (utils$1.isString(path)) {
33599
+ cookie.push(`path=${path}`);
33600
+ }
33601
+ if (utils$1.isString(domain)) {
33602
+ cookie.push(`domain=${domain}`);
33603
+ }
33604
+ if (secure === true) {
33605
+ cookie.push('secure');
33606
+ }
33607
+ if (utils$1.isString(sameSite)) {
33608
+ cookie.push(`SameSite=${sameSite}`);
33609
+ }
33363
33610
 
33364
33611
  document.cookie = cookie.join('; ');
33365
33612
  },
33366
33613
 
33367
33614
  read(name) {
33368
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
33369
- return (match ? decodeURIComponent(match[3]) : null);
33615
+ if (typeof document === 'undefined') return null;
33616
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
33617
+ return match ? decodeURIComponent(match[1]) : null;
33370
33618
  },
33371
33619
 
33372
33620
  remove(name) {
33373
- this.write(name, '', Date.now() - 86400000);
33621
+ this.write(name, '', Date.now() - 86400000, '/');
33374
33622
  }
33375
33623
  }
33376
33624
 
@@ -33385,7 +33633,8 @@ var cookies = platform.hasStandardBrowserEnv ?
33385
33633
  remove() {}
33386
33634
  };
33387
33635
 
33388
- const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
33636
+ const headersToObject = (thing) =>
33637
+ thing instanceof AxiosHeaders ? { ...thing } : thing;
33389
33638
 
33390
33639
  /**
33391
33640
  * Config-specific merge-function which creates a new config-object
@@ -33403,7 +33652,7 @@ function mergeConfig(config1, config2) {
33403
33652
 
33404
33653
  function getMergedValue(target, source, prop, caseless) {
33405
33654
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
33406
- return utils$1.merge.call({caseless}, target, source);
33655
+ return utils$1.merge.call({ caseless }, target, source);
33407
33656
  } else if (utils$1.isPlainObject(source)) {
33408
33657
  return utils$1.merge({}, source);
33409
33658
  } else if (utils$1.isArray(source)) {
@@ -33412,12 +33661,11 @@ function mergeConfig(config1, config2) {
33412
33661
  return source;
33413
33662
  }
33414
33663
 
33415
- // eslint-disable-next-line consistent-return
33416
- function mergeDeepProperties(a, b, prop , caseless) {
33664
+ function mergeDeepProperties(a, b, prop, caseless) {
33417
33665
  if (!utils$1.isUndefined(b)) {
33418
- return getMergedValue(a, b, prop , caseless);
33666
+ return getMergedValue(a, b, prop, caseless);
33419
33667
  } else if (!utils$1.isUndefined(a)) {
33420
- return getMergedValue(undefined, a, prop , caseless);
33668
+ return getMergedValue(undefined, a, prop, caseless);
33421
33669
  }
33422
33670
  }
33423
33671
 
@@ -33475,14 +33723,27 @@ function mergeConfig(config1, config2) {
33475
33723
  socketPath: defaultToConfig2,
33476
33724
  responseEncoding: defaultToConfig2,
33477
33725
  validateStatus: mergeDirectKeys,
33478
- headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
33726
+ headers: (a, b, prop) =>
33727
+ mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
33479
33728
  };
33480
33729
 
33481
- utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
33482
- const merge = mergeMap[prop] || mergeDeepProperties;
33483
- const configValue = merge(config1[prop], config2[prop], prop);
33484
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
33485
- });
33730
+ utils$1.forEach(
33731
+ Object.keys({ ...config1, ...config2 }),
33732
+ function computeConfigValue(prop) {
33733
+ if (
33734
+ prop === "__proto__" ||
33735
+ prop === "constructor" ||
33736
+ prop === "prototype"
33737
+ )
33738
+ return;
33739
+ const merge = utils$1.hasOwnProp(mergeMap, prop)
33740
+ ? mergeMap[prop]
33741
+ : mergeDeepProperties;
33742
+ const configValue = merge(config1[prop], config2[prop], prop);
33743
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
33744
+ (config[prop] = configValue);
33745
+ },
33746
+ );
33486
33747
 
33487
33748
  return config;
33488
33749
  }
@@ -33748,7 +34009,7 @@ const composeSignals = (signals, timeout) => {
33748
34009
 
33749
34010
  let timer = timeout && setTimeout(() => {
33750
34011
  timer = null;
33751
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
34012
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
33752
34013
  }, timeout);
33753
34014
 
33754
34015
  const unsubscribe = () => {
@@ -33863,9 +34124,9 @@ const DEFAULT_CHUNK_SIZE = 64 * 1024;
33863
34124
 
33864
34125
  const {isFunction} = utils$1;
33865
34126
 
33866
- const globalFetchAPI = (({fetch, Request, Response}) => ({
33867
- fetch, Request, Response
33868
- }))(utils$1.global);
34127
+ const globalFetchAPI = (({Request, Response}) => ({
34128
+ Request, Response
34129
+ }))(utils$1.global);
33869
34130
 
33870
34131
  const {
33871
34132
  ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
@@ -33881,8 +34142,12 @@ const test = (fn, ...args) => {
33881
34142
  };
33882
34143
 
33883
34144
  const factory = (env) => {
33884
- const {fetch, Request, Response} = Object.assign({}, globalFetchAPI, env);
33885
- const isFetchSupported = isFunction(fetch);
34145
+ env = utils$1.merge.call({
34146
+ skipUndefined: true
34147
+ }, globalFetchAPI, env);
34148
+
34149
+ const {fetch: envFetch, Request, Response} = env;
34150
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
33886
34151
  const isRequestSupported = isFunction(Request);
33887
34152
  const isResponseSupported = isFunction(Response);
33888
34153
 
@@ -33985,6 +34250,8 @@ const factory = (env) => {
33985
34250
  fetchOptions
33986
34251
  } = resolveConfig(config);
33987
34252
 
34253
+ let _fetch = envFetch || fetch;
34254
+
33988
34255
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
33989
34256
 
33990
34257
  let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
@@ -34044,7 +34311,7 @@ const factory = (env) => {
34044
34311
 
34045
34312
  request = isRequestSupported && new Request(url, resolvedOptions);
34046
34313
 
34047
- let response = await (isRequestSupported ? fetch(request, fetchOptions) : fetch(url, resolvedOptions));
34314
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
34048
34315
 
34049
34316
  const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
34050
34317
 
@@ -34092,14 +34359,14 @@ const factory = (env) => {
34092
34359
 
34093
34360
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
34094
34361
  throw Object.assign(
34095
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
34362
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
34096
34363
  {
34097
34364
  cause: err.cause || err
34098
34365
  }
34099
34366
  )
34100
34367
  }
34101
34368
 
34102
- throw AxiosError.from(err, err && err.code, config, request);
34369
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
34103
34370
  }
34104
34371
  }
34105
34372
  };
@@ -34107,12 +34374,8 @@ const factory = (env) => {
34107
34374
  const seedCache = new Map();
34108
34375
 
34109
34376
  const getFetch = (config) => {
34110
- let env = utils$1.merge.call({
34111
- skipUndefined: true
34112
- }, globalFetchAPI, config ? config.env : null);
34113
-
34377
+ let env = (config && config.env) || {};
34114
34378
  const {fetch, Request, Response} = env;
34115
-
34116
34379
  const seeds = [
34117
34380
  Request, Response, fetch
34118
34381
  ];
@@ -34134,6 +34397,15 @@ const getFetch = (config) => {
34134
34397
 
34135
34398
  getFetch();
34136
34399
 
34400
+ /**
34401
+ * Known adapters mapping.
34402
+ * Provides environment-specific adapters for Axios:
34403
+ * - `http` for Node.js
34404
+ * - `xhr` for browsers
34405
+ * - `fetch` for fetch API-based requests
34406
+ *
34407
+ * @type {Object<string, Function|Object>}
34408
+ */
34137
34409
  const knownAdapters = {
34138
34410
  http: httpAdapter,
34139
34411
  xhr: xhrAdapter,
@@ -34142,71 +34414,107 @@ const knownAdapters = {
34142
34414
  }
34143
34415
  };
34144
34416
 
34417
+ // Assign adapter names for easier debugging and identification
34145
34418
  utils$1.forEach(knownAdapters, (fn, value) => {
34146
34419
  if (fn) {
34147
34420
  try {
34148
- Object.defineProperty(fn, 'name', {value});
34421
+ Object.defineProperty(fn, 'name', { value });
34149
34422
  } catch (e) {
34150
34423
  // eslint-disable-next-line no-empty
34151
34424
  }
34152
- Object.defineProperty(fn, 'adapterName', {value});
34425
+ Object.defineProperty(fn, 'adapterName', { value });
34153
34426
  }
34154
34427
  });
34155
34428
 
34429
+ /**
34430
+ * Render a rejection reason string for unknown or unsupported adapters
34431
+ *
34432
+ * @param {string} reason
34433
+ * @returns {string}
34434
+ */
34156
34435
  const renderReason = (reason) => `- ${reason}`;
34157
34436
 
34437
+ /**
34438
+ * Check if the adapter is resolved (function, null, or false)
34439
+ *
34440
+ * @param {Function|null|false} adapter
34441
+ * @returns {boolean}
34442
+ */
34158
34443
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
34159
34444
 
34160
- var adapters = {
34161
- getAdapter: (adapters, config) => {
34162
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
34163
-
34164
- const {length} = adapters;
34165
- let nameOrAdapter;
34166
- let adapter;
34445
+ /**
34446
+ * Get the first suitable adapter from the provided list.
34447
+ * Tries each adapter in order until a supported one is found.
34448
+ * Throws an AxiosError if no adapter is suitable.
34449
+ *
34450
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
34451
+ * @param {Object} config - Axios request configuration
34452
+ * @throws {AxiosError} If no suitable adapter is available
34453
+ * @returns {Function} The resolved adapter function
34454
+ */
34455
+ function getAdapter(adapters, config) {
34456
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
34167
34457
 
34168
- const rejectedReasons = {};
34458
+ const { length } = adapters;
34459
+ let nameOrAdapter;
34460
+ let adapter;
34169
34461
 
34170
- for (let i = 0; i < length; i++) {
34171
- nameOrAdapter = adapters[i];
34172
- let id;
34462
+ const rejectedReasons = {};
34173
34463
 
34174
- adapter = nameOrAdapter;
34464
+ for (let i = 0; i < length; i++) {
34465
+ nameOrAdapter = adapters[i];
34466
+ let id;
34175
34467
 
34176
- if (!isResolvedHandle(nameOrAdapter)) {
34177
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
34468
+ adapter = nameOrAdapter;
34178
34469
 
34179
- if (adapter === undefined) {
34180
- throw new AxiosError(`Unknown adapter '${id}'`);
34181
- }
34182
- }
34470
+ if (!isResolvedHandle(nameOrAdapter)) {
34471
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
34183
34472
 
34184
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
34185
- break;
34473
+ if (adapter === undefined) {
34474
+ throw new AxiosError(`Unknown adapter '${id}'`);
34186
34475
  }
34476
+ }
34187
34477
 
34188
- rejectedReasons[id || '#' + i] = adapter;
34478
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
34479
+ break;
34189
34480
  }
34190
34481
 
34191
- if (!adapter) {
34482
+ rejectedReasons[id || '#' + i] = adapter;
34483
+ }
34192
34484
 
34193
- const reasons = Object.entries(rejectedReasons)
34194
- .map(([id, state]) => `adapter ${id} ` +
34195
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
34196
- );
34485
+ if (!adapter) {
34486
+ const reasons = Object.entries(rejectedReasons)
34487
+ .map(([id, state]) => `adapter ${id} ` +
34488
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
34489
+ );
34197
34490
 
34198
- let s = length ?
34199
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
34200
- 'as no adapter specified';
34491
+ let s = length ?
34492
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
34493
+ 'as no adapter specified';
34201
34494
 
34202
- throw new AxiosError(
34203
- `There is no suitable adapter to dispatch the request ` + s,
34204
- 'ERR_NOT_SUPPORT'
34205
- );
34206
- }
34495
+ throw new AxiosError(
34496
+ `There is no suitable adapter to dispatch the request ` + s,
34497
+ 'ERR_NOT_SUPPORT'
34498
+ );
34499
+ }
34207
34500
 
34208
- return adapter;
34209
- },
34501
+ return adapter;
34502
+ }
34503
+
34504
+ /**
34505
+ * Exports Axios adapters and utility to resolve an adapter
34506
+ */
34507
+ var adapters = {
34508
+ /**
34509
+ * Resolve an adapter from a list of adapter names or functions.
34510
+ * @type {Function}
34511
+ */
34512
+ getAdapter,
34513
+
34514
+ /**
34515
+ * Exposes all known adapters
34516
+ * @type {Object<string, Function|Object>}
34517
+ */
34210
34518
  adapters: knownAdapters
34211
34519
  };
34212
34520
 
@@ -34449,7 +34757,8 @@ class Axios {
34449
34757
  validator.assertOptions(transitional, {
34450
34758
  silentJSONParsing: validators.transitional(validators.boolean),
34451
34759
  forcedJSONParsing: validators.transitional(validators.boolean),
34452
- clarifyTimeoutError: validators.transitional(validators.boolean)
34760
+ clarifyTimeoutError: validators.transitional(validators.boolean),
34761
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
34453
34762
  }, false);
34454
34763
  }
34455
34764
 
@@ -34506,7 +34815,14 @@ class Axios {
34506
34815
 
34507
34816
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
34508
34817
 
34509
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
34818
+ const transitional = config.transitional || transitionalDefaults;
34819
+ const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
34820
+
34821
+ if (legacyInterceptorReqResOrdering) {
34822
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
34823
+ } else {
34824
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
34825
+ }
34510
34826
  });
34511
34827
 
34512
34828
  const responseInterceptorChain = [];
@@ -34537,8 +34853,6 @@ class Axios {
34537
34853
 
34538
34854
  let newConfig = config;
34539
34855
 
34540
- i = 0;
34541
-
34542
34856
  while (i < len) {
34543
34857
  const onFulfilled = requestInterceptorChain[i++];
34544
34858
  const onRejected = requestInterceptorChain[i++];
@@ -34743,7 +35057,7 @@ class CancelToken {
34743
35057
  *
34744
35058
  * ```js
34745
35059
  * function f(x, y, z) {}
34746
- * var args = [1, 2, 3];
35060
+ * const args = [1, 2, 3];
34747
35061
  * f.apply(null, args);
34748
35062
  * ```
34749
35063
  *
@@ -34838,6 +35152,12 @@ const HttpStatusCode = {
34838
35152
  LoopDetected: 508,
34839
35153
  NotExtended: 510,
34840
35154
  NetworkAuthenticationRequired: 511,
35155
+ WebServerIsDown: 521,
35156
+ ConnectionTimedOut: 522,
35157
+ OriginIsUnreachable: 523,
35158
+ TimeoutOccurred: 524,
35159
+ SslHandshakeFailed: 525,
35160
+ InvalidSslCertificate: 526,
34841
35161
  };
34842
35162
 
34843
35163
  Object.entries(HttpStatusCode).forEach(([key, value]) => {