From 53fb12b92c46ce0f9174f9e36da6e953faa42569 Mon Sep 17 00:00:00 2001 From: Julien Elbaz Date: Sat, 14 Sep 2024 00:00:38 +0200 Subject: [PATCH] 2.10.0 tag --- CHANGELOG.md | 65 +++++++++---------- README.md | 2 +- docs/api/assets/navigation.js | 2 +- docs/api/assets/search.js | 2 +- docs/api/functions/addons_abort.default.html | 2 +- docs/api/functions/addons_perfs.default.html | 2 +- .../functions/addons_progress.default.html | 2 +- docs/api/functions/index.default.html | 10 +-- .../functions/middlewares_dedupe.dedupe.html | 2 +- .../functions/middlewares_delay.delay.html | 2 +- .../functions/middlewares_retry.retry.html | 2 +- ...wares_throttlingCache.throttlingCache.html | 2 +- .../addons_abort.AbortResolver.html | 8 +-- .../interfaces/addons_abort.AbortWretch.html | 4 +- .../addons_basicAuth.BasicAuthAddon.html | 4 +- .../addons_formData.FormDataAddon.html | 4 +- .../addons_formUrl.FormUrlAddon.html | 4 +- .../interfaces/addons_perfs.PerfsAddon.html | 4 +- .../addons_progress.ProgressResolver.html | 4 +- .../addons_queryString.QueryStringAddon.html | 4 +- docs/api/interfaces/index.Wretch.html | 50 +++++++------- docs/api/interfaces/index.WretchError.html | 4 +- .../interfaces/index.WretchResponseChain.html | 30 ++++----- docs/api/modules/addons.html | 2 +- docs/api/modules/addons_abort.html | 2 +- docs/api/modules/addons_basicAuth.html | 2 +- docs/api/modules/addons_formData.html | 2 +- docs/api/modules/addons_formUrl.html | 2 +- docs/api/modules/addons_perfs.html | 2 +- docs/api/modules/addons_progress.html | 2 +- docs/api/modules/addons_queryString.html | 2 +- docs/api/modules/index.html | 2 +- docs/api/modules/middlewares.html | 2 +- docs/api/modules/middlewares_dedupe.html | 2 +- docs/api/modules/middlewares_delay.html | 2 +- docs/api/modules/middlewares_retry.html | 2 +- .../modules/middlewares_throttlingCache.html | 2 +- docs/api/types/addons_perfs.PerfCallback.html | 2 +- docs/api/types/index.Config.html | 2 +- .../api/types/index.ConfiguredMiddleware.html | 2 +- docs/api/types/index.FetchLike.html | 2 +- docs/api/types/index.Middleware.html | 2 +- docs/api/types/index.WretchAddon.html | 2 +- .../types/index.WretchDeferredCallback.html | 2 +- docs/api/types/index.WretchErrorCallback.html | 2 +- docs/api/types/index.WretchOptions.html | 2 +- docs/api/types/index.WretchResponse.html | 2 +- .../middlewares_dedupe.DedupeKeyFunction.html | 2 +- .../middlewares_dedupe.DedupeMiddleware.html | 2 +- .../middlewares_dedupe.DedupeOptions.html | 2 +- ...lewares_dedupe.DedupeResolverFunction.html | 2 +- ...middlewares_dedupe.DedupeSkipFunction.html | 2 +- .../middlewares_delay.DelayMiddleware.html | 2 +- .../middlewares_retry.DelayRampFunction.html | 2 +- .../middlewares_retry.OnRetryFunction.html | 2 +- ...lewares_retry.OnRetryFunctionResponse.html | 2 +- .../middlewares_retry.RetryMiddleware.html | 2 +- .../types/middlewares_retry.RetryOptions.html | 2 +- .../types/middlewares_retry.SkipFunction.html | 2 +- .../middlewares_retry.UntilFunction.html | 2 +- ...ingCache.ThrottlingCacheClearFunction.html | 2 +- ...ache.ThrottlingCacheConditionFunction.html | 2 +- ...che.ThrottlingCacheInvalidateFunction.html | 2 +- ...tlingCache.ThrottlingCacheKeyFunction.html | 2 +- ...ttlingCache.ThrottlingCacheMiddleware.html | 2 +- ...hrottlingCache.ThrottlingCacheOptions.html | 2 +- ...lingCache.ThrottlingCacheSkipFunction.html | 2 +- .../variables/addons_basicAuth.default.html | 2 +- .../variables/addons_formData.default.html | 2 +- .../api/variables/addons_formUrl.default.html | 2 +- .../variables/addons_queryString.default.html | 2 +- package.json | 2 +- 72 files changed, 155 insertions(+), 158 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd3fe0..df40eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ + +# [2.10.0](https://github.com/elbywan/wretch/compare/2.9.1...2.10.0) (2024-09-13) + + +### :arrow_up: Version update(s) + +* Bump axios from 1.6.2 to 1.7.7 ([4542c28](https://github.com/elbywan/wretch/commit/4542c28)) + +### :art: Code improvement(s) + +* Expand eslint ignore list ([cdad424](https://github.com/elbywan/wretch/commit/cdad424)) +* Properly build commonjs ([c7f00fc](https://github.com/elbywan/wretch/commit/c7f00fc)), closes [#247](https://github.com/elbywan/wretch/issues/247) + + + ## [2.9.1](https://github.com/elbywan/wretch/compare/2.9.0...2.9.1) (2024-09-06) @@ -398,40 +413,7 @@ -# [2.0.0-next.1](https://github.com/elbywan/wretch/compare/2.0.0-next.0...2.0.0-next.1) (2022-07-08) - - -### :art: Code improvement(s) - -* Add editorconfig ([e81eaff](https://github.com/elbywan/wretch/commit/e81eaff)) - -### :fire: Breaking change(s) - -* Drop support on node < 14 ([1ff926c](https://github.com/elbywan/wretch/commit/1ff926c)) - -### :memo: Documentation update(s) - -* Additional improvements ([e79ff71](https://github.com/elbywan/wretch/commit/e79ff71)) -* Autogenerate API documentation and split it from the main README ([c710a71](https://github.com/elbywan/wretch/commit/c710a71)) -* Move svg asset and minor readme changes ([30de07c](https://github.com/elbywan/wretch/commit/30de07c)) -* Regenerate api doc ([7ae5b57](https://github.com/elbywan/wretch/commit/7ae5b57)) -* Small edits to the contributing file and renames scripts related t ([abec7f0](https://github.com/elbywan/wretch/commit/abec7f0)) -* Update bundle size ([1115d34](https://github.com/elbywan/wretch/commit/1115d34)) -* Update companion website ([d6bb842](https://github.com/elbywan/wretch/commit/d6bb842)) -* Update documentation ([15fd187](https://github.com/elbywan/wretch/commit/15fd187)) - -### :white_check_mark: Test improvement(s) - -* Fix resolvers test for node14 ([ca8b559](https://github.com/elbywan/wretch/commit/ca8b559)) -* Fix test on node 18 (with polyfilled fetch) ([d3b7b00](https://github.com/elbywan/wretch/commit/d3b7b00)) -* Replace restify with fastify for mock server ([9ee2cfc](https://github.com/elbywan/wretch/commit/9ee2cfc)) -* Run lint on CI ([9b819d3](https://github.com/elbywan/wretch/commit/9b819d3)) -* Test in multiple version of node in CI ([00d80a6](https://github.com/elbywan/wretch/commit/00d80a6)) - - - - -# [2.0.0-next.0](https://github.com/elbywan/wretch/compare/1.7.10...2.0.0-next.0) (2022-07-03) +# [2.0.0-next.1](https://github.com/elbywan/wretch/compare/1.7.10...2.0.0-next.1) (2022-07-08) ### :arrow_up: Version update(s) @@ -440,6 +422,7 @@ ### :art: Code improvement(s) +* Add editorconfig ([e81eaff](https://github.com/elbywan/wretch/commit/e81eaff)) * Improved packaging and bundling ([69c1e35](https://github.com/elbywan/wretch/commit/69c1e35)) ### :bug: Bug fix(es) @@ -459,15 +442,29 @@ * Add url arg and harmonize replace/mixin arguments ([8e4d0aa](https://github.com/elbywan/wretch/commit/8e4d0aa)) * Complete refactoring ([c2f5035](https://github.com/elbywan/wretch/commit/c2f5035)) +* Drop support on node < 14 ([1ff926c](https://github.com/elbywan/wretch/commit/1ff926c)) * Restore normal array behaviour for formdata and fix tests ([6879d48](https://github.com/elbywan/wretch/commit/6879d48)), closes [#119](https://github.com/elbywan/wretch/issues/119) ### :memo: Documentation update(s) +* Additional improvements ([e79ff71](https://github.com/elbywan/wretch/commit/e79ff71)) +* Autogenerate API documentation and split it from the main README ([c710a71](https://github.com/elbywan/wretch/commit/c710a71)) +* Move svg asset and minor readme changes ([30de07c](https://github.com/elbywan/wretch/commit/30de07c)) +* Regenerate api doc ([7ae5b57](https://github.com/elbywan/wretch/commit/7ae5b57)) +* Small edits to the contributing file and renames scripts related t ([abec7f0](https://github.com/elbywan/wretch/commit/abec7f0)) * Update browserstack badge. ([91cad34](https://github.com/elbywan/wretch/commit/91cad34)) +* Update bundle size ([1115d34](https://github.com/elbywan/wretch/commit/1115d34)) +* Update companion website ([d6bb842](https://github.com/elbywan/wretch/commit/d6bb842)) +* Update documentation ([15fd187](https://github.com/elbywan/wretch/commit/15fd187)) ### :white_check_mark: Test improvement(s) * Better tests coverage ([77e85dc](https://github.com/elbywan/wretch/commit/77e85dc)) +* Fix resolvers test for node14 ([ca8b559](https://github.com/elbywan/wretch/commit/ca8b559)) +* Fix test on node 18 (with polyfilled fetch) ([d3b7b00](https://github.com/elbywan/wretch/commit/d3b7b00)) +* Replace restify with fastify for mock server ([9ee2cfc](https://github.com/elbywan/wretch/commit/9ee2cfc)) +* Run lint on CI ([9b819d3](https://github.com/elbywan/wretch/commit/9b819d3)) +* Test in multiple version of node in CI ([00d80a6](https://github.com/elbywan/wretch/commit/00d80a6)) diff --git a/README.md b/README.md index 74bf344..639dfe3 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@
-##### Wretch 2.9 is now live 🎉 ! Please have a look at the [releases](https://github.com/elbywan/wretch/releases) and the [changelog](https://github.com/elbywan/wretch/blob/master/CHANGELOG.md) after each update for new features and breaking changes. If you want to try out the hot stuff, please look into the [dev](https://github.com/elbywan/wretch/tree/dev) branch. +##### Wretch 2.10 is now live 🎉 ! Please have a look at the [releases](https://github.com/elbywan/wretch/releases) and the [changelog](https://github.com/elbywan/wretch/blob/master/CHANGELOG.md) after each update for new features and breaking changes. If you want to try out the hot stuff, please look into the [dev](https://github.com/elbywan/wretch/tree/dev) branch. ##### And if you like the library please consider becoming a [sponsor](https://github.com/sponsors/elbywan) ❤️. diff --git a/docs/api/assets/navigation.js b/docs/api/assets/navigation.js index 7ac040b..64a885d 100644 --- a/docs/api/assets/navigation.js +++ b/docs/api/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE6WX227bMAyG38W9zQ5t0w7NXZeuwLAN3doFuyiKQImVRIhiZ7LSNRj67oOt2NGJEjXfJj8/ijRJUY9/M0lfZDbKSJ6XRZUNsi2Rq2yUbcp8x2n1Tv3+diU3PBtka1bk2ehskM1XjOeCFtnosUNcz0oh72lV8mcqgqQTW6q4w9Or4fn74evARP4SVM5XCGAnhHAfScXm1zu5uq5Nw0RHC0FvS7G5IZIgmLY0hJwIjiRqSgj4nYpFhcAZOhAmyqWgVYX71B41BP6xo2L/IAUrloizetQQmNTVgUAaOgg2SygiU/vmNIBd4MvIkEahuELSlUHkFllK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AeC8nu8ZMl9nRIdo2cO6iHRLLzlPkEtr1/mtieg4OgmTBPr0//AFxyWgSYJQAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WX227bMAyG38W9zQ5t0w7NXZeuwLAN3doFuyiKQImVRIhiZ7LSNRj67oOt2NGJEjXfJj8/ijRJUY9/M0lfZDbKSJ6XRZUNsi2Rq2yUbcp8x2n1Tv3+diU3PBtka1bk2ehskM1XjOeCFtnosUNcz0oh72lV8mcqgqQTW6q4w9Or4fn74evARP4SVM5XCGAnhHAfScXm1zu5uq5Nw0RHC0FvS7G5IZIgmLY0hJwIjiRqSgj4nYpFhcAZOhAmyqWgVYX71B41BP6xo2L/IAUrloizetQQmNTVgUAaOgg2SygiU/vmNIBd4MvIkEahuELSlUHkFllKR10YdygPDNGSQsjfSWVkq4OnbQoE4k2bf/uMSlZIKhZkbiMNueXg4jI2L4NUJQ4xc7ogO65FvdgVc8nKwsIddCbqcvj65OsdMIedApVHaKC7IR+5pk1S5M9EMDLzntYb/fmZEX3bt2DwrQAVO3DvuKF3VMOiX+AdExv3RPBg2BPB0VG7E80fdM3U9f1DromYiJvhB8bb/IuK1ndvu7Eq3lEbirNWjQnnMzJfH5lyv/XhWqEFfH/14fTiLGlEKCZmRLRTHs7eQYBLILireNLYgm2jftOxw2Ki124jMAGaBpUDeK1yc6Czbbt+7aOT4RbSc8GKnL64WWh+RgUeuAgVJH75KcUnIUp/6eicRhWH3dNqWxYVHa8I838LHWqoQ/BxWSzY0m5phVL/xbpYqXaC5t9YnnP6hwga4pnKGP22juYrWwPI7u8YJ3Y2/IlUgq2W0FGaAMe6oQsqBM2hAatjbS3OQ1NjGLwhxLHvts3cClEPEhyvLd0QsNX0uGEUDjNcN11peG4X7U/UcLmh+W5Lv9D97eEkceSJzwZ6aiitr9ojeMMkTHe+eAR91Ie57cWZnBqPYdjTw5ptk71YRrAHTvaJH8C2CLLvySbt8K4NxL8r7qkUKbXpWiDZbptjfWiWkK9Gn/QNXIsgG98ClhyiJlYkshZ/rkQpJWfFckzmKzrmlKR0V8Qc67Usclab9PDsQSC9fy6eCWc5kfT/3XsZSP9poz5ojPSYVPchW6Q/fC+AhkhPiU0StoZ8TgrJeIIXWw9x8+YSQQA7IUziZI8CKR3EEfVoQnBaHcSRZp4RRNeiR9amStN3/VJbpofr2MS2TngHi/jAP0KARSzCR+7hsW0s4sU2xLnz93bElW4UfwuYlXR8CnjwvpKyngXxLpw2EmRdAkujLwE11DKIB28cFoq9JnsObUUenxvTRoKP3L/SurErrGMSix5cayEPlkEiH3rBRv1gn7Xgegv5sQxQfMRw0eDI0YLtckVOaW/g2obQhjzGtgre3z2K6yl8q3tSbsupJUZ1FG7pdxNj+wpxYhnDPwHSz2GzEs8SehAkH8aFJZ4GuYpEjpGwnCAeC8nu8ZMl9nRIdo2cO6iHRLLzlPkEtr1/mtieg4OgmTBPr0//AFxyWgSYJQAA" \ No newline at end of file diff --git a/docs/api/assets/search.js b/docs/api/assets/search.js index d61ae23..ed96c5e 100644 --- a/docs/api/assets/search.js +++ b/docs/api/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE81dXXMrt5H9L9SrIrMx3/fNceLa1GbXWSfePKhcLl5xdMW9FKmQlG3F5f++NZjBsNE44PQMKek+iSKB7kbjoAH0wWB+m+22v+xnH25/m31ebZazD+Z6tlk81rMPs9VmWf86u54979azD7PH7fJ5Xe+/st/ePBwe17Pr2d16sd/X+9mH2ez3aychT3sRy/p+8bw+9ELunzd3h9V248R0vwNx17Onxa7eHHo7jvJpbqZpuOr++QOd1uUqxXRun6wGnc5j4XEa8yxL8l7lTz8dXp7qURpv2jp/MDrVN87QSKPr3W67+4faCF78rRre67zpa2kafjQ10vSn7frlfrVeK3ucF3+rpvc6Xa+nysYfjY00/p+7+nD38OfGRzpT/ArjHHAMPovlspG/+LjdHYIY1P74k/3xZCgy2dGdXzelW+N6gavNod7dL+6kTFb2dGzyzIx4cL/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rlhUCaIPb6MjYlnAbNwu4xEN6+CLRGfqLohYlx4SXUdvBXBoOL55FQHv6eFXGvxBZLSe00G8g7kPnj+XbkyDZOZLJiMMGcfzuesYYnbg/aJfNIFz6ft+uV+tV77odNjBnQ4doL8aM4Q5jDh4meq9N/WT89VfFpVohVlgRPWRiU8nRjAy/D0ppJlcNIQNWNYHHGUmFGGpadn3188QZbo+tLmuT1ncTZSZwbLlQf+SlisSHvkuhCkTE2JObp5VIRlXHUTQed7bxnJY46St0BdmLLo6pZZZq4DWifvl9XhYb041PsDCt85U1Dq+gSJIb4dag7i6gSJiS9nAKkcYFPdItwKw4u4nAGlclsWZX7Wit1uNvXhl+3uc7A+z9n4L3UjtpUYznwZG2Jlb6XOk/v60L8MmncKX7vqBK0+bRZeGOf9qnNZkzX0xikTkXdxu+rpfJ3TYpnIjCHGcepGuftzb7XlDuPDttKJad/aykMIF9Iv9CsdjLu1rr9z4/2opNZPrJkLvlPu46Vy2y3kWkoGdUzOlPTHFpSBUOpwjA3Uw/E5dzFDmeMQio77ZqiJd+vcDVDl/k1oipAXOVsAVH2uVxeVhQYcCQu+iu0XecrUodAAQljBV3xzl7RPRiHfiY+N+JxN0FXPHOmiCIyRfGVT6nDzvGkY5e1u9e9abCP5SC10S9Pn5h0jXkxjQFOmYq0MGB9ZjxR9f+tCiMghlrxzHTNDlc5j4SGfwjvl48A+12GlFQdW0Gw6MHNdtGllLbs3DqP9GvH0KVU6rLViwwUDQ2/nQuWyiwnERvL+qXTRvJUJRjLxQzykXNm00uDykGeNqdLhzxd397BY+Z095yM3Uzjxx+vZ0+qpXq829ezD7Y+///7/E8Xtv5blAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA81dXXMrt5H9L9SrIrMx3/fNceLa1GbXWSfePKhcLl5xdMW9FKmQlG3F5f++NZjBsNE44PQMKek+iSKB7kbjoAH0wWB+m+22v+xnH25/m31ebZazD+Z6tlk81rMPs9VmWf86u54979azD7PH7fJ5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rLViwwUDQ2/nQuWyiwnERvL+qXTRvJUJRjLxQzykXNm00uDykGeNqdLhzxd397BY+Z095yM3Uzjxx+vZ0+qpXq829ezD7Y+///7/E8Xtv5blAAA="; \ No newline at end of file diff --git a/docs/api/functions/addons_abort.default.html b/docs/api/functions/addons_abort.default.html index e685171..5b12995 100644 --- a/docs/api/functions/addons_abort.default.html +++ b/docs/api/functions/addons_abort.default.html @@ -6,4 +6,4 @@
import AbortAddon from "wretch/addons/abort"

const [c, w] = wretch("...")
.addon(AbortAddon())
.get()
.onAbort((_) => console.log("Aborted !"))
.controller();

w.text((_) => console.log("should never be called"));
c.abort();

// Or :

const controller = new AbortController();

wretch("...")
.addon(AbortAddon())
.signal(controller)
.get()
.onAbort((_) => console.log("Aborted !"))
.text((_) => console.log("should never be called"));

controller.abort();
-
+
diff --git a/docs/api/functions/addons_perfs.default.html b/docs/api/functions/addons_perfs.default.html index ffd6072..2a07d71 100644 --- a/docs/api/functions/addons_perfs.default.html +++ b/docs/api/functions/addons_perfs.default.html @@ -11,4 +11,4 @@
// Node.js only
const { performance, PerformanceObserver } = require("perf_hooks");

wretch.polyfills({
fetch: function (url, opts) {
performance.mark(url + " - begin");
return fetch(url, opts).then(res => {
performance.mark(url + " - end");
setTimeout(() => performance.measure(res.url, url + " - begin", url + " - end"), 0);
return res;
});
},
// other polyfills…
performance: performance,
PerformanceObserver: PerformanceObserver,
});
-
+
diff --git a/docs/api/functions/addons_progress.default.html b/docs/api/functions/addons_progress.default.html index 5a11cf3..dcdf13a 100644 --- a/docs/api/functions/addons_progress.default.html +++ b/docs/api/functions/addons_progress.default.html @@ -3,4 +3,4 @@
import ProgressAddon from "wretch/addons/progress"

wretch("some_url")
// Register the addon
.addon(ProgressAddon())
.get()
// Log the progress as a percentage of completion
.progress((loaded, total) => console.log(`${(loaded / total * 100).toFixed(0)}%`))
-
+
diff --git a/docs/api/functions/index.default.html b/docs/api/functions/index.default.html index 6c0ef70..5267db3 100644 --- a/docs/api/functions/index.default.html +++ b/docs/api/functions/index.default.html @@ -6,12 +6,12 @@

Parameters

Returns Wretch

A fresh wretch instance

-

Properties

Properties

WretchError: typeof WretchError
default: typeof default
errorType: ((errorType: ErrorType) => void)

{@inheritDoc setErrorType}

+

Properties

WretchError: typeof WretchError
default: typeof default
errorType: ((errorType: ErrorType) => void)

{@inheritDoc setErrorType}

Type declaration

    • (errorType): void
    • Sets the default method (text, json, …) used to parse the data contained in the response body in case of an HTTP error. As with other static methods, it will affect wretch instances created after calling this function.

      Note: if the response Content-Type header is set to "application/json", the body will be parsed as json regardless of the errorType.

      @@ -19,14 +19,14 @@

      If null, defaults to "text".

      -

      Parameters

      • errorType: ErrorType

      Returns void

options: ((options: object, replace?: boolean) => void)

{@inheritDoc setOptions}

+

Parameters

  • errorType: ErrorType

Returns void

options: ((options: object, replace?: boolean) => void)

{@inheritDoc setOptions}

Type declaration

    • (options, replace?): void
    • Sets the default fetch options that will be stored internally when instantiating wretch objects.

      import wretch from "wretch"

      wretch.options({ headers: { "Accept": "application/json" } });

      // The fetch request is sent with both headers.
      wretch("...", { headers: { "X-Custom": "Header" } }).get().res();

      Parameters

      • options: object

        Default options

      • replace: boolean = false

        If true, completely replaces the existing options instead of mixing in

        -

      Returns void

polyfills: ((polyfills: object, replace?: boolean) => void)

{@inheritDoc setPolyfills}

+

Returns void

polyfills: ((polyfills: object, replace?: boolean) => void)

{@inheritDoc setPolyfills}

Type declaration

    • (polyfills, replace?): void
    • Sets the default polyfills that will be stored internally when instantiating wretch objects. Useful for browserless environments like node.js.

      Needed for libraries like fetch-ponyfill.

      @@ -35,4 +35,4 @@

      Parameters

      • polyfills: object

        An object containing the polyfills

      • replace: boolean = false

        If true, replaces the current polyfills instead of mixing in

        -

      Returns void

+

Returns void

diff --git a/docs/api/functions/middlewares_dedupe.dedupe.html b/docs/api/functions/middlewares_dedupe.dedupe.html index 9ea9b22..e2bc090 100644 --- a/docs/api/functions/middlewares_dedupe.dedupe.html +++ b/docs/api/functions/middlewares_dedupe.dedupe.html @@ -1 +1 @@ -dedupe | wretch
+dedupe | wretch
diff --git a/docs/api/functions/middlewares_delay.delay.html b/docs/api/functions/middlewares_delay.delay.html index 2aa86ee..eb8a2b7 100644 --- a/docs/api/functions/middlewares_delay.delay.html +++ b/docs/api/functions/middlewares_delay.delay.html @@ -1 +1 @@ -delay | wretch
+delay | wretch
diff --git a/docs/api/functions/middlewares_retry.retry.html b/docs/api/functions/middlewares_retry.retry.html index 886d937..bcd6e53 100644 --- a/docs/api/functions/middlewares_retry.retry.html +++ b/docs/api/functions/middlewares_retry.retry.html @@ -1 +1 @@ -retry | wretch
+retry | wretch
diff --git a/docs/api/functions/middlewares_throttlingCache.throttlingCache.html b/docs/api/functions/middlewares_throttlingCache.throttlingCache.html index 13aefea..6c6b7c7 100644 --- a/docs/api/functions/middlewares_throttlingCache.throttlingCache.html +++ b/docs/api/functions/middlewares_throttlingCache.throttlingCache.html @@ -1 +1 @@ -throttlingCache | wretch
+throttlingCache | wretch
diff --git a/docs/api/interfaces/addons_abort.AbortResolver.html b/docs/api/interfaces/addons_abort.AbortResolver.html index d35ec1e..5ac57a1 100644 --- a/docs/api/interfaces/addons_abort.AbortResolver.html +++ b/docs/api/interfaces/addons_abort.AbortResolver.html @@ -1,16 +1,16 @@ -AbortResolver | wretch

Interface AbortResolver

interface AbortResolver {
    controller: (<T, C, R>(this: C & WretchResponseChain<T, C, R>) => [any, AbortResolver]);
    onAbort: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb: WretchErrorCallback<T, C, R>) => this);
    setTimeout: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, time: number, controller?: AbortController) => this);
}

Properties

controller +AbortResolver | wretch

Interface AbortResolver

interface AbortResolver {
    controller: (<T, C, R>(this: C & WretchResponseChain<T, C, R>) => [any, AbortResolver]);
    onAbort: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb: WretchErrorCallback<T, C, R>) => this);
    setTimeout: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, time: number, controller?: AbortController) => this);
}

Properties

controller: (<T, C, R>(this: C & WretchResponseChain<T, C, R>) => [any, AbortResolver])

Returns the provided or generated AbortController plus the wretch response chain as a pair.

// We need the controller outside the chain
const [c, w] = wretch("url")
.addon(AbortAddon())
.get()
.controller()

// Resume with the chain
w.onAbort(_ => console.log("ouch")).json()

// Later on…
c.abort()
-
onAbort: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb: WretchErrorCallback<T, C, R>) => this)

Catches an AbortError and performs a callback.

-
setTimeout: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, time: number, controller?: AbortController) => this)

Aborts the request after a fixed time.

+
onAbort: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb: WretchErrorCallback<T, C, R>) => this)

Catches an AbortError and performs a callback.

+
setTimeout: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, time: number, controller?: AbortController) => this)

Aborts the request after a fixed time.

If you use a custom AbortController associated with the request, pass it as the second argument.

// 1 second timeout
wretch("...").addon(AbortAddon()).get().setTimeout(1000).json(_ =>
// will not be called if the request timeouts
)

Type declaration

    • <T, C, R>(this, time, controller?): this
    • Type Parameters

      Parameters

      • this: C & WretchResponseChain<T, C, R>
      • time: number

        Time in milliseconds

      • Optionalcontroller: AbortController

        An instance of AbortController

        -

      Returns this

+

Returns this

diff --git a/docs/api/interfaces/addons_abort.AbortWretch.html b/docs/api/interfaces/addons_abort.AbortWretch.html index 16cb5fc..30ebffa 100644 --- a/docs/api/interfaces/addons_abort.AbortWretch.html +++ b/docs/api/interfaces/addons_abort.AbortWretch.html @@ -1,4 +1,4 @@ -AbortWretch | wretch

Interface AbortWretch

interface AbortWretch {
    signal: (<T, C, R>(this: T & Wretch<T, C, R>, controller: AbortController) => this);
}

Properties

signal +AbortWretch | wretch

Interface AbortWretch

interface AbortWretch {
    signal: (<T, C, R>(this: T & Wretch<T, C, R>, controller: AbortController) => this);
}

Properties

Properties

signal: (<T, C, R>(this: T & Wretch<T, C, R>, controller: AbortController) => this)

Associates a custom controller with the request.

Useful when you need to use your own AbortController, otherwise wretch will create a new controller itself.

@@ -6,4 +6,4 @@

Type declaration

    • <T, C, R>(this, controller): this
    • Type Parameters

      Parameters

      • this: T & Wretch<T, C, R>
      • controller: AbortController

        An instance of AbortController

        -

      Returns this

+

Returns this

diff --git a/docs/api/interfaces/addons_basicAuth.BasicAuthAddon.html b/docs/api/interfaces/addons_basicAuth.BasicAuthAddon.html index cb6f16d..1b4b052 100644 --- a/docs/api/interfaces/addons_basicAuth.BasicAuthAddon.html +++ b/docs/api/interfaces/addons_basicAuth.BasicAuthAddon.html @@ -1,4 +1,4 @@ -BasicAuthAddon | wretch

Interface BasicAuthAddon

interface BasicAuthAddon {
    basicAuth<T, C, R>(this: T & Wretch<T, C, R>, username: string, password: string): this;
}

Methods

basicAuth +BasicAuthAddon | wretch

Interface BasicAuthAddon

interface BasicAuthAddon {
    basicAuth<T, C, R>(this: T & Wretch<T, C, R>, username: string, password: string): this;
}

Methods

Methods

  • Sets the Authorization header to Basic + . Additionally, allows using URLs with credentials in them.

    const user = "user"
    const pass = "pass"

    // Automatically sets the Authorization header to "Basic " + <base64 encoded credentials>
    wretch("...").addon(BasicAuthAddon).basicAuth(user, pass).get()

    // Allows using URLs with credentials in them
    wretch(`https://${user}:${pass}@...`).addon(BasicAuthAddon).get() @@ -6,4 +6,4 @@

    Type Parameters

    Parameters

    • this: T & Wretch<T, C, R>
    • username: string

      Username to use for basic auth

    • password: string

      Password to use for basic auth

      -

    Returns this

+

Returns this

diff --git a/docs/api/interfaces/addons_formData.FormDataAddon.html b/docs/api/interfaces/addons_formData.FormDataAddon.html index 3082679..3216da3 100644 --- a/docs/api/interfaces/addons_formData.FormDataAddon.html +++ b/docs/api/interfaces/addons_formData.FormDataAddon.html @@ -1,4 +1,4 @@ -FormDataAddon | wretch

Interface FormDataAddon

interface FormDataAddon {
    formData<T, C, R>(this: T & Wretch<T, C, R>, formObject: object, recursive?: boolean | string[]): this;
}

Methods

formData +FormDataAddon | wretch

Interface FormDataAddon

interface FormDataAddon {
    formData<T, C, R>(this: T & Wretch<T, C, R>, formObject: object, recursive?: boolean | string[]): this;
}

Methods

Methods

  • Converts the javascript object to a FormData and sets the request body.

    const form = {
    hello: "world",
    duck: "Muscovy",
    };

    wretch("...").addons(FormDataAddon).formData(form).post();
    @@ -24,4 +24,4 @@

    Type Parameters

    Parameters

    • this: T & Wretch<T, C, R>
    • formObject: object

      An object which will be converted to a FormData

    • Optionalrecursive: boolean | string[]

      If true, will recurse through all nested objects. Can be set as an array of string to exclude specific keys.

      -

    Returns this

+

Returns this

diff --git a/docs/api/interfaces/addons_formUrl.FormUrlAddon.html b/docs/api/interfaces/addons_formUrl.FormUrlAddon.html index 183b5d6..1e7d878 100644 --- a/docs/api/interfaces/addons_formUrl.FormUrlAddon.html +++ b/docs/api/interfaces/addons_formUrl.FormUrlAddon.html @@ -1,4 +1,4 @@ -FormUrlAddon | wretch

Interface FormUrlAddon

interface FormUrlAddon {
    formUrl<T, C, R>(this: T & Wretch<T, C, R>, input: string | object): this;
}

Methods

formUrl +FormUrlAddon | wretch

Interface FormUrlAddon

interface FormUrlAddon {
    formUrl<T, C, R>(this: T & Wretch<T, C, R>, input: string | object): this;
}

Methods

Methods

  • Converts the input parameter to an url encoded string and sets the content-type header and body. If the input argument is already a string, skips the conversion part.

    @@ -6,4 +6,4 @@

    Type Parameters

    Parameters

    • this: T & Wretch<T, C, R>
    • input: string | object

      An object to convert into an url encoded string or an already encoded string

      -

    Returns this

+

Returns this

diff --git a/docs/api/interfaces/addons_perfs.PerfsAddon.html b/docs/api/interfaces/addons_perfs.PerfsAddon.html index 0ada5a6..15fe1d5 100644 --- a/docs/api/interfaces/addons_perfs.PerfsAddon.html +++ b/docs/api/interfaces/addons_perfs.PerfsAddon.html @@ -1,4 +1,4 @@ -PerfsAddon | wretch

Interface PerfsAddon

interface PerfsAddon {
    perfs: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb?: PerfCallback) => this);
}

Properties

perfs +PerfsAddon | wretch

Interface PerfsAddon

interface PerfsAddon {
    perfs: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb?: PerfCallback) => this);
}

Properties

Properties

perfs: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb?: PerfCallback) => this)

Performs a callback on the API performance timings of the request.

Warning: Still experimental on browsers and node.js

-
+
diff --git a/docs/api/interfaces/addons_progress.ProgressResolver.html b/docs/api/interfaces/addons_progress.ProgressResolver.html index 88aac77..ad4100d 100644 --- a/docs/api/interfaces/addons_progress.ProgressResolver.html +++ b/docs/api/interfaces/addons_progress.ProgressResolver.html @@ -1,4 +1,4 @@ -ProgressResolver | wretch

Interface ProgressResolver

interface ProgressResolver {
    progress: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, onProgress: ((loaded: number, total: number) => void)) => this);
}

Properties

progress +ProgressResolver | wretch

Interface ProgressResolver

interface ProgressResolver {
    progress: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, onProgress: ((loaded: number, total: number) => void)) => this);
}

Properties

Properties

progress: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, onProgress: ((loaded: number, total: number) => void)) => this)

Provides a way to register a callback to be invoked one or multiple times during the download. The callback receives the current progress as two arguments, the number of bytes loaded and the total number of bytes to load.

Under the hood: this method adds a middleware to the chain that will intercept the response and replace the body with a new one that will emit the progress event.

@@ -6,4 +6,4 @@

Type declaration

    • <T, C, R>(this, onProgress): this
    • Type Parameters

      Parameters

      • this: C & WretchResponseChain<T, C, R>
      • onProgress: ((loaded: number, total: number) => void)

        A callback that will be called one or multiple times with the number of bytes loaded and the total number of bytes to load.

        -
          • (loaded, total): void
          • Parameters

            • loaded: number
            • total: number

            Returns void

      Returns this

+
    • (loaded, total): void
    • Parameters

      • loaded: number
      • total: number

      Returns void

Returns this

diff --git a/docs/api/interfaces/addons_queryString.QueryStringAddon.html b/docs/api/interfaces/addons_queryString.QueryStringAddon.html index de07561..17d0ff8 100644 --- a/docs/api/interfaces/addons_queryString.QueryStringAddon.html +++ b/docs/api/interfaces/addons_queryString.QueryStringAddon.html @@ -1,4 +1,4 @@ -QueryStringAddon | wretch
interface QueryStringAddon {
    query<T, C, R>(this: T & Wretch<T, C, R>, qp: string | object, replace?: boolean, omitUndefinedOrNullValues?: boolean): this;
}

Methods

query +QueryStringAddon | wretch
interface QueryStringAddon {
    query<T, C, R>(this: T & Wretch<T, C, R>, qp: string | object, replace?: boolean, omitUndefinedOrNullValues?: boolean): this;
}

Methods

Methods

  • Converts a javascript object to query parameters, then appends this query string to the current url. String values are used as the query string verbatim.

    Pass true as the second argument to replace existing query parameters. @@ -12,4 +12,4 @@

    Type Parameters

    Parameters

    • this: T & Wretch<T, C, R>
    • qp: string | object

      An object which will be converted, or a string which will be used verbatim.

      -
    • Optionalreplace: boolean
    • OptionalomitUndefinedOrNullValues: boolean

    Returns this

+
  • Optionalreplace: boolean
  • OptionalomitUndefinedOrNullValues: boolean
  • Returns this

    diff --git a/docs/api/interfaces/index.Wretch.html b/docs/api/interfaces/index.Wretch.html index 5e7f4c8..e70c1d5 100644 --- a/docs/api/interfaces/index.Wretch.html +++ b/docs/api/interfaces/index.Wretch.html @@ -3,7 +3,7 @@

    Immutability : almost every method of this class return a fresh Wretch object.

    -
    interface Wretch<Self, Chain, Resolver> {
        accept(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        addon<W, R>(addon: WretchAddon<W, R>): W & Self & Wretch<Self & W, Chain & R, Resolver>;
        auth(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        body(this: Self & Wretch<Self, Chain, Resolver>, contents: any): this;
        catcher(this: Self & Wretch<Self, Chain, Resolver>, errorId: string | number | symbol, catcher: ((error: WretchError, originalRequest: this) => any)): this;
        catcherFallback(this: Self & Wretch<Self, Chain, Resolver>, catcher: ((error: WretchError, originalRequest: this) => any)): this;
        content(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        defer<Clear>(this: Self & Wretch<Self, Chain, Resolver>, callback: WretchDeferredCallback<Self, Chain, Resolver>, clear?: Clear): this;
        delete(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        errorType(this: Self & Wretch<Self, Chain, Resolver>, method: ErrorType): this;
        fetch(this: Self & Wretch<Self, Chain, Resolver>, method?: string, url?: string, body?: any): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        get(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        head(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        headers(this: Self & Wretch<Self, Chain, Resolver>, headerValues: HeadersInit): this;
        json(this: Self & Wretch<Self, Chain, Resolver>, jsObject: object, contentType?: string): this;
        middlewares(this: Self & Wretch<Self, Chain, Resolver>, middlewares: ConfiguredMiddleware[], clear?: boolean): this;
        options(this: Self & Wretch<Self, Chain, Resolver>, options: WretchOptions, replace?: boolean): this;
        opts(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        patch(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        polyfills(this: Self & Wretch<Self, Chain, Resolver>, polyfills: object, replace?: boolean): this;
        post(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        put(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        resolve<ResolverReturn, Clear>(this: Self & Wretch<Self, Chain, Resolver>, resolver: ((chain: Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, undefined>
            : Clear extends true
                ? Chain & WretchResponseChain<Self, Chain, undefined>
                : Resolver, originalRequest: Self & Wretch<Self, Chain, Clear extends true
            ? undefined
            : Resolver>) => ResolverReturn), clear?: Clear): Self & Wretch<Self, Chain, ResolverReturn>;
        url(this: Self & Wretch<Self, Chain, Resolver>, url: string, replace?: boolean): this;
    }

    Type Parameters

    Body Types

    interface Wretch<Self, Chain, Resolver> {
        accept(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        addon<W, R>(addon: WretchAddon<W, R>): W & Self & Wretch<Self & W, Chain & R, Resolver>;
        auth(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        body(this: Self & Wretch<Self, Chain, Resolver>, contents: any): this;
        catcher(this: Self & Wretch<Self, Chain, Resolver>, errorId: string | number | symbol, catcher: ((error: WretchError, originalRequest: this) => any)): this;
        catcherFallback(this: Self & Wretch<Self, Chain, Resolver>, catcher: ((error: WretchError, originalRequest: this) => any)): this;
        content(this: Self & Wretch<Self, Chain, Resolver>, headerValue: string): this;
        defer<Clear>(this: Self & Wretch<Self, Chain, Resolver>, callback: WretchDeferredCallback<Self, Chain, Resolver>, clear?: Clear): this;
        delete(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        errorType(this: Self & Wretch<Self, Chain, Resolver>, method: ErrorType): this;
        fetch(this: Self & Wretch<Self, Chain, Resolver>, method?: string, url?: string, body?: any): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        get(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        head(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        headers(this: Self & Wretch<Self, Chain, Resolver>, headerValues: HeadersInit): this;
        json(this: Self & Wretch<Self, Chain, Resolver>, jsObject: object, contentType?: string): this;
        middlewares(this: Self & Wretch<Self, Chain, Resolver>, middlewares: ConfiguredMiddleware[], clear?: boolean): this;
        options(this: Self & Wretch<Self, Chain, Resolver>, options: WretchOptions, replace?: boolean): this;
        opts(this: Self & Wretch<Self, Chain, Resolver>, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        patch(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        polyfills(this: Self & Wretch<Self, Chain, Resolver>, polyfills: object, replace?: boolean): this;
        post(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        put(this: Self & Wretch<Self, Chain, Resolver>, body?: any, url?: string): Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
            : Resolver;
        resolve<ResolverReturn, Clear>(this: Self & Wretch<Self, Chain, Resolver>, resolver: ((chain: Resolver extends undefined
            ? Chain & WretchResponseChain<Self, Chain, undefined>
            : Clear extends true
                ? Chain & WretchResponseChain<Self, Chain, undefined>
                : Resolver, originalRequest: Self & Wretch<Self, Chain, Clear extends true
            ? undefined
            : Resolver>) => ResolverReturn), clear?: Clear): Self & Wretch<Self, Chain, ResolverReturn>;
        url(this: Self & Wretch<Self, Chain, Resolver>, url: string, replace?: boolean): this;
    }

    Type Parameters

    • Self = unknown
    • Chain = unknown
    • Resolver = undefined

    Body Types

    HTTP

    delete fetch @@ -32,17 +32,17 @@

    Parameters

    Returns this

    • Sets the "Content-Type" header, stringifies an object and sets the request body.

      +

    Returns this

    • Sets the "Content-Type" header, stringifies an object and sets the request body.

      const jsonObject = { a: 1, b: 2, c: 3 };
      wretch("...").json(jsonObject).post();
      // Note that calling an 'http verb' method with an object argument is equivalent:
      wretch("...").post(jsonObject);

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • jsObject: object

        An object which will be serialized into a JSON

      • OptionalcontentType: string

        A custom content type.

        -

      Returns this

    HTTP

    Returns this

    HTTP

    • Sends the request using the accumulated fetch options.

      Can be used to replay requests.

      const reAuthOn401 = wretch()
      .catcher(401, async (error, request) => {
      // Renew credentials
      const token = await wretch("/renewtoken").get().text();
      storeToken(token);
      // Replay the original request with new credentials
      return request.auth(token).fetch().unauthorized((err) => {
      throw err;
      }).json();
      });

      reAuthOn401
      .get("/resource")
      .json() // <- Will only be called for the original promise
      .then(callback); // <- Will be called for the original OR the replayed promise result
      @@ -50,46 +50,46 @@

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • Optionalmethod: string

        The HTTP method to use

      • Optionalurl: string

        Some url to append

      • Optionalbody: any

        Set the body. Behaviour varies depending on the argument type, an object is considered as json.

        -

      Returns Resolver extends undefined
          ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
          : Resolver

    Returns Resolver extends undefined
        ? Chain & WretchResponseChain<Self, Chain, Resolver<Resolver>>
        : Resolver

    Helpers

    Helpers

    • Shortcut to set the "Accept" header.

      wretch("...").accept("application/json");
       

      Parameters

      Returns this

    Returns this

    • Register an Addon to enhance the wretch or response objects.

      import FormDataAddon from "wretch/addons/formData"
      import QueryStringAddon from "wretch/addons/queryString"

      // Add both addons
      const w = wretch().addon(FormDataAddon).addon(QueryStringAddon)

      // Additional features are now available
      w.formData({ hello: "world" }).query({ check: true })

      Type Parameters

      • W
      • R

      Parameters

      Returns W & Self & Wretch<Self & W, Chain & R, Resolver>

    • Shortcut to set the "Authorization" header.

      +

    Returns W & Self & Wretch<Self & W, Chain & R, Resolver>

    • Shortcut to set the "Authorization" header.

      wretch("...").auth("Basic d3JldGNoOnJvY2tz");
       

      Parameters

      Returns this

    • Adds a catcher which will be +

    Returns this

    • Adds a catcher which will be called on every subsequent request error.

      Very useful when you need to perform a repetitive action on a specific error code.

      @@ -103,40 +103,40 @@

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • errorId: string | number | symbol

        Error code or name

      • catcher: ((error: WretchError, originalRequest: this) => any)

        The catcher method

        -
          • (error, originalRequest): any
          • Parameters

            Returns any

      Returns this

    • A fallback catcher that will be called for any error thrown - if uncaught by other means.

      +
        • (error, originalRequest): any
        • Parameters

          Returns any

    Returns this

    • A fallback catcher that will be called for any error thrown - if uncaught by other means.

      wretch(url)
      .catcher(404, err => redirect("/routes/notfound", err.message))
      .catcher(500, err => flashMessage("internal.server.error"))
      // this fallback will trigger for any error except the ones caught above (404 and 505)
      .catcherFallback(err => {
      log("Uncaught error:", err)
      throw err
      })

      Parameters

      Returns this

      Wretch.catcher for more details.

      -
    • Shortcut to set the "Content-Type" header.

      +
    • Shortcut to set the "Content-Type" header.

      wretch("...").content("application/json");
       

      Parameters

      Returns this

    • Defer one or multiple request chain methods that will get called just before the request is sent.

      +

    Returns this

    • Defer one or multiple request chain methods that will get called just before the request is sent.

      // Small fictional example: deferred authentication

      // If you cannot retrieve the auth token while configuring the wretch object you can use .defer to postpone the call
      const api = wretch("http://some-domain.com").defer((w, url, options) => {
      // If we are hitting the route /user…
      if (//user/.test(url)) {
      const { token } = options.context;
      return w.auth(token);
      }
      return w;
      });

      // ... //

      const token = await getToken(request.session.user);

      // .auth gets called here automatically
      api.options({
      context: { token },
      }).get("/user/1").res();

      Type Parameters

      • Clear extends boolean = false

      Parameters

      Returns this

    • Sets the method (text, json ...) used to parse the data contained in the +

    Returns this

    • Sets the method (text, json ...) used to parse the data contained in the response body in case of an HTTP error is returned.

      Note: if the response Content-Type header is set to "application/json", the body will be parsed as json regardless of the errorType.

      wretch("http://server/which/returns/an/error/with/a/json/body")
      .errorType("json")
      .get()
      .res()
      .catch(error => {
      // error[errorType] (here, json) contains the parsed body
      console.log(error.json)
      })

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • method: ErrorType

        The method to call on the Fetch response to read the body and use it as the Error message

        -

      Returns this

    • Sets the request headers.

      +

    Returns this

    • Sets the request headers.

      wretch("...")
      .headers({ "Content-Type": "text/plain", Accept: "application/json" })
      .post("my text")
      .json();

      Parameters

      Returns this

    • Add middlewares to intercept a request before being sent.

      +

    Returns this

    • Add middlewares to intercept a request before being sent.

      // A simple delay middleware.
      const delayMiddleware = delay => next => (url, opts) => {
      return new Promise(res => setTimeout(() => res(next(url, opts)), delay))
      }

      // The request will be delayed by 1 second.
      wretch("...").middlewares([
      delayMiddleware(1000)
      ]).get().res()
      -

      Parameters

      Returns this

    • Sets the fetch options.

      wretch("...").options({ credentials: "same-origin" });
       
      @@ -151,24 +151,24 @@

      Parameters

      Returns this

    • Sets non-global polyfills - for instance in browserless environments.

      +

    Returns this

    • Sets non-global polyfills - for instance in browserless environments.

      Needed for libraries like fetch-ponyfill.

      const fetch = require("node-fetch");
      const FormData = require("form-data");

      wretch("http://domain.com")
      .polyfills({
      fetch: fetch,
      FormData: FormData,
      URLSearchParams: require("url").URLSearchParams,
      })
      .get()

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • polyfills: object

        An object containing the polyfills

      • Optionalreplace: boolean

        If true, replaces the current polyfills instead of mixing in

        -

      Returns this

    Returns this

    Returns Self & Wretch<Self, Chain, ResolverReturn>

    • Appends or replaces the url.

      wretch("/root").url("/sub").get().json();

      // Can be used to set a base url

      // Subsequent requests made using the 'blogs' object will be prefixed with "http://domain.com/api/blogs"
      const blogs = wretch("http://domain.com/api/blogs");

      // Perfect for CRUD apis
      const id = await blogs.post({ name: "my blog" }).json(blog => blog.id);
      const blog = await blogs.get(`/${id}`).json();
      console.log(blog.name);

      await blogs.url(`/${id}`).delete().res();

      // And to replace the base url if needed :
      const noMoreBlogs = blogs.url("http://domain2.com/", true);

      Parameters

      • this: Self & Wretch<Self, Chain, Resolver>
      • url: string

        Url segment

      • Optionalreplace: boolean

        If true, replaces the current url instead of appending

        -

      Returns this

    +

    Returns this

    diff --git a/docs/api/interfaces/index.WretchError.html b/docs/api/interfaces/index.WretchError.html index cdac1ed..f6db8d3 100644 --- a/docs/api/interfaces/index.WretchError.html +++ b/docs/api/interfaces/index.WretchError.html @@ -1,5 +1,5 @@ WretchError | wretch

    Interface WretchError

    An Error enhanced with status, text and body.

    -
    interface WretchError {
        json?: any;
        message: string;
        name: string;
        response: WretchResponse;
        stack?: string;
        status: number;
        text?: string;
        url: string;
    }

    Hierarchy

    • Error
      • WretchError

    Properties

    interface WretchError {
        json?: any;
        message: string;
        name: string;
        response: WretchResponse;
        stack?: string;
        status: number;
        text?: string;
        url: string;
    }

    Hierarchy

    • Error
      • WretchError

    Properties

    Properties

    json?: any
    message: string
    name: string
    response: WretchResponse
    stack?: string
    status: number
    text?: string
    url: string
    +

    Properties

    json?: any
    message: string
    name: string
    response: WretchResponse
    stack?: string
    status: number
    text?: string
    url: string
    diff --git a/docs/api/interfaces/index.WretchResponseChain.html b/docs/api/interfaces/index.WretchResponseChain.html index 300f8cf..8e9712d 100644 --- a/docs/api/interfaces/index.WretchResponseChain.html +++ b/docs/api/interfaces/index.WretchResponseChain.html @@ -1,6 +1,6 @@ WretchResponseChain | wretch

    Interface WretchResponseChain<T, Self, R>

    The resolver interface to chaining catchers and extra methods after the request has been sent. Ultimately returns a Promise.

    -
    interface WretchResponseChain<T, Self, R> {
        arrayBuffer: (<Result>(cb?: ((type: ArrayBuffer) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        badRequest: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        blob: (<Result>(cb?: ((type: Blob) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        error: ((this: Self & WretchResponseChain<T, Self, R>, code: string | number | symbol, cb: WretchErrorCallback<T, Self, R>) => this);
        fetchError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        forbidden: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        formData: (<Result>(cb?: ((type: FormData) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        internalError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        json: (<Result>(cb?: ((type: any) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        notFound: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        res: (<Result>(cb?: ((type: WretchResponse) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        text: (<Result>(cb?: ((type: string) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        timeout: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        unauthorized: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
    }

    Type Parameters

    • T
    • Self = unknown
    • R = undefined

    Catchers

    interface WretchResponseChain<T, Self, R> {
        arrayBuffer: (<Result>(cb?: ((type: ArrayBuffer) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        badRequest: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        blob: (<Result>(cb?: ((type: Blob) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        error: ((this: Self & WretchResponseChain<T, Self, R>, code: string | number | symbol, cb: WretchErrorCallback<T, Self, R>) => this);
        fetchError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        forbidden: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        formData: (<Result>(cb?: ((type: FormData) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        internalError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        json: (<Result>(cb?: ((type: any) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        notFound: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        res: (<Result>(cb?: ((type: WretchResponse) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        text: (<Result>(cb?: ((type: string) => Result | Promise<Result>)) => Promise<Awaited<Result>>);
        timeout: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
        unauthorized: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this);
    }

    Type Parameters

    • T
    • Self = unknown
    • R = undefined

    Catchers

    badRequest error fetchError forbidden @@ -17,52 +17,52 @@

    Catchers

    badRequest: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a bad request (http code 400) and performs a callback.

    Syntactic sugar for error(400, cb).

    error: ((this: Self & WretchResponseChain<T, Self, R>, code: string | number | symbol, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an http response with a specific error code or name and performs a callback.

    +
    error: ((this: Self & WretchResponseChain<T, Self, R>, code: string | number | symbol, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an http response with a specific error code or name and performs a callback.

    The original request is passed along the error and can be used in order to perform an additional request.

    wretch("/resource")
    .get()
    .unauthorized(async (error, req) => {
    // Renew credentials
    const token = await wretch("/renewtoken").get().text();
    storeToken(token);
    // Replay the original request with new credentials
    return req.auth(token).get().unauthorized((err) => {
    throw err;
    }).json();
    })
    .json()
    // The promise chain is preserved as expected
    // ".then" will be performed on the result of the original request
    // or the replayed one (if a 401 error was thrown)
    .then(callback);
    -
    fetchError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches any error thrown by the fetch function and perform the callback.

    +
    fetchError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches any error thrown by the fetch function and perform the callback.

    forbidden: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a forbidden request (http code 403) and performs a callback.

    +
    forbidden: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a forbidden request (http code 403) and performs a callback.

    Syntactic sugar for error(403, cb).

    internalError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an internal server error (http code 500) and performs a callback.

    +
    internalError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an internal server error (http code 500) and performs a callback.

    Syntactic sugar for error(500, cb).

    notFound: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a "not found" request (http code 404) and performs a callback.

    +
    notFound: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a "not found" request (http code 404) and performs a callback.

    Syntactic sugar for error(404, cb).

    timeout: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a timeout (http code 408) and performs a callback.

    +
    timeout: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches a timeout (http code 408) and performs a callback.

    Syntactic sugar for error(408, cb).

    unauthorized: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an unauthorized request (http code 401) and performs a callback.

    +
    unauthorized: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => this)

    Catches an unauthorized request (http code 401) and performs a callback.

    Syntactic sugar for error(401, cb).

    Response Type

    arrayBuffer: (<Result>(cb?: ((type: ArrayBuffer) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as an ArrayBuffer object.

    +

    Response Type

    arrayBuffer: (<Result>(cb?: ((type: ArrayBuffer) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as an ArrayBuffer object.

    wretch("...").get().arrayBuffer(arrayBuffer => …)
     
    -
    blob: (<Result>(cb?: ((type: Blob) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as a Blob.

    +
    blob: (<Result>(cb?: ((type: Blob) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as a Blob.

    wretch("...").get().blob(blob => …)
     
    -
    formData: (<Result>(cb?: ((type: FormData) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as a FormData object.

    +
    formData: (<Result>(cb?: ((type: FormData) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as a FormData object.

    wretch("...").get().formData(formData => …)
     
    -
    json: (<Result>(cb?: ((type: any) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as JSON.

    +
    json: (<Result>(cb?: ((type: any) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Read the payload and deserialize it as JSON.

    wretch("...").get().json((json) => console.log(Object.keys(json)));
     
    -
    res: (<Result>(cb?: ((type: WretchResponse) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    The handler for the raw fetch Response. +

    res: (<Result>(cb?: ((type: WretchResponse) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    The handler for the raw fetch Response. Check the MDN documentation for more details on the Response class.

    wretch("...").get().res((response) => console.log(response.url));
     
    -
    text: (<Result>(cb?: ((type: string) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Retrieves the payload as a string.

    +
    text: (<Result>(cb?: ((type: string) => Result | Promise<Result>)) => Promise<Awaited<Result>>)

    Retrieves the payload as a string.

    wretch("...").get().text((txt) => console.log(txt));
     
    -
    +
    diff --git a/docs/api/modules/addons.html b/docs/api/modules/addons.html index 8a71da1..235f0d1 100644 --- a/docs/api/modules/addons.html +++ b/docs/api/modules/addons.html @@ -1,4 +1,4 @@ -addons | wretch

    Module addons

    References

    AbortResolver +addons | wretch

    Module addons

    References

    AbortResolver AbortWretch BasicAuthAddon FormDataAddon diff --git a/docs/api/modules/addons_abort.html b/docs/api/modules/addons_abort.html index 3e3732c..1fbae69 100644 --- a/docs/api/modules/addons_abort.html +++ b/docs/api/modules/addons_abort.html @@ -1,4 +1,4 @@ -addons/abort | wretch

    Module addons/abort

    Index

    Interfaces

    AbortResolver +addons/abort | wretch

    Module addons/abort

    Index

    Interfaces

    Functions

    diff --git a/docs/api/modules/addons_basicAuth.html b/docs/api/modules/addons_basicAuth.html index 234c5f9..ea3d694 100644 --- a/docs/api/modules/addons_basicAuth.html +++ b/docs/api/modules/addons_basicAuth.html @@ -1,3 +1,3 @@ -addons/basicAuth | wretch

    Module addons/basicAuth

    Index

    Interfaces

    BasicAuthAddon +addons/basicAuth | wretch

    Module addons/basicAuth

    Index

    Interfaces

    Variables

    diff --git a/docs/api/modules/addons_formData.html b/docs/api/modules/addons_formData.html index 542450f..4cc0975 100644 --- a/docs/api/modules/addons_formData.html +++ b/docs/api/modules/addons_formData.html @@ -1,3 +1,3 @@ -addons/formData | wretch

    Module addons/formData

    Index

    Interfaces

    FormDataAddon +addons/formData | wretch

    Module addons/formData

    Index

    Interfaces

    Variables

    diff --git a/docs/api/modules/addons_formUrl.html b/docs/api/modules/addons_formUrl.html index 7b1530a..1d9ba18 100644 --- a/docs/api/modules/addons_formUrl.html +++ b/docs/api/modules/addons_formUrl.html @@ -1,3 +1,3 @@ -addons/formUrl | wretch

    Module addons/formUrl

    Index

    Interfaces

    FormUrlAddon +addons/formUrl | wretch

    Module addons/formUrl

    Index

    Interfaces

    Variables

    diff --git a/docs/api/modules/addons_perfs.html b/docs/api/modules/addons_perfs.html index df5e3b5..4910293 100644 --- a/docs/api/modules/addons_perfs.html +++ b/docs/api/modules/addons_perfs.html @@ -1,4 +1,4 @@ -addons/perfs | wretch

    Module addons/perfs

    Index

    Interfaces

    PerfsAddon +addons/perfs | wretch

    Module addons/perfs

    Index

    Interfaces

    Type Aliases

    Functions

    diff --git a/docs/api/modules/addons_progress.html b/docs/api/modules/addons_progress.html index 65403fa..2961d42 100644 --- a/docs/api/modules/addons_progress.html +++ b/docs/api/modules/addons_progress.html @@ -1,3 +1,3 @@ -addons/progress | wretch

    Module addons/progress

    Index

    Interfaces

    ProgressResolver +addons/progress | wretch

    Module addons/progress

    Index

    Interfaces

    Functions

    diff --git a/docs/api/modules/addons_queryString.html b/docs/api/modules/addons_queryString.html index fc80a52..c82b76b 100644 --- a/docs/api/modules/addons_queryString.html +++ b/docs/api/modules/addons_queryString.html @@ -1,3 +1,3 @@ -addons/queryString | wretch

    Module addons/queryString

    Index

    Interfaces

    QueryStringAddon +addons/queryString | wretch

    Module addons/queryString

    Index

    Interfaces

    Variables

    diff --git a/docs/api/modules/index.html b/docs/api/modules/index.html index 4530cdf..65802dd 100644 --- a/docs/api/modules/index.html +++ b/docs/api/modules/index.html @@ -1,4 +1,4 @@ -index | wretch

    Module index

    Index

    Interfaces

    Wretch +index | wretch

    Module index

    Index

    Interfaces

    Type Aliases

    Config diff --git a/docs/api/modules/middlewares.html b/docs/api/modules/middlewares.html index 8ab6b64..65e9548 100644 --- a/docs/api/modules/middlewares.html +++ b/docs/api/modules/middlewares.html @@ -1,4 +1,4 @@ -middlewares | wretch

    Module middlewares

    References

    DedupeKeyFunction +middlewares | wretch

    Module middlewares

    References

    DedupeKeyFunction DedupeMiddleware DedupeOptions DedupeResolverFunction diff --git a/docs/api/modules/middlewares_dedupe.html b/docs/api/modules/middlewares_dedupe.html index 1f74606..b883b2d 100644 --- a/docs/api/modules/middlewares_dedupe.html +++ b/docs/api/modules/middlewares_dedupe.html @@ -1,4 +1,4 @@ -middlewares/dedupe | wretch

    Module middlewares/dedupe

    Index

    Type Aliases

    DedupeKeyFunction +middlewares/dedupe | wretch

    Module middlewares/dedupe

    Index

    Type Aliases

    DedupeKeyFunction DedupeMiddleware DedupeOptions DedupeResolverFunction diff --git a/docs/api/modules/middlewares_delay.html b/docs/api/modules/middlewares_delay.html index 190e239..5173a4d 100644 --- a/docs/api/modules/middlewares_delay.html +++ b/docs/api/modules/middlewares_delay.html @@ -1,3 +1,3 @@ -middlewares/delay | wretch

    Module middlewares/delay

    Index

    Type Aliases

    DelayMiddleware +middlewares/delay | wretch

    Module middlewares/delay

    Index

    Type Aliases

    Functions

    diff --git a/docs/api/modules/middlewares_retry.html b/docs/api/modules/middlewares_retry.html index fa23811..70f53b7 100644 --- a/docs/api/modules/middlewares_retry.html +++ b/docs/api/modules/middlewares_retry.html @@ -1,4 +1,4 @@ -middlewares/retry | wretch

    Module middlewares/retry

    Index

    Type Aliases

    DelayRampFunction +middlewares/retry | wretch

    Module middlewares/retry

    Index

    Type Aliases

    DelayRampFunction OnRetryFunction OnRetryFunctionResponse RetryMiddleware diff --git a/docs/api/modules/middlewares_throttlingCache.html b/docs/api/modules/middlewares_throttlingCache.html index f0b6971..56f0f74 100644 --- a/docs/api/modules/middlewares_throttlingCache.html +++ b/docs/api/modules/middlewares_throttlingCache.html @@ -1,4 +1,4 @@ -middlewares/throttlingCache | wretch

    Module middlewares/throttlingCache

    Index

    Type Aliases

    ThrottlingCacheClearFunction +middlewares/throttlingCache | wretch

    Module middlewares/throttlingCache

    Index

    Type Aliases

    ThrottlingCacheClearFunction ThrottlingCacheConditionFunction ThrottlingCacheInvalidateFunction ThrottlingCacheKeyFunction diff --git a/docs/api/types/addons_perfs.PerfCallback.html b/docs/api/types/addons_perfs.PerfCallback.html index ced7811..f81bd19 100644 --- a/docs/api/types/addons_perfs.PerfCallback.html +++ b/docs/api/types/addons_perfs.PerfCallback.html @@ -1 +1 @@ -PerfCallback | wretch

    Type Alias PerfCallback

    PerfCallback: ((timing: any) => void)
    +PerfCallback | wretch

    Type Alias PerfCallback

    PerfCallback: ((timing: any) => void)
    diff --git a/docs/api/types/index.Config.html b/docs/api/types/index.Config.html index 768e343..9682e3e 100644 --- a/docs/api/types/index.Config.html +++ b/docs/api/types/index.Config.html @@ -1,2 +1,2 @@ Config | wretch

    Type Alias Config

    Config: {
        errorType: ErrorType;
        options: object;
        polyfills: object;
        polyfill(p: "fetch", doThrow?: boolean): {
            (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
            (input: RequestInfo, init?: RequestInit): Promise<Response>;
        };
        polyfill(p: "FormData", doThrow: boolean, instance: true, ...args: [form?: HTMLFormElement, submitter?: HTMLElement]): FormData;
        polyfill(p: "FormData", doThrow?: boolean, instance?: false): {
            prototype: FormData;
            new (form?: HTMLFormElement, submitter?: HTMLElement): FormData;
        };
        polyfill(p: "URL", doThrow: boolean, instance: true, ...args: [url: string | URL, base?: string | URL]): URL;
        polyfill(p: "URL", doThrow?: boolean, instance?: false): {
            prototype: URL;
            canParse(url: string | URL, base?: string): boolean;
            createObjectURL(obj: Blob | MediaSource): string;
            revokeObjectURL(url: string): void;
            new (url: string | URL, base?: string | URL): URL;
        };
        polyfill(p: "URLSearchParams", doThrow: boolean, instance: true, ...args: [init?:
            | string
            | Record<string, string>
            | URLSearchParams
            | string[][]]): URLSearchParams;
        polyfill(p: "URLSearchParams", doThrow?: boolean, instance?: false): {
            prototype: URLSearchParams;
            new (init?:
                | string
                | Record<string, string>
                | URLSearchParams
                | string[][]): URLSearchParams;
        };
        polyfill(p: "AbortController", doThrow: boolean, instance: true, ...args: []): AbortController;
        polyfill(p: "AbortController", doThrow?: boolean, instance?: false): {
            prototype: AbortController;
            new (): AbortController;
        };
        polyfill(p: "performance", doThrow: boolean): Performance;
        polyfill(p: string, doThrow?: boolean, instance?: boolean, ...args: any[]): any;
    }

    Configuration object.

    -
    +
    diff --git a/docs/api/types/index.ConfiguredMiddleware.html b/docs/api/types/index.ConfiguredMiddleware.html index cffbaf2..7c23d44 100644 --- a/docs/api/types/index.ConfiguredMiddleware.html +++ b/docs/api/types/index.ConfiguredMiddleware.html @@ -1,4 +1,4 @@ ConfiguredMiddleware | wretch

    Type Alias ConfiguredMiddleware

    ConfiguredMiddleware: ((next: FetchLike) => FetchLike)

    A ready to use middleware which is called before the request is sent. Input is the next middleware in the chain, then url and options. Output is a promise.

    -
    +
    diff --git a/docs/api/types/index.FetchLike.html b/docs/api/types/index.FetchLike.html index d81a924..0264f96 100644 --- a/docs/api/types/index.FetchLike.html +++ b/docs/api/types/index.FetchLike.html @@ -1,2 +1,2 @@ FetchLike | wretch

    Type Alias FetchLike

    FetchLike: ((url: string, opts: WretchOptions) => Promise<WretchResponse>)

    Any function having the same shape as fetch().

    -
    +
    diff --git a/docs/api/types/index.Middleware.html b/docs/api/types/index.Middleware.html index 8944acf..d7bd575 100644 --- a/docs/api/types/index.Middleware.html +++ b/docs/api/types/index.Middleware.html @@ -1,3 +1,3 @@ Middleware | wretch

    Type Alias Middleware

    Middleware: ((options?: {
        [key: string]: any;
    }) => ConfiguredMiddleware)

    Shape of a typical middleware. Expects options and returns a ConfiguredMiddleware that can then be registered using the .middlewares function.

    -
    +
    diff --git a/docs/api/types/index.WretchAddon.html b/docs/api/types/index.WretchAddon.html index efa2599..7deb449 100644 --- a/docs/api/types/index.WretchAddon.html +++ b/docs/api/types/index.WretchAddon.html @@ -1,2 +1,2 @@ WretchAddon | wretch

    Type Alias WretchAddon<W, R>

    WretchAddon<W, R>: {
        resolver?: R | (<T, C>(_: C & WretchResponseChain<T, C, R>) => R);
        wretch?: W;
        beforeRequest?<T, C, R>(wretch: T & Wretch<T, C, R>, options: WretchOptions, state: Record<any, any>): T & Wretch<T, C, R>;
    }

    An addon enhancing either the request or response chain (or both).

    -

    Type Parameters

    • W
    • R = unknown
    +

    Type Parameters

    • W
    • R = unknown
    diff --git a/docs/api/types/index.WretchDeferredCallback.html b/docs/api/types/index.WretchDeferredCallback.html index ec5d72e..0bdeae5 100644 --- a/docs/api/types/index.WretchDeferredCallback.html +++ b/docs/api/types/index.WretchDeferredCallback.html @@ -1,2 +1,2 @@ WretchDeferredCallback | wretch

    Type Alias WretchDeferredCallback<T, C, R>

    WretchDeferredCallback<T, C, R>: ((wretch: T & Wretch<T, C, R>, url: string, options: WretchOptions) => Wretch<T, C, any>)

    Callback provided to the defer function allowing to chain deferred actions that will be stored and applied just before the request is sent.

    -

    Type Parameters

    • T
    • C
    • R
    +

    Type Parameters

    • T
    • C
    • R
    diff --git a/docs/api/types/index.WretchErrorCallback.html b/docs/api/types/index.WretchErrorCallback.html index 6ae4caf..1ab8c9d 100644 --- a/docs/api/types/index.WretchErrorCallback.html +++ b/docs/api/types/index.WretchErrorCallback.html @@ -1,2 +1,2 @@ WretchErrorCallback | wretch

    Type Alias WretchErrorCallback<T, C, R>

    WretchErrorCallback<T, C, R>: ((error: WretchError, originalRequest: T & Wretch<T, C, R>) => any)

    Callback provided to catchers on error. Contains the original wretch instance used to perform the request.

    -

    Type Parameters

    • T
    • C
    • R
    +

    Type Parameters

    • T
    • C
    • R
    diff --git a/docs/api/types/index.WretchOptions.html b/docs/api/types/index.WretchOptions.html index 0373991..93a2d4f 100644 --- a/docs/api/types/index.WretchOptions.html +++ b/docs/api/types/index.WretchOptions.html @@ -1,2 +1,2 @@ WretchOptions | wretch

    Type Alias WretchOptions

    WretchOptions: Record<string, any>

    Fetch Request options with additional properties.

    -
    +
    diff --git a/docs/api/types/index.WretchResponse.html b/docs/api/types/index.WretchResponse.html index 221155c..2ee17e3 100644 --- a/docs/api/types/index.WretchResponse.html +++ b/docs/api/types/index.WretchResponse.html @@ -1,2 +1,2 @@ WretchResponse | wretch

    Type Alias WretchResponse

    WretchResponse: Response & {
        [key: string]: any;
    }

    Fetch Response object with additional properties.

    -
    +
    diff --git a/docs/api/types/middlewares_dedupe.DedupeKeyFunction.html b/docs/api/types/middlewares_dedupe.DedupeKeyFunction.html index 85b532b..f3d919a 100644 --- a/docs/api/types/middlewares_dedupe.DedupeKeyFunction.html +++ b/docs/api/types/middlewares_dedupe.DedupeKeyFunction.html @@ -1 +1 @@ -DedupeKeyFunction | wretch

    Type Alias DedupeKeyFunction

    DedupeKeyFunction: ((url: string, opts: WretchOptions) => string)
    +DedupeKeyFunction | wretch

    Type Alias DedupeKeyFunction

    DedupeKeyFunction: ((url: string, opts: WretchOptions) => string)
    diff --git a/docs/api/types/middlewares_dedupe.DedupeMiddleware.html b/docs/api/types/middlewares_dedupe.DedupeMiddleware.html index d0be443..2bf7685 100644 --- a/docs/api/types/middlewares_dedupe.DedupeMiddleware.html +++ b/docs/api/types/middlewares_dedupe.DedupeMiddleware.html @@ -18,4 +18,4 @@

    This function is called when resolving the fetch response from duplicate calls. By default it clones the response to allow reading the body from multiple sources.

    -
    +
    diff --git a/docs/api/types/middlewares_dedupe.DedupeOptions.html b/docs/api/types/middlewares_dedupe.DedupeOptions.html index 154ccb7..966a952 100644 --- a/docs/api/types/middlewares_dedupe.DedupeOptions.html +++ b/docs/api/types/middlewares_dedupe.DedupeOptions.html @@ -1 +1 @@ -DedupeOptions | wretch
    DedupeOptions: {
        key?: DedupeKeyFunction;
        resolver?: DedupeResolverFunction;
        skip?: DedupeSkipFunction;
    }
    +DedupeOptions | wretch
    DedupeOptions: {
        key?: DedupeKeyFunction;
        resolver?: DedupeResolverFunction;
        skip?: DedupeSkipFunction;
    }
    diff --git a/docs/api/types/middlewares_dedupe.DedupeResolverFunction.html b/docs/api/types/middlewares_dedupe.DedupeResolverFunction.html index 7cd7ae3..76d1ea7 100644 --- a/docs/api/types/middlewares_dedupe.DedupeResolverFunction.html +++ b/docs/api/types/middlewares_dedupe.DedupeResolverFunction.html @@ -1 +1 @@ -DedupeResolverFunction | wretch

    Type Alias DedupeResolverFunction

    DedupeResolverFunction: ((response: Response) => Response)
    +DedupeResolverFunction | wretch

    Type Alias DedupeResolverFunction

    DedupeResolverFunction: ((response: Response) => Response)
    diff --git a/docs/api/types/middlewares_dedupe.DedupeSkipFunction.html b/docs/api/types/middlewares_dedupe.DedupeSkipFunction.html index 7c69523..d6d2bce 100644 --- a/docs/api/types/middlewares_dedupe.DedupeSkipFunction.html +++ b/docs/api/types/middlewares_dedupe.DedupeSkipFunction.html @@ -1 +1 @@ -DedupeSkipFunction | wretch

    Type Alias DedupeSkipFunction

    DedupeSkipFunction: ((url: string, opts: WretchOptions) => boolean)
    +DedupeSkipFunction | wretch

    Type Alias DedupeSkipFunction

    DedupeSkipFunction: ((url: string, opts: WretchOptions) => boolean)
    diff --git a/docs/api/types/middlewares_delay.DelayMiddleware.html b/docs/api/types/middlewares_delay.DelayMiddleware.html index 714e02c..0ef4ea0 100644 --- a/docs/api/types/middlewares_delay.DelayMiddleware.html +++ b/docs/api/types/middlewares_delay.DelayMiddleware.html @@ -5,4 +5,4 @@

    The request will be delayed by that amount of time.

    -
    +
    diff --git a/docs/api/types/middlewares_retry.DelayRampFunction.html b/docs/api/types/middlewares_retry.DelayRampFunction.html index 2af66e9..21cce9e 100644 --- a/docs/api/types/middlewares_retry.DelayRampFunction.html +++ b/docs/api/types/middlewares_retry.DelayRampFunction.html @@ -1 +1 @@ -DelayRampFunction | wretch

    Type Alias DelayRampFunction

    DelayRampFunction: ((delay: number, nbOfAttempts: number) => number)
    +DelayRampFunction | wretch

    Type Alias DelayRampFunction

    DelayRampFunction: ((delay: number, nbOfAttempts: number) => number)
    diff --git a/docs/api/types/middlewares_retry.OnRetryFunction.html b/docs/api/types/middlewares_retry.OnRetryFunction.html index 37df826..f3fe568 100644 --- a/docs/api/types/middlewares_retry.OnRetryFunction.html +++ b/docs/api/types/middlewares_retry.OnRetryFunction.html @@ -1 +1 @@ -OnRetryFunction | wretch

    Type Alias OnRetryFunction

    OnRetryFunction: ((args: {
        error?: Error;
        options: WretchOptions;
        response?: Response;
        url: string;
    }) => void | OnRetryFunctionResponse | Promise<OnRetryFunctionResponse>)
    +OnRetryFunction | wretch

    Type Alias OnRetryFunction

    OnRetryFunction: ((args: {
        error?: Error;
        options: WretchOptions;
        response?: Response;
        url: string;
    }) => void | OnRetryFunctionResponse | Promise<OnRetryFunctionResponse>)
    diff --git a/docs/api/types/middlewares_retry.OnRetryFunctionResponse.html b/docs/api/types/middlewares_retry.OnRetryFunctionResponse.html index b77bfba..d8fc955 100644 --- a/docs/api/types/middlewares_retry.OnRetryFunctionResponse.html +++ b/docs/api/types/middlewares_retry.OnRetryFunctionResponse.html @@ -1 +1 @@ -OnRetryFunctionResponse | wretch

    Type Alias OnRetryFunctionResponse

    OnRetryFunctionResponse: {
        options?: WretchOptions;
        url?: string;
    } | undefined
    +OnRetryFunctionResponse | wretch

    Type Alias OnRetryFunctionResponse

    OnRetryFunctionResponse: {
        options?: WretchOptions;
        url?: string;
    } | undefined
    diff --git a/docs/api/types/middlewares_retry.RetryMiddleware.html b/docs/api/types/middlewares_retry.RetryMiddleware.html index abe4f69..95433e9 100644 --- a/docs/api/types/middlewares_retry.RetryMiddleware.html +++ b/docs/api/types/middlewares_retry.RetryMiddleware.html @@ -7,4 +7,4 @@
    import wretch from 'wretch'
    import { retry } from 'wretch/middlewares'

    wretch().middlewares([
    retry({
    // Options - defaults below
    delayTimer: 500,
    delayRamp: (delay, nbOfAttempts) => delay * nbOfAttempts,
    maxAttempts: 10,
    until: (response, error) => response && response.ok,
    onRetry: null,
    retryOnNetworkError: false,
    resolveWithLatestResponse: false,
    skip: undefined
    })
    ])

    // You can also return a Promise, which is useful if you want to inspect the body:
    wretch().middlewares([
    retry({
    until: response =>
    response.clone().json().then(body =>
    body.field === 'something'
    )
    })
    ])
    -
    +
    diff --git a/docs/api/types/middlewares_retry.RetryOptions.html b/docs/api/types/middlewares_retry.RetryOptions.html index 654c1d8..2098b79 100644 --- a/docs/api/types/middlewares_retry.RetryOptions.html +++ b/docs/api/types/middlewares_retry.RetryOptions.html @@ -18,4 +18,4 @@

    Default: undefined

  • Optionaluntil?: UntilFunction

    The request will be retried until that condition is satisfied.

    Default: response && response.ok

    -
  • +
    diff --git a/docs/api/types/middlewares_retry.SkipFunction.html b/docs/api/types/middlewares_retry.SkipFunction.html index 80e7cf0..9a9a28f 100644 --- a/docs/api/types/middlewares_retry.SkipFunction.html +++ b/docs/api/types/middlewares_retry.SkipFunction.html @@ -1 +1 @@ -SkipFunction | wretch
    SkipFunction: ((url: string, opts: WretchOptions) => boolean)
    +SkipFunction | wretch
    SkipFunction: ((url: string, opts: WretchOptions) => boolean)
    diff --git a/docs/api/types/middlewares_retry.UntilFunction.html b/docs/api/types/middlewares_retry.UntilFunction.html index 334ed33..c7243d1 100644 --- a/docs/api/types/middlewares_retry.UntilFunction.html +++ b/docs/api/types/middlewares_retry.UntilFunction.html @@ -1 +1 @@ -UntilFunction | wretch

    Type Alias UntilFunction

    UntilFunction: ((response?: Response, error?: Error) => boolean | Promise<boolean>)
    +UntilFunction | wretch

    Type Alias UntilFunction

    UntilFunction: ((response?: Response, error?: Error) => boolean | Promise<boolean>)
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheClearFunction.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheClearFunction.html index 5c757e5..940223d 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheClearFunction.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheClearFunction.html @@ -1 +1 @@ -ThrottlingCacheClearFunction | wretch
    ThrottlingCacheClearFunction: ((url: string, opts: WretchOptions) => boolean)
    +ThrottlingCacheClearFunction | wretch
    ThrottlingCacheClearFunction: ((url: string, opts: WretchOptions) => boolean)
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheConditionFunction.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheConditionFunction.html index ce755d5..ade9da1 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheConditionFunction.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheConditionFunction.html @@ -1 +1 @@ -ThrottlingCacheConditionFunction | wretch
    ThrottlingCacheConditionFunction: ((response: WretchOptions) => boolean)
    +ThrottlingCacheConditionFunction | wretch
    ThrottlingCacheConditionFunction: ((response: WretchOptions) => boolean)
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheInvalidateFunction.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheInvalidateFunction.html index a84e9e1..8a5b045 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheInvalidateFunction.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheInvalidateFunction.html @@ -1 +1 @@ -ThrottlingCacheInvalidateFunction | wretch

    Type Alias ThrottlingCacheInvalidateFunction

    ThrottlingCacheInvalidateFunction: ((url: string, opts: WretchOptions) => string | RegExp | void)
    +ThrottlingCacheInvalidateFunction | wretch

    Type Alias ThrottlingCacheInvalidateFunction

    ThrottlingCacheInvalidateFunction: ((url: string, opts: WretchOptions) => string | RegExp | void)
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheKeyFunction.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheKeyFunction.html index f91e9f4..f38492a 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheKeyFunction.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheKeyFunction.html @@ -1 +1 @@ -ThrottlingCacheKeyFunction | wretch
    ThrottlingCacheKeyFunction: ((url: string, opts: WretchOptions) => string)
    +ThrottlingCacheKeyFunction | wretch
    ThrottlingCacheKeyFunction: ((url: string, opts: WretchOptions) => string)
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheMiddleware.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheMiddleware.html index c5f5a94..7d9e6c1 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheMiddleware.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheMiddleware.html @@ -41,4 +41,4 @@

    If set, a Response returned from the cache whill be flagged with a property name equal to this option.

    -
    +
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheOptions.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheOptions.html index f6c2d7d..05b4ea1 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheOptions.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheOptions.html @@ -1 +1 @@ -ThrottlingCacheOptions | wretch
    ThrottlingCacheOptions: {
        clear?: ThrottlingCacheClearFunction;
        condition?: ThrottlingCacheConditionFunction;
        flagResponseOnCacheHit?: string;
        invalidate?: ThrottlingCacheInvalidateFunction;
        key?: ThrottlingCacheKeyFunction;
        skip?: ThrottlingCacheSkipFunction;
        throttle?: number;
    }
    +ThrottlingCacheOptions | wretch
    ThrottlingCacheOptions: {
        clear?: ThrottlingCacheClearFunction;
        condition?: ThrottlingCacheConditionFunction;
        flagResponseOnCacheHit?: string;
        invalidate?: ThrottlingCacheInvalidateFunction;
        key?: ThrottlingCacheKeyFunction;
        skip?: ThrottlingCacheSkipFunction;
        throttle?: number;
    }
    diff --git a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheSkipFunction.html b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheSkipFunction.html index 67b4770..be9d94d 100644 --- a/docs/api/types/middlewares_throttlingCache.ThrottlingCacheSkipFunction.html +++ b/docs/api/types/middlewares_throttlingCache.ThrottlingCacheSkipFunction.html @@ -1 +1 @@ -ThrottlingCacheSkipFunction | wretch
    ThrottlingCacheSkipFunction: ((url: string, opts: WretchOptions) => boolean)
    +ThrottlingCacheSkipFunction | wretch
    ThrottlingCacheSkipFunction: ((url: string, opts: WretchOptions) => boolean)
    diff --git a/docs/api/variables/addons_basicAuth.default.html b/docs/api/variables/addons_basicAuth.default.html index e450d2b..39e7c9b 100644 --- a/docs/api/variables/addons_basicAuth.default.html +++ b/docs/api/variables/addons_basicAuth.default.html @@ -2,4 +2,4 @@
    import BasicAuthAddon from "wretch/addons/basicAuth"

    wretch().addon(BasicAuthAddon)
    -
    +
    diff --git a/docs/api/variables/addons_formData.default.html b/docs/api/variables/addons_formData.default.html index 4180335..86d2bd1 100644 --- a/docs/api/variables/addons_formData.default.html +++ b/docs/api/variables/addons_formData.default.html @@ -2,4 +2,4 @@
    import FormDataAddon from "wretch/addons/formData"

    wretch().addon(FormDataAddon)
    -
    +
    diff --git a/docs/api/variables/addons_formUrl.default.html b/docs/api/variables/addons_formUrl.default.html index 5fe4c58..ab642b8 100644 --- a/docs/api/variables/addons_formUrl.default.html +++ b/docs/api/variables/addons_formUrl.default.html @@ -2,4 +2,4 @@
    import FormUrlAddon from "wretch/addons/formUrl"

    wretch().addon(FormUrlAddon)
    -
    +
    diff --git a/docs/api/variables/addons_queryString.default.html b/docs/api/variables/addons_queryString.default.html index 47a19f1..f152c6a 100644 --- a/docs/api/variables/addons_queryString.default.html +++ b/docs/api/variables/addons_queryString.default.html @@ -2,4 +2,4 @@
    import QueryAddon from "wretch/addons/queryString"

    wretch().addon(QueryAddon)
    -
    +
    diff --git a/package.json b/package.json index 2d04d84..8c5988f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wretch", - "version": "2.9.1", + "version": "2.10.0", "type": "module", "description": "A tiny wrapper built around fetch with an intuitive syntax.", "keywords": [