Releases: feffef/typesafe-hypermedia
Releases · feffef/typesafe-hypermedia
v0.1.0 — Initial Release
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.
defineLinksfor compile-time and runtime validation of the link graph, includingSchemaResolversupport forType.Ref(...)dereferencing.linkTo,navigate,navigateAllpublic API.- Single-link auto-resolve mode and named-link mode.
navigateAllfor parallel resolution of single-link navigables.
- URI template expansion (RFC 6570) via
@hyperjump/uri-template, plus the publicexpandUriTemplateutility for BFF servers building typed URLs. - Typed error handling:
- Optional
expecton links producingPromise<[Resource, null] | [null, Failure]>. Failurediscriminated union over declared error resources plus sub-discriminated'unexpected'variants (uriExpansion,network,unmappedStatus,invalidJson,invalidStructure).ResponseInfocarrying status, statusText, headers, and optional body.
- Optional
errorVerbosityoption ('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.