@@ -10,7 +10,7 @@ import {
1010import { AUTH_BIND_URL , OAUTH_REDIRECT } from "constants/routesURL" ;
1111import log from "loglevel" ;
1212import history from "util/history" ;
13- import axios , { AxiosError , AxiosRequestConfig , AxiosResponse } from "axios" ;
13+ import axios , { AxiosError , AxiosRequestConfig , AxiosResponse , InternalAxiosRequestConfig } from "axios" ;
1414import { trans } from "i18n" ;
1515import StoreRegistry from "redux/store/storeRegistry" ;
1616import { logoutAction } from "redux/reduxActions/userActions" ;
@@ -20,7 +20,7 @@ const executeActionRegex = /query\/execute/;
2020const timeoutErrorRegex = / t i m e o u t o f ( \d + ) m s e x c e e d e d / ;
2121export const axiosConnectionAbortedCode = "ECONNABORTED" ;
2222
23- type AxiosRequestConfigWithTimer = AxiosRequestConfig & { timer : number } ;
23+ type AxiosRequestConfigWithTimer = InternalAxiosRequestConfig & { timer : number } ;
2424
2525export type AxiosResponseWithTimer = AxiosResponse < ApiResponse > & {
2626 config : AxiosRequestConfigWithTimer ;
@@ -37,7 +37,7 @@ export type AxiosErrorWithTimer = AxiosError<ApiResponse> & {
3737} ;
3838
3939function isAxiosErrorWithTimer ( error : any ) : error is AxiosErrorWithTimer {
40- return axios . isAxiosError ( error ) && error ?. config && "timer" in error . config ;
40+ return Boolean ( axios . isAxiosError ( error ) && error ?. config && "timer" in error . config ) ;
4141}
4242
4343const makeExecuteActionResponse = ( response : any ) => {
@@ -68,7 +68,7 @@ const notNeedBindPath = () => {
6868 return pathName === AUTH_BIND_URL || pathName === OAUTH_REDIRECT ;
6969} ;
7070
71- export const apiRequestInterceptor = ( config : AxiosRequestConfig ) : AxiosRequestConfigWithTimer => ( {
71+ export const apiRequestInterceptor = ( config : InternalAxiosRequestConfig ) : AxiosRequestConfigWithTimer => ( {
7272 ...config ,
7373 timer : performance . now ( ) ,
7474} ) ;
0 commit comments