Commit Graph

2199 Commits

Author SHA1 Message Date
Davidson Gomes
39606240da Merge branch 'release/2.3.0' 2025-06-17 09:25:38 -03:00
Davidson Gomes
f4fbc4afc6 chore(changelog): remove fixed issue with @lid in chatwoot from CHANGELOG 2025-06-17 09:25:19 -03:00
Davidson Gomes
70905e7338 chore(changelog): update version date for 2.3.0 release 2025-06-17 09:20:12 -03:00
Davidson Gomes
07cccb7c7f
Merge pull request #1599 from splusoficial/develop
fix: ajuste na validacao dos bots e pausar sessao
2025-06-17 08:52:47 -03:00
Davidson Gomes
5f0862a759 test: disable webhook https test 2025-06-16 15:27:16 -03:00
Joao Vitor
029d68e2cd fix: ajuste na validacao dos bots e pausar sessao 2025-06-15 18:24:34 -03:00
Davidson Gomes
a1fae85531
Merge pull request #1594 from KokeroO/feat/improves-and-adjusts-treatment-lid-numbers
refactor(chatwoot): Melhora e ajusta tratamento de números @lid
2025-06-13 17:54:09 -03:00
Willian Coqueiro
1afa8df556 refactor(chatwoot): simplify findContact method and update contact creation logic 2025-06-13 19:36:13 +00:00
Davidson Gomes
bfb044b234 feat(whatsapp): enhance contact handling and configuration logic
- Added support for `lid` in WhatsApp numbers router to improve contact identification.
- Updated the contact retrieval logic to accept an object with `phone_number` and `identifier` for better clarity and consistency.
- Enhanced error handling and logging in the Chatwoot service for improved traceability during contact creation and updates.
- Implemented automatic search for the latest WhatsApp version if the CONFIG_SESSION_PHONE_VERSION variable is not set, ensuring users have the most up-to-date integration.
2025-06-13 14:58:01 -03:00
Davidson Gomes
ae99ec7a0e feat(whatsapp): implement fetchLatestWaWebVersion utility and update version fetching logic
- Added a new utility function `fetchLatestWaWebVersion` to retrieve the latest WhatsApp Web version.
- Updated the Baileys service and router to utilize the new function instead of the deprecated `fetchLatestBaileysVersion`, ensuring accurate version information is fetched for WhatsApp integration.
- This change enhances the reliability of version management in the application.
2025-06-13 13:14:35 -03:00
Davidson Gomes
22c379aa36 chore(env): comment out WhatsApp Web version in example configuration
- Updated the .env.example file to comment out the CONFIG_SESSION_PHONE_VERSION variable, indicating it is not currently set. This change helps clarify the configuration options available for users.
2025-06-13 12:34:45 -03:00
Davidson Gomes
62c00c3db2 feat(router): update whatsappWebVersion to fetch latest Baileys version
- Modified the root route to fetch the latest WhatsApp web version from Baileys if not set in the environment configuration.
- This enhancement ensures that clients receive the most up-to-date version information in the API response.
2025-06-13 12:03:24 -03:00
Davidson Gomes
afc2927837 feat(IsOnWhatsapp): add optional lid field and update related logic
- Introduced a new optional `lid` field in the IsOnWhatsapp model to enhance data tracking.
- Updated migration script to add the `lid` column to the database.
- Modified OnWhatsAppDto to include the `lid` property for better integration with WhatsApp user data.
- Enhanced the WhatsApp Baileys service to handle `lid` numbers separately and improve user verification logic.
- Updated cache handling functions to support the new `lid` field for consistent data management.
2025-06-13 11:52:32 -03:00
Davidson Gomes
c17b48bca0 fix(chatwoot.service): improve number retrieval logic for message senders
- Enhanced the logic for retrieving sender numbers by introducing a new method that prioritizes senderPn, followed by participant and remoteJid.
- This change ensures more reliable identification of message senders across different scenarios.
2025-06-13 09:10:29 -03:00
Davidson Gomes
534c54a171 fix(chatwoot.service): enhance contact retrieval logic and normalize identifiers
- Updated contact retrieval to handle cases where the identifier is not found, specifically for @lid scenarios.
- Introduced a new method to normalize contact identifiers, prioritizing senderLid and participantLid.
- Improved logging for better traceability during contact lookups and conversation handling.
2025-06-13 08:28:09 -03:00
Davidson Gomes
8603e6def0 feat(router): add whatsappWebVersion to response object
- Included `whatsappWebVersion` in the response object to provide the version of the WhatsApp web session from the environment configuration.
- This addition enhances the API's response with relevant session information for clients.
2025-06-12 18:08:18 -03:00
Davidson Gomes
bcf2febf48 refactor(whatsapp.business.service): replace hardcoded token with class property
- Updated the token retrieval in the BusinessStartupService to use a class property instead of a hardcoded environment variable.
- This change enhances flexibility and maintainability of the service configuration.
2025-06-12 17:32:00 -03:00
Davidson Gomes
a02ecc88f5 refactor(whatsapp.business.service): enhance media handling and audio processing
- Updated media message preparation to conditionally include filename and caption based on media type.
- Improved error handling in media ID retrieval and audio processing methods.
- Refactored audio processing to support file uploads and URL handling more effectively.
- Enhanced logging for better error tracking during media operations.
2025-06-12 17:28:02 -03:00
Davidson Gomes
bc451e8493 feat(Typebot): add splitMessages and timePerChar fields to Typebot models
- Introduced `splitMessages` and `timePerChar` fields in the Typebot and TypebotSetting models with default values.
- Created a migration script to update the database schema accordingly.
- Updated audio message handling to prepend `[audio]` to transcriptions for better clarity in message context.
2025-06-12 13:24:25 -03:00
Davidson Gomes
1eb2c848f7 fix(chatwoot.service): add isLid parameter to service methods for enhanced functionality
- Introduced a new boolean parameter `isLid` in relevant methods to improve the handling of conversation data.
- Updated conditionals to incorporate `isLid` for more precise data management.
- Ensured backward compatibility by maintaining existing functionality while enhancing the service's capabilities.
2025-06-12 12:02:38 -03:00
Davidson Gomes
7cfc359be9 chore: update package-lock.json and refactor WhatsApp Baileys service
- Added new dependency `audio-decode` version 2.2.3.
- Introduced `@eshaz/web-worker` version 1.2.2 with its metadata.
- Refactored `userDevicesCache` initialization and various object destructuring for improved readability in `whatsapp.baileys.service.ts`.
- Streamlined multiple object property assignments for better code clarity.
- Removed deprecated `@typescript-eslint/project-service` and related packages from package-lock.json.
2025-06-12 12:01:01 -03:00
Davidson Gomes
421e762c2d fix(chatwoot.service): Ensure conversation checks are robust before toggling status
- Added null checks for conversation object in reopenConversation mode and when finding unresolved conversations.
- Improved logging for better debugging of conversation retrieval.
2025-06-12 11:18:59 -03:00
Davidson Gomes
9e1f9cbb83
Merge pull request #1574 from edisonmartinsmkt/develop
feat(audio): support LPCM and fix waveform distortion
2025-06-08 20:59:46 -03:00
edisoncm-ti
44e0ff2250 feat(audio): support LPCM and fix waveform distortion 2025-06-08 20:41:59 -03:00
Davidson Gomes
614ad7cbdf
Merge pull request #1556 from splusoficial/develop
fix: adjustment in audio transcription with official api
2025-06-06 23:10:57 -03:00
Joao Vitor
77b3b331f8 fix: adjustment in audio transcription with official api 2025-06-05 20:31:11 -03:00
Davidson Gomes
e469dc132f
Merge pull request #1536 from Daquisu/fix-fetchStatusMessage-params
Update `fetchStatusMessage` to handle empty offset / page
2025-06-03 12:40:14 -03:00
Daquisu
fa14abac5a Update fetchStatusMessage to handle empty offset / page 2025-06-01 15:22:01 -06:00
Davidson Gomes
a53e0a8694
Merge pull request #1513 from samuelterra22/patch-1
fix: change service image version and change to latest config session phone version
2025-05-28 13:53:17 -03:00
Davidson Gomes
16e4bba108 chore: update dependencies in package-lock.json and package.json
This commit updates several dependencies in the package-lock.json and package.json files to their latest versions. Key changes include:
- Upgraded various @typescript-eslint packages to version 8.33.0, ensuring compatibility and access to the latest features and fixes.
- Updated the baileys package from version 6.7.17 to 6.7.18, incorporating the latest improvements.
- Bumped the pino package version from 9.6.0 to 9.7.0 for enhanced performance and stability.
- Updated the process-warning package from version 4.0.1 to 5.0.0, which may include important updates and fixes.
- Adjusted the protobufjs package version from 7.5.2 to 7.4.0, reflecting the latest changes.

These updates contribute to improved performance, security, and maintainability of the codebase.
2025-05-28 11:44:17 -03:00
Davidson Gomes
bd19fff264
Merge branch 'develop' into patch-1 2025-05-28 11:01:17 -03:00
Samuel Terra
94285ecb90
fix: change service image version and change to latest config session phone version 2025-05-28 09:22:38 -03:00
Davidson Gomes
3500fbe27f
Merge pull request #1508 from gomessguii/develop
refactor: improve chatbot integrations
2025-05-27 18:03:44 -03:00
Guilherme Gomes
cb76381466 refactor: reorder parameters and simplify EvolutionBot DTO
This commit refines the EvolutionBot integration by reordering constructor parameters for consistency and removing unused properties from the EvolutionBotDto and EvolutionBotSettingDto classes. Key changes include:
- Adjusted the parameter order in the EvolutionBotService constructor for improved clarity.
- Streamlined the EvolutionBotDto and EvolutionBotSettingDto by eliminating unnecessary fields.

These updates enhance the maintainability and readability of the EvolutionBot integration.
2025-05-27 17:52:45 -03:00
Guilherme Gomes
98502f6555 fix: resolve build errors and audio transcription issues across chatbot services
- Add YAML file loader to tsup.config.ts to fix build compilation errors
- Fix OpenAI speechToText method signature across all chatbot services
- Correct DifyService constructor parameter order in server.module.ts and channel.service.ts
- Add missing OpenAI service dependency injection to EvoaiService
- Standardize audio transcription logic in FlowiseService to match N8N implementation
- Fix speechToText calls in WhatsApp Baileys and Evolution channel services
- Ensure consistent error handling and parameter passing for audio processing

This resolves the "Cannot read properties of undefined" errors and ensures
all chatbot integrations (OpenAI, N8N, Flowise, EvoAI, Dify, EvolutionBot)
properly handle audio message transcription using OpenAI Whisper.
2025-05-27 17:46:29 -03:00
Guilherme Gomes
3fc77e4c76 refactor: update asset references in index.html and replace CSS/JS files
This commit updates the asset references in the index.html file to point to new CSS and JS files. Key changes include:
- Replaced the old JavaScript file `index-mxi8bQ4k.js` with `index-D-oOjDYe.js`.
- Updated the CSS file reference from `index-DNOCacL_.css` to the new `index-CXH2BdD4.css`.
- Removed the old CSS and JS files to clean up the codebase.

These updates ensure that the application uses the latest styles and scripts, contributing to improved performance and maintainability.
2025-05-27 17:37:01 -03:00
Guilherme Gomes
19e291178c refactor: streamline integration checks and parameter handling in chatbot controllers
This commit refines the Flowise and Typebot integrations by simplifying the integration enablement checks in their respective controllers. Key changes include:
- Consolidated the integration checks in the createBot method of FlowiseController and startBot method of TypebotController for improved readability.
- Removed unnecessary line breaks to enhance code clarity.

These updates contribute to a cleaner and more maintainable codebase for chatbot integrations.
2025-05-27 17:26:00 -03:00
Guilherme Gomes
7682a679d1 refactor: enhance Dify integration with improved validation and message processing
This commit refines the Dify integration by updating the controller and service logic for better functionality and maintainability. Key changes include:
- Added Dify-specific validation in the createBot method to prevent duplicate entries.
- Simplified comments for clarity and removed unused methods in DifyController.
- Enhanced message processing in DifyService to handle audio messages more effectively and improve error handling.
- Updated DifyDto and DifySettingDto to streamline properties and improve clarity.

These updates contribute to a more robust and maintainable Dify integration.
2025-05-27 17:04:35 -03:00
Guilherme Gomes
97ca23a7b0 refactor: enhance Evoai integration with improved validation and message handling
This commit refines the Evoai integration by updating the service and controller logic for better functionality and maintainability. Key changes include:
- Added the `openaiService` as a parameter in the EvoaiService constructor for improved dependency management.
- Enhanced the createBot method in EvoaiController to include EvoAI-specific validation and duplicate checks.
- Updated EvoaiDto and EvoaiSettingDto to remove unnecessary comments and add a fallback property.
- Refined the message processing logic in EvoaiService to handle audio messages more effectively and improve logging clarity.
- Adjusted the schema for Evoai settings to rename `evoaiIdFallback` to `botIdFallback` for better clarity.

These updates contribute to a more robust and maintainable Evoai integration.
2025-05-27 16:00:32 -03:00
Guilherme Gomes
95bd85b6e3 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.
2025-05-27 15:49:15 -03:00
Guilherme Gomes
64fc7a05ac 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.
2025-05-27 15:10:47 -03:00
Guilherme Gomes
39aaf29d54 refactor: enhance OpenAI controller and service for better credential management
This commit refactors the OpenAIController and OpenAIService to improve credential handling and error management. Key changes include:
- Added checks to prevent duplicate API keys and names during bot creation.
- Updated the getModels method to accept an optional credential ID for more flexible credential usage.
- Enhanced error handling with specific BadRequestException messages for better clarity.
- Removed unused methods and streamlined the speech-to-text functionality to utilize instance-specific settings.

These improvements enhance the maintainability and usability of the OpenAI integration.
2025-05-27 14:32:10 -03:00
Guilherme Gomes
22e99f7934 refactor: simplify TypebotController and TypebotService methods
This commit refactors the TypebotController and TypebotService to streamline the processTypebot method, aligning it with the base class pattern. It reduces complexity by consolidating parameters and improving readability. Additionally, it updates the TypebotDto and TypebotSettingDto to remove unused properties, enhancing code clarity and maintainability.
2025-05-27 13:07:15 -03:00
Davidson Gomes
dd0dfd447c
Merge pull request #1504 from KokeroO/develop
fix: Melhora o método createConversation (evita conversas criadas duplicadas Chatwoot)
2025-05-27 08:11:34 -03:00
Willian Coqueiro
fb18267ac5 fix: eslint 2025-05-27 02:10:15 +00:00
Willian Coqueiro
fc5965938e fix: improve createConversation method with caching and locking mechanisms 2025-05-27 01:31:06 +00:00
Davidson Gomes
623efd86a2
Merge pull request #1498 from thrsouza/main
Inclusão do parâmetro frame_max para compatibilidade com RabbitMQ 4.1+
2025-05-25 11:10:40 -03:00
Thiago Souza
3297364c10 fix: update RabbitMQ frame_max parameter for 4.1+ compatibility
Updates the minimum frame_max value from 4096 to 8192 to meet the requirements
of RabbitMQ 4.1+ servers. This resolves connection failures with newer RabbitMQ
versions while maintaining backwards compatibility with older versions.
2025-05-25 03:08:12 -03:00
Davidson Gomes
373a531e88 fix: update logging and message handling in EvoaiService
This commit modifies the logging messages in the `EvoaiService` to use the correct service name "EvoAI" instead of "Dify" for better clarity. Additionally, it refines the message handling logic by changing the way message IDs are generated and updating the payload structure sent to the API. The extraction of the message from the response artifacts has also been improved to ensure that the correct message is retrieved from the response data.

Changes include:
- Updated logging statements to reflect the correct service name.
- Changed the message ID generation to use a shorter UUID substring.
- Adjusted the payload structure to include `contextId` and `messageId`.
- Enhanced message extraction logic from the response artifacts.

These changes enhance the clarity of logs and improve the robustness of message handling in the service.
2025-05-23 20:37:01 -03:00
Davidson Gomes
e081533f02 fix: remove unused Auth import from Dify and N8n services
This commit removes the unused `Auth` import from both `dify.service.ts` and `n8n.service.ts`. This change helps to clean up the code and improve readability by eliminating unnecessary dependencies.
2025-05-23 20:09:36 -03:00