From bda300c16100e4598135750c141a1a0537f39e3c Mon Sep 17 00:00:00 2001 From: Julien Elbaz Date: Tue, 11 Apr 2023 08:35:39 +0200 Subject: [PATCH] 2.5.2 tag --- CHANGELOG.md | 15 +++++ 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-1.html | 2 +- .../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_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 | 56 +++++++++---------- docs/api/interfaces/index.WretchError.html | 12 ++-- .../interfaces/index.WretchResponseChain.html | 30 +++++----- docs/api/modules/addons.html | 2 +- docs/api/modules/addons_abort.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.default.html | 12 ++-- 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/index.Config.html | 4 +- .../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 | 4 +- .../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_formData.default.html | 2 +- .../api/variables/addons_formUrl.default.html | 2 +- .../variables/addons_queryString.default.html | 2 +- .../variables/index.default.WretchError.html | 2 +- docs/api/variables/index.default.default.html | 2 +- .../variables/index.default.errorType.html | 2 +- docs/api/variables/index.default.options.html | 2 +- .../variables/index.default.polyfills.html | 2 +- package.json | 2 +- 71 files changed, 147 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71c440..af0a960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ + +## [2.5.2](https://github.com/elbywan/wretch/compare/2.5.1...2.5.2) (2023-04-11) + + +### :bug: Bug fix(es) + +* Fix catcher and resolve callback argument type. ([76c295f](https://github.com/elbywan/wretch/commit/76c295f)), closes [#177](https://github.com/elbywan/wretch/issues/177) + +### :memo: Documentation update(s) + +* Node.js 18 section wording ([b696b1c](https://github.com/elbywan/wretch/commit/b696b1c)) +* Warn to use a custom until function to avoid retrying on 4xx error ([1812c73](https://github.com/elbywan/wretch/commit/1812c73)), closes [#176](https://github.com/elbywan/wretch/issues/176) + + + ## [2.5.1](https://github.com/elbywan/wretch/compare/2.5.0...2.5.1) (2023-02-27) diff --git a/docs/api/functions/addons_abort.default.html b/docs/api/functions/addons_abort.default.html index 793224a..95efe6d 100644 --- a/docs/api/functions/addons_abort.default.html +++ b/docs/api/functions/addons_abort.default.html @@ -30,7 +30,7 @@

Function default

Returns WretchAddon<AbortWretch, AbortResolver>

+
  • Defined in src/addons/abort.ts:110
  • Returns WretchAddon<unknown, PerfsAddon>

    +
  • Defined in src/addons/perfs.ts:58
  • Returns WretchAddon<unknown, ProgressResolver>

    +
  • Defined in src/addons/progress.ts:45
  • +
  • Defined in src/index.ts:36
  • +
  • Defined in src/middlewares/dedupe.ts:33
  • +
  • Defined in src/middlewares/delay.ts:16
  • +
  • Defined in src/middlewares/retry.ts:119
  • +
  • Defined in src/middlewares/throttlingCache.ts:56
  • +
  • Defined in src/addons/abort.ts:68
  • onAbort: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, cb: WretchErrorCallback<T, C, R>) => AbortResolver)
    @@ -96,7 +96,7 @@
    this: Ccb: WretchErrorCallback<T, C, R>

    Returns AbortResolver

    +
  • Defined in src/addons/abort.ts:72
  • setTimeout: (<T, C, R>(this: C & WretchResponseChain<T, C, R>, time: number, controller?: AbortController) => AbortResolver)
    @@ -136,7 +136,7 @@
    Optional controller:

    Returns AbortResolver

    +
  • Defined in src/addons/abort.ts:50
  • Returns AbortWretch

    +
  • Defined in src/addons/abort.ts:31
  • +
  • Defined in src/addons/formData.ts:80
  • Returns PerfsAddon

    +
  • Defined in src/addons/perfs.ts:9
  • Returns ProgressResolver

    +
  • Defined in src/addons/progress.ts:23
  • +
  • Defined in src/addons/queryString.ts:87
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:397
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:413
  • HTTP Methods

    @@ -142,7 +142,7 @@
    this: SelfOptional url: string

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

    +
  • Defined in src/types.ts:470
  • +
  • Defined in src/types.ts:444
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:457
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:522
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:535
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:509
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:496
  • Returns Resolver extends undefined ? Chain & WretchResponseChain<Self, Chain, Resolver> : Resolver

    +
  • Defined in src/types.ts:483
  • Helpers Methods

    @@ -315,7 +315,7 @@
    headerValue: string

    Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:209
  • Returns W & Self & Wretch<Self & W, Chain & R, Resolver>

    +
  • Defined in src/types.ts:64
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:233
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:284
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:221
  • +
  • Defined in src/types.ts:316
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:86
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:197
  • Returns Wretch<Self, Chain, Resolver>

    +
  • Defined in src/types.ts:383
  • +
  • Defined in src/types.ts:182
  • +
  • Defined in src/types.ts:110
  • Optional clear: Clear
  • Returns Self & Wretch<Self, Chain, ResolverReturn>

    +
  • Defined in src/types.ts:352
  • +
  • Defined in src/types.ts:138
  • +
  • Defined in src/types.ts:659
  • error: ((this: Self & WretchResponseChain<T, Self, R>, code: string | number | symbol, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -114,7 +114,7 @@
    code: stringWretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:650
  • fetchError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -138,7 +138,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:713
  • forbidden: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -163,7 +163,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:677
  • internalError: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -188,7 +188,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:706
  • notFound: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -213,7 +213,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:686
  • timeout: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -238,7 +238,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:696
  • unauthorized: ((this: Self & WretchResponseChain<T, Self, R>, cb: WretchErrorCallback<T, Self, R>) => WretchResponseChain<T, Self, R>)
    @@ -263,7 +263,7 @@
    this: Selfcb: WretchErrorCallback<T, Self, R>

    Returns WretchResponseChain<T, Self, R>

    +
  • Defined in src/types.ts:668
  • Response Type Properties

    @@ -303,7 +303,7 @@
    type: ArrayBuffer
    Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:611
  • blob: (<Result>(cb?: ((type: Blob) => Result | Promise<Result>)) => Promise<Awaited<Result>>)
    @@ -341,7 +341,7 @@
    type: Blob

    Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:591
  • formData: (<Result>(cb?: ((type: FormData) => Result | Promise<Result>)) => Promise<Awaited<Result>>)
    @@ -379,7 +379,7 @@
    type: FormData

    Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:601
  • json: (<Result>(cb?: ((type: any) => Result | Promise<Result>)) => Promise<Awaited<Result>>)
    @@ -417,7 +417,7 @@
    type: any

    Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:581
  • res: (<Result>(cb?: ((type: WretchResponse) => Result | Promise<Result>)) => Promise<Awaited<Result>>)
    @@ -456,7 +456,7 @@
    type: Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:571
  • text: (<Result>(cb?: ((type: string) => Result | Promise<Result>)) => Promise<Awaited<Result>>)
    @@ -494,7 +494,7 @@
    type: string

    Returns Result | Promise<Result>

    Returns Promise<Awaited<Result>>

    +
  • Defined in src/types.ts:621
  • +
  • Defined in src/addons/abort.ts:1
  • diff --git a/docs/api/modules/addons_formData.html b/docs/api/modules/addons_formData.html index d85cbb6..a65f05e 100644 --- a/docs/api/modules/addons_formData.html +++ b/docs/api/modules/addons_formData.html @@ -16,7 +16,7 @@
  • addons/formData
  • Module addons/formData

    +
  • Defined in src/addons/formData.ts:1
  • diff --git a/docs/api/modules/addons_formUrl.html b/docs/api/modules/addons_formUrl.html index b4dc162..8ad9ec1 100644 --- a/docs/api/modules/addons_formUrl.html +++ b/docs/api/modules/addons_formUrl.html @@ -16,7 +16,7 @@
  • addons/formUrl
  • Module addons/formUrl

    +
  • Defined in src/addons/formUrl.ts:1
  • diff --git a/docs/api/modules/addons_perfs.html b/docs/api/modules/addons_perfs.html index 34b94bc..e512f35 100644 --- a/docs/api/modules/addons_perfs.html +++ b/docs/api/modules/addons_perfs.html @@ -16,7 +16,7 @@
  • addons/perfs
  • Module addons/perfs

    +
  • Defined in src/addons/perfs.ts:1
  • diff --git a/docs/api/modules/addons_progress.html b/docs/api/modules/addons_progress.html index 0cf1fee..7ecd8a4 100644 --- a/docs/api/modules/addons_progress.html +++ b/docs/api/modules/addons_progress.html @@ -16,7 +16,7 @@
  • addons/progress
  • Module addons/progress

    +
  • Defined in src/addons/progress.ts:1
  • diff --git a/docs/api/modules/addons_queryString.html b/docs/api/modules/addons_queryString.html index 72ae125..cc864db 100644 --- a/docs/api/modules/addons_queryString.html +++ b/docs/api/modules/addons_queryString.html @@ -16,7 +16,7 @@
  • addons/queryString
  • Module addons/queryString

    +
  • Defined in src/addons/queryString.ts:1
  • diff --git a/docs/api/modules/index.default.html b/docs/api/modules/index.default.html index e3fde23..0915a3e 100644 --- a/docs/api/modules/index.default.html +++ b/docs/api/modules/index.default.html @@ -17,12 +17,12 @@
  • default
  • Namespace default

    +
  • Defined in src/index.ts:36
  • +
  • Defined in src/index.ts:40
  • +
  • Defined in src/index.ts:42
  • +
  • Defined in src/index.ts:44
  • +
  • Defined in src/index.ts:46
  • +
  • Defined in src/index.ts:47
  • Index

    diff --git a/docs/api/modules/index.html b/docs/api/modules/index.html index bfa2d3a..93f1288 100644 --- a/docs/api/modules/index.html +++ b/docs/api/modules/index.html @@ -16,7 +16,7 @@
  • index
  • Module index

    +
  • Defined in src/index.ts:1
  • diff --git a/docs/api/modules/middlewares.html b/docs/api/modules/middlewares.html index 6bdbaec..5a8171e 100644 --- a/docs/api/modules/middlewares.html +++ b/docs/api/modules/middlewares.html @@ -16,7 +16,7 @@
  • middlewares
  • Module middlewares

    +
  • Defined in src/middlewares/index.ts:1
  • diff --git a/docs/api/modules/middlewares_dedupe.html b/docs/api/modules/middlewares_dedupe.html index 5433c9a..7f20452 100644 --- a/docs/api/modules/middlewares_dedupe.html +++ b/docs/api/modules/middlewares_dedupe.html @@ -16,7 +16,7 @@
  • middlewares/dedupe
  • Module middlewares/dedupe

    +
  • Defined in src/middlewares/dedupe.ts:1
  • diff --git a/docs/api/modules/middlewares_delay.html b/docs/api/modules/middlewares_delay.html index 72b9641..45be85c 100644 --- a/docs/api/modules/middlewares_delay.html +++ b/docs/api/modules/middlewares_delay.html @@ -16,7 +16,7 @@
  • middlewares/delay
  • Module middlewares/delay

    +
  • Defined in src/middlewares/delay.ts:1
  • diff --git a/docs/api/modules/middlewares_retry.html b/docs/api/modules/middlewares_retry.html index bd73c13..206c522 100644 --- a/docs/api/modules/middlewares_retry.html +++ b/docs/api/modules/middlewares_retry.html @@ -16,7 +16,7 @@
  • middlewares/retry
  • Module middlewares/retry

    +
  • Defined in src/middlewares/retry.ts:1
  • diff --git a/docs/api/modules/middlewares_throttlingCache.html b/docs/api/modules/middlewares_throttlingCache.html index 6107d87..044a520 100644 --- a/docs/api/modules/middlewares_throttlingCache.html +++ b/docs/api/modules/middlewares_throttlingCache.html @@ -16,7 +16,7 @@
  • middlewares/throttlingCache
  • Module middlewares/throttlingCache

    +
  • Defined in src/middlewares/throttlingCache.ts:1
  • diff --git a/docs/api/types/index.Config.html b/docs/api/types/index.Config.html index 59a40dc..31a628b 100644 --- a/docs/api/types/index.Config.html +++ b/docs/api/types/index.Config.html @@ -48,9 +48,9 @@
    Optional instance: Rest ...args: any[]

    Returns any

    +
  • Defined in src/types.ts:719
  • +
  • Defined in src/types.ts:757
  • +
  • Defined in src/types.ts:761
  • +
  • Defined in src/types.ts:751
  • +
  • Defined in src/types.ts:766
  • +
  • Defined in src/types.ts:745
  • +
  • Defined in src/types.ts:737
  • +
  • Defined in src/types.ts:729
  • +
  • Defined in src/types.ts:741
  • +
  • Defined in src/middlewares/dedupe.ts:6
  • +
  • Defined in src/middlewares/dedupe.ts:33
  • +
  • Defined in src/middlewares/dedupe.ts:8
  • +
  • Defined in src/middlewares/dedupe.ts:7
  • +
  • Defined in src/middlewares/dedupe.ts:5
  • +
  • Defined in src/middlewares/delay.ts:16
  • +
  • Defined in src/middlewares/retry.ts:5
  • +
  • Defined in src/middlewares/retry.ts:13
  • +
  • Defined in src/middlewares/retry.ts:10
  • +
  • Defined in src/middlewares/retry.ts:119
  • +
  • Defined in src/middlewares/retry.ts:19
  • +
  • Defined in src/middlewares/retry.ts:6
  • +
  • Defined in src/middlewares/throttlingCache.ts:7
  • +
  • Defined in src/middlewares/throttlingCache.ts:9
  • +
  • Defined in src/middlewares/throttlingCache.ts:8
  • +
  • Defined in src/middlewares/throttlingCache.ts:6
  • +
  • Defined in src/middlewares/throttlingCache.ts:56
  • +
  • Defined in src/middlewares/throttlingCache.ts:10
  • +
  • Defined in src/middlewares/throttlingCache.ts:5
  • +
  • Defined in src/addons/formData.ts:92
  • +
  • Defined in src/addons/formUrl.ts:53
  • +
  • Defined in src/addons/queryString.ts:99
  • +
  • Defined in src/index.ts:47
  • +
  • Defined in src/index.ts:40
  • +
  • Defined in src/index.ts:44
  • +
  • Defined in src/index.ts:42
  • +
  • Defined in src/index.ts:46