Commit Graph

2289 Commits

Author SHA1 Message Date
Davidson Gomes
cf95c027eb chore: update package dependencies and scripts
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
- Changed the `baileys` dependency source from `EvolutionAPI` to `WhiskeySockets`.
- Updated the start and development server scripts to use `tsx` instead of `tsnd`.
- Added `tsx` as a new dependency and removed `ts-node-dev`.
- Updated `music-metadata` to version 11.7.1 and adjusted its dependencies.
- Cleaned up the package-lock by removing unused modules and adding new ones like `fflate` and `uint8array-extras`.
2025-07-22 18:21:46 -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
b98cd11fb1
Merge pull request #1736 from juniortopanotti/main
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
remove lógica de paginação duplicada no fetchChats que causa resultados vazios quando skip > 0
2025-07-21 13:16:22 -03: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
Gilberto Topanotti Junior
6954472070
remove lógica de paginação duplicada no fetchChats que causa resultados vazios quando skip > 0
Problema:
O método fetchChats estava aplicando a lógica de paginação duas vezes, causando resultados vazios ao usar o parâmetro skip com valores maiores que 0.
Causa Raiz:
A query SQL já aplica LIMIT e OFFSET corretamente
O código JavaScript então aplica .slice(skip, skip + take) nos resultados já paginados
Este "offset duplo" faz com que o slice tente acessar posições do array que não existem
Exemplo do bug:
Requisição: {"take": 10, "skip": 10}
SQL: LIMIT 10 OFFSET 10 → retorna chats 11-20 (10 itens)
JS: .slice(10, 20) → tenta pegar posições 10-20 de um array com apenas 10 itens
Resultado: [] (array vazio)
Solução:
Removida a lógica de paginação JavaScript redundante (linhas 796-800) já que a query SQL já manipula a paginação corretamente com LIMIT e OFFSET.
Arquivos Alterados:
src/api/services/channel.service.ts
Testes:
 {"take": 10, "skip": 0} - Retorna os primeiros 10 chats
 {"take": 10, "skip": 10} - Retorna chats 11-20 (anteriormente retornava [])
 {"take": 5, "skip": 15} - Retorna chats 16-20 (anteriormente retornava [])
Impacto:
Corrige a funcionalidade de paginação para todos os valores de skip > 0
Mantém compatibilidade com versões anteriores
Sem mudanças que quebrem implementações existentes
2025-07-18 14:20:22 -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
9fd40a411a
Merge pull request #1726 from Santosl2/feat/add-async-lock
Some checks are pending
Build Docker image / Build and Deploy (push) Waiting to run
feat: add BaileysMessageProcessor for improved message handling
2025-07-16 19:24:23 -03: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
196617507e
Merge pull request #1700 from guilherme-aguilar/guilheme_aguilar/develop
feat(database): add pgbouncer support and optimize postgres config
2025-07-14 14:51:49 -03:00
Davidson Gomes
6da71f5161
Merge pull request #1683 from pauloboc/develop
added missing migrations in mysql prisma
2025-07-14 14:51:21 -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
11520481ba
Merge pull request #1705 from KokeroO/develop
fix: Tratar conversas @lid no inicio do recebimento dos eventos e novo erro da libsignal
2025-07-14 14:43:57 -03:00
Davidson Gomes
95a53d33ef
Merge pull request #1701 from leonardocintra/patch-1
Update README.md - 2025
2025-07-14 14:43:20 -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
guilherme
e92961e7b0 feat(database): add psql_bouncer support and simplify postgresql config
- Add new psql_bouncer database provider option
- Update database scripts to handle psql_bouncer provider
- Comment out pgbouncer service in docker-compose
- Simplify postgresql schema by removing directUrl
- Add new psql_bouncer-schema.prisma file
- Update .env.example with psql_bouncer configuration
- Modify runWithProvider.js to handle psql_bouncer migrations
2025-07-10 01:08:08 -03:00
Rafael Souza
f11d490f7a Remove package-lock.json do .gititnore 2025-07-09 18:56:32 -03:00
Willian Coqueiro
37319966db Remove redudantent code 2025-07-09 18:42:35 +00:00
Willian Coqueiro
630f5c5624 fix:
- [Baileys] Trocar @lids em remoteJid por senderPn em todos os serviços;
 - [Baileys] Adicionar valor @lid recebido em remoteJid para previousRemoteJid (Posteriormente utilizasse em ChatwootService);
 - Minors fixes;
2025-07-09 18:35:57 +00:00
Leonardo Nascimento Cintra
3e690fe9e2
Update README.md - 2025 2025-07-08 20:00:42 -03:00
guilherme
09429e68fe docs: update database name in .env.example from evolution to evolution_db 2025-07-08 18:09:59 -03:00
Rafael Souza
9acccf723d Throw exception if download media fail 2025-07-08 17:43:21 -03:00
guilherme
3b920f93c5 feat(database): add pgbouncer support and optimize postgres config
- Add pgbouncer service to handle connection pooling
- Update database connection URIs to support direct and pooled connections
- Optimize postgres configuration with better memory settings
- Update prisma schema to support directUrl connection
2025-07-08 17:14:37 -03:00
foqc
85936dcaed feature: Correctly map SQL query results by enforcing quoted column aliases (update missing mappings) 2025-07-07 17:40:30 -05:00
foqc
333ef3eeb8 feature: Correctly map SQL query results by enforcing quoted column aliases 2025-07-07 17:31:49 -05:00
Paulo Ferreira
8dd51b0302 added missing migrations in mysql prisma 2025-07-03 15:20:03 -03:00
Davidson Gomes
e6ec706a38
Merge pull request #1665 from pauloboc/fix-prisma-type-mysql
Fix prisma type mysql
2025-07-02 11:22:48 -03:00
Davidson Gomes
53101d4571
Merge pull request #1664 from pauloboc/fix-setup-mysql
(mysql): remove out-of-order wavoipToken migration
2025-07-01 08:15:26 -03:00
Davidson Gomes
c7b5abce6e
Merge pull request #1670 from Santosl2/fix/typebot-variables
fix: correçao do typebot não conseguir ouvir mensagens de input
2025-07-01 08:14:28 -03:00
Santosl2
5b1b5ff9d2
fix: bind applyFormatting method in processMessages to maintain context 2025-06-29 20:23:31 -03:00
Paulo Ferreira
3efe69ada3 fix(prisma) Mysql: update data types for N8n, N8nSetting, Evoai, and EvoaiSetting models 2025-06-28 09:34:52 -03:00
Paulo Ferreira
287c679ce4 (mysql): remove out-of-order wavoipToken migration
Delete prisma/mysql-migrations/1707735894523_add_wavoip_token_to_settings_table, which executes before the initial Setting table is created and breaks fresh MySQL installs.

The later migration 20250214181954_add_wavoip_token_column, line 145, already adds the column correctly, so keeping only that directory guarantees a clean deploy.
2025-06-28 09:27:13 -03:00