mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-08 20:34:48 +00:00
108 lines
3.6 KiB
TypeScript
108 lines
3.6 KiB
TypeScript
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
|
import { ClientsModule } from '@nestjs/microservices';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
|
|
import { LoggerMiddleware } from './middlewares/authentication';
|
|
|
|
import { InputsController } from './modules/inputs/inputs.controller';
|
|
import { TransformationsController } from './modules/transformations/transformations.controller';
|
|
import { OutputsController } from './modules/outputs/outputs.controllers';
|
|
import { PipelinesController } from './modules/pipelines/pipelines.controller';
|
|
import { AuthController } from './modules/auth/auth.controller';
|
|
import { HealthController } from './modules/health/health.controller';
|
|
|
|
import { InputsService } from './modules/inputs/inputs.service';
|
|
import { TransformationsService } from './modules/transformations/transformations.service';
|
|
import { OutputsService } from './modules/outputs/outputs.service';
|
|
import { PipelinesService } from './modules/pipelines/pipelines.service';
|
|
// import { AuthService } from './modules/auth/auth.service';
|
|
import { HealthService } from './modules/health/health.service';
|
|
|
|
import { InputsClientService } from './clients/inputs/client.service';
|
|
import { TransformationsClientService } from './clients/transformations/client.service';
|
|
import { OutputsClientService } from './clients/outputs/client.service';
|
|
import { PipelinesClientService } from './clients/pipelines/client.service';
|
|
import { AuthClientService } from './clients/auth/client.service';
|
|
|
|
import { OutputsClientConfiguration } from './clients/outputs/client.config';
|
|
import { TransformationsClientConfiguration } from './clients/transformations/client.config';
|
|
import { AuthClient } from './clients/auth/client.config';
|
|
import { InputsClientConfiguration } from './clients/inputs/client.config';
|
|
import { PipelinesClientConfiguration } from './clients/pipelines/client.config';
|
|
import { CatalogController } from './modules/catalog/catalog.controller';
|
|
import { CatalogService } from './modules/catalog/catalog.service';
|
|
|
|
const authClient = new AuthClient();
|
|
const inputClient = new InputsClientConfiguration();
|
|
const outputClient = new OutputsClientConfiguration();
|
|
const pipelineClient = new PipelinesClientConfiguration();
|
|
const transformationClient = new TransformationsClientConfiguration();
|
|
|
|
@Module({
|
|
controllers: [
|
|
InputsController,
|
|
TransformationsController,
|
|
OutputsController,
|
|
PipelinesController,
|
|
AuthController,
|
|
HealthController,
|
|
CatalogController,
|
|
],
|
|
providers: [
|
|
InputsService,
|
|
TransformationsService,
|
|
OutputsService,
|
|
PipelinesService,
|
|
// AuthService,
|
|
HealthService,
|
|
InputsClientService,
|
|
TransformationsClientService,
|
|
OutputsClientService,
|
|
PipelinesClientService,
|
|
AuthClientService,
|
|
CatalogService,
|
|
],
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
}),
|
|
|
|
ClientsModule.register([
|
|
{
|
|
name: 'INPUTS_PACKAGE',
|
|
...inputClient.config(),
|
|
},
|
|
|
|
{
|
|
name: 'TRANSFORMATIONS_PACKAGE',
|
|
...transformationClient.config(),
|
|
},
|
|
{
|
|
name: 'OUTPUTS_PACKAGE',
|
|
...outputClient.config(),
|
|
},
|
|
{
|
|
name: 'AUTH_PACKAGE',
|
|
...authClient.config(),
|
|
},
|
|
{
|
|
name: 'PIPELINES_PACKAGE',
|
|
...pipelineClient.config(),
|
|
},
|
|
]),
|
|
],
|
|
})
|
|
export class AppModule implements NestModule {
|
|
configure(consumer: MiddlewareConsumer) {
|
|
consumer
|
|
.apply(LoggerMiddleware)
|
|
.forRoutes(
|
|
InputsController,
|
|
TransformationsController,
|
|
OutputsController,
|
|
PipelinesController,
|
|
CatalogController,
|
|
);
|
|
}
|
|
}
|