Skip to content

Releases: feffef/typesafe-hypermedia

v0.1.0 — Initial Release

16 Apr 18:23

Choose a tag to compare

Initial public release of typesafe-hypermedia — a type-safe client for HATEOAS APIs with minimal dependencies.

Added

  • Type-safe navigation for HATEOAS APIs with phantom types.
  • defineLinks for compile-time and runtime validation of the link graph, including SchemaResolver support for Type.Ref(...) dereferencing.
  • linkTo, navigate, navigateAll public API.
    • Single-link auto-resolve mode and named-link mode.
    • navigateAll for parallel resolution of single-link navigables.
  • URI template expansion (RFC 6570) via @hyperjump/uri-template, plus the public expandUriTemplate utility for BFF servers building typed URLs.
  • Typed error handling:
    • Optional expect on links producing Promise<[Resource, null] | [null, Failure]>.
    • Failure discriminated union over declared error resources plus sub-discriminated 'unexpected' variants (uriExpansion, network, unmappedStatus, invalidJson, invalidStructure).
    • ResponseInfo carrying status, statusText, headers, and optional body.
  • errorVerbosity option ('verbose' default, 'safe' for BFF/gateway contexts) controlling URL and header disclosure in error messages.
  • FetchFactory<Api> / FetchContext<Api> for full user control of HTTP behavior (methods, auth, headers, bodies).
  • Support for both link-property and link-object styles (GitHub/JSON-LD and HAL/Siren/JSON:API).

Install

npm install typesafe-hypermedia

See the README for usage and the Developer Guide for patterns.