Merge branch 'constants' into 'main'

Constants

See merge request v3/service/user!44
This commit is contained in:
Sylvain Briat 2023-10-17 12:39:57 +00:00
commit 27854fce77
4 changed files with 7 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@mobicoop/user",
"version": "1.2.0",
"version": "1.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mobicoop/user",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL",
"dependencies": {
"@grpc/grpc-js": "^1.9.5",

View File

@ -1,6 +1,6 @@
{
"name": "@mobicoop/user",
"version": "1.2.0",
"version": "1.2.1",
"description": "Mobicoop V3 User Service",
"author": "sbriat",
"private": true,

View File

@ -2,6 +2,7 @@
export const SERVICE_NAME = 'user';
// grpc
export const GRPC_PACKAGE_NAME = 'user';
export const GRPC_SERVICE_NAME = 'UserService';
// configuration
@ -11,6 +12,6 @@ export const SERVICE_CONFIGURATION_PROPAGATE_QUEUE =
'user-configuration-propagate';
// health
export const HEALTH_SERVICE_NAME = 'health';
export const GRPC_HEALTH_PACKAGE_NAME = 'health';
export const HEALTH_USER_REPOSITORY = 'UserRepository';
export const HEALTH_CRITICAL_LOGGING_KEY = 'logging.user.health.crit';

View File

@ -2,7 +2,7 @@ import { NestFactory } from '@nestjs/core';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { join } from 'path';
import { AppModule } from './app.module';
import { HEALTH_SERVICE_NAME, SERVICE_NAME } from './app.constants';
import { GRPC_HEALTH_PACKAGE_NAME, GRPC_PACKAGE_NAME } from './app.constants';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
@ -12,7 +12,7 @@ async function bootstrap() {
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.GRPC,
options: {
package: [SERVICE_NAME, HEALTH_SERVICE_NAME],
package: [GRPC_PACKAGE_NAME, GRPC_HEALTH_PACKAGE_NAME],
protoPath: [
join(__dirname, 'modules/user/interface/grpc-controllers/user.proto'),
join(__dirname, 'health.proto'),