Releases: serhiisol/node-decorators
Server-1.0.0-beta.7
- Updated
@decorators/di
to3.1.0
with support of root container - Added root container as parent to application container
Server-1.0.0-beta.10
- Added missing imports in swagger
Di@3.1.0
Server-1.0.0-beta.6
- updated validation for simple types
adapter.IsHeadersSent
- returns now boolean
Server-1.0.0-beta.5
- Added ability to ignore global version to generate url (useful for example for wildcard routes
*
) - Updated param validation
- Param extraction returns promise
Server-1.0.0-beta.4
1.0.0-beta.4 release:
- Adds custom parameter decorator error handling - pipes will receive error for handling (#174)
- Adds error handling for
render
process (#173, #175)
Express-openapi@2.1.0
- Adds ability to mark property as nullable (resolves #179)
Di@3.0.1
Server@1.0.0-beta.3
Fixed missing typeVersions and exports in package.json
Server@1.0.0-beta.1
Features:
- Adapters
- Pipes
- Payload Validation
- Modules
- Simplification
- Custom Decorators
Adapters
Package is router library agnostic so it's possible to use express
, fastify
or koa
.
In this release only ExpressAdapter is included, more to come.
Pipes
Reimagined middleware. Supports both running code before and after main handler.
There are three types of pipes: global
, controller
and method
at the moment.
Order of Execution:
Global => Controller => Method => Route Handler => Method => Controller => Global
Payload Validation
Based on class-validator and class-transformer system supports payload validation. Standard type validation (i.e. string
, object
, boolean
etc.) is also supported.
@Post('', 200)
create(@Body() post: PostType) {
return post;
}
@Get(':id', 200)
post(@Params('id') id: string) {
return { id, name: 'hello world' };
}
Modules
Modules keep providers scoped. Resolved via update of @decorators/di@3.0.0
version that supports nesting of containers. With 3.0.0 update is also possible to use multi
providers (available through the same injection token).