vigor-fetch 6.0.0 → 6.1.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 +29 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +183 -38
- package/dist/index.d.ts +183 -38
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry of named result transforms: how a function changes the type of
|
|
3
|
+
* what it's given, written as a type of `In` (the input) and `Arg` (the
|
|
4
|
+
* argument it was created with, `undefined` when none). Empty here; add
|
|
5
|
+
* entries with declaration merging. The type parameters must be named and
|
|
6
|
+
* listed exactly like this (`<In, Arg>`) for the declarations to merge.
|
|
7
|
+
*
|
|
8
|
+
* A fluent `onResult` middleware made with `vigor.transform()` then turns
|
|
9
|
+
* the result into its entry's type — computed from the result it actually
|
|
10
|
+
* gets, so it works on a builder before its API map or path is set (where a
|
|
11
|
+
* plain callback's parameter is still `unknown`), and per status.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* declare module "vigor-fetch" {
|
|
15
|
+
* interface VigorTransforms<In, Arg> {
|
|
16
|
+
* unwrap: In extends { data: infer D } ? D : never
|
|
17
|
+
* wrap: { value: In }
|
|
18
|
+
* pick: Arg extends keyof In ? In[Arg] : never
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* const unwrap = vigor.transform("unwrap", r => r.data)
|
|
22
|
+
* const pick = <K extends string>(key: K) => vigor.transform("pick", key, r => r[key])
|
|
23
|
+
*
|
|
24
|
+
* const base = vigor.fetch(origin).middlewares(m => m.onResult("fluent", unwrap))
|
|
25
|
+
* const me = await base.apiMap<Api>().path("append", "me").request() // the route's `data`
|
|
26
|
+
*/
|
|
27
|
+
interface VigorTransforms<In, Arg> {
|
|
28
|
+
}
|
|
29
|
+
/** The names registered in {@link VigorTransforms}. */
|
|
30
|
+
type VigorTransformKey = keyof VigorTransforms<unknown, unknown>;
|
|
31
|
+
/** Type-only tag carrying a transform's registry key and argument. Never present at runtime. */
|
|
32
|
+
declare const VigorTransformTag: unique symbol;
|
|
33
|
+
/**
|
|
34
|
+
* A function made with `vigor.transform()`: at runtime the function itself,
|
|
35
|
+
* typed as the {@link VigorTransforms} entry `K` (with argument `Arg`).
|
|
36
|
+
*/
|
|
37
|
+
type VigorTransform<K extends VigorTransformKey = VigorTransformKey, Arg = unknown> = ((input: any) => any) & {
|
|
38
|
+
readonly [VigorTransformTag]: {
|
|
39
|
+
key: K;
|
|
40
|
+
arg: Arg;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** Whether `F` was made with `vigor.transform()`. */
|
|
44
|
+
type VigorIsTransform<F> = F extends {
|
|
45
|
+
readonly [VigorTransformTag]: unknown;
|
|
46
|
+
} ? true : false;
|
|
47
|
+
/** What transform `F` turns `In` into: its registry entry for `In` and its argument. */
|
|
48
|
+
type VigorTransformResult<F, In> = F extends {
|
|
49
|
+
readonly [VigorTransformTag]: {
|
|
50
|
+
key: infer K extends VigorTransformKey;
|
|
51
|
+
arg: infer A;
|
|
52
|
+
};
|
|
53
|
+
} ? VigorTransforms<In, A>[K] : never;
|
|
54
|
+
/** `vigor.transform`'s overloads. */
|
|
55
|
+
type VigorTransformFn = {
|
|
56
|
+
/** A transform without an argument: `Arg` is `undefined`. */
|
|
57
|
+
<const K extends VigorTransformKey>(key: K, func: (input: any) => unknown): VigorTransform<K, undefined>;
|
|
58
|
+
/** A transform created with an argument, passed to its entry as `Arg`. */
|
|
59
|
+
<const K extends VigorTransformKey, const A>(key: K, arg: A, func: (input: any) => unknown): VigorTransform<K, A>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Tags `func` as transform `key` (see {@link VigorTransforms}). Purely a
|
|
63
|
+
* type: the function is returned as it is, and runs like any fluent
|
|
64
|
+
* `onResult` middleware. Its entry is trusted — nothing checks that the
|
|
65
|
+
* function really returns that type, so keep the two side by side.
|
|
66
|
+
*/
|
|
67
|
+
declare const createVigorTransform: VigorTransformFn;
|
|
68
|
+
|
|
1
69
|
type VigorBrand<Branch extends string, Name extends string> = string & {
|
|
2
70
|
__brand: `@vigor-fetch:::${Branch} <- ${Name}`;
|
|
3
71
|
};
|
|
@@ -139,10 +207,12 @@ type VigorContextStep<Ctx, M, FluentKey extends PropertyKey> = M extends {
|
|
|
139
207
|
func: (ctx: infer P, ...args: any[]) => infer Ret;
|
|
140
208
|
} ? VigorContextApply<Ctx, VigorContextChanges<P, Awaited<Ret>>> : M extends {
|
|
141
209
|
_mode: "fluent";
|
|
142
|
-
func:
|
|
143
|
-
} ? [FluentKey] extends [never] ? Ctx : VigorContextApply<Ctx, {
|
|
210
|
+
func: infer F;
|
|
211
|
+
} ? [FluentKey] extends [never] ? Ctx : VigorIsTransform<F> extends true ? VigorContextApply<Ctx, {
|
|
212
|
+
[K in FluentKey]: VigorTransformResult<F, Ctx[K & keyof Ctx]>;
|
|
213
|
+
}> : F extends (...args: any[]) => infer FR ? VigorContextApply<Ctx, {
|
|
144
214
|
[K in FluentKey]: Awaited<FR>;
|
|
145
|
-
}> : Ctx;
|
|
215
|
+
}> : Ctx : Ctx;
|
|
146
216
|
/**
|
|
147
217
|
* Folds one stage's middleware list over `Ctx`, the way the runtime runs
|
|
148
218
|
* it: an intercept middleware's returned context (awaited) overwrites the
|
|
@@ -437,10 +507,13 @@ declare class VigorParsePolicyMiddlewares<T extends VigorParseSchema<T> = typeof
|
|
|
437
507
|
};
|
|
438
508
|
}>>;
|
|
439
509
|
}
|
|
440
|
-
/**
|
|
441
|
-
|
|
510
|
+
/**
|
|
511
|
+
* The result the success pipeline produces: the parsed one (or `.cast<T>()`'s), through `after` and `onResult`.
|
|
512
|
+
* `Natural` replaces what the pipeline starts from (see `VigorParseAfterContextSchema`).
|
|
513
|
+
*/
|
|
514
|
+
type VigorParsePipeResult<T extends VigorParseSchema<T>, Natural = VigorParseNaturalResult<T>> = VigorParseOnResultContextSchema<T, Natural>["result"];
|
|
442
515
|
/** `ctx.result` once the `onError` middlewares ran — what a recovered run (`setResult`) resolves to, as far as types go. */
|
|
443
|
-
type VigorParseErrorPipeResult<T extends VigorParseSchema<T>> = VigorParseOnErrorContextSchema<T>["result"];
|
|
516
|
+
type VigorParseErrorPipeResult<T extends VigorParseSchema<T>, Natural = VigorParseNaturalResult<T>> = VigorParseOnErrorContextSchema<T, Natural>["result"];
|
|
444
517
|
|
|
445
518
|
/**
|
|
446
519
|
* One recorded timeline entry: which `action` happened, its `content`, `now`,
|
|
@@ -641,14 +714,18 @@ type VigorParseNaturalResult<T extends VigorParseSchema<T>> = T["policy"]["setti
|
|
|
641
714
|
* returning a different context (see `VigorContextStage`).
|
|
642
715
|
*/
|
|
643
716
|
type VigorParseBeforeContextSchema<T extends VigorParseSchema<T>> = VigorContextStage<VigorParseContextSchema<T, VigorDefaultType>, T["policy"]["middlewares"]["before"]>;
|
|
644
|
-
/**
|
|
645
|
-
|
|
646
|
-
|
|
717
|
+
/**
|
|
718
|
+
* Context seen by `after` middlewares — `result` is the parsed one; what `before` changed otherwise carries over.
|
|
719
|
+
* `Natural` is the result before any middleware: by default the engine's own
|
|
720
|
+
* (see {@link VigorParseNaturalResult}); a fetch passes its API map's data.
|
|
721
|
+
*/
|
|
722
|
+
type VigorParseAfterContextSchema<T extends VigorParseSchema<T>, Natural = VigorParseNaturalResult<T>> = VigorContextStage<VigorContextReset<VigorParseBeforeContextSchema<T>, {
|
|
723
|
+
result: Natural;
|
|
647
724
|
}>, T["policy"]["middlewares"]["after"]>;
|
|
648
725
|
/** Context seen by `onResult` middlewares — `ctx.result` is what the earlier `onResult` ones left it as. */
|
|
649
|
-
type VigorParseOnResultContextSchema<T extends VigorParseSchema<T>> = VigorContextStage<VigorParseAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"], "result">;
|
|
726
|
+
type VigorParseOnResultContextSchema<T extends VigorParseSchema<T>, Natural = VigorParseNaturalResult<T>> = VigorContextStage<VigorParseAfterContextSchema<T, Natural>, T["policy"]["middlewares"]["onResult"], "result">;
|
|
650
727
|
/** Context seen by `onError` middlewares — every strategy failed (or a middleware threw). */
|
|
651
|
-
type VigorParseOnErrorContextSchema<T extends VigorParseSchema<T>> = VigorContextStage<VigorParseContextSchema<T>, T["policy"]["middlewares"]["onError"]>;
|
|
728
|
+
type VigorParseOnErrorContextSchema<T extends VigorParseSchema<T>, Natural = VigorParseNaturalResult<T>> = VigorContextStage<VigorParseContextSchema<T, VigorParsePipeResult<T, Natural> | VigorDefaultType>, T["policy"]["middlewares"]["onError"]>;
|
|
652
729
|
/** Context shape once the full middleware pipeline (including `onResult`) has run. */
|
|
653
730
|
type VigorParseResultContextSchema<T extends VigorParseSchema<T>> = VigorParseContextSchema<T, VigorParsePipeResult<T>>;
|
|
654
731
|
declare const VigorParseContextBase: {
|
|
@@ -919,6 +996,14 @@ type VigorParseSchema<T extends VigorParseSchema<T>> = {
|
|
|
919
996
|
};
|
|
920
997
|
/** What `request()` resolves to: the pipeline's result, or what `settings.default` returns. */
|
|
921
998
|
type VigorParseResult<T extends VigorParseSchema<T>> = VigorExcludeDefault<VigorParseContextSchema<T>["result"]> | VigorExcludeDefault<VigorParseErrorPipeResult<T>> | VigorReturnType<T["policy"]["settings"]["default"]>;
|
|
999
|
+
/**
|
|
1000
|
+
* What a run of engine `T` resolves to when parsing yields `Natural` (as
|
|
1001
|
+
* `VigorParseResult`, but starting from `Natural` instead of the engine's
|
|
1002
|
+
* own `.cast<T>()`/`unknown`): through the middlewares, `| default`, `|`
|
|
1003
|
+
* what `onError` recovers with. A fetch uses it to run its API map's data
|
|
1004
|
+
* through the parse engine.
|
|
1005
|
+
*/
|
|
1006
|
+
type VigorParseResultFor<T extends VigorParseSchema<T>, Natural> = VigorExcludeDefault<VigorParsePipeResult<T, Natural>> | (T["policy"]["middlewares"]["onError"] extends readonly [] ? never : VigorExcludeDefault<VigorParseErrorPipeResult<T, Natural>>) | VigorReturnType<T["policy"]["settings"]["default"]>;
|
|
922
1007
|
/** The builder `T` becomes after merging `P` in (with strategy tree `S`). */
|
|
923
1008
|
type VigorParseNext<T, P, S = undefined> = VigorApply<VigorParseTypeLambda, VigorDeepMerge<T, P, S>>;
|
|
924
1009
|
declare const VigorParseBase: {
|
|
@@ -2623,25 +2708,34 @@ type VigorApiNormalize<Item, O> = VigorSimplify<(Item extends {
|
|
|
2623
2708
|
type VigorApiVariants<Item, X> = X extends readonly unknown[] ? {
|
|
2624
2709
|
-readonly [I in keyof X]: VigorApiNormalize<Item, X[I]>;
|
|
2625
2710
|
} : [VigorApiNormalize<Item, X>];
|
|
2626
|
-
/** Every `"<METHOD> /<path>"` key the nested map `M` has. */
|
|
2627
|
-
type VigorApiFlatKey<M> = {
|
|
2628
|
-
[P in keyof M & VigorApiPathKey]: `${keyof M[P] & VigorApiMethod} ${P}`;
|
|
2629
|
-
}[keyof M & VigorApiPathKey];
|
|
2630
2711
|
/**
|
|
2631
2712
|
* The nested map `M` flattened to one entry per method and path, keyed
|
|
2632
2713
|
* `"<METHOD> /<path>"`, each the list of its overloads as routes.
|
|
2633
2714
|
*/
|
|
2634
2715
|
type VigorApiFlatten<M> = {
|
|
2635
|
-
[K in
|
|
2716
|
+
[K in {
|
|
2717
|
+
[P in keyof M & VigorApiPathKey]: `${keyof M[P] & VigorApiMethod} ${P}`;
|
|
2718
|
+
}[keyof M & VigorApiPathKey]]: K extends `${infer Method} ${infer P}` ? P extends keyof M ? Method extends keyof M[P] ? VigorApiVariants<M[P], NonNullable<M[P][Method]>> : never : never : never;
|
|
2719
|
+
};
|
|
2720
|
+
/** `.apiMap<M>(options)`'s options. */
|
|
2721
|
+
type VigorApiMapOptions = {
|
|
2722
|
+
/**
|
|
2723
|
+
* Make a request that matches no route a compile error on `request()` /
|
|
2724
|
+
* `requestVerbose()`, instead of silently typing its result from the parse
|
|
2725
|
+
* engine (usually `unknown`). A dynamic path (`...segments: string[]`)
|
|
2726
|
+
* can't be matched, so it's an error too. `.cast<T>()` opts a request out.
|
|
2727
|
+
*/
|
|
2728
|
+
strict?: boolean;
|
|
2636
2729
|
};
|
|
2637
2730
|
/**
|
|
2638
2731
|
* What `.apiMap<M>()` stores on the schema: the map, flattened (see
|
|
2639
|
-
* {@link VigorApiFlatten}),
|
|
2640
|
-
* called, which every route is relative to
|
|
2732
|
+
* {@link VigorApiFlatten}), the path segments already set when it was
|
|
2733
|
+
* called, which every route is relative to, and whether it's `strict`.
|
|
2641
2734
|
*/
|
|
2642
|
-
type VigorApiMapSlot<M, Base extends readonly string[]> = {
|
|
2735
|
+
type VigorApiMapSlot<M, Base extends readonly string[], Strict extends boolean = false> = {
|
|
2643
2736
|
map: M;
|
|
2644
2737
|
base: Base;
|
|
2738
|
+
strict: Strict;
|
|
2645
2739
|
};
|
|
2646
2740
|
/** One `.path()` argument as the string segment it becomes at runtime. */
|
|
2647
2741
|
type VigorPathSegment<V> = V extends Date ? string : V extends string | number | bigint | boolean ? `${V}` : string;
|
|
@@ -2711,7 +2805,7 @@ type VigorApiMatchFor<M, Method, A> = A extends readonly string[] ? number exten
|
|
|
2711
2805
|
* path list `Path` matches, or `VigorApiNoMatchType`. A union path (e.g.
|
|
2712
2806
|
* `.path("append", kind)` with `kind: "a" | "b"`) gives a union of matches.
|
|
2713
2807
|
*/
|
|
2714
|
-
type VigorApiMatched<Slot, Method, Path> = Slot extends VigorApiMapSlot<infer M, infer Base> ? VigorApiMatchFor<M, Method, VigorDropPrefix<VigorPathSegments<Path>, VigorPathSegments<Base>>> : VigorApiNoMatchType;
|
|
2808
|
+
type VigorApiMatched<Slot, Method, Path> = Slot extends VigorApiMapSlot<infer M, infer Base, boolean> ? VigorApiMatchFor<M, Method, VigorDropPrefix<VigorPathSegments<Path>, VigorPathSegments<Base>>> : VigorApiNoMatchType;
|
|
2715
2809
|
/** A route's `responses`, with `response` as the `"2xx"` entry it's shorthand for (unless `responses` has one). */
|
|
2716
2810
|
type VigorApiResponsesOf<R> = (R extends {
|
|
2717
2811
|
responses: infer S;
|
|
@@ -2800,7 +2894,7 @@ type VigorApiFailure<Slot, Method, Path, Body, Query> = VigorApiMatched<Slot, Me
|
|
|
2800
2894
|
*/
|
|
2801
2895
|
type VigorApiResponse<Slot, Method, Path, Body, Query> = VigorApiSuccess<Slot, Method, Path, Body, Query>["data"];
|
|
2802
2896
|
/** The route of key `K` in the API map stored in `Slot` (its first overload: they share `params`), or `{}`. */
|
|
2803
|
-
type VigorApiRouteOf<Slot, K> = Slot extends VigorApiMapSlot<infer M, any> ? K extends keyof M ? M[K] extends readonly [infer R, ...any[]] ? R : {} : {} : {};
|
|
2897
|
+
type VigorApiRouteOf<Slot, K> = Slot extends VigorApiMapSlot<infer M, any, boolean> ? K extends keyof M ? M[K] extends readonly [infer R, ...any[]] ? R : {} : {} : {};
|
|
2804
2898
|
/**
|
|
2805
2899
|
* What `request()`'s `this` becomes when the request doesn't match its route:
|
|
2806
2900
|
* the compiler reports this type, so its keys spell out what's wrong.
|
|
@@ -2810,19 +2904,25 @@ type VigorApiRequestIssue<Key, Problem extends string, Expected, Received> = {
|
|
|
2810
2904
|
readonly expected: Expected;
|
|
2811
2905
|
readonly received: Received;
|
|
2812
2906
|
};
|
|
2813
|
-
/**
|
|
2814
|
-
|
|
2815
|
-
|
|
2907
|
+
/**
|
|
2908
|
+
* `T` with every `readonly` dropped, deeply — a `const`-inferred value against a declared type.
|
|
2909
|
+
* Stops after {@link VigorDeepMutableLimit} levels and keeps the rest as-is: a
|
|
2910
|
+
* recursive type (e.g. `z.json()`) would otherwise never end (TS2589).
|
|
2911
|
+
*/
|
|
2912
|
+
type VigorDeepMutable<T, Depth extends readonly unknown[] = []> = Depth["length"] extends VigorDeepMutableLimit ? T : T extends VigorBuiltin ? T : {
|
|
2913
|
+
-readonly [K in keyof T]: VigorDeepMutable<T[K], [...Depth, unknown]>;
|
|
2816
2914
|
};
|
|
2915
|
+
/** How deep {@link VigorDeepMutable} goes. A `const` literal deeper than this keeps its inner `readonly`. */
|
|
2916
|
+
type VigorDeepMutableLimit = 10;
|
|
2817
2917
|
type VigorUnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
2818
2918
|
/** Every `.query()` object of the stored list, as the one object they add up to. */
|
|
2819
2919
|
type VigorQueryOf<Q> = Q extends readonly (infer E)[] ? [E] extends [never] ? {} : VigorSimplify<VigorUnionToIntersection<E>> : {};
|
|
2820
|
-
type VigorApiBodyIssue<Key, R, Body> = "body" extends keyof R ? R["body" & keyof R] extends infer B ? [Body] extends [VigorEmptyType | null] ? undefined extends B ? never : null extends B ? never : VigorApiRequestIssue<Key, "the route requires a body", B, Body> : VigorDeepMutable<Body> extends B ? never : VigorApiRequestIssue<Key, "the body does not match the route", B, Body> : never : never;
|
|
2821
|
-
type VigorApiQueryIssue<Key, R, Query> = "query" extends keyof R ? [NonNullable<R["query" & keyof R]>, VigorQueryOf<Query>] extends [infer D, infer Q] ? [Exclude<keyof Q, keyof D>] extends [never] ? VigorDeepMutable<Q> extends D ? never : VigorApiRequestIssue<Key, "the query does not match the route", D, Q> : VigorApiRequestIssue<Key, `unknown query key "${Exclude<keyof Q, keyof D> & string}"`, D, Q> : never : never;
|
|
2920
|
+
type VigorApiBodyIssue<Key, R, Body> = "body" extends keyof R ? R["body" & keyof R] extends infer B ? [Body] extends [VigorEmptyType | null] ? undefined extends B ? never : null extends B ? never : VigorApiRequestIssue<Key, "the route requires a body", B, Body> : [Body] extends [B] ? never : VigorDeepMutable<Body> extends B ? never : VigorApiRequestIssue<Key, "the body does not match the route", B, Body> : never : never;
|
|
2921
|
+
type VigorApiQueryIssue<Key, R, Query> = "query" extends keyof R ? [NonNullable<R["query" & keyof R]>, VigorQueryOf<Query>] extends [infer D, infer Q] ? [Exclude<keyof Q, keyof D>] extends [never] ? [Q] extends [D] ? never : VigorDeepMutable<Q> extends D ? never : VigorApiRequestIssue<Key, "the query does not match the route", D, Q> : VigorApiRequestIssue<Key, `unknown query key "${Exclude<keyof Q, keyof D> & string}"`, D, Q> : never : never;
|
|
2822
2922
|
/** The first of overloads `V` that `Body` and `Query` surely match, or `never`. */
|
|
2823
2923
|
type VigorApiDefinite<V, Body, Query> = V extends readonly [infer R, ...infer Rest] ? [VigorApiBodyIssue<"", R, Body> | VigorApiQueryIssue<"", R, Query>] extends [never] ? R : VigorApiDefinite<Rest, Body, Query> : never;
|
|
2824
2924
|
/** Whether `Body` may match route `R`'s body: it may be left out, or the two types overlap. */
|
|
2825
|
-
type VigorApiBodyPossible<R, Body> = "body" extends keyof R ? R["body" & keyof R] extends infer B ? [Body] extends [VigorEmptyType | null] ? undefined extends B ? true : null extends B ? true : false : [VigorDeepMutable<Body> & B] extends [never] ? false : true : never : true;
|
|
2925
|
+
type VigorApiBodyPossible<R, Body> = "body" extends keyof R ? R["body" & keyof R] extends infer B ? [Body] extends [VigorEmptyType | null] ? undefined extends B ? true : null extends B ? true : false : [Body] extends [B] ? true : [VigorDeepMutable<Body> & B] extends [never] ? false : true : never : true;
|
|
2826
2926
|
/** The keys `D` requires. */
|
|
2827
2927
|
type VigorApiRequiredKeys<D> = {
|
|
2828
2928
|
[K in keyof D]-?: {} extends Pick<D, K> ? never : K;
|
|
@@ -2855,10 +2955,19 @@ type VigorApiRequestIssues<Slot, Method, Path, Body, Query> = VigorApiMatched<Sl
|
|
|
2855
2955
|
body: [Body] extends [VigorEmptyType] ? undefined : Body;
|
|
2856
2956
|
query: VigorQueryOf<Query>;
|
|
2857
2957
|
}> : never : never : never;
|
|
2958
|
+
/**
|
|
2959
|
+
* With a `strict` API map, a {@link VigorApiRequestIssue} for every possible
|
|
2960
|
+
* path of the request that matches no route; otherwise `never`. `expected`
|
|
2961
|
+
* lists the routes of the request's method.
|
|
2962
|
+
*/
|
|
2963
|
+
type VigorApiStrictIssues<Slot, Method, Path> = Slot extends VigorApiMapSlot<infer M, infer Base, true> ? VigorApiMatched<Slot, Method, Path> extends infer X ? X extends VigorApiNoMatchType ? VigorDropPrefix<VigorPathSegments<Path>, VigorPathSegments<Base>> extends infer A extends readonly string[] ? VigorApiRequestIssue<`${Method & string} (strict)`, number extends A["length"] ? "the path is dynamic (string[]), so no route can match it: use .route() or .cast<T>()" : "no route of the API map matches the request", keyof M extends infer K ? K extends `${Method & string} /${string}` ? K : never : never, {
|
|
2964
|
+
method: Method;
|
|
2965
|
+
path: A;
|
|
2966
|
+
}> : never : never : never : never;
|
|
2858
2967
|
/** The method a request is sent with: the one set, else `POST` with a body and `GET` without. */
|
|
2859
2968
|
type VigorResolvedMethod<Method, Body> = Method extends VigorEmptyType ? Body extends VigorEmptyType | null ? "GET" : "POST" : Method;
|
|
2860
2969
|
/** The route keys of the API map stored in `Slot`. */
|
|
2861
|
-
type VigorApiKeys<Slot> = Slot extends VigorApiMapSlot<infer M, any> ? keyof M & VigorApiRouteKey : never;
|
|
2970
|
+
type VigorApiKeys<Slot> = Slot extends VigorApiMapSlot<infer M, any, boolean> ? keyof M & VigorApiRouteKey : never;
|
|
2862
2971
|
type VigorParamNames<P extends string> = P extends `${infer H}/${infer R}` ? VigorParamName<H> | VigorParamNames<R> : VigorParamName<P>;
|
|
2863
2972
|
type VigorParamName<S extends string> = S extends `:${infer N}` ? N : never;
|
|
2864
2973
|
/** The path part of a route key (`"GET /users/:id"` → `"users/:id"`). */
|
|
@@ -3051,6 +3160,21 @@ type VigorFetchParsedResult<T extends VigorFetchSchema<T>> = VigorDeepMerge<T["p
|
|
|
3051
3160
|
target: "replace";
|
|
3052
3161
|
};
|
|
3053
3162
|
}> extends infer P ? P extends VigorParseSchema<any> ? VigorParseResult<P> : unknown : unknown;
|
|
3163
|
+
/**
|
|
3164
|
+
* What the parse engine produces when the strategies yield API-map data `D`:
|
|
3165
|
+
* `D` through its middlewares, `| default`, `|` its `onError` recovery — the
|
|
3166
|
+
* map describes the raw body, and at runtime the parse engine's pipeline
|
|
3167
|
+
* runs on it like on any other.
|
|
3168
|
+
*/
|
|
3169
|
+
type VigorFetchParsedFor<T extends VigorFetchSchema<T>, D> = VigorDeepMerge<T["policy"]["parse"], {
|
|
3170
|
+
policy: {
|
|
3171
|
+
target: Response;
|
|
3172
|
+
};
|
|
3173
|
+
}, {
|
|
3174
|
+
policy: {
|
|
3175
|
+
target: "replace";
|
|
3176
|
+
};
|
|
3177
|
+
}> extends infer P ? P extends VigorParseSchema<any> ? VigorParseResultFor<P, D> : D : D;
|
|
3054
3178
|
/**
|
|
3055
3179
|
* The result type before `.cast<T>()`: a `raw` parse gives the `Response`
|
|
3056
3180
|
* itself; otherwise the union of the API map's matched route's success
|
|
@@ -3061,10 +3185,12 @@ type VigorFetchParsedResult<T extends VigorFetchSchema<T>> = VigorDeepMerge<T["p
|
|
|
3061
3185
|
type VigorFetchNaturalResult<T extends VigorFetchSchema<T>> = VigorFetchNaturalFor<T, VigorApiResponse<T["apiMap"], VigorResolvedMethod<T["policy"]["method"], T["policy"]["body"]>, VigorPathList<T["policy"]["path"]>, T["policy"]["body"], T["policy"]["query"]>>;
|
|
3062
3186
|
/**
|
|
3063
3187
|
* The result type before `.cast<T>()` for API-map data `D` (one status's,
|
|
3064
|
-
* or the union of all): a `raw` parse gives the `Response
|
|
3065
|
-
*
|
|
3188
|
+
* or the union of all): a `raw` parse gives the `Response`; matched data
|
|
3189
|
+
* goes through the parse engine (see {@link VigorFetchParsedFor}), and
|
|
3190
|
+
* where no route matched (`VigorApiNoMatchType`) the parse engine's own
|
|
3191
|
+
* result is used.
|
|
3066
3192
|
*/
|
|
3067
|
-
type VigorFetchNaturalFor<T extends VigorFetchSchema<T>, D> = T["policy"]["parse"]["policy"]["settings"]["raw"] extends true ? VigorFetchParsedResult<T> : Exclude<D, VigorApiNoMatchType> | (VigorApiNoMatchType extends D ? VigorFetchParsedResult<T> : never);
|
|
3193
|
+
type VigorFetchNaturalFor<T extends VigorFetchSchema<T>, D> = T["policy"]["parse"]["policy"]["settings"]["raw"] extends true ? VigorFetchParsedResult<T> : ([Exclude<D, VigorApiNoMatchType>] extends [never] ? never : VigorFetchParsedFor<T, Exclude<D, VigorApiNoMatchType>>) | (VigorApiNoMatchType extends D ? VigorFetchParsedResult<T> : never);
|
|
3068
3194
|
/**
|
|
3069
3195
|
* The result the success pipeline produces. `Natural` is the result it
|
|
3070
3196
|
* starts from (before `.cast<T>()`): by default the API map's whole success
|
|
@@ -3161,8 +3287,9 @@ type VigorFetchErrorDatas<C extends VigorFetchErrorCodes, T extends VigorFetchSc
|
|
|
3161
3287
|
type VigorFetchFailedDataBase = Parameters<typeof VigorFetchErrorMessageFuncs["FETCH_FAILED"]>[0];
|
|
3162
3288
|
/**
|
|
3163
3289
|
* `FETCH_FAILED`'s `data` for request `T`: per declared failure status of
|
|
3164
|
-
* its matched route, `{ status, ..., parsed }`
|
|
3165
|
-
*
|
|
3290
|
+
* its matched route, `{ status, ..., parsed }` — the declared body through
|
|
3291
|
+
* the parse engine's pipeline, `undefined` when the body couldn't be
|
|
3292
|
+
* parsed — with `parsed: unknown` for the rest.
|
|
3166
3293
|
* Without a matching route, or with a `raw` parse (whose `parsed` is the
|
|
3167
3294
|
* `Response`), it's the plain shape.
|
|
3168
3295
|
*/
|
|
@@ -3174,7 +3301,7 @@ type VigorFetchFailedData<T extends VigorFetchSchema<any>> = 0 extends (1 & T) ?
|
|
|
3174
3301
|
statusText: string;
|
|
3175
3302
|
response: Response;
|
|
3176
3303
|
url: string;
|
|
3177
|
-
parsed: P;
|
|
3304
|
+
parsed: unknown extends P ? P : VigorFetchParsedFor<T, Exclude<P, undefined>> | undefined;
|
|
3178
3305
|
} : never : never;
|
|
3179
3306
|
/**
|
|
3180
3307
|
* Every fetch error code as its own union member, so narrowing by `code`
|
|
@@ -3438,11 +3565,12 @@ type VigorFetchVerboseResult<T extends VigorFetchSchema<T>, R = VigorFetchInferR
|
|
|
3438
3565
|
};
|
|
3439
3566
|
/**
|
|
3440
3567
|
* What `request()`/`requestVerbose()` require of their `this`: the request
|
|
3441
|
-
* itself, unless its `body`/`query` don't match its API map route
|
|
3568
|
+
* itself, unless its `body`/`query` don't match its API map route, or a
|
|
3569
|
+
* `strict` map has no route for it (see `VigorApiStrictIssues`) — then a
|
|
3442
3570
|
* {@link VigorApiRequestIssue} describing the mismatch, so the call doesn't
|
|
3443
3571
|
* compile. Only computed where those methods are called.
|
|
3444
3572
|
*/
|
|
3445
|
-
type VigorFetchRequestThis<T extends VigorFetchSchema<T>> = 0 extends (1 & T) ? VigorFetch<T> : T["apiMap"] extends VigorEmptyType ? VigorFetch<T> : VigorApiRequestIssues<T["apiMap"], VigorResolvedMethod<T["policy"]["method"], T["policy"]["body"]>, VigorPathList<T["policy"]["path"]>, T["policy"]["body"], T["policy"]["query"]> extends infer I ? [I] extends [never] ? VigorFetch<T> : I : never;
|
|
3573
|
+
type VigorFetchRequestThis<T extends VigorFetchSchema<T>> = 0 extends (1 & T) ? VigorFetch<T> : T["apiMap"] extends VigorEmptyType ? VigorFetch<T> : VigorApiRequestIssues<T["apiMap"], VigorResolvedMethod<T["policy"]["method"], T["policy"]["body"]>, VigorPathList<T["policy"]["path"]>, T["policy"]["body"], T["policy"]["query"]> | (T["cast"] extends VigorEmptyType ? VigorApiStrictIssues<T["apiMap"], VigorResolvedMethod<T["policy"]["method"], T["policy"]["body"]>, VigorPathList<T["policy"]["path"]>> : never) extends infer I ? [I] extends [never] ? VigorFetch<T> : I : never;
|
|
3446
3574
|
type VigorFetchMethod = NonNullable<VigorFetchOptions["method"]>;
|
|
3447
3575
|
/** The API map's route keys `.route()` accepts for `T`: those whose method `T` allows. */
|
|
3448
3576
|
type VigorFetchRouteKeys<T extends VigorFetchSchema<T>> = Extract<VigorApiKeys<T["apiMap"]>, `${VigorFetchMethodFor<T>} /${string}`>;
|
|
@@ -3924,8 +4052,20 @@ declare class VigorFetch<T extends VigorFetchSchema<T> = typeof VigorFetchBase>
|
|
|
3924
4052
|
* }
|
|
3925
4053
|
* const api = vigor.fetch("https://api.example.com").apiMap<Api>()
|
|
3926
4054
|
* const user = await api.path("append", "users", id).request() // User
|
|
4055
|
+
*
|
|
4056
|
+
* // strict: a request no route matches doesn't compile (`.cast<T>()` opts out)
|
|
4057
|
+
* const strictApi = vigor.fetch("https://api.example.com").apiMap<Api>({ strict: true })
|
|
3927
4058
|
*/
|
|
3928
|
-
apiMap<const M extends VigorApiMap<M>>(
|
|
4059
|
+
apiMap<const M extends VigorApiMap<M>>(options: VigorApiMapOptions & {
|
|
4060
|
+
strict: true;
|
|
4061
|
+
}): VigorFetchNext<T, {
|
|
4062
|
+
apiMap: VigorApiMapSlot<VigorApiFlatten<M>, VigorPathList<T["policy"]["path"]>, true>;
|
|
4063
|
+
}, {
|
|
4064
|
+
apiMap: "replace";
|
|
4065
|
+
}>;
|
|
4066
|
+
apiMap<const M extends VigorApiMap<M>>(options?: VigorApiMapOptions & {
|
|
4067
|
+
strict?: false;
|
|
4068
|
+
}): VigorFetchNext<T, {
|
|
3929
4069
|
apiMap: VigorApiMapSlot<VigorApiFlatten<M>, VigorPathList<T["policy"]["path"]>>;
|
|
3930
4070
|
}, {
|
|
3931
4071
|
apiMap: "replace";
|
|
@@ -5875,6 +6015,11 @@ declare const vigorBase: {
|
|
|
5875
6015
|
}>;
|
|
5876
6016
|
};
|
|
5877
6017
|
};
|
|
6018
|
+
/**
|
|
6019
|
+
* Tags a function as a registered result transform (see `VigorTransforms`),
|
|
6020
|
+
* for a fluent `onResult` middleware whose result type follows what it's given.
|
|
6021
|
+
*/
|
|
6022
|
+
transform: VigorTransformFn;
|
|
5878
6023
|
guards: {
|
|
5879
6024
|
retry: typeof isVigorRetryError;
|
|
5880
6025
|
parse: typeof isVigorParseError;
|
|
@@ -5909,4 +6054,4 @@ type VigorPlugin<O extends {
|
|
|
5909
6054
|
};
|
|
5910
6055
|
declare const vigor: VigorInstance;
|
|
5911
6056
|
|
|
5912
|
-
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 VigorApiFlatten, type VigorApiKeys, type VigorApiMap, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiOperation, type VigorApiParamValue, type VigorApiPath, type VigorApiPathKey, type VigorApiRequest, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiResponses, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiSelect, type VigorApiStatusClass, type VigorApiSuccess, VigorBodySerializer, type VigorBodyStepFunc, VigorBodySteps, 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, VigorFetchPolicySerializers, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchSerializerStage, VigorFetchSerializersBase, type VigorFetchSerializersSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorFetcher, VigorHeadersSerializer, type VigorHeadersStepFunc, VigorHeadersSteps, 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, VigorPathSerializer, type VigorPathStepFunc, VigorPathSteps, type VigorPlugin, type VigorPrimitive, type VigorQueryArrayFormat, type VigorQueryEntry, VigorQuerySerializer, type VigorQueryStepFunc, VigorQuerySteps, 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 VigorSerializeInfo, type VigorSerializedBody, type VigorSerializerStep, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, VigorUrlSerializer, type VigorUrlStepFunc, VigorUrlSteps, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, vigor as default, findInVigorErrorChain, isVigorAllError, isVigorDefault, isVigorEmpty, isVigorFetchError, isVigorInternalMiddleware, isVigorParseError, isVigorRetryError, markVigorInternal, readVigorParseBody, runVigorGuard, vigor, vigorStringifyValue };
|
|
6057
|
+
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 VigorApiFlatten, type VigorApiKeys, type VigorApiMap, type VigorApiMapOptions, type VigorApiMapSlot, type VigorApiMatch, type VigorApiMatched, type VigorApiMethod, type VigorApiNoMatchType, type VigorApiOperation, type VigorApiParamValue, type VigorApiPath, type VigorApiPathKey, type VigorApiRequest, type VigorApiRequestIssue, type VigorApiRequestIssues, type VigorApiResponse, type VigorApiResponses, type VigorApiRoute, type VigorApiRouteKey, type VigorApiRouteOf, type VigorApiSelect, type VigorApiStatusClass, type VigorApiStrictIssues, type VigorApiSuccess, VigorBodySerializer, type VigorBodyStepFunc, VigorBodySteps, 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 VigorFetchParsedFor, type VigorFetchParsedResult, type VigorFetchPipeResult, VigorFetchPolicyBase, VigorFetchPolicyMiddlewares, type VigorFetchPolicyMiddlewaresApi, VigorFetchPolicyMiddlewaresBase, type VigorFetchPolicyMiddlewaresFluent, type VigorFetchPolicyMiddlewaresIntercept, type VigorFetchPolicyMiddlewaresSchema, type VigorFetchPolicySchema, VigorFetchPolicySerializers, VigorFetchPolicySettings, VigorFetchPolicySettingsBase, type VigorFetchPolicySettingsSchema, type VigorFetchProcessHandler, type VigorFetchRequestError, type VigorFetchRequestThis, type VigorFetchResult, type VigorFetchResultContextSchema, type VigorFetchRouteKeys, type VigorFetchSchema, type VigorFetchSerializerStage, VigorFetchSerializersBase, type VigorFetchSerializersSchema, type VigorFetchTimeline, type VigorFetchTimelineEvents, type VigorFetchTimelineSnapshot, type VigorFetchVerboseResult, type VigorFetcher, VigorHeadersSerializer, type VigorHeadersStepFunc, VigorHeadersSteps, type VigorHttpFailureStatus, type VigorHttpStatusOf, type VigorHttpSuccessStatus, type VigorInstance, type VigorIsSame, type VigorIsTransform, 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 VigorParseResultFor, type VigorParseSchema, VigorParseSniffStrategy, type VigorParseStrategyFunc, type VigorParseTimeline, type VigorParseTimelineEvents, type VigorParseTimelineSnapshot, type VigorPathList, type VigorPathSegments, VigorPathSerializer, type VigorPathStepFunc, VigorPathSteps, type VigorPlugin, type VigorPrimitive, type VigorQueryArrayFormat, type VigorQueryEntry, VigorQuerySerializer, type VigorQueryStepFunc, VigorQuerySteps, 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 VigorSerializeInfo, type VigorSerializedBody, type VigorSerializerStep, type VigorSimplify, VigorStatus, type VigorStringable, type VigorTimeline, type VigorTimelineEndEvents, type VigorTimelineItem, type VigorTimelineMiddlewareEvents, type VigorTimelineOutcome, type VigorTimelineProcessEvents, type VigorTimelineSnapshot, type VigorTransform, type VigorTransformFn, type VigorTransformKey, type VigorTransformResult, type VigorTransforms, VigorUrlSerializer, type VigorUrlStepFunc, VigorUrlSteps, adoptVigorFetchError, createBrand, createVigorTimelineRecorder, createVigorTransform, vigor as default, findInVigorErrorChain, isVigorAllError, isVigorDefault, isVigorEmpty, isVigorFetchError, isVigorInternalMiddleware, isVigorParseError, isVigorRetryError, markVigorInternal, readVigorParseBody, runVigorGuard, vigor, vigorStringifyValue };
|