61 lines
4.3 KiB
TypeScript
61 lines
4.3 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { ConversationORM } from '../infrastructure/database/postgres/entities/conversation.orm';
|
|
import { MessageORM } from '../infrastructure/database/postgres/entities/message.orm';
|
|
import { TokenUsageORM } from '../infrastructure/database/postgres/entities/token-usage.orm';
|
|
import { AgentExecutionORM } from '../infrastructure/database/postgres/entities/agent-execution.orm';
|
|
import { AssessmentDirectiveORM } from '../infrastructure/database/postgres/entities/assessment-directive.orm';
|
|
import { CollectionDirectiveORM } from '../infrastructure/database/postgres/entities/collection-directive.orm';
|
|
import { GatewayApiKeyORM } from '../infrastructure/database/postgres/entities/gateway-api-key.orm';
|
|
import { GatewayInjectionRuleORM } from '../infrastructure/database/postgres/entities/gateway-injection-rule.orm';
|
|
import { GatewayContentRuleORM } from '../infrastructure/database/postgres/entities/gateway-content-rule.orm';
|
|
import { GatewayUsageLogORM } from '../infrastructure/database/postgres/entities/gateway-usage-log.orm';
|
|
import { GatewayAuditLogORM } from '../infrastructure/database/postgres/entities/gateway-audit-log.orm';
|
|
import { ConversationPostgresRepository } from '../adapters/outbound/persistence/conversation-postgres.repository';
|
|
import { MessagePostgresRepository } from '../adapters/outbound/persistence/message-postgres.repository';
|
|
import { TokenUsagePostgresRepository } from '../adapters/outbound/persistence/token-usage-postgres.repository';
|
|
import { CONVERSATION_REPOSITORY } from '../domain/repositories/conversation.repository.interface';
|
|
import { MESSAGE_REPOSITORY } from '../domain/repositories/message.repository.interface';
|
|
import { TOKEN_USAGE_REPOSITORY } from '../domain/repositories/token-usage.repository.interface';
|
|
import { ConversationService } from '../application/services/conversation.service';
|
|
import { ConversationController } from '../adapters/inbound/conversation.controller';
|
|
import { InternalConversationController } from '../adapters/inbound/internal.controller';
|
|
import { AdminConversationController } from '../adapters/inbound/admin-conversation.controller';
|
|
import { AdminMcpController } from '../adapters/inbound/admin-mcp.controller';
|
|
import { AdminEvaluationRuleController } from '../adapters/inbound/admin-evaluation-rule.controller';
|
|
import { AdminObservabilityController } from '../adapters/inbound/admin-observability.controller';
|
|
import { AdminAssessmentDirectiveController } from '../adapters/inbound/admin-assessment-directive.controller';
|
|
import { AdminCollectionDirectiveController } from '../adapters/inbound/admin-collection-directive.controller';
|
|
import { AdminSupervisorController } from '../adapters/inbound/admin-supervisor.controller';
|
|
import {
|
|
AdminGatewayKeysController,
|
|
AdminGatewayInjectionRulesController,
|
|
AdminGatewayContentRulesController,
|
|
AdminGatewayDashboardController,
|
|
} from '../adapters/inbound/admin-gateway.controller';
|
|
import { ConversationGateway } from '../adapters/inbound/conversation.gateway';
|
|
import { PaymentModule } from '../infrastructure/payment/payment.module';
|
|
|
|
@Module({
|
|
imports: [TypeOrmModule.forFeature([ConversationORM, MessageORM, TokenUsageORM, AgentExecutionORM, AssessmentDirectiveORM, CollectionDirectiveORM, GatewayApiKeyORM, GatewayInjectionRuleORM, GatewayContentRuleORM, GatewayUsageLogORM, GatewayAuditLogORM]), PaymentModule],
|
|
controllers: [ConversationController, InternalConversationController, AdminMcpController, AdminEvaluationRuleController, AdminAssessmentDirectiveController, AdminCollectionDirectiveController, AdminSupervisorController, AdminConversationController, AdminObservabilityController, AdminGatewayKeysController, AdminGatewayInjectionRulesController, AdminGatewayContentRulesController, AdminGatewayDashboardController],
|
|
providers: [
|
|
ConversationService,
|
|
ConversationGateway,
|
|
{
|
|
provide: CONVERSATION_REPOSITORY,
|
|
useClass: ConversationPostgresRepository,
|
|
},
|
|
{
|
|
provide: MESSAGE_REPOSITORY,
|
|
useClass: MessagePostgresRepository,
|
|
},
|
|
{
|
|
provide: TOKEN_USAGE_REPOSITORY,
|
|
useClass: TokenUsagePostgresRepository,
|
|
},
|
|
],
|
|
exports: [ConversationService, CONVERSATION_REPOSITORY, MESSAGE_REPOSITORY, TOKEN_USAGE_REPOSITORY],
|
|
})
|
|
export class ConversationModule {}
|