feat: Integration with Dify

Adds support for Dify integration, including new routes, services, and controllers. The configuration for Dify has been added to the environment file, and the necessary changes have been made to the `.env.example` file. Additionally, the WhatsApp Baileys service has been updated to handle Dify notifications.

Modified files:
- `.env.example`
- `package.json`
- `src/api/integrations/openai/services/openai.service.ts`
- `src/api/routes/index.router.ts`
- `src/api/server.module.ts`
- `src/api/services/channel.service.ts`
- `src/api/services/channels/whatsapp.baileys.service.ts`
- `src/config/env.config.ts`
- `src/validate/validate.schema.ts`

Introduced files:
- `src/api/integrations/dify/`
- `src/api/integrations/dify/controllers/dify.controller.ts`
- `src/api/integrations/dify/dto/dify.dto.ts`
- `src/api/integrations/dify/routes/dify.router.ts`
- `src/api/integrations/dify/services/dify.service.ts`
- `src/api/integrations/dify/validate/dify.schema.ts`
This commit is contained in:
Davidson Gomes
2024-07-30 13:34:35 -03:00
parent b604e4ecc7
commit a5d72a0dfd
14 changed files with 1698 additions and 2 deletions

View File

@@ -13,6 +13,8 @@ import { TemplateController } from './controllers/template.controller';
import { WebhookController } from './controllers/webhook.controller';
import { ChatwootController } from './integrations/chatwoot/controllers/chatwoot.controller';
import { ChatwootService } from './integrations/chatwoot/services/chatwoot.service';
import { DifyController } from './integrations/dify/controllers/dify.controller';
import { DifyService } from './integrations/dify/services/dify.service';
import { OpenaiController } from './integrations/openai/controllers/openai.controller';
import { OpenaiService } from './integrations/openai/services/openai.service';
import { RabbitmqController } from './integrations/rabbitmq/controllers/rabbitmq.controller';
@@ -70,6 +72,9 @@ export const typebotController = new TypebotController(typebotService);
const openaiService = new OpenaiService(waMonitor, configService, prismaRepository);
export const openaiController = new OpenaiController(openaiService);
const difyService = new DifyService(waMonitor, configService, prismaRepository);
export const difyController = new DifyController(difyService);
const s3Service = new S3Service(prismaRepository);
export const s3Controller = new S3Controller(s3Service);