Skip to content

Commit bd64b0c

Browse files
committed
Merge branch 'release/1.5.1'
2 parents 5bc33ac + e1c8928 commit bd64b0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1317
-218
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# 1.5.1 (2023-09-17 13:50)
2+
3+
### Feature
4+
5+
* Added listening_from_me option in Set Typebot
6+
* Added variables options in Start Typebot
7+
* Added webhooks for typebot events
8+
* Added ChamaAI integration
9+
* Added webhook to send errors
10+
* Added support for messaging with ads on chatwoot
11+
12+
### Fixed
13+
14+
* Fix looping connection messages in chatwoot
15+
* Improved performance of fetch instances
16+
117
# 1.5.0 (2023-08-18 12:47)
218

319
### Feature

Docker/.env.example

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,19 @@ WEBHOOK_EVENTS_CONNECTION_UPDATE=true
8181
WEBHOOK_EVENTS_CALL=true
8282
# This event fires every time a new token is requested via the refresh route
8383
WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
84+
# This events is used with Typebot
85+
WEBHOOK_EVENTS_TYPEBOT_START=false
86+
WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
87+
# This event is used with Chama AI
88+
WEBHOOK_EVENTS_CHAMA_AI_ACTION=false
89+
# This event is used to send errors
90+
WEBHOOK_EVENTS_ERRORS=false
91+
WEBHOOK_EVENTS_ERRORS_WEBHOOK=
8492

8593
# Name that will be displayed on smartphone connection
8694
CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
87-
# Browser Name = chrome | firefox | edge | opera | safari
88-
CONFIG_SESSION_PHONE_NAME=chrome
95+
# Browser Name = Chrome | Firefox | Edge | Opera | Safari
96+
CONFIG_SESSION_PHONE_NAME=Chrome
8997

9098
# Set qrcode display limit
9199
QRCODE_LIMIT=30

Docker/docker-compose.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.3'
2+
3+
services:
4+
5+
api:
6+
container_name: evolution_api
7+
image: davidsongomes/evolution-api
8+
restart: always
9+
ports:
10+
- 8080:8080
11+
volumes:
12+
- evolution_instances:/evolution/instances
13+
- evolution_store:/evolution/store
14+
env_file:
15+
- .env
16+
command: ['node', './dist/src/main.js']
17+
expose:
18+
- 8080
19+
20+
volumes:
21+
evolution_instances:
22+
evolution_store:
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Server URL - Set your application url
2+
SERVER_URL='http://localhost:8080'
3+
4+
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
5+
CORS_ORIGIN='*'
6+
CORS_METHODS='POST,GET,PUT,DELETE'
7+
CORS_CREDENTIALS=true
8+
9+
# Determine the logs to be displayed
10+
LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS'
11+
LOG_COLOR=true
12+
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
13+
LOG_BAILEYS=error
14+
15+
# Determine how long the instance should be deleted from memory in case of no connection.
16+
# Default time: 5 minutes
17+
# If you don't even want an expiration, enter the value false
18+
DEL_INSTANCE=false
19+
20+
# Temporary data storage
21+
STORE_MESSAGES=true
22+
STORE_MESSAGE_UP=true
23+
STORE_CONTACTS=true
24+
STORE_CHATS=true
25+
26+
# Set Store Interval in Seconds (7200 = 2h)
27+
CLEAN_STORE_CLEANING_INTERVAL=7200
28+
CLEAN_STORE_MESSAGES=true
29+
CLEAN_STORE_MESSAGE_UP=true
30+
CLEAN_STORE_CONTACTS=true
31+
CLEAN_STORE_CHATS=true
32+
33+
# Permanent data storage
34+
DATABASE_ENABLED=true
35+
DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
36+
DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
37+
38+
# Choose the data you want to save in the application's database or store
39+
DATABASE_SAVE_DATA_INSTANCE=false
40+
DATABASE_SAVE_DATA_NEW_MESSAGE=false
41+
DATABASE_SAVE_MESSAGE_UPDATE=false
42+
DATABASE_SAVE_DATA_CONTACTS=false
43+
DATABASE_SAVE_DATA_CHATS=false
44+
45+
REDIS_ENABLED=true
46+
REDIS_URI=redis://redis:6379
47+
REDIS_PREFIX_KEY=evolution
48+
49+
# Global Webhook Settings
50+
# Each instance's Webhook URL and events will be requested at the time it is created
51+
## Define a global webhook that will listen for enabled events from all instances
52+
WEBHOOK_GLOBAL_URL=''
53+
WEBHOOK_GLOBAL_ENABLED=false
54+
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
55+
WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
56+
## Set the events you want to hear
57+
WEBHOOK_EVENTS_APPLICATION_STARTUP=false
58+
WEBHOOK_EVENTS_QRCODE_UPDATED=true
59+
WEBHOOK_EVENTS_MESSAGES_SET=true
60+
WEBHOOK_EVENTS_MESSAGES_UPSERT=true
61+
WEBHOOK_EVENTS_MESSAGES_UPDATE=true
62+
WEBHOOK_EVENTS_MESSAGES_DELETE=true
63+
WEBHOOK_EVENTS_SEND_MESSAGE=true
64+
WEBHOOK_EVENTS_CONTACTS_SET=true
65+
WEBHOOK_EVENTS_CONTACTS_UPSERT=true
66+
WEBHOOK_EVENTS_CONTACTS_UPDATE=true
67+
WEBHOOK_EVENTS_PRESENCE_UPDATE=true
68+
WEBHOOK_EVENTS_CHATS_SET=true
69+
WEBHOOK_EVENTS_CHATS_UPSERT=true
70+
WEBHOOK_EVENTS_CHATS_UPDATE=true
71+
WEBHOOK_EVENTS_CHATS_DELETE=true
72+
WEBHOOK_EVENTS_GROUPS_UPSERT=true
73+
WEBHOOK_EVENTS_GROUPS_UPDATE=true
74+
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
75+
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
76+
# This event fires every time a new token is requested via the refresh route
77+
WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
78+
79+
# Name that will be displayed on smartphone connection
80+
CONFIG_SESSION_PHONE_CLIENT='Evolution API'
81+
# Browser Name = chrome | firefox | edge | opera | safari
82+
CONFIG_SESSION_PHONE_NAME=chrome
83+
84+
# Set qrcode display limit
85+
QRCODE_LIMIT=30
86+
87+
# Defines an authentication type for the api
88+
# We recommend using the apikey because it will allow you to use a custom token,
89+
# if you use jwt, a random token will be generated and may be expired and you will have to generate a new token
90+
# jwt or 'apikey'
91+
AUTHENTICATION_TYPE='apikey'
92+
## Define a global apikey to access all instances.
93+
### OBS: This key must be inserted in the request header to create an instance.
94+
AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976'
95+
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
96+
## Set the secret key to encrypt and decrypt your token and its expiration time
97+
# seconds - 3600s ===1h | zero (0) - never expires
98+
AUTHENTICATION_JWT_EXPIRIN_IN=0
99+
AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG'
100+
# Set the instance name and webhook url to create an instance in init the application
101+
# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event
102+
# container or server
103+
AUTHENTICATION_INSTANCE_MODE=server
104+
# if you are using container mode, set the container name and the webhook url to default instance
105+
AUTHENTICATION_INSTANCE_NAME=evolution
106+
AUTHENTICATION_INSTANCE_WEBHOOK_URL=''
107+
AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID=1
108+
AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456
109+
AUTHENTICATION_INSTANCE_CHATWOOT_URL=''
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
version: '3.3'
2+
3+
services:
4+
5+
mongodb:
6+
container_name: mongodb
7+
image: mongo
8+
restart: on-failure
9+
ports:
10+
- 27017:27017
11+
environment:
12+
- MONGO_INITDB_ROOT_USERNAME=root
13+
- MONGO_INITDB_ROOT_PASSWORD=root
14+
- PUID=1000
15+
- PGID=1000
16+
volumes:
17+
- evolution_mongodb_data:/data/db
18+
- evolution_mongodb_configdb:/data/configdb
19+
expose:
20+
- 27017
21+
22+
mongo-express:
23+
container_name: mongodb-express
24+
image: mongo-express
25+
restart: on-failure
26+
ports:
27+
- 8081:8081
28+
depends_on:
29+
- mongodb
30+
environment:
31+
ME_CONFIG_BASICAUTH_USERNAME: root
32+
ME_CONFIG_BASICAUTH_PASSWORD: root
33+
ME_CONFIG_MONGODB_SERVER: mongodb
34+
ME_CONFIG_MONGODB_ADMINUSERNAME: root
35+
ME_CONFIG_MONGODB_ADMINPASSWORD: root
36+
links:
37+
- mongodb
38+
39+
redis:
40+
container_name: redis
41+
image: redis:latest
42+
restart: on-failure
43+
ports:
44+
- 6379:6379
45+
command: >
46+
redis-server
47+
--port 6379
48+
--appendonly yes
49+
volumes:
50+
- evolution_redis:/data
51+
52+
rebrow:
53+
container_name: rebrow
54+
image: marian/rebrow
55+
restart: on-failure
56+
depends_on:
57+
- redis
58+
ports:
59+
- 5001:5001
60+
links:
61+
- redis
62+
63+
api:
64+
container_name: evolution_api
65+
image: davidsongomes/evolution-api
66+
restart: always
67+
depends_on:
68+
- mongodb
69+
- redis
70+
ports:
71+
- 8080:8080
72+
volumes:
73+
- evolution_instances:/evolution/instances
74+
- evolution_store:/evolution/store
75+
env_file:
76+
- .env
77+
command: ['node', './dist/src/main.js']
78+
expose:
79+
- 8080
80+
81+
volumes:
82+
evolution_mongodb_data:
83+
evolution_mongodb_configdb:
84+
evolution_redis:
85+
evolution_instances:
86+
evolution_store:
87+
88+
networks:
89+
evolution-net:
90+
external: true
91+

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:16.18-alpine
22

3-
LABEL version="1.5.0" description="Api to control whatsapp features through http requests."
3+
LABEL version="1.5.1" description="Api to control whatsapp features through http requests."
44
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
55
LABEL contact="[email protected]"
66

@@ -84,8 +84,16 @@ ENV WEBHOOK_EVENTS_CALL=true
8484

8585
ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
8686

87+
ENV WEBHOOK_EVENTS_TYPEBOT_START=false
88+
ENV WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
89+
90+
ENV WEBHOOK_EVENTS_CHAMA_AI_ACTION=false
91+
92+
ENV WEBHOOK_EVENTS_ERRORS=false
93+
ENV WEBHOOK_EVENTS_ERRORS_WEBHOOK=
94+
8795
ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
88-
ENV CONFIG_SESSION_PHONE_NAME=chrome
96+
ENV CONFIG_SESSION_PHONE_NAME=Chrome
8997

9098
ENV QRCODE_LIMIT=30
9199
ENV QRCODE_COLOR=#198754

Extras/appsmith/manager.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Extras/typebot/typebot-example.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/src/main.js",
66
"scripts": {
@@ -43,10 +43,10 @@
4343
"dependencies": {
4444
"@adiwajshing/keyed-db": "^0.2.4",
4545
"@ffmpeg-installer/ffmpeg": "^1.1.0",
46-
"@figuro/chatwoot-sdk": "^1.1.14",
46+
"@figuro/chatwoot-sdk": "^1.1.16",
4747
"@hapi/boom": "^10.0.1",
4848
"@sentry/node": "^7.59.2",
49-
"@whiskeysockets/baileys": "github:EvolutionAPI/Baileys",
49+
"@whiskeysockets/baileys": "^6.4.0",
5050
"amqplib": "^0.10.3",
5151
"axios": "^1.3.5",
5252
"class-validator": "^0.13.2",
@@ -69,14 +69,17 @@
6969
"mongoose": "^6.10.5",
7070
"node-cache": "^5.1.2",
7171
"node-mime-types": "^1.1.0",
72+
"node-windows": "^1.0.0-beta.8",
7273
"pino": "^8.11.0",
7374
"proxy-agent": "^6.3.0",
7475
"qrcode": "^1.5.1",
7576
"qrcode-terminal": "^0.12.0",
7677
"redis": "^4.6.5",
7778
"sharp": "^0.30.7",
7879
"socket.io": "^4.7.1",
79-
"uuid": "^9.0.0"
80+
"socks-proxy-agent": "^8.0.1",
81+
"uuid": "^9.0.0",
82+
"whatsapp-web.js": "^1.22.1"
8083
},
8184
"devDependencies": {
8285
"@types/compression": "^1.7.2",
@@ -86,6 +89,7 @@
8689
"@types/jsonwebtoken": "^8.5.9",
8790
"@types/mime-types": "^2.1.1",
8891
"@types/node": "^18.15.11",
92+
"@types/node-windows": "^0.1.2",
8993
"@types/qrcode": "^1.5.0",
9094
"@types/qrcode-terminal": "^0.12.0",
9195
"@types/uuid": "^8.3.4",

0 commit comments

Comments
 (0)