- export
RequestError
type
- add
state
toRequestConfig
to allow for custom state to be passed through the request middleware - add
EndpointBuilder.stateOf
- fix support for cloudflare workers
- add
credentials
option - deprecated
RequestContext.computedConfig
in favor ofRequestContext.requestConfig
- fix non-array buffer and non-json responses having their data as
Promise
- update error messages to be more helpful
- add
updateMethod
,updatePath
&updateBaseUrl
toRequestContext
to enhance middleware capabilities - hide internal
computedPath
fromRequestContext
, replaced withpath
- allow params to be inferred from the path
- zod validation
- upper case methods
- change default retry logic to always retry unless you pass
shouldRetry
predicate - add
minDelay
andmaxDelay
to retry logic
- add request backend at
Api
level too
- Breaking: if no response type given, use inferred
- deprecate
queryParser
(it's actually a stringifier) and replace withqueryHandling.stringify
- allow
query
to be an arbitrary string
- expose type for
Endpoint
- fix
fetch
detection in node
- bad response type inferring
- don't pass body to GET requests
- parse body for
application/x-www-form-urlencoded
- add
request
info to errors
- axios will enforce
ResponseType
- add
ResponseOf
,QueryOf
,BodyOf
,ParamsOf
to quickly get types from endpoints - new
queryParser
config option to allow custom query string parsing - better errors
- automatically lowercase header names
PATCH
method
- absolute paths as
baseUrl
is now supported in fetch backend - don't re-use same requests based upon URL to allow for concurrent
POST
requests
- Undocumented mocking API has been overhauled
- Add mocking!
- Restructured mocking so that mocks are defined on the endpoint level (documentation updated)
- Add
acceptableStatus
to specify which status codes are considered successful - Extend retry logic to use exponential back-off, rather than retrying immediately
- Support for additional hot-request methods:
- PUT, DELETE
- fix fetch backend not working with unbound fetch
- add better error handling on parse
- Move config values from options object up one layer
- In config
retries
->retry
defaults
->config
- Remove need for enum imports
- Make
name
anddescription
optional in endpoint definition
- Make fetch backend default if fetch is present
- Fix fetch backends text response type support
- allow defaults to be a function on api
- add content type header in fetch backend to match axios backend
- remove
flatted
- polyfill object.assign for ie
- change retry logic so that if a middleware event responds with Retry we always attempt a retry
- Remove
window
usages to allow node support