Initial LisgloSIPS V2 implementation
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import crypto from 'node:crypto';
|
||||
import { LoggerModule } from 'nestjs-pino';
|
||||
import { API_PREFIX } from '@lisglosips/contracts';
|
||||
import { LOG_REDACT_PATHS } from '@lisglosips/observability';
|
||||
import { appConfig, validationSchema } from '../shared/config.js';
|
||||
import { AuditLogsModule } from './audit-logs/audit-logs.module.js';
|
||||
import { AuditModule } from './audit/audit.module.js';
|
||||
import { AuthModule } from './auth/auth.module.js';
|
||||
import { CustomerGatewayPoliciesModule } from './customer-gateway-policies/customer-gateway-policies.module.js';
|
||||
import { CustomerGatewaysModule } from './customer-gateways/customer-gateways.module.js';
|
||||
import { CustomersModule } from './customers/customers.module.js';
|
||||
import { DashboardModule } from './dashboard/dashboard.module.js';
|
||||
import { DatabaseModule } from './database/database.module.js';
|
||||
import { HealthModule } from './health/health.module.js';
|
||||
import { LandingLineGroupsModule } from './landing-line-groups/landing-line-groups.module.js';
|
||||
import { RechargesModule } from './recharges/recharges.module.js';
|
||||
import { RecordingsModule } from './recordings/recordings.module.js';
|
||||
import { QualityModule } from './quality/quality.module.js';
|
||||
import { RolesModule } from './roles/roles.module.js';
|
||||
import { SecurityModule } from './security/security.module.js';
|
||||
import { UsersModule } from './users/users.module.js';
|
||||
import { VendorGatewaysModule } from './vendor-gateways/vendor-gateways.module.js';
|
||||
import { VendorsModule } from './vendors/vendors.module.js';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
cache: true,
|
||||
load: [appConfig],
|
||||
validationSchema,
|
||||
validationOptions: {
|
||||
abortEarly: false,
|
||||
allowUnknown: true
|
||||
}
|
||||
}),
|
||||
LoggerModule.forRoot({
|
||||
pinoHttp: {
|
||||
level: process.env.LISGLOSIPS_LOG_LEVEL ?? 'info',
|
||||
name: process.env.LISGLOSIPS_SERVICE_NAME ?? 'api',
|
||||
genReqId: (request) =>
|
||||
request.headers[process.env.LISGLOSIPS_REQUEST_ID_HEADER ?? 'x-request-id']?.toString() ?? crypto.randomUUID(),
|
||||
redact: {
|
||||
paths: LOG_REDACT_PATHS,
|
||||
censor: '[REDACTED]'
|
||||
},
|
||||
customProps: () => ({
|
||||
apiPrefix: API_PREFIX
|
||||
})
|
||||
}
|
||||
}),
|
||||
DatabaseModule,
|
||||
SecurityModule,
|
||||
AuditModule,
|
||||
AuthModule,
|
||||
DashboardModule,
|
||||
CustomersModule,
|
||||
CustomerGatewaysModule,
|
||||
CustomerGatewayPoliciesModule,
|
||||
RechargesModule,
|
||||
VendorsModule,
|
||||
VendorGatewaysModule,
|
||||
LandingLineGroupsModule,
|
||||
QualityModule,
|
||||
RecordingsModule,
|
||||
UsersModule,
|
||||
RolesModule,
|
||||
AuditLogsModule,
|
||||
HealthModule
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
Reference in New Issue
Block a user