Skip to content

Releases: arucard21/SimplyRESTful-client-ts

Improve stability and reliability

27 May 11:10
Compare
Choose a tag to compare

The client now explicitly asks for the plain JSON representation of the API service document. This should make the client more stable and predictable in the presence of other representations, like a HAL+JSON representation or a newer version of the service document in the future.

Support streaming API resources as server-sent events

23 May 13:01
Compare
Choose a tag to compare

This release adds support for receiving API resources as server-sent events. This can be used as an alternative to paging when you want to get all API resources.

This works by having the API set up a one-directional connection to the client, then sending each API resource (in JSON format) over that connection. Once all API resources are sent, an event marking the end of the collection is sent and the connection is closed.

This functionality requires the API to use at least version 1.1.0 of SimplyRESTful and to have the stream() functionality implemented. It is also strongly recommended to use HTTP/2 due to limitations with the amount of connections that can be made in earlier versions of HTTP.

Use plain JSON media type

14 Jan 09:27
Compare
Choose a tag to compare

This release switches no longer uses HAL+JSON as media type to represent the API resources when accessing the API. Support for HAL+JSON was dropped in SimplyRESTful version 1.0.0. Instead, this TypeScript client now uses plain JSON by detecting the custom media type for the API resources.

This is a breaking change since HALResource and HALCollectionV2 were renamed to APIResource and APICollection. Instead of HALLink from the hal-types library, this now uses a custom Link object. These objects are also defined as interface instead of type now. Since type and interface are practically interchangeable, this release only provides the flexibility to choose which one you prefer instead of requiring an intersection type as it did before.

Migrating to this release mainly requires changing the names to their updated versions. Optionally, you can change your own API resource from an intersection type that intersects with HALResource to an interface that extends APIResource.

Fix for custom errors

06 Jan 14:59
Compare
Choose a tag to compare

This is a quick fix for the new custom errors in the TypeScript client. These errors were not exported so they could not be used yet, which would be necessary for checking their type. With this release, the errors are now correctly exported.

Custom errors for TS client

06 Jan 14:59
Compare
Choose a tag to compare

The TypeScript client now throws custom errors that correspond to the HTTP status code when an error occurs. This provides more details about the actual nature of the error that occurred which should allow for better error handling. The custom errors contains a cause field that contains more information about exactly why that type of error might have occurred. These custom errors were modeled after their Java Exception counterparts provided in JAX-RS.

Fix for relative URI usage (re-release)

06 Jan 14:59
Compare
Choose a tag to compare

When using relative URIs with the TypeScript client, the query parameters were not included when the actual request was made. This is now fixed and all query parameters are correctly included.

This was supposed to be released as v0.18.4 (or v0.18.5) but an outdated build was accidentally used. So this is the correct release for this fix.

Skipped release

06 Jan 14:58
Compare
Choose a tag to compare

This was an unsuccessful attempt to correctly publish v0.18.4. Use v0.18.6 instead.

Support for relative URIs

06 Jan 14:58
Compare
Choose a tag to compare

The TypeScript client now supports using relative URIs to access the API. As this is passed to the Fetch API, the exact behavior when resolving the relative URI is determined by the Fetch API.

Additionally, the parameters for the list() method now use a destructured object so you can easily pass only 1 or 2 parameters to the method.

Fix for relative URI usage

06 Jan 14:58
Compare
Choose a tag to compare

Note: This was incorrectly published, use v0.18.6 (or later) instead.

When using relative URIs with the TypeScript client, the query parameters were not included when the actual request was made. This is now fixed and all query parameters are correctly included.

Updated dependencies

06 Jan 14:56
Compare
Choose a tag to compare

The dependencies used by the TypeScript client have been updated.