Add N8n integration with models, services, and routes

- Introduced N8n and N8nSetting models in both MySQL and PostgreSQL schemas.
- Implemented N8nController and N8nService for managing N8n bots.
- Created N8nRouter for handling API requests related to N8n.
- Added DTOs and validation schemas for N8n integration.
- Updated server module and chatbot controller to include N8n functionality.
- Configured environment settings for N8n integration.
This commit is contained in:
Guilherme Gomes
2025-05-14 20:47:23 -03:00
parent 6d63f2fb6e
commit 38f089f04c
14 changed files with 1708 additions and 5 deletions

View File

@@ -0,0 +1,34 @@
import { TriggerType, TriggerOperator } from '@prisma/client';
export class N8nDto {
enabled?: boolean;
description?: string;
webhookUrl?: string;
basicAuthUser?: string;
basicAuthPass?: string;
// Advanced bot properties (copied from DifyDto style)
triggerType?: TriggerType;
triggerOperator?: TriggerOperator;
triggerValue?: string;
expire?: number;
keywordFinish?: string;
delayMessage?: number;
unknownMessage?: string;
listeningFromMe?: boolean;
stopBotFromMe?: boolean;
keepOpen?: boolean;
debounceTime?: number;
ignoreJids?: string[];
splitMessages?: boolean;
timePerChar?: number;
}
export class N8nSettingDto {
// Add settings fields here if needed for compatibility
}
export class N8nMessageDto {
chatInput: string;
sessionId: string;
}