- Introduce
@Auth()
and deprecate@User()
to supportexpress-jwt
version 7 and above.
- Update deps
- Fix breaking tests
- Better error logging: besides the error object, send a lot of useful info to the logger.
- Update deps
- Added
@User()
attribute decorator, shorthand forrequest.user
, useful for authorization. - Changelog styling updated
- Update deps
- Validator for booleans -- Contribution from kundralaci
- Test for boolean bindings
- Update deps
- Update dependencies
Features
WebError
can have texterrorCode
values as well- Update dependencies
Fixes
- Add
.js.map
files to npm package - Add comments (JSDoc) to npm package
- Close rejected async requests even if autoClose is set (
Response
object is used) - Actions with the same route and different method won't have their middlewares interfere with each other
- Now a middleware is applied if the route AND the method are ok. The latter is the news.
- Middlewares are applied in the same order as their declaration
- Readme fixes and update
- Test fixes
Changes
- Results of
string
or aPromise<string>
wont't be JSON-serialized- Technically it's a breaking change but sending JSON-serialized strings is clearly a bad practice noone should use
- Error callback changed as it was already documented
- Debug callback already works this way
Fixes
- Permission name generation for actions with routes
/
,/:*
would also generatectrlname:funcname
Changes (undocumented breaking)
@Get('')
and other methods will register to/ctrlname
instead of/ctrlname/
- Permission for
Get('')
will bectrlName.funcName
- Using different permissions on same route + different method is available. Using any permission and no permission (Public) on the same route + different method is still forbidden.
Fixes
- Fixes in readme (typos, errors)
BREAKING CHANGES: Renames
@AllowAnonymus
-->@Public
getAllWhiteList
-->getAllPublicRoutes
getWhiteList
-->getPublicRoutes
Features
- Less constraints on
Body
,Query
andParam
: each can be used without types - Minor undocumented change:
@Body()
won't validatebody
to be an Object
Features
- Introduced some static messages on
AdvancedController
affecting every existing controller instances - Role-based authentication + authorization
Param
decorator for routing params (e.g.my-ctrl/action/:id
)AllowAnonymus
andAuthorize
decorators- WhiteLists
- Some checks to prevent various unintentional cases (e.g. 2 controllers using the same name)
BREAKING CHANGES
- Rename all decorators:
camelCase
-->PascalCase
(e.g.get
-->Get
) - Type rename:
Req
-->Request
,Res
-->Response
- Rename
BaseController
-->AdvancedController
- Rename at
AdvancedController
instance:getAllPermissions
-->getPermissions
- Default permission goes from
<ctrl>:<action>
to<ctrl>.<action>
- TS build: Requires full ES2015 lib (specifically:
ES2015.collections
, even more specifically:Map
)
3# 0.4.0 (2017-05-05)
Features
- Permission support on classes
Fixes
- Fix enables using controller classes having a member variable with
function
type
Features
WebError
can be used to send back acode
besides a message.{ errors: [ { message: string, code?: number }] }
No breaking change, only extension.
Features
- Permission support
- Namespace support
BREAKING CHANGES
- Obsolete decorators like
@queryString
and@bodyNumber
are removed
Notes
- Code is restructured into several files
- Removed
typings
, now using@types/<name>
NPM packages Promise
objects were already required; now TS build explicitly requireses2015.promise
- Minor git and package config changes
- Planning to go to
es2015
package build
Features
- Can parse whole body (#2)
- Custom validation and parsing can be added
- Error handling is more customizable: can send back plain text or JSON object
- Default settings: sending back something like JSON API:
"{"errors":[{"message":"<ERROR-MSG>"}]}"
- Default settings: sending back something like JSON API:
@queryTYPE
and@bodyTYPE
are obsolete; use@query(name, type, opt?)
instead
BREAKING CHANGES
- Error messages are not plain text but JSON objects by default