mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-26 07:07:45 -06:00
refactor: improve session handling and validation in N8n integration
This commit enhances the N8n integration by refining session management and validation logic. Key changes include: - Added error handling for session creation failures in the BaseChatbotService. - Removed unused methods and properties in N8nService and N8nDto to streamline the codebase. - Updated N8n schema to enforce required fields and improve validation checks. - Simplified message processing logic to utilize base class methods, enhancing maintainability. These improvements contribute to a more robust and efficient N8n integration.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { TriggerOperator, TriggerType } from '@prisma/client';
|
||||
|
||||
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
||||
|
||||
export class N8nDto extends BaseChatbotDto {
|
||||
@@ -7,26 +5,10 @@ export class N8nDto extends BaseChatbotDto {
|
||||
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 extends BaseChatbotSettingDto {
|
||||
// N8n specific fields
|
||||
// N8n has no specific fields
|
||||
}
|
||||
|
||||
export class N8nMessageDto {
|
||||
|
||||
Reference in New Issue
Block a user