...**/!(*.map|*.min.js)Size
Gzip
Dependencies
Publish
Install
Publish
Install
@@ -100,7 +100,7 @@ | ||
| 100 | 100 | isAxiosError: boolean; |
| 101 | 101 | status?: number; |
| 102 | 102 | toJSON: () => object; |
| 103 | cause?: unknown; | |
| 103 | cause?: Error; | |
| 104 | 104 | event?: BrowserProgressEvent; |
| 105 | 105 | static from<T = unknown, D = any>( |
| 106 | 106 | error: Error | unknown, |
@@ -515,14 +515,32 @@ | ||
| 515 | 515 | runWhen?: (config: InternalAxiosRequestConfig) => boolean; |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | type AxiosRequestInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number; | |
| 518 | type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>; | |
| 519 | type AxiosInterceptorRejected = (error: any) => any; | |
| 519 | 520 | |
| 520 | type AxiosResponseInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null) => number; | |
| 521 | type AxiosRequestInterceptorUse<T> = ( | |
| 522 | onFulfilled?: AxiosInterceptorFulfilled<T> | null, | |
| 523 | onRejected?: AxiosInterceptorRejected | null, | |
| 524 | options?: AxiosInterceptorOptions | |
| 525 | ) => number; | |
| 521 | 526 | |
| 527 | type AxiosResponseInterceptorUse<T> = ( | |
| 528 | onFulfilled?: AxiosInterceptorFulfilled<T> | null, | |
| 529 | onRejected?: AxiosInterceptorRejected | null | |
| 530 | ) => number; | |
| 531 | ||
| 532 | interface AxiosInterceptorHandler<T> { | |
| 533 | fulfilled: AxiosInterceptorFulfilled<T>; | |
| 534 | rejected?: AxiosInterceptorRejected; | |
| 535 | synchronous: boolean; | |
| 536 | runWhen?: (config: AxiosRequestConfig) => boolean; | |
| 537 | } | |
| 538 | ||
| 522 | 539 | interface AxiosInterceptorManager<V> { |
| 523 | 540 | use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>; |
| 524 | 541 | eject(id: number): void; |
| 525 | 542 | clear(): void; |
| 543 | handlers?: Array<AxiosInterceptorHandler<V>>; | |
| 526 | 544 | } |
| 527 | 545 | |
| 528 | 546 | interface AxiosInstance extends Axios { |
@@ -1,6 +1,6 @@ | ||
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | import utils from './../utils.js'; | |
| 3 | import utils from '../utils.js'; | |
| 4 | 4 | import buildURL from '../helpers/buildURL.js'; |
| 5 | 5 | import InterceptorManager from './InterceptorManager.js'; |
| 6 | 6 | import dispatchRequest from './dispatchRequest.js'; |
@@ -159,8 +159,13 @@ | ||
| 159 | 159 | |
| 160 | 160 | promise = Promise.resolve(config); |
| 161 | 161 | |
| 162 | let prevResult = config; | |
| 162 | 163 | while (i < len) { |
| 163 | promise = promise.then(chain[i++], chain[i++]); | |
| 164 | promise = promise | |
| 165 | .then(chain[i++]) | |
| 166 | .then(result => { prevResult = result !== undefined ? result : prevResult }) | |
| 167 | .catch(chain[i++]) | |
| 168 | .then(() => prevResult); | |
| 164 | 169 | } |
| 165 | 170 | |
| 166 | 171 | return promise; |
@@ -191,7 +196,7 @@ | ||
| 191 | 196 | len = responseInterceptorChain.length; |
| 192 | 197 | |
| 193 | 198 | while (i < len) { |
| 194 | promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); | |
| 199 | promise = promise.then(responseInterceptorChain[i++]).catch(responseInterceptorChain[i++]); | |
| 195 | 200 | } |
| 196 | 201 | |
| 197 | 202 | return promise; |
@@ -29,29 +29,26 @@ | ||
| 29 | 29 | * @returns {string} The formatted url |
| 30 | 30 | */ |
| 31 | 31 | export default function buildURL(url, params, options) { |
| 32 | /*eslint no-param-reassign:0*/ | |
| 33 | 32 | if (!params) { |
| 34 | 33 | return url; |
| 35 | 34 | } |
| 36 | ||
| 35 | ||
| 37 | 36 | const _encode = options && options.encode || encode; |
| 38 | 37 | |
| 39 | if (utils.isFunction(options)) { | |
| 40 | options = { | |
| 41 | serialize: options | |
| 42 | }; | |
| 43 | } | |
| 38 | const _options = utils.isFunction(options) ? { | |
| 39 | serialize: options | |
| 40 | } : options; | |
| 44 | 41 | |
| 45 | const serializeFn = options && options.serialize; | |
| 42 | const serializeFn = _options && _options.serialize; | |
| 46 | 43 | |
| 47 | 44 | let serializedParams; |
| 48 | 45 | |
| 49 | 46 | if (serializeFn) { |
| 50 | serializedParams = serializeFn(params, options); | |
| 47 | serializedParams = serializeFn(params, _options); | |
| 51 | 48 | } else { |
| 52 | 49 | serializedParams = utils.isURLSearchParams(params) ? |
| 53 | 50 | params.toString() : |
| 54 | new AxiosURLSearchParams(params, options).toString(_encode); | |
| 51 | new AxiosURLSearchParams(params, _options).toString(_encode); | |
| 55 | 52 | } |
| 56 | 53 | |
| 57 | 54 | if (serializedParams) { |
@@ -1,25 +1,22 @@ | ||
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | 3 | import AxiosError from '../core/AxiosError.js'; |
| 4 | import utils from '../utils.js'; | |
| 5 | 4 | |
| 6 | /** | |
| 7 | * A `CanceledError` is an object that is thrown when an operation is canceled. | |
| 8 | * | |
| 9 | * @param {string=} message The message. | |
| 10 | * @param {Object=} config The config. | |
| 11 | * @param {Object=} request The request. | |
| 12 | * | |
| 13 | * @returns {CanceledError} The created error. | |
| 14 | */ | |
| 15 | function CanceledError(message, config, request) { | |
| 16 | // eslint-disable-next-line no-eq-null,eqeqeq | |
| 17 | AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); | |
| 18 | this.name = 'CanceledError'; | |
| 5 | class CanceledError extends AxiosError { | |
| 6 | /** | |
| 7 | * A `CanceledError` is an object that is thrown when an operation is canceled. | |
| 8 | * | |
| 9 | * @param {string=} message The message. | |
| 10 | * @param {Object=} config The config. | |
| 11 | * @param {Object=} request The request. | |
| 12 | * | |
| 13 | * @returns {CanceledError} The created error. | |
| 14 | */ | |
| 15 | constructor(message, config, request) { | |
| 16 | super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); | |
| 17 | this.name = 'CanceledError'; | |
| 18 | this.__CANCEL__ = true; | |
| 19 | } | |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | utils.inherits(CanceledError, AxiosError, { | |
| 22 | __CANCEL__: true | |
| 23 | }); | |
| 24 | ||
| 25 | 22 | export default CanceledError; |
@@ -21,7 +21,7 @@ | ||
| 21 | 21 | |
| 22 | 22 | let timer = timeout && setTimeout(() => { |
| 23 | 23 | timer = null; |
| 24 | onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)) | |
| 24 | onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)) | |
| 25 | 25 | }, timeout) |
| 26 | 26 | |
| 27 | 27 | const unsubscribe = () => { |
@@ -1,7 +1,7 @@ | ||
| 1 | import utils from './../utils.js'; | |
| 2 | import settle from './../core/settle.js'; | |
| 1 | import utils from '../utils.js'; | |
| 2 | import settle from '../core/settle.js'; | |
| 3 | 3 | import buildFullPath from '../core/buildFullPath.js'; |
| 4 | import buildURL from './../helpers/buildURL.js'; | |
| 4 | import buildURL from '../helpers/buildURL.js'; | |
| 5 | 5 | import proxyFromEnv from 'proxy-from-env'; |
| 6 | 6 | import http from 'http'; |
| 7 | 7 | import https from 'https'; |
@@ -193,12 +193,16 @@ | ||
| 193 | 193 | |
| 194 | 194 | if (proxy.auth) { |
| 195 | 195 | // Support proxy auth object form |
| 196 | if (proxy.auth.username || proxy.auth.password) { | |
| 196 | const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password); | |
| 197 | ||
| 198 | if (validProxyAuth) { | |
| 197 | 199 | proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); |
| 200 | } else if (typeof proxy.auth === 'object') { | |
| 201 | throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, { proxy }); | |
| 198 | 202 | } |
| 199 | const base64 = Buffer | |
| 200 | .from(proxy.auth, 'utf8') | |
| 201 | .toString('base64'); | |
| 203 | ||
| 204 | const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64'); | |
| 205 | ||
| 202 | 206 | options.headers['Proxy-Authorization'] = 'Basic ' + base64; |
| 203 | 207 | } |
| 204 | 208 | |
@@ -264,8 +268,9 @@ | ||
| 264 | 268 | |
| 265 | 269 | const http2Transport = { |
| 266 | 270 | request(options, cb) { |
| 267 | const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80); | |
| 271 | const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80)); | |
| 268 | 272 | |
| 273 | ||
| 269 | 274 | const {http2Options, headers} = options; |
| 270 | 275 | |
| 271 | 276 | const session = http2Sessions.getSession(authority, http2Options); |
@@ -812,8 +817,6 @@ | ||
| 812 | 817 | |
| 813 | 818 | // Handle errors |
| 814 | 819 | req.on('error', function handleRequestError(err) { |
| 815 | // @todo remove | |
| 816 | // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; | |
| 817 | 820 | reject(AxiosError.from(err, null, config, req)); |
| 818 | 821 | }); |
| 819 | 822 | |
@@ -1,6 +1,6 @@ | ||
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | import utils from './../utils.js'; | |
| 3 | import utils from '../utils.js'; | |
| 4 | 4 | |
| 5 | 5 | class InterceptorManager { |
| 6 | 6 | constructor() { |
@@ -12,6 +12,7 @@ | ||
| 12 | 12 | * |
| 13 | 13 | * @param {Function} fulfilled The function to handle `then` for a `Promise` |
| 14 | 14 | * @param {Function} rejected The function to handle `reject` for a `Promise` |
| 15 | * @param {Object} options The options for the interceptor, synchronous and runWhen | |
| 15 | 16 | * |
| 16 | 17 | * @return {Number} An ID used to remove interceptor later |
| 17 | 18 | */ |
@@ -21,7 +21,7 @@ | ||
| 21 | 21 | |
| 22 | 22 | function getMergedValue(target, source, prop, caseless) { |
| 23 | 23 | if (utils.isPlainObject(target) && utils.isPlainObject(source)) { |
| 24 | return utils.merge.call({caseless}, target, source); | |
| 24 | return utils.merge.call({ caseless }, target, source); | |
| 25 | 25 | } else if (utils.isPlainObject(source)) { |
| 26 | 26 | return utils.merge({}, source); |
| 27 | 27 | } else if (utils.isArray(source)) { |
@@ -30,7 +30,6 @@ | ||
| 30 | 30 | return source; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | // eslint-disable-next-line consistent-return | |
| 34 | 33 | function mergeDeepProperties(a, b, prop, caseless) { |
| 35 | 34 | if (!utils.isUndefined(b)) { |
| 36 | 35 | return getMergedValue(a, b, prop, caseless); |
@@ -96,7 +95,7 @@ | ||
| 96 | 95 | headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) |
| 97 | 96 | }; |
| 98 | 97 | |
| 99 | utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { | |
| 98 | utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { | |
| 100 | 99 | const merge = mergeMap[prop] || mergeDeepProperties; |
| 101 | 100 | const configValue = merge(config1[prop], config2[prop], prop); |
| 102 | 101 | (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); |
@@ -252,10 +252,11 @@ | ||
| 252 | 252 | * If 'obj' is an Object callback will be called passing |
| 253 | 253 | * the value, key, and complete object for each property. |
| 254 | 254 | * |
| 255 | * @param {Object|Array} obj The object to iterate | |
| 255 | * @param {Object|Array<unknown>} obj The object to iterate | |
| 256 | 256 | * @param {Function} fn The callback to invoke for each item |
| 257 | 257 | * |
| 258 | * @param {Boolean} [allOwnKeys = false] | |
| 258 | * @param {Object} [options] | |
| 259 | * @param {Boolean} [options.allOwnKeys = false] | |
| 259 | 260 | * @returns {any} |
| 260 | 261 | */ |
| 261 | 262 | function forEach(obj, fn, {allOwnKeys = false} = {}) { |
@@ -332,7 +333,7 @@ | ||
| 332 | 333 | * Example: |
| 333 | 334 | * |
| 334 | 335 | * ```js |
| 335 | * var result = merge({foo: 123}, {foo: 456}); | |
| 336 | * const result = merge({foo: 123}, {foo: 456}); | |
| 336 | 337 | * console.log(result.foo); // outputs 456 |
| 337 | 338 | * ``` |
| 338 | 339 | * |
@@ -369,15 +370,26 @@ | ||
| 369 | 370 | * @param {Object} b The object to copy properties from |
| 370 | 371 | * @param {Object} thisArg The object to bind function to |
| 371 | 372 | * |
| 372 | * @param {Boolean} [allOwnKeys] | |
| 373 | * @param {Object} [options] | |
| 374 | * @param {Boolean} [options.allOwnKeys] | |
| 373 | 375 | * @returns {Object} The resulting value of object a |
| 374 | 376 | */ |
| 375 | 377 | const extend = (a, b, thisArg, {allOwnKeys}= {}) => { |
| 376 | 378 | forEach(b, (val, key) => { |
| 377 | 379 | if (thisArg && isFunction(val)) { |
| 378 | a[key] = bind(val, thisArg); | |
| 380 | Object.defineProperty(a, key, { | |
| 381 | value: bind(val, thisArg), | |
| 382 | writable: true, | |
| 383 | enumerable: true, | |
| 384 | configurable: true | |
| 385 | }); | |
| 379 | 386 | } else { |
| 380 | a[key] = val; | |
| 387 | Object.defineProperty(a, key, { | |
| 388 | value: val, | |
| 389 | writable: true, | |
| 390 | enumerable: true, | |
| 391 | configurable: true | |
| 392 | }); | |
| 381 | 393 | } |
| 382 | 394 | }, {allOwnKeys}); |
| 383 | 395 | return a; |
@@ -408,7 +420,12 @@ | ||
| 408 | 420 | */ |
| 409 | 421 | const inherits = (constructor, superConstructor, props, descriptors) => { |
| 410 | 422 | constructor.prototype = Object.create(superConstructor.prototype, descriptors); |
| 411 | constructor.prototype.constructor = constructor; | |
| 423 | Object.defineProperty(constructor.prototype, 'constructor', { | |
| 424 | value: constructor, | |
| 425 | writable: true, | |
| 426 | enumerable: false, | |
| 427 | configurable: true | |
| 428 | }); | |
| 412 | 429 | Object.defineProperty(constructor, 'super', { |
| 413 | 430 | value: superConstructor.prototype |
| 414 | 431 | }); |
@@ -1,5 +1,5 @@ | ||
| 1 | import utils from './../utils.js'; | |
| 2 | import settle from './../core/settle.js'; | |
| 1 | import utils from '../utils.js'; | |
| 2 | import settle from '../core/settle.js'; | |
| 3 | 3 | import transitionalDefaults from '../defaults/transitional.js'; |
| 4 | 4 | import AxiosError from '../core/AxiosError.js'; |
| 5 | 5 | import CanceledError from '../cancel/CanceledError.js'; |
@@ -1,14 +1,19 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "axios", |
| 3 | "version": "1.13.2", | |
| 3 | "version": "1.13.3", | |
| 4 | 4 | "description": "Promise based HTTP client for the browser and node.js", |
| 5 | "main": "index.js", | |
| 5 | "main": "./dist/node/axios.cjs", | |
| 6 | "module": "./index.js", | |
| 6 | 7 | "exports": { |
| 7 | 8 | ".": { |
| 8 | 9 | "types": { |
| 9 | 10 | "require": "./index.d.cts", |
| 10 | 11 | "default": "./index.d.ts" |
| 11 | 12 | }, |
| 13 | "bun": { | |
| 14 | "require": "./dist/node/axios.cjs", | |
| 15 | "default": "./index.js" | |
| 16 | }, | |
| 12 | 17 | "react-native": { |
| 13 | 18 | "require": "./dist/browser/axios.cjs", |
| 14 | 19 | "default": "./dist/esm/axios.js" |
@@ -42,6 +47,7 @@ | ||
| 42 | 47 | "scripts": { |
| 43 | 48 | "test": "npm run test:node && npm run test:browser && npm run test:package", |
| 44 | 49 | "test:node": "npm run test:mocha", |
| 50 | "test:node:coverage": "c8 npm run test:mocha", | |
| 45 | 51 | "test:browser": "npm run test:karma", |
| 46 | 52 | "test:package": "npm run test:eslint && npm run test:dtslint && npm run test:exports", |
| 47 | 53 | "test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js", |
@@ -108,6 +114,7 @@ | ||
| 108 | 114 | "abortcontroller-polyfill": "^1.7.5", |
| 109 | 115 | "auto-changelog": "^2.4.0", |
| 110 | 116 | "body-parser": "^1.20.2", |
| 117 | "c8": "^10.1.3", | |
| 111 | 118 | "chalk": "^5.3.0", |
| 112 | 119 | "coveralls": "^3.1.1", |
| 113 | 120 | "cross-env": "^7.0.3", |
@@ -235,5 +242,22 @@ | ||
| 235 | 242 | "extends": [ |
| 236 | 243 | "@commitlint/config-conventional" |
| 237 | 244 | ] |
| 245 | }, | |
| 246 | "c8": { | |
| 247 | "all": true, | |
| 248 | "include": [ | |
| 249 | "lib/**/*.js", | |
| 250 | "lib/**/*.ts" | |
| 251 | ], | |
| 252 | "exclude": [ | |
| 253 | "test", | |
| 254 | "sandbox" | |
| 255 | ], | |
| 256 | "reporter": [ | |
| 257 | "text", | |
| 258 | "lcov", | |
| 259 | "html" | |
| 260 | ], | |
| 261 | "report-dir": "./coverage" | |
| 238 | 262 | } |
| 239 | 263 | } |
@@ -1,5 +1,72 @@ | ||
| 1 | 1 | # Changelog |
| 2 | 2 | |
| 3 | ## [1.13.3](https://github.com/axios/axios/compare/v1.13.2...v1.13.3) (2026-01-20) | |
| 4 | ||
| 5 | ||
| 6 | ### Bug Fixes | |
| 7 | ||
| 8 | * **http2:** Use port 443 for HTTPS connections by default. ([#7256](https://github.com/axios/axios/issues/7256)) ([d7e6065](https://github.com/axios/axios/commit/d7e60653460480ffacecf85383012ca1baa6263e)) | |
| 9 | * **interceptor:** handle the error in the same interceptor ([#6269](https://github.com/axios/axios/issues/6269)) ([5945e40](https://github.com/axios/axios/commit/5945e40bb171d4ac4fc195df276cf952244f0f89)) | |
| 10 | * main field in package.json should correspond to cjs artifacts ([#5756](https://github.com/axios/axios/issues/5756)) ([7373fbf](https://github.com/axios/axios/commit/7373fbff24cd92ce650d99ff6f7fe08c2e2a0a04)) | |
| 11 | * **package.json:** add 'bun' package.json 'exports' condition. Load the Node.js build in Bun instead of the browser build ([#5754](https://github.com/axios/axios/issues/5754)) ([b89217e](https://github.com/axios/axios/commit/b89217e3e91de17a3d55e2b8f39ceb0e9d8aeda8)) | |
| 12 | * silentJSONParsing=false should throw on invalid JSON ([#7253](https://github.com/axios/axios/issues/7253)) ([#7257](https://github.com/axios/axios/issues/7257)) ([7d19335](https://github.com/axios/axios/commit/7d19335e43d6754a1a9a66e424f7f7da259895bf)) | |
| 13 | * turn AxiosError into a native error ([#5394](https://github.com/axios/axios/issues/5394)) ([#5558](https://github.com/axios/axios/issues/5558)) ([1c6a86d](https://github.com/axios/axios/commit/1c6a86dd2c0623ee1af043a8491dbc96d40e883b)) | |
| 14 | * **types:** add handlers to AxiosInterceptorManager interface ([#5551](https://github.com/axios/axios/issues/5551)) ([8d1271b](https://github.com/axios/axios/commit/8d1271b49fc226ed7defd07cd577bd69a55bb13a)) | |
| 15 | * **types:** restore AxiosError.cause type from unknown to Error ([#7327](https://github.com/axios/axios/issues/7327)) ([d8233d9](https://github.com/axios/axios/commit/d8233d9e8e9a64bfba9bbe01d475ba417510b82b)) | |
| 16 | * unclear error message is thrown when specifying an empty proxy authorization ([#6314](https://github.com/axios/axios/issues/6314)) ([6ef867e](https://github.com/axios/axios/commit/6ef867e684adf7fb2343e3b29a79078a3c76dc29)) | |
| 17 | ||
| 18 | ||
| 19 | ### Features | |
| 20 | ||
| 21 | * add `undefined` as a value in AxiosRequestConfig ([#5560](https://github.com/axios/axios/issues/5560)) ([095033c](https://github.com/axios/axios/commit/095033c626895ecdcda2288050b63dcf948db3bd)) | |
| 22 | * add automatic minor and patch upgrades to dependabot ([#6053](https://github.com/axios/axios/issues/6053)) ([65a7584](https://github.com/axios/axios/commit/65a7584eda6164980ddb8cf5372f0afa2a04c1ed)) | |
| 23 | * add Node.js coverage script using c8 (closes [#7289](https://github.com/axios/axios/issues/7289)) ([#7294](https://github.com/axios/axios/issues/7294)) ([ec9d94e](https://github.com/axios/axios/commit/ec9d94e9f88da13e9219acadf65061fb38ce080a)) | |
| 24 | * added copilot instructions ([3f83143](https://github.com/axios/axios/commit/3f83143bfe617eec17f9d7dcf8bafafeeae74c26)) | |
| 25 | * compatibility with frozen prototypes ([#6265](https://github.com/axios/axios/issues/6265)) ([860e033](https://github.com/axios/axios/commit/860e03396a536e9b926dacb6570732489c9d7012)) | |
| 26 | * enhance pipeFileToResponse with error handling ([#7169](https://github.com/axios/axios/issues/7169)) ([88d7884](https://github.com/axios/axios/commit/88d78842541610692a04282233933d078a8a2552)) | |
| 27 | * **types:** Intellisense for string literals in a widened union ([#6134](https://github.com/axios/axios/issues/6134)) ([f73474d](https://github.com/axios/axios/commit/f73474d02c5aa957b2daeecee65508557fd3c6e5)), closes [/github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329](https://github.com//github.com/microsoft/TypeScript/issues/33471/issues/issuecomment-1376364329) | |
| 28 | ||
| 29 | ||
| 30 | ### Reverts | |
| 31 | ||
| 32 | * Revert "fix: silentJSONParsing=false should throw on invalid JSON (#7253) (#7β¦" (#7298) ([a4230f5](https://github.com/axios/axios/commit/a4230f5581b3f58b6ff531b6dbac377a4fd7942a)), closes [#7253](https://github.com/axios/axios/issues/7253) [#7](https://github.com/axios/axios/issues/7) [#7298](https://github.com/axios/axios/issues/7298) | |
| 33 | * **deps:** bump peter-evans/create-pull-request from 7 to 8 in the github-actions group ([#7334](https://github.com/axios/axios/issues/7334)) ([2d6ad5e](https://github.com/axios/axios/commit/2d6ad5e48bd29b0b2b5e7e95fb473df98301543a)) | |
| 34 | ||
| 35 | ### Contributors to this release | |
| 36 | ||
| 37 | - <img src="https://avatars.githubusercontent.com/u/175160345?v=4&s=18" alt="avatar" width="18"/> [Ashvin Tiwari](https://github.com/ashvin2005 "+1752/-4 (#7218 #7218 )") | |
| 38 | - <img src="https://avatars.githubusercontent.com/u/71729144?v=4&s=18" alt="avatar" width="18"/> [Nikunj Mochi](https://github.com/mochinikunj "+940/-12 (#7294 #7294 )") | |
| 39 | - <img src="https://avatars.githubusercontent.com/u/128113546?v=4&s=18" alt="avatar" width="18"/> [Anchal Singh](https://github.com/imanchalsingh "+544/-102 (#7169 #7185 )") | |
| 40 | - <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [jasonsaayman](https://github.com/jasonsaayman "+317/-73 (#7334 #7298 )") | |
| 41 | - <img src="https://avatars.githubusercontent.com/u/377911?v=4&s=18" alt="avatar" width="18"/> [Julian Dax](https://github.com/brodo "+99/-120 (#5558 )") | |
| 42 | - <img src="https://avatars.githubusercontent.com/u/184285082?v=4&s=18" alt="avatar" width="18"/> [Akash Dhar Dubey](https://github.com/AKASHDHARDUBEY "+167/-0 (#7287 #7288 )") | |
| 43 | - <img src="https://avatars.githubusercontent.com/u/145687605?v=4&s=18" alt="avatar" width="18"/> [Madhumita](https://github.com/madhumitaaa "+20/-68 (#7198 )") | |
| 44 | - <img src="https://avatars.githubusercontent.com/u/24915252?v=4&s=18" alt="avatar" width="18"/> [Tackoil](https://github.com/Tackoil "+80/-2 (#6269 )") | |
| 45 | - <img src="https://avatars.githubusercontent.com/u/145078271?v=4&s=18" alt="avatar" width="18"/> [Justin Dhillon](https://github.com/justindhillon "+41/-41 (#6324 #6315 )") | |
| 46 | - <img src="https://avatars.githubusercontent.com/u/184138832?v=4&s=18" alt="avatar" width="18"/> [Rudransh](https://github.com/Rudrxxx "+71/-2 (#7257 )") | |
| 47 | - <img src="https://avatars.githubusercontent.com/u/146366930?v=4&s=18" alt="avatar" width="18"/> [WuMingDao](https://github.com/WuMingDao "+36/-36 (#7215 )") | |
| 48 | - <img src="https://avatars.githubusercontent.com/u/46827243?v=4&s=18" alt="avatar" width="18"/> [codenomnom](https://github.com/codenomnom "+70/-0 (#7201 #7201 )") | |
| 49 | - <img src="https://avatars.githubusercontent.com/u/189698992?v=4&s=18" alt="avatar" width="18"/> [Nandan Acharya](https://github.com/Nandann018-ux "+60/-10 (#7272 )") | |
| 50 | - <img src="https://avatars.githubusercontent.com/u/7225168?v=4&s=18" alt="avatar" width="18"/> [Eric DubΓ©](https://github.com/KernelDeimos "+22/-40 (#7042 )") | |
| 51 | - <img src="https://avatars.githubusercontent.com/u/915045?v=4&s=18" alt="avatar" width="18"/> [Tibor Pilz](https://github.com/tiborpilz "+40/-4 (#5551 )") | |
| 52 | - <img src="https://avatars.githubusercontent.com/u/23138717?v=4&s=18" alt="avatar" width="18"/> [Gabriel Quaresma](https://github.com/joaoGabriel55 "+31/-4 (#6314 )") | |
| 53 | - <img src="https://avatars.githubusercontent.com/u/21505?v=4&s=18" alt="avatar" width="18"/> [Turadg Aleahmad](https://github.com/turadg "+23/-6 (#6265 )") | |
| 54 | - <img src="https://avatars.githubusercontent.com/u/4273631?v=4&s=18" alt="avatar" width="18"/> [JohnTitor](https://github.com/kiritosan "+14/-14 (#6155 )") | |
| 55 | - <img src="https://avatars.githubusercontent.com/u/39668736?v=4&s=18" alt="avatar" width="18"/> [rohit miryala](https://github.com/rohitmiryala "+22/-0 (#7250 )") | |
| 56 | - <img src="https://avatars.githubusercontent.com/u/30316250?v=4&s=18" alt="avatar" width="18"/> [Wilson Mun](https://github.com/wmundev "+20/-0 (#6053 )") | |
| 57 | - <img src="https://avatars.githubusercontent.com/u/184506226?v=4&s=18" alt="avatar" width="18"/> [techcodie](https://github.com/techcodie "+7/-7 (#7236 )") | |
| 58 | - <img src="https://avatars.githubusercontent.com/u/187598667?v=4&s=18" alt="avatar" width="18"/> [Ved Vadnere](https://github.com/Archis009 "+5/-6 (#7283 )") | |
| 59 | - <img src="https://avatars.githubusercontent.com/u/115612815?v=4&s=18" alt="avatar" width="18"/> [svihpinc](https://github.com/svihpinc "+5/-3 (#6134 )") | |
| 60 | - <img src="https://avatars.githubusercontent.com/u/123884782?v=4&s=18" alt="avatar" width="18"/> [SANDESH LENDVE](https://github.com/mrsandy1965 "+3/-3 (#7246 )") | |
| 61 | - <img src="https://avatars.githubusercontent.com/u/12529395?v=4&s=18" alt="avatar" width="18"/> [Lubos](https://github.com/mrlubos "+5/-1 (#7312 )") | |
| 62 | - <img src="https://avatars.githubusercontent.com/u/709451?v=4&s=18" alt="avatar" width="18"/> [Jarred Sumner](https://github.com/Jarred-Sumner "+5/-1 (#5754 )") | |
| 63 | - <img src="https://avatars.githubusercontent.com/u/17907922?v=4&s=18" alt="avatar" width="18"/> [Adam Hines](https://github.com/thebanjomatic "+2/-1 (#5756 )") | |
| 64 | - <img src="https://avatars.githubusercontent.com/u/177472603?v=4&s=18" alt="avatar" width="18"/> [Subhan Kumar Rai](https://github.com/Subhan030 "+2/-1 (#7256 )") | |
| 65 | - <img src="https://avatars.githubusercontent.com/u/6473925?v=4&s=18" alt="avatar" width="18"/> [Joseph Frazier](https://github.com/josephfrazier "+1/-1 (#7311 )") | |
| 66 | - <img src="https://avatars.githubusercontent.com/u/184906930?v=4&s=18" alt="avatar" width="18"/> [KT0803](https://github.com/KT0803 "+0/-2 (#7229 )") | |
| 67 | - <img src="https://avatars.githubusercontent.com/u/6703955?v=4&s=18" alt="avatar" width="18"/> [Albie](https://github.com/AlbertoSadoc "+1/-1 (#5560 )") | |
| 68 | - <img src="https://avatars.githubusercontent.com/u/9452325?v=4&s=18" alt="avatar" width="18"/> [Jake Hayes](https://github.com/thejayhaykid "+1/-0 (#5999 )") | |
| 69 | ||
| 3 | 70 | ## [1.13.2](https://github.com/axios/axios/compare/v1.13.1...v1.13.2) (2025-11-04) |
| 4 | 71 | |
| 5 | 72 | |
@@ -1,4 +1,6 @@ | ||
| 1 | 1 | // TypeScript Version: 4.7 |
| 2 | type StringLiteralsOrString<Literals extends string> = Literals | (string & {}); | |
| 3 | ||
| 2 | 4 | export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; |
| 3 | 5 | |
| 4 | 6 | interface RawAxiosHeaders { |
@@ -302,7 +304,7 @@ | ||
| 302 | 304 | |
| 303 | 305 | type Milliseconds = number; |
| 304 | 306 | |
| 305 | type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {}); | |
| 307 | type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>; | |
| 306 | 308 | |
| 307 | 309 | type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; |
| 308 | 310 | |
@@ -317,7 +319,7 @@ | ||
| 317 | 319 | |
| 318 | 320 | export interface AxiosRequestConfig<D = any> { |
| 319 | 321 | url?: string; |
| 320 | method?: Method | string; | |
| 322 | method?: StringLiteralsOrString<Method>; | |
| 321 | 323 | baseURL?: string; |
| 322 | 324 | allowAbsoluteUrls?: boolean; |
| 323 | 325 | transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; |
@@ -332,7 +334,7 @@ | ||
| 332 | 334 | adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; |
| 333 | 335 | auth?: AxiosBasicCredentials; |
| 334 | 336 | responseType?: ResponseType; |
| 335 | responseEncoding?: responseEncoding | string; | |
| 337 | responseEncoding?: StringLiteralsOrString<responseEncoding>; | |
| 336 | 338 | xsrfCookieName?: string; |
| 337 | 339 | xsrfHeaderName?: string; |
| 338 | 340 | onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; |
@@ -348,7 +350,7 @@ | ||
| 348 | 350 | httpAgent?: any; |
| 349 | 351 | httpsAgent?: any; |
| 350 | 352 | proxy?: AxiosProxyConfig | false; |
| 351 | cancelToken?: CancelToken; | |
| 353 | cancelToken?: CancelToken | undefined; | |
| 352 | 354 | decompress?: boolean; |
| 353 | 355 | transitional?: TransitionalOptions; |
| 354 | 356 | signal?: GenericAbortSignal; |
@@ -429,7 +431,7 @@ | ||
| 429 | 431 | isAxiosError: boolean; |
| 430 | 432 | status?: number; |
| 431 | 433 | toJSON: () => object; |
| 432 | cause?: unknown; | |
| 434 | cause?: Error; | |
| 433 | 435 | event?: BrowserProgressEvent; |
| 434 | 436 | static from<T = unknown, D = any>( |
| 435 | 437 | error: Error | unknown, |
@@ -492,14 +494,32 @@ | ||
| 492 | 494 | runWhen?: (config: InternalAxiosRequestConfig) => boolean; |
| 493 | 495 | } |
| 494 | 496 | |
| 495 | type AxiosRequestInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number; | |
| 497 | type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>; | |
| 498 | type AxiosInterceptorRejected = (error: any) => any; | |
| 496 | 499 | |
| 497 | type AxiosResponseInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null) => number; | |
| 500 | type AxiosRequestInterceptorUse<T> = ( | |
| 501 | onFulfilled?: AxiosInterceptorFulfilled<T> | null, | |
| 502 | onRejected?: AxiosInterceptorRejected | null, | |
| 503 | options?: AxiosInterceptorOptions | |
| 504 | ) => number; | |
| 498 | 505 | |
| 506 | type AxiosResponseInterceptorUse<T> = ( | |
| 507 | onFulfilled?: AxiosInterceptorFulfilled<T> | null, | |
| 508 | onRejected?: AxiosInterceptorRejected | null | |
| 509 | ) => number; | |
| 510 | ||
| 511 | interface AxiosInterceptorHandler<T> { | |
| 512 | fulfilled: AxiosInterceptorFulfilled<T>; | |
| 513 | rejected?: AxiosInterceptorRejected; | |
| 514 | synchronous: boolean; | |
| 515 | runWhen: (config: AxiosRequestConfig) => boolean | null; | |
| 516 | } | |
| 517 | ||
| 499 | 518 | export interface AxiosInterceptorManager<V> { |
| 500 | 519 | use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>; |
| 501 | 520 | eject(id: number): void; |
| 502 | 521 | clear(): void; |
| 522 | handlers?: Array<AxiosInterceptorHandler<V>>; | |
| 503 | 523 | } |
| 504 | 524 | |
| 505 | 525 | export class Axios { |
Missing Verifiable Provenance
This version lacks the verifiable provenance found in axios@1.13.2. This is a significant trust regression and may indicate a manual publish or a hijacked package.