-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.2.0' into develop
- Loading branch information
Showing
37 changed files
with
1,404 additions
and
2,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v12.8.0 | ||
v16.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,86 @@ | ||
{ | ||
"name": "@neoskop/nestjs", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Collection of useful NestJS Modules", | ||
"main": "index.js", | ||
"repository": "https://github.com/neoskop/nestjs", | ||
"author": "Mark Wecke <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"prebuild": "rm -r dist", | ||
"prebuild": "rm -rf dist", | ||
"build": "tsc", | ||
"postbuild": "jq 'del(.scripts) | del(.devDependencies)' package.json > dist/package.json && cp README.md dist", | ||
"publish-next": "npm run build && npm publish dist --tag next", | ||
"publish-latest-only": "npm run build && npm publish dist", | ||
"publish-next": "npm run build && cd dist && npm publish --tag next", | ||
"publish-latest-only": "npm run build && cd dist && npm publish", | ||
"publish-latest": "npm run publish-latest-only && npm dist-tag add @neoskop/nestjs@`jq '.version' package.json -r` next" | ||
}, | ||
"devDependencies": { | ||
"@angular/core": "7.2.14", | ||
"@angular/platform-server": "7.2.14", | ||
"@angular/router": "7.2.14", | ||
"@angular/common": "12", | ||
"@angular/core": "12", | ||
"@angular/platform-server": "12", | ||
"@angular/router": "12", | ||
"@neoskop/adamant": "0.3.0-rc.6", | ||
"@neoskop/annotation-factory": "1.0.1", | ||
"@neoskop/hrbac": "1.0.1", | ||
"@neoskop/hrbac": "2.0.0-rc.1", | ||
"@neoskop/phantom": "1.3.0", | ||
"@nestjs/common": "6.1.1", | ||
"@nestjs/core": "6.1.1", | ||
"@nestjs/graphql": "6.0.5", | ||
"@nguniversal/module-map-ngfactory-loader": "7.1.1", | ||
"@types/cookie-parser": "1.4.1", | ||
"@types/express": "4.16.1", | ||
"@types/http-proxy-middleware": "0.19.2", | ||
"@nestjs/common": "8", | ||
"@nestjs/core": "8", | ||
"@nestjs/graphql": "8", | ||
"@nestjs/terminus": "8", | ||
"@types/cookie-parser": "1.4.2", | ||
"@types/express": "4.17.1", | ||
"@types/http-proxy-middleware": "^1.0.0", | ||
"@types/json-schema": "7.0.3", | ||
"@types/node": "12.0.0", | ||
"@types/node": "12.7.5", | ||
"@types/oauth2-server": "3.0.12", | ||
"@types/pouchdb": "6.4.0", | ||
"@types/simple-oauth2": "2.2.1", | ||
"@types/winston": "2.4.4", | ||
"ajv": "6.10.0", | ||
"ajv": "6.10.2", | ||
"cookie-parser": "^1.4.4", | ||
"http-proxy-middleware": "0.19.1", | ||
"http-proxy-middleware": "^2.0.0", | ||
"oauth2-server": "3.0.1", | ||
"reflect-metadata": "0.1.13", | ||
"rxjs": "6.5.1", | ||
"simple-oauth2": "2.2.1", | ||
"typescript": "3.4.5", | ||
"rxjs": "6.5.3", | ||
"simple-oauth2": "2.4.0", | ||
"typescript": "^4.2.4", | ||
"winston": "3.2.1", | ||
"zone.js": "0.9.1" | ||
"zone.js": "0.10.2" | ||
}, | ||
"dependencies": { | ||
"tslib": "1.9.3" | ||
"import-fresh": "^3.3.0", | ||
"tslib": "^2.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": "*", | ||
"@angular/core": "*", | ||
"@angular/platform-server": "^7.2.9", | ||
"@neoskop/adamant": "^0.3.0-rc.5", | ||
"@neoskop/hrbac": "^1.0.1", | ||
"@neoskop/phantom": "^1.3.0", | ||
"@nestjs/common": "^6.1.1", | ||
"@nestjs/core": "^6.1.1", | ||
"@nestjs/graphql": "^6.0.5", | ||
"@nguniversal/module-map-ngfactory-loader": "^7.1.1", | ||
"ajv": "^6.10.0", | ||
"cookie-parser": "^1.4.4", | ||
"http-proxy-middleware": "^0.19.1", | ||
"reflect-metadata": "^0.1.12", | ||
"rxjs": "^6.0.0", | ||
"simple-oauth2": "^2.2.1", | ||
"winston": "^3.2.1", | ||
"zone.js": "0.9.1" | ||
"@angular/platform-server": "*", | ||
"@neoskop/adamant": "*", | ||
"@neoskop/hrbac": ">=2.0.0-rc.1", | ||
"@neoskop/phantom": "*", | ||
"@nestjs/common": "*", | ||
"@nestjs/core": "*", | ||
"@nestjs/graphql": "*", | ||
"@nestjs/terminus": "*", | ||
"ajv": "*", | ||
"cookie-parser": "*", | ||
"http-proxy-middleware": "*", | ||
"oauth2-server": "*", | ||
"reflect-metadata": "*", | ||
"rxjs": "*", | ||
"simple-oauth2": "*", | ||
"winston": "*", | ||
"zone.js": "*" | ||
}, | ||
"prettier": { | ||
"trailingComma": "none", | ||
"tabWidth": 4, | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"htmlWhitespaceSensitivity": "css", | ||
"printWidth": 140, | ||
"quoteProps": "as-needed", | ||
"singleQuote": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { AdamantConnectionManager } from '@neoskop/adamant'; | ||
import { Injectable } from '@nestjs/common'; | ||
import { HealthIndicator } from '@nestjs/terminus'; | ||
import url from 'url'; | ||
|
||
const TIMEOUT = Symbol.for('Timeout'); | ||
|
||
@Injectable() | ||
export class AdamantHealthIndicator extends HealthIndicator { | ||
constructor(protected readonly manager : AdamantConnectionManager) { | ||
super(); | ||
} | ||
|
||
async pingCheck(key: string, { timeout = 1000 }: { timeout?: number } = {}) { | ||
let isHealthy = true; | ||
const info : { [key: string]: boolean } = {} | ||
for(const conn of this.manager.getOpenConnections()) { | ||
let isConnectionHealthy : boolean; | ||
try { | ||
const res = await this.timeout(conn.info(), timeout) | ||
isConnectionHealthy = res !== TIMEOUT; | ||
} catch { | ||
isConnectionHealthy = false; | ||
} | ||
info[url.parse(conn.name).pathname!.substr(1)] = isConnectionHealthy; | ||
isHealthy = isHealthy && isConnectionHealthy; | ||
} | ||
|
||
return this.getStatus(key, isHealthy, info); | ||
} | ||
|
||
private timeout<T>(promise : Promise<T>, timeout : number) : Promise<T|typeof TIMEOUT> { | ||
return Promise.race([ | ||
promise, | ||
new Promise<typeof TIMEOUT>(resolve => { | ||
setTimeout(() => resolve(TIMEOUT), timeout) | ||
}) | ||
]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './adamant.module'; | ||
export * from './adamant.module'; | ||
export * from './adamant.health'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.