vigor-fetch 5.2.0 → 5.4.0
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/README.md +12 -9
- package/dist/index.cjs +1 -2822
- package/dist/index.d.cts +70 -68
- package/dist/index.d.ts +70 -68
- package/dist/index.js +1 -2717
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -764,11 +764,21 @@ declare abstract class VigorError<C extends string, D, T = unknown> extends Erro
|
|
|
764
764
|
* `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`), then its `cause`. Each wrapped
|
|
765
765
|
* error is searched fully before moving on. Cycles are skipped.
|
|
766
766
|
*
|
|
767
|
-
* This is what the
|
|
768
|
-
* for the error that actually happened (e.g. `FETCH_FAILED`)
|
|
769
|
-
* unwrapping the retry layers by hand.
|
|
767
|
+
* This is what the callback form of the `isVigor*Error` guards uses, so a
|
|
768
|
+
* caller can ask for the error that actually happened (e.g. `FETCH_FAILED`)
|
|
769
|
+
* without unwrapping the retry layers by hand.
|
|
770
770
|
*/
|
|
771
771
|
declare function findInVigorErrorChain(error: unknown, match: (error: unknown) => boolean): unknown;
|
|
772
|
+
/**
|
|
773
|
+
* Shared body of the `isVigor*Error` guards. `is` checks one error against a
|
|
774
|
+
* code list (empty means any code of that module).
|
|
775
|
+
*
|
|
776
|
+
* - `(error, ...codes)`: checks `error` itself and returns a boolean.
|
|
777
|
+
* - `(error, codes, callback)`: searches `error`'s chain (see
|
|
778
|
+
* {@link findInVigorErrorChain}) and calls `callback` with the first match.
|
|
779
|
+
* Returns what `callback` returns, or `undefined` when nothing matches.
|
|
780
|
+
*/
|
|
781
|
+
declare function runVigorGuard(error: unknown, args: readonly unknown[], is: (error: unknown, codes: readonly unknown[]) => boolean): unknown;
|
|
772
782
|
|
|
773
783
|
declare const VigorParseErrorMessageFuncs: {
|
|
774
784
|
readonly VALUE_REQUIRED: ({ key }: {
|
|
@@ -851,23 +861,23 @@ type VigorParseErrorsIn<E, C extends VigorParseErrorCodes = VigorParseErrorCodes
|
|
|
851
861
|
* if (isVigorParseError(error, "PARSER_NOT_FOUND")) {
|
|
852
862
|
* error.data // that code's payload
|
|
853
863
|
* }
|
|
854
|
-
*/
|
|
855
|
-
declare function isVigorParseError<E>(error: E): error is E & VigorParseErrorsIn<E>;
|
|
856
|
-
declare function isVigorParseError<E, const C extends VigorParseErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorParseErrorsIn<E, C>;
|
|
857
|
-
/**
|
|
858
|
-
* Like `isVigorParseError(error, ...codes)`, but also looks inside the errors
|
|
859
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
860
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
861
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
862
864
|
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
866
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
867
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
868
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
869
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
870
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
871
|
+
* which is still the wrapper.)
|
|
865
872
|
*
|
|
866
873
|
* @example
|
|
867
|
-
*
|
|
868
|
-
*
|
|
874
|
+
* isVigorParseError(error, "PARSER_NOT_FOUND", error => {
|
|
875
|
+
* error.data.expected // found even when wrapped in RETRY_EXHAUSTED
|
|
876
|
+
* })
|
|
869
877
|
*/
|
|
870
|
-
declare function
|
|
878
|
+
declare function isVigorParseError<E, const C extends VigorParseErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorParseErrorsIn<E, C>) => R): R | undefined;
|
|
879
|
+
declare function isVigorParseError<E>(error: E): error is E & VigorParseErrorsIn<E>;
|
|
880
|
+
declare function isVigorParseError<E, const C extends VigorParseErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorParseErrorsIn<E, C>;
|
|
871
881
|
|
|
872
882
|
type VigorParsePolicySchema<T extends VigorParseSchema<T>> = {
|
|
873
883
|
__brand: VigorBrand<"Parse", "Policy<Schema">;
|
|
@@ -1736,23 +1746,23 @@ type VigorRetryErrorsIn<E, C extends VigorRetryErrorCodes = VigorRetryErrorCodes
|
|
|
1736
1746
|
* if (isVigorRetryError(error, "TIMED_OUT")) {
|
|
1737
1747
|
* error.data // that code's payload
|
|
1738
1748
|
* }
|
|
1739
|
-
*/
|
|
1740
|
-
declare function isVigorRetryError<E>(error: E): error is E & VigorRetryErrorsIn<E>;
|
|
1741
|
-
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorRetryErrorsIn<E, C>;
|
|
1742
|
-
/**
|
|
1743
|
-
* Like `isVigorRetryError(error, ...codes)`, but also looks inside the errors
|
|
1744
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
1745
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
1746
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
1747
1749
|
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
1751
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
1752
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
1753
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
1754
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
1755
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
1756
|
+
* which is still the wrapper.)
|
|
1750
1757
|
*
|
|
1751
1758
|
* @example
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1759
|
+
* isVigorRetryError(error, "TIMED_OUT", error => {
|
|
1760
|
+
* error.data.limit // found even when wrapped in RETRY_EXHAUSTED
|
|
1761
|
+
* })
|
|
1754
1762
|
*/
|
|
1755
|
-
declare function
|
|
1763
|
+
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorRetryErrorsIn<E, C>) => R): R | undefined;
|
|
1764
|
+
declare function isVigorRetryError<E>(error: E): error is E & VigorRetryErrorsIn<E>;
|
|
1765
|
+
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorRetryErrorsIn<E, C>;
|
|
1756
1766
|
|
|
1757
1767
|
type VigorRetryPolicySchema<T extends VigorRetrySchema<T>> = {
|
|
1758
1768
|
__brand: VigorBrand<"Retry", "Policy<Schema">;
|
|
@@ -2520,23 +2530,23 @@ type VigorAllErrorsIn<E, C extends VigorAllErrorCodes = VigorAllErrorCodes> = [
|
|
|
2520
2530
|
* if (isVigorAllError(error, "TIMED_OUT")) {
|
|
2521
2531
|
* error.data // that code's payload
|
|
2522
2532
|
* }
|
|
2523
|
-
*/
|
|
2524
|
-
declare function isVigorAllError<E>(error: E): error is E & VigorAllErrorsIn<E>;
|
|
2525
|
-
declare function isVigorAllError<E, const C extends VigorAllErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorAllErrorsIn<E, C>;
|
|
2526
|
-
/**
|
|
2527
|
-
* Like `isVigorAllError(error, ...codes)`, but also looks inside the errors
|
|
2528
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
2529
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
2530
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
2531
2533
|
*
|
|
2532
|
-
*
|
|
2533
|
-
*
|
|
2534
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
2535
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
2536
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
2537
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
2538
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
2539
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
2540
|
+
* which is still the wrapper.)
|
|
2534
2541
|
*
|
|
2535
2542
|
* @example
|
|
2536
|
-
*
|
|
2537
|
-
*
|
|
2543
|
+
* isVigorAllError(error, "TIMED_OUT", error => {
|
|
2544
|
+
* error.data.index // found even when wrapped in RETRY_EXHAUSTED
|
|
2545
|
+
* })
|
|
2538
2546
|
*/
|
|
2539
|
-
declare function
|
|
2547
|
+
declare function isVigorAllError<E, const C extends VigorAllErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorAllErrorsIn<E, C>) => R): R | undefined;
|
|
2548
|
+
declare function isVigorAllError<E>(error: E): error is E & VigorAllErrorsIn<E>;
|
|
2549
|
+
declare function isVigorAllError<E, const C extends VigorAllErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorAllErrorsIn<E, C>;
|
|
2540
2550
|
|
|
2541
2551
|
/**
|
|
2542
2552
|
* A single task. It receives an `AbortSignal` that fires when the task's
|
|
@@ -4064,23 +4074,23 @@ type VigorFetchErrorsIn<E, C extends VigorFetchErrorCodes = VigorFetchErrorCodes
|
|
|
4064
4074
|
* if (isVigorFetchError(error, "FETCH_FAILED")) {
|
|
4065
4075
|
* error.data // that code's payload
|
|
4066
4076
|
* }
|
|
4067
|
-
*/
|
|
4068
|
-
declare function isVigorFetchError<E>(error: E): error is E & VigorFetchErrorsIn<E>;
|
|
4069
|
-
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorFetchErrorsIn<E, C>;
|
|
4070
|
-
/**
|
|
4071
|
-
* Like `isVigorFetchError(error, ...codes)`, but also looks inside the errors
|
|
4072
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
4073
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
4074
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
4075
4077
|
*
|
|
4076
|
-
*
|
|
4077
|
-
*
|
|
4078
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
4079
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
4080
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
4081
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
4082
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
4083
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
4084
|
+
* which is still the wrapper.)
|
|
4078
4085
|
*
|
|
4079
4086
|
* @example
|
|
4080
|
-
*
|
|
4081
|
-
*
|
|
4087
|
+
* isVigorFetchError(error, "FETCH_FAILED", error => {
|
|
4088
|
+
* error.data.status // found even when wrapped in RETRY_EXHAUSTED
|
|
4089
|
+
* })
|
|
4082
4090
|
*/
|
|
4083
|
-
declare function
|
|
4091
|
+
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorFetchErrorsIn<E, C>) => R): R | undefined;
|
|
4092
|
+
declare function isVigorFetchError<E>(error: E): error is E & VigorFetchErrorsIn<E>;
|
|
4093
|
+
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorFetchErrorsIn<E, C>;
|
|
4084
4094
|
/**
|
|
4085
4095
|
* Re-raises an error of the nested retry/parse engine as a `VigorFetchError`
|
|
4086
4096
|
* with the same `code`, `data`, and `method`, keeping the original as
|
|
@@ -5481,18 +5491,10 @@ declare const vigorBase: {
|
|
|
5481
5491
|
};
|
|
5482
5492
|
};
|
|
5483
5493
|
guards: {
|
|
5484
|
-
retry: typeof isVigorRetryError
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
find: typeof findVigorParseError;
|
|
5489
|
-
};
|
|
5490
|
-
fetch: typeof isVigorFetchError & {
|
|
5491
|
-
find: typeof findVigorFetchError;
|
|
5492
|
-
};
|
|
5493
|
-
all: typeof isVigorAllError & {
|
|
5494
|
-
find: typeof findVigorAllError;
|
|
5495
|
-
};
|
|
5494
|
+
retry: typeof isVigorRetryError;
|
|
5495
|
+
parse: typeof isVigorParseError;
|
|
5496
|
+
fetch: typeof isVigorFetchError;
|
|
5497
|
+
all: typeof isVigorAllError;
|
|
5496
5498
|
};
|
|
5497
5499
|
};
|
|
5498
5500
|
/** `A` with `B`'s properties replacing same-named ones, like `{ ...A, ...B }`. */
|
|
@@ -5522,4 +5524,4 @@ type VigorPlugin<O extends {
|
|
|
5522
5524
|
};
|
|
5523
5525
|
declare const vigor: VigorInstance;
|
|
5524
5526
|
|
|
5525
|
-
export { VigorAll, type VigorAllAfterContextSchema, VigorAllBase, type VigorAllBeforeContextSchema, type VigorAllCastNaturalResult, VigorAllContextBase, type VigorAllContextSchema, VigorAllEachContextBase, type VigorAllEachContextSchema, type VigorAllEachMiddlewareFn, type VigorAllEachOnErrorFn, VigorAllError, type VigorAllErrorCodes, type VigorAllErrorCodesWithOptionalContext, type VigorAllErrorCodesWithoutContext, type VigorAllErrorContext, type VigorAllErrorDatas, VigorAllErrorMessageFuncs, type VigorAllErrors, type VigorAllErrorsIn, type VigorAllNaturalResult, type VigorAllOnResultContextSchema, type VigorAllPipeResult, VigorAllPolicyBase, VigorAllPolicyMiddlewares, type VigorAllPolicyMiddlewaresApi, VigorAllPolicyMiddlewaresBase, type VigorAllPolicyMiddlewaresFluent, type VigorAllPolicyMiddlewaresIntercept, type VigorAllPolicyMiddlewaresSchema, type VigorAllPolicySchema, VigorAllPolicySettings, VigorAllPolicySettingsBase, type VigorAllPolicySettingsSchema, type VigorAllProcessHandler, type VigorAllRequestError, type VigorAllResult, type VigorAllResultContextSchema, type VigorAllSchema, type VigorAllSettled, type VigorAllTask, type VigorAllTaskError, type VigorAllTaskResult, type VigorAllTasksTuple, type VigorAllTimeline, type VigorAllTimelineEvents, type VigorAllTimelineSnapshot, type VigorApiFailure, type VigorApiKeys, type VigorApiMap, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiParamValue, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiStatusClass, type VigorApiSuccess, type VigorBrand, type VigorBuiltin, VigorCastPlaceholder, type VigorCastPlaceholderType, type VigorCastResult, type VigorConcat, type VigorContextApply, type VigorContextChanges, type VigorContextReset, type VigorContextStage, type VigorDeepMerge, type VigorDeepPartial, VigorDefault, type VigorDefaultType, VigorEmpty, type VigorEmptyType, VigorError, type VigorErrorContext, type VigorErrorOptions, type VigorExcludeDefault, type VigorExcludeEmpty, VigorFetch, type VigorFetchAfterContextSchema, VigorFetchBase, type VigorFetchBeforeContextSchema, type VigorFetchBodyFor, VigorFetchContextBase, type VigorFetchContextSchema, VigorFetchError, type VigorFetchErrorCodes, type VigorFetchErrorCodesWithOptionalContext, type VigorFetchErrorCodesWithoutContext, type VigorFetchErrorContext, type VigorFetchErrorDatas, VigorFetchErrorMessageFuncs, type VigorFetchErrorPipeResult, type VigorFetchErrors, type VigorFetchErrorsIn, type VigorFetchExtraOptions, type VigorFetchFailedData, type VigorFetchInferResult, type VigorFetchMethodFor, type VigorFetchNaturalFor, type VigorFetchNaturalResult, type VigorFetchOnErrorContextSchema, type VigorFetchOnResultContextSchema, type VigorFetchOptions, type VigorFetchParseSource, type VigorFetchParsedResult, type VigorFetchPipeResult, VigorFetchPolicyBase, VigorFetchPolicyMiddlewares, type VigorFetchPolicyMiddlewaresApi, VigorFetchPolicyMiddlewaresBase, type VigorFetchPolicyMiddlewaresFluent, type VigorFetchPolicyMiddlewaresIntercept, type VigorFetchPolicyMiddlewaresSchema, type VigorFetchPolicySchema, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorHttpFailureStatus, type VigorHttpStatusOf, type VigorHttpSuccessStatus, type VigorInstance, type VigorIsSame, VigorJitter, type VigorLastOf, type VigorMergeMode, type VigorMergeStrategy, type VigorNoExtraKeys, VigorParse, type VigorParseAfterContextSchema, VigorParseBase, type VigorParseBeforeContextSchema, type VigorParseBody, VigorParseContentTypeStrategy, VigorParseContextBase, type VigorParseContextSchema, VigorParseError, type VigorParseErrorCodes, type VigorParseErrorCodesWithOptionalContext, type VigorParseErrorCodesWithoutContext, type VigorParseErrorContext, type VigorParseErrorDatas, VigorParseErrorMessageFuncs, type VigorParseErrorPipeResult, type VigorParseErrors, type VigorParseErrorsIn, type VigorParseNaturalResult, type VigorParseOnErrorContextSchema, type VigorParseOnResultContextSchema, type VigorParsePipeResult, VigorParsePolicyBase, VigorParsePolicyMiddlewares, type VigorParsePolicyMiddlewaresApi, VigorParsePolicyMiddlewaresBase, type VigorParsePolicyMiddlewaresFluent, type VigorParsePolicyMiddlewaresIntercept, type VigorParsePolicyMiddlewaresSchema, type VigorParsePolicySchema, VigorParsePolicySettings, VigorParsePolicySettingsBase, type VigorParsePolicySettingsSchema, VigorParsePolicyStrategies, VigorParsePolicyStrategiesBase, type VigorParsePolicyStrategiesSchema, type VigorParseProcessHandler, type VigorParseRequestError, type VigorParseResult, type VigorParseResultContextSchema, type VigorParseSchema, VigorParseSniffStrategy, type VigorParseStrategyFunc, type VigorParseTimeline, type VigorParseTimelineEvents, type VigorParseTimelineSnapshot, type VigorPathList, type VigorPathSegments, type VigorPlugin, type VigorPrimitive, type VigorReplaceType, type VigorResolvedMethod, type VigorResultError, type VigorResultOf, VigorRetry, type VigorRetryAfterContextSchema, VigorRetryBase, type VigorRetryBeforeContextSchema, VigorRetryContextBase, type VigorRetryContextSchema, type VigorRetryDecisionReason, VigorRetryError, type VigorRetryErrorCodes, type VigorRetryErrorCodesWithOptionalContext, type VigorRetryErrorCodesWithoutContext, type VigorRetryErrorContext, type VigorRetryErrorDatas, VigorRetryErrorMessageFuncs, type VigorRetryErrorPipeResult, type VigorRetryErrors, type VigorRetryErrorsIn, type VigorRetryNaturalResult, type VigorRetryOnErrorContextSchema, type VigorRetryOnResultContextSchema, type VigorRetryOnRetryContextSchema, type VigorRetryPipeResult, VigorRetryPolicyAlgorithms, VigorRetryPolicyAlgorithmsBackoff, VigorRetryPolicyAlgorithmsBackoffBase, type VigorRetryPolicyAlgorithmsBackoffSchema, VigorRetryPolicyAlgorithmsBase, VigorRetryPolicyAlgorithmsConstant, VigorRetryPolicyAlgorithmsConstantBase, type VigorRetryPolicyAlgorithmsConstantSchema, VigorRetryPolicyAlgorithmsCustom, VigorRetryPolicyAlgorithmsCustomBase, type VigorRetryPolicyAlgorithmsCustomSchema, VigorRetryPolicyAlgorithmsLinear, VigorRetryPolicyAlgorithmsLinearBase, type VigorRetryPolicyAlgorithmsLinearSchema, type VigorRetryPolicyAlgorithmsSchema, VigorRetryPolicyBase, VigorRetryPolicyMiddlewares, type VigorRetryPolicyMiddlewaresApi, VigorRetryPolicyMiddlewaresBase, type VigorRetryPolicyMiddlewaresFluent, type VigorRetryPolicyMiddlewaresIntercept, type VigorRetryPolicyMiddlewaresSchema, type VigorRetryPolicySchema, VigorRetryPolicySettings, VigorRetryPolicySettingsBase, type VigorRetryPolicySettingsSchema, type VigorRetryProcessHandler, type VigorRetryRequestError, type VigorRetryResult, type VigorRetryResultContextSchema, type VigorRetryRetryIfContextSchema, type VigorRetrySchema, type VigorRetryTimeline, type VigorRetryTimelineEvents, type VigorRetryTimelineSnapshot, type VigorReturnType, type VigorRouteMethod, type VigorRouteParams, type VigorRoutePath, type VigorRoutePathList, type VigorRouteWithParams, type VigorRouteWithoutParams, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, vigor as default, findInVigorErrorChain,
|
|
5527
|
+
export { VigorAll, type VigorAllAfterContextSchema, VigorAllBase, type VigorAllBeforeContextSchema, type VigorAllCastNaturalResult, VigorAllContextBase, type VigorAllContextSchema, VigorAllEachContextBase, type VigorAllEachContextSchema, type VigorAllEachMiddlewareFn, type VigorAllEachOnErrorFn, VigorAllError, type VigorAllErrorCodes, type VigorAllErrorCodesWithOptionalContext, type VigorAllErrorCodesWithoutContext, type VigorAllErrorContext, type VigorAllErrorDatas, VigorAllErrorMessageFuncs, type VigorAllErrors, type VigorAllErrorsIn, type VigorAllNaturalResult, type VigorAllOnResultContextSchema, type VigorAllPipeResult, VigorAllPolicyBase, VigorAllPolicyMiddlewares, type VigorAllPolicyMiddlewaresApi, VigorAllPolicyMiddlewaresBase, type VigorAllPolicyMiddlewaresFluent, type VigorAllPolicyMiddlewaresIntercept, type VigorAllPolicyMiddlewaresSchema, type VigorAllPolicySchema, VigorAllPolicySettings, VigorAllPolicySettingsBase, type VigorAllPolicySettingsSchema, type VigorAllProcessHandler, type VigorAllRequestError, type VigorAllResult, type VigorAllResultContextSchema, type VigorAllSchema, type VigorAllSettled, type VigorAllTask, type VigorAllTaskError, type VigorAllTaskResult, type VigorAllTasksTuple, type VigorAllTimeline, type VigorAllTimelineEvents, type VigorAllTimelineSnapshot, type VigorApiFailure, type VigorApiKeys, type VigorApiMap, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiParamValue, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiStatusClass, type VigorApiSuccess, type VigorBrand, type VigorBuiltin, VigorCastPlaceholder, type VigorCastPlaceholderType, type VigorCastResult, type VigorConcat, type VigorContextApply, type VigorContextChanges, type VigorContextReset, type VigorContextStage, type VigorDeepMerge, type VigorDeepPartial, VigorDefault, type VigorDefaultType, VigorEmpty, type VigorEmptyType, VigorError, type VigorErrorContext, type VigorErrorOptions, type VigorExcludeDefault, type VigorExcludeEmpty, VigorFetch, type VigorFetchAfterContextSchema, VigorFetchBase, type VigorFetchBeforeContextSchema, type VigorFetchBodyFor, VigorFetchContextBase, type VigorFetchContextSchema, VigorFetchError, type VigorFetchErrorCodes, type VigorFetchErrorCodesWithOptionalContext, type VigorFetchErrorCodesWithoutContext, type VigorFetchErrorContext, type VigorFetchErrorDatas, VigorFetchErrorMessageFuncs, type VigorFetchErrorPipeResult, type VigorFetchErrors, type VigorFetchErrorsIn, type VigorFetchExtraOptions, type VigorFetchFailedData, type VigorFetchInferResult, type VigorFetchMethodFor, type VigorFetchNaturalFor, type VigorFetchNaturalResult, type VigorFetchOnErrorContextSchema, type VigorFetchOnResultContextSchema, type VigorFetchOptions, type VigorFetchParseSource, type VigorFetchParsedResult, type VigorFetchPipeResult, VigorFetchPolicyBase, VigorFetchPolicyMiddlewares, type VigorFetchPolicyMiddlewaresApi, VigorFetchPolicyMiddlewaresBase, type VigorFetchPolicyMiddlewaresFluent, type VigorFetchPolicyMiddlewaresIntercept, type VigorFetchPolicyMiddlewaresSchema, type VigorFetchPolicySchema, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorHttpFailureStatus, type VigorHttpStatusOf, type VigorHttpSuccessStatus, type VigorInstance, type VigorIsSame, VigorJitter, type VigorLastOf, type VigorMergeMode, type VigorMergeStrategy, type VigorNoExtraKeys, VigorParse, type VigorParseAfterContextSchema, VigorParseBase, type VigorParseBeforeContextSchema, type VigorParseBody, VigorParseContentTypeStrategy, VigorParseContextBase, type VigorParseContextSchema, VigorParseError, type VigorParseErrorCodes, type VigorParseErrorCodesWithOptionalContext, type VigorParseErrorCodesWithoutContext, type VigorParseErrorContext, type VigorParseErrorDatas, VigorParseErrorMessageFuncs, type VigorParseErrorPipeResult, type VigorParseErrors, type VigorParseErrorsIn, type VigorParseNaturalResult, type VigorParseOnErrorContextSchema, type VigorParseOnResultContextSchema, type VigorParsePipeResult, VigorParsePolicyBase, VigorParsePolicyMiddlewares, type VigorParsePolicyMiddlewaresApi, VigorParsePolicyMiddlewaresBase, type VigorParsePolicyMiddlewaresFluent, type VigorParsePolicyMiddlewaresIntercept, type VigorParsePolicyMiddlewaresSchema, type VigorParsePolicySchema, VigorParsePolicySettings, VigorParsePolicySettingsBase, type VigorParsePolicySettingsSchema, VigorParsePolicyStrategies, VigorParsePolicyStrategiesBase, type VigorParsePolicyStrategiesSchema, type VigorParseProcessHandler, type VigorParseRequestError, type VigorParseResult, type VigorParseResultContextSchema, type VigorParseSchema, VigorParseSniffStrategy, type VigorParseStrategyFunc, type VigorParseTimeline, type VigorParseTimelineEvents, type VigorParseTimelineSnapshot, type VigorPathList, type VigorPathSegments, type VigorPlugin, type VigorPrimitive, type VigorReplaceType, type VigorResolvedMethod, type VigorResultError, type VigorResultOf, VigorRetry, type VigorRetryAfterContextSchema, VigorRetryBase, type VigorRetryBeforeContextSchema, VigorRetryContextBase, type VigorRetryContextSchema, type VigorRetryDecisionReason, VigorRetryError, type VigorRetryErrorCodes, type VigorRetryErrorCodesWithOptionalContext, type VigorRetryErrorCodesWithoutContext, type VigorRetryErrorContext, type VigorRetryErrorDatas, VigorRetryErrorMessageFuncs, type VigorRetryErrorPipeResult, type VigorRetryErrors, type VigorRetryErrorsIn, type VigorRetryNaturalResult, type VigorRetryOnErrorContextSchema, type VigorRetryOnResultContextSchema, type VigorRetryOnRetryContextSchema, type VigorRetryPipeResult, VigorRetryPolicyAlgorithms, VigorRetryPolicyAlgorithmsBackoff, VigorRetryPolicyAlgorithmsBackoffBase, type VigorRetryPolicyAlgorithmsBackoffSchema, VigorRetryPolicyAlgorithmsBase, VigorRetryPolicyAlgorithmsConstant, VigorRetryPolicyAlgorithmsConstantBase, type VigorRetryPolicyAlgorithmsConstantSchema, VigorRetryPolicyAlgorithmsCustom, VigorRetryPolicyAlgorithmsCustomBase, type VigorRetryPolicyAlgorithmsCustomSchema, VigorRetryPolicyAlgorithmsLinear, VigorRetryPolicyAlgorithmsLinearBase, type VigorRetryPolicyAlgorithmsLinearSchema, type VigorRetryPolicyAlgorithmsSchema, VigorRetryPolicyBase, VigorRetryPolicyMiddlewares, type VigorRetryPolicyMiddlewaresApi, VigorRetryPolicyMiddlewaresBase, type VigorRetryPolicyMiddlewaresFluent, type VigorRetryPolicyMiddlewaresIntercept, type VigorRetryPolicyMiddlewaresSchema, type VigorRetryPolicySchema, VigorRetryPolicySettings, VigorRetryPolicySettingsBase, type VigorRetryPolicySettingsSchema, type VigorRetryProcessHandler, type VigorRetryRequestError, type VigorRetryResult, type VigorRetryResultContextSchema, type VigorRetryRetryIfContextSchema, type VigorRetrySchema, type VigorRetryTimeline, type VigorRetryTimelineEvents, type VigorRetryTimelineSnapshot, type VigorReturnType, type VigorRouteMethod, type VigorRouteParams, type VigorRoutePath, type VigorRoutePathList, type VigorRouteWithParams, type VigorRouteWithoutParams, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, vigor as default, findInVigorErrorChain, isVigorAllError, isVigorDefault, isVigorEmpty, isVigorFetchError, isVigorInternalMiddleware, isVigorParseError, isVigorRetryError, markVigorInternal, readVigorParseBody, runVigorGuard, vigor };
|
package/dist/index.d.ts
CHANGED
|
@@ -764,11 +764,21 @@ declare abstract class VigorError<C extends string, D, T = unknown> extends Erro
|
|
|
764
764
|
* `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`), then its `cause`. Each wrapped
|
|
765
765
|
* error is searched fully before moving on. Cycles are skipped.
|
|
766
766
|
*
|
|
767
|
-
* This is what the
|
|
768
|
-
* for the error that actually happened (e.g. `FETCH_FAILED`)
|
|
769
|
-
* unwrapping the retry layers by hand.
|
|
767
|
+
* This is what the callback form of the `isVigor*Error` guards uses, so a
|
|
768
|
+
* caller can ask for the error that actually happened (e.g. `FETCH_FAILED`)
|
|
769
|
+
* without unwrapping the retry layers by hand.
|
|
770
770
|
*/
|
|
771
771
|
declare function findInVigorErrorChain(error: unknown, match: (error: unknown) => boolean): unknown;
|
|
772
|
+
/**
|
|
773
|
+
* Shared body of the `isVigor*Error` guards. `is` checks one error against a
|
|
774
|
+
* code list (empty means any code of that module).
|
|
775
|
+
*
|
|
776
|
+
* - `(error, ...codes)`: checks `error` itself and returns a boolean.
|
|
777
|
+
* - `(error, codes, callback)`: searches `error`'s chain (see
|
|
778
|
+
* {@link findInVigorErrorChain}) and calls `callback` with the first match.
|
|
779
|
+
* Returns what `callback` returns, or `undefined` when nothing matches.
|
|
780
|
+
*/
|
|
781
|
+
declare function runVigorGuard(error: unknown, args: readonly unknown[], is: (error: unknown, codes: readonly unknown[]) => boolean): unknown;
|
|
772
782
|
|
|
773
783
|
declare const VigorParseErrorMessageFuncs: {
|
|
774
784
|
readonly VALUE_REQUIRED: ({ key }: {
|
|
@@ -851,23 +861,23 @@ type VigorParseErrorsIn<E, C extends VigorParseErrorCodes = VigorParseErrorCodes
|
|
|
851
861
|
* if (isVigorParseError(error, "PARSER_NOT_FOUND")) {
|
|
852
862
|
* error.data // that code's payload
|
|
853
863
|
* }
|
|
854
|
-
*/
|
|
855
|
-
declare function isVigorParseError<E>(error: E): error is E & VigorParseErrorsIn<E>;
|
|
856
|
-
declare function isVigorParseError<E, const C extends VigorParseErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorParseErrorsIn<E, C>;
|
|
857
|
-
/**
|
|
858
|
-
* Like `isVigorParseError(error, ...codes)`, but also looks inside the errors
|
|
859
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
860
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
861
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
862
864
|
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
866
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
867
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
868
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
869
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
870
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
871
|
+
* which is still the wrapper.)
|
|
865
872
|
*
|
|
866
873
|
* @example
|
|
867
|
-
*
|
|
868
|
-
*
|
|
874
|
+
* isVigorParseError(error, "PARSER_NOT_FOUND", error => {
|
|
875
|
+
* error.data.expected // found even when wrapped in RETRY_EXHAUSTED
|
|
876
|
+
* })
|
|
869
877
|
*/
|
|
870
|
-
declare function
|
|
878
|
+
declare function isVigorParseError<E, const C extends VigorParseErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorParseErrorsIn<E, C>) => R): R | undefined;
|
|
879
|
+
declare function isVigorParseError<E>(error: E): error is E & VigorParseErrorsIn<E>;
|
|
880
|
+
declare function isVigorParseError<E, const C extends VigorParseErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorParseErrorsIn<E, C>;
|
|
871
881
|
|
|
872
882
|
type VigorParsePolicySchema<T extends VigorParseSchema<T>> = {
|
|
873
883
|
__brand: VigorBrand<"Parse", "Policy<Schema">;
|
|
@@ -1736,23 +1746,23 @@ type VigorRetryErrorsIn<E, C extends VigorRetryErrorCodes = VigorRetryErrorCodes
|
|
|
1736
1746
|
* if (isVigorRetryError(error, "TIMED_OUT")) {
|
|
1737
1747
|
* error.data // that code's payload
|
|
1738
1748
|
* }
|
|
1739
|
-
*/
|
|
1740
|
-
declare function isVigorRetryError<E>(error: E): error is E & VigorRetryErrorsIn<E>;
|
|
1741
|
-
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorRetryErrorsIn<E, C>;
|
|
1742
|
-
/**
|
|
1743
|
-
* Like `isVigorRetryError(error, ...codes)`, but also looks inside the errors
|
|
1744
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
1745
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
1746
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
1747
1749
|
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
1751
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
1752
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
1753
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
1754
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
1755
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
1756
|
+
* which is still the wrapper.)
|
|
1750
1757
|
*
|
|
1751
1758
|
* @example
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1759
|
+
* isVigorRetryError(error, "TIMED_OUT", error => {
|
|
1760
|
+
* error.data.limit // found even when wrapped in RETRY_EXHAUSTED
|
|
1761
|
+
* })
|
|
1754
1762
|
*/
|
|
1755
|
-
declare function
|
|
1763
|
+
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorRetryErrorsIn<E, C>) => R): R | undefined;
|
|
1764
|
+
declare function isVigorRetryError<E>(error: E): error is E & VigorRetryErrorsIn<E>;
|
|
1765
|
+
declare function isVigorRetryError<E, const C extends VigorRetryErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorRetryErrorsIn<E, C>;
|
|
1756
1766
|
|
|
1757
1767
|
type VigorRetryPolicySchema<T extends VigorRetrySchema<T>> = {
|
|
1758
1768
|
__brand: VigorBrand<"Retry", "Policy<Schema">;
|
|
@@ -2520,23 +2530,23 @@ type VigorAllErrorsIn<E, C extends VigorAllErrorCodes = VigorAllErrorCodes> = [
|
|
|
2520
2530
|
* if (isVigorAllError(error, "TIMED_OUT")) {
|
|
2521
2531
|
* error.data // that code's payload
|
|
2522
2532
|
* }
|
|
2523
|
-
*/
|
|
2524
|
-
declare function isVigorAllError<E>(error: E): error is E & VigorAllErrorsIn<E>;
|
|
2525
|
-
declare function isVigorAllError<E, const C extends VigorAllErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorAllErrorsIn<E, C>;
|
|
2526
|
-
/**
|
|
2527
|
-
* Like `isVigorAllError(error, ...codes)`, but also looks inside the errors
|
|
2528
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
2529
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
2530
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
2531
2533
|
*
|
|
2532
|
-
*
|
|
2533
|
-
*
|
|
2534
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
2535
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
2536
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
2537
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
2538
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
2539
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
2540
|
+
* which is still the wrapper.)
|
|
2534
2541
|
*
|
|
2535
2542
|
* @example
|
|
2536
|
-
*
|
|
2537
|
-
*
|
|
2543
|
+
* isVigorAllError(error, "TIMED_OUT", error => {
|
|
2544
|
+
* error.data.index // found even when wrapped in RETRY_EXHAUSTED
|
|
2545
|
+
* })
|
|
2538
2546
|
*/
|
|
2539
|
-
declare function
|
|
2547
|
+
declare function isVigorAllError<E, const C extends VigorAllErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorAllErrorsIn<E, C>) => R): R | undefined;
|
|
2548
|
+
declare function isVigorAllError<E>(error: E): error is E & VigorAllErrorsIn<E>;
|
|
2549
|
+
declare function isVigorAllError<E, const C extends VigorAllErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorAllErrorsIn<E, C>;
|
|
2540
2550
|
|
|
2541
2551
|
/**
|
|
2542
2552
|
* A single task. It receives an `AbortSignal` that fires when the task's
|
|
@@ -4064,23 +4074,23 @@ type VigorFetchErrorsIn<E, C extends VigorFetchErrorCodes = VigorFetchErrorCodes
|
|
|
4064
4074
|
* if (isVigorFetchError(error, "FETCH_FAILED")) {
|
|
4065
4075
|
* error.data // that code's payload
|
|
4066
4076
|
* }
|
|
4067
|
-
*/
|
|
4068
|
-
declare function isVigorFetchError<E>(error: E): error is E & VigorFetchErrorsIn<E>;
|
|
4069
|
-
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorFetchErrorsIn<E, C>;
|
|
4070
|
-
/**
|
|
4071
|
-
* Like `isVigorFetchError(error, ...codes)`, but also looks inside the errors
|
|
4072
|
-
* `error` wraps — `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
4073
|
-
* then `cause` — and returns the first match, outermost first. Returns
|
|
4074
|
-
* `null` when there is none. `error` itself is left as it is.
|
|
4075
4077
|
*
|
|
4076
|
-
*
|
|
4077
|
-
*
|
|
4078
|
+
* Pass a `callback` as the third argument (with the code, or an array of
|
|
4079
|
+
* codes, as the second) to also look inside the errors `error` wraps: the
|
|
4080
|
+
* error itself, then `data.error` of `RETRY_EXHAUSTED` / `RESTART_EXHAUSTED`,
|
|
4081
|
+
* then `cause`. `callback` gets the first match, outermost first, typed for
|
|
4082
|
+
* its code; the guard returns what `callback` returns, or `undefined` when
|
|
4083
|
+
* nothing matches. (A plain guard can't do this: it narrows `error` itself,
|
|
4084
|
+
* which is still the wrapper.)
|
|
4078
4085
|
*
|
|
4079
4086
|
* @example
|
|
4080
|
-
*
|
|
4081
|
-
*
|
|
4087
|
+
* isVigorFetchError(error, "FETCH_FAILED", error => {
|
|
4088
|
+
* error.data.status // found even when wrapped in RETRY_EXHAUSTED
|
|
4089
|
+
* })
|
|
4082
4090
|
*/
|
|
4083
|
-
declare function
|
|
4091
|
+
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes, R>(error: E, codes: C | readonly [C, ...C[]], callback: (error: VigorFetchErrorsIn<E, C>) => R): R | undefined;
|
|
4092
|
+
declare function isVigorFetchError<E>(error: E): error is E & VigorFetchErrorsIn<E>;
|
|
4093
|
+
declare function isVigorFetchError<E, const C extends VigorFetchErrorCodes>(error: E, ...codes: [C, ...C[]]): error is E & VigorFetchErrorsIn<E, C>;
|
|
4084
4094
|
/**
|
|
4085
4095
|
* Re-raises an error of the nested retry/parse engine as a `VigorFetchError`
|
|
4086
4096
|
* with the same `code`, `data`, and `method`, keeping the original as
|
|
@@ -5481,18 +5491,10 @@ declare const vigorBase: {
|
|
|
5481
5491
|
};
|
|
5482
5492
|
};
|
|
5483
5493
|
guards: {
|
|
5484
|
-
retry: typeof isVigorRetryError
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
find: typeof findVigorParseError;
|
|
5489
|
-
};
|
|
5490
|
-
fetch: typeof isVigorFetchError & {
|
|
5491
|
-
find: typeof findVigorFetchError;
|
|
5492
|
-
};
|
|
5493
|
-
all: typeof isVigorAllError & {
|
|
5494
|
-
find: typeof findVigorAllError;
|
|
5495
|
-
};
|
|
5494
|
+
retry: typeof isVigorRetryError;
|
|
5495
|
+
parse: typeof isVigorParseError;
|
|
5496
|
+
fetch: typeof isVigorFetchError;
|
|
5497
|
+
all: typeof isVigorAllError;
|
|
5496
5498
|
};
|
|
5497
5499
|
};
|
|
5498
5500
|
/** `A` with `B`'s properties replacing same-named ones, like `{ ...A, ...B }`. */
|
|
@@ -5522,4 +5524,4 @@ type VigorPlugin<O extends {
|
|
|
5522
5524
|
};
|
|
5523
5525
|
declare const vigor: VigorInstance;
|
|
5524
5526
|
|
|
5525
|
-
export { VigorAll, type VigorAllAfterContextSchema, VigorAllBase, type VigorAllBeforeContextSchema, type VigorAllCastNaturalResult, VigorAllContextBase, type VigorAllContextSchema, VigorAllEachContextBase, type VigorAllEachContextSchema, type VigorAllEachMiddlewareFn, type VigorAllEachOnErrorFn, VigorAllError, type VigorAllErrorCodes, type VigorAllErrorCodesWithOptionalContext, type VigorAllErrorCodesWithoutContext, type VigorAllErrorContext, type VigorAllErrorDatas, VigorAllErrorMessageFuncs, type VigorAllErrors, type VigorAllErrorsIn, type VigorAllNaturalResult, type VigorAllOnResultContextSchema, type VigorAllPipeResult, VigorAllPolicyBase, VigorAllPolicyMiddlewares, type VigorAllPolicyMiddlewaresApi, VigorAllPolicyMiddlewaresBase, type VigorAllPolicyMiddlewaresFluent, type VigorAllPolicyMiddlewaresIntercept, type VigorAllPolicyMiddlewaresSchema, type VigorAllPolicySchema, VigorAllPolicySettings, VigorAllPolicySettingsBase, type VigorAllPolicySettingsSchema, type VigorAllProcessHandler, type VigorAllRequestError, type VigorAllResult, type VigorAllResultContextSchema, type VigorAllSchema, type VigorAllSettled, type VigorAllTask, type VigorAllTaskError, type VigorAllTaskResult, type VigorAllTasksTuple, type VigorAllTimeline, type VigorAllTimelineEvents, type VigorAllTimelineSnapshot, type VigorApiFailure, type VigorApiKeys, type VigorApiMap, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiParamValue, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiStatusClass, type VigorApiSuccess, type VigorBrand, type VigorBuiltin, VigorCastPlaceholder, type VigorCastPlaceholderType, type VigorCastResult, type VigorConcat, type VigorContextApply, type VigorContextChanges, type VigorContextReset, type VigorContextStage, type VigorDeepMerge, type VigorDeepPartial, VigorDefault, type VigorDefaultType, VigorEmpty, type VigorEmptyType, VigorError, type VigorErrorContext, type VigorErrorOptions, type VigorExcludeDefault, type VigorExcludeEmpty, VigorFetch, type VigorFetchAfterContextSchema, VigorFetchBase, type VigorFetchBeforeContextSchema, type VigorFetchBodyFor, VigorFetchContextBase, type VigorFetchContextSchema, VigorFetchError, type VigorFetchErrorCodes, type VigorFetchErrorCodesWithOptionalContext, type VigorFetchErrorCodesWithoutContext, type VigorFetchErrorContext, type VigorFetchErrorDatas, VigorFetchErrorMessageFuncs, type VigorFetchErrorPipeResult, type VigorFetchErrors, type VigorFetchErrorsIn, type VigorFetchExtraOptions, type VigorFetchFailedData, type VigorFetchInferResult, type VigorFetchMethodFor, type VigorFetchNaturalFor, type VigorFetchNaturalResult, type VigorFetchOnErrorContextSchema, type VigorFetchOnResultContextSchema, type VigorFetchOptions, type VigorFetchParseSource, type VigorFetchParsedResult, type VigorFetchPipeResult, VigorFetchPolicyBase, VigorFetchPolicyMiddlewares, type VigorFetchPolicyMiddlewaresApi, VigorFetchPolicyMiddlewaresBase, type VigorFetchPolicyMiddlewaresFluent, type VigorFetchPolicyMiddlewaresIntercept, type VigorFetchPolicyMiddlewaresSchema, type VigorFetchPolicySchema, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorHttpFailureStatus, type VigorHttpStatusOf, type VigorHttpSuccessStatus, type VigorInstance, type VigorIsSame, VigorJitter, type VigorLastOf, type VigorMergeMode, type VigorMergeStrategy, type VigorNoExtraKeys, VigorParse, type VigorParseAfterContextSchema, VigorParseBase, type VigorParseBeforeContextSchema, type VigorParseBody, VigorParseContentTypeStrategy, VigorParseContextBase, type VigorParseContextSchema, VigorParseError, type VigorParseErrorCodes, type VigorParseErrorCodesWithOptionalContext, type VigorParseErrorCodesWithoutContext, type VigorParseErrorContext, type VigorParseErrorDatas, VigorParseErrorMessageFuncs, type VigorParseErrorPipeResult, type VigorParseErrors, type VigorParseErrorsIn, type VigorParseNaturalResult, type VigorParseOnErrorContextSchema, type VigorParseOnResultContextSchema, type VigorParsePipeResult, VigorParsePolicyBase, VigorParsePolicyMiddlewares, type VigorParsePolicyMiddlewaresApi, VigorParsePolicyMiddlewaresBase, type VigorParsePolicyMiddlewaresFluent, type VigorParsePolicyMiddlewaresIntercept, type VigorParsePolicyMiddlewaresSchema, type VigorParsePolicySchema, VigorParsePolicySettings, VigorParsePolicySettingsBase, type VigorParsePolicySettingsSchema, VigorParsePolicyStrategies, VigorParsePolicyStrategiesBase, type VigorParsePolicyStrategiesSchema, type VigorParseProcessHandler, type VigorParseRequestError, type VigorParseResult, type VigorParseResultContextSchema, type VigorParseSchema, VigorParseSniffStrategy, type VigorParseStrategyFunc, type VigorParseTimeline, type VigorParseTimelineEvents, type VigorParseTimelineSnapshot, type VigorPathList, type VigorPathSegments, type VigorPlugin, type VigorPrimitive, type VigorReplaceType, type VigorResolvedMethod, type VigorResultError, type VigorResultOf, VigorRetry, type VigorRetryAfterContextSchema, VigorRetryBase, type VigorRetryBeforeContextSchema, VigorRetryContextBase, type VigorRetryContextSchema, type VigorRetryDecisionReason, VigorRetryError, type VigorRetryErrorCodes, type VigorRetryErrorCodesWithOptionalContext, type VigorRetryErrorCodesWithoutContext, type VigorRetryErrorContext, type VigorRetryErrorDatas, VigorRetryErrorMessageFuncs, type VigorRetryErrorPipeResult, type VigorRetryErrors, type VigorRetryErrorsIn, type VigorRetryNaturalResult, type VigorRetryOnErrorContextSchema, type VigorRetryOnResultContextSchema, type VigorRetryOnRetryContextSchema, type VigorRetryPipeResult, VigorRetryPolicyAlgorithms, VigorRetryPolicyAlgorithmsBackoff, VigorRetryPolicyAlgorithmsBackoffBase, type VigorRetryPolicyAlgorithmsBackoffSchema, VigorRetryPolicyAlgorithmsBase, VigorRetryPolicyAlgorithmsConstant, VigorRetryPolicyAlgorithmsConstantBase, type VigorRetryPolicyAlgorithmsConstantSchema, VigorRetryPolicyAlgorithmsCustom, VigorRetryPolicyAlgorithmsCustomBase, type VigorRetryPolicyAlgorithmsCustomSchema, VigorRetryPolicyAlgorithmsLinear, VigorRetryPolicyAlgorithmsLinearBase, type VigorRetryPolicyAlgorithmsLinearSchema, type VigorRetryPolicyAlgorithmsSchema, VigorRetryPolicyBase, VigorRetryPolicyMiddlewares, type VigorRetryPolicyMiddlewaresApi, VigorRetryPolicyMiddlewaresBase, type VigorRetryPolicyMiddlewaresFluent, type VigorRetryPolicyMiddlewaresIntercept, type VigorRetryPolicyMiddlewaresSchema, type VigorRetryPolicySchema, VigorRetryPolicySettings, VigorRetryPolicySettingsBase, type VigorRetryPolicySettingsSchema, type VigorRetryProcessHandler, type VigorRetryRequestError, type VigorRetryResult, type VigorRetryResultContextSchema, type VigorRetryRetryIfContextSchema, type VigorRetrySchema, type VigorRetryTimeline, type VigorRetryTimelineEvents, type VigorRetryTimelineSnapshot, type VigorReturnType, type VigorRouteMethod, type VigorRouteParams, type VigorRoutePath, type VigorRoutePathList, type VigorRouteWithParams, type VigorRouteWithoutParams, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, vigor as default, findInVigorErrorChain,
|
|
5527
|
+
export { VigorAll, type VigorAllAfterContextSchema, VigorAllBase, type VigorAllBeforeContextSchema, type VigorAllCastNaturalResult, VigorAllContextBase, type VigorAllContextSchema, VigorAllEachContextBase, type VigorAllEachContextSchema, type VigorAllEachMiddlewareFn, type VigorAllEachOnErrorFn, VigorAllError, type VigorAllErrorCodes, type VigorAllErrorCodesWithOptionalContext, type VigorAllErrorCodesWithoutContext, type VigorAllErrorContext, type VigorAllErrorDatas, VigorAllErrorMessageFuncs, type VigorAllErrors, type VigorAllErrorsIn, type VigorAllNaturalResult, type VigorAllOnResultContextSchema, type VigorAllPipeResult, VigorAllPolicyBase, VigorAllPolicyMiddlewares, type VigorAllPolicyMiddlewaresApi, VigorAllPolicyMiddlewaresBase, type VigorAllPolicyMiddlewaresFluent, type VigorAllPolicyMiddlewaresIntercept, type VigorAllPolicyMiddlewaresSchema, type VigorAllPolicySchema, VigorAllPolicySettings, VigorAllPolicySettingsBase, type VigorAllPolicySettingsSchema, type VigorAllProcessHandler, type VigorAllRequestError, type VigorAllResult, type VigorAllResultContextSchema, type VigorAllSchema, type VigorAllSettled, type VigorAllTask, type VigorAllTaskError, type VigorAllTaskResult, type VigorAllTasksTuple, type VigorAllTimeline, type VigorAllTimelineEvents, type VigorAllTimelineSnapshot, type VigorApiFailure, type VigorApiKeys, type VigorApiMap, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiParamValue, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiStatusClass, type VigorApiSuccess, type VigorBrand, type VigorBuiltin, VigorCastPlaceholder, type VigorCastPlaceholderType, type VigorCastResult, type VigorConcat, type VigorContextApply, type VigorContextChanges, type VigorContextReset, type VigorContextStage, type VigorDeepMerge, type VigorDeepPartial, VigorDefault, type VigorDefaultType, VigorEmpty, type VigorEmptyType, VigorError, type VigorErrorContext, type VigorErrorOptions, type VigorExcludeDefault, type VigorExcludeEmpty, VigorFetch, type VigorFetchAfterContextSchema, VigorFetchBase, type VigorFetchBeforeContextSchema, type VigorFetchBodyFor, VigorFetchContextBase, type VigorFetchContextSchema, VigorFetchError, type VigorFetchErrorCodes, type VigorFetchErrorCodesWithOptionalContext, type VigorFetchErrorCodesWithoutContext, type VigorFetchErrorContext, type VigorFetchErrorDatas, VigorFetchErrorMessageFuncs, type VigorFetchErrorPipeResult, type VigorFetchErrors, type VigorFetchErrorsIn, type VigorFetchExtraOptions, type VigorFetchFailedData, type VigorFetchInferResult, type VigorFetchMethodFor, type VigorFetchNaturalFor, type VigorFetchNaturalResult, type VigorFetchOnErrorContextSchema, type VigorFetchOnResultContextSchema, type VigorFetchOptions, type VigorFetchParseSource, type VigorFetchParsedResult, type VigorFetchPipeResult, VigorFetchPolicyBase, VigorFetchPolicyMiddlewares, type VigorFetchPolicyMiddlewaresApi, VigorFetchPolicyMiddlewaresBase, type VigorFetchPolicyMiddlewaresFluent, type VigorFetchPolicyMiddlewaresIntercept, type VigorFetchPolicyMiddlewaresSchema, type VigorFetchPolicySchema, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorHttpFailureStatus, type VigorHttpStatusOf, type VigorHttpSuccessStatus, type VigorInstance, type VigorIsSame, VigorJitter, type VigorLastOf, type VigorMergeMode, type VigorMergeStrategy, type VigorNoExtraKeys, VigorParse, type VigorParseAfterContextSchema, VigorParseBase, type VigorParseBeforeContextSchema, type VigorParseBody, VigorParseContentTypeStrategy, VigorParseContextBase, type VigorParseContextSchema, VigorParseError, type VigorParseErrorCodes, type VigorParseErrorCodesWithOptionalContext, type VigorParseErrorCodesWithoutContext, type VigorParseErrorContext, type VigorParseErrorDatas, VigorParseErrorMessageFuncs, type VigorParseErrorPipeResult, type VigorParseErrors, type VigorParseErrorsIn, type VigorParseNaturalResult, type VigorParseOnErrorContextSchema, type VigorParseOnResultContextSchema, type VigorParsePipeResult, VigorParsePolicyBase, VigorParsePolicyMiddlewares, type VigorParsePolicyMiddlewaresApi, VigorParsePolicyMiddlewaresBase, type VigorParsePolicyMiddlewaresFluent, type VigorParsePolicyMiddlewaresIntercept, type VigorParsePolicyMiddlewaresSchema, type VigorParsePolicySchema, VigorParsePolicySettings, VigorParsePolicySettingsBase, type VigorParsePolicySettingsSchema, VigorParsePolicyStrategies, VigorParsePolicyStrategiesBase, type VigorParsePolicyStrategiesSchema, type VigorParseProcessHandler, type VigorParseRequestError, type VigorParseResult, type VigorParseResultContextSchema, type VigorParseSchema, VigorParseSniffStrategy, type VigorParseStrategyFunc, type VigorParseTimeline, type VigorParseTimelineEvents, type VigorParseTimelineSnapshot, type VigorPathList, type VigorPathSegments, type VigorPlugin, type VigorPrimitive, type VigorReplaceType, type VigorResolvedMethod, type VigorResultError, type VigorResultOf, VigorRetry, type VigorRetryAfterContextSchema, VigorRetryBase, type VigorRetryBeforeContextSchema, VigorRetryContextBase, type VigorRetryContextSchema, type VigorRetryDecisionReason, VigorRetryError, type VigorRetryErrorCodes, type VigorRetryErrorCodesWithOptionalContext, type VigorRetryErrorCodesWithoutContext, type VigorRetryErrorContext, type VigorRetryErrorDatas, VigorRetryErrorMessageFuncs, type VigorRetryErrorPipeResult, type VigorRetryErrors, type VigorRetryErrorsIn, type VigorRetryNaturalResult, type VigorRetryOnErrorContextSchema, type VigorRetryOnResultContextSchema, type VigorRetryOnRetryContextSchema, type VigorRetryPipeResult, VigorRetryPolicyAlgorithms, VigorRetryPolicyAlgorithmsBackoff, VigorRetryPolicyAlgorithmsBackoffBase, type VigorRetryPolicyAlgorithmsBackoffSchema, VigorRetryPolicyAlgorithmsBase, VigorRetryPolicyAlgorithmsConstant, VigorRetryPolicyAlgorithmsConstantBase, type VigorRetryPolicyAlgorithmsConstantSchema, VigorRetryPolicyAlgorithmsCustom, VigorRetryPolicyAlgorithmsCustomBase, type VigorRetryPolicyAlgorithmsCustomSchema, VigorRetryPolicyAlgorithmsLinear, VigorRetryPolicyAlgorithmsLinearBase, type VigorRetryPolicyAlgorithmsLinearSchema, type VigorRetryPolicyAlgorithmsSchema, VigorRetryPolicyBase, VigorRetryPolicyMiddlewares, type VigorRetryPolicyMiddlewaresApi, VigorRetryPolicyMiddlewaresBase, type VigorRetryPolicyMiddlewaresFluent, type VigorRetryPolicyMiddlewaresIntercept, type VigorRetryPolicyMiddlewaresSchema, type VigorRetryPolicySchema, VigorRetryPolicySettings, VigorRetryPolicySettingsBase, type VigorRetryPolicySettingsSchema, type VigorRetryProcessHandler, type VigorRetryRequestError, type VigorRetryResult, type VigorRetryResultContextSchema, type VigorRetryRetryIfContextSchema, type VigorRetrySchema, type VigorRetryTimeline, type VigorRetryTimelineEvents, type VigorRetryTimelineSnapshot, type VigorReturnType, type VigorRouteMethod, type VigorRouteParams, type VigorRoutePath, type VigorRoutePathList, type VigorRouteWithParams, type VigorRouteWithoutParams, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, vigor as default, findInVigorErrorChain, isVigorAllError, isVigorDefault, isVigorEmpty, isVigorFetchError, isVigorInternalMiddleware, isVigorParseError, isVigorRetryError, markVigorInternal, readVigorParseBody, runVigorGuard, vigor };
|