Upgrade axios to 0.18.1

Closes SCI-3589
This commit is contained in:
Jure Grabnar 2019-06-18 16:34:22 +02:00
parent fb3b7918af
commit 72cf169989
3 changed files with 77 additions and 34 deletions

View file

@ -1,10 +1,17 @@
// flow-typed signature: 783541c5bb930cc2cb39610705a4adc1
// flow-typed version: d84de54b07/axios_v0.16.x/flow_>=v0.25.x
// flow-typed version: 8b766558cb/axios_v0.18.x/flow_>=v0.25.x
declare module 'axios' {
declare module "axios" {
declare interface AxiosTransformer<T> {
(data: T, headers?: Object): Object;
}
declare interface ProxyConfig {
host: string;
port: number;
auth?: {
username: string,
password: string
};
}
declare interface Cancel {
constructor(message?: string): Cancel;
@ -17,7 +24,7 @@ declare module 'axios' {
token: CancelToken;
cancel: Canceler;
}
declare interface CancelToken {
declare class CancelToken {
constructor(executor: (cancel: Canceler) => void): CancelToken;
static source(): CancelTokenSource;
promise: Promise<Cancel>;
@ -30,22 +37,28 @@ declare module 'axios' {
username: string,
password: string
};
baseURL?: string,
baseURL?: string;
cancelToken?: CancelToken;
headers?: Object;
httpAgent?: mixed; // Missing the type in the core flow node libdef
httpsAgent?: mixed; // Missing the type in the core flow node libdef
maxContentLength?: number;
maxRedirects?: 5,
maxRedirects?: number;
params?: Object;
paramsSerializer?: (params: Object) => string;
progress?: (progressEvent: Event) => void | mixed;
proxy?: ProxyConfig;
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
proxy?: ProxyConfig | false;
responseType?:
| "arraybuffer"
| "blob"
| "document"
| "json"
| "text"
| "stream";
timeout?: number;
transformRequest?: Array<<U>(data: T) => U|Array<<U>(data: T) => U>>;
transformResponse?: Array<<U>(data: T) => U>;
validateStatus?: (status: number) => boolean,
transformRequest?: AxiosTransformer<T> | Array<AxiosTransformer<T>>;
transformResponse?: AxiosTransformer<T> | Array<AxiosTransformer<T>>;
validateStatus?: (status: number) => boolean;
withCredentials?: boolean;
xsrfCookieName?: string;
xsrfHeaderName?: string;
@ -62,46 +75,64 @@ declare module 'axios' {
data: T;
headers?: Object;
status: number;
statusText: string,
request: http$ClientRequest | XMLHttpRequest
statusText: string;
request: http$ClientRequest | XMLHttpRequest;
}
declare type $AxiosXHR<T> = AxiosXHR<T>;
declare class AxiosInterceptorIdent extends String {}
declare type AxiosInterceptorIdent = number;
declare class AxiosRequestInterceptor<T> {
use(
successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
errorHandler: ?(error: mixed) => mixed,
successHandler: ?(
response: AxiosXHRConfig<T>
) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
errorHandler: ?(error: mixed) => mixed
): AxiosInterceptorIdent;
eject(ident: AxiosInterceptorIdent): void;
}
declare class AxiosResponseInterceptor<T> {
use(
successHandler: ?(response: AxiosXHR<T>) => mixed,
errorHandler: ?(error: $AxiosError<any>) => mixed,
errorHandler: ?(error: $AxiosError<any>) => mixed
): AxiosInterceptorIdent;
eject(ident: AxiosInterceptorIdent): void;
}
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
declare class Axios {
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
$call: <T>(config: AxiosXHRConfig<T> | string, config?: AxiosXHRConfig<T>) => AxiosPromise<T>;
$call: <T>(
config: AxiosXHRConfig<T> | string,
config?: AxiosXHRConfig<T>
) => AxiosPromise<T>;
request<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
get<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
head<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
post<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
put<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
patch<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
post<T>(
url: string,
data?: mixed,
config?: AxiosXHRConfigBase<T>
): AxiosPromise<T>;
put<T>(
url: string,
data?: mixed,
config?: AxiosXHRConfigBase<T>
): AxiosPromise<T>;
patch<T>(
url: string,
data?: mixed,
config?: AxiosXHRConfigBase<T>
): AxiosPromise<T>;
interceptors: {
request: AxiosRequestInterceptor<mixed>,
response: AxiosResponseInterceptor<mixed>,
response: AxiosResponseInterceptor<mixed>
};
defaults: AxiosXHRConfig<*> & { headers: Object };
defaults: { headers: Object } & AxiosXHRConfig<*>;
}
declare class AxiosError<T> extends Error {
config: AxiosXHRConfig<T>;
response: AxiosXHR<T>;
request?: http$ClientRequest | XMLHttpRequest;
response?: AxiosXHR<T>;
code?: string;
}
@ -114,7 +145,7 @@ declare module 'axios' {
isCancel(value: any): boolean;
create(config?: AxiosXHRConfigBase<any>): Axios;
all: typeof Promise.all;
spread(callback: Function): (arr: Array<any>) => Function
spread(callback: Function): (arr: Array<any>) => Function;
}
declare module.exports: AxiosExport;
}

View file

@ -44,7 +44,7 @@
"dependencies": {
"@rails/webpacker": "^3.5.5",
"autoprefixer": "^7.2.6",
"axios": "^0.16.2",
"axios": "0.18.1",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
@ -58,8 +58,8 @@
"coffee-loader": "^0.8.0",
"coffeescript": "^1.12.6",
"compression-webpack-plugin": "^1.1.11",
"css-loader": "^0.28.11",
"croppie": "^2.6.4",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^3.0.2",
"fabric": "1.6.7",
"file-loader": "^0.11.2",

View file

@ -578,13 +578,13 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
axios@^0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.16.2.tgz#ba4f92f17167dfbab40983785454b9ac149c3c6d"
integrity sha1-uk+S8XFn37q0CYN4VFS5rBScPG0=
axios@0.18.1:
version "0.18.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3"
integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==
dependencies:
follow-redirects "^1.2.3"
is-buffer "^1.1.5"
follow-redirects "1.5.10"
is-buffer "^2.0.2"
axobject-query@^0.1.0:
version "0.1.0"
@ -2504,7 +2504,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.
dependencies:
ms "2.0.0"
debug@3.1.0:
debug@3.1.0, debug@=3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
@ -3714,7 +3714,14 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"
follow-redirects@^1.0.0, follow-redirects@^1.2.3:
follow-redirects@1.5.10:
version "1.5.10"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
dependencies:
debug "=3.1.0"
follow-redirects@^1.0.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76"
integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==
@ -4588,6 +4595,11 @@ is-buffer@^1.1.5, is-buffer@~1.1.1:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-buffer@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==
is-callable@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"