Node Decorators Versions Save

node-decorators

server-1.0.0-beta.8

9 months ago
  • Removes standard type validation
  • Adds custom param validators:
post(@Params('id', (id) => !IsNaN(Number(id))) id: number) {}

Resolves #183

server-1.0.0-beta.7

9 months ago
  • Updated @decorators/di to 3.1.0 with support of root container
  • Added root container as parent to application container

di-3.1.0

9 months ago
  • Introduces Injectable options with providedIn='root' option in it to register root provider.
  • RootContainer is exported out of di package.

server-1.0.0-beta.6

9 months ago
  • updated validation for simple types
  • adapter.IsHeadersSent - returns now boolean

server-1.0.0-beta.5

9 months ago
  • 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

9 months ago

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

9 months ago
  • Adds ability to mark property as nullable (resolves #179)

di-3.0.1

9 months ago
  • Optional dips will return undefined instead of null so default values can be used

server-1.0.0-beta.3

10 months ago

Fixed missing typeVersions and exports in package.json

server-1.0.0-beta.1

10 months ago

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/[email protected] version that supports nesting of containers. With 3.0.0 update is also possible to use multi providers (available through the same injection token).