vigor-fetch 4.0.10 → 4.0.11

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/dist/index.d.cts CHANGED
@@ -380,7 +380,9 @@ type VigorAllContextSchema<T extends VigorAllSchema<T>, R = VigorAllPipeResult<T
380
380
  /** Context shape seen by `before` middlewares — no task has run yet. */
381
381
  type VigorAllBeforeContextSchema<T extends VigorAllSchema<T>> = VigorAllContextSchema<T, VigorDefaultType>;
382
382
  /** Context shape seen by `after` middlewares — every task has settled, reflecting whatever `before` changed. */
383
- type VigorAllAfterContextSchema<T extends VigorAllSchema<T>> = VigorAllPipeStepVoid<VigorAllPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>;
383
+ type VigorAllAfterContextSchema<T extends VigorAllSchema<T>> = VigorDeepMerge<VigorAllPipeStepVoid<VigorAllPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
384
+ result: VigorAllPipeInitialContext<T>["result"];
385
+ }>;
384
386
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
385
387
  type VigorAllOnResultContextSchema<T extends VigorAllSchema<T>> = VigorAllPipeStepResult<VigorAllPipeStepVoid<VigorAllAfterContextSchema<T>, T["policy"]["middlewares"]["after"]>, T["policy"]["middlewares"]["onResult"]>;
386
388
  /** Per-task context, seen by `beforeEach` / `afterEach` / `onErrorEach`. */
@@ -715,7 +717,9 @@ type VigorFetchContextSchema<T extends VigorFetchSchema<T>, R = VigorFetchPipeRe
715
717
  /** Context shape seen by `before` middlewares — the request hasn't been sent yet. */
716
718
  type VigorFetchBeforeContextSchema<T extends VigorFetchSchema<T>> = VigorFetchContextSchema<T, VigorDefaultType>;
717
719
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
718
- type VigorFetchAfterContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorFetchPipeStepVoid<VigorFetchPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
720
+ type VigorFetchAfterContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorDeepMerge<VigorFetchPipeStepVoid<VigorFetchPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
721
+ result: VigorFetchPipeInitialContext<T>["result"];
722
+ }>, T["policy"]["middlewares"]["after"]>;
719
723
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
720
724
  type VigorFetchOnResultContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorFetchAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
721
725
 
@@ -1302,7 +1306,9 @@ type VigorRetryContextSchema<T extends VigorRetrySchema<T>, R = VigorRetryPipeRe
1302
1306
  /** Context shape seen by `before` middlewares — the target hasn't run yet, so there's no result. */
1303
1307
  type VigorRetryBeforeContextSchema<T extends VigorRetrySchema<T>> = VigorRetryContextSchema<T, VigorDefaultType>;
1304
1308
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
1305
- type VigorRetryAfterContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorRetryPipeStepVoid<VigorRetryPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
1309
+ type VigorRetryAfterContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorDeepMerge<VigorRetryPipeStepVoid<VigorRetryPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
1310
+ result: VigorRetryPipeInitialContext<T>["result"];
1311
+ }>, T["policy"]["middlewares"]["after"]>;
1306
1312
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
1307
1313
  type VigorRetryOnResultContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorRetryAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
1308
1314
 
@@ -1860,7 +1866,9 @@ type VigorParseContextSchema<T extends VigorParseSchema<T>, R = VigorParsePipeRe
1860
1866
  /** Context shape seen by `before` middlewares — parsing hasn't run yet. */
1861
1867
  type VigorParseBeforeContextSchema<T extends VigorParseSchema<T>> = VigorParseContextSchema<T, VigorDefaultType>;
1862
1868
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
1863
- type VigorParseAfterContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorParsePipeStepVoid<VigorParsePipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
1869
+ type VigorParseAfterContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorDeepMerge<VigorParsePipeStepVoid<VigorParsePipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
1870
+ result: VigorParsePipeInitialContext<T>["result"];
1871
+ }>, T["policy"]["middlewares"]["after"]>;
1864
1872
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
1865
1873
  type VigorParseOnResultContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorParseAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
1866
1874
 
package/dist/index.d.ts CHANGED
@@ -380,7 +380,9 @@ type VigorAllContextSchema<T extends VigorAllSchema<T>, R = VigorAllPipeResult<T
380
380
  /** Context shape seen by `before` middlewares — no task has run yet. */
381
381
  type VigorAllBeforeContextSchema<T extends VigorAllSchema<T>> = VigorAllContextSchema<T, VigorDefaultType>;
382
382
  /** Context shape seen by `after` middlewares — every task has settled, reflecting whatever `before` changed. */
383
- type VigorAllAfterContextSchema<T extends VigorAllSchema<T>> = VigorAllPipeStepVoid<VigorAllPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>;
383
+ type VigorAllAfterContextSchema<T extends VigorAllSchema<T>> = VigorDeepMerge<VigorAllPipeStepVoid<VigorAllPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
384
+ result: VigorAllPipeInitialContext<T>["result"];
385
+ }>;
384
386
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
385
387
  type VigorAllOnResultContextSchema<T extends VigorAllSchema<T>> = VigorAllPipeStepResult<VigorAllPipeStepVoid<VigorAllAfterContextSchema<T>, T["policy"]["middlewares"]["after"]>, T["policy"]["middlewares"]["onResult"]>;
386
388
  /** Per-task context, seen by `beforeEach` / `afterEach` / `onErrorEach`. */
@@ -715,7 +717,9 @@ type VigorFetchContextSchema<T extends VigorFetchSchema<T>, R = VigorFetchPipeRe
715
717
  /** Context shape seen by `before` middlewares — the request hasn't been sent yet. */
716
718
  type VigorFetchBeforeContextSchema<T extends VigorFetchSchema<T>> = VigorFetchContextSchema<T, VigorDefaultType>;
717
719
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
718
- type VigorFetchAfterContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorFetchPipeStepVoid<VigorFetchPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
720
+ type VigorFetchAfterContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorDeepMerge<VigorFetchPipeStepVoid<VigorFetchPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
721
+ result: VigorFetchPipeInitialContext<T>["result"];
722
+ }>, T["policy"]["middlewares"]["after"]>;
719
723
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
720
724
  type VigorFetchOnResultContextSchema<T extends VigorFetchSchema<T>> = VigorFetchPipeStepResult<VigorFetchAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
721
725
 
@@ -1302,7 +1306,9 @@ type VigorRetryContextSchema<T extends VigorRetrySchema<T>, R = VigorRetryPipeRe
1302
1306
  /** Context shape seen by `before` middlewares — the target hasn't run yet, so there's no result. */
1303
1307
  type VigorRetryBeforeContextSchema<T extends VigorRetrySchema<T>> = VigorRetryContextSchema<T, VigorDefaultType>;
1304
1308
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
1305
- type VigorRetryAfterContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorRetryPipeStepVoid<VigorRetryPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
1309
+ type VigorRetryAfterContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorDeepMerge<VigorRetryPipeStepVoid<VigorRetryPipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
1310
+ result: VigorRetryPipeInitialContext<T>["result"];
1311
+ }>, T["policy"]["middlewares"]["after"]>;
1306
1312
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
1307
1313
  type VigorRetryOnResultContextSchema<T extends VigorRetrySchema<T>> = VigorRetryPipeStepResult<VigorRetryAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
1308
1314
 
@@ -1860,7 +1866,9 @@ type VigorParseContextSchema<T extends VigorParseSchema<T>, R = VigorParsePipeRe
1860
1866
  /** Context shape seen by `before` middlewares — parsing hasn't run yet. */
1861
1867
  type VigorParseBeforeContextSchema<T extends VigorParseSchema<T>> = VigorParseContextSchema<T, VigorDefaultType>;
1862
1868
  /** Context shape seen by `after` middlewares — reflects the result after `before` has run. */
1863
- type VigorParseAfterContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorParsePipeStepVoid<VigorParsePipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, T["policy"]["middlewares"]["after"]>;
1869
+ type VigorParseAfterContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorDeepMerge<VigorParsePipeStepVoid<VigorParsePipeInitialContext<T>, T["policy"]["middlewares"]["before"]>, {
1870
+ result: VigorParsePipeInitialContext<T>["result"];
1871
+ }>, T["policy"]["middlewares"]["after"]>;
1864
1872
  /** Context shape seen by `onResult` middlewares — additionally threads any `onResult` middlewares already registered earlier in the same chain, so `ctx.result` reflects what the previous `onResult` returned. */
1865
1873
  type VigorParseOnResultContextSchema<T extends VigorParseSchema<T>> = VigorParsePipeStepResult<VigorParseAfterContextSchema<T>, T["policy"]["middlewares"]["onResult"]>;
1866
1874
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigor-fetch",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "Smart, zero-dependency HTTP client with self-healing retries for rate-limited servers.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",