Skip to content

Latest commit

 

History

History
84 lines (40 loc) · 4.95 KB

CHANGELOG.md

File metadata and controls

84 lines (40 loc) · 4.95 KB

2.0.0 (2024-10-20)

⚠ BREAKING CHANGES

  • Change the first parameter of ResponseError to expect a RetrieveResponse object instead of a Response object. How to update: Replace new ResponseError(response, ...) with new ResponseError({ response, data: null }, ...).

Features

  • add data to ResponseError (bdddbdc)

    Add a new data property to ResponseErrors holding the same deserialized value as the data property on RetrieveResponse objects. If an exception occurs during deserialization, the value will be null.

    BREAKING CHANGE: Change the first parameter of ResponseError to expect a RetrieveResponse object instead of a Response object. How to update: Replace new ResponseError(response, ...) with new ResponseError({ response, data: null }, ...).

1.2.1 (2023-12-05)

Bug Fixes

  • crash on window access in node environments (bf014f3)

    Fix retrieve not working in Node environments caused by accessing window without first checking if it exists.

1.2.0 (2023-11-25)

Features

  • relax response error handler types (5095993)

    Relaxes the types of response error handlers. The first argument of a response error handler is now typed as Error instead of ResponseError. Only the type changes. The value is unchanged: the object will still be a ResponseError unless a previous response error handler changes it. Similarly, the return value for maintained errors now expects a value of type Error instead of requiring ResponseError. This makes it easier to use response error handler because you can now return custom error formats without angering the TypeScript compiler.

Bug Fixes

  • only processing the first response success handler (f4a1e06)

    Fixes an issue with response success handlers where only the first handler was processed.

  • processing more response error handlers after one corrected an error (7567bc5)

    Fixes an issue with the processing of response error handlers where if a handler corrected the error state, retrieve would continue processing the remaining handlers. This was unintentional and neither matched the behavior of request error handlers nor the documentation for response error handlers.

  • processing response success handlers in error case (92567fb)

    Fixes an issue with response success handlers where handlers were executed even if the network response had an error status code.

1.1.1 (2023-11-18)

Bug Fixes

  • overriding x-requested-with header (f9d32d4)

    Fixes setting the x-requested-with header when config.init.headers already has a value for that header field.

1.1.0 (2023-07-16)

Features

  • changes default response error message (20ef3eb)

    Changes the default response error message from 'Unknown response error' to $statusCode $statusText (e.g. '404 Not Found').

Bug Fixes

  • ignoring config.init.body (514b3e6)

    Fixes an issue where config.init.body would always be ignored regardless of config.data being set. Now, if config.data is not set and config.init.body is set, config.init.body will be used as the request body as-is.

  • not passing config.init to fetch (4139f4f)

    Fixes a bug causing config.init not to be passed as the init parameter to fetch.

  • using JSON content-type for POST requests with FormData body (5ae55df)

    Fixes POST requests with config.data being set to a FormData object being sent with a content type 'application/json'. Instead, such requests now will be sent with no content type as the browser will set it automatically.

1.0.0 (2023-06-20)

Features