Releases: junglebarry/jsonapi-transformers
0.6.0: Improved types for top-level and pagination
Adds more explicit types for the TopLevel
, representing:
TopLevelDatum
- a response where the primary data is a single resourceTopLevelData
- a response where the primary data is an array of resourcesPagedTopLevelData
- a response where the primary data is an array of resources with pagination controls
Also adds a type for pagination links.
0.5.0: Entity inheritance
Entity definitions can now be split across multiple types:
Add the ability to extend subclasses of JsonapiEntity
, whilst drawing annotated properties from the prototype chain.
Prior to this release, if you attempt to create a common superclass that extends JsonapiEntity
, then extend with child @entity
classes, the only properties to be deserialised are those declared in the subclass.
For example, the @entity
class Cat
:
extends the (abstract) Animal
:
so you would expect a deserialised Cat
to contain all the Animal
fields and the Cat
fields.
This release adds the ability to pull inherited JSON:API fields from the parent type, by making attribute
, link
, meta
, and relationship
traverse up the prototype chain.
However, this release does not attempt to allow full OO extensions: it is not permitted to have an @entity
subtype of a class that is, itself, and @entity
(due to the odd prototype chain).
0.4.0: CommonJS publishing
Update build process to release as an ES2015 library with type declar…
0.3.0: Upgrade to Typescript 2.6
Typescript 2.6 (#5) * Upgrade to Typescript 2.6
0.2.0
Fix bugs in property transfer
0.1.0
Adds initial functionality to the library, namely:
- decorator definitions to be able to create Typescript classes that map to JSON:API types
- serialisation and deserialisation routines for converting between JSON:API and Typescript class equivalents
- A package structure that allows the library to be used from an Angular application
- Tests for all the above.