Compare commits

...

78 Commits

Author SHA1 Message Date
Davidson Gomes
c2085b59ea Merge branch 'release/2.3.2'
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-09-02 13:33:39 -03:00
Davidson Gomes
2513f96178 chore: bump version to 2.3.2 in package.json and package-lock.json
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-09-02 13:33:34 -03:00
Davidson Gomes
70a2c18146 Merge branch 'release/2.3.2' 2025-09-02 10:53:10 -03:00
Davidson Gomes
b8953f1431 chore: update CHANGELOG for version 2.3.2
- Added support for socks proxy.
- Included key id in webhook payload for n8n service.
- Enhanced RabbitMQ controller with improved connection management and shutdown procedures.
- Converted outgoing images to JPEG format before sending with Chatwoot.
- Updated baileys dependency to version 6.7.19.
2025-09-02 10:53:00 -03:00
Davidson Gomes
a91a4ad19c Merge pull request #1889 from codingbox2022/main
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
update version
2025-09-01 11:00:37 -03:00
Davidson Gomes
00ba227e15 chore: update baileys dependency to version 6.7.19 2025-09-01 10:43:12 -03:00
codingbox2022
c02d37028b Merge branch 'main' into main 2025-08-29 22:08:52 -05:00
Davidson Gomes
14771ab84e Merge pull request #1851 from caiquezanetoni/patch-1
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
Update 20250116001415_add_wavoip_token_to_settings_table
2025-08-29 07:17:02 -03:00
Davidson Gomes
20352e77ef Merge pull request #1878 from LuisSantosJS/reconnect-rabbitmq
Reconnect rabbitmq
2025-08-29 07:16:13 -03:00
Davidson Gomes
78f7618d04 Merge pull request #1884 from nestordavalos/feat/whatsapp/convert-to-jpeg
Feat/whatsapp/convert-to-jpeg
2025-08-29 07:14:56 -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
Caíque Zanetoni Fim
6e652d6ea2 Update migration.sql 2025-08-18 08:43:21 -03: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
f9c4255500 Merge pull request #1809 from neto-developer/patch-1
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
docs(readme): corrigidos badge Docker image no README
2025-08-07 08:22:26 -03: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
Neto, Aristides da Silva
4945345519 docs(readme): corrigidos badge Docker image no README
Corrigida formatação do badge Docker image no README
2025-08-05 22:07:20 -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
Davidson Gomes
dab66fc8c8 Merge pull request #1786 from bilaliqbalr/patch-1
Fixed boolean and integer type attributes for MySQL
2025-08-04 19:17:49 -03:00
Davidson Gomes
03a44cf9b2 Merge pull request #1798 from apresentame/fix/webhook_event
Permitir correta utilização da evolution quando mensagens não são persistidas no DB
2025-08-04 18:52:58 -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
20dd1b1660 Merge branch 'develop' of github.com:apresentame/evolution-api into fix/webhook_event 2025-08-04 13:52:07 -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
Bilal Iqbal
095e435561 Fixed boolean and integer type attributes 2025-07-31 14:26:05 +05:00
Davidson Gomes
96f4b80d46 Merge branch 'release/2.3.1' into develop
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-07-29 09:20:29 -03:00
Davidson Gomes
9cdb897a0f Merge branch 'release/1.3.1'
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
2025-07-29 09:20:16 -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
Davidson Gomes
7f8293f4c6 changelog: v2.3.1 2025-07-29 09:16:19 -03:00
William Dumes
a62f9ebe46 chore: voltar porta do dockerfile 2025-07-28 11:19:07 -03:00
William Dumes
69726f0dc2 fix(evo): melhorado controle de recebimento do ack das msgs 2025-07-28 09:24:22 -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
Davidson Gomes
4a25cd1ff7 Merge pull request #1757 from KokeroO/develop
fix: atualizar o handle de erros de eventos
2025-07-25 16:54:28 -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
cf95c027eb chore: update package dependencies and scripts
Some checks failed
Build Docker image / Build and Deploy (push) Has been cancelled
- 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
codingbox2022
192c34caa0 Update docker-compose.yaml 2025-07-17 12:47:36 -05: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
foqc
1ca829c00b feature: run lint to clean up codebase 2025-07-15 16:40:17 -05:00
Davidson Gomes
5d0278a589 Merge branch 'develop' into foqc/develop 2025-07-14 14:46:36 -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
codingbox2022
505490d237 Update docker-compose.yaml 2025-06-28 22:36:21 -05:00
codingbox2022
675745ae3c Update docker-compose.yaml 2025-06-28 22:28:42 -05:00
codingbox2022
6dfbfe2d83 Update docker-compose.yaml 2025-06-28 22:27:42 -05:00
codingbox2022
1c247498d8 Update docker-compose.yaml 2025-06-28 22:25:44 -05:00
codingbox2022
419324837c Update docker-compose.yaml 2025-06-28 22:05:12 -05:00
codingbox2022
17f97fb051 Update docker-compose.yaml 2025-06-28 22:03:45 -05:00
codingbox2022
f7e7a6c901 Update docker-compose.yaml 2025-06-28 22:02:34 -05:00
codingbox2022
b35b33ca50 Update docker-compose.yaml 2025-06-28 22:00:52 -05:00
21 changed files with 633 additions and 589 deletions

View File

@@ -1,4 +1,22 @@
# 2.3.1 (develop) # 2.3.2 (2025-09-02)
### Features
* Add support to socks proxy
### Fixed
* Added key id into webhook payload in n8n service
* Enhance RabbitMQ controller with improved connection management and shutdown procedures
* Convert outgoing images to JPEG before sending with Chatwoot
* Update baileys dependency to version 6.7.19
# 2.3.1 (2025-07-29)
### Feature
* Add BaileysMessageProcessor for improved message handling and integrate rxjs for asynchronous processing
* Enhance message processing with retry logic for error handling
### Fixed ### Fixed
@@ -8,6 +26,9 @@
* Add unreadMessages in the response * Add unreadMessages in the response
* Phone number as message ID for Evo AI * Phone number as message ID for Evo AI
* Fix upload to s3 when media message * Fix upload to s3 when media message
* Simplify edited message check in BaileysStartupService
* Avoid corrupting URLs with query strings
* Removed CONFIG_SESSION_PHONE_VERSION environment variable
# 2.3.0 (2025-06-17 09:19) # 2.3.0 (2025-06-17 09:19)

View File

@@ -94,7 +94,6 @@ services:
- WEBHOOK_EVENTS_ERRORS_WEBHOOK= - WEBHOOK_EVENTS_ERRORS_WEBHOOK=
- CONFIG_SESSION_PHONE_CLIENT=Evolution API V2 - CONFIG_SESSION_PHONE_CLIENT=Evolution API V2
- CONFIG_SESSION_PHONE_NAME=Chrome - CONFIG_SESSION_PHONE_NAME=Chrome
#- CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200
- QRCODE_LIMIT=30 - QRCODE_LIMIT=30
- OPENAI_ENABLED=true - OPENAI_ENABLED=true
- DIFY_ENABLED=true - DIFY_ENABLED=true

View File

@@ -2,7 +2,7 @@
<div align="center"> <div align="center">
[![Docker Image (https://img.shields.io/badge/Docker-Image-blue)](https://hub.docker.com/r/evoapicloud/evolution-api)] [![Docker Image](https://img.shields.io/badge/Docker-image-blue)](https://hub.docker.com/r/evoapicloud/evolution-api)
[![Whatsapp Group](https://img.shields.io/badge/Group-WhatsApp-%2322BC18)](https://evolution-api.com/whatsapp) [![Whatsapp Group](https://img.shields.io/badge/Group-WhatsApp-%2322BC18)](https://evolution-api.com/whatsapp)
[![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord) [![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord)
[![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman) [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman)

View File

@@ -1,83 +1,75 @@
version: "3.8"
services: services:
api: api:
container_name: evolution_api container_name: evolution_api
image: evoapicloud/evolution-api:latest image: evoapicloud/evolution-api:latest
restart: always restart: always
depends_on: depends_on:
- redis - redis
- postgres - evolution-postgres
ports: ports:
- 8080:8080 - "127.0.0.1:8080:8080"
volumes: volumes:
- evolution_instances:/evolution/instances - evolution_instances:/evolution/instances
networks: networks:
- evolution-net - evolution-net
- dokploy-network
env_file: env_file:
- .env - .env
expose: expose:
- 8080 - "8080"
redis: redis:
container_name: evolution_redis
image: redis:latest image: redis:latest
networks: restart: always
- evolution-net
container_name: redis
command: > command: >
redis-server --port 6379 --appendonly yes redis-server --port 6379 --appendonly yes
volumes: volumes:
- evolution_redis:/data - evolution_redis:/data
ports: networks:
- 6379:6379 evolution-net:
aliases:
- evolution-redis
dokploy-network:
aliases:
- evolution-redis
expose:
- "6379"
postgres: evolution-postgres:
container_name: postgres container_name: evolution_postgres
image: postgres:15 image: postgres:15
restart: always
env_file:
- .env
command:
- postgres
- -c
- max_connections=1000
- -c
- listen_addresses=*
environment:
- POSTGRES_DB=${POSTGRES_DATABASE}
- POSTGRES_USER=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks: networks:
- evolution-net - evolution-net
command: [ - dokploy-network
"postgres", expose:
"-c", "max_connections=200", - "5432"
"-c", "listen_addresses=*",
"-c", "shared_buffers=256MB",
"-c", "effective_cache_size=1GB",
"-c", "work_mem=4MB"
]
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=evolution_db
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres_data:/var/lib/postgresql/data
# pgbouncer:
# image: edoburu/pgbouncer:latest
# environment:
# DB_HOST: postgres
# DB_USER: user
# DB_PASSWORD: pass
# POOL_MODE: transaction
# AUTH_TYPE: trust
# MAX_CLIENT_CONN: 1000
# DEFAULT_POOL_SIZE: 25
# depends_on:
# - postgres
# ports:
# - "6543:5432"
# networks:
# - evolution-net
volumes: volumes:
evolution_instances: evolution_instances:
evolution_redis: evolution_redis:
postgres_data: postgres_data:
networks: networks:
evolution-net: evolution-net:
name: evolution-net name: evolution-net
driver: bridge driver: bridge
dokploy-network:
external: true

650
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "evolution-api", "name": "evolution-api",
"version": "2.3.1", "version": "2.3.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "evolution-api", "name": "evolution-api",
"version": "2.3.1", "version": "2.3.2",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@adiwajshing/keyed-db": "^0.2.4", "@adiwajshing/keyed-db": "^0.2.4",
@@ -20,12 +20,13 @@
"amqplib": "^0.10.5", "amqplib": "^0.10.5",
"audio-decode": "^2.2.3", "audio-decode": "^2.2.3",
"axios": "^1.7.9", "axios": "^1.7.9",
"baileys": "github:EvolutionAPI/Baileys", "baileys": "github:WhiskeySockets/Baileys",
"class-validator": "^0.14.1", "class-validator": "^0.14.1",
"compression": "^1.7.5", "compression": "^1.7.5",
"cors": "^2.8.5", "cors": "^2.8.5",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"emoji-regex": "^10.4.0",
"eventemitter2": "^6.4.9", "eventemitter2": "^6.4.9",
"express": "^4.21.2", "express": "^4.21.2",
"express-async-errors": "^3.1.1", "express-async-errors": "^3.1.1",
@@ -59,6 +60,7 @@
"sharp": "^0.34.2", "sharp": "^0.34.2",
"socket.io": "^4.8.1", "socket.io": "^4.8.1",
"socket.io-client": "^4.8.1", "socket.io-client": "^4.8.1",
"socks-proxy-agent": "^8.0.5",
"swagger-ui-express": "^5.0.1", "swagger-ui-express": "^5.0.1",
"tsup": "^8.3.5" "tsup": "^8.3.5"
}, },
@@ -82,8 +84,8 @@
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"tsx": "^4.20.3",
"typescript": "^5.7.2" "typescript": "^5.7.2"
} }
}, },
@@ -717,18 +719,6 @@
"keyv": "^5.3.4" "keyv": "^5.3.4"
} }
}, },
"node_modules/@cspotcode/source-map-support": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"dependencies": {
"@jridgewell/trace-mapping": "0.3.9"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@emnapi/runtime": { "node_modules/@emnapi/runtime": {
"version": "1.4.4", "version": "1.4.4",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.4.tgz", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.4.tgz",
@@ -2308,16 +2298,6 @@
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz",
"integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==" "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw=="
}, },
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@keyv/serialize": { "node_modules/@keyv/serialize": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.0.3.tgz", "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.0.3.tgz",
@@ -4104,35 +4084,46 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@tokenizer/inflate": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz",
"integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==",
"license": "MIT",
"dependencies": {
"debug": "^4.4.0",
"fflate": "^0.8.2",
"token-types": "^6.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/@tokenizer/inflate/node_modules/token-types": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz",
"integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==",
"license": "MIT",
"dependencies": {
"@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1"
},
"engines": {
"node": ">=14.16"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/@tokenizer/token": { "node_modules/@tokenizer/token": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
}, },
"node_modules/@tsconfig/node10": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz",
"integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==",
"dev": true
},
"node_modules/@tsconfig/node12": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
"dev": true
},
"node_modules/@tsconfig/node14": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
"dev": true
},
"node_modules/@tsconfig/node16": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true
},
"node_modules/@types/body-parser": { "node_modules/@types/body-parser": {
"version": "1.19.6", "version": "1.19.6",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz",
@@ -4219,7 +4210,8 @@
"node_modules/@types/long": { "node_modules/@types/long": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz",
"integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==",
"license": "MIT"
}, },
"node_modules/@types/mime": { "node_modules/@types/mime": {
"version": "4.0.0", "version": "4.0.0",
@@ -4351,18 +4343,6 @@
"resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz",
"integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg=="
}, },
"node_modules/@types/strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==",
"dev": true
},
"node_modules/@types/strip-json-comments": {
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz",
"integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==",
"dev": true
},
"node_modules/@types/tedious": { "node_modules/@types/tedious": {
"version": "4.0.14", "version": "4.0.14",
"resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz",
@@ -4690,18 +4670,6 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/acorn-walk": {
"version": "8.3.4",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
"integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
"dev": true,
"dependencies": {
"acorn": "^8.11.0"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/agent-base": { "node_modules/agent-base": {
"version": "7.1.4", "version": "7.1.4",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
@@ -4781,30 +4749,11 @@
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="
}, },
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/append-field": { "node_modules/append-field": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
"integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw=="
}, },
"node_modules/arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"node_modules/argparse": { "node_modules/argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -5037,8 +4986,8 @@
} }
}, },
"node_modules/baileys": { "node_modules/baileys": {
"version": "6.7.18", "version": "6.7.19",
"resolved": "git+ssh://git@github.com/EvolutionAPI/Baileys.git#748ea484785c31817512ae6dc45e20c51cb9f3ff", "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#9e04cce8d3eeb16025283a57849cc83aa26c6dd1",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -5046,9 +4995,8 @@
"@hapi/boom": "^9.1.3", "@hapi/boom": "^9.1.3",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"axios": "^1.6.0", "axios": "^1.6.0",
"libsignal": "github:WhiskeySockets/libsignal-node", "libsignal": "git+https://github.com/whiskeysockets/libsignal-node",
"lodash": "^4.17.21", "music-metadata": "^11.7.0",
"music-metadata": "^7.12.3",
"pino": "^9.6", "pino": "^9.6",
"protobufjs": "^7.2.4", "protobufjs": "^7.2.4",
"ws": "^8.13.0" "ws": "^8.13.0"
@@ -5060,7 +5008,7 @@
"audio-decode": "^2.1.3", "audio-decode": "^2.1.3",
"jimp": "^1.6.0", "jimp": "^1.6.0",
"link-preview-js": "^3.0.0", "link-preview-js": "^3.0.0",
"sharp": "^0.34.2" "sharp": "*"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"audio-decode": { "audio-decode": {
@@ -5071,9 +5019,6 @@
}, },
"link-preview-js": { "link-preview-js": {
"optional": true "optional": true
},
"sharp": {
"optional": true
} }
} }
}, },
@@ -5187,18 +5132,6 @@
"node": "^4.5.0 || >= 5.9" "node": "^4.5.0 || >= 5.9"
} }
}, },
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
"dev": true,
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/block-stream2": { "node_modules/block-stream2": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz", "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz",
@@ -5493,42 +5426,6 @@
"url": "https://github.com/sponsors/fb55" "url": "https://github.com/sponsors/fb55"
} }
}, },
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/cjs-module-lexer": { "node_modules/cjs-module-lexer": {
"version": "1.4.3", "version": "1.4.3",
"resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz",
@@ -5789,12 +5686,6 @@
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.0.6", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -5837,7 +5728,8 @@
"node_modules/curve25519-js": { "node_modules/curve25519-js": {
"version": "0.0.4", "version": "0.0.4",
"resolved": "https://registry.npmjs.org/curve25519-js/-/curve25519-js-0.0.4.tgz", "resolved": "https://registry.npmjs.org/curve25519-js/-/curve25519-js-0.0.4.tgz",
"integrity": "sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w==" "integrity": "sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w==",
"license": "MIT"
}, },
"node_modules/data-view-buffer": { "node_modules/data-view-buffer": {
"version": "1.0.2", "version": "1.0.2",
@@ -5999,15 +5891,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true,
"engines": {
"node": ">=0.3.1"
}
},
"node_modules/dijkstrajs": { "node_modules/dijkstrajs": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
@@ -6112,15 +5995,6 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/dynamic-dedupe": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz",
"integrity": "sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==",
"dev": true,
"dependencies": {
"xtend": "^4.0.0"
}
},
"node_modules/eastasianwidth": { "node_modules/eastasianwidth": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -6140,9 +6014,10 @@
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "8.0.0", "version": "10.4.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
"license": "MIT"
}, },
"node_modules/encodeurl": { "node_modules/encodeurl": {
"version": "2.0.0", "version": "2.0.0",
@@ -7051,6 +6926,12 @@
"reusify": "^1.0.4" "reusify": "^1.0.4"
} }
}, },
"node_modules/fflate": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
"license": "MIT"
},
"node_modules/file-entry-cache": { "node_modules/file-entry-cache": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
@@ -7433,6 +7314,19 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/get-tsconfig": {
"version": "4.10.1",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz",
"integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/gifwrap": { "node_modules/gifwrap": {
"version": "0.10.1", "version": "0.10.1",
"resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.10.1.tgz", "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.10.1.tgz",
@@ -7846,6 +7740,19 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/ip-address": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz",
"integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==",
"license": "MIT",
"dependencies": {
"jsbn": "1.1.0",
"sprintf-js": "^1.1.3"
},
"engines": {
"node": ">= 12"
}
},
"node_modules/ipaddr.js": { "node_modules/ipaddr.js": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz",
@@ -7934,18 +7841,6 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-boolean-object": { "node_modules/is-boolean-object": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz",
@@ -8368,6 +8263,12 @@
"js-yaml": "bin/js-yaml.js" "js-yaml": "bin/js-yaml.js"
} }
}, },
"node_modules/jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
"license": "MIT"
},
"node_modules/json-buffer": { "node_modules/json-buffer": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
@@ -8480,7 +8381,7 @@
"node_modules/libsignal": { "node_modules/libsignal": {
"name": "@whiskeysockets/libsignal-node", "name": "@whiskeysockets/libsignal-node",
"version": "2.0.1", "version": "2.0.1",
"resolved": "git+ssh://git@github.com/WhiskeySockets/libsignal-node.git#4d08331a833727c338c1a90041d17b870210dfae", "resolved": "git+ssh://git@github.com/whiskeysockets/libsignal-node.git#4d08331a833727c338c1a90041d17b870210dfae",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"curve25519-js": "^0.0.4", "curve25519-js": "^0.0.4",
@@ -8490,18 +8391,21 @@
"node_modules/libsignal/node_modules/@types/node": { "node_modules/libsignal/node_modules/@types/node": {
"version": "10.17.60", "version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==",
"license": "MIT"
}, },
"node_modules/libsignal/node_modules/long": { "node_modules/libsignal/node_modules/long": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",
"license": "Apache-2.0"
}, },
"node_modules/libsignal/node_modules/protobufjs": { "node_modules/libsignal/node_modules/protobufjs": {
"version": "6.8.8", "version": "6.8.8",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz",
"integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "BSD-3-Clause",
"dependencies": { "dependencies": {
"@protobufjs/aspromise": "^1.1.2", "@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2", "@protobufjs/base64": "^1.1.2",
@@ -8642,12 +8546,6 @@
"@jridgewell/sourcemap-codec": "^1.5.0" "@jridgewell/sourcemap-codec": "^1.5.0"
} }
}, },
"node_modules/make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -8660,6 +8558,7 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
"license": "MIT",
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
@@ -8880,20 +8779,79 @@
} }
}, },
"node_modules/music-metadata": { "node_modules/music-metadata": {
"version": "7.14.0", "version": "11.7.1",
"resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-7.14.0.tgz", "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.7.1.tgz",
"integrity": "sha512-xrm3w7SV0Wk+OythZcSbaI8mcr/KHd0knJieu8bVpaPfMv/Agz5EooCAPz3OR5hbYMiUG6dgAPKZKnMzV+3amA==", "integrity": "sha512-qoimzvpOnOi2VJpGz6Nz4SwmcYKe39TsAwlcNilgnDrGKNQDib35t0kj5fy1E71DQgqGApBeAKLmcV9pO3l/2w==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/Borewit"
},
{
"type": "buymeacoffee",
"url": "https://buymeacoffee.com/borewit"
}
],
"license": "MIT",
"dependencies": { "dependencies": {
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
"content-type": "^1.0.5", "content-type": "^1.0.5",
"debug": "^4.3.4", "debug": "^4.4.1",
"file-type": "^16.5.4", "file-type": "^21.0.0",
"media-typer": "^1.1.0", "media-typer": "^1.1.0",
"strtok3": "^6.3.0", "strtok3": "^10.3.2",
"token-types": "^4.2.1" "token-types": "^6.0.3",
"uint8array-extras": "^1.4.0"
}, },
"engines": { "engines": {
"node": ">=10" "node": ">=18"
}
},
"node_modules/music-metadata/node_modules/file-type": {
"version": "21.0.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz",
"integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==",
"license": "MIT",
"dependencies": {
"@tokenizer/inflate": "^0.2.7",
"strtok3": "^10.2.2",
"token-types": "^6.0.0",
"uint8array-extras": "^1.4.0"
},
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/sindresorhus/file-type?sponsor=1"
}
},
"node_modules/music-metadata/node_modules/strtok3": {
"version": "10.3.2",
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.2.tgz",
"integrity": "sha512-or9w505RhhY66+uoe5YOC5QO/bRuATaoim3XTh+pGKx5VMWi/HDhMKuCjDLsLJouU2zg9Hf1nLPcNW7IHv80kQ==",
"license": "MIT",
"dependencies": {
"@tokenizer/token": "^0.3.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/music-metadata/node_modules/token-types": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz",
"integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==",
"license": "MIT",
"dependencies": {
"@tokenizer/token": "^0.3.0",
"ieee754": "^1.2.1"
},
"engines": {
"node": ">=14.16"
}, },
"funding": { "funding": {
"type": "github", "type": "github",
@@ -9022,15 +8980,6 @@
"node": ">=4.4.0" "node": ">=4.4.0"
} }
}, },
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/nth-check": { "node_modules/nth-check": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
@@ -10204,18 +10153,6 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
} }
}, },
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/real-require": { "node_modules/real-require": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
@@ -10338,6 +10275,16 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"devOptional": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/reusify": { "node_modules/reusify": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
@@ -10834,6 +10781,16 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/smart-buffer": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
"integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
"license": "MIT",
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
}
},
"node_modules/socket.io": { "node_modules/socket.io": {
"version": "4.8.1", "version": "4.8.1",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz",
@@ -10970,6 +10927,34 @@
} }
} }
}, },
"node_modules/socks": {
"version": "2.8.6",
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz",
"integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==",
"license": "MIT",
"dependencies": {
"ip-address": "^9.0.5",
"smart-buffer": "^4.2.0"
},
"engines": {
"node": ">= 10.0.0",
"npm": ">= 3.0.0"
}
},
"node_modules/socks-proxy-agent": {
"version": "8.0.5",
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
"integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
"license": "MIT",
"dependencies": {
"agent-base": "^7.1.2",
"debug": "^4.3.4",
"socks": "^2.8.3"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/sonic-boom": { "node_modules/sonic-boom": {
"version": "3.8.1", "version": "3.8.1",
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz",
@@ -10978,25 +10963,6 @@
"atomic-sleep": "^1.0.0" "atomic-sleep": "^1.0.0"
} }
}, },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-support": {
"version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"dev": true,
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"node_modules/split-on-first": { "node_modules/split-on-first": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
@@ -11013,6 +10979,12 @@
"node": ">= 10.x" "node": ">= 10.x"
} }
}, },
"node_modules/sprintf-js": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
"integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==",
"license": "BSD-3-Clause"
},
"node_modules/statuses": { "node_modules/statuses": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@@ -11098,6 +11070,18 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/string-width/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/string.prototype.trim": { "node_modules/string.prototype.trim": {
"version": "1.2.10", "version": "1.2.10",
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz",
@@ -11495,120 +11479,6 @@
"resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="
}, },
"node_modules/ts-node": {
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"dev": true,
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
"@tsconfig/node12": "^1.0.7",
"@tsconfig/node14": "^1.0.0",
"@tsconfig/node16": "^1.0.2",
"acorn": "^8.4.1",
"acorn-walk": "^8.1.1",
"arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"v8-compile-cache-lib": "^3.0.1",
"yn": "3.1.1"
},
"bin": {
"ts-node": "dist/bin.js",
"ts-node-cwd": "dist/bin-cwd.js",
"ts-node-esm": "dist/bin-esm.js",
"ts-node-script": "dist/bin-script.js",
"ts-node-transpile-only": "dist/bin-transpile.js",
"ts-script": "dist/bin-script-deprecated.js"
},
"peerDependencies": {
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
"@types/node": "*",
"typescript": ">=2.7"
},
"peerDependenciesMeta": {
"@swc/core": {
"optional": true
},
"@swc/wasm": {
"optional": true
}
}
},
"node_modules/ts-node-dev": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ts-node-dev/-/ts-node-dev-2.0.0.tgz",
"integrity": "sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==",
"dev": true,
"dependencies": {
"chokidar": "^3.5.1",
"dynamic-dedupe": "^0.3.0",
"minimist": "^1.2.6",
"mkdirp": "^1.0.4",
"resolve": "^1.0.0",
"rimraf": "^2.6.1",
"source-map-support": "^0.5.12",
"tree-kill": "^1.2.2",
"ts-node": "^10.4.0",
"tsconfig": "^7.0.0"
},
"bin": {
"ts-node-dev": "lib/bin.js",
"tsnd": "lib/bin.js"
},
"engines": {
"node": ">=0.8.0"
},
"peerDependencies": {
"node-notifier": "*",
"typescript": "*"
},
"peerDependenciesMeta": {
"node-notifier": {
"optional": true
}
}
},
"node_modules/ts-node-dev/node_modules/mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true,
"bin": {
"mkdirp": "bin/cmd.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ts-node-dev/node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"deprecated": "Rimraf versions prior to v4 are no longer supported",
"dev": true,
"dependencies": {
"glob": "^7.1.3"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/tsconfig": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz",
"integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==",
"dev": true,
"dependencies": {
"@types/strip-bom": "^3.0.0",
"@types/strip-json-comments": "0.0.30",
"strip-bom": "^3.0.0",
"strip-json-comments": "^2.0.0"
}
},
"node_modules/tsconfig-paths": { "node_modules/tsconfig-paths": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
@@ -11623,15 +11493,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/tsconfig/node_modules/strip-json-comments": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/tslib": { "node_modules/tslib": {
"version": "2.8.1", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
@@ -11756,6 +11617,26 @@
"webidl-conversions": "^4.0.2" "webidl-conversions": "^4.0.2"
} }
}, },
"node_modules/tsx": {
"version": "4.20.3",
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz",
"integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"esbuild": "~0.25.0",
"get-tsconfig": "^4.7.5"
},
"bin": {
"tsx": "dist/cli.mjs"
},
"engines": {
"node": ">=18.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
}
},
"node_modules/tweetnacl": { "node_modules/tweetnacl": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
@@ -11907,6 +11788,18 @@
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz",
"integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==" "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="
}, },
"node_modules/uint8array-extras": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz",
"integrity": "sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/unbox-primitive": { "node_modules/unbox-primitive": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz",
@@ -12015,12 +11908,6 @@
"uuid": "dist/bin/uuid" "uuid": "dist/bin/uuid"
} }
}, },
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
"dev": true
},
"node_modules/validator": { "node_modules/validator": {
"version": "13.15.15", "version": "13.15.15",
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz", "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz",
@@ -12320,15 +12207,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/yocto-queue": { "node_modules/yocto-queue": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",

View File

@@ -1,15 +1,15 @@
{ {
"name": "evolution-api", "name": "evolution-api",
"version": "2.3.1", "version": "2.3.2",
"description": "Rest api for communication with WhatsApp", "description": "Rest api for communication with WhatsApp",
"main": "./dist/main.js", "main": "./dist/main.js",
"type": "commonjs", "type": "commonjs",
"scripts": { "scripts": {
"build": "tsc --noEmit && tsup", "build": "tsc --noEmit && tsup",
"start": "tsnd -r tsconfig-paths/register --files --transpile-only ./src/main.ts", "start": "tsx ./src/main.ts",
"start:prod": "node dist/main", "start:prod": "node dist/main",
"dev:server": "tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts", "dev:server": "tsx watch ./src/main.ts",
"test": "tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts", "test": "tsx watch ./test/all.test.ts",
"lint": "eslint --fix --ext .ts src", "lint": "eslint --fix --ext .ts src",
"lint:check": "eslint --ext .ts src", "lint:check": "eslint --ext .ts src",
"db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
@@ -60,12 +60,13 @@
"amqplib": "^0.10.5", "amqplib": "^0.10.5",
"audio-decode": "^2.2.3", "audio-decode": "^2.2.3",
"axios": "^1.7.9", "axios": "^1.7.9",
"baileys": "github:EvolutionAPI/Baileys", "baileys": "github:WhiskeySockets/Baileys",
"class-validator": "^0.14.1", "class-validator": "^0.14.1",
"compression": "^1.7.5", "compression": "^1.7.5",
"cors": "^2.8.5", "cors": "^2.8.5",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"emoji-regex": "^10.4.0",
"eventemitter2": "^6.4.9", "eventemitter2": "^6.4.9",
"express": "^4.21.2", "express": "^4.21.2",
"express-async-errors": "^3.1.1", "express-async-errors": "^3.1.1",
@@ -99,6 +100,7 @@
"sharp": "^0.34.2", "sharp": "^0.34.2",
"socket.io": "^4.8.1", "socket.io": "^4.8.1",
"socket.io-client": "^4.8.1", "socket.io-client": "^4.8.1",
"socks-proxy-agent": "^8.0.5",
"swagger-ui-express": "^5.0.1", "swagger-ui-express": "^5.0.1",
"tsup": "^8.3.5" "tsup": "^8.3.5"
}, },
@@ -122,8 +124,8 @@
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"tsx": "^4.20.3",
"typescript": "^5.7.2" "typescript": "^5.7.2"
} }
} }

View File

@@ -647,22 +647,22 @@ model IsOnWhatsapp {
model N8n { model N8n {
id String @id @default(cuid()) id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean enabled Boolean @default(true) @db.TinyInt(1)
description String? @db.VarChar(255) description String? @db.VarChar(255)
webhookUrl String? @db.VarChar(255) webhookUrl String? @db.VarChar(255)
basicAuthUser String? @db.VarChar(255) basicAuthUser String? @db.VarChar(255)
basicAuthPass String? @db.VarChar(255) basicAuthPass String? @db.VarChar(255)
expire Int? @default(0) @db.Int expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100) keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100) unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false) keepOpen Boolean? @default(false)
debounceTime Int? @db.Integer debounceTime Int? @db.Int
ignoreJids Json? ignoreJids Json?
splitMessages Boolean? @default(false) splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Integer timePerChar Int? @default(50) @db.Int
triggerType TriggerType? triggerType TriggerType?
triggerOperator TriggerOperator? triggerOperator TriggerOperator?
triggerValue String? triggerValue String?
@@ -677,15 +677,15 @@ model N8nSetting {
id String @id @default(cuid()) id String @id @default(cuid())
expire Int? @default(0) @db.Int expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100) keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100) unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false) keepOpen Boolean? @default(false)
debounceTime Int? @db.Integer debounceTime Int? @db.Int
ignoreJids Json? ignoreJids Json?
splitMessages Boolean? @default(false) splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Integer timePerChar Int? @default(50) @db.Int
createdAt DateTime? @default(now()) @db.Timestamp createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp
Fallback N8n? @relation(fields: [n8nIdFallback], references: [id]) Fallback N8n? @relation(fields: [n8nIdFallback], references: [id])
@@ -696,21 +696,21 @@ model N8nSetting {
model Evoai { model Evoai {
id String @id @default(cuid()) id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean enabled Boolean @default(true) @db.TinyInt(1)
description String? @db.VarChar(255) description String? @db.VarChar(255)
agentUrl String? @db.VarChar(255) agentUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255) apiKey String? @db.VarChar(255)
expire Int? @default(0) @db.Int expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100) keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100) unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false) keepOpen Boolean? @default(false)
debounceTime Int? @db.Integer debounceTime Int? @db.Int
ignoreJids Json? ignoreJids Json?
splitMessages Boolean? @default(false) splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Integer timePerChar Int? @default(50) @db.Int
triggerType TriggerType? triggerType TriggerType?
triggerOperator TriggerOperator? triggerOperator TriggerOperator?
triggerValue String? triggerValue String?
@@ -725,15 +725,15 @@ model EvoaiSetting {
id String @id @default(cuid()) id String @id @default(cuid())
expire Int? @default(0) @db.Int expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100) keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100) unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false) stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false) keepOpen Boolean? @default(false)
debounceTime Int? @db.Integer debounceTime Int? @db.Int
ignoreJids Json? ignoreJids Json?
splitMessages Boolean? @default(false) splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Integer timePerChar Int? @default(50) @db.Int
createdAt DateTime? @default(now()) @db.Timestamp createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp
Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id]) Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id])

View File

@@ -6,14 +6,4 @@ Warnings:
*/ */
-- AlterTable -- AlterTable
DO $$ ALTER TABLE "Setting" ADD COLUMN IF NOT EXISTS "wavoipToken" VARCHAR(100);
BEGIN
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'Setting'
AND column_name = 'wavoipToken'
) THEN
ALTER TABLE "Setting" ADD COLUMN "wavoipToken" VARCHAR(100);
END IF;
END $$;

View File

@@ -70,6 +70,10 @@ export class ChatController {
return await this.waMonitor.waInstances[instanceName].fetchChats(query); return await this.waMonitor.waInstances[instanceName].fetchChats(query);
} }
public async findChatByRemoteJid({ instanceName }: InstanceDto, remoteJid: string) {
return await this.waMonitor.waInstances[instanceName].findChatByRemoteJid(remoteJid);
}
public async sendPresence({ instanceName }: InstanceDto, data: SendPresenceDto) { public async sendPresence({ instanceName }: InstanceDto, data: SendPresenceDto) {
return await this.waMonitor.waInstances[instanceName].sendPresence(data); return await this.waMonitor.waInstances[instanceName].sendPresence(data);
} }

View File

@@ -53,15 +53,21 @@ export class ProxyController {
httpsAgent: makeProxyAgent(proxy), httpsAgent: makeProxyAgent(proxy),
}); });
return response?.data !== serverIp?.data; const result = response?.data !== serverIp?.data;
} catch (error) { if (result) {
if (axios.isAxiosError(error) && error.response?.data) { logger.info('testProxy: proxy connection successful');
logger.error('testProxy error: ' + error.response.data);
} else if (axios.isAxiosError(error)) {
logger.error('testProxy error: ');
} else { } else {
logger.error('testProxy error: '); logger.warn("testProxy: proxy connection doesn't change the origin IP");
} }
return result;
} catch (error) {
if (axios.isAxiosError(error)) {
logger.error('testProxy error: axios error: ' + error.message);
} else {
logger.error('testProxy error: unexpected error: ' + error);
}
return false; return false;
} }
} }

View File

@@ -17,13 +17,15 @@ import {
import { WAMonitoringService } from '@api/services/monitor.service'; import { WAMonitoringService } from '@api/services/monitor.service';
import { BadRequestException } from '@exceptions'; import { BadRequestException } from '@exceptions';
import { isBase64, isURL } from 'class-validator'; import { isBase64, isURL } from 'class-validator';
import emojiRegex from 'emoji-regex';
const regex = emojiRegex();
function isEmoji(str: string) { function isEmoji(str: string) {
if (str === '') return true; if (str === '') return true;
const emojiRegex = const match = str.match(regex);
/^[\u{1F300}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F000}-\u{1F02F}\u{1F0A0}-\u{1F0FF}\u{1F100}-\u{1F64F}\u{1F680}-\u{1F6FF}]$/u; return match?.length === 1 && match[0] === str;
return emojiRegex.test(str);
} }
export class SendMessageController { export class SendMessageController {

View File

@@ -549,17 +549,18 @@ export class BaileysStartupService extends ChannelStartupService {
this.logger.info(`Browser: ${browser}`); this.logger.info(`Browser: ${browser}`);
} }
let version; const baileysVersion = await fetchLatestWaWebVersion({});
let log; const version = baileysVersion.version;
const log = `Baileys version: ${version.join('.')}`;
if (session.VERSION) { // if (session.VERSION) {
version = session.VERSION.split('.'); // version = session.VERSION.split('.');
log = `Baileys version env: ${version}`; // log = `Baileys version env: ${version}`;
} else { // } else {
const baileysVersion = await fetchLatestWaWebVersion({}); // const baileysVersion = await fetchLatestWaWebVersion({});
version = baileysVersion.version; // version = baileysVersion.version;
log = `Baileys version: ${version}`; // log = `Baileys version: ${version}`;
} // }
this.logger.info(log); this.logger.info(log);
@@ -1059,6 +1060,8 @@ export class BaileysStartupService extends ChannelStartupService {
'failed to decrypt message', 'failed to decrypt message',
'SessionError', 'SessionError',
'Invalid PreKey ID', 'Invalid PreKey ID',
'No session record',
'No session found to decrypt message',
].some((err) => param?.includes?.(err)), ].some((err) => param?.includes?.(err)),
) )
) { ) {
@@ -1085,7 +1088,7 @@ export class BaileysStartupService extends ChannelStartupService {
const editedMessage = const editedMessage =
received?.message?.protocolMessage || received?.message?.editedMessage?.message?.protocolMessage; received?.message?.protocolMessage || received?.message?.editedMessage?.message?.protocolMessage;
if (received.message?.protocolMessage?.editedMessage && editedMessage) { if (editedMessage) {
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot?.enabled) if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot?.enabled)
this.chatwootService.eventWhatsapp( this.chatwootService.eventWhatsapp(
'messages.edit', 'messages.edit',
@@ -1133,7 +1136,7 @@ export class BaileysStartupService extends ChannelStartupService {
if ( if (
(type !== 'notify' && type !== 'append') || (type !== 'notify' && type !== 'append') ||
received.message?.protocolMessage || editedMessage ||
received.message?.pollUpdateMessage || received.message?.pollUpdateMessage ||
!received?.message !received?.message
) { ) {
@@ -1443,16 +1446,7 @@ export class BaileysStartupService extends ChannelStartupService {
} }
} }
const findMessage = await this.prismaRepository.message.findFirst({
where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } },
});
if (!findMessage) {
continue;
}
const message: any = { const message: any = {
messageId: findMessage.id,
keyId: key.id, keyId: key.id,
remoteJid: key?.remoteJid, remoteJid: key?.remoteJid,
fromMe: key.fromMe, fromMe: key.fromMe,
@@ -1462,6 +1456,16 @@ export class BaileysStartupService extends ChannelStartupService {
instanceId: this.instanceId, instanceId: this.instanceId,
}; };
let findMessage: any;
const configDatabaseData = this.configService.get<Database>('DATABASE').SAVE_DATA;
if (configDatabaseData.HISTORIC || configDatabaseData.NEW_MESSAGE) {
findMessage = await this.prismaRepository.message.findFirst({
where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } },
});
if (findMessage) message.messageId = findMessage.id;
}
if (update.message === null && update.status === undefined) { if (update.message === null && update.status === undefined) {
this.sendDataWebhook(Events.MESSAGES_DELETE, key); this.sendDataWebhook(Events.MESSAGES_DELETE, key);
@@ -1477,7 +1481,9 @@ export class BaileysStartupService extends ChannelStartupService {
} }
continue; continue;
} else if (update.status !== undefined && status[update.status] !== findMessage.status) { }
if (findMessage && update.status !== undefined && status[update.status] !== findMessage.status) {
if (!key.fromMe && key.remoteJid) { if (!key.fromMe && key.remoteJid) {
readChatToUpdate[key.remoteJid] = true; readChatToUpdate[key.remoteJid] = true;
@@ -2442,9 +2448,43 @@ export class BaileysStartupService extends ChannelStartupService {
try { try {
const type = mediaMessage.mediatype === 'ptv' ? 'video' : mediaMessage.mediatype; const type = mediaMessage.mediatype === 'ptv' ? 'video' : mediaMessage.mediatype;
let mediaInput: any;
if (mediaMessage.mediatype === 'image') {
let imageBuffer: Buffer;
if (isURL(mediaMessage.media)) {
let config: any = { responseType: 'arraybuffer' };
if (this.localProxy?.enabled) {
config = {
...config,
httpsAgent: makeProxyAgent({
host: this.localProxy.host,
port: this.localProxy.port,
protocol: this.localProxy.protocol,
username: this.localProxy.username,
password: this.localProxy.password,
}),
};
}
const response = await axios.get(mediaMessage.media, config);
imageBuffer = Buffer.from(response.data, 'binary');
} else {
imageBuffer = Buffer.from(mediaMessage.media, 'base64');
}
mediaInput = await sharp(imageBuffer).jpeg().toBuffer();
mediaMessage.fileName ??= 'image.jpg';
mediaMessage.mimetype = 'image/jpeg';
} else {
mediaInput = isURL(mediaMessage.media)
? { url: mediaMessage.media }
: Buffer.from(mediaMessage.media, 'base64');
}
const prepareMedia = await prepareWAMessageMedia( const prepareMedia = await prepareWAMessageMedia(
{ {
[type]: isURL(mediaMessage.media) ? { url: mediaMessage.media } : Buffer.from(mediaMessage.media, 'base64'), [type]: mediaInput,
} as any, } as any,
{ upload: this.client.waUploadToServer }, { upload: this.client.waUploadToServer },
); );
@@ -2458,7 +2498,7 @@ export class BaileysStartupService extends ChannelStartupService {
} }
if (mediaMessage.mediatype === 'image' && !mediaMessage.fileName) { if (mediaMessage.mediatype === 'image' && !mediaMessage.fileName) {
mediaMessage.fileName = 'image.png'; mediaMessage.fileName = 'image.jpg';
} }
if (mediaMessage.mediatype === 'video' && !mediaMessage.fileName) { if (mediaMessage.mediatype === 'video' && !mediaMessage.fileName) {
@@ -2556,7 +2596,9 @@ export class BaileysStartupService extends ChannelStartupService {
imageBuffer = Buffer.from(base64Data, 'base64'); imageBuffer = Buffer.from(base64Data, 'base64');
} else { } else {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const url = `${image}?timestamp=${timestamp}`; const parsedURL = new URL(image);
parsedURL.searchParams.set('timestamp', timestamp.toString());
const url = parsedURL.toString();
let config: any = { responseType: 'arraybuffer' }; let config: any = { responseType: 'arraybuffer' };
@@ -2777,7 +2819,9 @@ export class BaileysStartupService extends ChannelStartupService {
if (isURL(audio)) { if (isURL(audio)) {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const url = `${audio}?timestamp=${timestamp}`; const parsedURL = new URL(audio);
parsedURL.searchParams.set('timestamp', timestamp.toString());
const url = parsedURL.toString();
const config: any = { responseType: 'stream' }; const config: any = { responseType: 'stream' };
@@ -3431,17 +3475,20 @@ export class BaileysStartupService extends ChannelStartupService {
where: { id: message.id }, where: { id: message.id },
data: { key: { ...existingKey, deleted: true }, status: 'DELETED' }, data: { key: { ...existingKey, deleted: true }, status: 'DELETED' },
}); });
const messageUpdate: any = { if (this.configService.get<Database>('DATABASE').SAVE_DATA.MESSAGE_UPDATE) {
messageId: message.id, const messageUpdate: any = {
keyId: messageId, messageId: message.id,
remoteJid: response.key.remoteJid, keyId: messageId,
fromMe: response.key.fromMe, remoteJid: response.key.remoteJid,
participant: response.key?.remoteJid, fromMe: response.key.fromMe,
status: 'DELETED', participant: response.key?.remoteJid,
instanceId: this.instanceId, status: 'DELETED',
}; instanceId: this.instanceId,
await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); };
await this.prismaRepository.messageUpdate.create({ data: messageUpdate });
}
} else { } else {
if (!message) return response;
await this.prismaRepository.message.deleteMany({ where: { id: message.id } }); await this.prismaRepository.message.deleteMany({ where: { id: message.id } });
} }
this.sendDataWebhook(Events.MESSAGES_DELETE, { this.sendDataWebhook(Events.MESSAGES_DELETE, {
@@ -3703,7 +3750,9 @@ export class BaileysStartupService extends ChannelStartupService {
let pic: WAMediaUpload; let pic: WAMediaUpload;
if (isURL(picture)) { if (isURL(picture)) {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const url = `${picture}?timestamp=${timestamp}`; const parsedURL = new URL(picture);
parsedURL.searchParams.set('timestamp', timestamp.toString());
const url = parsedURL.toString();
let config: any = { responseType: 'arraybuffer' }; let config: any = { responseType: 'arraybuffer' };
@@ -3771,6 +3820,10 @@ export class BaileysStartupService extends ChannelStartupService {
private async formatUpdateMessage(data: UpdateMessageDto) { private async formatUpdateMessage(data: UpdateMessageDto) {
try { try {
if (!this.configService.get<Database>('DATABASE').SAVE_DATA.NEW_MESSAGE) {
return data;
}
const msg: any = await this.getMessage(data.key, true); const msg: any = await this.getMessage(data.key, true);
if (msg?.messageType === 'conversation' || msg?.messageType === 'extendedTextMessage') { if (msg?.messageType === 'conversation' || msg?.messageType === 'extendedTextMessage') {
@@ -3804,13 +3857,15 @@ export class BaileysStartupService extends ChannelStartupService {
try { try {
const oldMessage: any = await this.getMessage(data.key, true); const oldMessage: any = await this.getMessage(data.key, true);
if (!oldMessage) throw new NotFoundException('Message not found'); if (this.configService.get<Database>('DATABASE').SAVE_DATA.NEW_MESSAGE) {
if (oldMessage?.key?.remoteJid !== jid) { if (!oldMessage) throw new NotFoundException('Message not found');
throw new BadRequestException('RemoteJid does not match'); if (oldMessage?.key?.remoteJid !== jid) {
} throw new BadRequestException('RemoteJid does not match');
if (oldMessage?.messageTimestamp > Date.now() + 900000) { }
// 15 minutes in milliseconds if (oldMessage?.messageTimestamp > Date.now() + 900000) {
throw new BadRequestException('Message is older than 15 minutes'); // 15 minutes in milliseconds
throw new BadRequestException('Message is older than 15 minutes');
}
} }
const messageSent = await this.client.sendMessage(jid, { ...(options as any), edit: data.key }); const messageSent = await this.client.sendMessage(jid, { ...(options as any), edit: data.key });
@@ -3828,7 +3883,7 @@ export class BaileysStartupService extends ChannelStartupService {
); );
const messageId = messageSent.message?.protocolMessage?.key?.id; const messageId = messageSent.message?.protocolMessage?.key?.id;
if (messageId) { if (messageId && this.configService.get<Database>('DATABASE').SAVE_DATA.NEW_MESSAGE) {
let message = await this.prismaRepository.message.findFirst({ let message = await this.prismaRepository.message.findFirst({
where: { key: { path: ['id'], equals: messageId } }, where: { key: { path: ['id'], equals: messageId } },
}); });
@@ -3840,6 +3895,7 @@ export class BaileysStartupService extends ChannelStartupService {
if ((message.key.valueOf() as any)?.deleted) { if ((message.key.valueOf() as any)?.deleted) {
new BadRequestException('You cannot edit deleted messages'); new BadRequestException('You cannot edit deleted messages');
} }
if (oldMessage.messageType === 'conversation' || oldMessage.messageType === 'extendedTextMessage') { if (oldMessage.messageType === 'conversation' || oldMessage.messageType === 'extendedTextMessage') {
oldMessage.message.conversation = data.text; oldMessage.message.conversation = data.text;
} else { } else {
@@ -3853,16 +3909,19 @@ export class BaileysStartupService extends ChannelStartupService {
messageTimestamp: Math.floor(Date.now() / 1000), // Convert to int32 by dividing by 1000 to get seconds messageTimestamp: Math.floor(Date.now() / 1000), // Convert to int32 by dividing by 1000 to get seconds
}, },
}); });
const messageUpdate: any = {
messageId: message.id, if (this.configService.get<Database>('DATABASE').SAVE_DATA.MESSAGE_UPDATE) {
keyId: messageId, const messageUpdate: any = {
remoteJid: messageSent.key.remoteJid, messageId: message.id,
fromMe: messageSent.key.fromMe, keyId: messageId,
participant: messageSent.key?.remoteJid, remoteJid: messageSent.key.remoteJid,
status: 'EDITED', fromMe: messageSent.key.fromMe,
instanceId: this.instanceId, participant: messageSent.key?.remoteJid,
}; status: 'EDITED',
await this.prismaRepository.messageUpdate.create({ data: messageUpdate }); instanceId: this.instanceId,
};
await this.prismaRepository.messageUpdate.create({ data: messageUpdate });
}
} }
} }
} }
@@ -3985,7 +4044,9 @@ export class BaileysStartupService extends ChannelStartupService {
let pic: WAMediaUpload; let pic: WAMediaUpload;
if (isURL(picture.image)) { if (isURL(picture.image)) {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const url = `${picture.image}?timestamp=${timestamp}`; const parsedURL = new URL(picture.image);
parsedURL.searchParams.set('timestamp', timestamp.toString());
const url = parsedURL.toString();
let config: any = { responseType: 'arraybuffer' }; let config: any = { responseType: 'arraybuffer' };

View File

@@ -567,6 +567,13 @@ export class ChatwootService {
} }
public async createConversation(instance: InstanceDto, body: any) { public async createConversation(instance: InstanceDto, body: any) {
if (!body?.key) {
this.logger.warn(
`body.key is null or undefined in createConversation. Full body object: ${JSON.stringify(body)}`,
);
return null;
}
const isLid = body.key.previousRemoteJid?.includes('@lid') && body.key.senderPn; const isLid = body.key.previousRemoteJid?.includes('@lid') && body.key.senderPn;
const remoteJid = body.key.remoteJid; const remoteJid = body.key.remoteJid;
const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`;
@@ -674,7 +681,7 @@ export class ChatwootService {
instance, instance,
body.key.participant.split('@')[0], body.key.participant.split('@')[0],
filterInbox.id, filterInbox.id,
isGroup, false,
body.pushName, body.pushName,
picture_url.profilePictureUrl || null, picture_url.profilePictureUrl || null,
body.key.participant, body.key.participant,
@@ -1893,6 +1900,12 @@ export class ChatwootService {
public async eventWhatsapp(event: string, instance: InstanceDto, body: any) { public async eventWhatsapp(event: string, instance: InstanceDto, body: any) {
try { try {
// Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE)
if (body?.type && body.type !== 'message' && body.type !== 'conversation') {
this.logger.verbose(`Ignoring non-message event type: ${body.type}`);
return;
}
const waInstance = this.waMonitor.waInstances[instance.instanceName]; const waInstance = this.waMonitor.waInstances[instance.instanceName];
if (!waInstance) { if (!waInstance) {
@@ -1938,6 +1951,11 @@ export class ChatwootService {
} }
if (event === 'messages.upsert' || event === 'send.message') { if (event === 'messages.upsert' || event === 'send.message') {
if (!body?.key) {
this.logger.warn(`body.key is null or undefined. Full body object: ${JSON.stringify(body)}`);
return;
}
if (body.key.remoteJid === 'status@broadcast') { if (body.key.remoteJid === 'status@broadcast') {
return; return;
} }
@@ -2260,10 +2278,23 @@ export class ChatwootService {
} }
if (event === 'messages.edit' || event === 'send.message.update') { if (event === 'messages.edit' || event === 'send.message.update') {
// Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE)
if (body?.type && body.type !== 'message') {
this.logger.verbose(`Ignoring non-message event type: ${body.type}`);
return;
}
if (!body?.key?.id) {
this.logger.warn(
`body.key.id is null or undefined in messages.edit. Full body object: ${JSON.stringify(body)}`,
);
return;
}
const editedText = `${ const editedText = `${
body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text
}\n\n_\`${i18next.t('cw.message.edited')}.\`_`; }\n\n_\`${i18next.t('cw.message.edited')}.\`_`;
const message = await this.getMessageByKeyId(instance, body?.key?.id); const message = await this.getMessageByKeyId(instance, body.key.id);
const key = message.key as { const key = message.key as {
id: string; id: string;
fromMe: boolean; fromMe: boolean;

View File

@@ -49,6 +49,7 @@ export class N8nService extends BaseChatbotService<N8n, N8nSetting> {
sessionId: session.sessionId, sessionId: session.sessionId,
remoteJid: remoteJid, remoteJid: remoteJid,
pushName: pushName, pushName: pushName,
keyId: msg?.key?.id,
fromMe: msg?.key?.fromMe, fromMe: msg?.key?.fromMe,
instanceName: instance.instanceName, instanceName: instance.instanceName,
serverUrl: this.configService.get<HttpServer>('SERVER').URL, serverUrl: this.configService.get<HttpServer>('SERVER').URL,

View File

@@ -45,7 +45,7 @@ export class RabbitmqController extends EventController implements EventControll
heartbeat: 30, // Add heartbeat of 30 seconds heartbeat: 30, // Add heartbeat of 30 seconds
}; };
amqp.connect(connectionOptions, (error, connection) => { amqp.connect(connectionOptions, (error: Error, connection: amqp.Connection) => {
if (error) { if (error) {
this.logger.error({ this.logger.error({
local: 'RabbitmqController.connect', local: 'RabbitmqController.connect',
@@ -57,7 +57,7 @@ export class RabbitmqController extends EventController implements EventControll
} }
// Connection event handlers // Connection event handlers
connection.on('error', (err) => { connection.on('error', (err: Error) => {
this.logger.error({ this.logger.error({
local: 'RabbitmqController.connectionError', local: 'RabbitmqController.connectionError',
message: 'RabbitMQ connection error', message: 'RabbitMQ connection error',
@@ -71,7 +71,7 @@ export class RabbitmqController extends EventController implements EventControll
this.handleConnectionLoss(); this.handleConnectionLoss();
}); });
connection.createChannel((channelError, channel) => { connection.createChannel((channelError: Error, channel: amqp.Channel) => {
if (channelError) { if (channelError) {
this.logger.error({ this.logger.error({
local: 'RabbitmqController.createChannel', local: 'RabbitmqController.createChannel',
@@ -83,7 +83,7 @@ export class RabbitmqController extends EventController implements EventControll
} }
// Channel event handlers // Channel event handlers
channel.on('error', (err) => { channel.on('error', (err: Error) => {
this.logger.error({ this.logger.error({
local: 'RabbitmqController.channelError', local: 'RabbitmqController.channelError',
message: 'RabbitMQ channel error', message: 'RabbitMQ channel error',
@@ -136,8 +136,7 @@ export class RabbitmqController extends EventController implements EventControll
return; // Already attempting to reconnect return; // Already attempting to reconnect
} }
this.amqpChannel = null; this.cleanup();
this.amqpConnection = null;
this.scheduleReconnect(); this.scheduleReconnect();
} }
@@ -406,4 +405,25 @@ export class RabbitmqController extends EventController implements EventControll
} }
} }
} }
public async cleanup(): Promise<void> {
try {
if (this.amqpChannel) {
await this.amqpChannel.close();
this.amqpChannel = null;
}
if (this.amqpConnection) {
await this.amqpConnection.close();
this.amqpConnection = null;
}
} catch (error) {
this.logger.warn({
local: 'RabbitmqController.cleanup',
message: 'Error during cleanup',
error: error.message || error,
});
this.amqpChannel = null;
this.amqpConnection = null;
}
}
} }

View File

@@ -30,8 +30,12 @@ export class WebsocketController extends EventController implements EventControl
const url = new URL(req.url || '', 'http://localhost'); const url = new URL(req.url || '', 'http://localhost');
const params = new URLSearchParams(url.search); const params = new URLSearchParams(url.search);
const { remoteAddress } = req.socket;
const isLocalhost =
remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1';
// Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4) // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4)
if (params.has('EIO')) { if (params.has('EIO') && isLocalhost) {
return callback(null, true); return callback(null, true);
} }

View File

@@ -191,6 +191,16 @@ export class ChatRouter extends RouterBroker {
return res.status(HttpStatus.OK).json(response); return res.status(HttpStatus.OK).json(response);
}) })
.get(this.routerPath('findChatByRemoteJid'), ...guards, async (req, res) => {
const instance = req.params as unknown as InstanceDto;
const { remoteJid } = req.query as unknown as { remoteJid: string };
if (!remoteJid) {
return res.status(HttpStatus.BAD_REQUEST).json({ error: 'remoteJid is a required query parameter' });
}
const response = await chatController.findChatByRemoteJid(instance, remoteJid);
return res.status(HttpStatus.OK).json(response);
})
// Profile routes // Profile routes
.post(this.routerPath('fetchBusinessProfile'), ...guards, async (req, res) => { .post(this.routerPath('fetchBusinessProfile'), ...guards, async (req, res) => {
const response = await this.dataValidate<ProfilePictureDto>({ const response = await this.dataValidate<ProfilePictureDto>({

View File

@@ -69,8 +69,7 @@ router
clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME,
manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined,
documentation: `https://doc.evolution-api.com`, documentation: `https://doc.evolution-api.com`,
whatsappWebVersion: whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'),
process.env.CONFIG_SESSION_PHONE_VERSION || (await fetchLatestWaWebVersion({})).version.join('.'),
}); });
}) })
.post('/verify-creds', authGuard['apikey'], async (req, res) => { .post('/verify-creds', authGuard['apikey'], async (req, res) => {

View File

@@ -696,6 +696,16 @@ export class ChannelStartupService {
}); });
} }
public async findChatByRemoteJid(remoteJid: string) {
if (!remoteJid) return null;
return await this.prismaRepository.chat.findFirst({
where: {
instanceId: this.instanceId,
remoteJid: remoteJid,
},
});
}
public async fetchChats(query: any) { public async fetchChats(query: any) {
const remoteJid = query?.where?.remoteJid const remoteJid = query?.where?.remoteJid
? query?.where?.remoteJid.includes('@') ? query?.where?.remoteJid.includes('@')
@@ -740,21 +750,21 @@ export class ChannelStartupService {
"Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires", "Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires",
"Chat"."unreadMessages" as "unreadMessages", "Chat"."unreadMessages" as "unreadMessages",
CASE WHEN "Chat"."createdAt" + INTERVAL '24 hours' > NOW() THEN true ELSE false END as "windowActive", CASE WHEN "Chat"."createdAt" + INTERVAL '24 hours' > NOW() THEN true ELSE false END as "windowActive",
"Message"."id" AS lastMessageId, "Message"."id" AS "lastMessageId",
"Message"."key" AS lastMessage_key, "Message"."key" AS "lastMessage_key",
CASE CASE
WHEN "Message"."key"->>'fromMe' = 'true' THEN 'Você' WHEN "Message"."key"->>'fromMe' = 'true' THEN 'Você'
ELSE "Message"."pushName" ELSE "Message"."pushName"
END AS lastMessagePushName, END AS "lastMessagePushName",
"Message"."participant" AS lastMessageParticipant, "Message"."participant" AS "lastMessageParticipant",
"Message"."messageType" AS lastMessageMessageType, "Message"."messageType" AS "lastMessageMessageType",
"Message"."message" AS lastMessageMessage, "Message"."message" AS "lastMessageMessage",
"Message"."contextInfo" AS lastMessageContextInfo, "Message"."contextInfo" AS "lastMessageContextInfo",
"Message"."source" AS lastMessageSource, "Message"."source" AS "lastMessageSource",
"Message"."messageTimestamp" AS lastMessageMessageTimestamp, "Message"."messageTimestamp" AS "lastMessageMessageTimestamp",
"Message"."instanceId" AS lastMessageInstanceId, "Message"."instanceId" AS "lastMessageInstanceId",
"Message"."sessionId" AS lastMessageSessionId, "Message"."sessionId" AS "lastMessageSessionId",
"Message"."status" AS lastMessageStatus "Message"."status" AS "lastMessageStatus"
FROM "Message" FROM "Message"
LEFT JOIN "Contact" ON "Contact"."remoteJid" = "Message"."key"->>'remoteJid' AND "Contact"."instanceId" = "Message"."instanceId" LEFT JOIN "Contact" ON "Contact"."remoteJid" = "Message"."key"->>'remoteJid' AND "Contact"."instanceId" = "Message"."instanceId"
LEFT JOIN "Chat" ON "Chat"."remoteJid" = "Message"."key"->>'remoteJid' AND "Chat"."instanceId" = "Message"."instanceId" LEFT JOIN "Chat" ON "Chat"."remoteJid" = "Message"."key"->>'remoteJid' AND "Chat"."instanceId" = "Message"."instanceId"
@@ -771,44 +781,38 @@ export class ChannelStartupService {
if (results && isArray(results) && results.length > 0) { if (results && isArray(results) && results.length > 0) {
const mappedResults = results.map((contact) => { const mappedResults = results.map((contact) => {
const lastMessage = contact.lastmessageid const lastMessage = contact.lastMessageId
? { ? {
id: contact.lastmessageid, id: contact.lastMessageId,
key: contact.lastmessage_key, key: contact.lastMessage_key,
pushName: contact.lastmessagepushname, pushName: contact.lastMessagePushName,
participant: contact.lastmessageparticipant, participant: contact.lastMessageParticipant,
messageType: contact.lastmessagemessagetype, messageType: contact.lastMessageMessageType,
message: contact.lastmessagemessage, message: contact.lastMessageMessage,
contextInfo: contact.lastmessagecontextinfo, contextInfo: contact.lastMessageContextInfo,
source: contact.lastmessagesource, source: contact.lastMessageSource,
messageTimestamp: contact.lastmessagemessagetimestamp, messageTimestamp: contact.lastMessageMessageTimestamp,
instanceId: contact.lastmessageinstanceid, instanceId: contact.lastMessageInstanceId,
sessionId: contact.lastmessagesessionid, sessionId: contact.lastMessageSessionId,
status: contact.lastmessagestatus, status: contact.lastMessageStatus,
} }
: undefined; : undefined;
return { return {
id: contact.contactid || null, id: contact.contactId || null,
remoteJid: contact.remotejid, remoteJid: contact.remoteJid,
pushName: contact.pushname, pushName: contact.pushName,
profilePicUrl: contact.profilepicurl, profilePicUrl: contact.profilePicUrl,
updatedAt: contact.updatedat, updatedAt: contact.updatedAt,
windowStart: contact.windowstart, windowStart: contact.windowStart,
windowExpires: contact.windowexpires, windowExpires: contact.windowExpires,
windowActive: contact.windowactive, windowActive: contact.windowActive,
lastMessage: lastMessage ? this.cleanMessageData(lastMessage) : undefined, lastMessage: lastMessage ? this.cleanMessageData(lastMessage) : undefined,
unreadCount: contact.unreadMessages, unreadCount: contact.unreadMessages,
isSaved: !!contact.contactid, isSaved: !!contact.contactId,
}; };
}); });
if (query?.take && query?.skip) {
const skip = query.skip || 0;
const take = query.take || 20;
return mappedResults.slice(skip, skip + take);
}
return mappedResults; return mappedResults;
} }

View File

@@ -249,7 +249,7 @@ export type Webhook = {
}; };
}; };
export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPusher }; export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPusher };
export type ConfigSessionPhone = { CLIENT: string; NAME: string; VERSION: string }; export type ConfigSessionPhone = { CLIENT: string; NAME: string };
export type QrCode = { LIMIT: number; COLOR: string }; export type QrCode = { LIMIT: number; COLOR: string };
export type Typebot = { ENABLED: boolean; API_VERSION: string; SEND_MEDIA_BASE64: boolean }; export type Typebot = { ENABLED: boolean; API_VERSION: string; SEND_MEDIA_BASE64: boolean };
export type Chatwoot = { export type Chatwoot = {
@@ -590,7 +590,6 @@ export class ConfigService {
CONFIG_SESSION_PHONE: { CONFIG_SESSION_PHONE: {
CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API', CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API',
NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome', NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome',
VERSION: process.env?.CONFIG_SESSION_PHONE_VERSION || null,
}, },
QRCODE: { QRCODE: {
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30, LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,

View File

@@ -1,4 +1,5 @@
import { HttpsProxyAgent } from 'https-proxy-agent'; import { HttpsProxyAgent } from 'https-proxy-agent';
import { SocksProxyAgent } from 'socks-proxy-agent';
type Proxy = { type Proxy = {
host: string; host: string;
@@ -8,9 +9,28 @@ type Proxy = {
username?: string; username?: string;
}; };
export function makeProxyAgent(proxy: Proxy | string) { function selectProxyAgent(proxyUrl: string): HttpsProxyAgent<string> | SocksProxyAgent {
const url = new URL(proxyUrl);
// NOTE: The following constants are not used in the function but are defined for clarity.
// When a proxy URL is used to build the URL object, the protocol returned by procotol's property contains a `:` at
// the end so, we add the protocol constants without the `:` to avoid confusion.
const PROXY_HTTP_PROTOCOL = 'http:';
const PROXY_SOCKS_PROTOCOL = 'socks:';
switch (url.protocol) {
case PROXY_HTTP_PROTOCOL:
return new HttpsProxyAgent(url);
case PROXY_SOCKS_PROTOCOL:
return new SocksProxyAgent(url);
default:
throw new Error(`Unsupported proxy protocol: ${url.protocol}`);
}
}
export function makeProxyAgent(proxy: Proxy | string): HttpsProxyAgent<string> | SocksProxyAgent {
if (typeof proxy === 'string') { if (typeof proxy === 'string') {
return new HttpsProxyAgent(proxy); return selectProxyAgent(proxy);
} }
const { host, password, port, protocol, username } = proxy; const { host, password, port, protocol, username } = proxy;
@@ -19,5 +39,6 @@ export function makeProxyAgent(proxy: Proxy | string) {
if (username && password) { if (username && password) {
proxyUrl = `${protocol}://${username}:${password}@${host}:${port}`; proxyUrl = `${protocol}://${username}:${password}@${host}:${port}`;
} }
return new HttpsProxyAgent(proxyUrl);
return selectProxyAgent(proxyUrl);
} }