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.31.0 - 2017-10-19
- Added end to end unit tests.
- Updated list and find to return original "_id"s instead of strings.
- Swapped to js Promise rather than Q promise for mongoose.
- Fixed bug preventing "$where" association queries.
- Added a 'select' call to association endpoints to allow owner object to be updated during association middleware.
- Fixed bug with linking model modelName.
- Added missing return statement to removeAssociation. Was causing promises to return before mongo entries updated.
0.30.0 - 2017-10-12
- Added "add" association middleware for "addOne" and "addMany" endpoints."
0.29.0 - 2017-10-10
- Support for policies via mrhorse plugin.
- Support for document-level authorization
- Built in policies for authorizing document creators
createdBy
,updatedBy
, anddeletedBy
metadata options.
- Deprecated
routeOptions.scope
androuteOptions.scope.scope
and replaced withrouteOptions.routeScope
androuteOptions.routeScope.rootScope
.
0.28.0 - 2017-09-29
- Added
update-associations
cli tool.
- Updated hapi-swagger to fix circular reference issue.
- Added option (
config.embedAssociations
) to use linking model collections.
- See docs for details.
- BREAKING
config.embedAssociations
set tofalse
by default to take advantage of mongoose virtuals. If you already have documents in your db, set this option totrue
to continue with the same functionality.
- If possible, future versions will include a cli command to convert existing db data between MANY_MANY structures.
0.26.0 - 2017-09-24
- Added config option to disable 500 response for response validation (disabled by default).
- Cleaned up tests
- Major updates to joi helper functions including support for nested fields.
0.25.0 - 2017-09-20
- Added config option to enable logging of routes and scopes (disabled by default).
0.24.0 - 2017-09-19
- Exposed joi helper methods, including the rest-hapi version of Joi ObjectId.
- Throw error when payload is empty for addMany.
0.23.0 - 2017-09-12
- Allow custom errors in middleware
- Cleaned up tests
- Removed requirement that middlware functions return a promise.
0.22.0 - 2017-09-08
- getAll association middleware
- Uncommented and updated deleteOne handler tests.
- Replaced Boom.serverTimeout with .badImplementation
0.21.0 - 2017-09-06
- list and find pre middleware
- Uncommented and updated create and update handler tests.
0.20.3 - 2017-09-01
- Fixed bug that missed when a payload is an array of Ids.
0.20.2 - 2017-08-31
- Uncommented and updated find handler tests.
- Update dependencies and tests so that rest-hapi works under node v8.
- Hapi request object now accessible in middleware functions.
- BREAKING Middleware function parameters have changed to support the
request
object.- The table below shows the middleware functions before (v0.19.2) and after (v0.20.0)
Before | After |
---|---|
list | |
post(query, result, Log) | post(request, result, Log) |
--- | --- |
find | |
post(query, result, Log) | post(request, result, Log) |
--- | --- |
create | |
pre(payload, Log) | pre(payload, request, Log) |
post(document, result, Log) | post(document, request, result, Log) |
--- | --- |
update | |
pre(_id, payload, Log) | pre(_id, request, Log) |
post(payload, result, Log) | post(request, result, Log) |
--- | --- |
delete | |
pre(_id, hardDelete, Log) | pre(_id, hardDelete, request, Log) |
post(hardDelete, deleted, Log) | post(hardDelete, deleted, request, Log) |