mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-10 00:54:48 +00:00
110 lines
4.0 KiB
TypeScript
110 lines
4.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ClientsModule } from '@nestjs/microservices';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
|
|
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 { HealthService } from './modules/health/health.service';
|
|
|
|
import { AuthClientService } from './clients/auth/client.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 { PermissionsClientService } from './clients/permissions/client.service';
|
|
|
|
import { OutputsClientConfiguration } from './clients/outputs/client.config';
|
|
import { TransformationsClientConfiguration } from './clients/transformations/client.config';
|
|
import { DucClient } from './clients/duc/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';
|
|
import { OauthController } from './modules/oauth/oauth.controller';
|
|
import { getOauthSecrets } from './utils/OauthSecrets';
|
|
import { HubspotStrategy } from './modules/oauth/passport-strategies/hubspot-strategy';
|
|
import { FacebookStrategy } from './modules/oauth/passport-strategies/facebook-strategy';
|
|
import { AuthenticationGuard } from './authentication/authentication.guard';
|
|
import { APP_GUARD } from '@nestjs/core';
|
|
import { GoogleStrategy } from './modules/oauth/passport-strategies/google-strategy';
|
|
|
|
const ducClient = new DucClient();
|
|
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,
|
|
OauthController,
|
|
],
|
|
providers: [
|
|
{ provide: 'OAUTH_SECRETS', useValue: getOauthSecrets() },
|
|
InputsService,
|
|
TransformationsService,
|
|
OutputsService,
|
|
PipelinesService,
|
|
HealthService,
|
|
InputsClientService,
|
|
TransformationsClientService,
|
|
OutputsClientService,
|
|
PipelinesClientService,
|
|
AuthClientService,
|
|
PermissionsClientService,
|
|
CatalogService,
|
|
{
|
|
provide: APP_GUARD,
|
|
useClass: AuthenticationGuard,
|
|
},
|
|
//OAUTH Passport Strategies
|
|
HubspotStrategy,
|
|
FacebookStrategy,
|
|
GoogleStrategy,
|
|
],
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
}),
|
|
|
|
ClientsModule.register([
|
|
{
|
|
name: 'INPUTS_PACKAGE',
|
|
...inputClient.config(),
|
|
},
|
|
{
|
|
name: 'TRANSFORMATIONS_PACKAGE',
|
|
...transformationClient.config(),
|
|
},
|
|
{
|
|
name: 'OUTPUTS_PACKAGE',
|
|
...outputClient.config(),
|
|
},
|
|
{
|
|
name: 'DUC_PACKAGE',
|
|
...ducClient.config(),
|
|
},
|
|
{
|
|
name: 'PIPELINES_PACKAGE',
|
|
...pipelineClient.config(),
|
|
},
|
|
]),
|
|
],
|
|
})
|
|
export class AppModule {}
|