Merge branch 'updateHealthPackage' into 'main'

Update health package

See merge request v3/service/ad!17
This commit is contained in:
Sylvain Briat 2023-07-20 12:50:02 +00:00
commit 81cc4c019e
4 changed files with 78 additions and 29 deletions

85
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@mobicoop/ad",
"version": "1.1.1",
"version": "1.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mobicoop/ad",
"version": "1.1.1",
"version": "1.2.1",
"license": "AGPL",
"dependencies": {
"@grpc/grpc-js": "^1.8.14",
@ -14,7 +14,7 @@
"@liaoliaots/nestjs-redis": "^9.0.5",
"@mobicoop/configuration-module": "^1.2.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",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1",
@ -235,9 +235,10 @@
"license": "MIT"
},
"node_modules/@babel/core/node_modules/semver": {
"version": "6.3.0",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
@ -275,9 +276,10 @@
}
},
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
"version": "6.3.0",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
@ -1430,16 +1432,18 @@
}
},
"node_modules/@mobicoop/health-module": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@mobicoop/health-module/-/health-module-1.1.0.tgz",
"integrity": "sha512-tSdvpwHxMOG7U3txm3sQDUkj1cWeGg9K68u8Y2BKgD8ocMRDufiCXY43ScFXKZqWm8jkcOU6XdwJm3pxvUOq4w==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@mobicoop/health-module/-/health-module-2.0.0.tgz",
"integrity": "sha512-r/7zrHJKVRTIiZ50ILy3lEUC/9vi6k0TRcYPMS8zcnUssQg+MPcT5DQS9B9tTB2gkKwcCyxOQlZZIppIybFX3A==",
"dependencies": {
"@grpc/grpc-js": "^1.8.14",
"@grpc/proto-loader": "^0.7.7",
"@mobicoop/ddd-library": "^0.3.0",
"@mobicoop/message-broker-module": "^1.0.5",
"@nestjs/axios": "^3.0.0",
"@nestjs/microservices": "^9.4.2",
"@nestjs/terminus": "^9.2.2"
"@nestjs/terminus": "^9.2.2",
"axios": "^1.4.0"
},
"peerDependencies": {
"@nestjs/common": "^9.4.2"
@ -1458,6 +1462,17 @@
"@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": {
"version": "9.5.0",
"dev": true,
@ -2830,9 +2845,18 @@
},
"node_modules/asynckit": {
"version": "0.4.0",
"dev": true,
"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": {
"version": "29.5.0",
"dev": true,
@ -3457,7 +3481,6 @@
},
"node_modules/combined-stream": {
"version": "1.0.8",
"dev": true,
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
@ -3688,7 +3711,6 @@
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
@ -4496,6 +4518,25 @@
"dev": true,
"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": {
"version": "8.0.0",
"dev": true,
@ -4525,7 +4566,6 @@
},
"node_modules/form-data": {
"version": "4.0.0",
"dev": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
@ -5112,9 +5152,10 @@
}
},
"node_modules/istanbul-lib-instrument/node_modules/semver": {
"version": "6.3.0",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
@ -5926,9 +5967,10 @@
}
},
"node_modules/make-dir/node_modules/semver": {
"version": "6.3.0",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
}
@ -6732,6 +6774,11 @@
"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": {
"version": "3.0.0",
"dev": true,

View File

@ -1,6 +1,6 @@
{
"name": "@mobicoop/ad",
"version": "1.1.1",
"version": "1.2.1",
"description": "Mobicoop V3 Ad",
"author": "sbriat",
"private": true,
@ -35,7 +35,7 @@
"@liaoliaots/nestjs-redis": "^9.0.5",
"@mobicoop/configuration-module": "^1.2.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",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.1",

View File

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

View File

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