refactor: update Flowise integration for improved configuration and validation

This commit refines the Flowise integration by enhancing configuration management and validation logic. Key changes include:
- Reordered parameters in the FlowiseService constructor for consistency.
- Updated FlowiseController to utilize the configService for integration enablement checks.
- Simplified FlowiseDto and FlowiseSettingDto by removing unused properties.
- Enhanced validation logic in flowise.schema.ts to include new fields.
- Improved error handling in the createBot method to prevent duplicate entries.

These updates contribute to a more robust and maintainable Flowise integration.
This commit is contained in:
Guilherme Gomes
2025-05-27 15:49:15 -03:00
parent 64fc7a05ac
commit 95bd85b6e3
6 changed files with 143 additions and 133 deletions

View File

@@ -270,6 +270,7 @@ export type Openai = { ENABLED: boolean; API_KEY_GLOBAL?: string };
export type Dify = { ENABLED: boolean };
export type N8n = { ENABLED: boolean };
export type Evoai = { ENABLED: boolean };
export type Flowise = { ENABLED: boolean };
export type S3 = {
ACCESS_KEY: string;
@@ -311,6 +312,7 @@ export interface Env {
DIFY: Dify;
N8N: N8n;
EVOAI: Evoai;
FLOWISE: Flowise;
CACHE: CacheConf;
S3?: S3;
AUTHENTICATION: Auth;
@@ -626,6 +628,9 @@ export class ConfigService {
EVOAI: {
ENABLED: process.env?.EVOAI_ENABLED === 'true',
},
FLOWISE: {
ENABLED: process.env?.FLOWISE_ENABLED === 'true',
},
CACHE: {
REDIS: {
ENABLED: process.env?.CACHE_REDIS_ENABLED === 'true',