Skip to content

Commit

Permalink
📝 Regenerate api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Jul 31, 2024
1 parent b9f27a7 commit 79f95a6
Show file tree
Hide file tree
Showing 84 changed files with 1,020 additions and 642 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ _From this point on, wretch returns a standard Promise._

> 💡 The API documentation is now autogenerated and hosted separately, click the links access it.
### [Static Methods 🔗](https://elbywan.github.io/wretch/api/modules/index.default.html)
### [Static Methods 🔗](https://elbywan.github.io/wretch/api/functions/index.default)

These methods are available from the main default export and can be used to instantiate wretch and configure it globally.

Expand All @@ -374,7 +374,7 @@ wretch.options({ mode: "cors" })
let w = wretch("http://domain.com/", { cache: "default" })
```

### [Helper Methods 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch.html)
### [Helper Methods 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch#accept)

Helper Methods are used to configure the request and program actions.

Expand All @@ -385,15 +385,15 @@ w = w
.content("text/html")
```

### [Body Types 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch.html)
### [Body Types 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch#body)

Specify a body type if uploading data. Can also be added through the HTTP Method argument.

```js
w = w.body("<html><body><div/></body></html>")
```

### [HTTP Methods 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch.html)
### [HTTP Methods 🔗](https://elbywan.github.io/wretch/api/interfaces/index.Wretch#delete)

Sets the HTTP method and sends the request.

Expand All @@ -412,7 +412,7 @@ wretch().json({ json: "body" }).url("/url").post();
**NOTE:** if the body argument is an `Object` it is assumed that it is a JSON payload and it will have the same behaviour as calling `.json(body)` unless the `Content-Type` header has been set to something else beforehand.


### [Catchers 🔗](https://elbywan.github.io/wretch/api/interfaces/index.WretchResponseChain.html)
### [Catchers 🔗](https://elbywan.github.io/wretch/api/interfaces/index.WretchResponseChain#badRequest)

Catchers are optional, but if none are provided an error will still be thrown for http error codes and it will be up to you to catch it.

Expand Down Expand Up @@ -463,7 +463,7 @@ wretch("/resource")
.then(callback);
```

### [Response Types 🔗](https://elbywan.github.io/wretch/api/interfaces/index.WretchResponseChain.html)
### [Response Types 🔗](https://elbywan.github.io/wretch/api/interfaces/index.WretchResponseChain#arrayBuffer)

Setting the final response body type ends the chain and returns a regular promise.

Expand Down Expand Up @@ -502,7 +502,7 @@ Typescript should also be fully supported and will provide completions.

https://user-images.githubusercontent.com/3428394/182319457-504a0856-abdd-4c1d-bd04-df5a061e515d.mov

### [QueryString 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_queryString.QueryStringAddon.html)
### [QueryString 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_queryString.QueryStringAddon)

Used to construct and append the query string part of the URL from an object.

Expand All @@ -521,7 +521,7 @@ w = w.query({ reset: true }, true);
// url is now http://example.com?reset=true
```

### [FormData 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_formData.FormDataAddon.html)
### [FormData 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_formData.FormDataAddon)

Adds a helper method to serialize a `multipart/form-data` body from an object.

Expand All @@ -546,7 +546,7 @@ const form = {
wretch("...").addon(FormDataAddon).formData(form, ["ignored"]).post();
```

### [FormUrl 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_formUrl.FormUrlAddon.html)
### [FormUrl 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_formUrl.FormUrlAddon)

Adds a method to serialize a `application/x-www-form-urlencoded` body from an object.

Expand All @@ -561,7 +561,7 @@ wretch("...").addon(FormUrlAddon).formUrl(form).post();
wretch("...").addon(FormUrlAddon).formUrl(alreadyEncodedForm).post();
```

### [Abort 🔗](https://elbywan.github.io/wretch/api/modules/addons_abort.html)
### [Abort 🔗](https://elbywan.github.io/wretch/api/functions/addons_abort.default)

Adds the ability to abort requests and set timeouts using AbortController and signals under the hood.

Expand Down Expand Up @@ -607,7 +607,7 @@ wretch("...").addon(AbortAddon()).get().setTimeout(1000).json(_ =>
)
```

### [BasicAuth 🔗](https://elbywan.github.io/wretch/api/modules/addons_basicAuth.BasicAuthAddon.html)
### [BasicAuth 🔗](https://elbywan.github.io/wretch/api/modules/addons_basicAuth.BasicAuthAddon)

Adds the ability to set the `Authorization` header for the [basic authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#basic_authentication_scheme) without the need to manually encode the username/password.

Expand All @@ -626,7 +626,7 @@ wretch("...").addon(BasicAuthAddon).basicAuth(user, pass).get()
wretch(`https://${user}:${pass}@...`).addon(BasicAuthAddon).get()
```

### [Progress 🔗](https://elbywan.github.io/wretch/api/modules/addons_progress.html)
### [Progress 🔗](https://elbywan.github.io/wretch/api/interfaces/addons_progress.ProgressResolver)

Adds the ability to monitor progress when downloading a response.

Expand All @@ -646,7 +646,7 @@ wretch("some_url")
.text()
```

### [Performance 🔗](https://elbywan.github.io/wretch/api/modules/addons_perfs.html)
### [Performance 🔗](https://elbywan.github.io/wretch/api/functions/addons_perfs.default)

Adds the ability to measure requests using the Performance Timings API.

Expand All @@ -669,7 +669,7 @@ const w = wretch().middlewares([retry(), dedupe()])

> 💡 The following middlewares were previously provided by the [`wretch-middlewares`](https://github.com/elbywan/wretch-middlewares/) package.
### [Retry 🔗](https://elbywan.github.io/wretch/api/functions/middlewares_retry.retry.html)
### [Retry 🔗](https://elbywan.github.io/wretch/api/types/middlewares_retry.RetryMiddleware)

**Retries a request multiple times in case of an error (or until a custom condition is true).**

Expand Down Expand Up @@ -708,7 +708,7 @@ wretch().middlewares([
])
```
### [Dedupe 🔗](https://elbywan.github.io/wretch/api/functions/middlewares_dedupe.dedupe.html)
### [Dedupe 🔗](https://elbywan.github.io/wretch/api/types/middlewares_dedupe.DedupeMiddleware)

**Prevents having multiple identical requests on the fly at the same time.**

Expand All @@ -726,7 +726,7 @@ wretch().middlewares([
])./* ... */
```

### [Throttling Cache 🔗](https://elbywan.github.io/wretch/api/modules/middlewares_throttlingCache.html)
### [Throttling Cache 🔗](https://elbywan.github.io/wretch/api/types/middlewares_throttlingCache.ThrottlingCacheMiddleware)

**A throttling cache which stores and serves server responses for a certain amount of time.**

Expand All @@ -748,7 +748,7 @@ wretch().middlewares([
])./* ... */
```

### [Delay 🔗](https://elbywan.github.io/wretch/api/functions/middlewares_delay.delay.html)
### [Delay 🔗](https://elbywan.github.io/wretch/api/types/middlewares_delay.DelayMiddleware)

**Delays the request by a specific amount of time.**

Expand Down Expand Up @@ -1057,7 +1057,7 @@ wretch.formData({ hello: "world" }).query({ check: true })
## Typescript
Types have been renamed and refactored, please update your imports accordingly and refer to the [typescript api documentation](https://elbywan.github.io/wretch/api/modules/index.html).
Types have been renamed and refactored, please update your imports accordingly and refer to the [typescript api documentation](https://elbywan.github.io/wretch/api).
## API Changes
Expand Down Expand Up @@ -1094,7 +1094,7 @@ wretch("https://base.com").get("/resource/1")
### Replay function
The `.replay` function has been renamed to [`.fetch`](https://elbywan.github.io/wretch/api/interfaces/index.Wretch.html#fetch).
The `.replay` function has been renamed to [`.fetch`](https://elbywan.github.io/wretch/api/interfaces/index.Wretch#fetch).
# License
Expand Down
Loading

0 comments on commit 79f95a6

Please sign in to comment.