mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-11 01:14:30 +08:00
Update axios to 0.18.1 [SCI-3589] (#1859)
Update axios to 0.18.1 [SCI-3589]
This commit is contained in:
commit
4e05d720e9
3 changed files with 77 additions and 34 deletions
|
@ -1,10 +1,17 @@
|
||||||
// flow-typed signature: 783541c5bb930cc2cb39610705a4adc1
|
// 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 {
|
declare interface ProxyConfig {
|
||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
|
auth?: {
|
||||||
|
username: string,
|
||||||
|
password: string
|
||||||
|
};
|
||||||
}
|
}
|
||||||
declare interface Cancel {
|
declare interface Cancel {
|
||||||
constructor(message?: string): Cancel;
|
constructor(message?: string): Cancel;
|
||||||
|
@ -17,7 +24,7 @@ declare module 'axios' {
|
||||||
token: CancelToken;
|
token: CancelToken;
|
||||||
cancel: Canceler;
|
cancel: Canceler;
|
||||||
}
|
}
|
||||||
declare interface CancelToken {
|
declare class CancelToken {
|
||||||
constructor(executor: (cancel: Canceler) => void): CancelToken;
|
constructor(executor: (cancel: Canceler) => void): CancelToken;
|
||||||
static source(): CancelTokenSource;
|
static source(): CancelTokenSource;
|
||||||
promise: Promise<Cancel>;
|
promise: Promise<Cancel>;
|
||||||
|
@ -30,22 +37,28 @@ declare module 'axios' {
|
||||||
username: string,
|
username: string,
|
||||||
password: string
|
password: string
|
||||||
};
|
};
|
||||||
baseURL?: string,
|
baseURL?: string;
|
||||||
cancelToken?: CancelToken;
|
cancelToken?: CancelToken;
|
||||||
headers?: Object;
|
headers?: Object;
|
||||||
httpAgent?: mixed; // Missing the type in the core flow node libdef
|
httpAgent?: mixed; // Missing the type in the core flow node libdef
|
||||||
httpsAgent?: mixed; // Missing the type in the core flow node libdef
|
httpsAgent?: mixed; // Missing the type in the core flow node libdef
|
||||||
maxContentLength?: number;
|
maxContentLength?: number;
|
||||||
maxRedirects?: 5,
|
maxRedirects?: number;
|
||||||
params?: Object;
|
params?: Object;
|
||||||
paramsSerializer?: (params: Object) => string;
|
paramsSerializer?: (params: Object) => string;
|
||||||
progress?: (progressEvent: Event) => void | mixed;
|
progress?: (progressEvent: Event) => void | mixed;
|
||||||
proxy?: ProxyConfig;
|
proxy?: ProxyConfig | false;
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
responseType?:
|
||||||
|
| "arraybuffer"
|
||||||
|
| "blob"
|
||||||
|
| "document"
|
||||||
|
| "json"
|
||||||
|
| "text"
|
||||||
|
| "stream";
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
transformRequest?: Array<<U>(data: T) => U|Array<<U>(data: T) => U>>;
|
transformRequest?: AxiosTransformer<T> | Array<AxiosTransformer<T>>;
|
||||||
transformResponse?: Array<<U>(data: T) => U>;
|
transformResponse?: AxiosTransformer<T> | Array<AxiosTransformer<T>>;
|
||||||
validateStatus?: (status: number) => boolean,
|
validateStatus?: (status: number) => boolean;
|
||||||
withCredentials?: boolean;
|
withCredentials?: boolean;
|
||||||
xsrfCookieName?: string;
|
xsrfCookieName?: string;
|
||||||
xsrfHeaderName?: string;
|
xsrfHeaderName?: string;
|
||||||
|
@ -62,46 +75,64 @@ declare module 'axios' {
|
||||||
data: T;
|
data: T;
|
||||||
headers?: Object;
|
headers?: Object;
|
||||||
status: number;
|
status: number;
|
||||||
statusText: string,
|
statusText: string;
|
||||||
request: http$ClientRequest | XMLHttpRequest
|
request: http$ClientRequest | XMLHttpRequest;
|
||||||
}
|
}
|
||||||
declare type $AxiosXHR<T> = AxiosXHR<T>;
|
declare type $AxiosXHR<T> = AxiosXHR<T>;
|
||||||
declare class AxiosInterceptorIdent extends String {}
|
declare type AxiosInterceptorIdent = number;
|
||||||
declare class AxiosRequestInterceptor<T> {
|
declare class AxiosRequestInterceptor<T> {
|
||||||
use(
|
use(
|
||||||
successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
|
successHandler: ?(
|
||||||
errorHandler: ?(error: mixed) => mixed,
|
response: AxiosXHRConfig<T>
|
||||||
|
) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
|
||||||
|
errorHandler: ?(error: mixed) => mixed
|
||||||
): AxiosInterceptorIdent;
|
): AxiosInterceptorIdent;
|
||||||
eject(ident: AxiosInterceptorIdent): void;
|
eject(ident: AxiosInterceptorIdent): void;
|
||||||
}
|
}
|
||||||
declare class AxiosResponseInterceptor<T> {
|
declare class AxiosResponseInterceptor<T> {
|
||||||
use(
|
use(
|
||||||
successHandler: ?(response: AxiosXHR<T>) => mixed,
|
successHandler: ?(response: AxiosXHR<T>) => mixed,
|
||||||
errorHandler: ?(error: $AxiosError<any>) => mixed,
|
errorHandler: ?(error: $AxiosError<any>) => mixed
|
||||||
): AxiosInterceptorIdent;
|
): AxiosInterceptorIdent;
|
||||||
eject(ident: AxiosInterceptorIdent): void;
|
eject(ident: AxiosInterceptorIdent): void;
|
||||||
}
|
}
|
||||||
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
|
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
|
||||||
declare class Axios {
|
declare class Axios {
|
||||||
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
|
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>;
|
request<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
|
||||||
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
||||||
get<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>;
|
head<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
||||||
post<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
post<T>(
|
||||||
put<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
url: string,
|
||||||
patch<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
|
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: {
|
interceptors: {
|
||||||
request: AxiosRequestInterceptor<mixed>,
|
request: AxiosRequestInterceptor<mixed>,
|
||||||
response: AxiosResponseInterceptor<mixed>,
|
response: AxiosResponseInterceptor<mixed>
|
||||||
};
|
};
|
||||||
defaults: AxiosXHRConfig<*> & { headers: Object };
|
defaults: { headers: Object } & AxiosXHRConfig<*>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class AxiosError<T> extends Error {
|
declare class AxiosError<T> extends Error {
|
||||||
config: AxiosXHRConfig<T>;
|
config: AxiosXHRConfig<T>;
|
||||||
response: AxiosXHR<T>;
|
request?: http$ClientRequest | XMLHttpRequest;
|
||||||
|
response?: AxiosXHR<T>;
|
||||||
code?: string;
|
code?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +145,7 @@ declare module 'axios' {
|
||||||
isCancel(value: any): boolean;
|
isCancel(value: any): boolean;
|
||||||
create(config?: AxiosXHRConfigBase<any>): Axios;
|
create(config?: AxiosXHRConfigBase<any>): Axios;
|
||||||
all: typeof Promise.all;
|
all: typeof Promise.all;
|
||||||
spread(callback: Function): (arr: Array<any>) => Function
|
spread(callback: Function): (arr: Array<any>) => Function;
|
||||||
}
|
}
|
||||||
declare module.exports: AxiosExport;
|
declare module.exports: AxiosExport;
|
||||||
}
|
}
|
|
@ -44,7 +44,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rails/webpacker": "^3.5.5",
|
"@rails/webpacker": "^3.5.5",
|
||||||
"autoprefixer": "^7.2.6",
|
"autoprefixer": "^7.2.6",
|
||||||
"axios": "^0.16.2",
|
"axios": "0.18.1",
|
||||||
"babel-core": "^6.26.3",
|
"babel-core": "^6.26.3",
|
||||||
"babel-loader": "^7.1.5",
|
"babel-loader": "^7.1.5",
|
||||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||||
|
@ -58,8 +58,8 @@
|
||||||
"coffee-loader": "^0.8.0",
|
"coffee-loader": "^0.8.0",
|
||||||
"coffeescript": "^1.12.6",
|
"coffeescript": "^1.12.6",
|
||||||
"compression-webpack-plugin": "^1.1.11",
|
"compression-webpack-plugin": "^1.1.11",
|
||||||
"css-loader": "^0.28.11",
|
|
||||||
"croppie": "^2.6.4",
|
"croppie": "^2.6.4",
|
||||||
|
"css-loader": "^0.28.11",
|
||||||
"extract-text-webpack-plugin": "^3.0.2",
|
"extract-text-webpack-plugin": "^3.0.2",
|
||||||
"fabric": "1.6.7",
|
"fabric": "1.6.7",
|
||||||
"file-loader": "^0.11.2",
|
"file-loader": "^0.11.2",
|
||||||
|
|
28
yarn.lock
28
yarn.lock
|
@ -578,13 +578,13 @@ aws4@^1.8.0:
|
||||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||||
|
|
||||||
axios@^0.16.2:
|
axios@0.18.1:
|
||||||
version "0.16.2"
|
version "0.18.1"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.16.2.tgz#ba4f92f17167dfbab40983785454b9ac149c3c6d"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3"
|
||||||
integrity sha1-uk+S8XFn37q0CYN4VFS5rBScPG0=
|
integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects "^1.2.3"
|
follow-redirects "1.5.10"
|
||||||
is-buffer "^1.1.5"
|
is-buffer "^2.0.2"
|
||||||
|
|
||||||
axobject-query@^0.1.0:
|
axobject-query@^0.1.0:
|
||||||
version "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:
|
dependencies:
|
||||||
ms "2.0.0"
|
ms "2.0.0"
|
||||||
|
|
||||||
debug@3.1.0:
|
debug@3.1.0, debug@=3.1.0:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||||
|
@ -3714,7 +3714,14 @@ flush-write-stream@^1.0.0:
|
||||||
inherits "^2.0.3"
|
inherits "^2.0.3"
|
||||||
readable-stream "^2.3.6"
|
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"
|
version "1.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76"
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76"
|
||||||
integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==
|
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"
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
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:
|
is-callable@^1.1.4:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
||||||
|
|
Loading…
Reference in a new issue