axios 1.2.0 → 1.2.2
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.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +54 -0
- package/README.md +2 -3
- package/dist/axios.js +102 -5
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +108 -7
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +118 -15
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +111 -15
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +23 -12
- package/index.d.ts +17 -6
- package/index.js +6 -2
- package/lib/.DS_Store +0 -0
- package/lib/adapters/http.js +23 -8
- package/lib/adapters/xhr.js +2 -2
- package/lib/axios.js +6 -0
- package/lib/core/dispatchRequest.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/HttpStatusCode.js +71 -0
- package/lib/helpers/speedometer.js +1 -1
- package/lib/platform/browser/index.js +20 -0
- package/lib/utils.js +5 -1
- package/package.json +54 -6
- package/bin/ssl_hotfix.js +0 -22
- package/gulpfile.js +0 -88
- package/karma.conf.cjs +0 -250
- package/rollup.config.js +0 -117
- package/tsconfig.json +0 -9
- package/tslint.json +0 -11
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,59 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.2.2] - 2022-12-29
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392)
|
7
|
+
- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377)
|
8
|
+
- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376)
|
9
|
+
- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375)
|
10
|
+
- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353)
|
11
|
+
- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345)
|
12
|
+
|
13
|
+
### Chores
|
14
|
+
- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406)
|
15
|
+
- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403)
|
16
|
+
- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398)
|
17
|
+
- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397)
|
18
|
+
- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393)
|
19
|
+
- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342)
|
20
|
+
- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384)
|
21
|
+
- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364)
|
22
|
+
|
23
|
+
### Contributors to this release
|
24
|
+
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
25
|
+
-  [Winnie](https://github.com/winniehell)
|
26
|
+
|
27
|
+
## [1.2.1] - 2022-12-05
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151)
|
31
|
+
|
32
|
+
### Fixed
|
33
|
+
- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922)
|
34
|
+
- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022)
|
35
|
+
- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306)
|
36
|
+
- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139)
|
37
|
+
|
38
|
+
### Refactors
|
39
|
+
- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308)
|
40
|
+
- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956)
|
41
|
+
|
42
|
+
### Chores
|
43
|
+
- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307)
|
44
|
+
- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159)
|
45
|
+
|
46
|
+
### Contributors to this release
|
47
|
+
|
48
|
+
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
49
|
+
- [Zachary Lysobey](https://github.com/zachlysobey)
|
50
|
+
- [Kevin Ennis](https://github.com/kevincennis)
|
51
|
+
- [Philipp Loose](https://github.com/phloose)
|
52
|
+
- [secondl1ght](https://github.com/secondl1ght)
|
53
|
+
- [wenzheng](https://github.com/0x30)
|
54
|
+
- [Ivan Barsukov](https://github.com/ovarn)
|
55
|
+
- [Arthur Fiorette](https://github.com/arthurfiorette)
|
56
|
+
|
3
57
|
## [1.2.0] - 2022-11-10
|
4
58
|
|
5
59
|
### Changed
|
package/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
<p align="center">
|
10
10
|
<a href="https://axios-http.com/"><b>Website</b></a> •
|
11
11
|
<a href="https://axios-http.com/docs/intro"><b>Documentation</b></a>
|
12
|
-
</p>
|
12
|
+
</p>
|
13
13
|
|
14
14
|
<div align="center">
|
15
15
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
|
31
31
|
</div>
|
32
|
-
|
32
|
+
|
33
33
|
## Table of Contents
|
34
34
|
|
35
35
|
- [Features](#features)
|
@@ -1297,7 +1297,6 @@ You can use Gitpod, an online IDE(which is free for Open Source) for contributin
|
|
1297
1297
|
## Resources
|
1298
1298
|
|
1299
1299
|
* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
|
1300
|
-
* [Upgrade Guide](https://github.com/axios/axios/blob/v1.x/UPGRADE_GUIDE.md)
|
1301
1300
|
* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md)
|
1302
1301
|
* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md)
|
1303
1302
|
* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md)
|
package/dist/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.2.
|
1
|
+
// Axios v1.2.2 Copyright (c) 2022 Matt Zabriskie and contributors
|
2
2
|
(function (global, factory) {
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
@@ -367,7 +367,11 @@
|
|
367
367
|
}
|
368
368
|
return null;
|
369
369
|
}
|
370
|
-
var _global =
|
370
|
+
var _global = function () {
|
371
|
+
/*eslint no-undef:0*/
|
372
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
373
|
+
return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global;
|
374
|
+
}();
|
371
375
|
var isContextDefined = function isContextDefined(context) {
|
372
376
|
return !isUndefined(context) && context !== _global;
|
373
377
|
};
|
@@ -1212,6 +1216,21 @@
|
|
1212
1216
|
}
|
1213
1217
|
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1214
1218
|
}();
|
1219
|
+
|
1220
|
+
/**
|
1221
|
+
* Determine if we're running in a standard browser webWorker environment
|
1222
|
+
*
|
1223
|
+
* Although the `isStandardBrowserEnv` method indicates that
|
1224
|
+
* `allows axios to run in a web worker`, the WebWorker will still be
|
1225
|
+
* filtered out due to its judgment standard
|
1226
|
+
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1227
|
+
* This leads to a problem when axios post `FormData` in webWorker
|
1228
|
+
*/
|
1229
|
+
var isStandardBrowserWebWorkerEnv = function () {
|
1230
|
+
return typeof WorkerGlobalScope !== 'undefined' &&
|
1231
|
+
// eslint-disable-next-line no-undef
|
1232
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
|
1233
|
+
}();
|
1215
1234
|
var platform = {
|
1216
1235
|
isBrowser: true,
|
1217
1236
|
classes: {
|
@@ -1220,6 +1239,7 @@
|
|
1220
1239
|
Blob: Blob
|
1221
1240
|
},
|
1222
1241
|
isStandardBrowserEnv: isStandardBrowserEnv,
|
1242
|
+
isStandardBrowserWebWorkerEnv: isStandardBrowserWebWorkerEnv,
|
1223
1243
|
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1224
1244
|
};
|
1225
1245
|
|
@@ -2008,7 +2028,7 @@
|
|
2008
2028
|
config.signal.removeEventListener('abort', onCanceled);
|
2009
2029
|
}
|
2010
2030
|
}
|
2011
|
-
if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {
|
2031
|
+
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
2012
2032
|
requestHeaders.setContentType(false); // Let the browser set it
|
2013
2033
|
}
|
2014
2034
|
|
@@ -2232,7 +2252,7 @@
|
|
2232
2252
|
config.cancelToken.throwIfRequested();
|
2233
2253
|
}
|
2234
2254
|
if (config.signal && config.signal.aborted) {
|
2235
|
-
throw new CanceledError();
|
2255
|
+
throw new CanceledError(null, config);
|
2236
2256
|
}
|
2237
2257
|
}
|
2238
2258
|
|
@@ -2377,7 +2397,7 @@
|
|
2377
2397
|
return config;
|
2378
2398
|
}
|
2379
2399
|
|
2380
|
-
var VERSION = "1.2.
|
2400
|
+
var VERSION = "1.2.2";
|
2381
2401
|
|
2382
2402
|
var validators$1 = {};
|
2383
2403
|
|
@@ -2769,6 +2789,79 @@
|
|
2769
2789
|
return utils.isObject(payload) && payload.isAxiosError === true;
|
2770
2790
|
}
|
2771
2791
|
|
2792
|
+
var HttpStatusCode = {
|
2793
|
+
Continue: 100,
|
2794
|
+
SwitchingProtocols: 101,
|
2795
|
+
Processing: 102,
|
2796
|
+
EarlyHints: 103,
|
2797
|
+
Ok: 200,
|
2798
|
+
Created: 201,
|
2799
|
+
Accepted: 202,
|
2800
|
+
NonAuthoritativeInformation: 203,
|
2801
|
+
NoContent: 204,
|
2802
|
+
ResetContent: 205,
|
2803
|
+
PartialContent: 206,
|
2804
|
+
MultiStatus: 207,
|
2805
|
+
AlreadyReported: 208,
|
2806
|
+
ImUsed: 226,
|
2807
|
+
MultipleChoices: 300,
|
2808
|
+
MovedPermanently: 301,
|
2809
|
+
Found: 302,
|
2810
|
+
SeeOther: 303,
|
2811
|
+
NotModified: 304,
|
2812
|
+
UseProxy: 305,
|
2813
|
+
Unused: 306,
|
2814
|
+
TemporaryRedirect: 307,
|
2815
|
+
PermanentRedirect: 308,
|
2816
|
+
BadRequest: 400,
|
2817
|
+
Unauthorized: 401,
|
2818
|
+
PaymentRequired: 402,
|
2819
|
+
Forbidden: 403,
|
2820
|
+
NotFound: 404,
|
2821
|
+
MethodNotAllowed: 405,
|
2822
|
+
NotAcceptable: 406,
|
2823
|
+
ProxyAuthenticationRequired: 407,
|
2824
|
+
RequestTimeout: 408,
|
2825
|
+
Conflict: 409,
|
2826
|
+
Gone: 410,
|
2827
|
+
LengthRequired: 411,
|
2828
|
+
PreconditionFailed: 412,
|
2829
|
+
PayloadTooLarge: 413,
|
2830
|
+
UriTooLong: 414,
|
2831
|
+
UnsupportedMediaType: 415,
|
2832
|
+
RangeNotSatisfiable: 416,
|
2833
|
+
ExpectationFailed: 417,
|
2834
|
+
ImATeapot: 418,
|
2835
|
+
MisdirectedRequest: 421,
|
2836
|
+
UnprocessableEntity: 422,
|
2837
|
+
Locked: 423,
|
2838
|
+
FailedDependency: 424,
|
2839
|
+
TooEarly: 425,
|
2840
|
+
UpgradeRequired: 426,
|
2841
|
+
PreconditionRequired: 428,
|
2842
|
+
TooManyRequests: 429,
|
2843
|
+
RequestHeaderFieldsTooLarge: 431,
|
2844
|
+
UnavailableForLegalReasons: 451,
|
2845
|
+
InternalServerError: 500,
|
2846
|
+
NotImplemented: 501,
|
2847
|
+
BadGateway: 502,
|
2848
|
+
ServiceUnavailable: 503,
|
2849
|
+
GatewayTimeout: 504,
|
2850
|
+
HttpVersionNotSupported: 505,
|
2851
|
+
VariantAlsoNegotiates: 506,
|
2852
|
+
InsufficientStorage: 507,
|
2853
|
+
LoopDetected: 508,
|
2854
|
+
NotExtended: 510,
|
2855
|
+
NetworkAuthenticationRequired: 511
|
2856
|
+
};
|
2857
|
+
Object.entries(HttpStatusCode).forEach(function (_ref) {
|
2858
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
2859
|
+
key = _ref2[0],
|
2860
|
+
value = _ref2[1];
|
2861
|
+
HttpStatusCode[value] = key;
|
2862
|
+
});
|
2863
|
+
var HttpStatusCode$1 = HttpStatusCode;
|
2864
|
+
|
2772
2865
|
/**
|
2773
2866
|
* Create an instance of Axios
|
2774
2867
|
*
|
@@ -2824,10 +2917,14 @@
|
|
2824
2917
|
|
2825
2918
|
// Expose isAxiosError
|
2826
2919
|
axios.isAxiosError = isAxiosError;
|
2920
|
+
|
2921
|
+
// Expose mergeConfig
|
2922
|
+
axios.mergeConfig = mergeConfig;
|
2827
2923
|
axios.AxiosHeaders = AxiosHeaders$1;
|
2828
2924
|
axios.formToJSON = function (thing) {
|
2829
2925
|
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
2830
2926
|
};
|
2927
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
2831
2928
|
axios["default"] = axios;
|
2832
2929
|
|
2833
2930
|
return axios;
|