Skip to content

Commit 530aec9

Browse files
committed
Merge branch 'release/1.5.0'
2 parents eff5bb7 + deb8f2a commit 530aec9

Some content is hidden

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

74 files changed

+3703
-282
lines changed

.DS_Store

0 Bytes
Binary file not shown.

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# 1.5.0 (2023-08-18 12:47)
2+
3+
### Feature
4+
5+
* New instance manager in /manager route
6+
* Added extra files for chatwoot and appsmith
7+
* Added Get Last Message and Archive for Chat
8+
* Added env var QRCODE_COLOR
9+
* Added websocket to send events
10+
* Added rabbitmq to send events
11+
* Added Typebot integration
12+
* Added proxy endpoint
13+
* Added send and date_time in webhook data
14+
15+
### Fixed
16+
17+
* Solved problem when disconnecting from the instance the instance was deleted
18+
* Encoded spaces in chatwoot webhook
19+
* Adjustment in the saving of contacts, saving the information of the number and Jid
20+
* Update Dockerfile
21+
* If you pass empty events in create instance and set webhook it is understood as all
22+
* Fixed issue that did not output base64 averages
23+
* Messages sent by the api now arrive in chatwoot
24+
25+
### Integrations
26+
27+
- Chatwoot: v2.18.0 - v3.0.0
28+
- Typebot: v2.16.0
29+
- Manager Evolution API
30+
131
# 1.4.8 (2023-07-27 10:27)
232

333
### Fixed

Docker/.env.example

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CLEAN_STORE_CONTACTS=true
3131
CLEAN_STORE_CHATS=true
3232

3333
# Permanent data storage
34-
DATABASE_ENABLED=true
34+
DATABASE_ENABLED=false
3535
DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
3636
DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker
3737

@@ -42,10 +42,15 @@ DATABASE_SAVE_MESSAGE_UPDATE=false
4242
DATABASE_SAVE_DATA_CONTACTS=false
4343
DATABASE_SAVE_DATA_CHATS=false
4444

45-
REDIS_ENABLED=true
45+
REDIS_ENABLED=false
4646
REDIS_URI=redis://redis:6379
4747
REDIS_PREFIX_KEY=evdocker
4848

49+
RABBITMQ_ENABLED=false
50+
RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672
51+
52+
WEBSOCKET_ENABLED=false
53+
4954
# Global Webhook Settings
5055
# Each instance's Webhook URL and events will be requested at the time it is created
5156
## Define a global webhook that will listen for enabled events from all instances
@@ -84,6 +89,7 @@ CONFIG_SESSION_PHONE_NAME=chrome
8489

8590
# Set qrcode display limit
8691
QRCODE_LIMIT=30
92+
QRCODE_COLOR=#198754
8793

8894
# Defines an authentication type for the api
8995
# We recommend using the apikey because it will allow you to use a custom token,

Dockerfile

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

3-
LABEL version="1.1.3" description="Api to control whatsapp features through http requests."
3+
LABEL version="1.5.0" 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

77
RUN apk update && apk upgrade && \
8-
apk add --no-cache git
8+
apk add --no-cache git tzdata ffmpeg wget curl
99

1010
WORKDIR /evolution
1111

1212
COPY ./package.json .
1313

14+
ENV TZ=America/Sao_Paulo
1415
ENV DOCKER_ENV=true
1516

1617
ENV SERVER_URL=http://localhost:8080
@@ -50,7 +51,12 @@ ENV REDIS_ENABLED=false
5051
ENV REDIS_URI=redis://redis:6379
5152
ENV REDIS_PREFIX_KEY=evolution
5253

53-
ENV WEBHOOK_GLOBAL_URL=<url>
54+
ENV RABBITMQ_ENABLED=false
55+
ENV RABBITMQ_URI=amqp://guest:guest@rabbitmq:5672
56+
57+
ENV WEBSOCKET_ENABLED=false
58+
59+
ENV WEBHOOK_GLOBAL_URL=
5460
ENV WEBHOOK_GLOBAL_ENABLED=false
5561

5662
ENV WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
@@ -82,6 +88,7 @@ ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
8288
ENV CONFIG_SESSION_PHONE_NAME=chrome
8389

8490
ENV QRCODE_LIMIT=30
91+
ENV QRCODE_COLOR=#198754
8592

8693
ENV AUTHENTICATION_TYPE=apikey
8794

Extras/appsmith/manager.json

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

Extras/chatwoot/configurar_admin.json

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
{
2+
"name": "[Evolution] Configurar Admin",
3+
"nodes": [
4+
{
5+
"parameters": {
6+
"values": {
7+
"string": [
8+
{
9+
"name": "api_access_token",
10+
"value": "CHATWOOT_ADMIN_USER_TOKEN"
11+
},
12+
{
13+
"name": "chatwoot_url",
14+
"value": "https://CHATWOOT_URL"
15+
},
16+
{
17+
"name": "n8n_url",
18+
"value": "https://N8N_URL"
19+
},
20+
{
21+
"name": "organization",
22+
"value": "ORGANIZATION_NAME"
23+
},
24+
{
25+
"name": "logo",
26+
"value": "ORGANIZATION_LOGO"
27+
}
28+
]
29+
},
30+
"options": {}
31+
},
32+
"id": "7a89a538-2cae-4032-8896-09627c07bc68",
33+
"name": "Info Base",
34+
"type": "n8n-nodes-base.set",
35+
"typeVersion": 2,
36+
"position": [
37+
620,
38+
480
39+
]
40+
},
41+
{
42+
"parameters": {
43+
"method": "POST",
44+
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/contacts/",
45+
"sendHeaders": true,
46+
"headerParameters": {
47+
"parameters": [
48+
{
49+
"name": "api_access_token",
50+
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
51+
}
52+
]
53+
},
54+
"sendBody": true,
55+
"specifyBody": "json",
56+
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}",
57+
"options": {}
58+
},
59+
"id": "12a39df3-6b95-4f83-a0bc-50b25adaca7f",
60+
"name": "Cria Contato Bot",
61+
"type": "n8n-nodes-base.httpRequest",
62+
"typeVersion": 3,
63+
"position": [
64+
1020,
65+
480
66+
]
67+
},
68+
{
69+
"parameters": {
70+
"method": "POST",
71+
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/inboxes/",
72+
"sendHeaders": true,
73+
"headerParameters": {
74+
"parameters": [
75+
{
76+
"name": "api_access_token",
77+
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
78+
}
79+
]
80+
},
81+
"sendBody": true,
82+
"specifyBody": "json",
83+
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
84+
"options": {}
85+
},
86+
"id": "bed7c54d-e232-4fe4-9584-0515e9679868",
87+
"name": "Cria Inbox Start",
88+
"type": "n8n-nodes-base.httpRequest",
89+
"typeVersion": 3,
90+
"position": [
91+
820,
92+
480
93+
]
94+
},
95+
{
96+
"parameters": {},
97+
"id": "36ada769-a757-4193-989b-0cc4ea504b80",
98+
"name": "When clicking \"Execute Workflow\"",
99+
"type": "n8n-nodes-base.manualTrigger",
100+
"typeVersion": 1,
101+
"position": [
102+
420,
103+
480
104+
]
105+
},
106+
{
107+
"parameters": {
108+
"method": "POST",
109+
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/",
110+
"sendHeaders": true,
111+
"headerParameters": {
112+
"parameters": [
113+
{
114+
"name": "api_access_token",
115+
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
116+
}
117+
]
118+
},
119+
"sendBody": true,
120+
"specifyBody": "json",
121+
"jsonBody": "={\n \"name\": \"Create Company Chatwoot\",\n \"description\": \"Create Company Chatwoot\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/criadorchatwoot\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"Tema Criador de Empresa:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
122+
"options": {}
123+
},
124+
"id": "f5bbb285-71a8-4c58-a4d7-e56002d697f0",
125+
"name": "Cria Automação Empresas",
126+
"type": "n8n-nodes-base.httpRequest",
127+
"typeVersion": 3,
128+
"position": [
129+
1220,
130+
480
131+
]
132+
},
133+
{
134+
"parameters": {
135+
"method": "POST",
136+
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/",
137+
"sendHeaders": true,
138+
"headerParameters": {
139+
"parameters": [
140+
{
141+
"name": "api_access_token",
142+
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
143+
}
144+
]
145+
},
146+
"sendBody": true,
147+
"specifyBody": "json",
148+
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
149+
"options": {}
150+
},
151+
"id": "a36bebdc-a318-40a2-8532-c7f476f8adb7",
152+
"name": "Cria Automação Inboxes",
153+
"type": "n8n-nodes-base.httpRequest",
154+
"typeVersion": 3,
155+
"position": [
156+
1420,
157+
480
158+
]
159+
},
160+
{
161+
"parameters": {
162+
"content": "## Workflow Para Configurar admin\n**Aqui você prepara o Chatwoot Principal com um usuário (Superadmin) que poderá criar empresas e caixas de entrada**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n**Obs: A variável api_access_token é o token do usuário que irá poder criar as empresas**",
163+
"width": 894.6435495898575
164+
},
165+
"id": "db66e867-e9f4-452d-b521-725eeac652c8",
166+
"name": "Sticky Note",
167+
"type": "n8n-nodes-base.stickyNote",
168+
"typeVersion": 1,
169+
"position": [
170+
420,
171+
280
172+
]
173+
}
174+
],
175+
"pinData": {},
176+
"connections": {
177+
"Info Base": {
178+
"main": [
179+
[
180+
{
181+
"node": "Cria Inbox Start",
182+
"type": "main",
183+
"index": 0
184+
}
185+
]
186+
]
187+
},
188+
"Cria Contato Bot": {
189+
"main": [
190+
[
191+
{
192+
"node": "Cria Automação Empresas",
193+
"type": "main",
194+
"index": 0
195+
}
196+
]
197+
]
198+
},
199+
"Cria Inbox Start": {
200+
"main": [
201+
[
202+
{
203+
"node": "Cria Contato Bot",
204+
"type": "main",
205+
"index": 0
206+
}
207+
]
208+
]
209+
},
210+
"When clicking \"Execute Workflow\"": {
211+
"main": [
212+
[
213+
{
214+
"node": "Info Base",
215+
"type": "main",
216+
"index": 0
217+
}
218+
]
219+
]
220+
},
221+
"Cria Automação Empresas": {
222+
"main": [
223+
[
224+
{
225+
"node": "Cria Automação Inboxes",
226+
"type": "main",
227+
"index": 0
228+
}
229+
]
230+
]
231+
}
232+
},
233+
"active": false,
234+
"settings": {},
235+
"versionId": "78f155dc-7809-4bfc-9282-63f49b07fc4d",
236+
"id": "BSATyGpGWLR4ZwNm",
237+
"meta": {
238+
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
239+
},
240+
"tags": []
241+
}

0 commit comments

Comments
 (0)