Coloquent Versions Save

Javascript/Typescript library mapping objects and their interrelations to JSON API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel's Eloquent) syntax for creating, retrieving, updating and deleting model objects.

v3.0.1-beta

2 years ago

New major version 3.x

  • All configuration now happens with static properties, making it more uniform and reducing runtime memory usage
  • The Model.httpClient is now a property that one can override

Breaking changes | How to upgrade from v2.x

  • The configuratioof your models, namely setting the jsonApiBaseUrl and setting jsonApiType has been slightly altered, moving to exclusive use of static properties. Check the readme to see for how they are set now.

v2.4.1

2 years ago

Fixes

  • It now becomes possible to wrap Coloquent models in proxies

v2.4.0

2 years ago

Improvements

  • #86 Type hints no longer needed when building a query from the model class. E.g.
    Artist
        .get() // Now a Promise<PluralResult<Artist>>, no longer a
               //       Promise<PluralResult<Model>>
    

v2.3.0

2 years ago

Improvements

  • #79 Better cross-platform automatic relation name detection by using error-stack-parser under the hood
  • #80 Possibility to specify generics on relationships and models, that will enable Typescript to infer which model types are returned by all query methods
  • #80 Whether the .get() method returns a SingularResponse or a PluralResponse is now known by the type system, so no more casting is needed

v2.2.0

4 years ago

Features

  • #74 The .query() method on the model is now statically available

Fixes

  • #72 The .fresh() method was not reloading nested relations

v2.1.0

4 years ago
  • A .fresh() method has been added, which can be called on any Model instance to obtain a fresh version of that model from the API
  • A .limit() method has been added to the query builder, which allows you to limit the number of results returned by a query.

v2.0.2

4 years ago

v2.0.1

4 years ago

v2.0.0

4 years ago
  • Query building method chain is now immutable For instance, from now on we can do this:
    const allStudentsQuery = Student
        .with('university');
    const firstYearStudentsQuery = allStudentsQuery
        .where('year', 1);
    
    In version <2, the second statement would have mutated allStudentsQuery as well, and both queries would have been exactly the same. From this release, both allStudentsQuery and firstYearStudentsQuery are what their names describe them to be.

v1.2.8

4 years ago
  • Fixed: wrong URL was generated when querying relations