Commit Graph

1308 Commits

Author SHA1 Message Date
Davidson Gomes
d342a7b621 chore: Refactor WAMonitoringService instance retrieval and improve code readability
Refactored WAMonitoringService to retrieve instances using Prisma's `findMany` method with a dynamic `where` clause.
This change simplifies the code and makes it more maintainable.
It also removes the deprecated `for...of` loop and the unnecessary instantiation of objects.
The new implementation provides better performance and is more aligned with the current best practices.

Modified files:
- src/api/services/monitor.service.ts
2024-06-26 19:27:06 -03:00
Davidson Gomes
b70ab5a4c3 fix: Update message function to support different message types
The updateMessage function was updated to support different message types such as text, image, and video.
A new private function formatUpdateMessage was added to handle the logic of formatting the message based on its type.
The function checks the message type and returns the corresponding format for the message.
If the message type is not supported, it will return null and throw a BadRequestException.
The createJid function is now called in the updateMessage function to get the jid of the recipient.
This change improves the flexibility of the updateMessage function and ensures that it can handle different types of messages.
2024-06-26 18:23:18 -03:00
Davidson Gomes
6cb3357f08 fix: Correction in WhatsApp sticker sending
Corrected an issue where stickers were not being sent properly in WhatsApp channels. The bug was caused by a mistake in the 'src/api/services/channels/whatsapp.baileys.service.ts' file. This fix resolves the problem and ensures that stickers are sent correctly in WhatsApp channels.
2024-06-26 17:52:51 -03:00
Davidson Gomes
99f4fe2e43 fix: Ghost emoji correction in message sending
Corrects an issue where a ghost emoji was being displayed in message sending. The 'Mentions' class was removed and its properties were moved to the 'Options' class. The 'everyOne' and 'mentioned' properties were replaced by 'mentionsEveryOne' and 'mentioned', respectively. This change improves the code readability and maintainability.

The affected files are:
- src/api/dto/sendMessage.dto.ts
- src/api/services/channels/whatsapp.baileys.service.ts
- src/api/services/channels/whatsapp.business.service.ts
2024-06-26 17:27:38 -03:00
Davidson Gomes
0ded76d366 chore: Recover lost messages from cache in WhatsApp Baileys service 2024-06-26 16:57:55 -03:00
Davidson Gomes
a737fed5cb chore: Updated WhatsApp baileys service
Modified the WhatsApp baileys service to improve the overall functionality. This change aims to enhance the user experience and maintain code quality.

Please note that only the 'src/api/services/channels/whatsapp.baileys.service.ts' file has been modified.
2024-06-26 16:13:21 -03:00
Davidson Gomes
79cadadcc7 chore: Update group metadata cache (#GI234)
- Updated the group metadata cache to improve performance.
- Added verbose logging for cache updates and requests.
- Affected file: `whatsapp.baileys.service.ts`.

Please note that this change does not alter the functionality or behavior of the application. It is a maintenance task to optimize cache management.
2024-06-26 15:38:04 -03:00
Davidson Gomes
75922e603b chore: Update group metadata cache on participants update
Refactored WhatsappBaileysService to update group metadata cache when a participants update event is triggered. This will improve the accuracy of the group metadata and ensure that it stays up-to-date with the latest changes in the group.

Modified:
- src/api/services/channels/whatsapp.baileys.service.ts
2024-06-26 15:23:06 -03:00
Davidson Gomes
d0eee796ba fix: Resolve generation of pairing code
In this commit, we have fixed an issue related to the generation of the pairing code. The changes include modifying the `whatsapp.baileys.service.ts` file, where we have updated the `connectToWhatsapp` method to accept a phone number parameter. Additionally, we have made changes to the `browser` variable to handle phone number and browser options. These changes improve the reliability of the pairing code generation.
2024-06-26 13:55:11 -03:00
Davidson Gomes
47d6fd5d31 chore: Update privacy settings, refactor code and improve performance
In this commit, several changes were made to improve the codebase and update privacy settings. Specifically, the following changes were made:

- The `PrivacySetting` class was refactored to `PrivacySettingDto` in `chat.dto.ts`.
- The `put` method was changed to `post` in `chat.router.ts` for updating the profile picture.
- Several methods in `channel.service.ts` were refactored to improve performance and readability. Specifically, the `setWebhook`, `setRabbitmq`, `setSqs`, `fetchContacts`, and `fetchMessages` methods were improved.
- The `updatePrivacySettings` method in `whatsapp.baileys.service.ts` was refactored to reduce complexity and improve readability.

These changes were made to improve the overall performance and maintainability of the codebase. Additionally, the privacy settings for the WhatsApp client were updated to provide better control over user data.
2024-06-26 08:08:12 -03:00
Davidson Gomes
4120318ec4 feat: update dependencies and improve channel services
Updated dependencies in package.json to ensure compatibility and performance. Enhanced functionality in channel.service.ts and whatsapp.baileys.service.ts for better service handling and reliability. This update aims to improve overall system stability and performance.
2024-06-18 11:28:10 -03:00
Davidson Gomes
4349959daa
Merge pull request #647 from francisbreit/evolution-api-v2.0.0-alpha-fr1
Update criador_de_inbox.json for Evolution v2.0
2024-06-17 14:28:38 -03:00
Davidson Gomes
549224ac16 fix: update WhatsApp Baileys service
Modified the WhatsApp Baileys service in channels to fix an issue. This change addresses a bug that was causing incorrect message handling. The update ensures more reliable communication through the WhatsApp API.
2024-06-17 13:48:46 -03:00
Davidson Gomes
d45e303d55 fix: add TypeScript types to use-multi-file-auth-state-prisma.ts functions
Added TypeScript types to functions in use-multi-file-auth-state-prisma.ts to improve type safety and code readability. This change helps catch type-related errors during development and enhances the maintainability of the codebase.
2024-06-17 13:42:18 -03:00
Davidson Gomes
85106667a2 feat: update message sending logic
Refactored sendMessage.controller.ts, chat.dto.ts, and sendMessage.dto.ts to improve message handling. Updated chatwoot.service.ts and sendMessage.router.ts for better integration with Chatwoot. Enhanced whatsapp.baileys.service.ts for more reliable WhatsApp communication. Adjusted chat.schema.ts and message.schema.ts for validation improvements. These changes enhance the overall messaging functionality and reliability.
2024-06-15 12:46:52 -03:00
Francis Breit
371ab944b3
Update criador_de_inbox.json for Evolution v2.0
Update criador_de_inbox.json for Evolution v2.0
2024-06-14 13:16:42 -03:00
Davidson Gomes
2d49c73023 fix: add validation to prevent group calls in whatsapp.baileys.service.ts
Added a check to prevent group calls by throwing a BadRequestException when a group JID is detected. This change ensures that only individual calls are processed, preventing unsupported group call attempts and improving error handling.
2024-06-14 09:45:02 -03:00
Davidson Gomes
92a0d8ccc9 feat: update API routes and services for better cache handling
Modified instance.router.ts to change HTTP method from PUT to POST for 'restart' route. Updated whatsapp.baileys.service.ts to correct cache configuration logic, ensuring proper usage of cached group metadata. Removed obsolete Typebot-related schema definitions from instance.schema.ts for cleaner validation. These changes improve API functionality and maintainability.
2024-06-14 09:25:18 -03:00
Davidson Gomes
7dfc09ff16 feat: update Baileys library and add fake call feature
Updated the Baileys library reference in package.json and refactored imports across multiple files to use the new library. Added a new feature to handle fake calls in sendMessage.controller.ts and related DTOs. This change improves the integration with the Baileys library and introduces the ability to simulate calls, enhancing the testing capabilities. Main files modified: package.json, instance.controller.ts, sendMessage.controller.ts, chat.dto.ts, instance.dto.ts, sendMessage.dto.ts, chatwoot.service.ts, chatwoot-import-helper.ts, sendMessage.router.ts, cache.service.ts, channel.service.ts, whatsapp.baileys.service.ts, whatsapp.business.service.ts, wa.types.ts, rediscache.ts, use-multi-file-auth-state-prisma.ts, use-multi-file-auth-state-provider-files.ts, use-multi-file-auth-state-redis-db.ts, message.schema.ts.
2024-06-14 08:44:19 -03:00
Davidson Gomes
61d6ddfa81 fix: update default values for WA_BUSINESS configuration
Updated the default values for TOKEN_WEBHOOK, URL, and VERSION in the WA_BUSINESS configuration. This change ensures that the application has more meaningful default settings, improving the initial setup experience. The impact is limited to default behavior when environment variables are not set.
2024-06-13 18:53:20 -03:00
Davidson Gomes
06ba1fd17b chore: update baileys version in package.json
Updated the baileys version in package.json to ensure compatibility with the latest features and bug fixes. This change is necessary to maintain the stability and performance of the application.
2024-06-12 18:56:17 -03:00
Davidson Gomes
f1c31a70bc fix: adjust settings in whatsapp.baileys.service.ts
Increased retryRequestDelayMs, added maxMsgRetryCount, and updated connectTimeoutMs and qrTimeout values for better performance. Adjusted transactionOpts for more efficient retries. These changes aim to enhance connection stability and message handling efficiency.
2024-06-12 18:39:57 -03:00
Davidson Gomes
7799e6626f fix: baileys ignore newsletter 2024-06-12 15:42:37 -03:00
Davidson Gomes
aa79c1bfd7 feat: tagging in chatwoot contact by instance 2024-06-12 15:18:37 -03:00
Davidson Gomes
7451b0d1e3 feat: tagging in chatwoot contact by instance 2024-06-12 15:18:26 -03:00
Davidson Gomes
18d4c68025 fix: messageId baileys 2024-06-12 11:23:51 -03:00
Davidson Gomes
a7887f0b1c fix: messageId baileys 2024-06-12 09:55:40 -03:00
Davidson Gomes
fa14b7b1a9 feat: Added debounce time for typebot messages 2024-06-11 17:56:45 -03:00
Davidson Gomes
2776f113cb feat: Added debounce time for typebot messages 2024-06-11 17:56:20 -03:00
Davidson Gomes
0bf8e55144 fix: provider variables are no longer mandatory in the env 2024-06-11 13:06:35 -03:00
Davidson Gomes
87c68df0f6 fix: provider variables are no longer mandatory in the env 2024-06-11 12:40:00 -03:00
Davidson Gomes
f551242e86 fix: reply message 2024-06-11 11:07:49 -03:00
Davidson Gomes
31258a9b85 feat: Organization configuration and logo in chatwoot bot contact 2024-06-11 10:09:04 -03:00
Davidson Gomes
a8937bd8b1 fix: get message id for typebot 2024-06-10 18:32:05 -03:00
Davidson Gomes
fa3306b0f4 adjusts in typebot 2024-06-10 16:38:11 -03:00
Davidson Gomes
4824ccafd6 fix: get base64 for media message 2024-06-10 15:55:40 -03:00
Davidson Gomes
f40cdb62ba fix: get message id for typebot 2024-06-10 15:48:48 -03:00
Davidson Gomes
8c6e1a579f fix: reply with media message 2024-06-10 15:15:13 -03:00
Davidson Gomes
95022578ba fix: reply with media message 2024-06-10 15:03:41 -03:00
Davidson Gomes
99999eae5d fix: reply with media message 2024-06-10 14:50:03 -03:00
Davidson Gomes
2eb09c1853 fix: reply with media message 2024-06-10 14:49:46 -03:00
Davidson Gomes
99ebb81838 chore: Dockerfile 2024-06-10 14:16:40 -03:00
Davidson Gomes
6d6f7293f9 fix: audio convertion with stream to mp4 2024-06-10 14:01:07 -03:00
Davidson Gomes
9cd50833cf fix: audio convertion with stream 2024-06-10 13:15:24 -03:00
Davidson Gomes
c1cbc0d30c test: audio convertion 2024-06-10 13:01:38 -03:00
Davidson Gomes
ed6e28744e test: audio convertion 2024-06-10 12:34:06 -03:00
Davidson Gomes
28e5b2f65e fix: instances 2024-06-10 11:52:19 -03:00
Davidson Gomes
4879bdb527 fix: instances 2024-06-10 11:33:36 -03:00
Davidson Gomes
7ebf237c1c fix: init store folders 2024-06-10 11:28:28 -03:00
Davidson Gomes
21d984969a fix: Correction of audio sending, now we can speed it up and have the audio wireframe 2024-06-10 07:45:43 -03:00