routing-controllers
Advanced tools
Comparing version 0.8.0 to 0.8.1-alpha.1
{ | ||
"name": "routing-controllers", | ||
"private": false, | ||
"version": "0.8.0", | ||
"version": "0.8.1-alpha.1", | ||
"description": "Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.", | ||
@@ -16,2 +16,10 @@ "license": "MIT", | ||
"url": "https://github.com/19majkel94" | ||
}, | ||
{ | ||
"name": "Jonathas Morais", | ||
"url": "https://github.com/jotamorais" | ||
}, | ||
{ | ||
"name": "adenhertog", | ||
"url": "https://github.com/adenhertog" | ||
} | ||
@@ -42,2 +50,6 @@ ], | ||
}, | ||
"peerDependencies": { | ||
"class-transformer": "^0.2.3", | ||
"class-validator": "0.10.1" | ||
}, | ||
"devDependencies": { | ||
@@ -87,6 +99,2 @@ "@types/chai": "^4.2.3", | ||
}, | ||
"peerDependencies": { | ||
"class-transformer": "^0.2.3", | ||
"class-validator": "0.10.1" | ||
}, | ||
"scripts": { | ||
@@ -93,0 +101,0 @@ "build": "rimraf build && echo Using TypeScript && tsc --version && tsc --pretty", |
@@ -1401,2 +1401,35 @@ # routing-controllers | ||
For other IoC providers that don't expose a `get(xxx)` function, you can create an IoC adapter using `IocAdapter` like so: | ||
```typescript | ||
// inversify-adapter.ts | ||
import { IoCAdapter } from 'routing-controllers' | ||
import { Container } from 'inversify' | ||
class InversifyAdapter implements IocAdapter { | ||
constructor ( | ||
private readonly container: Container | ||
) { | ||
} | ||
get<T> (someClass: ClassConstructor<T>, action?: Action): T { | ||
const childContainer = this.container.createChild() | ||
childContainer.bind(API_SYMBOLS.ClientIp).toConstantValue(action.context.ip) | ||
return childContainer.resolve<T>(someClass) | ||
} | ||
} | ||
``` | ||
And then tell Routing Controllers to use it: | ||
```typescript | ||
// Somewhere in your app startup | ||
import { useContainer } from 'routing-controllers' | ||
import { Container } from 'inversify' | ||
import { InversifyAdapter } from './inversify-adapter.ts' | ||
const container = new Container() | ||
const inversifyAdapter = new InversifyAdapter(container) | ||
useContainer(inversifyAdapter) | ||
``` | ||
## Custom parameter decorators | ||
@@ -1403,0 +1436,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
458434
9381
1562
0
206