axios 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/dist/axios.js +2 -2
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +2 -2
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +2 -2
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +2 -2
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +83 -64
- package/index.d.ts +84 -65
- package/lib/env/data.js +1 -1
- package/package.json +1 -1
- package/lib/.DS_Store +0 -0
package/index.d.cts
CHANGED
@@ -1,28 +1,22 @@
|
|
1
1
|
type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
2
|
-
type RawAxiosHeaders = Record<string, AxiosHeaderValue>;
|
3
2
|
|
4
|
-
|
5
|
-
[
|
6
|
-
};
|
7
|
-
|
8
|
-
interface CommonHeaders {
|
9
|
-
common: AxiosHeaders;
|
3
|
+
interface RawAxiosHeaders {
|
4
|
+
[key: string]: AxiosHeaderValue;
|
10
5
|
}
|
11
6
|
|
12
|
-
type
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
type AxiosHeaderGetter = ((parser?: RegExp) => RegExpExecArray | null) |
|
17
|
-
((matcher?: AxiosHeaderMatcher) => AxiosHeaderValue);
|
7
|
+
type MethodsHeaders = Partial<{
|
8
|
+
[Key in axios.Method as Lowercase<Key>]: AxiosHeaders;
|
9
|
+
} & {common: AxiosHeaders}>;
|
18
10
|
|
19
|
-
type
|
11
|
+
type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
|
20
12
|
|
21
13
|
declare class AxiosHeaders {
|
22
14
|
constructor(
|
23
15
|
headers?: RawAxiosHeaders | AxiosHeaders
|
24
16
|
);
|
25
17
|
|
18
|
+
[key: string]: any;
|
19
|
+
|
26
20
|
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
27
21
|
set(headers?: RawAxiosHeaders | AxiosHeaders, rewrite?: boolean): AxiosHeaders;
|
28
22
|
|
@@ -37,7 +31,7 @@ declare class AxiosHeaders {
|
|
37
31
|
|
38
32
|
normalize(format: boolean): AxiosHeaders;
|
39
33
|
|
40
|
-
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
34
|
+
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
41
35
|
|
42
36
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
43
37
|
|
@@ -45,39 +39,51 @@ declare class AxiosHeaders {
|
|
45
39
|
|
46
40
|
static accessor(header: string | string[]): AxiosHeaders;
|
47
41
|
|
48
|
-
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
42
|
+
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
43
|
+
|
44
|
+
setContentType(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
45
|
+
getContentType(parser?: RegExp): RegExpExecArray | null;
|
46
|
+
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
47
|
+
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
50
|
+
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
51
|
+
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
52
|
+
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
55
|
+
getAccept(parser?: RegExp): RegExpExecArray | null;
|
56
|
+
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
57
|
+
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
60
|
+
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
61
|
+
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
62
|
+
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
-
|
64
|
+
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
65
|
+
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
66
|
+
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
67
|
+
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
70
|
+
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
71
|
+
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
72
|
+
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
73
|
+
|
74
|
+
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
69
75
|
}
|
70
76
|
|
71
77
|
declare class AxiosError<T = unknown, D = any> extends Error {
|
72
78
|
constructor(
|
73
79
|
message?: string,
|
74
80
|
code?: string,
|
75
|
-
config?: axios.
|
81
|
+
config?: axios.InternalAxiosRequestConfig<D>,
|
76
82
|
request?: any,
|
77
83
|
response?: axios.AxiosResponse<T, D>
|
78
84
|
);
|
79
85
|
|
80
|
-
config?: axios.
|
86
|
+
config?: axios.InternalAxiosRequestConfig<D>;
|
81
87
|
code?: string;
|
82
88
|
request?: any;
|
83
89
|
response?: axios.AxiosResponse<T, D>;
|
@@ -103,24 +109,24 @@ declare class CanceledError<T> extends AxiosError<T> {
|
|
103
109
|
}
|
104
110
|
|
105
111
|
declare class Axios {
|
106
|
-
constructor(config?: axios.
|
112
|
+
constructor(config?: axios.AxiosRequestConfig);
|
107
113
|
defaults: axios.AxiosDefaults;
|
108
114
|
interceptors: {
|
109
|
-
request: axios.AxiosInterceptorManager<axios.
|
115
|
+
request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig>;
|
110
116
|
response: axios.AxiosInterceptorManager<axios.AxiosResponse>;
|
111
117
|
};
|
112
|
-
getUri(config?: axios.
|
113
|
-
request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.
|
114
|
-
get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.
|
115
|
-
delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.
|
116
|
-
head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.
|
117
|
-
options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.
|
118
|
-
post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
119
|
-
put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
120
|
-
patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
121
|
-
postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
122
|
-
putForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
123
|
-
patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.
|
118
|
+
getUri(config?: axios.AxiosRequestConfig): string;
|
119
|
+
request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.AxiosRequestConfig<D>): Promise<R>;
|
120
|
+
get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
121
|
+
delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
122
|
+
head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
123
|
+
options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
124
|
+
post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
125
|
+
put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
126
|
+
patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
127
|
+
postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
128
|
+
putForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
129
|
+
patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
124
130
|
}
|
125
131
|
|
126
132
|
declare enum HttpStatusCode {
|
@@ -194,26 +200,36 @@ type InternalAxiosError<T = unknown, D = any> = AxiosError<T, D>;
|
|
194
200
|
declare namespace axios {
|
195
201
|
type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>;
|
196
202
|
|
197
|
-
type
|
203
|
+
type CommonRequestHeadersList = 'Accept' | 'Content-Type' | 'Content-Length' | 'User-Agent'| 'Content-Encoding';
|
204
|
+
|
205
|
+
type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
206
|
+
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
207
|
+
}>;
|
198
208
|
|
199
209
|
type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
200
210
|
|
201
|
-
type
|
202
|
-
|
203
|
-
|
211
|
+
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
212
|
+
|
213
|
+
type RawCommonResponseHeaders = {
|
214
|
+
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
215
|
+
} & {
|
216
|
+
"set-cookie": string[];
|
217
|
+
};
|
218
|
+
|
219
|
+
type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
204
220
|
|
205
221
|
type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
206
222
|
|
207
223
|
interface AxiosRequestTransformer {
|
208
|
-
(this:
|
224
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
209
225
|
}
|
210
226
|
|
211
227
|
interface AxiosResponseTransformer {
|
212
|
-
(this:
|
228
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
213
229
|
}
|
214
230
|
|
215
231
|
interface AxiosAdapter {
|
216
|
-
(config:
|
232
|
+
(config: InternalAxiosRequestConfig): AxiosPromise;
|
217
233
|
}
|
218
234
|
|
219
235
|
interface AxiosBasicCredentials {
|
@@ -342,13 +358,13 @@ declare namespace axios {
|
|
342
358
|
|
343
359
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
344
360
|
|
345
|
-
interface
|
361
|
+
interface AxiosRequestConfig<D = any> {
|
346
362
|
url?: string;
|
347
363
|
method?: Method | string;
|
348
364
|
baseURL?: string;
|
349
365
|
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
350
366
|
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
351
|
-
headers?: RawAxiosRequestHeaders | AxiosHeaders;
|
367
|
+
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
352
368
|
params?: any;
|
353
369
|
paramsSerializer?: ParamsSerializerOptions;
|
354
370
|
data?: D;
|
@@ -384,7 +400,10 @@ declare namespace axios {
|
|
384
400
|
formSerializer?: FormSerializerOptions;
|
385
401
|
}
|
386
402
|
|
387
|
-
|
403
|
+
// Alias
|
404
|
+
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
405
|
+
|
406
|
+
interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig {
|
388
407
|
headers: AxiosRequestHeaders;
|
389
408
|
}
|
390
409
|
|
@@ -402,11 +421,11 @@ declare namespace axios {
|
|
402
421
|
unlink?: RawAxiosRequestHeaders;
|
403
422
|
}
|
404
423
|
|
405
|
-
interface AxiosDefaults<D = any> extends Omit<
|
424
|
+
interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
406
425
|
headers: HeadersDefaults;
|
407
426
|
}
|
408
427
|
|
409
|
-
interface CreateAxiosDefaults<D = any> extends Omit<
|
428
|
+
interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
410
429
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
411
430
|
}
|
412
431
|
|
@@ -415,7 +434,7 @@ declare namespace axios {
|
|
415
434
|
status: number;
|
416
435
|
statusText: string;
|
417
436
|
headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
|
418
|
-
config:
|
437
|
+
config: InternalAxiosRequestConfig<D>;
|
419
438
|
request?: any;
|
420
439
|
}
|
421
440
|
|
@@ -430,7 +449,7 @@ declare namespace axios {
|
|
430
449
|
}
|
431
450
|
|
432
451
|
interface Canceler {
|
433
|
-
(message?: string, config?:
|
452
|
+
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
434
453
|
}
|
435
454
|
|
436
455
|
interface CancelTokenStatic {
|
@@ -451,7 +470,7 @@ declare namespace axios {
|
|
451
470
|
|
452
471
|
interface AxiosInterceptorOptions {
|
453
472
|
synchronous?: boolean;
|
454
|
-
runWhen?: (config:
|
473
|
+
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
455
474
|
}
|
456
475
|
|
457
476
|
interface AxiosInterceptorManager<V> {
|
@@ -461,8 +480,8 @@ declare namespace axios {
|
|
461
480
|
}
|
462
481
|
|
463
482
|
interface AxiosInstance extends Axios {
|
464
|
-
<T = any, R = AxiosResponse<T>, D = any>(config:
|
465
|
-
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
483
|
+
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
484
|
+
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
466
485
|
|
467
486
|
defaults: Omit<AxiosDefaults, 'headers'> & {
|
468
487
|
headers: HeadersDefaults & {
|
package/index.d.ts
CHANGED
@@ -1,29 +1,23 @@
|
|
1
1
|
// TypeScript Version: 4.7
|
2
2
|
type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
3
|
-
type RawAxiosHeaders = Record<string, AxiosHeaderValue>;
|
4
3
|
|
5
|
-
|
6
|
-
[
|
7
|
-
};
|
8
|
-
|
9
|
-
interface CommonHeaders {
|
10
|
-
common: AxiosHeaders;
|
4
|
+
interface RawAxiosHeaders {
|
5
|
+
[key: string]: AxiosHeaderValue;
|
11
6
|
}
|
12
7
|
|
13
|
-
type
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
type AxiosHeaderGetter = ((parser?: RegExp) => RegExpExecArray | null) |
|
18
|
-
((matcher?: AxiosHeaderMatcher) => AxiosHeaderValue);
|
8
|
+
type MethodsHeaders = Partial<{
|
9
|
+
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
10
|
+
} & {common: AxiosHeaders}>;
|
19
11
|
|
20
|
-
type
|
12
|
+
type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
|
21
13
|
|
22
14
|
export class AxiosHeaders {
|
23
15
|
constructor(
|
24
16
|
headers?: RawAxiosHeaders | AxiosHeaders
|
25
17
|
);
|
26
18
|
|
19
|
+
[key: string]: any;
|
20
|
+
|
27
21
|
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
28
22
|
set(headers?: RawAxiosHeaders | AxiosHeaders, rewrite?: boolean): AxiosHeaders;
|
29
23
|
|
@@ -38,7 +32,7 @@ export class AxiosHeaders {
|
|
38
32
|
|
39
33
|
normalize(format: boolean): AxiosHeaders;
|
40
34
|
|
41
|
-
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
35
|
+
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
42
36
|
|
43
37
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
44
38
|
|
@@ -46,49 +40,71 @@ export class AxiosHeaders {
|
|
46
40
|
|
47
41
|
static accessor(header: string | string[]): AxiosHeaders;
|
48
42
|
|
49
|
-
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string>): AxiosHeaders;
|
43
|
+
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
50
44
|
|
51
|
-
setContentType:
|
52
|
-
getContentType:
|
53
|
-
|
45
|
+
setContentType(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
46
|
+
getContentType(parser?: RegExp): RegExpExecArray | null;
|
47
|
+
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
48
|
+
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
54
49
|
|
55
|
-
setContentLength:
|
56
|
-
getContentLength:
|
57
|
-
|
50
|
+
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
51
|
+
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
52
|
+
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
53
|
+
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
58
54
|
|
59
|
-
setAccept:
|
60
|
-
getAccept:
|
61
|
-
|
55
|
+
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
56
|
+
getAccept(parser?: RegExp): RegExpExecArray | null;
|
57
|
+
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
58
|
+
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
62
59
|
|
63
|
-
setUserAgent:
|
64
|
-
getUserAgent:
|
65
|
-
|
60
|
+
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
61
|
+
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
62
|
+
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
63
|
+
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
66
64
|
|
67
|
-
setContentEncoding:
|
68
|
-
getContentEncoding:
|
69
|
-
|
65
|
+
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
66
|
+
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
67
|
+
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
68
|
+
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
69
|
+
|
70
|
+
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
71
|
+
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
72
|
+
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
73
|
+
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
74
|
+
|
75
|
+
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
70
76
|
}
|
71
77
|
|
72
|
-
|
78
|
+
type CommonRequestHeadersList = 'Accept' | 'Content-Type' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
|
79
|
+
|
80
|
+
export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
81
|
+
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
82
|
+
}>;
|
73
83
|
|
74
84
|
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
75
85
|
|
76
|
-
|
77
|
-
|
78
|
-
|
86
|
+
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
87
|
+
|
88
|
+
type RawCommonResponseHeaders = {
|
89
|
+
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
90
|
+
} & {
|
91
|
+
"set-cookie": string[];
|
92
|
+
};
|
93
|
+
|
94
|
+
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
79
95
|
|
80
96
|
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
81
97
|
|
82
98
|
export interface AxiosRequestTransformer {
|
83
|
-
(this:
|
99
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
84
100
|
}
|
85
101
|
|
86
102
|
export interface AxiosResponseTransformer {
|
87
|
-
(this:
|
103
|
+
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
88
104
|
}
|
89
105
|
|
90
106
|
export interface AxiosAdapter {
|
91
|
-
(config:
|
107
|
+
(config: InternalAxiosRequestConfig): AxiosPromise;
|
92
108
|
}
|
93
109
|
|
94
110
|
export interface AxiosBasicCredentials {
|
@@ -283,13 +299,13 @@ type AxiosAdapterName = 'xhr' | 'http' | string;
|
|
283
299
|
|
284
300
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
285
301
|
|
286
|
-
export interface
|
302
|
+
export interface AxiosRequestConfig<D = any> {
|
287
303
|
url?: string;
|
288
304
|
method?: Method | string;
|
289
305
|
baseURL?: string;
|
290
306
|
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
291
307
|
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
292
|
-
headers?: RawAxiosRequestHeaders | AxiosHeaders;
|
308
|
+
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
293
309
|
params?: any;
|
294
310
|
paramsSerializer?: ParamsSerializerOptions;
|
295
311
|
data?: D;
|
@@ -325,7 +341,10 @@ export interface RawAxiosRequestConfig<D = any> {
|
|
325
341
|
formSerializer?: FormSerializerOptions;
|
326
342
|
}
|
327
343
|
|
328
|
-
|
344
|
+
// Alias
|
345
|
+
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
346
|
+
|
347
|
+
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
329
348
|
headers: AxiosRequestHeaders;
|
330
349
|
}
|
331
350
|
|
@@ -343,11 +362,11 @@ export interface HeadersDefaults {
|
|
343
362
|
unlink?: RawAxiosRequestHeaders;
|
344
363
|
}
|
345
364
|
|
346
|
-
export interface AxiosDefaults<D = any> extends Omit<
|
365
|
+
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
347
366
|
headers: HeadersDefaults;
|
348
367
|
}
|
349
368
|
|
350
|
-
export interface CreateAxiosDefaults<D = any> extends Omit<
|
369
|
+
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
351
370
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
352
371
|
}
|
353
372
|
|
@@ -356,7 +375,7 @@ export interface AxiosResponse<T = any, D = any> {
|
|
356
375
|
status: number;
|
357
376
|
statusText: string;
|
358
377
|
headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
|
359
|
-
config:
|
378
|
+
config: InternalAxiosRequestConfig<D>;
|
360
379
|
request?: any;
|
361
380
|
}
|
362
381
|
|
@@ -364,12 +383,12 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|
364
383
|
constructor(
|
365
384
|
message?: string,
|
366
385
|
code?: string,
|
367
|
-
config?:
|
386
|
+
config?: InternalAxiosRequestConfig<D>,
|
368
387
|
request?: any,
|
369
388
|
response?: AxiosResponse<T, D>
|
370
389
|
);
|
371
390
|
|
372
|
-
config?:
|
391
|
+
config?: InternalAxiosRequestConfig<D>;
|
373
392
|
code?: string;
|
374
393
|
request?: any;
|
375
394
|
response?: AxiosResponse<T, D>;
|
@@ -380,7 +399,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|
380
399
|
static from<T = unknown, D = any>(
|
381
400
|
error: Error | unknown,
|
382
401
|
code?: string,
|
383
|
-
config?:
|
402
|
+
config?: InternalAxiosRequestConfig<D>,
|
384
403
|
request?: any,
|
385
404
|
response?: AxiosResponse<T, D>,
|
386
405
|
customProps?: object,
|
@@ -413,7 +432,7 @@ export interface Cancel {
|
|
413
432
|
}
|
414
433
|
|
415
434
|
export interface Canceler {
|
416
|
-
(message?: string, config?:
|
435
|
+
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
417
436
|
}
|
418
437
|
|
419
438
|
export interface CancelTokenStatic {
|
@@ -434,7 +453,7 @@ export interface CancelTokenSource {
|
|
434
453
|
|
435
454
|
export interface AxiosInterceptorOptions {
|
436
455
|
synchronous?: boolean;
|
437
|
-
runWhen?: (config:
|
456
|
+
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
438
457
|
}
|
439
458
|
|
440
459
|
export interface AxiosInterceptorManager<V> {
|
@@ -444,29 +463,29 @@ export interface AxiosInterceptorManager<V> {
|
|
444
463
|
}
|
445
464
|
|
446
465
|
export class Axios {
|
447
|
-
constructor(config?:
|
466
|
+
constructor(config?: AxiosRequestConfig);
|
448
467
|
defaults: AxiosDefaults;
|
449
468
|
interceptors: {
|
450
|
-
request: AxiosInterceptorManager<
|
469
|
+
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
|
451
470
|
response: AxiosInterceptorManager<AxiosResponse>;
|
452
471
|
};
|
453
|
-
getUri(config?:
|
454
|
-
request<T = any, R = AxiosResponse<T>, D = any>(config:
|
455
|
-
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
456
|
-
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
457
|
-
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
458
|
-
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
459
|
-
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
460
|
-
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
461
|
-
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
462
|
-
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
463
|
-
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
464
|
-
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?:
|
472
|
+
getUri(config?: AxiosRequestConfig): string;
|
473
|
+
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
474
|
+
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
475
|
+
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
476
|
+
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
477
|
+
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
478
|
+
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
479
|
+
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
480
|
+
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
481
|
+
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
482
|
+
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
483
|
+
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
465
484
|
}
|
466
485
|
|
467
486
|
export interface AxiosInstance extends Axios {
|
468
|
-
<T = any, R = AxiosResponse<T>, D = any>(config:
|
469
|
-
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?:
|
487
|
+
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
488
|
+
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
470
489
|
|
471
490
|
defaults: Omit<AxiosDefaults, 'headers'> & {
|
472
491
|
headers: HeadersDefaults & {
|
package/lib/env/data.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "1.2.
|
1
|
+
export const VERSION = "1.2.5";
|
package/package.json
CHANGED
package/lib/.DS_Store
DELETED
Binary file
|