Skip to content

Commit 3c3458b

Browse files
committed
first commit
0 parents  commit 3c3458b

File tree

253 files changed

+36299
-0
lines changed

Some content is hidden

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

253 files changed

+36299
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
*Dockerfile*
3+
*docker-compose*
4+
node_modules
5+
dist

.env.example

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
SERVER_TYPE=http
2+
SERVER_PORT=8080
3+
# Server URL - Set your application url
4+
SERVER_URL=http://localhost:8080
5+
6+
SENTRY_DSN=
7+
8+
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
9+
CORS_ORIGIN=*
10+
CORS_METHODS=GET,POST,PUT,DELETE
11+
CORS_CREDENTIALS=true
12+
13+
# Determine the logs to be displayed
14+
LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET
15+
LOG_COLOR=true
16+
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
17+
LOG_BAILEYS=error
18+
19+
# Set the maximum number of listeners that can be registered for an event
20+
EVENT_EMITTER_MAX_LISTENERS=50
21+
22+
# Determine how long the instance should be deleted from memory in case of no connection.
23+
# Default time: 5 minutes
24+
# If you don't even want an expiration, enter the value false
25+
DEL_INSTANCE=false
26+
27+
# Provider: postgresql | mysql
28+
DATABASE_PROVIDER=postgresql
29+
DATABASE_CONNECTION_URI='postgresql://user:pass@localhost:5432/evolution?schema=public'
30+
# Client name for the database connection
31+
# It is used to separate an API installation from another that uses the same database.
32+
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
33+
34+
# Choose the data you want to save in the application's database
35+
DATABASE_SAVE_DATA_INSTANCE=true
36+
DATABASE_SAVE_DATA_NEW_MESSAGE=true
37+
DATABASE_SAVE_MESSAGE_UPDATE=true
38+
DATABASE_SAVE_DATA_CONTACTS=true
39+
DATABASE_SAVE_DATA_CHATS=true
40+
DATABASE_SAVE_DATA_LABELS=true
41+
DATABASE_SAVE_DATA_HISTORIC=true
42+
DATABASE_SAVE_IS_ON_WHATSAPP=true
43+
DATABASE_SAVE_IS_ON_WHATSAPP_DAYS=7
44+
45+
# RabbitMQ - Environment variables
46+
RABBITMQ_ENABLED=false
47+
RABBITMQ_URI=amqp://localhost
48+
RABBITMQ_EXCHANGE_NAME=evolution
49+
# Global events - By enabling this variable, events from all instances are sent in the same event queue.
50+
RABBITMQ_GLOBAL_ENABLED=false
51+
# Choose the events you want to send to RabbitMQ
52+
RABBITMQ_EVENTS_APPLICATION_STARTUP=false
53+
RABBITMQ_EVENTS_INSTANCE_CREATE=false
54+
RABBITMQ_EVENTS_INSTANCE_DELETE=false
55+
RABBITMQ_EVENTS_QRCODE_UPDATED=false
56+
RABBITMQ_EVENTS_MESSAGES_SET=false
57+
RABBITMQ_EVENTS_MESSAGES_UPSERT=false
58+
RABBITMQ_EVENTS_MESSAGES_EDITED=false
59+
RABBITMQ_EVENTS_MESSAGES_UPDATE=false
60+
RABBITMQ_EVENTS_MESSAGES_DELETE=false
61+
RABBITMQ_EVENTS_SEND_MESSAGE=false
62+
RABBITMQ_EVENTS_CONTACTS_SET=false
63+
RABBITMQ_EVENTS_CONTACTS_UPSERT=false
64+
RABBITMQ_EVENTS_CONTACTS_UPDATE=false
65+
RABBITMQ_EVENTS_PRESENCE_UPDATE=false
66+
RABBITMQ_EVENTS_CHATS_SET=false
67+
RABBITMQ_EVENTS_CHATS_UPSERT=false
68+
RABBITMQ_EVENTS_CHATS_UPDATE=false
69+
RABBITMQ_EVENTS_CHATS_DELETE=false
70+
RABBITMQ_EVENTS_GROUPS_UPSERT=false
71+
RABBITMQ_EVENTS_GROUP_UPDATE=false
72+
RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
73+
RABBITMQ_EVENTS_CONNECTION_UPDATE=false
74+
RABBITMQ_EVENTS_REMOVE_INSTANCE=false
75+
RABBITMQ_EVENTS_LOGOUT_INSTANCE=false
76+
RABBITMQ_EVENTS_CALL=false
77+
RABBITMQ_EVENTS_TYPEBOT_START=false
78+
RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS=false
79+
80+
# SQS - Environment variables
81+
SQS_ENABLED=false
82+
SQS_ACCESS_KEY_ID=
83+
SQS_SECRET_ACCESS_KEY=
84+
SQS_ACCOUNT_ID=
85+
SQS_REGION=
86+
87+
# Websocket - Environment variables
88+
WEBSOCKET_ENABLED=false
89+
WEBSOCKET_GLOBAL_EVENTS=false
90+
91+
# WhatsApp Business API - Environment variables
92+
# Token used to validate the webhook on the Facebook APP
93+
WA_BUSINESS_TOKEN_WEBHOOK=evolution
94+
WA_BUSINESS_URL=https://graph.facebook.com
95+
WA_BUSINESS_VERSION=v20.0
96+
WA_BUSINESS_LANGUAGE=en_US
97+
98+
# Global Webhook Settings
99+
# Each instance's Webhook URL and events will be requested at the time it is created
100+
WEBHOOK_GLOBAL_ENABLED=false
101+
# Define a global webhook that will listen for enabled events from all instances
102+
WEBHOOK_GLOBAL_URL=''
103+
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
104+
WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
105+
# Set the events you want to hear
106+
WEBHOOK_EVENTS_APPLICATION_STARTUP=false
107+
WEBHOOK_EVENTS_QRCODE_UPDATED=true
108+
WEBHOOK_EVENTS_MESSAGES_SET=true
109+
WEBHOOK_EVENTS_MESSAGES_UPSERT=true
110+
WEBHOOK_EVENTS_MESSAGES_EDITED=true
111+
WEBHOOK_EVENTS_MESSAGES_UPDATE=true
112+
WEBHOOK_EVENTS_MESSAGES_DELETE=true
113+
WEBHOOK_EVENTS_SEND_MESSAGE=true
114+
WEBHOOK_EVENTS_CONTACTS_SET=true
115+
WEBHOOK_EVENTS_CONTACTS_UPSERT=true
116+
WEBHOOK_EVENTS_CONTACTS_UPDATE=true
117+
WEBHOOK_EVENTS_PRESENCE_UPDATE=true
118+
WEBHOOK_EVENTS_CHATS_SET=true
119+
WEBHOOK_EVENTS_CHATS_UPSERT=true
120+
WEBHOOK_EVENTS_CHATS_UPDATE=true
121+
WEBHOOK_EVENTS_CHATS_DELETE=true
122+
WEBHOOK_EVENTS_GROUPS_UPSERT=true
123+
WEBHOOK_EVENTS_GROUPS_UPDATE=true
124+
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
125+
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
126+
WEBHOOK_EVENTS_REMOVE_INSTANCE=false
127+
WEBHOOK_EVENTS_LOGOUT_INSTANCE=false
128+
WEBHOOK_EVENTS_LABELS_EDIT=true
129+
WEBHOOK_EVENTS_LABELS_ASSOCIATION=true
130+
WEBHOOK_EVENTS_CALL=true
131+
# This events is used with Typebot
132+
WEBHOOK_EVENTS_TYPEBOT_START=false
133+
WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
134+
# This event is used to send errors
135+
WEBHOOK_EVENTS_ERRORS=false
136+
WEBHOOK_EVENTS_ERRORS_WEBHOOK=
137+
138+
# Name that will be displayed on smartphone connection
139+
CONFIG_SESSION_PHONE_CLIENT=Evolution API
140+
# Browser Name = Chrome | Firefox | Edge | Opera | Safari
141+
CONFIG_SESSION_PHONE_NAME=Chrome
142+
143+
# Whatsapp Web version for baileys channel
144+
# https://web.whatsapp.com/check-update?version=0&platform=web
145+
CONFIG_SESSION_PHONE_VERSION=2.3000.1015901307
146+
147+
# Set qrcode display limit
148+
QRCODE_LIMIT=30
149+
# Color of the QRCode on base64
150+
QRCODE_COLOR='#175197'
151+
152+
# Typebot - Environment variables
153+
TYPEBOT_ENABLED=false
154+
# old | latest
155+
TYPEBOT_API_VERSION=latest
156+
157+
# Chatwoot - Environment variables
158+
CHATWOOT_ENABLED=false
159+
# If you leave this option as false, when deleting the message for everyone on WhatsApp, it will not be deleted on Chatwoot.
160+
CHATWOOT_MESSAGE_READ=true
161+
# If you leave this option as true, when sending a message in Chatwoot, the client's last message will be marked as read on WhatsApp.
162+
CHATWOOT_MESSAGE_DELETE=true
163+
# If you leave this option as true, a contact will be created on Chatwoot to provide the QR Code and update messages about the instance.
164+
CHATWOOT_BOT_CONTACT=true
165+
# This db connection is used to import messages from whatsapp to chatwoot database
166+
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://user:passwprd@host:5432/chatwoot?sslmode=disable
167+
CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
168+
169+
# OpenAI - Environment variables
170+
OPENAI_ENABLED=false
171+
172+
# Dify - Environment variables
173+
DIFY_ENABLED=false
174+
175+
# Cache - Environment variables
176+
# Redis Cache enabled
177+
CACHE_REDIS_ENABLED=true
178+
CACHE_REDIS_URI=redis://localhost:6379/6
179+
CACHE_REDIS_TTL=604800
180+
# Prefix serves to differentiate data from one installation to another that are using the same redis
181+
CACHE_REDIS_PREFIX_KEY=evolution
182+
# Enabling this variable will save the connection information in Redis and not in the database.
183+
CACHE_REDIS_SAVE_INSTANCES=false
184+
# Local Cache enabled
185+
CACHE_LOCAL_ENABLED=false
186+
187+
# Amazon S3 - Environment variables
188+
S3_ENABLED=false
189+
S3_ACCESS_KEY=
190+
S3_SECRET_KEY=
191+
S3_BUCKET=evolution
192+
S3_PORT=443
193+
S3_ENDPOINT=s3.domain.com
194+
S3_REGION=eu-west-3
195+
S3_USE_SSL=true
196+
197+
# AMAZON S3 - Environment variables
198+
# S3_ENABLED=true
199+
# S3_BUCKET=bucket_name
200+
# S3_ACCESS_KEY=access_key_id
201+
# S3_SECRET_KEY=secret_access_key
202+
# S3_ENDPOINT=s3.amazonaws.com # region: s3.eu-west-3.amazonaws.com
203+
# S3_REGION=eu-west-3
204+
205+
# MINIO Use SSL - Environment variables
206+
# S3_ENABLED=true
207+
# S3_ACCESS_KEY=access_key_id
208+
# S3_SECRET_KEY=secret_access_key
209+
# S3_BUCKET=bucket_name
210+
# S3_PORT=443
211+
# S3_ENDPOINT=s3.domain.com
212+
# S3_USE_SSL=true
213+
# S3_REGION=eu-south
214+
215+
# Define a global apikey to access all instances.
216+
# OBS: This key must be inserted in the request header to create an instance.
217+
AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
218+
# If you leave this option as true, the instances will be exposed in the fetch instances endpoint.
219+
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
220+
LANGUAGE=en
221+
222+
# Define a global proxy to be used if the instance does not have one
223+
# PROXY_HOST=
224+
# PROXY_PORT=80
225+
# PROXY_PROTOCOL=http
226+
# PROXY_USERNAME=
227+
# PROXY_PASSWORD=

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node-modules
2+
/dist

.eslintrc.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
sourceType: 'CommonJS',
5+
},
6+
plugins: ['@typescript-eslint', 'simple-import-sort', 'import'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
8+
globals: {
9+
Atomics: 'readonly',
10+
SharedArrayBuffer: 'readonly',
11+
},
12+
root: true,
13+
env: {
14+
node: true,
15+
jest: true,
16+
},
17+
ignorePatterns: ['.eslintrc.js'],
18+
rules: {
19+
'@typescript-eslint/interface-name-prefix': 'off',
20+
'@typescript-eslint/explicit-function-return-type': 'off',
21+
'@typescript-eslint/explicit-module-boundary-types': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'@typescript-eslint/no-empty-function': 'off',
24+
'@typescript-eslint/no-non-null-assertion': 'off',
25+
'@typescript-eslint/no-unused-vars': 'error',
26+
'import/first': 'error',
27+
'import/no-duplicates': 'error',
28+
'simple-import-sort/imports': 'error',
29+
'simple-import-sort/exports': 'error',
30+
'@typescript-eslint/ban-types': [
31+
'error',
32+
{
33+
extendDefaults: true,
34+
types: {
35+
'{}': false,
36+
Object: false,
37+
},
38+
},
39+
],
40+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
41+
},
42+
};
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Bug Report
2+
description: Create a report to help us improve.
3+
labels:
4+
- bug
5+
- en
6+
# - help wanted
7+
# Automatically assign the issue to:
8+
# assignees: DavidsonGomes
9+
body:
10+
- type: checkboxes
11+
id: terms
12+
attributes:
13+
label: Welcome!
14+
description: |
15+
The issue tracker is only for reporting bugs and feature requests.
16+
For user-related support questions, please visit:
17+
- [Discord](https://evolution-api.com/discord)
18+
- [WhatsApp Group](https://evolution-api.com/whatsapp)
19+
<br/>
20+
21+
**DO NOT OPEN AN ISSUE FOR GENERAL SUPPORT QUESTIONS.**
22+
23+
options:
24+
- label: Yes, I have searched for similar issues on [GitHub](https://github.com/EvolutionAPI/evolution-api/issues) and found none.
25+
required: true
26+
27+
- type: textarea
28+
attributes:
29+
label: What did you do?
30+
description: |
31+
How to write a good bug report?
32+
33+
- Respect the issue template as much as possible.
34+
- The title should be short and descriptive.
35+
- Explain the conditions that led you to report this issue: the context.
36+
- The context should lead to something, an idea or problem you are facing.
37+
- Be clear and concise.
38+
- Format your messages to help the reader focus on what matters and understand the structure of your message, use [Markdown syntax](https://help.github.com/articles/github-flavored-markdown)
39+
placeholder: Describe the problem you encountered in detail.
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
attributes:
45+
label: What did you expect?
46+
placeholder: Describe what you expected to happen.
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
attributes:
52+
label: What did you observe instead of what you expected?
53+
placeholder: Explain what actually happens when you follow the steps above.
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
attributes:
59+
label: Screenshots/Videos
60+
placeholder: |
61+
If possible, add screenshots or videos that illustrate the problem. This can be extremely helpful in understanding the issue better.
62+
63+
- type: textarea
64+
attributes:
65+
label: Which version of the API are you using?
66+
description: |
67+
Enter the version number found in the `version` property of the **package.json**.
68+
placeholder: Paste the version here.
69+
validations:
70+
required: true
71+
72+
- type: dropdown
73+
id: select
74+
attributes:
75+
label: What is your environment?
76+
options:
77+
- Windows
78+
- Linux
79+
- Mac
80+
- Docker
81+
- Other
82+
validations:
83+
required: true
84+
85+
- type: textarea
86+
attributes:
87+
label: Other environment specifications
88+
placeholder: 'Hardware/Software: [e.g., CPU, GPU]'
89+
validations:
90+
required: false
91+
92+
- type: textarea
93+
attributes:
94+
label: If applicable, paste the log output
95+
description: |
96+
Please attach any logs that might be related to the issue.
97+
If the logs contain sensitive information, consider sending them privately to one of the project maintainers.
98+
placeholder: Paste the application log here.
99+
validations:
100+
required: false
101+
102+
- type: textarea
103+
attributes:
104+
label: Additional Notes
105+
description: Include any other information you think might be useful to understand or resolve the bug.
106+
validations:
107+
required: false

0 commit comments

Comments
 (0)