v0.13.0
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).