Skip to content

Commit c154205

Browse files
authored
Merge branch 'develop' into fetch-profile
2 parents 250e67e + 23534da commit c154205

123 files changed

Lines changed: 6420 additions & 1926 deletions

File tree

Some content is hidden

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

.DS_Store

0 Bytes
Binary file not shown.

.eslintrc.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ module.exports = {
33
parserOptions: {
44
sourceType: 'CommonJS',
55
},
6-
plugins: ['@typescript-eslint/eslint-plugin'],
6+
plugins: [
7+
'@typescript-eslint',
8+
'simple-import-sort',
9+
'import'
10+
],
711
extends: [
12+
'eslint:recommended',
813
'plugin:@typescript-eslint/recommended',
9-
'plugin:prettier/recommended',
1014
'plugin:prettier/recommended'
1115
],
1216
globals: {
@@ -26,7 +30,11 @@ module.exports = {
2630
'@typescript-eslint/no-explicit-any': 'off',
2731
'@typescript-eslint/no-empty-function': 'off',
2832
'@typescript-eslint/no-non-null-assertion': 'off',
29-
'@typescript-eslint/no-unused-vars': 'off',
33+
'@typescript-eslint/no-unused-vars': 'error',
34+
'import/first': 'error',
35+
'import/no-duplicates': 'error',
36+
'simple-import-sort/imports': 'error',
37+
'simple-import-sort/exports': 'error',
3038
'@typescript-eslint/ban-types': [
3139
'error',
3240
{

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ lerna-debug.log*
1616
/docker-compose-data
1717
/docker-data
1818

19+
docker-compose.yaml
20+
1921
# Package
2022
/yarn.lock
2123
/package-lock.json
2224

23-
# IDE - VSCode
25+
# IDEs
2426
.vscode/*
2527
!.vscode/settings.json
2628
!.vscode/tasks.json
2729
!.vscode/launch.json
2830
!.vscode/extensions.json
31+
.nova/*
2932

3033
# Prisma
3134
/prisma/migrations
@@ -38,3 +41,6 @@ lerna-debug.log*
3841
/store
3942

4043
/temp/*
44+
45+
.DS_Store
46+
*.DS_Store

.prettierrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ module.exports = {
22
semi: true,
33
trailingComma: 'all',
44
singleQuote: true,
5-
printWidth: 90,
5+
printWidth: 120,
6+
arrowParens: 'always',
67
tabWidth: 2,
7-
bracketSameLine: true,
8-
bracketSpacing: true
8+
useTabs: false,
9+
bracketSameLine: false,
10+
bracketSpacing: true,
11+
parser: 'typescript'
912
}

CHANGELOG.md

Lines changed: 153 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,168 @@
1+
# 1.5.1 (homolog)
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+
11+
### Fixed
12+
13+
* Fix looping connection messages in chatwoot
14+
15+
# 1.5.0 (2023-08-18 12:47)
16+
17+
### Feature
18+
19+
* New instance manager in /manager route
20+
* Added extra files for chatwoot and appsmith
21+
* Added Get Last Message and Archive for Chat
22+
* Added env var QRCODE_COLOR
23+
* Added websocket to send events
24+
* Added rabbitmq to send events
25+
* Added Typebot integration
26+
* Added proxy endpoint
27+
* Added send and date_time in webhook data
28+
29+
### Fixed
30+
31+
* Solved problem when disconnecting from the instance the instance was deleted
32+
* Encoded spaces in chatwoot webhook
33+
* Adjustment in the saving of contacts, saving the information of the number and Jid
34+
* Update Dockerfile
35+
* If you pass empty events in create instance and set webhook it is understood as all
36+
* Fixed issue that did not output base64 averages
37+
* Messages sent by the api now arrive in chatwoot
38+
39+
### Integrations
40+
41+
- Chatwoot: v2.18.0 - v3.0.0
42+
- Typebot: v2.16.0
43+
- Manager Evolution API
44+
45+
# 1.4.8 (2023-07-27 10:27)
46+
47+
### Fixed
48+
49+
* Fixed error return bug
50+
51+
# 1.4.7 (2023-07-27 08:47)
52+
53+
### Fixed
54+
55+
* Fixed error return bug
56+
* Fixed problem of getting message when deleting message in chatwoot
57+
* Change in error return pattern
58+
59+
# 1.4.6 (2023-07-26 17:54)
60+
61+
### Fixed
62+
63+
* Fixed bug of creating new inbox by chatwoot
64+
* When conversation reopens is pending when conversation pending is true
65+
* Added docker-compose file with dockerhub image
66+
67+
# 1.4.5 (2023-07-26 09:32)
68+
69+
### Fixed
70+
71+
* Fixed problems in localization template in chatwoot
72+
* Fix mids going duplicated in chatwoot
73+
74+
# 1.4.4 (2023-07-25 15:24)
75+
76+
### Fixed
77+
78+
* Fixed chatwoot line wrap issue
79+
* Solved receive location in chatwoot
80+
* When requesting the pairing code, it also brings the qr code
81+
* Option reopen_conversation in chatwoot endpoint
82+
* Option conversation_pending in chatwoot endpoint
83+
84+
# 1.4.3 (2023-07-25 10:51)
85+
86+
### Fixed
87+
88+
* Adjusts in settings with options always_online, read_messages and read_status
89+
* Fixed send webhook for event CALL
90+
* Create instance with settings
91+
92+
# 1.4.2 (2023-07-24 20:52)
93+
94+
### Fixed
95+
96+
* Fixed validation is set settings
97+
* Adjusts in group validations
98+
* Ajusts in sticker message to chatwoot
99+
100+
# 1.4.1 (2023-07-24 18:28)
101+
102+
### Fixed
103+
104+
* Fixed reconnect with pairing code or qrcode
105+
* Fixed problem in createJid
106+
107+
# 1.4.0 (2023-07-24 17:03)
108+
109+
### Features
110+
111+
* Added connection functionality via pairing code
112+
* Added fetch profile endpoint in chat controller
113+
* Created settings controller
114+
* Added reject call and send text message when receiving a call
115+
* Added setting to ignore group messages
116+
* Added connection with pairing code in chatwoot with command /init:{NUMBER}
117+
* Added encoding option in endpoint sendWhatsAppAudio
118+
119+
### Fixed
120+
121+
* Added link preview option in send text message
122+
* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
123+
* Fixed issue where it was not possible to open a conversation when sent at first by me on my cell phone in chatwoot
124+
* Now it only updates the contact name if it is the same as the phone number in chatwoot
125+
* Now accepts all chatwoot inbox templates
126+
* Command to create new instances set to /new_instance:{NAME}:{NUMBER}
127+
* Fix in chatwoot set, sign msg can now be disabled
128+
129+
### Integrations
130+
131+
- Chatwoot: v2.18.0 - v3.0.0 (Beta)
132+
133+
# 1.3.2 (2023-07-21 17:19)
134+
135+
### Fixed
136+
137+
* Fix in update settings that needed to restart after updated
138+
* Correction in the use of the api with mongodb
139+
* Adjustments to search endpoint for contacts, chats, messages and Status messages
140+
* Now when deleting the instance, the data referring to it in mongodb is also deleted
141+
* It is now validated if the instance name contains uppercase and special characters
142+
* For compatibility reasons, container mode has been removed
143+
* Added docker-compose files example
144+
145+
### Integrations
146+
147+
- Chatwoot: v2.18.0
148+
1149
# 1.3.1 (2023-07-20 07:48)
2150

3151
### Fixed
4152

5153
* Adjust in create store files
6154

155+
### Integrations
156+
157+
- Chatwoot: v2.18.0
158+
7159
# 1.3.0 (2023-07-19 11:33)
8160

9161
### Features
10162

11163
* Added messages.delete event
12164
* Added restart instance endpoint
13-
* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:<INSTANCE_NAME>'
165+
* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:{INSTANCE_NAME}
14166
* Change Baileys version to: 6.4.0
15167
* Send contact in chatwoot
16168
* Send contact array in chatwoot

Docker/.env.example

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Server URL - Set your application url
2-
SERVER_URL='http://localhost:8080'
2+
SERVER_URL=http://localhost:8080
33

44
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
5-
CORS_ORIGIN='*'
6-
CORS_METHODS='POST,GET,PUT,DELETE'
5+
CORS_ORIGIN=*
6+
CORS_METHODS=POST,GET,PUT,DELETE
77
CORS_CREDENTIALS=true
88

99
# Determine the logs to be displayed
10-
LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS'
10+
LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS
1111
LOG_COLOR=true
1212
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
1313
LOG_BAILEYS=error
@@ -33,7 +33,7 @@ CLEAN_STORE_CHATS=true
3333
# Permanent data storage
3434
DATABASE_ENABLED=false
3535
DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
36-
DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
36+
DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker
3737

3838
# Choose the data you want to save in the application's database or store
3939
DATABASE_SAVE_DATA_INSTANCE=false
@@ -44,7 +44,12 @@ DATABASE_SAVE_DATA_CHATS=false
4444

4545
REDIS_ENABLED=false
4646
REDIS_URI=redis://redis:6379
47-
REDIS_PREFIX_KEY=evolution
47+
REDIS_PREFIX_KEY=evdocker
48+
49+
RABBITMQ_ENABLED=false
50+
RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672
51+
52+
WEBSOCKET_ENABLED=false
4853

4954
# Global Webhook Settings
5055
# Each instance's Webhook URL and events will be requested at the time it is created
@@ -73,37 +78,37 @@ WEBHOOK_EVENTS_GROUPS_UPSERT=true
7378
WEBHOOK_EVENTS_GROUPS_UPDATE=true
7479
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
7580
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
81+
WEBHOOK_EVENTS_CALL=true
7682
# This event fires every time a new token is requested via the refresh route
7783
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=
7892

7993
# 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
94+
CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
95+
# Browser Name = Chrome | Firefox | Edge | Opera | Safari
96+
CONFIG_SESSION_PHONE_NAME=Chrome
8397

8498
# Set qrcode display limit
8599
QRCODE_LIMIT=30
100+
QRCODE_COLOR=#198754
86101

87102
# Defines an authentication type for the api
88103
# We recommend using the apikey because it will allow you to use a custom token,
89104
# if you use jwt, a random token will be generated and may be expired and you will have to generate a new token
90105
# jwt or 'apikey'
91-
AUTHENTICATION_TYPE='apikey'
106+
AUTHENTICATION_TYPE=apikey
92107
## Define a global apikey to access all instances.
93108
### OBS: This key must be inserted in the request header to create an instance.
94-
AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976'
109+
AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976
95110
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
96111
## Set the secret key to encrypt and decrypt your token and its expiration time
97112
# seconds - 3600s ===1h | zero (0) - never expires
98113
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=''
114+
AUTHENTICATION_JWT_SECRET='L=0YWt]b2w[WF>#>:&E`'

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:

0 commit comments

Comments
 (0)