update health package

This commit is contained in:
sbriat 2023-07-20 14:41:02 +02:00
parent 41cb3731c6
commit 17de996457
4 changed files with 63 additions and 18 deletions

61
package-lock.json generated
View File

@ -14,7 +14,7 @@
"@liaoliaots/nestjs-redis": "^9.0.5", "@liaoliaots/nestjs-redis": "^9.0.5",
"@mobicoop/configuration-module": "^1.2.0", "@mobicoop/configuration-module": "^1.2.0",
"@mobicoop/ddd-library": "^0.3.0", "@mobicoop/ddd-library": "^0.3.0",
"@mobicoop/health-module": "^1.1.0", "@mobicoop/health-module": "^2.0.0",
"@mobicoop/message-broker-module": "^1.2.0", "@mobicoop/message-broker-module": "^1.2.0",
"@nestjs/common": "^9.0.0", "@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1", "@nestjs/config": "^2.3.1",
@ -1430,16 +1430,18 @@
} }
}, },
"node_modules/@mobicoop/health-module": { "node_modules/@mobicoop/health-module": {
"version": "1.1.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@mobicoop/health-module/-/health-module-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@mobicoop/health-module/-/health-module-2.0.0.tgz",
"integrity": "sha512-tSdvpwHxMOG7U3txm3sQDUkj1cWeGg9K68u8Y2BKgD8ocMRDufiCXY43ScFXKZqWm8jkcOU6XdwJm3pxvUOq4w==", "integrity": "sha512-r/7zrHJKVRTIiZ50ILy3lEUC/9vi6k0TRcYPMS8zcnUssQg+MPcT5DQS9B9tTB2gkKwcCyxOQlZZIppIybFX3A==",
"dependencies": { "dependencies": {
"@grpc/grpc-js": "^1.8.14", "@grpc/grpc-js": "^1.8.14",
"@grpc/proto-loader": "^0.7.7", "@grpc/proto-loader": "^0.7.7",
"@mobicoop/ddd-library": "^0.3.0", "@mobicoop/ddd-library": "^0.3.0",
"@mobicoop/message-broker-module": "^1.0.5", "@mobicoop/message-broker-module": "^1.0.5",
"@nestjs/axios": "^3.0.0",
"@nestjs/microservices": "^9.4.2", "@nestjs/microservices": "^9.4.2",
"@nestjs/terminus": "^9.2.2" "@nestjs/terminus": "^9.2.2",
"axios": "^1.4.0"
}, },
"peerDependencies": { "peerDependencies": {
"@nestjs/common": "^9.4.2" "@nestjs/common": "^9.4.2"
@ -1458,6 +1460,17 @@
"@nestjs/common": "^9.4.2" "@nestjs/common": "^9.4.2"
} }
}, },
"node_modules/@nestjs/axios": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.0.tgz",
"integrity": "sha512-ULdH03jDWkS5dy9X69XbUVbhC+0pVnrRcj7bIK/ytTZ76w7CgvTZDJqsIyisg3kNOiljRW/4NIjSf3j6YGvl+g==",
"peerDependencies": {
"@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
"axios": "^1.3.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0 || ^7.0.0"
}
},
"node_modules/@nestjs/cli": { "node_modules/@nestjs/cli": {
"version": "9.5.0", "version": "9.5.0",
"dev": true, "dev": true,
@ -2830,9 +2843,18 @@
}, },
"node_modules/asynckit": { "node_modules/asynckit": {
"version": "0.4.0", "version": "0.4.0",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/axios": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/babel-jest": { "node_modules/babel-jest": {
"version": "29.5.0", "version": "29.5.0",
"dev": true, "dev": true,
@ -3457,7 +3479,6 @@
}, },
"node_modules/combined-stream": { "node_modules/combined-stream": {
"version": "1.0.8", "version": "1.0.8",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"delayed-stream": "~1.0.0" "delayed-stream": "~1.0.0"
@ -3688,7 +3709,6 @@
}, },
"node_modules/delayed-stream": { "node_modules/delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=0.4.0" "node": ">=0.4.0"
@ -4496,6 +4516,25 @@
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/fork-ts-checker-webpack-plugin": { "node_modules/fork-ts-checker-webpack-plugin": {
"version": "8.0.0", "version": "8.0.0",
"dev": true, "dev": true,
@ -4525,7 +4564,6 @@
}, },
"node_modules/form-data": { "node_modules/form-data": {
"version": "4.0.0", "version": "4.0.0",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
@ -6732,6 +6770,11 @@
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/pump": { "node_modules/pump": {
"version": "3.0.0", "version": "3.0.0",
"dev": true, "dev": true,

View File

@ -35,7 +35,7 @@
"@liaoliaots/nestjs-redis": "^9.0.5", "@liaoliaots/nestjs-redis": "^9.0.5",
"@mobicoop/configuration-module": "^1.2.0", "@mobicoop/configuration-module": "^1.2.0",
"@mobicoop/ddd-library": "^0.3.0", "@mobicoop/ddd-library": "^0.3.0",
"@mobicoop/health-module": "^1.1.0", "@mobicoop/health-module": "^2.0.0",
"@mobicoop/message-broker-module": "^1.2.0", "@mobicoop/message-broker-module": "^1.2.0",
"@nestjs/common": "^9.0.0", "@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1", "@nestjs/config": "^2.3.1",

View File

@ -8,13 +8,10 @@ import {
import { EventEmitterModule } from '@nestjs/event-emitter'; import { EventEmitterModule } from '@nestjs/event-emitter';
import { RequestContextModule } from 'nestjs-request-context'; import { RequestContextModule } from 'nestjs-request-context';
import { MessagerModule } from '@modules/messager/messager.module'; import { MessagerModule } from '@modules/messager/messager.module';
import { HealthModule } from '@mobicoop/health-module'; import { HealthModule, HealthRepositoryPort } from '@mobicoop/health-module';
import { AD_REPOSITORY } from '@modules/ad/ad.di-tokens'; import { AD_REPOSITORY } from '@modules/ad/ad.di-tokens';
import { MESSAGE_PUBLISHER } from '@modules/messager/messager.di-tokens'; import { MESSAGE_PUBLISHER } from '@modules/messager/messager.di-tokens';
import { import { HealthModuleOptions } from '@mobicoop/health-module/dist/core/domain/types/health.types';
HealthModuleOptions,
ICheckRepository,
} from '@mobicoop/health-module/dist/core/domain/types/health.types';
import { MessagePublisherPort } from '@mobicoop/ddd-library'; import { MessagePublisherPort } from '@mobicoop/ddd-library';
@Module({ @Module({
@ -47,12 +44,17 @@ import { MessagePublisherPort } from '@mobicoop/ddd-library';
imports: [AdModule, MessagerModule], imports: [AdModule, MessagerModule],
inject: [AD_REPOSITORY, MESSAGE_PUBLISHER], inject: [AD_REPOSITORY, MESSAGE_PUBLISHER],
useFactory: async ( useFactory: async (
adRepository: ICheckRepository, adRepository: HealthRepositoryPort,
messagePublisher: MessagePublisherPort, messagePublisher: MessagePublisherPort,
): Promise<HealthModuleOptions> => ({ ): Promise<HealthModuleOptions> => ({
serviceName: 'ad', serviceName: 'ad',
criticalLoggingKey: 'logging.ad.health.crit', criticalLoggingKey: 'logging.ad.health.crit',
checkRepositories: [adRepository], checkRepositories: [
{
name: 'AdRepository',
repository: adRepository,
},
],
messagePublisher, messagePublisher,
}), }),
}), }),

View File

@ -2,7 +2,6 @@ syntax = "proto3";
package health; package health;
service Health { service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse); rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
} }
@ -18,4 +17,5 @@ message HealthCheckResponse {
NOT_SERVING = 2; NOT_SERVING = 2;
} }
ServingStatus status = 1; ServingStatus status = 1;
string message = 2;
} }