@unicom-cloud/axios 0.1.1 → 0.1.3
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.
- package/chunk/CYdDqQOh.js +274 -0
- package/chunk/DtlKw_Ta.js +67 -0
- package/index.d.cts +791 -0
- package/index.d.ts +28 -11
- package/index.js +1 -1
- package/lib/axios.js +228 -210
- package/lib/utils.js +2 -2
- package/mock-adapter/LICENSE +20 -0
- package/mock-adapter/index.js +3 -3
- package/mock-adapter/request.js +2 -2
- package/mock-adapter/utils.js +3 -3
- package/package.json +1 -1
- package/chunk/CBBFLbi8.js +0 -253
- package/chunk/Turrizj0.js +0 -62
package/index.d.ts
CHANGED
|
@@ -332,6 +332,7 @@ export interface TransitionalOptions {
|
|
|
332
332
|
silentJSONParsing?: boolean;
|
|
333
333
|
forcedJSONParsing?: boolean;
|
|
334
334
|
clarifyTimeoutError?: boolean;
|
|
335
|
+
legacyInterceptorReqResOrdering?: boolean;
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
export interface GenericAbortSignal {
|
|
@@ -518,8 +519,9 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
518
519
|
// Alias
|
|
519
520
|
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
|
520
521
|
|
|
521
|
-
export interface InternalAxiosRequestConfig<
|
|
522
|
-
|
|
522
|
+
export interface InternalAxiosRequestConfig<
|
|
523
|
+
D = any,
|
|
524
|
+
> extends AxiosRequestConfig<D> {
|
|
523
525
|
headers: AxiosRequestHeaders;
|
|
524
526
|
}
|
|
525
527
|
|
|
@@ -537,13 +539,17 @@ export interface HeadersDefaults {
|
|
|
537
539
|
unlink?: RawAxiosRequestHeaders;
|
|
538
540
|
}
|
|
539
541
|
|
|
540
|
-
export interface AxiosDefaults<D = any>
|
|
541
|
-
|
|
542
|
+
export interface AxiosDefaults<D = any> extends Omit<
|
|
543
|
+
AxiosRequestConfig<D>,
|
|
544
|
+
'headers'
|
|
545
|
+
> {
|
|
542
546
|
headers: HeadersDefaults;
|
|
543
547
|
}
|
|
544
548
|
|
|
545
|
-
export interface CreateAxiosDefaults<D = any>
|
|
546
|
-
|
|
549
|
+
export interface CreateAxiosDefaults<D = any> extends Omit<
|
|
550
|
+
AxiosRequestConfig<D>,
|
|
551
|
+
'headers'
|
|
552
|
+
> {
|
|
547
553
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
|
548
554
|
}
|
|
549
555
|
|
|
@@ -572,7 +578,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
|
|
|
572
578
|
isAxiosError: boolean;
|
|
573
579
|
status?: number;
|
|
574
580
|
toJSON: () => object;
|
|
575
|
-
cause?:
|
|
581
|
+
cause?: Error;
|
|
576
582
|
event?: BrowserProgressEvent;
|
|
577
583
|
static from<T = unknown, D = any>(
|
|
578
584
|
error: Error | unknown,
|
|
@@ -635,23 +641,34 @@ export interface AxiosInterceptorOptions {
|
|
|
635
641
|
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
|
636
642
|
}
|
|
637
643
|
|
|
644
|
+
type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
|
|
645
|
+
type AxiosInterceptorRejected = (error: any) => any;
|
|
646
|
+
|
|
638
647
|
type AxiosRequestInterceptorUse<T> = (
|
|
639
|
-
onFulfilled?:
|
|
640
|
-
onRejected?:
|
|
648
|
+
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
649
|
+
onRejected?: AxiosInterceptorRejected | null,
|
|
641
650
|
options?: AxiosInterceptorOptions,
|
|
642
651
|
) => number;
|
|
643
652
|
|
|
644
653
|
type AxiosResponseInterceptorUse<T> = (
|
|
645
|
-
onFulfilled?:
|
|
646
|
-
onRejected?:
|
|
654
|
+
onFulfilled?: AxiosInterceptorFulfilled<T> | null,
|
|
655
|
+
onRejected?: AxiosInterceptorRejected | null,
|
|
647
656
|
) => number;
|
|
648
657
|
|
|
658
|
+
interface AxiosInterceptorHandler<T> {
|
|
659
|
+
fulfilled: AxiosInterceptorFulfilled<T>;
|
|
660
|
+
rejected?: AxiosInterceptorRejected;
|
|
661
|
+
synchronous: boolean;
|
|
662
|
+
runWhen: (config: AxiosRequestConfig) => boolean | null;
|
|
663
|
+
}
|
|
664
|
+
|
|
649
665
|
export interface AxiosInterceptorManager<V> {
|
|
650
666
|
use: V extends AxiosResponse
|
|
651
667
|
? AxiosResponseInterceptorUse<V>
|
|
652
668
|
: AxiosRequestInterceptorUse<V>;
|
|
653
669
|
eject(id: number): void;
|
|
654
670
|
clear(): void;
|
|
671
|
+
handlers?: Array<AxiosInterceptorHandler<V>>;
|
|
655
672
|
}
|
|
656
673
|
|
|
657
674
|
export class Axios {
|
package/index.js
CHANGED