All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0-beta.5 - 2024-10-02
- Fix falsy attribute values not being returned
0.2.0-beta.4 - 2024-10-01
- Remove index signature from
Model
0.2.0-beta.3 - 2024-09-03
- Allow syncing
null
document data. - Add
exports
field to package.json.
0.2.0-beta.1 - 2024-05-14
-
Rewrite TypeScript support to allow Intellisense based on JSON:API resource schema. For example:
type UsersSchema = { type: 'users'; id: string; attributes: { name: string; }; relationships: { dog: { data?: { type: 'dogs'; id: string } | null }; }; }; class User extends Model<UsersSchema> {}
To type related resources, you can provide a collection of all models as the second generic.
type DogsSchema = { // ... }; type Schemas = { users: User; dogs: Dog; }; class User extends Model<UsersSchema, Schemas> {} class Dog extends Model<DogsSchema, Schemas> {}
-
The
Store
now returns proxiedModel
instances to implement field getters, instead ofModel
depending onStore
and defining getters for present fields. -
Remove the
Query
helper. UseURLSearchParams
instead. -
Remove
Model
attribute casting functionality. Define getters instead:class User extends Model<UserSchema> { get createdAtDate() { return new Date(this.createdAt); } }
-
Remove the
Model.getAttribute()
andModel.getRelationship()
methods. -
Remove CJS and IIFE exports. Package is now only exported as an ES module.
0.1.0-beta.8 - 2022-06-05
-
Support model type inference:
const store = new Store({ users: User }); store.find('users', '1'); // User
- Remove the
Store.model
method. Models must now be defined when the Store is constructed.
0.1.0-beta.7 - 2021-09-01
- Fix regression with attribute casting not handling dates correctly, and add more sophisticated handling of primitives, constructables, and callables.
0.1.0-beta.6 - 2021-09-01
- Fix attribute cast type definition and invoke as function rather than with
new
.
0.1.0-beta.5 - 2021-08-31
- Query: add
append
,set
, anddelete
methods. - Export useful JSON:API types:
JsonApiDocument
,JsonApiIdentifier
,JsonApiResource
,JsonApiRelationships
, andJsonApiRelationship
.
- Query: remove
push
method.
0.1.0-beta.4 - 2021-05-26
- Fix casts not working correctly.
0.1.0-beta.3 - 2021-05-26
- Added ability to define typecasts for attributes on custom models.
- Change compilation target to
es2017
forObject.entries
support.
- Initial release