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.
1.3.0 - 2018-06-14
- Added 'swaggerHost' config option.
- Removed bcrypt dependency
- Attempt to fix windows error
1.2.0 - 2018-05-31
- Updated dependencies to fix security vulnerability.
- Refactored logging to be more consistent.
Please see the release notes.
0.43.0 - 2018-03-23
- Updated auditLog to get correct IP when behind a reverse proxy such as nginx.
0.42.0 - 2018-03-22
- Added option to toggle swagger protocol (http or https) with config.enableSwaggerHttps.
0.41.0 - 2018-03-17
- config.enableSwaggerUI to config.js to determine wether SwaggerUI will be generated or no.
0.40.0 - 2018-01-11
- Config options for disabling
$where
query param and enabling mongoose runValidators option.
- Added "remove: pre" middleware.
- BREAKING Swapped parameters for "add: pre" middleware for consistency.
Before | After |
---|---|
add | |
pre(request, payload, Log) | pre(payload, request, Log) |
0.38.0 - 2017-12-12
- errorHelper feature.
- Added ipAddress and notes to auditLog model
- Fixed date to set to actual current date in auditLog model
- Removed required fields in auditLog model
- updated errorHandler.formatResponse to handle boom errors and normal errors
0.37.0 - 2017-11-17
- Duplicate fields feature.
- Add regex validator.
- Moved testHelper to utilities directory to be included in npm module.
- Moved query-string to regular dependencies for testHelper.
- Updated travis since it broke for no apparent reason.
- Fixed bug preventing associations added from wrapper methods to update correctly.
0.36.0 - 2017-11-11
- Exposed testHelper to RestHapi object, mostly for server injection utilities.
- Fixed bug preventing _id filtering for getAll queries with real ObjectIds.
0.35.0 - 2017-11-10
- Updated joi model for object types.
- Fixed bug preventing object types.
0.34.0 - 2017-11-05
- Added error response for db conflicts.
- Auditlog validation warning.
- Fix payload copies to work with ObjectIds.
- Added missing permissions.
- Added missing params to mongoose wrappers.
0.33.0 - 2017-10-23
- Endpoint activity history tracking via Audit Logs
- BREAKING Modified update: pre middleware to include payload copy. This is more consistent and allows the original payload to remain unchanged.
- The table below shows the middleware functions before (v0.31.1) and after (v0.32.0)
Before | After |
---|---|
update | |
pre(_id, request, Log) | pre(_id, payload, request, Log) |
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) |