deps: bump axios to v0.24

This commit is contained in:
Hazork 2021-10-28 11:40:15 -03:00
parent 28e3392808
commit 99906e57b9
6 changed files with 22 additions and 21 deletions

View File

@ -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` |

View File

@ -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"
}
}

20
src/cache/axios.ts vendored
View File

@ -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
*/
<R = unknown, D = any>(config: CacheRequestConfig<D>): Promise<
<R = any, D = any>(config: CacheRequestConfig<D>): Promise<
CacheAxiosResponse<R, D>
>;
/**
* @template R The type returned by this response
* @template D The type that the request body use
*/
<R = unknown, D = any>(url: string, config?: CacheRequestConfig<D>): Promise<
<R = any, D = any>(url: string, config?: CacheRequestConfig<D>): Promise<
CacheAxiosResponse<R, D>
>;
@ -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<R = unknown, D = any>(
request<R = any, D = any>(
config: CacheRequestConfig<D>
): Promise<CacheAxiosResponse<R, D>>;
@ -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<R = unknown, D = any>(
get<R = any, D = any>(
url: string,
config?: CacheRequestConfig<D>
): Promise<CacheAxiosResponse<R, D>>;
@ -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<R = unknown, D = any>(
delete<R = any, D = any>(
url: string,
config?: CacheRequestConfig<D>
): Promise<CacheAxiosResponse<R, D>>;
@ -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<R = unknown, D = any>(
head<R = any, D = any>(
url: string,
config?: CacheRequestConfig<D>
): Promise<CacheAxiosResponse<R, D>>;
@ -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<R = unknown, D = any>(
options<R = any, D = any>(
url: string,
config?: CacheRequestConfig<D>
): Promise<CacheAxiosResponse<R, D>>;
@ -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<R = unknown, D = any>(
post<R = any, D = any>(
url: string,
data?: D,
config?: CacheRequestConfig<D>
@ -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<R = unknown, D = any>(
put<R = any, D = any>(
url: string,
data?: D,
config?: CacheRequestConfig<D>
@ -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<R = unknown, D = any>(
patch<R = any, D = any>(
url: string,
data?: D,
config?: CacheRequestConfig<D>

2
src/cache/cache.ts vendored
View File

@ -97,5 +97,5 @@ export interface CacheInstance {
/**
* The response interceptor that will be used to handle the cache.
*/
responseInterceptor: AxiosInterceptor<CacheAxiosResponse<unknown, any>>;
responseInterceptor: AxiosInterceptor<CacheAxiosResponse<any, any>>;
}

View File

@ -100,7 +100,7 @@ export class CacheRequestInterceptor<D>
* Even though the response interceptor receives this one from
* here, it has been configured to ignore cached responses: true
*/
Promise.resolve<CacheAxiosResponse<unknown, D>>({
Promise.resolve<CacheAxiosResponse<any, D>>({
config: config,
data: cachedResponse.data,
headers: cachedResponse.headers,

View File

@ -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"