Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

v0.13.0

Choose a tag to compare

@etsuo etsuo released this 23 Apr 15:57
· 76 commits to develop since this release
3967171

See Milestone 0.13.0

New

@BeforeCreate and @BeforeSave hooks

(#166) You can now declare one or more methods in your @Model decorated class with @BeforeSave() or @BeforeCreate() to allow hooks to be called before your model is saved or created. This is helpful for things like updating updatedAt fields, etc. You can use a context to control which hook is called in a given situation (including * context for hooks that should execute in all contexts). If you're familiar with how context works elsewhere in SakuraApi, it's the same here.

You can now type fromJson

(#165) For example SomeModel.fromJson<ISomeMore>({});

Bug Fixes

(#167) Arrays of sub documents are now properly handled by toJson, fromJson, toDb and fromDb.

Internal Improvements

(#169) SakuraApi Core is undergoing a major internal renovation (refactor) to clean up how code is organized and how tests are organized (#168).