From 99906e57b9b65d72a331040cecfc5f393db9f640 Mon Sep 17 00:00:00 2001 From: Hazork Date: Thu, 28 Oct 2021 11:40:15 -0300 Subject: [PATCH] deps: bump axios to v0.24 --- README.md | 7 ++++--- package.json | 4 ++-- src/cache/axios.ts | 20 ++++++++++---------- src/cache/cache.ts | 2 +- src/interceptors/request.ts | 2 +- yarn.lock | 8 ++++---- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index b656ada..b49f4ed 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,15 @@ yarn add axios axios-cache-interceptor ## Support list Below you can check what version of this package is supported by your version of axios. -But that does not mean that won't work with any version. Most of "breaking changes" made -by axios was it's types. +But that does not mean that won't work with any version. **Most of "breaking changes" made +by axios was it's types.** > **NOTE**: Below v0.3, axios was not configured as a peer dependency | [Version](https://github.com/ArthurFiorette/axios-cache-interceptor/releases) | [Axios](https://github.com/axios/axios/releases) | | ----------------------------------------------------------------------------- | ------------------------------------------------ | -| `~v0.4` | `>= v0.32` | +| `~v0.5` | `>= v0.24` | +| `~v0.4` | `>= v0.23` | | `~v0.3` | `>= v0.22` | | `<= v0.2` | `v0.21` | diff --git a/package.json b/package.json index 651ac77..2630d1c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@typescript-eslint/eslint-plugin": "^4.31.2", "@typescript-eslint/parser": "^4.31.2", "auto-changelog": "^2.3.0", - "axios": "^0.23.0", + "axios": "^0.24.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", @@ -61,6 +61,6 @@ "typescript": "^4.4.3" }, "peerDependencies": { - "axios": "~0.23.0" + "axios": "~0.24.0" } } diff --git a/src/cache/axios.ts b/src/cache/axios.ts index d3916ae..a152b72 100644 --- a/src/cache/axios.ts +++ b/src/cache/axios.ts @@ -60,14 +60,14 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - (config: CacheRequestConfig): Promise< + (config: CacheRequestConfig): Promise< CacheAxiosResponse >; /** * @template R The type returned by this response * @template D The type that the request body use */ - (url: string, config?: CacheRequestConfig): Promise< + (url: string, config?: CacheRequestConfig): Promise< CacheAxiosResponse >; @@ -89,7 +89,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - request( + request( config: CacheRequestConfig ): Promise>; @@ -97,7 +97,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - get( + get( url: string, config?: CacheRequestConfig ): Promise>; @@ -106,7 +106,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - delete( + delete( url: string, config?: CacheRequestConfig ): Promise>; @@ -115,7 +115,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - head( + head( url: string, config?: CacheRequestConfig ): Promise>; @@ -124,7 +124,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - options( + options( url: string, config?: CacheRequestConfig ): Promise>; @@ -133,7 +133,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - post( + post( url: string, data?: D, config?: CacheRequestConfig @@ -143,7 +143,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - put( + put( url: string, data?: D, config?: CacheRequestConfig @@ -153,7 +153,7 @@ export interface AxiosCacheInstance extends CacheInstance { * @template R The type returned by this response * @template D The type that the request body use */ - patch( + patch( url: string, data?: D, config?: CacheRequestConfig diff --git a/src/cache/cache.ts b/src/cache/cache.ts index 6f3b973..afbb3b2 100644 --- a/src/cache/cache.ts +++ b/src/cache/cache.ts @@ -97,5 +97,5 @@ export interface CacheInstance { /** * The response interceptor that will be used to handle the cache. */ - responseInterceptor: AxiosInterceptor>; + responseInterceptor: AxiosInterceptor>; } diff --git a/src/interceptors/request.ts b/src/interceptors/request.ts index 7749c67..7abd9c7 100644 --- a/src/interceptors/request.ts +++ b/src/interceptors/request.ts @@ -100,7 +100,7 @@ export class CacheRequestInterceptor * Even though the response interceptor receives this one from * here, it has been configured to ignore cached responses: true */ - Promise.resolve>({ + Promise.resolve>({ config: config, data: cachedResponse.data, headers: cachedResponse.headers, diff --git a/yarn.lock b/yarn.lock index 9367890..73faa42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -893,10 +893,10 @@ auto-changelog@^2.3.0: parse-github-url "^1.0.2" semver "^6.3.0" -axios@^0.23.0: - version "0.23.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.23.0.tgz#b0fa5d0948a8d1d75e3d5635238b6c4625b05149" - integrity sha512-NmvAE4i0YAv5cKq8zlDoPd1VLKAqX5oLuZKs8xkJa4qi6RGn0uhCYFjWtHHC9EM/MwOwYWOs53W+V0aqEXq1sg== +axios@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" + integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== dependencies: follow-redirects "^1.14.4"