@rsdoctor/core 1.3.13-beta.1 → 1.3.13

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 (82) hide show
  1. package/compiled/axios/index.d.ts +4 -0
  2. package/compiled/axios/index.js +361 -99
  3. package/compiled/axios/package.json +1 -1
  4. package/dist/build-utils/build/chunks/assetsModules.cjs +2 -2
  5. package/dist/build-utils/build/chunks/chunkTransform.cjs +2 -2
  6. package/dist/build-utils/build/chunks/index.cjs +16 -22
  7. package/dist/build-utils/build/chunks/rspack/transform.cjs +2 -2
  8. package/dist/build-utils/build/index.cjs +2 -2
  9. package/dist/build-utils/build/index.js +6 -6
  10. package/dist/build-utils/build/loader/index.cjs +11 -15
  11. package/dist/build-utils/build/loader/probeLoader.cjs +2 -2
  12. package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +2 -2
  13. package/dist/build-utils/build/module-graph/index.cjs +21 -29
  14. package/dist/build-utils/build/module-graph/parser.cjs +2 -2
  15. package/dist/build-utils/build/module-graph/rspack/transform.cjs +2 -2
  16. package/dist/build-utils/build/module-graph/transform.cjs +2 -2
  17. package/dist/build-utils/build/module-graph/treeShaking.cjs +2 -2
  18. package/dist/build-utils/build/module-graph/utils.cjs +2 -2
  19. package/dist/build-utils/build/module-graph/webpack/transform.cjs +2 -2
  20. package/dist/build-utils/build/utils/index.cjs +16 -22
  21. package/dist/build-utils/build/utils/loader.cjs +3 -3
  22. package/dist/build-utils/build/utils/loader.js +3 -3
  23. package/dist/build-utils/build/utils/parseBundle.cjs +2 -2
  24. package/dist/build-utils/build/utils/plugin.cjs +2 -2
  25. package/dist/build-utils/index.cjs +2 -2
  26. package/dist/build-utils/index.js +2 -2
  27. package/dist/index.cjs +17 -21
  28. package/dist/index.js +2 -2
  29. package/dist/inner-plugins/constants.cjs +2 -2
  30. package/dist/inner-plugins/index.cjs +11 -15
  31. package/dist/inner-plugins/loaders/proxy.cjs +2 -2
  32. package/dist/inner-plugins/plugins/base.cjs +2 -2
  33. package/dist/inner-plugins/plugins/bundle.cjs +2 -3
  34. package/dist/inner-plugins/plugins/bundle.js +0 -1
  35. package/dist/inner-plugins/plugins/bundleTagPlugin.cjs +2 -2
  36. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +2 -2
  37. package/dist/inner-plugins/plugins/errors.cjs +2 -2
  38. package/dist/inner-plugins/plugins/index.cjs +56 -78
  39. package/dist/inner-plugins/plugins/loader.cjs +2 -2
  40. package/dist/inner-plugins/plugins/plugins.cjs +2 -2
  41. package/dist/inner-plugins/plugins/progress.cjs +2 -2
  42. package/dist/inner-plugins/plugins/resolver.cjs +2 -2
  43. package/dist/inner-plugins/plugins/rspack.cjs +2 -2
  44. package/dist/inner-plugins/plugins/rules.cjs +2 -2
  45. package/dist/inner-plugins/plugins/sourcemapTool.cjs +59 -18
  46. package/dist/inner-plugins/plugins/sourcemapTool.d.ts +18 -16
  47. package/dist/inner-plugins/plugins/sourcemapTool.js +58 -17
  48. package/dist/inner-plugins/plugins/summary.cjs +2 -2
  49. package/dist/inner-plugins/utils/circleDetect.cjs +2 -2
  50. package/dist/inner-plugins/utils/config.cjs +2 -2
  51. package/dist/inner-plugins/utils/index.cjs +42 -60
  52. package/dist/inner-plugins/utils/loader.cjs +2 -2
  53. package/dist/inner-plugins/utils/normalize-config.cjs +2 -2
  54. package/dist/inner-plugins/utils/plugin-common.cjs +2 -2
  55. package/dist/inner-plugins/utils/plugin.cjs +2 -2
  56. package/dist/inner-plugins/utils/sdk.cjs +2 -2
  57. package/dist/rules/index.cjs +17 -21
  58. package/dist/rules/linter.cjs +2 -2
  59. package/dist/rules/rule.cjs +2 -2
  60. package/dist/rules/rules/cross-chunks-package/index.cjs +2 -2
  61. package/dist/rules/rules/cross-chunks-package/types.cjs +1 -1
  62. package/dist/rules/rules/cross-chunks-package/utils.cjs +2 -2
  63. package/dist/rules/rules/default-import-check/index.cjs +2 -2
  64. package/dist/rules/rules/default-import-check/types.cjs +1 -1
  65. package/dist/rules/rules/default-import-check/utils.cjs +2 -2
  66. package/dist/rules/rules/duplicate-package/index.cjs +2 -2
  67. package/dist/rules/rules/duplicate-package/types.cjs +2 -2
  68. package/dist/rules/rules/duplicate-package/utils.cjs +2 -2
  69. package/dist/rules/rules/ecma-version-check/index.cjs +2 -2
  70. package/dist/rules/rules/ecma-version-check/types.cjs +1 -1
  71. package/dist/rules/rules/ecma-version-check/utils.cjs +2 -2
  72. package/dist/rules/rules/index.cjs +2 -2
  73. package/dist/rules/rules/loader-performance-optimization/index.cjs +2 -2
  74. package/dist/rules/rules/loader-performance-optimization/types.cjs +1 -1
  75. package/dist/rules/rules/loader-performance-optimization/utils.cjs +2 -2
  76. package/dist/rules/utils.cjs +2 -2
  77. package/dist/types/chunks.cjs +1 -1
  78. package/dist/types/index.cjs +21 -29
  79. package/dist/types/loader.cjs +1 -1
  80. package/dist/types/plugin.cjs +1 -1
  81. package/dist/types/rules.cjs +1 -1
  82. package/package.json +7 -7
@@ -4641,6 +4641,14 @@ module.exports = require("http");
4641
4641
 
4642
4642
  /***/ }),
4643
4643
 
4644
+ /***/ 5675:
4645
+ /***/ ((module) => {
4646
+
4647
+ "use strict";
4648
+ module.exports = require("http2");
4649
+
4650
+ /***/ }),
4651
+
4644
4652
  /***/ 5692:
4645
4653
  /***/ ((module) => {
4646
4654
 
@@ -4705,11 +4713,11 @@ module.exports = require("zlib");
4705
4713
 
4706
4714
  /***/ }),
4707
4715
 
4708
- /***/ 5849:
4716
+ /***/ 2926:
4709
4717
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
4710
4718
 
4711
4719
  "use strict";
4712
- /*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */
4720
+ /*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */
4713
4721
 
4714
4722
 
4715
4723
  const FormData$1 = __nccwpck_require__(931);
@@ -4718,6 +4726,7 @@ const url = __nccwpck_require__(7016);
4718
4726
  const proxyFromEnv = __nccwpck_require__(638);
4719
4727
  const http = __nccwpck_require__(8611);
4720
4728
  const https = __nccwpck_require__(5692);
4729
+ const http2 = __nccwpck_require__(5675);
4721
4730
  const util = __nccwpck_require__(9023);
4722
4731
  const followRedirects = __nccwpck_require__(7956);
4723
4732
  const zlib = __nccwpck_require__(3106);
@@ -4732,11 +4741,19 @@ const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
4732
4741
  const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
4733
4742
  const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
4734
4743
  const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
4744
+ const http2__default = /*#__PURE__*/_interopDefaultLegacy(http2);
4735
4745
  const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
4736
4746
  const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
4737
4747
  const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
4738
4748
  const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
4739
4749
 
4750
+ /**
4751
+ * Create a bound version of a function with a specified `this` context
4752
+ *
4753
+ * @param {Function} fn - The function to bind
4754
+ * @param {*} thisArg - The value to be passed as the `this` parameter
4755
+ * @returns {Function} A new function that will call the original function with the specified `this` context
4756
+ */
4740
4757
  function bind(fn, thisArg) {
4741
4758
  return function wrap() {
4742
4759
  return fn.apply(thisArg, arguments);
@@ -5986,7 +6003,7 @@ class InterceptorManager {
5986
6003
  *
5987
6004
  * @param {Number} id The ID that was returned by `use`
5988
6005
  *
5989
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
6006
+ * @returns {void}
5990
6007
  */
5991
6008
  eject(id) {
5992
6009
  if (this.handlers[id]) {
@@ -6861,7 +6878,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
6861
6878
  return requestedURL;
6862
6879
  }
6863
6880
 
6864
- const VERSION = "1.12.2";
6881
+ const VERSION = "1.13.2";
6865
6882
 
6866
6883
  function parseProtocol(url) {
6867
6884
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -7457,6 +7474,101 @@ const flushOnFinish = (stream, [throttled, flush]) => {
7457
7474
  return throttled;
7458
7475
  };
7459
7476
 
7477
+ class Http2Sessions {
7478
+ constructor() {
7479
+ this.sessions = Object.create(null);
7480
+ }
7481
+
7482
+ getSession(authority, options) {
7483
+ options = Object.assign({
7484
+ sessionTimeout: 1000
7485
+ }, options);
7486
+
7487
+ let authoritySessions = this.sessions[authority];
7488
+
7489
+ if (authoritySessions) {
7490
+ let len = authoritySessions.length;
7491
+
7492
+ for (let i = 0; i < len; i++) {
7493
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
7494
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) {
7495
+ return sessionHandle;
7496
+ }
7497
+ }
7498
+ }
7499
+
7500
+ const session = http2__default["default"].connect(authority, options);
7501
+
7502
+ let removed;
7503
+
7504
+ const removeSession = () => {
7505
+ if (removed) {
7506
+ return;
7507
+ }
7508
+
7509
+ removed = true;
7510
+
7511
+ let entries = authoritySessions, len = entries.length, i = len;
7512
+
7513
+ while (i--) {
7514
+ if (entries[i][0] === session) {
7515
+ if (len === 1) {
7516
+ delete this.sessions[authority];
7517
+ } else {
7518
+ entries.splice(i, 1);
7519
+ }
7520
+ return;
7521
+ }
7522
+ }
7523
+ };
7524
+
7525
+ const originalRequestFn = session.request;
7526
+
7527
+ const {sessionTimeout} = options;
7528
+
7529
+ if(sessionTimeout != null) {
7530
+
7531
+ let timer;
7532
+ let streamsCount = 0;
7533
+
7534
+ session.request = function () {
7535
+ const stream = originalRequestFn.apply(this, arguments);
7536
+
7537
+ streamsCount++;
7538
+
7539
+ if (timer) {
7540
+ clearTimeout(timer);
7541
+ timer = null;
7542
+ }
7543
+
7544
+ stream.once('close', () => {
7545
+ if (!--streamsCount) {
7546
+ timer = setTimeout(() => {
7547
+ timer = null;
7548
+ removeSession();
7549
+ }, sessionTimeout);
7550
+ }
7551
+ });
7552
+
7553
+ return stream;
7554
+ };
7555
+ }
7556
+
7557
+ session.once('close', removeSession);
7558
+
7559
+ let entry = [
7560
+ session,
7561
+ options
7562
+ ];
7563
+
7564
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
7565
+
7566
+ return session;
7567
+ }
7568
+ }
7569
+
7570
+ const http2Sessions = new Http2Sessions();
7571
+
7460
7572
 
7461
7573
  /**
7462
7574
  * If the proxy or config beforeRedirects functions are defined, call them with the options
@@ -7569,16 +7681,75 @@ const resolveFamily = ({address, family}) => {
7569
7681
 
7570
7682
  const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
7571
7683
 
7684
+ const http2Transport = {
7685
+ request(options, cb) {
7686
+ const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80);
7687
+
7688
+ const {http2Options, headers} = options;
7689
+
7690
+ const session = http2Sessions.getSession(authority, http2Options);
7691
+
7692
+ const {
7693
+ HTTP2_HEADER_SCHEME,
7694
+ HTTP2_HEADER_METHOD,
7695
+ HTTP2_HEADER_PATH,
7696
+ HTTP2_HEADER_STATUS
7697
+ } = http2__default["default"].constants;
7698
+
7699
+ const http2Headers = {
7700
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
7701
+ [HTTP2_HEADER_METHOD]: options.method,
7702
+ [HTTP2_HEADER_PATH]: options.path,
7703
+ };
7704
+
7705
+ utils$1.forEach(headers, (header, name) => {
7706
+ name.charAt(0) !== ':' && (http2Headers[name] = header);
7707
+ });
7708
+
7709
+ const req = session.request(http2Headers);
7710
+
7711
+ req.once('response', (responseHeaders) => {
7712
+ const response = req; //duplex
7713
+
7714
+ responseHeaders = Object.assign({}, responseHeaders);
7715
+
7716
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
7717
+
7718
+ delete responseHeaders[HTTP2_HEADER_STATUS];
7719
+
7720
+ response.headers = responseHeaders;
7721
+
7722
+ response.statusCode = +status;
7723
+
7724
+ cb(response);
7725
+ });
7726
+
7727
+ return req;
7728
+ }
7729
+ };
7730
+
7572
7731
  /*eslint consistent-return:0*/
7573
7732
  const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7574
7733
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
7575
- let {data, lookup, family} = config;
7734
+ let {data, lookup, family, httpVersion = 1, http2Options} = config;
7576
7735
  const {responseType, responseEncoding} = config;
7577
7736
  const method = config.method.toUpperCase();
7578
7737
  let isDone;
7579
7738
  let rejected = false;
7580
7739
  let req;
7581
7740
 
7741
+ httpVersion = +httpVersion;
7742
+
7743
+ if (Number.isNaN(httpVersion)) {
7744
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
7745
+ }
7746
+
7747
+ if (httpVersion !== 1 && httpVersion !== 2) {
7748
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
7749
+ }
7750
+
7751
+ const isHttp2 = httpVersion === 2;
7752
+
7582
7753
  if (lookup) {
7583
7754
  const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
7584
7755
  // hotfix to support opt.all option which is required for node 20.x
@@ -7595,8 +7766,17 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7595
7766
  };
7596
7767
  }
7597
7768
 
7598
- // temporary internal emitter until the AxiosRequest class will be implemented
7599
- const emitter = new events.EventEmitter();
7769
+ const abortEmitter = new events.EventEmitter();
7770
+
7771
+ function abort(reason) {
7772
+ try {
7773
+ abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
7774
+ } catch(err) {
7775
+ console.warn('emit error', err);
7776
+ }
7777
+ }
7778
+
7779
+ abortEmitter.once('abort', reject);
7600
7780
 
7601
7781
  const onFinished = () => {
7602
7782
  if (config.cancelToken) {
@@ -7607,29 +7787,40 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7607
7787
  config.signal.removeEventListener('abort', abort);
7608
7788
  }
7609
7789
 
7610
- emitter.removeAllListeners();
7790
+ abortEmitter.removeAllListeners();
7611
7791
  };
7612
7792
 
7613
- onDone((value, isRejected) => {
7793
+ if (config.cancelToken || config.signal) {
7794
+ config.cancelToken && config.cancelToken.subscribe(abort);
7795
+ if (config.signal) {
7796
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
7797
+ }
7798
+ }
7799
+
7800
+ onDone((response, isRejected) => {
7614
7801
  isDone = true;
7802
+
7615
7803
  if (isRejected) {
7616
7804
  rejected = true;
7617
7805
  onFinished();
7806
+ return;
7807
+ }
7808
+
7809
+ const {data} = response;
7810
+
7811
+ if (data instanceof stream__default["default"].Readable || data instanceof stream__default["default"].Duplex) {
7812
+ const offListeners = stream__default["default"].finished(data, () => {
7813
+ offListeners();
7814
+ onFinished();
7815
+ });
7816
+ } else {
7817
+ onFinished();
7618
7818
  }
7619
7819
  });
7620
7820
 
7621
- function abort(reason) {
7622
- emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
7623
- }
7624
7821
 
7625
- emitter.once('abort', reject);
7626
7822
 
7627
- if (config.cancelToken || config.signal) {
7628
- config.cancelToken && config.cancelToken.subscribe(abort);
7629
- if (config.signal) {
7630
- config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
7631
- }
7632
- }
7823
+
7633
7824
 
7634
7825
  // Parse url
7635
7826
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
@@ -7835,7 +8026,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7835
8026
  protocol,
7836
8027
  family,
7837
8028
  beforeRedirect: dispatchBeforeRedirect,
7838
- beforeRedirects: {}
8029
+ beforeRedirects: {},
8030
+ http2Options
7839
8031
  };
7840
8032
 
7841
8033
  // cacheable-lookup integration hotfix
@@ -7852,18 +8044,23 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7852
8044
  let transport;
7853
8045
  const isHttpsRequest = isHttps.test(options.protocol);
7854
8046
  options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
7855
- if (config.transport) {
7856
- transport = config.transport;
7857
- } else if (config.maxRedirects === 0) {
7858
- transport = isHttpsRequest ? https__default["default"] : http__default["default"];
8047
+
8048
+ if (isHttp2) {
8049
+ transport = http2Transport;
7859
8050
  } else {
7860
- if (config.maxRedirects) {
7861
- options.maxRedirects = config.maxRedirects;
7862
- }
7863
- if (config.beforeRedirect) {
7864
- options.beforeRedirects.config = config.beforeRedirect;
8051
+ if (config.transport) {
8052
+ transport = config.transport;
8053
+ } else if (config.maxRedirects === 0) {
8054
+ transport = isHttpsRequest ? https__default["default"] : http__default["default"];
8055
+ } else {
8056
+ if (config.maxRedirects) {
8057
+ options.maxRedirects = config.maxRedirects;
8058
+ }
8059
+ if (config.beforeRedirect) {
8060
+ options.beforeRedirects.config = config.beforeRedirect;
8061
+ }
8062
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
7865
8063
  }
7866
- transport = isHttpsRequest ? httpsFollow : httpFollow;
7867
8064
  }
7868
8065
 
7869
8066
  if (config.maxBodyLength > -1) {
@@ -7883,7 +8080,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7883
8080
 
7884
8081
  const streams = [res];
7885
8082
 
7886
- const responseLength = +res.headers['content-length'];
8083
+ const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
7887
8084
 
7888
8085
  if (onDownloadProgress || maxDownloadRate) {
7889
8086
  const transformStream = new AxiosTransformStream$1({
@@ -7946,10 +8143,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7946
8143
 
7947
8144
  responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
7948
8145
 
7949
- const offListeners = stream__default["default"].finished(responseStream, () => {
7950
- offListeners();
7951
- onFinished();
7952
- });
8146
+
7953
8147
 
7954
8148
  const response = {
7955
8149
  status: res.statusCode,
@@ -7975,7 +8169,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
7975
8169
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
7976
8170
  rejected = true;
7977
8171
  responseStream.destroy();
7978
- reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
8172
+ abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
7979
8173
  AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
7980
8174
  }
7981
8175
  });
@@ -8017,7 +8211,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
8017
8211
  });
8018
8212
  }
8019
8213
 
8020
- emitter.once('abort', err => {
8214
+ abortEmitter.once('abort', err => {
8021
8215
  if (!responseStream.destroyed) {
8022
8216
  responseStream.emit('error', err);
8023
8217
  responseStream.destroy();
@@ -8025,9 +8219,12 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
8025
8219
  });
8026
8220
  });
8027
8221
 
8028
- emitter.once('abort', err => {
8029
- reject(err);
8030
- req.destroy(err);
8222
+ abortEmitter.once('abort', err => {
8223
+ if (req.close) {
8224
+ req.close();
8225
+ } else {
8226
+ req.destroy(err);
8227
+ }
8031
8228
  });
8032
8229
 
8033
8230
  // Handle errors
@@ -8049,7 +8246,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
8049
8246
  const timeout = parseInt(config.timeout, 10);
8050
8247
 
8051
8248
  if (Number.isNaN(timeout)) {
8052
- reject(new AxiosError(
8249
+ abort(new AxiosError(
8053
8250
  'error trying to parse `config.timeout` to int',
8054
8251
  AxiosError.ERR_BAD_OPTION_VALUE,
8055
8252
  config,
@@ -8071,14 +8268,16 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
8071
8268
  if (config.timeoutErrorMessage) {
8072
8269
  timeoutErrorMessage = config.timeoutErrorMessage;
8073
8270
  }
8074
- reject(new AxiosError(
8271
+ abort(new AxiosError(
8075
8272
  timeoutErrorMessage,
8076
8273
  transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
8077
8274
  config,
8078
8275
  req
8079
8276
  ));
8080
- abort();
8081
8277
  });
8278
+ } else {
8279
+ // explicitly reset the socket timeout value for a possible `keep-alive` request
8280
+ req.setTimeout(0);
8082
8281
  }
8083
8282
 
8084
8283
 
@@ -8104,7 +8303,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
8104
8303
 
8105
8304
  data.pipe(req);
8106
8305
  } else {
8107
- req.end(data);
8306
+ data && req.write(data);
8307
+ req.end();
8108
8308
  }
8109
8309
  });
8110
8310
  };
@@ -8126,27 +8326,38 @@ const cookies = platform.hasStandardBrowserEnv ?
8126
8326
 
8127
8327
  // Standard browser envs support document.cookie
8128
8328
  {
8129
- write(name, value, expires, path, domain, secure) {
8130
- const cookie = [name + '=' + encodeURIComponent(value)];
8329
+ write(name, value, expires, path, domain, secure, sameSite) {
8330
+ if (typeof document === 'undefined') return;
8131
8331
 
8132
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
8332
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
8133
8333
 
8134
- utils$1.isString(path) && cookie.push('path=' + path);
8135
-
8136
- utils$1.isString(domain) && cookie.push('domain=' + domain);
8137
-
8138
- secure === true && cookie.push('secure');
8334
+ if (utils$1.isNumber(expires)) {
8335
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
8336
+ }
8337
+ if (utils$1.isString(path)) {
8338
+ cookie.push(`path=${path}`);
8339
+ }
8340
+ if (utils$1.isString(domain)) {
8341
+ cookie.push(`domain=${domain}`);
8342
+ }
8343
+ if (secure === true) {
8344
+ cookie.push('secure');
8345
+ }
8346
+ if (utils$1.isString(sameSite)) {
8347
+ cookie.push(`SameSite=${sameSite}`);
8348
+ }
8139
8349
 
8140
8350
  document.cookie = cookie.join('; ');
8141
8351
  },
8142
8352
 
8143
8353
  read(name) {
8144
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
8145
- return (match ? decodeURIComponent(match[3]) : null);
8354
+ if (typeof document === 'undefined') return null;
8355
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
8356
+ return match ? decodeURIComponent(match[1]) : null;
8146
8357
  },
8147
8358
 
8148
8359
  remove(name) {
8149
- this.write(name, '', Date.now() - 86400000);
8360
+ this.write(name, '', Date.now() - 86400000, '/');
8150
8361
  }
8151
8362
  }
8152
8363
 
@@ -8189,11 +8400,11 @@ function mergeConfig(config1, config2) {
8189
8400
  }
8190
8401
 
8191
8402
  // eslint-disable-next-line consistent-return
8192
- function mergeDeepProperties(a, b, prop , caseless) {
8403
+ function mergeDeepProperties(a, b, prop, caseless) {
8193
8404
  if (!utils$1.isUndefined(b)) {
8194
- return getMergedValue(a, b, prop , caseless);
8405
+ return getMergedValue(a, b, prop, caseless);
8195
8406
  } else if (!utils$1.isUndefined(a)) {
8196
- return getMergedValue(undefined, a, prop , caseless);
8407
+ return getMergedValue(undefined, a, prop, caseless);
8197
8408
  }
8198
8409
  }
8199
8410
 
@@ -8251,7 +8462,7 @@ function mergeConfig(config1, config2) {
8251
8462
  socketPath: defaultToConfig2,
8252
8463
  responseEncoding: defaultToConfig2,
8253
8464
  validateStatus: mergeDirectKeys,
8254
- headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
8465
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
8255
8466
  };
8256
8467
 
8257
8468
  utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
@@ -8891,7 +9102,7 @@ const factory = (env) => {
8891
9102
  const seedCache = new Map();
8892
9103
 
8893
9104
  const getFetch = (config) => {
8894
- let env = config ? config.env : {};
9105
+ let env = (config && config.env) || {};
8895
9106
  const {fetch, Request, Response} = env;
8896
9107
  const seeds = [
8897
9108
  Request, Response, fetch
@@ -8914,6 +9125,15 @@ const getFetch = (config) => {
8914
9125
 
8915
9126
  getFetch();
8916
9127
 
9128
+ /**
9129
+ * Known adapters mapping.
9130
+ * Provides environment-specific adapters for Axios:
9131
+ * - `http` for Node.js
9132
+ * - `xhr` for browsers
9133
+ * - `fetch` for fetch API-based requests
9134
+ *
9135
+ * @type {Object<string, Function|Object>}
9136
+ */
8917
9137
  const knownAdapters = {
8918
9138
  http: httpAdapter,
8919
9139
  xhr: xhrAdapter,
@@ -8922,71 +9142,107 @@ const knownAdapters = {
8922
9142
  }
8923
9143
  };
8924
9144
 
9145
+ // Assign adapter names for easier debugging and identification
8925
9146
  utils$1.forEach(knownAdapters, (fn, value) => {
8926
9147
  if (fn) {
8927
9148
  try {
8928
- Object.defineProperty(fn, 'name', {value});
9149
+ Object.defineProperty(fn, 'name', { value });
8929
9150
  } catch (e) {
8930
9151
  // eslint-disable-next-line no-empty
8931
9152
  }
8932
- Object.defineProperty(fn, 'adapterName', {value});
9153
+ Object.defineProperty(fn, 'adapterName', { value });
8933
9154
  }
8934
9155
  });
8935
9156
 
9157
+ /**
9158
+ * Render a rejection reason string for unknown or unsupported adapters
9159
+ *
9160
+ * @param {string} reason
9161
+ * @returns {string}
9162
+ */
8936
9163
  const renderReason = (reason) => `- ${reason}`;
8937
9164
 
9165
+ /**
9166
+ * Check if the adapter is resolved (function, null, or false)
9167
+ *
9168
+ * @param {Function|null|false} adapter
9169
+ * @returns {boolean}
9170
+ */
8938
9171
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
8939
9172
 
8940
- const adapters = {
8941
- getAdapter: (adapters, config) => {
8942
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
8943
-
8944
- const {length} = adapters;
8945
- let nameOrAdapter;
8946
- let adapter;
9173
+ /**
9174
+ * Get the first suitable adapter from the provided list.
9175
+ * Tries each adapter in order until a supported one is found.
9176
+ * Throws an AxiosError if no adapter is suitable.
9177
+ *
9178
+ * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
9179
+ * @param {Object} config - Axios request configuration
9180
+ * @throws {AxiosError} If no suitable adapter is available
9181
+ * @returns {Function} The resolved adapter function
9182
+ */
9183
+ function getAdapter(adapters, config) {
9184
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
8947
9185
 
8948
- const rejectedReasons = {};
9186
+ const { length } = adapters;
9187
+ let nameOrAdapter;
9188
+ let adapter;
8949
9189
 
8950
- for (let i = 0; i < length; i++) {
8951
- nameOrAdapter = adapters[i];
8952
- let id;
9190
+ const rejectedReasons = {};
8953
9191
 
8954
- adapter = nameOrAdapter;
9192
+ for (let i = 0; i < length; i++) {
9193
+ nameOrAdapter = adapters[i];
9194
+ let id;
8955
9195
 
8956
- if (!isResolvedHandle(nameOrAdapter)) {
8957
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
9196
+ adapter = nameOrAdapter;
8958
9197
 
8959
- if (adapter === undefined) {
8960
- throw new AxiosError(`Unknown adapter '${id}'`);
8961
- }
8962
- }
9198
+ if (!isResolvedHandle(nameOrAdapter)) {
9199
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
8963
9200
 
8964
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
8965
- break;
9201
+ if (adapter === undefined) {
9202
+ throw new AxiosError(`Unknown adapter '${id}'`);
8966
9203
  }
9204
+ }
8967
9205
 
8968
- rejectedReasons[id || '#' + i] = adapter;
9206
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
9207
+ break;
8969
9208
  }
8970
9209
 
8971
- if (!adapter) {
9210
+ rejectedReasons[id || '#' + i] = adapter;
9211
+ }
8972
9212
 
8973
- const reasons = Object.entries(rejectedReasons)
8974
- .map(([id, state]) => `adapter ${id} ` +
8975
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
8976
- );
9213
+ if (!adapter) {
9214
+ const reasons = Object.entries(rejectedReasons)
9215
+ .map(([id, state]) => `adapter ${id} ` +
9216
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
9217
+ );
8977
9218
 
8978
- let s = length ?
8979
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
8980
- 'as no adapter specified';
9219
+ let s = length ?
9220
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
9221
+ 'as no adapter specified';
8981
9222
 
8982
- throw new AxiosError(
8983
- `There is no suitable adapter to dispatch the request ` + s,
8984
- 'ERR_NOT_SUPPORT'
8985
- );
8986
- }
9223
+ throw new AxiosError(
9224
+ `There is no suitable adapter to dispatch the request ` + s,
9225
+ 'ERR_NOT_SUPPORT'
9226
+ );
9227
+ }
8987
9228
 
8988
- return adapter;
8989
- },
9229
+ return adapter;
9230
+ }
9231
+
9232
+ /**
9233
+ * Exports Axios adapters and utility to resolve an adapter
9234
+ */
9235
+ const adapters = {
9236
+ /**
9237
+ * Resolve an adapter from a list of adapter names or functions.
9238
+ * @type {Function}
9239
+ */
9240
+ getAdapter,
9241
+
9242
+ /**
9243
+ * Exposes all known adapters
9244
+ * @type {Object<string, Function|Object>}
9245
+ */
8990
9246
  adapters: knownAdapters
8991
9247
  };
8992
9248
 
@@ -9620,6 +9876,12 @@ const HttpStatusCode = {
9620
9876
  LoopDetected: 508,
9621
9877
  NotExtended: 510,
9622
9878
  NetworkAuthenticationRequired: 511,
9879
+ WebServerIsDown: 521,
9880
+ ConnectionTimedOut: 522,
9881
+ OriginIsUnreachable: 523,
9882
+ TimeoutOccurred: 524,
9883
+ SslHandshakeFailed: 525,
9884
+ InvalidSslCertificate: 526,
9623
9885
  };
9624
9886
 
9625
9887
  Object.entries(HttpStatusCode).forEach(([key, value]) => {
@@ -9751,7 +10013,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
9751
10013
  /******/ // startup
9752
10014
  /******/ // Load entry module and return exports
9753
10015
  /******/ // This entry module is referenced by other modules so it can't be inlined
9754
- /******/ var __webpack_exports__ = __nccwpck_require__(5849);
10016
+ /******/ var __webpack_exports__ = __nccwpck_require__(2926);
9755
10017
  /******/ module.exports = __webpack_exports__;
9756
10018
  /******/
9757
10019
  /******/ })()