Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-retry

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-retry - npm Package Compare versions

Comparing version 3.1.2 to 3.1.4

82

index.d.ts
import * as axios from 'axios'
export interface IAxiosRetryConfig {
/**
* The number of times to retry before failing
* default: 3
*
* @type {number}
*/
retries?: number,
/**
* Defines if the timeout should be reset between retries
* default: false
*
* @type {boolean}
*/
shouldResetTimeout?: boolean,
/**
* A callback to further control if a request should be retried. By default, it retries if the result did not have a response.
* default: error => !error.response
*
* @type {Function}
*/
retryCondition?: (error: axios.AxiosError) => boolean,
/**
* A callback to further control the delay between retry requests. By default there is no delay.
*
* @type {Function}
*/
retryDelay?: (retryCount: number, error: axios.AxiosError) => number
}
export interface IAxiosRetry {
interface IAxiosRetry {
(
axios: axios.AxiosStatic | axios.AxiosInstance,
axiosRetryConfig?: IAxiosRetryConfig
): void
): void;
isNetworkError(error: Error): boolean;
isRetryableError(error: Error): boolean;
isSafeRequestError(error: Error): boolean;
isIdempotentRequestError(error: Error): boolean;
isNetworkOrIdempotentRequestError(error: Error): boolean;
exponentialDelay(retryNumber: number): number;
}
declare const axiosRetry: IAxiosRetry
declare namespace IAxiosRetry {
export interface IAxiosRetryConfig {
/**
* The number of times to retry before failing
* default: 3
*
* @type {number}
*/
retries?: number,
/**
* Defines if the timeout should be reset between retries
* default: false
*
* @type {boolean}
*/
shouldResetTimeout?: boolean,
/**
* A callback to further control if a request should be retried. By default, it retries if the result did not have a response.
* default: error => !error.response
*
* @type {Function}
*/
retryCondition?: (error: axios.AxiosError) => boolean,
/**
* A callback to further control the delay between retry requests. By default there is no delay.
*
* @type {Function}
*/
retryDelay?: (retryCount: number, error: axios.AxiosError) => number
}
}
export default axiosRetry
declare const axiosRetry: IAxiosRetry;
export function isNetworkError(error: Error): boolean;
export function isRetryableError(error: Error): boolean;
export function isSafeRequestError(error: Error): boolean;
export function isIdempotentRequestError(error: Error): boolean;
export function isNetworkOrIdempotentRequestError(error: Error): boolean;
export function exponentialDelay(retryNumber: number): number;
export = axiosRetry;
{
"name": "axios-retry",
"version": "3.1.2",
"version": "3.1.4",
"author": "Rubén Norte <ruben.norte@softonic.com>",

@@ -5,0 +5,0 @@ "description": "Axios plugin that intercepts failed requests and retries them whenever posible.",

@@ -13,2 +13,5 @@ # axios-retry

### Note
Not working with `axios 0.19.0`. For details see the [bug](https://github.com/axios/axios/issues/2203). [`axios 0.19.1`](https://github.com/axios/axios/releases/tag/0.19.1) has fixed this bug.
## Usage

@@ -15,0 +18,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc