Skip to content

Releases: junglebarry/jsonapi-transformers

0.6.0: Improved types for top-level and pagination

06 Nov 15:41
b85984c
Compare
Choose a tag to compare

Adds more explicit types for the TopLevel, representing:

  • TopLevelDatum - a response where the primary data is a single resource
  • TopLevelData - a response where the primary data is an array of resources
  • PagedTopLevelData - 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

20 Aug 16:28
b3b178d
Compare
Choose a tag to compare

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:

https://github.com/junglebarry/jsonapi-transformers/blob/59f82faa73b2bd238f0c7eb3b36a3f64f1e14c87/spec/test-data/cat.ts#L1-L21

extends the (abstract) Animal:

https://github.com/junglebarry/jsonapi-transformers/blob/59f82faa73b2bd238f0c7eb3b36a3f64f1e14c87/spec/test-data/animal.ts#L1-L14

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

26 Jan 23:45
a05e3a6
Compare
Choose a tag to compare
Update build process to release as an ES2015 library with type declar…

0.3.0: Upgrade to Typescript 2.6

26 Jan 13:39
d0650bc
Compare
Choose a tag to compare
Typescript 2.6 (#5)

* Upgrade to Typescript 2.6

0.2.0

22 Sep 10:06
Compare
Choose a tag to compare

Fix bugs in property transfer

0.1.0

29 Aug 10:34
Compare
Choose a tag to compare

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.