refactor: integration folders

This commit is contained in:
Davidson Gomes
2024-08-23 13:20:18 -03:00
parent a08ca7a67d
commit beafc62403
7 changed files with 62 additions and 65 deletions

View File

@@ -2,7 +2,6 @@ import { InstanceDto } from '@api/dto/instance.dto';
import { PrismaRepository } from '@api/repository/repository.service';
import {
difyController,
eventManager,
flowiseController,
genericController,
openaiController,
@@ -90,32 +89,17 @@ export class ChatbotController {
pushName,
isIntegration,
};
// generic
await genericController.emit(emitData);
// typebot
await typebotController.emit(emitData);
// openai
await openaiController.emit(emitData);
// dify
await difyController.emit(emitData);
// flowise
await flowiseController.emit(emitData);
}
public async setInstance(instanceName: string, data: InstanceDto): Promise<any> {
if (data.websocket.enabled)
await eventManager.websocket.set(instanceName, {
websocket: {
enabled: true,
events: data.websocket.events,
},
});
}
public processDebounce(
userMessageDebounce: any,
content: string,

View File

@@ -8,11 +8,11 @@ import { Events } from '@api/types/wa.types';
import { Auth, configService, HttpServer, Typebot } from '@config/env.config';
import { Logger } from '@config/logger.config';
import { BadRequestException } from '@exceptions';
import { Typebot as TypebotModel } from '@prisma/client';
import { getConversationMessage } from '@utils/getConversationMessage';
import axios from 'axios';
import { ChatbotController, ChatbotControllerInterface } from '../../chatbot.controller';
import { Typebot as TypebotModel } from '@prisma/client';
export class TypebotController extends ChatbotController implements ChatbotControllerInterface {
constructor(