Commit Graph

1609 Commits

Author SHA1 Message Date
Davidson Gomes
55822f9443 style: improve code formatting for better readability in WhatsApp service files 2025-09-17 14:30:27 -03:00
Davidson Gomes
00780157db style(sqs): format messageGroupId assignment for improved readability 2025-09-17 14:27:19 -03:00
Davidson Gomes
b514fab30e fix: address Path Traversal vulnerability in /assets endpoint by implementing security checks 2025-09-17 14:27:19 -03:00
Davidson Gomes
7ba878742e
Merge pull request #1897 from nolramaf/feat/validate-video-type-before-uploading-to-s3
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
feat/validate video type before uploading to S3
2025-09-17 14:27:03 -03:00
Davidson Gomes
d998baa839
Merge pull request #1896 from nolramaf/feat/add-global-sqs-mode
feat/add global SQS mode with single-queue-per-event and payload size control
2025-09-17 14:26:15 -03:00
Davidson Gomes
e75dae38ee
Merge pull request #1947 from elizandropacheco/feat/prometheus-metrics
Feat/prometheus metrics
2025-09-17 14:25:22 -03:00
Davidson Gomes
1fabb1f3bd
Merge pull request #1951 from Nocelli/develop
feat: add extra fields to object sent to Flowise bot
2025-09-17 14:23:52 -03:00
Elizandro Pacheco
edfcb0c082 style(metrics): linted index.router.ts after eslint --fix 2025-09-17 12:05:30 -03:00
Davidson Gomes
827604644b
Merge pull request #1918 from ricaelchiquetti/main
feat: implement standardized error handling for WhatsApp API responses
2025-09-17 11:40:23 -03:00
Rafael Nocelli Soares
481e179cc5
feat: add extra fields to object sent to Flowise bot 2025-09-17 10:49:13 -03:00
ricael
ab4bec3b54 Merge branch 'develop' into main 2025-09-17 08:50:39 -03:00
furious
3eeffe4586 fix: convert mediaKey from media messages to avoid bad decrypt errors 2025-09-16 23:02:36 -03:00
Elizandro Pacheco
0e737d48c1 chore(metrics): use 'unknown' as fallback for clientName label 2025-09-16 19:40:21 -03:00
Elizandro Pacheco
875b874a7b feat: add Prometheus-compatible /metrics endpoint (gated by PROMETHEUS_METRICS) 2025-09-16 19:35:23 -03:00
Davidson Gomes
486645fb08 chore: update Baileys dependency to version 7.0.0-rc.3 and improve message key handling in WhatsApp service
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-09-15 16:21:33 -03:00
Davidson Gomes
d31d6fa554 refactor: replace JSON path queries with raw SQL in Baileys and Chatwoot services to improve message retrieval and update logic
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
2025-09-09 16:18:15 -03:00
Davidson Gomes
edbf36019e
Merge pull request #1929 from moothz/main
Customizable Websockets Security
2025-09-09 16:06:31 -03:00
moothz
d67eb3202b Fix lint 2025-09-09 15:46:26 -03:00
moothz
0aa6c96765 Customizable Websockets Security
Enables the option to specify safe remote addresses using WEBSOCKET_ALLOWED_HOSTS enviroment variables. Defaults to the secure only localhost.
2025-09-09 14:56:11 -03:00
Davidson Gomes
8619e320bc
Merge pull request #1928 from josiasmaceda/hotfix/chatbot-not-return-after-human
fix: allowing the chatbot return after the time expires and after human interaction (stopBotFromMe)
2025-09-09 14:33:20 -03:00
Davidson Gomes
5015cfbc9d
Merge pull request #1927 from josiasmaceda/hotfix/change-typebot-status-webhook
fix: integrate Typebot status change events for webhook in chatbot controller e service
2025-09-09 14:31:57 -03:00
Josias Maceda
cf548eedbe fix: lint with npm run lint 2025-09-09 14:19:54 -03:00
Josias Maceda
b9ae40145d fix: the lint with npm run lint 2025-09-09 14:15:16 -03:00
Josias Maceda
bc9724a929 fix: remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe) 2025-09-09 13:54:53 -03:00
Davidson Gomes
21502b996d fix: enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service 2025-09-09 12:50:51 -03:00
Davidson Gomes
d9c04fc866
Merge pull request #1906 from andres99x/enhancmenet/check-chatwoot-cron-id
fix: Prevent Duplicate Cron Jobs for Chatwoot Message Sync
2025-09-09 12:20:27 -03:00
Davidson Gomes
d6a76a096d
Merge pull request #1908 from dersonbsb2022/main
feat: implement disable/enable linkPreview support for Evolution Bot
2025-09-09 12:19:57 -03:00
Josias Maceda
0116bc4c9f fix: integrate Typebot status change events for webhook in chatbot controller and service 2025-09-09 11:49:13 -03:00
Davidson Gomes
6da79f0313 chore: update CHANGELOG for Baileys v7.0.0-rc.2 and implement message content sanitization in Baileys service
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
2025-09-08 19:53:52 -03:00
Davidson Gomes
8830f476e8 chore: bump version to 2.3.3 in package-lock.json and update remoteJid handling in Baileys service
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
2025-09-08 15:48:38 -03:00
ricael
05fcdd9ffc refactor: melhora na formatação do log de erro da API do WhatsApp 2025-09-08 14:45:33 -03:00
Davidson Gomes
3ecf288daf
Revert "Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE)" 2025-09-08 14:45:29 -03:00
ricael
16c0a8033f add stringify 2025-09-08 14:36:09 -03:00
ricael
79438c9445 refactor: lint fix 2025-09-08 09:11:45 -03:00
ricael
10a2c001ab feat: implement standardized error handling for WhatsApp API responses 2025-09-08 08:48:49 -03:00
Marlon Alves
7486d22ed1 feat/change variable messageGroupId 2025-09-05 07:18:07 -03:00
Anderson Silva
4f13a8ac28 style: clean up code formatting for linkPreview implementation
- Remove unnecessary trailing whitespace
- Use shorthand property syntax for linkPreview parameter
- Apply ESLint formatting standards
- Maintain code consistency and readability
2025-09-04 14:35:56 -03:00
Anderson Silva
1be58c8487 refactor: improve linkPreview implementation based on PR feedback
- Default linkPreview to true when not specified for backward compatibility
- Validate linkPreview is boolean before passing to textMessage
- Consolidate debug logs and remove sensitive data from logging
- Sanitize API keys in debug output ([REDACTED])
- Reduce log verbosity while maintaining debugging capability
- Ensure robust fallback behavior for malformed responses

Addresses PR feedback regarding:
- Backward compatibility preservation
- Security considerations in logging
- Input validation and error handling
2025-09-04 12:19:51 -03:00
Andres Pache
613d486fc2 stop tasks with missmatch cronId 2025-09-04 09:03:52 -03:00
Marlon Alves
025b183ebf feat/change variable GROUP_UPDATE to GROUPS_UPDATE 2025-09-04 03:18:35 -03:00
Anderson Silva
02b81beb7a feat: implement linkPreview support for Evolution Bot
- Add linkPreview extraction from webhook/n8n response
- Implement linkPreview parameter in textMessage calls
- Add debug logging for linkPreview functionality
- Support for disabling link previews when linkPreview: false
- Add comprehensive documentation for linkPreview feature

Usage:
- Return { "message": "text", "linkPreview": false } from webhook to disable preview
- Return { "message": "text", "linkPreview": true } from webhook to enable preview
- Omit linkPreview for default WhatsApp behavior
2025-09-03 16:08:15 -03:00
Andres Pache
43cc6d3608 check cronId before executing syncChatwootLostMessages 2025-09-03 12:16:00 -03:00
Marlon Alves
edb4fa3b3e feat/force MessageGroupId 2025-09-03 06:21:24 -03:00
Marlon Alves
17120e91a4 feat/force MessageGroupId 2025-09-03 05:57:18 -03:00
Marlon Alves
23cd6d2fd8 feat/force to save all evolution events in a single SQS queue 2025-09-02 17:44:44 -03:00
nolramaf
9ab6f9ad76
Update src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-09-01 19:50:08 -03:00
nolramaf
9beb38d807
Update src/config/env.config.ts
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-09-01 19:50:01 -03:00
nolramaf
e48e878b4f
Update src/api/integrations/channel/meta/whatsapp.business.service.ts
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-09-01 19:49:55 -03:00
Marlon Alves
293f655274 feat/validate video type before uploading to S3 2025-09-01 19:41:56 -03:00
Marlon Alves
cca929e7fc feat/add global SQS mode with single-queue-per-event and payload size control 2025-09-01 19:18:55 -03:00
Davidson Gomes
20352e77ef
Merge pull request #1878 from LuisSantosJS/reconnect-rabbitmq
Reconnect rabbitmq
2025-08-29 07:16:13 -03:00
nestordavalos
57b19d85d5 feat(whatsapp): Convert outgoing images to JPEG before sending
All images sent via the Baileys integration are now pre-processed and converted to JPEG format using the `sharp` library. This ensures better compatibility and prevents potential issues with unsupported formats.

- Images from URLs are now downloaded via axios before processing, which allows for the use of a proxy.
- The default filename and mimetype are updated to `image.jpg` and `image/jpeg` to reflect the conversion.
2025-08-28 00:17:15 -03:00
luissantosjs
b325500310 improve rabbit controller 2025-08-26 19:15:59 +01:00
luissantosjs
4681576cfc up 2025-08-22 22:49:40 +01:00
luissantosjs
7a99fba556 feat: enhance RabbitMQ controller with improved connection management and shutdown procedures 2025-08-20 12:29:45 +01:00
Davidson Gomes
33a922995b
Merge pull request #1838 from bilaliqbalr/patch-2
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
Added key id into webhook payload in n8n service
2025-08-15 12:49:10 -03:00
Bilal Iqbal
74cb65c4ea
Added key id into webhook payload in n8n service 2025-08-14 00:51:41 +05:00
Davidson Gomes
af423cef28
Merge pull request #1793 from henrybarreto/feat/add-support-socks-proxy
feat: add support to socks proxy
2025-08-07 08:22:00 -03:00
Davidson Gomes
40ce6b56ca
Merge pull request #1790 from henrybarreto/feat/improve-test-proxy-error
feat: enhance logging for proxy testing errors
2025-08-07 08:21:48 -03:00
Henry Barreto
ab9e0edad6
feat: enhance logging for proxy testing errors
This commit improves the logging in the testProxy method of the
ProxyController class. Now, when an Axios error occurs, the specific
error message will be logged if available. For unexpected errors, the
error object is included for better insight.

For reference, see the "message" field in the Axios documentation:
[Axios Error Handling](https://axios-http.com/docs/handling_errors).
2025-08-05 07:08:49 -03:00
Henry Barreto
3390958314
feat: add support to socks proxy 2025-08-05 07:08:00 -03:00
Davidson Gomes
a8343a8739
Merge pull request #1802 from frieck/main
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
Securing websockets
2025-08-04 19:18:30 -03:00
Felipe Augusto Rieck
fb11f3f99c Code quality 2025-08-04 18:19:14 -03:00
Felipe Augusto Rieck
d4eb61f64d Improving localhost check 2025-08-04 18:14:33 -03:00
Felipe Augusto Rieck
4f043f9576 Securing websockets 2025-08-04 16:34:20 -03:00
William Dumes
79f4a22217 refactor: lint check 2025-08-04 13:56:16 -03:00
William Dumes
fe8280ab7b Merge branch 'main' of github.com:apresentame/evolution-api into fix/webhook_event 2025-08-01 09:41:28 -03:00
William Dumes
bc11d0f751 fix: corrigido delete de mensagem quando nao salvo no banco de dados 2025-07-31 17:27:06 -03:00
Davidson Gomes
b5c67774dc chore: remove CONFIG_SESSION_PHONE_VERSION and update related code
- Removed the CONFIG_SESSION_PHONE_VERSION environment variable from the configuration and Docker files.
- Updated the BaileysStartupService to directly fetch the latest WhatsApp Web version without relying on the removed environment variable.
- Adjusted the index router to reflect the changes in the WhatsApp Web version retrieval.
2025-07-29 09:20:08 -03:00
William Dumes
6101c8d651 fix: corrigido disparo de eventos quando nao usa a opcao da ENV de salvar mensagens no banco 2025-07-25 17:08:14 -03:00
Davidson Gomes
c66485ef98
Merge pull request #1748 from coreh/fix-url-corruption-querystring
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
Avoid corrupting media URLs with query strings
2025-07-25 16:56:06 -03:00
Willian Coqueiro
23f54d1d96 lint 2025-07-25 12:13:56 +00:00
Willian Coqueiro
5191438acf fix: update error handling messages and correct group parameter in createContact method 2025-07-25 12:02:17 +00:00
Marco Buono
96d3ec2017 fix: avoid corrupting URLs with query strings 2025-07-23 16:06:14 -03:00
Davidson Gomes
9b7ca4bfb7
Merge pull request #1743 from foqc/foqc/develop
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
Add  endpoint to retrieve chat data by remoteJid
2025-07-21 16:13:59 -03:00
foqc
d490f8f576 feature: run lint to clean up codebase 2025-07-21 12:26:08 -05:00
foqc
68e847d10e feature: add endpoint to retrieve chat data by phone number 2025-07-21 12:21:45 -05:00
Davidson Gomes
5386d7171b
Merge pull request #1732 from rafwell/testmsg
Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE)
2025-07-21 13:15:38 -03:00
Davidson Gomes
f59cae7ee2
Merge pull request #1729 from ricaelchiquetti/main
improv: Ajustado isEmoji para aceitar todos os emojis.
2025-07-21 13:15:17 -03:00
Davidson Gomes
0e358cf9c1
Merge pull request #1696 from foqc/foqc/develop
Preserve alias casing in chat fetch query
2025-07-21 13:14:33 -03:00
Rafael Souza
afd0e01ddb fix lint 2025-07-17 15:59:33 -03:00
Rafael Souza
b3dae7a68e Ignore events that are not messages 2025-07-17 15:40:31 -03:00
Rafael Souza
44d4781f6f Ignore events that are not messages 2025-07-17 15:37:37 -03:00
Rafael Souza
e304b1dcdf Fix erro key 2025-07-17 15:32:25 -03:00
Rafael Souza
f8f2153cb4 Fix erro key 2025-07-17 15:29:04 -03:00
Davidson Gomes
cdef7dc9f9
Merge pull request #1728 from KokeroO/develop
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
Fix: [Chatwoot] Corrige mensagens editas
2025-07-17 11:55:55 -03:00
ricael
85798b209c improv: remover o emojiRefex() da função isEmoji. 2025-07-17 09:43:52 -03:00
ricael
71ebecbed3 improv: ajustado a validação aceitar todos os emojis. 2025-07-17 09:17:06 -03:00
Willian Coqueiro
419300b31f refactor: simplify edited message check in BaileysStartupService 2025-07-17 02:24:21 +00:00
Davidson Gomes
d98fa5259e
Merge branch 'develop' into feat/add-async-lock 2025-07-16 19:22:44 -03:00
Santosl2
05886ec684
feat: enhance message processing with retry logic for error handling 2025-07-15 21:41:25 -03:00
Santosl2
89d4d341f6
feat: add BaileysMessageProcessor for improved message handling and integrate rxjs for asynchronous processing 2025-07-15 21:35:25 -03:00
foqc
1ca829c00b feature: run lint to clean up codebase 2025-07-15 16:40:17 -05:00
Davidson Gomes
e321609b93 refactor: Simplify conditional check for contact updates in ChatwootService
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-07-14 14:52:02 -03:00
Davidson Gomes
5d0278a589
Merge branch 'develop' into foqc/develop 2025-07-14 14:46:36 -03:00
Davidson Gomes
2fb3eac383
Merge pull request #1715 from AlexisJusviack/fix/getBase64-template-support
Fix: Support media extraction from templateMessage in getBase64FromMediaMessage
2025-07-14 14:44:43 -03:00
Davidson Gomes
4a5696eda9
Merge pull request #1704 from rafwell/develop
Throw exception if download media fail
2025-07-14 14:44:29 -03:00
Davidson Gomes
d458c978f3
Merge branch 'develop' into develop 2025-07-14 14:42:18 -03:00
AlexisJusviack
bd35d7977c
Fix: Support media extraction from templateMessage in getBase64FromMediaMessage
### Fix: Add support for templateMessage media in getBase64FromMediaMessage

#### What this does
Adds support to download media from `templateMessage` structures in `getBase64FromMediaMessage`, by checking for `hydratedTemplate` and `hydratedFourRowTemplate`.

#### Why it's needed
Currently, media inside templates (e.g. `imageMessage`, `videoMessage`, `documentMessage`) is not processed by the method, which leads to errors or media being skipped.

#### How it works
If a `templateMessage` is detected, the code looks into the inner hydrated template and assigns the correct `mediaMessage` and `mediaType`. Then it proceeds as usual with the download logic.

#### Example message
```json
{
  "message": {
    "templateMessage": {
      "hydratedTemplate": {
        "imageMessage": {
          "mimetype": "image/jpeg",
          "fileLength": 123456,
          "url": "https://..."
        }
      }
    }
  }
}
2025-07-11 23:50:58 -03:00
Willian Coqueiro
37319966db Remove redudantent code 2025-07-09 18:42:35 +00:00