Compare commits

...

2181 Commits
1.0.8 ... main

Author SHA1 Message Date
Davidson Gomes
39606240da Merge branch 'release/2.3.0' 2025-06-17 09:25:38 -03:00
Davidson Gomes
f4fbc4afc6 chore(changelog): remove fixed issue with @lid in chatwoot from CHANGELOG 2025-06-17 09:25:19 -03:00
Davidson Gomes
70905e7338 chore(changelog): update version date for 2.3.0 release 2025-06-17 09:20:12 -03:00
Davidson Gomes
07cccb7c7f
Merge pull request #1599 from splusoficial/develop
fix: ajuste na validacao dos bots e pausar sessao
2025-06-17 08:52:47 -03:00
Davidson Gomes
5f0862a759 test: disable webhook https test 2025-06-16 15:27:16 -03:00
Joao Vitor
029d68e2cd fix: ajuste na validacao dos bots e pausar sessao 2025-06-15 18:24:34 -03:00
Davidson Gomes
a1fae85531
Merge pull request #1594 from KokeroO/feat/improves-and-adjusts-treatment-lid-numbers
refactor(chatwoot): Melhora e ajusta tratamento de números @lid
2025-06-13 17:54:09 -03:00
Willian Coqueiro
1afa8df556 refactor(chatwoot): simplify findContact method and update contact creation logic 2025-06-13 19:36:13 +00:00
Davidson Gomes
bfb044b234 feat(whatsapp): enhance contact handling and configuration logic
- Added support for `lid` in WhatsApp numbers router to improve contact identification.
- Updated the contact retrieval logic to accept an object with `phone_number` and `identifier` for better clarity and consistency.
- Enhanced error handling and logging in the Chatwoot service for improved traceability during contact creation and updates.
- Implemented automatic search for the latest WhatsApp version if the CONFIG_SESSION_PHONE_VERSION variable is not set, ensuring users have the most up-to-date integration.
2025-06-13 14:58:01 -03:00
Davidson Gomes
ae99ec7a0e feat(whatsapp): implement fetchLatestWaWebVersion utility and update version fetching logic
- Added a new utility function `fetchLatestWaWebVersion` to retrieve the latest WhatsApp Web version.
- Updated the Baileys service and router to utilize the new function instead of the deprecated `fetchLatestBaileysVersion`, ensuring accurate version information is fetched for WhatsApp integration.
- This change enhances the reliability of version management in the application.
2025-06-13 13:14:35 -03:00
Davidson Gomes
22c379aa36 chore(env): comment out WhatsApp Web version in example configuration
- Updated the .env.example file to comment out the CONFIG_SESSION_PHONE_VERSION variable, indicating it is not currently set. This change helps clarify the configuration options available for users.
2025-06-13 12:34:45 -03:00
Davidson Gomes
62c00c3db2 feat(router): update whatsappWebVersion to fetch latest Baileys version
- Modified the root route to fetch the latest WhatsApp web version from Baileys if not set in the environment configuration.
- This enhancement ensures that clients receive the most up-to-date version information in the API response.
2025-06-13 12:03:24 -03:00
Davidson Gomes
afc2927837 feat(IsOnWhatsapp): add optional lid field and update related logic
- Introduced a new optional `lid` field in the IsOnWhatsapp model to enhance data tracking.
- Updated migration script to add the `lid` column to the database.
- Modified OnWhatsAppDto to include the `lid` property for better integration with WhatsApp user data.
- Enhanced the WhatsApp Baileys service to handle `lid` numbers separately and improve user verification logic.
- Updated cache handling functions to support the new `lid` field for consistent data management.
2025-06-13 11:52:32 -03:00
Davidson Gomes
c17b48bca0 fix(chatwoot.service): improve number retrieval logic for message senders
- Enhanced the logic for retrieving sender numbers by introducing a new method that prioritizes senderPn, followed by participant and remoteJid.
- This change ensures more reliable identification of message senders across different scenarios.
2025-06-13 09:10:29 -03:00
Davidson Gomes
534c54a171 fix(chatwoot.service): enhance contact retrieval logic and normalize identifiers
- Updated contact retrieval to handle cases where the identifier is not found, specifically for @lid scenarios.
- Introduced a new method to normalize contact identifiers, prioritizing senderLid and participantLid.
- Improved logging for better traceability during contact lookups and conversation handling.
2025-06-13 08:28:09 -03:00
Davidson Gomes
8603e6def0 feat(router): add whatsappWebVersion to response object
- Included `whatsappWebVersion` in the response object to provide the version of the WhatsApp web session from the environment configuration.
- This addition enhances the API's response with relevant session information for clients.
2025-06-12 18:08:18 -03:00
Davidson Gomes
bcf2febf48 refactor(whatsapp.business.service): replace hardcoded token with class property
- Updated the token retrieval in the BusinessStartupService to use a class property instead of a hardcoded environment variable.
- This change enhances flexibility and maintainability of the service configuration.
2025-06-12 17:32:00 -03:00
Davidson Gomes
a02ecc88f5 refactor(whatsapp.business.service): enhance media handling and audio processing
- Updated media message preparation to conditionally include filename and caption based on media type.
- Improved error handling in media ID retrieval and audio processing methods.
- Refactored audio processing to support file uploads and URL handling more effectively.
- Enhanced logging for better error tracking during media operations.
2025-06-12 17:28:02 -03:00
Davidson Gomes
bc451e8493 feat(Typebot): add splitMessages and timePerChar fields to Typebot models
- Introduced `splitMessages` and `timePerChar` fields in the Typebot and TypebotSetting models with default values.
- Created a migration script to update the database schema accordingly.
- Updated audio message handling to prepend `[audio]` to transcriptions for better clarity in message context.
2025-06-12 13:24:25 -03:00
Davidson Gomes
1eb2c848f7 fix(chatwoot.service): add isLid parameter to service methods for enhanced functionality
- Introduced a new boolean parameter `isLid` in relevant methods to improve the handling of conversation data.
- Updated conditionals to incorporate `isLid` for more precise data management.
- Ensured backward compatibility by maintaining existing functionality while enhancing the service's capabilities.
2025-06-12 12:02:38 -03:00
Davidson Gomes
7cfc359be9 chore: update package-lock.json and refactor WhatsApp Baileys service
- Added new dependency `audio-decode` version 2.2.3.
- Introduced `@eshaz/web-worker` version 1.2.2 with its metadata.
- Refactored `userDevicesCache` initialization and various object destructuring for improved readability in `whatsapp.baileys.service.ts`.
- Streamlined multiple object property assignments for better code clarity.
- Removed deprecated `@typescript-eslint/project-service` and related packages from package-lock.json.
2025-06-12 12:01:01 -03:00
Davidson Gomes
421e762c2d fix(chatwoot.service): Ensure conversation checks are robust before toggling status
- Added null checks for conversation object in reopenConversation mode and when finding unresolved conversations.
- Improved logging for better debugging of conversation retrieval.
2025-06-12 11:18:59 -03:00
Davidson Gomes
9e1f9cbb83
Merge pull request #1574 from edisonmartinsmkt/develop
feat(audio): support LPCM and fix waveform distortion
2025-06-08 20:59:46 -03:00
edisoncm-ti
44e0ff2250 feat(audio): support LPCM and fix waveform distortion 2025-06-08 20:41:59 -03:00
Davidson Gomes
614ad7cbdf
Merge pull request #1556 from splusoficial/develop
fix: adjustment in audio transcription with official api
2025-06-06 23:10:57 -03:00
Joao Vitor
77b3b331f8 fix: adjustment in audio transcription with official api 2025-06-05 20:31:11 -03:00
Davidson Gomes
e469dc132f
Merge pull request #1536 from Daquisu/fix-fetchStatusMessage-params
Update `fetchStatusMessage` to handle empty offset / page
2025-06-03 12:40:14 -03:00
Daquisu
fa14abac5a Update fetchStatusMessage to handle empty offset / page 2025-06-01 15:22:01 -06:00
Davidson Gomes
a53e0a8694
Merge pull request #1513 from samuelterra22/patch-1
fix: change service image version and change to latest config session phone version
2025-05-28 13:53:17 -03:00
Davidson Gomes
16e4bba108 chore: update dependencies in package-lock.json and package.json
This commit updates several dependencies in the package-lock.json and package.json files to their latest versions. Key changes include:
- Upgraded various @typescript-eslint packages to version 8.33.0, ensuring compatibility and access to the latest features and fixes.
- Updated the baileys package from version 6.7.17 to 6.7.18, incorporating the latest improvements.
- Bumped the pino package version from 9.6.0 to 9.7.0 for enhanced performance and stability.
- Updated the process-warning package from version 4.0.1 to 5.0.0, which may include important updates and fixes.
- Adjusted the protobufjs package version from 7.5.2 to 7.4.0, reflecting the latest changes.

These updates contribute to improved performance, security, and maintainability of the codebase.
2025-05-28 11:44:17 -03:00
Davidson Gomes
bd19fff264
Merge branch 'develop' into patch-1 2025-05-28 11:01:17 -03:00
Samuel Terra
94285ecb90
fix: change service image version and change to latest config session phone version 2025-05-28 09:22:38 -03:00
Davidson Gomes
3500fbe27f
Merge pull request #1508 from gomessguii/develop
refactor: improve chatbot integrations
2025-05-27 18:03:44 -03:00
Guilherme Gomes
cb76381466 refactor: reorder parameters and simplify EvolutionBot DTO
This commit refines the EvolutionBot integration by reordering constructor parameters for consistency and removing unused properties from the EvolutionBotDto and EvolutionBotSettingDto classes. Key changes include:
- Adjusted the parameter order in the EvolutionBotService constructor for improved clarity.
- Streamlined the EvolutionBotDto and EvolutionBotSettingDto by eliminating unnecessary fields.

These updates enhance the maintainability and readability of the EvolutionBot integration.
2025-05-27 17:52:45 -03:00
Guilherme Gomes
98502f6555 fix: resolve build errors and audio transcription issues across chatbot services
- Add YAML file loader to tsup.config.ts to fix build compilation errors
- Fix OpenAI speechToText method signature across all chatbot services
- Correct DifyService constructor parameter order in server.module.ts and channel.service.ts
- Add missing OpenAI service dependency injection to EvoaiService
- Standardize audio transcription logic in FlowiseService to match N8N implementation
- Fix speechToText calls in WhatsApp Baileys and Evolution channel services
- Ensure consistent error handling and parameter passing for audio processing

This resolves the "Cannot read properties of undefined" errors and ensures
all chatbot integrations (OpenAI, N8N, Flowise, EvoAI, Dify, EvolutionBot)
properly handle audio message transcription using OpenAI Whisper.
2025-05-27 17:46:29 -03:00
Guilherme Gomes
3fc77e4c76 refactor: update asset references in index.html and replace CSS/JS files
This commit updates the asset references in the index.html file to point to new CSS and JS files. Key changes include:
- Replaced the old JavaScript file `index-mxi8bQ4k.js` with `index-D-oOjDYe.js`.
- Updated the CSS file reference from `index-DNOCacL_.css` to the new `index-CXH2BdD4.css`.
- Removed the old CSS and JS files to clean up the codebase.

These updates ensure that the application uses the latest styles and scripts, contributing to improved performance and maintainability.
2025-05-27 17:37:01 -03:00
Guilherme Gomes
19e291178c refactor: streamline integration checks and parameter handling in chatbot controllers
This commit refines the Flowise and Typebot integrations by simplifying the integration enablement checks in their respective controllers. Key changes include:
- Consolidated the integration checks in the createBot method of FlowiseController and startBot method of TypebotController for improved readability.
- Removed unnecessary line breaks to enhance code clarity.

These updates contribute to a cleaner and more maintainable codebase for chatbot integrations.
2025-05-27 17:26:00 -03:00
Guilherme Gomes
7682a679d1 refactor: enhance Dify integration with improved validation and message processing
This commit refines the Dify integration by updating the controller and service logic for better functionality and maintainability. Key changes include:
- Added Dify-specific validation in the createBot method to prevent duplicate entries.
- Simplified comments for clarity and removed unused methods in DifyController.
- Enhanced message processing in DifyService to handle audio messages more effectively and improve error handling.
- Updated DifyDto and DifySettingDto to streamline properties and improve clarity.

These updates contribute to a more robust and maintainable Dify integration.
2025-05-27 17:04:35 -03:00
Guilherme Gomes
97ca23a7b0 refactor: enhance Evoai integration with improved validation and message handling
This commit refines the Evoai integration by updating the service and controller logic for better functionality and maintainability. Key changes include:
- Added the `openaiService` as a parameter in the EvoaiService constructor for improved dependency management.
- Enhanced the createBot method in EvoaiController to include EvoAI-specific validation and duplicate checks.
- Updated EvoaiDto and EvoaiSettingDto to remove unnecessary comments and add a fallback property.
- Refined the message processing logic in EvoaiService to handle audio messages more effectively and improve logging clarity.
- Adjusted the schema for Evoai settings to rename `evoaiIdFallback` to `botIdFallback` for better clarity.

These updates contribute to a more robust and maintainable Evoai integration.
2025-05-27 16:00:32 -03:00
Guilherme Gomes
95bd85b6e3 refactor: update Flowise integration for improved configuration and validation
This commit refines the Flowise integration by enhancing configuration management and validation logic. Key changes include:
- Reordered parameters in the FlowiseService constructor for consistency.
- Updated FlowiseController to utilize the configService for integration enablement checks.
- Simplified FlowiseDto and FlowiseSettingDto by removing unused properties.
- Enhanced validation logic in flowise.schema.ts to include new fields.
- Improved error handling in the createBot method to prevent duplicate entries.

These updates contribute to a more robust and maintainable Flowise integration.
2025-05-27 15:49:15 -03:00
Guilherme Gomes
64fc7a05ac refactor: improve session handling and validation in N8n integration
This commit enhances the N8n integration by refining session management and validation logic. Key changes include:
- Added error handling for session creation failures in the BaseChatbotService.
- Removed unused methods and properties in N8nService and N8nDto to streamline the codebase.
- Updated N8n schema to enforce required fields and improve validation checks.
- Simplified message processing logic to utilize base class methods, enhancing maintainability.

These improvements contribute to a more robust and efficient N8n integration.
2025-05-27 15:10:47 -03:00
Guilherme Gomes
39aaf29d54 refactor: enhance OpenAI controller and service for better credential management
This commit refactors the OpenAIController and OpenAIService to improve credential handling and error management. Key changes include:
- Added checks to prevent duplicate API keys and names during bot creation.
- Updated the getModels method to accept an optional credential ID for more flexible credential usage.
- Enhanced error handling with specific BadRequestException messages for better clarity.
- Removed unused methods and streamlined the speech-to-text functionality to utilize instance-specific settings.

These improvements enhance the maintainability and usability of the OpenAI integration.
2025-05-27 14:32:10 -03:00
Guilherme Gomes
22e99f7934 refactor: simplify TypebotController and TypebotService methods
This commit refactors the TypebotController and TypebotService to streamline the processTypebot method, aligning it with the base class pattern. It reduces complexity by consolidating parameters and improving readability. Additionally, it updates the TypebotDto and TypebotSettingDto to remove unused properties, enhancing code clarity and maintainability.
2025-05-27 13:07:15 -03:00
Davidson Gomes
dd0dfd447c
Merge pull request #1504 from KokeroO/develop
fix: Melhora o método createConversation (evita conversas criadas duplicadas Chatwoot)
2025-05-27 08:11:34 -03:00
Willian Coqueiro
fb18267ac5 fix: eslint 2025-05-27 02:10:15 +00:00
Willian Coqueiro
fc5965938e fix: improve createConversation method with caching and locking mechanisms 2025-05-27 01:31:06 +00:00
Davidson Gomes
623efd86a2
Merge pull request #1498 from thrsouza/main
Inclusão do parâmetro frame_max para compatibilidade com RabbitMQ 4.1+
2025-05-25 11:10:40 -03:00
Thiago Souza
3297364c10 fix: update RabbitMQ frame_max parameter for 4.1+ compatibility
Updates the minimum frame_max value from 4096 to 8192 to meet the requirements
of RabbitMQ 4.1+ servers. This resolves connection failures with newer RabbitMQ
versions while maintaining backwards compatibility with older versions.
2025-05-25 03:08:12 -03:00
Davidson Gomes
373a531e88 fix: update logging and message handling in EvoaiService
This commit modifies the logging messages in the `EvoaiService` to use the correct service name "EvoAI" instead of "Dify" for better clarity. Additionally, it refines the message handling logic by changing the way message IDs are generated and updating the payload structure sent to the API. The extraction of the message from the response artifacts has also been improved to ensure that the correct message is retrieved from the response data.

Changes include:
- Updated logging statements to reflect the correct service name.
- Changed the message ID generation to use a shorter UUID substring.
- Adjusted the payload structure to include `contextId` and `messageId`.
- Enhanced message extraction logic from the response artifacts.

These changes enhance the clarity of logs and improve the robustness of message handling in the service.
2025-05-23 20:37:01 -03:00
Davidson Gomes
e081533f02 fix: remove unused Auth import from Dify and N8n services
This commit removes the unused `Auth` import from both `dify.service.ts` and `n8n.service.ts`. This change helps to clean up the code and improve readability by eliminating unnecessary dependencies.
2025-05-23 20:09:36 -03:00
Davidson Gomes
17fd407d8d
Merge pull request #1494 from KokeroO/develop
fix: melhora a formatação e tratamento de erros na função getExistingSourceIds
2025-05-23 10:43:27 -03:00
Willian Coqueiro
0cdc67effe fix: eslint 2025-05-23 02:40:05 +00:00
Willian Coqueiro
ddaf32be76 fix: melhora a formatação e tratamento de erros na função getExistingSourceIds 2025-05-23 02:18:13 +00:00
Willian Coqueiro
0b2d8a752f fix: melhora o tratamento de erros e otimiza a consulta de IDs de origem no Chatwoot 2025-05-23 02:13:46 +00:00
Davidson Gomes
9cda6a2f99
Merge pull request #1493 from oriondesign2015/develop
corrige estrutura de if/else e bloco try/catch em chatwoot-import-helper.ts
2025-05-22 21:57:33 -03:00
OrionDesign
d2263af3e8 fix: corrige estrutura de if/else e bloco try/catch em chatwoot-import-helper.ts
Esta PR corrige problemas de sintaxe no arquivo chatwoot-import-helper.ts, especificamente:
- Ajusta a estrutura do bloco if/else no método getExistingSourceIds, evitando erro de compilação do TypeScript.
- Garante que o bloco catch esteja corretamente posicionado dentro do método, retornando null em caso de erro.
- Mantém a lógica original do método, apenas corrigindo a sintaxe para permitir a compilação e execução correta do projeto.
Essas correções eliminam o erro de build relacionado ao TypeScript e melhoram a robustez do código ao tratar exceções de forma adequada.
2025-05-22 18:51:28 -03:00
Davidson Gomes
0239638232
Merge pull request #1490 from KokeroO/develop
fix: Corrige o PR1481
2025-05-22 17:08:43 -03:00
Willian Coqueiro
3459d61eff fix: Corrige o PR1481 2025-05-22 20:03:32 +00:00
Davidson Gomes
5330121c49
Merge pull request #1486 from oriondesign2015/develop
fix: Corrige envio da apiKey da instância nos payloads do Flowise e do Dify
2025-05-22 11:24:20 -03:00
OrionDesign
53c1c218c4 fix: Corrige envio da apiKey da instância no payload do Dify
Corrige o envio da apiKey no payload do Dify para usar a apiKey específica da instância ao invés da apiKey global do sistema.
2025-05-22 11:04:13 -03:00
OrionDesign
06378e5d6b fix: Corrige envio da apiKey da instância no payload do Flowise
Corrige o envio da apiKey no payload do Flowise para usar a apiKey específica da instância ao invés da apiKey global do sistema.
2025-05-22 11:03:22 -03:00
Davidson Gomes
6a83e89394
Merge pull request #1485 from oriondesign2015/develop
fix: Corrige envio da apiKey da instância nos payloads do Evolution Bot e N8N
2025-05-22 11:02:21 -03:00
OrionDesign
d24540d6dd fix: Corrige envio da apiKey da instância no payload do N8N
Corrige o envio da apiKey no payload do N8N para usar a apiKey específica da instância ao invés da apiKey global do sistema.
2025-05-22 10:57:41 -03:00
OrionDesign
2af7b24013 fix: Corrige envio da apiKey da instância no payload do Evolution Bot
Corrige o envio da apiKey no payload do Evolution Bot para usar a apiKey específica da instância ao invés da apiKey global do sistema.
2025-05-22 10:56:54 -03:00
Davidson Gomes
6f47a54fae
Merge pull request #1483 from KokeroO/develop
chore: possibilita o envio de medias do tipo [svg, tiff] vindas do Chatwoot
2025-05-22 07:03:41 -03:00
Davidson Gomes
edde059fa1
Merge pull request #1484 from oriondesign2015/develop
fix: melhora consistência e formatação dos chatbots (N8N e Evolution Bot)
2025-05-22 06:58:21 -03:00
OrionDesign
dcb09b87fe fix: corrige comportamento de sessão pausada no N8N
Corrige o problema onde o N8N reativava automaticamente a sessão após receber uma mensagem quando estava pausado. Agora, quando uma sessão está pausada, o bot ignora completamente as mensagens recebidas até que a sessão seja explicitamente reativada através do endpoint de mudança de status.
2025-05-22 01:08:48 -03:00
OrionDesign
bbf142cf39 fix: corrige comportamento de sessão pausada no Evolution Bot
Corrige o problema onde o Evolution Bot reativava automaticamente por qualquer mensagem do usuario quando a sessão estava pausada. Agora, quando uma sessão está pausada, o bot ignora completamente as mensagens recebidas até que a sessão seja explicitamente reativada.
2025-05-22 01:01:51 -03:00
OrionDesign
da51b6bd76 fix: corrige processamento de mensagens subsequentes no Evolution Bot
Corrige o problema onde o Evolution Bot não processava mensagens subsequentes após a primeira resposta. A correção permite que o bot continue respondendo a todas as mensagens enquanto a sessão estiver ativa, melhorando a continuidade da conversa.
2025-05-22 00:54:37 -03:00
Willian Coqueiro
8b15c11817 chore: adiciona suporte para extensão de arquivo .tif no envio de documentos 2025-05-22 03:38:57 +00:00
Willian Coqueiro
272a4de236 chore: possibilita o envio de medias do tipo svg e tiff vindas do Chatwoot 2025-05-22 03:29:16 +00:00
OrionDesign
65111481b9 fix: remove quebras de linha extras nas mensagens do N8n
Corrige o problema de formatação nas mensagens do N8n onde quebras de linha extras estavam sendo adicionadas antes e depois das mídias (imagens, vídeos, etc). Agora o texto é enviado mantendo apenas as quebras de linha intencionais.
2025-05-22 00:17:06 -03:00
Willian Coqueiro
0ca109e9d6 chore: possibilita o envio de medias do tipo .svg 2025-05-22 03:02:04 +00:00
Davidson Gomes
5b817028a9 refactor(chatbot): enhance EvoaiService with OpenAI integration
- Integrated OpenAI service into the EvoaiService to streamline audio message transcription.
- Updated the constructor to initialize OpenaiService, allowing for direct transcription of audio messages.
- Refactored audio message handling to utilize the OpenAI service for improved reliability and maintainability.
- Adjusted the processing logic to handle transcription results more effectively, ensuring fallback content is provided when transcription fails.

This commit focuses on enhancing the EvoaiService's capabilities by leveraging OpenAI for audio transcription, improving overall service functionality and code structure.
2025-05-21 22:27:59 -03:00
Davidson Gomes
6a0fc19702 refactor(chatbot): integrate OpenAI service into chatbot implementations
- Updated various chatbot services (Typebot, Dify, EvolutionBot, Flowise, N8n) to include the OpenAI service for audio transcription capabilities.
- Modified constructors to accept OpenaiService as a dependency, enhancing the ability to transcribe audio messages directly within each service.
- Refactored the handling of `keywordFinish` in multiple controllers and services, changing its type from an array to a string for consistency and simplifying logic.
- Removed redundant audio transcription logic from the base service, centralizing it within the OpenAI service to improve maintainability and reduce code duplication.

This commit focuses on enhancing the chatbot services by integrating OpenAI's transcription capabilities, improving code structure, and ensuring consistent handling of session keywords.
2025-05-21 22:17:10 -03:00
Davidson Gomes
9cedf31eed feat(env): enhance webhook configuration and SSL support
- Added new environment variables for SSL configuration, including `SSL_CONF_PRIVKEY` and `SSL_CONF_FULLCHAIN`, to support secure connections.
- Introduced additional webhook configuration options in the `.env.example` file, such as `WEBHOOK_REQUEST_TIMEOUT_MS`, `WEBHOOK_RETRY_MAX_ATTEMPTS`, and related retry settings to improve webhook resilience and error handling.
- Updated the `bootstrap` function in `main.ts` to handle SSL certificate loading failures gracefully, falling back to HTTP if necessary.
- Enhanced error handling and logging in the `BusinessStartupService` to ensure better traceability and robustness when processing messages.

This commit focuses on improving the security and reliability of webhook interactions while ensuring that the application can handle SSL configurations effectively.
2025-05-21 17:55:00 -03:00
Davidson Gomes
f9567fbeaa refactor(chatbot): unify keywordFinish type and enhance session handling
- Changed the type of `keywordFinish` from an array to a string in multiple DTOs and controller interfaces to simplify data handling.
- Updated the `BaseChatbotService` to include logic for updating session status to 'opened' and managing user responses more effectively.
- Refactored the media message handling in the `BaseChatbotService` to streamline the process and improve readability.
- Enhanced error logging across various services to ensure better traceability during operations.

This commit focuses on improving the structure and consistency of chatbot integrations while ensuring that session management is robust and user-friendly.
2025-05-21 17:02:24 -03:00
Davidson Gomes
d673c83a93 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2025-05-21 15:14:50 -03:00
Davidson Gomes
e16bb0e580 style(whatsapp): format code for consistency
- Adjusted spacing in destructuring assignments for `remoteJid` in multiple locations to enhance code readability and maintain consistency with coding standards.
- Removed unnecessary blank lines to streamline the code structure.

This commit focuses on improving the overall style of the `whatsapp.baileys.service.ts` file without altering any functionality.
2025-05-21 15:14:41 -03:00
Davidson Gomes
09120aa026
Merge pull request #1482 from gomessguii/fix/message-query
Refatoração da funcionalidade de chatbots (em andamento)
2025-05-21 15:14:25 -03:00
Davidson Gomes
fbfa364df9 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2025-05-21 15:01:22 -03:00
Davidson Gomes
624b37e2aa fix(media): improve media download handling for base64 conversion
- Enhanced the logic for converting media messages to base64 by adding a retry mechanism for downloading media if the initial buffer is not available.
- This change ensures that media messages are reliably converted to base64 format, improving the robustness of media handling in the WhatsApp integration service.
- Updated error logging to capture issues during the media conversion process.
2025-05-21 15:01:17 -03:00
Davidson Gomes
fcde1f9acc
Merge pull request #1481 from AlexSzefezuk/fix-chatwoot-import
Fix-chatwoot-import
2025-05-21 13:54:51 -03:00
Davidson Gomes
cc01787501
Merge pull request #1473 from KokeroO/develop
fix: Deadlock errors and undefined arguments
2025-05-21 13:52:57 -03:00
Guilherme Gomes
c30bae4c3a refactor(openai): improve service initialization and streamline audio transcription handling
- Updated OpenaiService and related classes to enhance the initialization process by ensuring the correct order of parameters.
- Simplified audio message handling by consolidating transcription logic and improving error handling.
- Refactored the OpenaiController to utilize the new structure, ensuring better integration with the base chatbot framework.
- Enhanced logging for better traceability during audio processing and API interactions.
2025-05-21 12:16:12 -03:00
Alex Szefezuk
2545013040 fix: enable sourceId exists in a conversation 2025-05-21 10:36:26 -03:00
Willian Coqueiro
c53a96e757 Fix suggestions 2025-05-20 13:07:28 +00:00
Willian Coqueiro
a2d8642e1c fix: Corrige processamento de documentos sem filename.
## Erros:
- Cannot read properties of null (reading 'fileName')
2025-05-19 23:21:01 +00:00
Willian Coqueiro
9c530c69cf fix: Evita tentar processar media messageContextInfo e disparar um erro generico. 2025-05-19 23:18:23 +00:00
Willian Coqueiro
348a4ff251 fix: Corrige problemas com deadlocks
## Erros:
- code: "40P01", message: "deadlock detected".
- Argument status is missing.
2025-05-19 23:14:57 +00:00
Willian Coqueiro
fc00916345 fix: Corrige o erro Unable to fit integer value '1747658857155' into an INT4 (32-bit signed integer.
## Solução
Após analise dos valores recebidos e seguindo a logica em outras partes também, se confirma que o valor de entrada é de timestamp em ms.
2025-05-19 23:05:11 +00:00
Guilherme Gomes
69b4f1aa02 feat(chatbot): implement base chatbot structure and enhance integration capabilities
- Introduced a base structure for chatbot integrations, including BaseChatbotController and BaseChatbotService.
- Added common DTOs for chatbot settings and data to streamline integration processes.
- Updated existing chatbot controllers (Dify, Evoai, N8n) to extend from the new base classes, improving code reusability and maintainability.
- Enhanced media message handling across integrations, including audio transcription capabilities using OpenAI's Whisper API.
- Refactored service methods to accommodate new message structures and improve error handling.
2025-05-17 16:22:13 -03:00
Davidson Gomes
7cccda10bb
Merge pull request #1456 from thiagoomatheus/main
Fixes issue #879
2025-05-16 13:38:30 -03:00
Davidson Gomes
33c808b195
Merge pull request #1457 from gomessguii/fix/message-query
feat(channel): enhance pushName logic for messages
2025-05-16 12:02:31 -03:00
Guilherme Gomes
d3ee370bdc feat(channel): enhance pushName logic for messages
- Updated the pushName selection to differentiate between group and individual messages.
- Added conditional logic to display the chat name for group messages and the sender's name for individual messages.
2025-05-16 11:33:52 -03:00
thiagoomatheus
7e5740b462 fix(media): allow multiples files with same name 2025-05-15 22:37:55 -03:00
Davidson Gomes
0b33a76394 changelog v2.3.0 2025-05-15 18:49:35 -03:00
Davidson Gomes
6a0b024b13
Merge pull request #1453 from gomessguii/fix/evoai-migration
feat(evoai): add Evoai and EvoaiSetting tables with foreign key const…
2025-05-15 18:20:09 -03:00
Guilherme Gomes
fda6b0d50e feat(evoai): add Evoai and EvoaiSetting tables with foreign key constraints
- Created the Evoai and EvoaiSetting tables in the PostgreSQL migration.
- Defined primary keys and added foreign key constraints to link with the Instance table.
- Included unique index on instanceId for EvoaiSetting to ensure data integrity.
2025-05-15 18:19:23 -03:00
Davidson Gomes
9ec6847683
Merge pull request #1452 from gomessguii/feature/new-manager-version
feat: updated manager to the last version with suport to n8n and EvoA…
2025-05-15 18:12:38 -03:00
Guilherme Gomes
c745fbad64 feat: updated manager to the last version with suport to n8n and EvoAI chatbot integrations 2025-05-15 18:09:23 -03:00
Davidson Gomes
40ea8bf356
Merge pull request #1451 from gomessguii/feature/evoai-chatbot
feat(evoai): add EvoAI integration with models, services, and routes
2025-05-15 15:50:12 -03:00
Guilherme Gomes
0699ad4bb0 fix(evoai): update EvoAI service initialization to include configService
- Modified the EvoaiService instantiation in the server module to include configService for enhanced configuration management.
2025-05-15 15:46:13 -03:00
Guilherme Gomes
70a4fe8f6e feat(evoai): enhance media message handling and transcription capabilities
- Added support for audio message detection and transcription using OpenAI's Whisper API.
- Integrated media downloading for both audio and image messages, with appropriate error handling.
- Updated logging to redact sensitive information from payloads.
- Modified existing methods to accommodate the new message structure, ensuring seamless integration with EvoAI services.
2025-05-15 15:42:17 -03:00
Guilherme Gomes
71124755b0 feat(evoai): add EvoAI integration with models, services, and routes
- Introduced Evoai and EvoaiSetting models in both MySQL and PostgreSQL schemas.
- Implemented EvoaiController and EvoaiService for managing EvoAI bots.
- Created EvoaiRouter for handling API requests related to EvoAI.
- Added DTOs and validation schemas for EvoAI integration.
- Updated server module and chatbot controller to include EvoAI functionality.
- Configured environment settings for EvoAI integration.
2025-05-15 11:54:11 -03:00
Davidson Gomes
a1cc504777
Merge pull request #1449 from gomessguii/feature/enhance-message-fetching
feat(whatsapp): enhance message fetching and processing logic
2025-05-14 21:44:39 -03:00
Davidson Gomes
0fd2e04286
Merge pull request #1448 from gomessguii/feature/n8n-chatbot
Add N8n integration with models, services, and routes
2025-05-14 21:44:25 -03:00
Guilherme Gomes
4f2b0c42f3
Merge pull request #2 from EvolutionAPI/develop
Develop
2025-05-14 21:35:36 -03:00
Guilherme Gomes
401b0359cd
Merge pull request #1 from EvolutionAPI/develop
Develop
2025-05-14 21:32:41 -03:00
Davidson Gomes
b1f3c5cc5f
Merge pull request #1450 from gomessguii/fix/npm-install-action
fix: remove postinstall script from package.json to fix GitHub Action
2025-05-14 21:29:57 -03:00
Guilherme Gomes
362736ea71 refactor(whatsapp): format userDevicesCache initialization for improved readability 2025-05-14 21:27:23 -03:00
Guilherme Gomes
2544c10592 fix: remove postinstall script from package.json to fix GitHub Action 2025-05-14 21:22:52 -03:00
Guilherme Gomes
383805aa95 feat(whatsapp): enhance message fetching and processing logic
- Added a new method `fetchMessages` to retrieve messages based on various query parameters.
- Improved handling of `pushName` for messages, ensuring proper assignment based on participant information.
- Refactored user devices cache initialization for better readability.
- Cleaned up commented-out code related to message recovery.
2025-05-14 21:12:45 -03:00
Guilherme Gomes
71101807bb Refactor N8n integration: update schema exports, improve import order, and enhance service logic
- Added export for N8n schema in chatbot.schema.ts.
- Improved import order in n8n.dto.ts and n8n.router.ts for better readability.
- Refactored variable declarations in n8n.service.ts for consistency and clarity.
2025-05-14 20:50:48 -03:00
Guilherme Gomes
38f089f04c Add N8n integration with models, services, and routes
- Introduced N8n and N8nSetting models in both MySQL and PostgreSQL schemas.
- Implemented N8nController and N8nService for managing N8n bots.
- Created N8nRouter for handling API requests related to N8n.
- Added DTOs and validation schemas for N8n integration.
- Updated server module and chatbot controller to include N8n functionality.
- Configured environment settings for N8n integration.
2025-05-14 20:47:23 -03:00
Davidson Gomes
6d63f2fb6e
Merge pull request #1420 from luiis716/main
Findchat group name treatment
2025-05-13 06:28:21 -03:00
Davidson Gomes
bb0b9b94ff
Merge branch 'develop' into main 2025-05-13 06:28:07 -03:00
luiis716
a449fdf0ef
Findchat group name treatment 2025-05-12 16:14:59 -03:00
Davidson Gomes
ec9de49647
Merge pull request #1435 from edisonmartinsmkt/fix/audio-caption-fallback
fix(chatwoot): only fallback audio caption when audioMessage exists
2025-05-10 19:14:41 -03:00
edisoncm-ti
a7a9de2903 fix: only fallback caption when audioMessage exists 2025-05-10 16:20:05 -03:00
Davidson Gomes
99b0c86278
Merge pull request #1422 from icaro-andrade/patch-2
Update package.json
2025-05-10 13:07:39 -03:00
Davidson Gomes
e6a72bd829
Merge pull request #1406 from Faelst/hotfix/issues-1385
fix: when you set jpegThumbnail, image not appear on app mobile
2025-05-10 13:07:06 -03:00
Davidson Gomes
341a0d884f
Merge pull request #1332 from theeusmartins/main
Defininando TTL no userDivicesCache igual usado no Baileys
2025-05-10 11:26:23 -03:00
Davidson Gomes
383bac090a
Merge pull request #1434 from edisonmartinsmkt/fix/group-audio-caption
fix(chatwoot): avoid "undefined" caption on group audio messages
2025-05-10 11:25:14 -03:00
edisoncm-ti
60a58ca037 fix: not show undefined in caption for received audio messages in group chats 2025-05-10 11:12:44 -03:00
Davidson Gomes
e5989f3d47
Merge pull request #1433 from paulocoutinhox/fix-mysql-wavoip-token
fix mysql wavoip token
2025-05-10 10:32:12 -03:00
Davidson Gomes
bff3bf564b
Merge pull request #1415 from victoreduardo/victoreduardos/fix-conversation-not-found
fix: Erro na criação de conversation quando já existe uma conversation de outro inbox para o mesmo usuário
2025-05-10 10:31:06 -03:00
Davidson Gomes
c74eee8e52
Merge pull request #1414 from onerrogus/fix_link_preview
Corrigir utilização do linkPreview no WhatsApp Business API
2025-05-10 10:30:54 -03:00
Davidson Gomes
d1a28ea4f7
Merge pull request #1318 from victoreduardo/victoreduardos/jwt-webhook
Tornando Webhook mais seguro com JWT token
2025-05-10 10:28:07 -03:00
Davidson Gomes
d2f1985913
Merge pull request #1425 from edisonmartinsmkt/develop
fix(audio): ensure full WhatsApp compatibility for audio conversion
2025-05-10 08:33:28 -03:00
Paulo Coutinho
90e27cc7d8 fix mysql wavoip token 2025-05-10 03:53:35 -03:00
edisoncm-ti
c4ddfe6804 style: fix linting issues with Prettier 2025-05-07 18:18:47 -03:00
edisoncm-ti
aaa103a842 fix(audio): ensure full WhatsApp compatibility for audio conversion (libopus, 48kHz, mono) 2025-05-07 13:41:09 -03:00
icaro-andrade
b2809b6f3e
Update package.json 2025-05-06 19:33:46 -03:00
luiis716
d52256718d
Findchat group name treatment
ajusta para endpoint puxa o nome do grupo correntemente quando for grupo usando nomenclatura @g.us
2025-05-03 14:55:07 -03:00
Victor Eduardo
8f0ede4207 fix: preventing use conversation from other inbox for the same user 2025-05-03 09:56:28 -03:00
Victor Eduardo
95827a2d70 lint 2025-05-03 09:42:18 -03:00
Victor Eduardo
b064e512e2
Merge branch 'develop' into victoreduardos/jwt-webhook 2025-05-03 09:40:37 -03:00
OnerRogus
db5f0d0891 fix: corrigido erro que não exibia o preview das urls quando utilizado o whatsapp business api 2025-05-02 15:32:47 -03:00
Davidson Gomes
ccbd866e42
Merge pull request #1384 from leandrosroc/develop
fix(api): modifica fetchChats para trazer mensagens de contatos não salvos
2025-04-30 06:15:42 -03:00
Rafael Silverio
dc67039b39 fix: when you set jpegThumbnail, image not appear on app mobile 2025-04-29 14:54:42 -03:00
Leandro Santos Rocha
eeedfb0e2a
fetchContacts - nestordavalos 2025-04-22 16:12:47 -03:00
Leandro Santos Rocha
3ab75faff7
fix lint 2025-04-21 00:42:33 -03:00
Leandro Santos Rocha
095754d173
perf(api): otimiza paginação em fetchChats usando LIMIT/OFFSET no SQL 2025-04-21 00:38:25 -03:00
Leandro Rocha
b94b452597 fix(api): modifica fetchChats para trazer mensagens de contatos não salvos
- Muda tabela base da consulta de Contact para Message
- Altera INNER JOIN para LEFT JOIN entre Message e Contact
- Usa COALESCE para campos que podem estar vazios
- Adiciona flag isSaved para identificar contatos salvos/não salvos
- Preserva toda funcionalidade de filtros existente

Resolve issue #1376
2025-04-21 00:30:48 -03:00
Davidson Gomes
2ded19752f
Merge pull request #1366 from adaptwebtech/hotfix_chatname
Corrigindo um bug ao atualizar o push name no evento MESSAGES_UPSERT e MESSAGES_UPDATE
2025-04-14 20:06:23 -03:00
pedro-php
4c8c7ee19b lint fixes 2025-04-09 15:15:48 -03:00
pedro-php
8c6f95fbef Fixing chatname on the events message.upsert and message.update in order to return always the chatname from the user correctly 2025-04-09 14:55:22 -03:00
Davidson Gomes
402b37d7b4
Merge pull request #1351 from ricocorreia1/main
Correção para quando enviar uma localização.
2025-04-08 19:10:38 -03:00
Davidson Gomes
09f79c94be
Merge pull request #1362 from Deyvi-dev/develop
feat(s3): add S3_SKIP_POLICY env variable to disable setBucketPolicy
2025-04-08 10:51:52 -03:00
Davidson Gomes
7c7dca9da9
Merge pull request #1354 from jeffersonfelixdev/hotfix/issue-1348
Hotfix - shell injection vulnerability
2025-04-08 10:51:35 -03:00
deyvi-dev
1d2e029b54 feat(s3): add S3_SKIP_POLICY env variable to disable setBucketPolicy for incompatible providers 2025-04-07 20:23:33 -03:00
Jefferson Felix
3f8d89e970 fix: remove wildcard 2025-04-02 12:04:07 -03:00
Jefferson Felix
abda9e2113 docs: update CHANGELOG.md 2025-04-02 11:55:53 -03:00
Jefferson Felix
2a020928e8 fix: change execSync to execFileSync 2025-04-02 11:55:23 -03:00
ricocorreia1
b436e5b0b0 quando localização, conversão de degreesLatitude para string, o parametro content é do tipo string nas chamadas de findBotByTrigger() em chatbot.controller. 2025-04-01 23:26:46 -03:00
Davidson Gomes
9889035ddc
Merge pull request #1344 from alvestassio/fix/multiple-files-sent-via-whatsapp
Adicionando um timestamp ao filename para possibilitar enviar o mesmo arquivo mais de uma vez na mesma conversa.
2025-03-30 12:09:01 -03:00
Davidson Gomes
07ce09d8e2
Merge pull request #1322 from marceloapd/fix/animated-stickers
Fix/animated stickers
2025-03-30 12:08:15 -03:00
Davidson Gomes
0d2a7ad50b
Merge pull request #1343 from adaptwebtech/new_feature_add_send_update_message_webhook
Adicionando um novo webhook no endpoint de updateMessage
2025-03-30 12:08:03 -03:00
pedro-php
7e8044a777 lint changes 2025-03-28 11:10:48 -03:00
pedro-php
645f305cd6 fixing build error on prisma 2025-03-28 11:08:38 -03:00
pedro-php
829032dc08 lint changes 2025-03-28 10:58:32 -03:00
pedro-php
3d40b0850b lint changes 2025-03-28 10:57:59 -03:00
pedro-php
17bd108251 treating errors gracefully 2025-03-28 10:56:19 -03:00
pedro-php
f695e8bdc9 merging with develop 2025-03-28 10:36:34 -03:00
Tassio Alves
bf59ff1287 [FIX] Run lint 2025-03-27 14:36:39 -04:00
Tassio Alves
ce1680f515 [FIX] Adding a timestamp to the filename to make it possible to send the same file more than once in the same conversation. 2025-03-27 10:46:13 -04:00
pedro-php
119ceba1ca Adding a new webhook that triggers when a message is updated by the user 2025-03-27 11:13:22 -03:00
Marcelo Assis
9710fbdac4 remove animated to webp 2025-03-26 13:09:08 -03:00
Marcelo Assis
658dae0b59 lint fix 2025-03-26 10:45:09 -03:00
Davidson Gomes
b89f1144b4
Merge pull request #1334 from adaptwebtech/fix_and_add_name_to_find_chats_and_paginate_get_contacts_and_get_chats
Corrigindo um bug no endpoint de findChats e permitindo paginação nos endpoints de findChats e findContacts
2025-03-26 10:34:56 -03:00
Pedro Afonso
d196590862
Update src/api/services/channel.service.ts
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-03-25 11:17:46 -03:00
pedro-php
c5c354ffe7 fix_and_add_name_to_find_chats_and_paginate_get_contacts_and_get_chats 2025-03-25 10:52:19 -03:00
Matheus Martins Piedade
36757dddc2 Defininando TTL no userDivicesCache igual usado no Baileys 2025-03-24 15:15:45 -03:00
Marcelo Assis
027401b839 fix: normalize file extension checks for case insensitivity in sticker conversion 2025-03-20 19:13:19 -03:00
Marcelo Assis
6e7dd51679 fix: preserve animation in GIF and WebP stickers 2025-03-20 19:00:02 -03:00
Marcelo Assis
f8b1c6e0fa fix: preserve animation in GIF and WebP stickers 2025-03-20 18:37:58 -03:00
Victor Eduardo
cee2bc4d71 sending JWT token when sending webhook if jwt_key exists in webhook header record 2025-03-19 18:04:42 -03:00
Davidson Gomes
043df62a8f
Merge pull request #1304 from rafwell/main
Add eventos referente a instancia que estavam faltando
2025-03-14 14:33:41 -03:00
Rafael Souza
53ae521863 Add eventos referente a instancia que estavam faltando 2025-03-10 18:11:03 -03:00
Davidson Gomes
13bdbc268c
Merge pull request #1290 from jrCleber/main
Corrige validação de URL para permitir localhost e endereços IP
2025-03-06 16:59:48 -03:00
Davidson Gomes
ea9c3fbbe0
Merge pull request #1287 from pedroepif/main
fix: adjusting cloud api send audio and video
2025-03-06 16:53:05 -03:00
Cleber Wilson
22a958616d basic regex for url 2025-03-06 16:17:42 -03:00
Davidson Gomes
32cde710b8 feat: Enhance WebSocket authentication and connection handling
- Add robust authentication mechanism for WebSocket connections
- Implement API key validation for both instance-specific and global tokens
- Improve connection request handling with detailed logging
- Refactor WebSocket controller to support more secure connection validation
2025-03-06 09:17:43 -03:00
Pedro Epifanio
d9aa111800 fix: lint 2025-03-06 08:59:45 -03:00
Pedro Epifanio
fb41ab14e8 fix: adding media verification 2025-03-05 20:01:14 -03:00
Pedro Epifanio
5998fcf940 fix: adjustin cloud api send audio and video 2025-03-05 19:54:34 -03:00
Davidson Gomes
2198a86ae4 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2025-02-25 15:44:42 -03:00
Davidson Gomes
8a54efe11c feat: Add NATS integration and update Baileys service
- Create Nats table in PostgreSQL migration
- Disable message recovery logic in Baileys service
- Remove console log in instance creation route
2025-02-25 15:42:40 -03:00
Davidson Gomes
4fadf64bae
Merge pull request #1264 from ygorsantana/fix/expiration-useless
Fix: Expiration being useless on awaitUser false
2025-02-22 21:03:05 -03:00
Ygor Santana
2f1df734e0 style: run lint 2025-02-22 14:17:37 -03:00
Ygor Santana
247c39fe39 fix: expiration time being useless when not awaitUser 2025-02-22 14:16:08 -03:00
Davidson Gomes
ada63b58af
Merge pull request #1251 from fernandoralha/hotfix/sqs-event
fix: Refactor SQS controller to correct bug in sqs events by instance
2025-02-21 19:31:29 -03:00
Davidson Gomes
5192f49a4f
Merge pull request #1259 from julianoaj/develop
 Feat: Remover a reação de uma mensagem.
2025-02-21 19:24:39 -03:00
julianoaj
48b5fd41e0 🐛 Fix: Linting requirements 2025-02-20 17:25:39 -03:00
julianoaj
5720bdc0ef Remove reaction from a message 2025-02-20 16:54:29 -03:00
Alison Juliano
ab2364b9a3
Merge pull request #1 from julianoaj/fix-1234-migration-wavoipToken-create
🐛 Corrige problema na API relacionado à migration. Fixes #1234
2025-02-18 13:36:21 -03:00
“fernandoralha”
278add6b11 fix: Refactor SQS controller to correct bug in sqs events by instance
- Implement dynamic queue creation based on enabled events - Add method to list existing queues for an instance - Improve error handling and logging for SQS operations - Remove unused queue removal methods - Update set method to handle queue creation/deletion on event changes - Add comments for future feature of forced queue deletion
2025-02-17 21:22:59 -03:00
Davidson Gomes
8f632a6f5c
Merge pull request #1244 from AndersonSilvaCavalcante/hotfix/missing-wavoipToken-mysql
hotfix(migration): add missing wavoipToken column in MySQL schema
2025-02-16 13:04:29 -03:00
Anderson Cavalcante
a4ac798b43 hotfix(migration): add missing wavoipToken column in MySQL schema 2025-02-14 15:26:07 -03:00
Davidson Gomes
fc513f1d1d
Merge pull request #1240 from ygorsantana/fix/list-response-message
fix: change mediaId optional chaining and list response message text obtain
2025-02-14 13:05:34 -03:00
Ygor Santana
6f1667abb5 style: run lint 2025-02-14 12:58:46 -03:00
Davidson Gomes
98b8419b8d
Merge pull request #1237 from GrimBit1/main
Refactor Editing Message events and update message handler
2025-02-14 12:09:27 -03:00
Ygor Santana
59479f9a21 fix: obtain mediaUrl not defined 2025-02-13 22:35:09 -03:00
Ygor Santana
ff77bc018a fix: change mediaId optional chaining and list response message text obtain 2025-02-13 21:54:09 -03:00
Aditya Nandwana
33f7f2932d Implement message update handling in BaileysStartupService 2025-02-13 11:07:18 +05:30
Aditya Nandwana
c939ed2337 Enhance message editing validation in BaileysStartupService 2025-02-13 10:39:29 +05:30
Davidson Gomes
a49c97996c
Merge pull request #1235 from julianoaj/fix-1234-migration-wavoipToken-create
🐛 Fix: Add migration for missing wavoipToken column in MySQL build env (#1234)
2025-02-12 18:23:35 -03:00
julianoaj
da72edfb03 🐛 Corrige problema na API relacionado à migration. Fixes #1234
Corrige problema na API relacionado à migration. Fixes #1234
2025-02-12 16:14:21 -03:00
Davidson Gomes
b51526aff3
Merge pull request #1226 from Desarrollo-TMS/fix-csat-chatwoot
fix: chatwoot csat creating new conversation in another language
2025-02-11 12:14:50 -03:00
Alexis Hernandez
b93ee2e023 fix: chatwoot csat creating new conversation in another language 2025-02-11 08:20:36 -04:00
Davidson Gomes
b58d9e957f Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2025-02-10 12:53:06 -03:00
Davidson Gomes
e5137e1aac
Merge pull request #1221 from mbap-dev/fix-audio
Fix audio send duplicate from chatwoot.
2025-02-10 12:52:48 -03:00
mbap-dev
6b120e5da2 Fix audio send duplicate from chatwoot. 2025-02-09 20:12:40 -03:00
Davidson Gomes
342dacc398
Merge pull request #1217 from Desarrollo-TMS/feat-message-location
feat: add message location support whatsapp meta
2025-02-07 16:57:45 -03:00
Alexis Hernandez
d75c37e233 feat: add message location support meta 2025-02-07 13:04:36 -04:00
Davidson Gomes
36df38d78b
Merge pull request #1215 from rafwell/main
Fix instance creation on v2.2.3
2025-02-07 12:34:32 -03:00
Davidson Gomes
68c6ad4f91
Merge pull request #1211 from joaosouz4dev/main
feat: notconvertsticket for animated stickers
2025-02-07 11:38:00 -03:00
Davidson Gomes
8685f2fdc4
Merge pull request #1214 from wayre/develop
Adicionado suporte para obter Catálogos e Coleções no WhatsApp Business
2025-02-07 11:19:11 -03:00
Rafael Souza
5a50381a8e Fix table name 2025-02-07 10:07:38 -03:00
Rafael Souza
736ca5e4b6 Fix case in table name 2025-02-07 09:52:08 -03:00
Wayre Avelar
6c1355b64b feat: Criado um novo grupo de rotas (business) para tratar dos catalogos de produtos e Coleções evitando alterações desnecessárias em arquivos do repositório 2025-02-07 00:56:49 -03:00
João Victor Souza
95401cf9b0
fix: rollback deploy_database.sh 2025-02-06 18:05:31 -03:00
João Victor Souza
0c5d28bb6c Merge branch 'main' of https://github.com/EvolutionAPI/evolution-api 2025-02-06 18:02:36 -03:00
João Victor Souza
0d1e7c08c9 feat: sendsticket notconvertsticket 2025-02-06 17:56:21 -03:00
Davidson Gomes
d665474404 feat: Add NATS integration support to the event system
- Added NATS package to dependencies
- Created Prisma schema models for NATS configuration
- Implemented NATS controller, router, and event management
- Updated instance controller and event manager to support NATS
- Added NATS configuration options in environment configuration
- Included NATS events in instance validation schema
2025-02-05 17:05:29 -03:00
Davidson Gomes
9a72b90ab2 refactor: Make RabbitMQ prefix key optional in configuration 2025-02-04 17:57:21 -03:00
Davidson Gomes
b143363c5d
Merge pull request #1201 from wayre/catalogProducts
Feat: Adicionei suporte para obter o Catálogos de Produtos e as Coleções de Produtos para a versão 2.2.3
2025-02-04 09:59:59 -03:00
Wayre Avelar
56a8e09ba8 chore: eslint applied 2025-02-04 09:04:41 -03:00
Davidson Gomes
023e030802
Merge pull request #1195 from GrimBit1/main
Refactor edit and delete message functionality in BaileyStartupService
2025-02-04 06:22:49 -03:00
Wayre Avelar
e27db0612f feat: Add support to get Catalogs and Collections with new routes: '{{baseUrl}}/chat/fetchCatalogs' and '{{baseUrl}}/chat/fetchCollections' 2025-02-04 03:51:47 -03:00
Davidson Gomes
e51b6e9270 fix: improve message deduplication and edited message handling in Baileys service
- Refactor edited message detection logic
- Prevent duplicate message processing for edited messages
- Optimize message key caching mechanism
2025-02-03 17:19:07 -03:00
Davidson Gomes
867e8493aa fix: added cache to identify duplicated messages on events
- Update Docker image repository to evoapicloud/evolution-api
- Modify contact email to contato@evolution-api.com
- Update Docker Compose, Dockerfile, and workflow files
- Add Docker image badge to README
- Include additional content creator in README
- Implement message deduplication cache in Baileys service
2025-02-03 15:37:11 -03:00
Davidson Gomes
8135994340 Merge tag '2.2.3' into develop
v
2025-02-03 11:52:51 -03:00
Davidson Gomes
427c994993 Merge branch 'release/2.2.3' 2025-02-03 11:52:49 -03:00
Davidson Gomes
da74611769 version: 2.2.3 2025-02-03 11:52:37 -03:00
Aditya Nandwana
91e7a32209 Refactor createJid method in BaileysStartupService 2025-02-03 14:24:27 +05:30
Aditya Nandwana
4137984b5d Refactor message deletion in BaileysStartupService 2025-02-03 11:44:41 +05:30
Aditya Nandwana
96821f5d9a Refactor BaileysStartupService updateMessage method 2025-02-03 11:43:53 +05:30
Davidson Gomes
3c2ea5c67c feat: Re-enable group metadata caching in Baileys service
- Restore group metadata caching mechanisms
- Uncomment cache-related methods for group updates and participants
- Implement conditional group metadata retrieval based on cache configuration
2025-02-02 16:42:17 -03:00
Davidson Gomes
4a5d7a91e2 chore: Update Baileys package to latest commit hash 2025-02-02 11:39:45 -03:00
Davidson Gomes
9109b140a9
Merge pull request #1192 from tonimoreiraa/fix-dify-truncated-messages
fix(dify-service): Truncated messages (agent bot)
2025-02-01 16:11:07 -03:00
Davidson Gomes
ff5a8adc71
Merge pull request #1190 from GrimBit1/main
Fix Message deletion in Whatsapp Bailey Service
2025-02-01 16:08:56 -03:00
Davidson Gomes
b09638600e chore: Upgrade Baileys to version 6.7.12
- Update Baileys package to latest version
- Bump package version to 2.2.3
2025-02-01 15:39:14 -03:00
Toni Moreira
fc84e0f327
fix: dify truncated messages 2025-02-01 11:47:50 -03:00
Aditya Nandwana
c1494ca035 Refactor logical message deletion in BaileysStartupService 2025-02-01 16:09:08 +05:30
Davidson Gomes
7ea46a05ca version: 2.2.3 2025-01-31 17:45:09 -03:00
Davidson Gomes
f8f1cbf4a2 fix: Disable group metadata caching in Baileys service
- Remove group metadata caching mechanisms
- Modify group-related cache update methods
- Simplify group metadata retrieval process
2025-01-31 17:44:44 -03:00
Davidson Gomes
79b1c6bb1c feat: Add configurable file/cache storage for authentication state
- Update Baileys package to version 6.7.10
- Implement conditional storage mechanism for authentication state
- Add support for file-based or Redis cache storage based on environment configuration
- Re-enable previously commented out file handling utility functions
2025-01-31 17:38:42 -03:00
Davidson Gomes
169d2f797b Merge tag '2.2.2' into develop
v
2025-01-31 07:14:30 -03:00
Davidson Gomes
db9cdbfc38 Merge branch 'release/2.2.2' 2025-01-31 07:14:29 -03:00
Davidson Gomes
6afcc958c5 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2025-01-31 07:13:54 -03:00
Davidson Gomes
2166aad1d3 Merge tag '2.2.2' into develop
v
2025-01-31 07:13:30 -03:00
Davidson Gomes
14fea2f5e0 Merge branch 'release/2.2.2' 2025-01-31 07:13:25 -03:00
Davidson Gomes
9122dae262 version: 2.2.2 2025-01-31 07:13:10 -03:00
Davidson Gomes
96549664c9
Merge pull request #1179 from MarceloSoaresJr/develop
bugfix: SQL query column quoting in ChannelStartupService
2025-01-28 18:41:14 -03:00
Davidson Gomes
fa19c7fa89 feat(rabbitmq): Add prefix key configuration for queue names 2025-01-28 18:01:28 -03:00
Marcelo Soares
503728e1e7
fix: SQL query column quoting in ChannelStartupService 2025-01-27 17:42:04 -03:00
Davidson Gomes
f11e3247f0 Merge tag '2.2.1' into develop
* Retry system for send webhooks
* Message filtering to support timestamp range queries
* Chats filtering to support timestamp range queries

* Correction of webhook global
* Fixed send audio with whatsapp cloud api
* Refactor on fetch chats
* Refactor on Evolution Channel
2025-01-22 14:39:40 -03:00
Davidson Gomes
7f10a0eecd Merge branch 'release/2.2.1' 2025-01-22 14:39:27 -03:00
Davidson Gomes
a1085b4a4d version: 2.2.1 2025-01-22 14:38:50 -03:00
Davidson Gomes
b1b2d18e5d Remove redundant migration cleanup step for wavoip_token in PostgreSQL migration file. This change simplifies the migration process by eliminating unnecessary deletion of previous migration records, ensuring a cleaner migration history. 2025-01-22 12:01:17 -03:00
Davidson Gomes
37a9e316a8 Refactor database migrations and schema for Chat and Setting tables
- Removed the unique constraint on `remoteJid` and `instanceId` in the `Chat` model to prevent potential migration failures due to existing duplicates.
- Deleted the old migration file for adding `wavoipToken` to the `Setting` table and created a new migration that includes a check for the column's existence before adding it, ensuring smoother migration processes.
- Updated migration logic to clear previous migrations related to `wavoip_token` to maintain a clean migration history.
2025-01-22 11:58:34 -03:00
Davidson Gomes
f340f7716f Remove unused dependencies from ChannelController to streamline integration logic 2025-01-22 11:14:05 -03:00
Davidson Gomes
dab843f118 changelog 2025-01-22 11:09:29 -03:00
Davidson Gomes
f7db442a94 Refactor Instance Management with Additional Profile Information
- Added new fields `ownerJid`, `profileName`, and `profilePicUrl` to the Instance DTO for improved user identification and personalization.
- Updated InstanceController to include the new profile information in instance data handling.
- Enhanced WAMonitoringService to utilize the additional profile fields, improving the context of instance data during monitoring operations.
2025-01-22 11:09:05 -03:00
Davidson Gomes
3a04f7587e Refactor Evolution Channel with new instance management and media handling features
- Added `setInstance` method to manage instance details and trigger events for instance creation.
- Refactored `connectToWhatsapp` to improve error handling and streamline connection logic.
- Enhanced `sendMessageWithTyping` to support various message types including buttons and lists, and integrated file handling for media messages.
- Updated `processAudio` to handle audio conversion using an external API, improving audio processing capabilities.
- Introduced new methods for sending button messages and handling audio messages, enhancing user interaction features.
- Improved contact update logic to ensure accurate data synchronization with the database and external services.
2025-01-22 11:06:10 -03:00
Davidson Gomes
666c0b514d Chats filtering to support timestamp range queries
- Introduced a new `timestampFilter` to allow filtering messages based on `messageTimestamp` within specified `gte` and `lte` ranges.
- Updated SQL query logic in `ChannelStartupService` to incorporate the timestamp filtering, improving message retrieval accuracy.
2025-01-22 10:22:09 -03:00
Davidson Gomes
ab5eb80edd Refactor JID creation and fetch chats
- Introduced a new utility function `createJid` to standardize JID creation across the application, replacing the previous method in `ChannelStartupService`.
- Updated multiple services to utilize the new `createJid` function for improved consistency and maintainability.
- Added a `cleanMessageData` method in `ChannelStartupService` to sanitize message objects before processing.
- Updated CHANGELOG to reflect the refactor on chat fetching logic and the introduction of the new JID utility.
2025-01-22 10:16:48 -03:00
Davidson Gomes
b0219e5e5a Update version to 2.2.1, enhance database migration, and update dependencies
- Updated version labels in Dockerfile and package-lock.json to 2.2.1.
- Added a new column `wavoipToken` to the `Setting` table in the PostgreSQL migration.
- Implemented a cleanup step to remove duplicate records in the `Chat` table before creating a unique index.
- Upgraded various package dependencies to their latest versions for improved functionality and security.
2025-01-21 17:39:03 -03:00
Davidson Gomes
d7b4965d60 Update CHANGELOG for version 2.2.1
- Added features: retry system for sending webhooks and enhanced message filtering to support timestamp range queries.
- Fixed issues: corrected global webhook handling and resolved audio sending problems with WhatsApp Cloud API.
2025-01-21 17:32:24 -03:00
Davidson Gomes
cfe6bd9ae0 Refactor instance deletion logic and enhance WhatsApp connection updates
- Updated the `deleteInstance` method to allow logout for instances in 'connecting' or 'open' states, improving instance management.
- Enhanced the `BaileysStartupService` to include additional profile information (wuid, profileName, profilePictureUrl) in connection update webhooks.
- Removed redundant webhook data sending logic, streamlining connection state updates for better performance.
- Adjusted settings schema to ensure required fields are properly validated.
2025-01-17 17:54:18 -03:00
Davidson Gomes
ac58f58bbc Update package version to 2.2.1 in package.json 2025-01-17 16:07:03 -03:00
Davidson Gomes
cb08f6b152 Refactor WebhookController to implement retry logic for webhook requests
- Introduced a new `retryWebhookRequest` method to handle retries for failed webhook requests, allowing up to 10 attempts with a delay of 30 seconds between each.
- Updated error logging to provide detailed information on each retry attempt, including the attempt number and error details.
- Enhanced existing webhook request handling to utilize the new retry logic, improving reliability in sending webhook data.
- Modified error messages to be more informative, indicating when all retry attempts have failed.
2025-01-17 16:06:23 -03:00
Davidson Gomes
a817d62067 Enhance message filtering in ChannelStartupService to support timestamp range queries
- Added support for filtering messages based on a timestamp range in the `ChannelStartupService`.
- Introduced a `timestampFilter` object to handle `gte` and `lte` conditions for `messageTimestamp`.
- Updated message count queries to include the new timestamp filtering logic.
2025-01-16 17:40:19 -03:00
Davidson Gomes
540467293c Enhance settings and integrate Baileys controller for WhatsApp functionality
- Added `wavoipToken` field to `Setting` model in both MySQL and PostgreSQL schemas.
- Updated `package.json` and `package-lock.json` to include `mime-types` and `socket.io-client` dependencies.
- Introduced `BaileysController` and `BaileysRouter` for handling WhatsApp interactions.
- Refactored media type handling to use `mime-types` instead of `mime` across various services.
- Updated DTOs and validation schemas to accommodate the new `wavoipToken` field.
- Implemented voice call functionalities using the Wavoip service in the Baileys integration.
- Enhanced event handling in the WebSocket controller to support new features.
2025-01-16 11:58:33 -03:00
Davidson Gomes
616ae0a7eb Update ESLint configuration, Dockerfile, and package dependencies; add GitHub Actions workflow for code quality checks
- Changed ESLint parser options to use 'module' as source type.
- Updated Dockerfile to remove force flag from npm install command.
- Upgraded 'mime' package from version 3.0.0 to 4.0.0 in package.json.
- Added '@types/mime' as a development dependency.
- Updated TypeScript configuration to use 'CommonJS' module format.
- Introduced a new GitHub Actions workflow for checking code quality, including linting and build checks.
2025-01-09 17:04:33 -03:00
Davidson Gomes
d598c4ed0b Update ESLint configuration, Dockerfile, and package dependencies; refactor bot trigger logic
- Updated ESLint configuration to use TypeScript project references and adjusted parser options.
- Modified Dockerfile to include OpenSSL in both builder and final stages.
- Changed `mime` package version from `^4.0.6` to `^3.0.0` in `package.json` and updated TypeScript ESLint packages to `^6.21.0`.
- Refactored `findBotByTrigger` function to remove unnecessary settings repository parameter.
- Adjusted bot trigger logic in multiple controller files to streamline function calls.
2025-01-09 12:57:21 -03:00
Davidson Gomes
ca451bfacc
Merge pull request #1126 from jesus-chacon/update_chats
Fix: cuid security deprecation, update libs, lint and improve chat DB update
2025-01-07 13:06:23 -03:00
Davidson Gomes
f971f388d5
Merge pull request #1134 from Allyson-Santana/bugfix/import-prisma-type
bugfix: import prisma types
2025-01-07 13:05:22 -03:00
Jesus
236b0f9b26 Fix import prisma types 2025-01-07 08:59:51 +01:00
Jesus
0f2498bbaa Fix prettier errors 2025-01-07 08:50:34 +01:00
Jesus
2816a16387 Added lock and update some libs 2025-01-07 08:50:24 +01:00
Jesus
a82669b6fa Improve chat update and fix unread messages 2025-01-07 08:25:37 +01:00
Jesus
72a33ae59f fix: lint and prettify 2025-01-07 08:25:37 +01:00
Jesus
425d340956 Fix: cuid security deprecacion 2025-01-07 08:25:37 +01:00
Jesus
f2872cf59a Update several libs 2025-01-07 08:25:37 +01:00
Allyson Santana
1773f2738e bugfix: import prisma types 2025-01-06 18:31:40 -03:00
Davidson Gomes
18626c9846
Merge pull request #1131 from FaelN1/develop
fix: include filename in media message payload for WhatsApp Business
2025-01-06 12:20:19 -03:00
Davidson Gomes
6212ee3eb0
Merge pull request #1125 from fmorett/patch-1
fix cannot read null of mentioned
2025-01-06 12:18:56 -03:00
Davidson Gomes
8c877029e5
Merge pull request #1124 from ScrashOff/fix/instance-creation-webhook-and-chatwoot-settings
fix: instance create w/webhook and chatwoot settings
2025-01-06 12:18:25 -03:00
Davidson Gomes
0000c1c05c
Merge pull request #1121 from EdmilsonSantana/fix/upgrade_prima_to_6_1_0
fix: upgrade Prisma packages to 6.1.0 to resolve an issue in Alpine images
2025-01-06 12:17:29 -03:00
Davidson Gomes
16daf9be8f
Merge pull request #1119 from MarksonSolutions/develop
send audio using sendWhatsAppAudio route, wabussines
2025-01-06 12:17:12 -03:00
Rafael Nicolas Barbosa Moreira
e0c960cc54 chore: remove redundant comment about filename condition 2025-01-03 16:35:14 -03:00
Rafael Nicolas Barbosa Moreira
08ceb803c8 fix: conditionally include filename for non-image media 2025-01-03 16:33:34 -03:00
Rafael Nicolas Barbosa Moreira
6b72550286 fix: include filename in media message payload for WhatsApp Business 2025-01-03 15:56:39 -03:00
Fabio Moretti
df0990df0f
fix cannot read null of mentioned 2024-12-28 02:15:26 +01:00
Fellipe "ScrashOff
60c9e231be fix: instance create w/webhook and chatwoot settings 2024-12-27 16:58:15 -03:00
João Victor Souza
2fb6318011 feat: updates api evolution for docker 2024-12-27 10:40:04 -03:00
EdmilsonSantana
070159568e fix: upgrading prisma packages to 6.1.0 to fix a issue in alpine images 2024-12-26 07:59:54 -03:00
MarksonSolutions
bfba702fde send audio using sendWhatsAppAudio route, wabussines 2024-12-20 16:00:15 -04:00
Davidson Gomes
d5c2cfb4f9
Merge pull request #1103 from roberto0arruda/fix/sentry-auto-instrument-express
chore: improve instrumentSentry.ts import before another import
2024-12-11 15:38:24 -03:00
Roberto Arruda
cdab5e2ae8 chore: improve instrumentSentry.ts import before another import
Signed-off-by: Roberto Arruda <roberto0arruda@hotmail.com>
2024-12-10 12:13:42 -04:00
Davidson Gomes
682eaa995f
Merge pull request #1088 from joaosantanadev/develop
[FIX]Correction of webhook global
2024-11-27 12:10:52 -03:00
Davidson Gomes
62ea22a06a
Merge pull request #1076 from verbeux-ai/main
[FIX] Fixando label handler e chats
2024-11-27 12:10:31 -03:00
joaosantanadev
370025b8f9 Correction of webhook global 2024-11-25 12:59:48 -03:00
Pedro Ivo
5d13f7055b
Merge remote-tracking branch 'refs/remotes/evo/develop'
# Conflicts:
#	prisma/mysql-schema.prisma
#	src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
2024-11-22 10:11:50 -03:00
Davidson Gomes
c4e87c160e
Merge pull request #1078 from Richards0nd/feature/windows-commands-support
Adaptação de scripts e comandos para compatibilidade com Windows
2024-11-21 14:51:14 -03:00
Davidson Gomes
ee8e937fad
Merge pull request #1073 from lucastononro/fix-prisma-p1001-dockercompose
Update docker-compose and .env.example
2024-11-21 14:49:10 -03:00
Davidson Gomes
d5a7e03ec2
Merge pull request #1012 from yousseefspires/fix/chats-messages
Add unique in Chat by instance/remotejid
2024-11-21 14:48:40 -03:00
Davidson Gomes
52b6b61ac9
Merge pull request #1071 from AlanCezarAraujo/fix/openai-audio
Correção de envio de áudio para OpenAI via Cloud API
2024-11-21 14:46:51 -03:00
Pedro Ivo
6e6711a5af
fix: get instance id in right place on handle label 2024-11-19 10:26:01 -03:00
Pedro Ivo
013fa9dc08
fix: join is considering instance id 2024-11-19 10:17:49 -03:00
Pedro Ivo
a42bc988ec
fix: add/remove saving on db and improve add query for startup case 2024-11-19 10:15:08 -03:00
Richards0n
3582cd38fb Add Windows support for database migration commands in package.json 2024-11-18 20:07:08 -03:00
Richards0n
bfd8c08987 Add Windows support for database deployment and improve error handling in runWithProvider.js 2024-11-18 20:01:10 -03:00
Pedro Ivo
ecbbc5b090
fix: avoid concurrency cases in label handler 2024-11-17 20:04:27 -03:00
Lucas Tonon
b7e15be418 Update docker-compose and .env.example
Error:

Database URL: 
Environment variables loaded from .env
Prisma schema loaded from prisma/postgresql-schema.prisma
Datasource "db": PostgreSQL database "evolution", schema "public" at "localhost:5432"
Error: P1001: Can't reach database server at localhost:5432

Fix:

Update `docker-compose.yaml` and `.env.example` files to configure PostgreSQL service and connection URI.

* **docker-compose.yaml**
  - Add `listen_addresses=*` command to the `postgres` service.
  - Add environment variables: `POSTGRES_USER=user`, `POSTGRES_PASSWORD=pass`, `POSTGRES_DB=evolution`, `POSTGRES_HOST_AUTH_METHOD=trust`.

* **.env.example**
  - Update `DATABASE_CONNECTION_URI` to `postgresql://user:pass@postgres:5432/evolution?schema=public`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/EvolutionAPI/evolution-api?shareId=XXXX-XXXX-XXXX-XXXX).
2024-11-17 11:36:12 -03:00
Alan Cezar
1d5508736e corrigido o envio de áudio para OpenAI 2024-11-15 17:57:38 -03:00
Pedro Ivo
cefe3ef6c3
fix: chats must be unique 2024-11-15 17:38:26 -03:00
Davidson Gomes
09a33a423e
Merge pull request #1070 from help-corretora/main
Quando a conversa está aberta e o cliente manda mensagem, o status da conversa muda para pendente.
2024-11-15 10:59:10 -03:00
Help Corretora
e092a80aeb
Merge pull request #1 from vitor-help/main
erro, colocando mensagens em pendente
2024-11-14 20:50:58 -03:00
Vitor
99a533afc1 o chat está colocando a conversa como pendente quando o cliente manda mensagem, esse código visa corrigir isso. 2024-11-14 20:48:47 -03:00
Davidson Gomes
b603021f56
Merge pull request #1067 from Alexandre-Prado/fix-chatbots-send-message
fix: esvazia textBuffer dos chatbots no sendMessageWhatsapp quando splitMessages é true
2024-11-14 18:37:07 -03:00
Davidson Gomes
7bf0fd1c36
Merge pull request #1058 from Richards0nd/newPhoneNumberContent
Correção: Número de telefone apresentado no nome do contato (CW Service)
2024-11-14 18:36:43 -03:00
Davidson Gomes
52cf4fa8b8
Merge pull request #1069 from AlanCezarAraujo/fix/whatsapp-images
Correção de Imagens no Cloud API
2024-11-14 18:36:24 -03:00
Alan Cezar
ef7574273c message recorded for no media messages 2024-11-14 09:11:21 -03:00
Alan Cezar
d797d8177c added isMediaMessage method 2024-11-14 09:10:11 -03:00
Alan Cezar
e7ed1446ee saved base64 file in memory 2024-11-14 09:09:27 -03:00
Alan Cezar
5eaabfb1eb fixed messageId 2024-11-14 09:08:52 -03:00
Alan Cezar
59383d5944 fixed remoteJid 2024-11-14 09:08:23 -03:00
Alan Cezar
d87d7c0775 fixed image mime type 2024-11-14 09:07:57 -03:00
Alexandre Prado
753f4ba141 fix: chatbots send message text buffer 2024-11-14 02:25:15 -03:00
Richards0n
7ef8afa9b3 Refactor phone number formatting in ChatwootService to improve parsing logic 2024-11-11 16:57:04 -03:00
Richardson Douglas
c5fd81ddbf
Merge pull request #1 from Richards0nd/develop
Develop
2024-11-11 16:49:17 -03:00
Davidson Gomes
8f855b4bfd
Merge pull request #1046 from rafwell/fixMessageStatus
Fix Message.Status as String
2024-11-11 15:44:25 -03:00
Davidson Gomes
084be1cee2
Merge pull request #1044 from Richards0nd/newPhoneNumberContent
Adiciona o número de telefone do remetente nas mensagens recebidas do WhatsApp antes do nome do contato (GRUPOS)
2024-11-11 15:44:05 -03:00
Davidson Gomes
997aceeebf
Merge pull request #1038 from fmedeiros95/develop
Ajuste nos tipos de mensagem respondidas
2024-11-11 15:43:49 -03:00
Rafael Souza
c8410bd146 Fix Message.Status as String 2024-11-08 07:15:23 -03:00
Richards0n
3d51b45e2b feat: format participant phone number in messages 2024-11-08 00:25:00 -03:00
Felipe Medeiros
50d84d1a08
Merge branch 'EvolutionAPI:develop' into develop 2024-11-05 17:17:15 -03:00
Felipe Medeiros
fd1f08a41e feat: handle quoted messages in WhatsApp integration 2024-11-05 17:16:41 -03:00
Davidson Gomes
8dc27919b1 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-11-02 08:13:04 -03:00
Davidson Gomes
6591a67ab6 feat: sh local install 2024-11-02 08:12:30 -03:00
Davidson Gomes
08192a03ca
Merge pull request #1023 from adriel12319/main
Fix Ios Response Button
2024-11-01 16:10:07 -03:00
Adriel Santos Araujo
8f86c9d758
Update getConversationMessage.ts 2024-10-31 23:19:17 -03:00
Adriel Santos Araujo
0e5f9e3b77
Update getConversationMessage.ts 2024-10-31 22:52:45 -03:00
Davidson Gomes
1665654676 feat: typebot send list 2024-10-29 19:30:17 -03:00
Davidson Gomes
133eddd742 docker-compose 2024-10-29 18:22:45 -03:00
Davidson Gomes
c55312d206 feat: typebot send list 2024-10-29 17:51:06 -03:00
Davidson Gomes
52216ec08e fix: receive buttons and list response in integrations 2024-10-29 16:11:53 -03:00
Davidson Gomes
7a01cdf0ef fix: receive buttons and list response in integrations 2024-10-29 16:11:29 -03:00
Davidson Gomes
65a9c78d86 feat: typebot send buttons 2024-10-29 16:03:00 -03:00
yousseefs
f6ccd58dee some fixs 2024-10-29 18:43:31 +00:00
Davidson Gomes
fbccf2eb2a feat: send pix button 2024-10-29 10:00:32 -03:00
Davidson Gomes
23640a71b8 fix: fetch instances 2024-10-29 07:43:48 -03:00
Davidson Gomes
fce3e55e91 feat: send pix button 2024-10-29 07:36:24 -03:00
Davidson Gomes
9f39ec2110 feat: send ptv message 2024-10-28 18:02:42 -03:00
Davidson Gomes
89c4c194df Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-10-28 18:02:24 -03:00
Davidson Gomes
a4e7baa41c feat: send ptv message 2024-10-28 18:02:17 -03:00
Davidson Gomes
e22ff6c0d9
Merge pull request #1009 from yousseefspires/fix/chats-messages
fix: received messages but chat doesnt exists
2024-10-28 17:42:44 -03:00
yousseefs
11d31123ac fix: received messages but chat doesnt exists 2024-10-28 20:23:20 +00:00
Davidson Gomes
0fdc47e8f0
Merge pull request #1001 from robjean9/patch-1
FIX: Update instance.controller.ts to filter by instanceName
2024-10-28 11:13:51 -03:00
Robson Jean Penteado
60db8081bd
FIX: Update instance.controller.ts to filter by instanceName
This commit should fix the filter by instanceName
2024-10-24 09:49:43 -03:00
Davidson Gomes
37b003f169
Merge pull request #1000 from fmedeiros95/develop
remove o arquivo public/images/cover (1).png:Zone.Identifier
2024-10-24 09:05:10 -03:00
Felipe Medeiros
891c3eb5d3
remove o arquivo 2024-10-24 08:52:56 -03:00
Davidson Gomes
3b99699f1a fix: var API_AUDIO_CONVERTER with default value 2024-10-22 11:29:43 -03:00
Davidson Gomes
e1de70542b feat: convert audio with api 2024-10-22 09:43:58 -03:00
Davidson Gomes
c10680df41 brand 2024-10-21 18:53:21 -03:00
Davidson Gomes
171f460f3b fix: ignoreJids in integrations dont work 2024-10-21 13:52:08 -03:00
Davidson Gomes
6d0ad5f3db feat: convert audio with api 2024-10-21 12:04:38 -03:00
Davidson Gomes
f34115fdcb feat: convert audio with api 2024-10-21 11:59:45 -03:00
Davidson Gomes
f9705c07dc feat: convert audio with api 2024-10-21 11:59:20 -03:00
Davidson Gomes
e986768716 feat: convert audio with api 2024-10-21 11:39:21 -03:00
Davidson Gomes
34769e2293 fix: receive medias on chatwoot 2024-10-18 19:49:14 -03:00
Davidson Gomes
5401ecd2c4 fix: send buttons cloud api oficial 2024-10-18 19:23:15 -03:00
Davidson Gomes
84451ba3e0 fix: receive messages on chatwoot 2024-10-18 17:43:43 -03:00
Davidson Gomes
bc751bbb6b feat: send list and buttons 2024-10-18 15:38:23 -03:00
Davidson Gomes
da77af5bd1 feat: send list and buttons 2024-10-18 15:34:22 -03:00
Davidson Gomes
1787238c63 feat: send list and buttons 2024-10-18 15:33:21 -03:00
Davidson Gomes
c4bcd1fafe
Merge pull request #991 from rafaelsantana6/fix-fetch-instances
feat: add support for fetching multiple instances by key
2024-10-18 10:55:52 -03:00
Rafael Santana
ecd4b913b6 feat: add support for fetching multiple instances by key
This commit adds a new feature to fetch instances by key in the InstanceController. If the provided key does not match the environment key, the controller will search for instances with the matching token. If instances are found, the names are extracted and passed to the waMonitor to retrieve instance information.

Also, update the waMonitor's instanceInfo method to accept an array of instance names instead of a single name.

Fixes #990
2024-10-17 16:42:52 -05:00
Davidson Gomes
1aeda4e1f4 fix: ads messages in chatwoot 2024-10-17 17:40:37 -03:00
Davidson Gomes
fb1eed8beb
Merge pull request #988 from Richards0nd/otimization_index_querys
Add indexes to improve performance in Evolution
2024-10-17 12:06:22 -03:00
Richards0n
287f387e82 refactor: Add indexes to improve performance in ChatwootService 2024-10-17 11:50:28 -03:00
Davidson Gomes
b18e83d293
Merge pull request #986 from deivisonrpg/refactor-onSendMessageError
refactor: Remove unnecessary code for handling contact not in WhatsApp and onSendMessageError
2024-10-17 10:17:32 -03:00
Davidson Gomes
968cc25d37
Merge pull request #983 from Richards0nd/fix
refactor: Update content_attributes in ChatwootService
2024-10-17 10:17:03 -03:00
Deivison Lincoln
b38f3cdddf Alterada outras traduções cw.message.numbernotinwhatsapp 2024-10-16 15:46:13 -03:00
Deivison Lincoln
a6fb8cbd30 refactor: Remove unnecessary code for handling contact not in WhatsApp
The code changes in `whatsapp.baileys.service.ts` remove the unnecessary code that handles the case when a contact is not in WhatsApp. The code was previously sending a notification to Chatwoot, but it is no longer needed. This change improves the code by removing unnecessary complexity.
2024-10-16 15:31:54 -03:00
Richards0n
aa8396d437 refactor: Update content_attributes in ChatwootService
This commit refactors the code in ChatwootService to update the content_attributes when replyToIds are present. Instead of directly spreading the replyToIds object, the code now converts it to a JSON string and appends it to the data object.

Refactor the code to improve readability and maintainability.
2024-10-15 18:01:57 -03:00
Davidson Gomes
ec2b7f94f8
Merge pull request #981 from yousseefspires/feat/delete-messages
feat: add logical or permanent message deletion based on env config
2024-10-15 17:44:15 -03:00
yousseefs
45acc6d281 feat: add logical or permanent message deletion based on env config 2024-10-15 20:10:59 +01:00
Davidson Gomes
b324e22d57
Merge pull request #977 from FelipeWayne/v2.0.0
(whatsapp.baileys.service.ts): adiciona novos campos de grupo na integração do WhatsApp
2024-10-14 08:04:27 -03:00
Davidson Gomes
001f4d3ca5
Merge pull request #972 from jesus-chacon/bugs/fix_last_message_fetch_chats_json
Fix last message fetch chats json
2024-10-14 08:04:12 -03:00
Felipe Augusto
aa18d13e21 (whatsapp.baileys.service.ts): adiciona novos campos de grupo na integração do WhatsApp
A inclusão dos campos isCommunity, isCommunityAnnounce e linkedParent na integração do WhatsApp permite que o serviço manipule informações adicionais sobre grupos. Isso melhora a funcionalidade e a flexibilidade do serviço, possibilitando um melhor gerenciamento e interação com grupos comunitários no WhatsApp.
2024-10-12 15:36:51 -03:00
Jesus
fa759f5da1 Fix lastMessage info for fetch chats query 2024-10-12 01:24:01 +02:00
Davidson Gomes
3af8f968c2 Add support for splitMessages and timePerChar in Integrations 2024-10-11 18:52:56 -03:00
Davidson Gomes
d8061346da update manager 2024-10-11 11:26:37 -03:00
Davidson Gomes
84df14ef93 changelog 2024-10-11 10:57:43 -03:00
Davidson Gomes
f5baced024
Merge pull request #971 from jesus-chacon/bugs/fix_fetch_chats_query
Fix fetch chats query
2024-10-11 10:56:07 -03:00
Davidson Gomes
0987fda327
Merge pull request #970 from jesus-chacon/bugs/mark_as_read_fromMe_and_groups
Mark as read from me and groups
2024-10-11 10:54:54 -03:00
Jesus
5b91648d5c Resolve read messages from groups and fromMe 2024-10-11 15:11:35 +02:00
Davidson Gomes
d50da79f22 feat: Add support for splitMessages and timePerChar in Integrations 2024-10-11 07:45:50 -03:00
Davidson Gomes
29e2cfaf96 feat: pusher event integration 2024-10-11 07:01:38 -03:00
Jesus
8ab8961e91 Fix fetch chats query 2024-10-11 08:19:51 +02:00
Davidson Gomes
f38f3e5ba5
Merge pull request #958 from jesus-chacon/features/last_message_in_chat
Added last message to fetch chats
2024-10-10 14:55:29 -03:00
Davidson Gomes
c29d20ea40
Merge pull request #967 from joaosouz4dev/v2.0.0
fix: migration update after alter
2024-10-10 14:18:55 -03:00
João Victor Souza
e19ee05e9f fix: migration update after alter 2024-10-10 13:41:07 -03:00
Davidson Gomes
68ccfb0517
Merge pull request #959 from yousseefspires/add-contextinfo-findMessages
Add ContextInfo to return in FindMessages
2024-10-09 17:07:42 -03:00
Davidson Gomes
7cb5d10fc9
Merge pull request #957 from fmedeiros95/v2.0.0
Escutar a configuração do webhook para midias recebidas
2024-10-09 17:03:41 -03:00
Youssef
ab0fedf484
Merge pull request #1 from yousseefspires/add-contextinfo-findMessages
Add ContextInfo to return in FindMessages
2024-10-08 16:41:22 +01:00
Youssef
5fcdf5aeaf
Update channel.service.ts 2024-10-08 16:39:18 +01:00
Jesus
394c091810 Fix parse multiples messages updates and creates 2024-10-08 17:15:53 +02:00
Jesus
73e732bf24 Added last message to fetch chats 2024-10-08 12:51:34 +02:00
Jesus
c6ee463dae Improve update messages status 2024-10-08 12:51:10 +02:00
Jesus
cada7be1e5 Add last_message to fetchChats query 2024-10-08 08:47:08 +02:00
Jesus
eb456f6a88 Fix unreadMessages for fetchChats query 2024-10-08 08:08:33 +02:00
Felipe Medeiros
7adab5c1c0 Escutar a configuração do webhook para midias recebidas 2024-10-07 19:14:21 -03:00
Davidson Gomes
f5f778ecbe feat: Added unreadMessages to chats 2024-10-07 13:45:19 -03:00
Davidson Gomes
f2bb01a640 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-10-07 13:37:56 -03:00
Davidson Gomes
2f1ba83546
Merge pull request #954 from jesus-chacon/features/unread_messages
Added unreadMessages to chats
2024-10-07 13:37:50 -03:00
Jesus
10aeeebb53 Fix and improve fetch chats 2024-10-07 18:03:27 +02:00
Jesus
96e1802148 Fix update message condition 2024-10-07 17:54:25 +02:00
Jesus
27dc49f2c3 Fix unread for chat creation 2024-10-07 17:41:43 +02:00
Jesus
edb3875b91 Added unreadMessages to chats 2024-10-07 17:39:00 +02:00
Davidson Gomes
ac3b18678e Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-10-07 11:07:42 -03:00
Davidson Gomes
49edd174a9
Merge pull request #953 from fmedeiros95/v2.0.0
refactor: remove a função "offerCall" do controller sendMessage
2024-10-07 11:07:29 -03:00
Felipe Medeiros
4d33ad3aef
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-07 11:05:43 -03:00
Felipe Medeiros
3511082511 Merge branch 'v2.0.0' of https://github.com/fmedeiros95/evolution-api into v2.0.0 2024-10-07 11:05:20 -03:00
Felipe Medeiros
23abcbecd3 refactor: remove a função "offerCall" do controller sendMessage 2024-10-07 11:05:17 -03:00
Davidson Gomes
87fe8c2b3c Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-10-07 11:02:13 -03:00
Davidson Gomes
eee43bb073
Merge pull request #952 from fmedeiros95/v2.0.0
Adiciona a função de fake call
2024-10-07 11:02:06 -03:00
Felipe Medeiros
51a3710b46
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-07 10:55:41 -03:00
Felipe Medeiros
0aa8150070 Update dependency: baileys
The package.json file was updated to use the latest version of the baileys dependency from the EvolutionAPI repository.
2024-10-07 10:55:21 -03:00
Felipe Medeiros
8e8a3db529 Merge branch 'v2.0.0' of https://github.com/fmedeiros95/evolution-api into v2.0.0 2024-10-07 10:49:55 -03:00
Felipe Medeiros
bcf59a2015 feat: adiciona controlador de chamadas
Adiciona o controlador de chamadas para oferecer chamadas falsas.

- Adiciona o arquivo `call.controller.ts` com a classe `CallController` que possui o método `offerCall` para oferecer chamadas falsas.
- Adiciona o arquivo `call.dto.ts` com as classes `Metadata` e `OfferCallDto` para definir os dados da chamada.
- Atualiza o arquivo `sendMessage.dto.ts` removendo a classe `OfferCallDto`.
- Atualiza o arquivo `whatsapp.baileys.service.ts` importando a classe `OfferCallDto` corretamente e atualizando o método `offerCall` para receber os parâmetros corretos.
- Adiciona o arquivo `call.router.ts` com a classe `CallRouter` para lidar com as rotas relacionadas a chamadas.
- Atualiza o arquivo `index.router.ts` para incluir as rotas relacionadas a chamadas.
2024-10-07 10:49:51 -03:00
Davidson Gomes
e66f877b4c fix: migrations 2024-10-07 10:49:26 -03:00
Davidson Gomes
aac8d446b4 changelog 2024-10-07 10:42:01 -03:00
Davidson Gomes
a0a62b997c
Merge pull request #951 from lucas-tomasi/patch-1
Fix duplicate file upload
2024-10-07 10:41:10 -03:00
Felipe Medeiros
070840d364
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-07 01:33:13 -03:00
Felipe Medeiros
0af00582f0 refactor: simplifica a lógica de terminação de chamada 2024-10-07 01:30:03 -03:00
Felipe Medeiros
b80b203670 feat: adiciona a funcionalidade de fake call 2024-10-07 01:13:02 -03:00
Davidson Gomes
29a1d99d05 fix: Fixed prefilledVariables in startTypebot 2024-10-06 20:05:14 -03:00
Lucas Tomasi
2e43683835
Fix duplicate file upload
Currently, we face an issue when a file with the same name is uploaded more than once:
1.⁠ ⁠It results in a unique key error in the database.
2.⁠ ⁠If the file is sent to S3, it overwrites the old file.

To resolve this problem, I've implemented a solution where we concatenate the message ID to the filename. This approach ensures uniqueness for each uploaded file, even if users upload files with identical names multiple times in a chat.


This change allows normal users to upload files with the same name multiple times in a chat without encountering errors or unintended file overwrites.
2024-10-06 15:42:17 -03:00
Davidson Gomes
ebbba7b7e9 version: 2.1.2 2024-10-06 10:10:00 -03:00
Davidson Gomes
c823f84c70 fix: status on send message 2024-10-06 10:04:02 -03:00
Davidson Gomes
0f7c2437bc fix: status on send message 2024-10-06 09:58:57 -03:00
Davidson Gomes
1f6473cfd5 version: 2.1.2 2024-10-06 09:47:42 -03:00
Davidson Gomes
db7428abd9
Merge pull request #949 from nestordavalos/v2.0.0
fix: Corrected audio file handling in WhatsApp
2024-10-06 09:27:27 -03:00
nestordavalos
59af93251d fix: Corregir manejo de archivo de audio en WhatsApp 2024-10-06 01:16:08 -03:00
nestordavalos
83567d6466 fix: Corrected audio file handling in WhatsApp
An error in the WhatsApp audio message handler has been fixed. The system now checks if the file has a valid buffer before sending it. Additionally, validation has been added to verify if the audio is a valid URL or Base64. If these conditions are not met, an error message is shown, and a BadRequestException is thrown.
2024-10-05 22:49:30 -04:00
Davidson Gomes
d7ddb99fb0 fix: Fixed bot fallback not working on integrations 2024-10-04 19:08:23 -03:00
Davidson Gomes
2d732c8071 fix: Does not search message without chatwoot Message Id for reply 2024-10-04 18:52:56 -03:00
Davidson Gomes
0d2125ddff fix: Does not search message without chatwoot Message Id for reply 2024-10-04 18:52:32 -03:00
Davidson Gomes
0791e1afe9 fix: Fixed bug when send message when dont have mentionsEveryOne on payload 2024-10-04 18:33:08 -03:00
Davidson Gomes
fcfa96d97d fix: Fixed bug when send message when dont have mentionsEveryOne on payload 2024-10-04 18:33:01 -03:00
Davidson Gomes
01ae55f02a fix: Fixed getBase64FromMediaMessage with convertToMp4 2024-10-04 18:27:25 -03:00
Davidson Gomes
97f633a69a fix: fixed issue of always creating a new label when saving chatwoot 2024-10-04 17:51:47 -03:00
Davidson Gomes
5c046d51c5 fix: fixed issue of always creating a new label when saving chatwoot 2024-10-04 17:51:32 -03:00
Davidson Gomes
487d8b93fb fix: startTypebot with startSession = true 2024-10-04 17:40:38 -03:00
Davidson Gomes
db065ab942 fix: send media message in chatwoot 2024-10-04 17:14:12 -03:00
Davidson Gomes
373268c938 fix: send message to group without no cache (local or redis) 2024-10-04 16:23:09 -03:00
Davidson Gomes
fcc26f931e
Merge pull request #947 from oismaelash/v2.0.0
fix: send message to group without no cache (local or redis)
2024-10-04 16:19:34 -03:00
oismaelash
2037e78045 fix: send message to group without no cache (local or redis) 2024-10-04 16:05:49 -03:00
Davidson Gomes
161abf1d03 feat: send media with form-data 2024-10-04 14:55:21 -03:00
Davidson Gomes
ec2d7e349f feat: send media with form-data 2024-10-04 14:45:16 -03:00
Davidson Gomes
44e152bea2 license: license terms updated 2024-10-04 13:27:46 -03:00
Davidson Gomes
9083bf44fe readme 2024-10-04 12:55:00 -03:00
Ismael Ash
7b41d333d7
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-04 06:18:31 -03:00
oismaelash
0a4b8d202a fix: transform any string on number to Lower Case, for not show reading id of undefined 2024-10-04 00:41:19 -03:00
Davidson Gomes
d84713f6ca license: license terms updated 2024-10-03 18:14:52 -03:00
Davidson Gomes
d1bc0e6150 fix: adjusts on prisma connections 2024-10-03 17:59:40 -03:00
Davidson Gomes
14d10c00ec chore: chatwoot verbose logs 2024-10-03 17:40:21 -03:00
Davidson Gomes
88c1830bf5 fix: timeout error on send status message 2024-10-03 17:22:52 -03:00
Davidson Gomes
23549e3c1f chore: update baileys version 2024-10-03 16:56:13 -03:00
Davidson Gomes
1ded6c81ad chore: Set the maximum number of listeners that can be registered for events 2024-10-03 16:46:50 -03:00
Davidson Gomes
7ca9bff6e0 fix: mexico number 2024-10-03 16:36:42 -03:00
Davidson Gomes
4fa3c50138 fix: mexico number 2024-10-03 16:36:28 -03:00
Davidson Gomes
14df0b368b changelog 2024-10-03 16:34:32 -03:00
Davidson Gomes
8dee8a1ec0
Merge pull request #944 from oismaelash/v2.0.0
fix: buildkey function in hSet and hDelete
2024-10-03 16:33:47 -03:00
Ismael Ash
acad895c9d
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-03 15:09:53 -03:00
oismaelash
49327593a9 fix: buildkey function in hSet and hDelete 2024-10-03 14:44:46 -03:00
Davidson Gomes
567152184c fix: openai setting when send a message with chatwoot 2024-10-03 14:28:47 -03:00
Davidson Gomes
0d8982395f fix: openai setting when send a message with chatwoot 2024-10-03 14:28:31 -03:00
Davidson Gomes
479dc12f28 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-10-03 14:24:29 -03:00
Davidson Gomes
182c5fc25e change version 2024-10-03 14:23:10 -03:00
Davidson Gomes
f16e9bc60f changelog 2024-10-03 08:38:13 -03:00
Davidson Gomes
10174069e0
Merge pull request #937 from oismaelash/v2.0.0
update: docker with expose port and localcache hGet and hSet return null
2024-10-03 08:35:17 -03:00
Davidson Gomes
e146921e53
Merge pull request #936 from vagners2/v2.0.0-fix-migrations
fix: add migration field message status
2024-10-03 08:34:58 -03:00
Davidson Gomes
449a3b2252 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-10-03 08:33:31 -03:00
Davidson Gomes
efbb32ff0c fix: fetch status message 2024-10-03 08:32:45 -03:00
oismaelash
0ad330bdb3 add: hDelete on LocalCache 2024-10-02 15:15:12 -03:00
oismaelash
9a6d4a8e44 add: hGet and hSet on LocalCache 2024-10-02 14:55:34 -03:00
oismaelash
0b40583fa8 fix: environment variables with optional #1 2024-10-02 12:39:11 -03:00
oismaelash
fe4a439fde fix: environment variables with optional 2024-10-02 12:24:33 -03:00
oismaelash
58a8d92c37 DATABASE_PROVIDER default is posttgresql #1 2024-10-02 01:33:20 -03:00
oismaelash
185fb587e0 DATABASE_PROVIDER default is posttgresql 2024-10-02 01:25:40 -03:00
oismaelash
5829762f91 update: docker with expose port and localcache hGet and hSet return null 2024-10-02 00:13:00 -03:00
vagnersantos
af56b06f50 fix: add migration field message status 2024-10-01 15:11:36 -03:00
Davidson Gomes
168c5f18d8
Merge pull request #926 from lopesfontana/v2.0.0-contacts_pushName
V2.0.0 contacts push name
2024-09-28 07:32:20 -03:00
Andre Fontana
510eaf1141 Adjust contact pushName. Not save when in message.upsert and the pushName is from the instance name 2024-09-27 15:03:17 -03:00
Andre Fontana
1e5d62c777 Adjust contact pushName. Not save when in message.upsert and the pushName is from the instance name 2024-09-27 15:01:35 -03:00
Andre Fontana
ca2387cc70 Adjust contact pushName. Not save when in message.upsert and the pushName is from the instance name 2024-09-27 14:49:58 -03:00
Davidson Gomes
0ff421121f
Merge pull request #918 from judsonjuniorr/fix/validate-message-before-sending-chatwoot
Fix/validate message before sending chatwoot
2024-09-27 14:02:58 -03:00
Davidson Gomes
8789f9bc97
Merge pull request #917 from judsonjuniorr/feat/sync-lost-messages-chatwoot
feat: Sync lost messages on chatwoot
2024-09-27 14:01:41 -03:00
Davidson Gomes
d535bc4ea2
Merge pull request #906 from fmedeiros95/v2.0.0
feat: adiciona o status da mensagem no retorno da função "prepareMessage"
2024-09-27 14:00:20 -03:00
Judson Cairo
f35f8dd7e0 feat: Update the cw message with the wpp time 2024-09-27 13:56:52 -03:00
Judson Cairo
f9726863ef feat: Update chatwoot source ID and status after sent 2024-09-27 09:40:18 -03:00
Judson Cairo
49ceb44102 fix: Validate if chatwoot connection is available 2024-09-25 13:07:20 -03:00
Judson Cairo
f54a00a07f fix: Validate if source id already exists in chatwoot
Check if message is already saved before sending it
2024-09-25 11:56:51 -03:00
Judson Cairo
e241cf4ee0 feat: Sync lost messages on chatwoot
Runs the sync method every 30min
2024-09-25 11:48:19 -03:00
Felipe Medeiros
59fac8bc4a
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-09-23 20:54:31 -03:00
Felipe Medeiros
68b5d8db4d feat: adiciona o status da mensagem no retorno da função "prepareMessage" 2024-09-22 17:48:16 -03:00
Davidson Gomes
4ca141b4f4 version: 2.1.1 2024-09-22 10:32:00 -03:00
Davidson Gomes
d3b229c6a1 fix: settings on dify, flowise and openai 2024-09-22 10:11:31 -03:00
Davidson Gomes
ffac87835b fix: settings on dify, flowise and openai 2024-09-22 10:10:36 -03:00
Davidson Gomes
726b0dcbb2 changelog 2024-09-22 09:06:10 -03:00
Davidson Gomes
5ebebbf211 fix: chatbot integrations send media and links 2024-09-22 08:53:10 -03:00
Davidson Gomes
3527e662e1 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-09-21 18:53:59 -03:00
Davidson Gomes
2b3062222a changelog 2024-09-21 18:53:44 -03:00
Davidson Gomes
495b50f933
Merge pull request #904 from olaronymax/patch-1
Visualização Única no ChatWoot
2024-09-21 18:44:14 -03:00
OlaRonyMax
ae69eb0bce
Visualização única no ChatWoot
Permite receber imagens e vídeos de visualização unica direto no  ChatWoot
2024-09-21 16:26:35 -03:00
Davidson Gomes
cecbf59f46 clear console logs 2024-09-21 13:42:23 -03:00
Davidson Gomes
d3f90a7abd fix: chatwoot integration 2024-09-21 13:41:51 -03:00
Davidson Gomes
4e4caab970 fix: chatwoot integration 2024-09-21 12:34:40 -03:00
Davidson Gomes
154dd4e9ba
Merge pull request #902 from fmedeiros95/v2.0.0
refactor: padroniza tratamento de mensagens no Baileys
2024-09-20 18:44:05 -03:00
Felipe Medeiros
79170b8f01 refactor: padroniza as mensagens salvas no banco 2024-09-20 18:41:01 -03:00
Davidson Gomes
adfe2977ef
Merge pull request #901 from fmedeiros95/v2.0.0
refactor: simplifica e padroniza envio de mensagens no Baileys
2024-09-20 17:46:39 -03:00
Felipe Medeiros
92373812c1 refactor: simplifica função sendMessage no Baileys
- Remove lógica duplicada de salvar mensagens no banco de dados e upload de mídia para o S3
- Padroniza o retorno da função, utilizando "messageRaw"
- Simplifica a validação da instância
- Elimina a verificação de configuração do S3 para envio de mídias
2024-09-20 17:37:37 -03:00
Felipe Medeiros
0544d80cbd refactor: padroniza retorno da função sendMessage no Baileys
Ajusta o retorno da função "sendMessage" para usar a variável "messageRaw" em vez de "messageSent", garantindo consistência no retorno.
2024-09-20 17:32:39 -03:00
Davidson Gomes
76fe717076
Merge pull request #894 from judsonjuniorr/fix/typebot-settings-for-ignore-jid
Fix ignoreJids on typebot
2024-09-19 12:54:33 -03:00
Judson Cairo
aeb422b3f7 Fix ignoreJids on typebot 2024-09-18 21:47:37 -03:00
Davidson Gomes
17313d45f9
Merge pull request #886 from judsonjuniorr/fix/instance-validation
Validate if instance exists before deleting it
2024-09-17 07:28:27 -03:00
Judson Cairo
6b447c654f Fix instance validation condition 2024-09-16 10:36:27 -03:00
Judson Cairo
ff98d0724e Validate if instance exists before deleting it 2024-09-12 18:43:29 -03:00
Davidson Gomes
9a1d5664c9
Merge pull request #883 from vidz1979/debounce-message-break
Debounce message break
2024-09-12 15:08:52 -03:00
Davidson Gomes
f5fbf73139
Merge pull request #882 from FaelN1/v2.0.0
refactor: refatora tratamento do tipo de mensagem para interativas, de botão e de contato
2024-09-12 15:07:43 -03:00
Davidson Gomes
ade5f8d122
Merge pull request #880 from joaosouz4dev/v2.0.0
fix: clean instance without chatwoot
2024-09-12 15:04:53 -03:00
Junior Vidotti
7fa41a4d4c removed docker-compose version as long it is obsolete 2024-09-11 22:18:30 +00:00
Junior Vidotti
c8b36a2401 reversed settings 2024-09-11 22:00:57 +00:00
Junior Vidotti
9fcb1e8829 reversed settings 2024-09-11 22:00:23 +00:00
Junior Vidotti
83f87bc1c5 debounce message break 2024-09-11 21:58:46 +00:00
Rafael Nicolas Barbosa Moreira
55a3e59fa5 refactor: refatora tratamento do tipo de mensagem para interativas, de botão e de contato 2024-09-11 17:31:10 -03:00
Davidson Gomes
2947269c4e Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-09-11 17:20:20 -03:00
Davidson Gomes
599560bdd7 fix: It is now possible to send images via the Evolution Channel 2024-09-11 17:20:07 -03:00
João Victor Souza
a84bc18dea
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-09-11 11:04:37 -03:00
João Victor Souza
918cf295ad fix: clean instance without chatwoot 2024-09-11 11:03:38 -03:00
Davidson Gomes
1ef379baf7
Merge pull request #878 from diegomustafamarino/v2.0.0
Update Facebook / Instagram ADS for whatsapp integration
2024-09-11 09:40:07 -03:00
Diego Marino
d183990732 Update getConversationMessage.ts 2024-09-10 22:55:03 -03:00
Davidson Gomes
9f30c7b160 changelog 2024-09-09 10:43:00 -03:00
Davidson Gomes
bfcf99bba0 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-09-09 10:12:19 -03:00
Davidson Gomes
80ae86b298 fix: chatwoot screen 2024-09-09 10:12:10 -03:00
Davidson Gomes
63dac9d04f
Merge pull request #869 from fmedeiros95/v2.0.0
feat: adds headers to the instance's webhook registration
2024-09-07 10:28:03 -03:00
Felipe Medeiros
65c6ecff88 feat: adiciona headers no cadastro de webhook da instância 2024-09-06 20:46:10 -03:00
Davidson Gomes
c20a3b643f fix: no response evolution bot 2024-09-05 20:52:46 -03:00
Davidson Gomes
a9e4860a77
Merge pull request #868 from judsonjuniorr/v2-fix-chatwoot-quote
Fix chatwoot not mentioning the quoted message
2024-09-05 09:31:32 -03:00
Judson Cairo
16a0e6b18e Fix chatwoot not mentioning the quoted message 2024-09-05 09:28:57 -03:00
Davidson Gomes
49410d7d5e
Merge pull request #866 from EvolutionAPI/revert-862-v2-fix-chatwoot-reply-quote
Revert "V2 fix chatwoot reply quote"
2024-09-05 09:26:44 -03:00
Davidson Gomes
ff78954383
Revert "V2 fix chatwoot reply quote" 2024-09-05 09:26:33 -03:00
Davidson Gomes
2c7288e888
Merge pull request #865 from judsonjuniorr/v2-rabbitmq-exchange-name
Use exchange name from .env
2024-09-05 09:20:55 -03:00
Davidson Gomes
a97a01e0aa
Merge pull request #864 from judsonjuniorr/v2-on-whatsapp-return
Fix on whatsapp number return
2024-09-05 09:20:29 -03:00
Davidson Gomes
18ccccf344
Merge pull request #862 from judsonjuniorr/v2-fix-chatwoot-reply-quote
V2 fix chatwoot reply quote
2024-09-05 09:18:00 -03:00
Judson Cairo
65debe5a95 Use exchange name from .env 2024-09-04 17:09:42 -03:00
Judson Cairo
672bdc1cc7 Fix on whatsapp number return 2024-09-04 17:05:07 -03:00
Judson Cairo
71289fb919 Fix chatwoot not mentioning the quoted message 2024-09-04 15:38:11 -03:00
Judson Cairo
b93725dd32 Merge branch 'v2.0.0' into v2 2024-09-04 13:24:12 -03:00
Davidson Gomes
2784b907b0 fix: use chatwoot with evolution channel 2024-09-03 17:23:18 -03:00
Davidson Gomes
25daec9f41 fix: use chatwoot with evolution channel 2024-09-03 17:23:05 -03:00
Davidson Gomes
849d5f79dc fix: sentry version 2024-09-03 16:53:23 -03:00
Davidson Gomes
73727da867 fix: upload media s3 on waba 2024-09-03 14:41:39 -03:00
Davidson Gomes
401770be1c
Merge pull request #852 from paulillo/fix-wpp-biz-api-upload-media-s3
Fix wpp biz api upload media s3
2024-09-03 14:40:50 -03:00
Davidson Gomes
acd4100b23 fix: fixed bugs in the frontend, on the event screens 2024-09-03 13:09:42 -03:00
Júlio Paulillo
b0aa299850 Hotfixes attribution 2024-09-03 12:25:02 -03:00
Júlio Paulillo
1db339c65f Declares instanceDto.chatwootAutoCreate 2024-09-03 12:13:30 -03:00
Júlio Paulillo
fed49c2072 Fixes wrong message type lookup 2024-09-02 20:39:11 -03:00
Davidson Gomes
5f86f01e3a
Merge pull request #849 from robsoncombr/v2.0.0-robsoncombr-fix-missing-autoCreate
v2.0.0-robsoncombr-fix-missing-autoCreate
2024-09-02 09:38:41 -03:00
Davidson Gomes
951da04373
Merge pull request #839 from judsonjuniorr/v2-is-on-whatsapp-cache
Save is on whatsapp on the database
2024-09-02 09:37:25 -03:00
Judson Cairo
1161a8a0e2 Await chatwoot creation and change log to error 2024-09-01 16:46:09 -03:00
Judson Junior
2cb68b38a9
Merge pull request #20 from robsoncombr/v2.0.0-robsoncombr-fix-missing-autoCreate
v2.0.0-robsoncombr-fix-missing-autoCreate
2024-09-01 16:42:26 -03:00
Robson Martins
265cba9e3e
v2.0.0-robsoncombr-fix-missing-autoCreate 2024-08-31 23:32:15 -03:00
Judson Junior
f17bb4ec42
Merge pull request #19 from EvolutionAPI/v2.0.0
changelog
2024-08-31 21:35:52 -03:00
Judson Cairo
4cdf76f381 Refactor database table name for IsOnWhatsapp 2024-08-30 16:37:20 -03:00
Davidson Gomes
f0840e07fe changelog 2024-08-30 11:38:41 -03:00
Judson Junior
47d56f9c52
Merge pull request #18 from judsonjuniorr/v2-is-on-whatsapp-cache
V2 is on whatsapp cache
2024-08-30 10:38:55 -03:00
Judson Junior
ed5ff089c5
Merge pull request #17 from EvolutionAPI/v2.0.0
V2.0.0
2024-08-30 10:32:44 -03:00
Davidson Gomes
256bd3ef73
Merge pull request #838 from judsonjuniorr/v2-fix-cache-errors
Validate if cache exists before accessing it
2024-08-30 09:39:13 -03:00
Davidson Gomes
09eaba99c0
Merge pull request #836 from chatwoot-br/next
feat: Define a global proxy to be used if the instance does not have one
2024-08-30 09:38:57 -03:00
Judson Cairo
a57842519b Change tables & columns maps 2024-08-29 15:45:42 -03:00
Judson Cairo
011bef3daf Testing docker-compose 2024-08-29 15:12:36 -03:00
Judson Cairo
2fc0815e14 Removed empty lines on cacheengine 2024-08-29 15:12:01 -03:00
Judson Cairo
5ac98f7278 Add typescript path to vscode settings 2024-08-29 15:11:50 -03:00
Judson Cairo
8b5ca0c9c4 Add DIRECT_URI on env and prisma 2024-08-29 15:10:04 -03:00
Judson Cairo
c63cb23433 Create bun.lockb 2024-08-29 15:09:46 -03:00
Judson Cairo
41342f39de Removed redis cache from is on whatsapp 2024-08-28 17:29:01 -03:00
Judson Cairo
49806cf47e Avoid duplicate search
If already found on redis ignore database
2024-08-28 13:33:33 -03:00
Judson Cairo
7468ae9169 Removed unused variable from .env 2024-08-28 13:30:11 -03:00
Judson Cairo
7a76600cd6 Added redis cache for on whatsapp & TTL on .env 2024-08-28 12:11:32 -03:00
Judson Cairo
ce6438b9a8 Save is on whatsapp on the database 2024-08-28 11:19:47 -03:00
Judson Cairo
a19343d3e1 Validate if cache exists before accessing it 2024-08-28 09:59:40 -03:00
@milesibastos
0989f8a3ad feat: Define a global proxy to be used if the instance does not have one 2024-08-27 21:01:48 -03:00
Davidson Gomes
3b9761992a
Merge pull request #832 from deivisonrpg/change-cache-logs-level
[Proposta] Alterar level dos logs do cache para verbose
2024-08-27 17:32:42 -03:00
Deivison Lincoln
b19c5375e5 [Proposta] Alterar level dos Logs do cache para verbose 2024-08-27 14:01:26 -03:00
Davidson Gomes
cb865bf5a0
Merge pull request #826 from yantxs/adjust-redis-compose
add network on redis docker compose
2024-08-27 08:37:42 -03:00
Davidson Gomes
bb89816ca6
Merge pull request #825 from yantxs/fix-dify-chunks
Fixed integration with Dify agents
2024-08-27 08:37:28 -03:00
Yan Teixeira
c7281cbdea add network on redis docker compose 2024-08-27 01:40:24 -03:00
Yan Teixeira
a44aa1f646 remove whitespaces 2024-08-27 01:34:25 -03:00
Yan Teixeira
d712cbc467 fix agents dify integration 2024-08-27 01:20:02 -03:00
Davidson Gomes
fc786c54f5 changelog 2024-08-26 15:35:39 -03:00
Davidson Gomes
b8d6e55fba fix: change answer to message on Evolution Bot 2024-08-26 15:32:44 -03:00
Davidson Gomes
d776770d09 refactor: evolution bot 2024-08-25 10:22:22 -03:00
Davidson Gomes
8b7ff37261 changelog 2024-08-24 14:58:14 -03:00
Davidson Gomes
c531906de2 fix: duplicated bot when use startTypebot 2024-08-24 14:57:54 -03:00
Davidson Gomes
e8fa952de5 fix: update description on chatbots 2024-08-24 14:36:00 -03:00
Davidson Gomes
d7049e798c changelog 2024-08-24 13:32:47 -03:00
Davidson Gomes
238c332df5 fix: get integrations sessions by type 2024-08-24 13:20:30 -03:00
Davidson Gomes
aeea61ef4b fix: get integrations sessions by type 2024-08-24 13:18:58 -03:00
Davidson Gomes
a90617fa0c fix: dockerfile 2024-08-24 08:39:33 -03:00
Davidson Gomes
a9c737da3f fix: chatbot services 2024-08-24 08:01:42 -03:00
Davidson Gomes
25959ad143 fix: manager 2024-08-24 07:50:31 -03:00
Davidson Gomes
c00f46b105 changelog 2024-08-24 07:48:51 -03:00
Davidson Gomes
2344dfc22f fix: chatbot services 2024-08-24 07:44:23 -03:00
Davidson Gomes
25cbe3a035 license: change in license to apache-2.0 2024-08-24 07:27:06 -03:00
Davidson Gomes
b546e56eea
Merge pull request #814 from diegomustafamarino/v2.0.0
Receive data from Meta ADS ( facebook, instagram ), excluding Chatwoot that already haves.
2024-08-24 07:21:40 -03:00
Diego Marino
aa79409d44 Implement externalAdReplyBody for Meta Ads
Receive Instagram/Facebook Ads messages for recognizing in messages to use in Dify(example).
2024-08-23 21:35:41 -03:00
Diego Marino
f6b3612c3d Merge remote-tracking branch 'upstream/v2.0.0' into v2.0.0 2024-08-23 21:25:10 -03:00
Davidson Gomes
5d6a34ad3f fix: websocket emit 2024-08-23 16:57:44 -03:00
Davidson Gomes
1b9fec6c27 fix: s3 saving media sent from me 2024-08-23 15:48:34 -03:00
Davidson Gomes
e809f38865 fix: fixed send messages in groups 2024-08-23 15:36:59 -03:00
Davidson Gomes
0fca8c0746 fix: set events 2024-08-23 14:56:33 -03:00
Davidson Gomes
d7b3230db9 break change: fix breakchange events in manager 2024-08-23 14:30:48 -03:00
Davidson Gomes
fcdee75f39 fix: set webhook 2024-08-23 14:24:32 -03:00
Davidson Gomes
ca503b49c6 changelog 2024-08-23 14:13:54 -03:00
Davidson Gomes
1f0a5a2e09 fix: fixed proxy config in manager 2024-08-23 14:05:48 -03:00
Davidson Gomes
6a62ae85fc refactor: integration folders and fix manager bugs 2024-08-23 13:46:51 -03:00
Davidson Gomes
beafc62403 refactor: integration folders 2024-08-23 13:20:18 -03:00
Davidson Gomes
a08ca7a67d
Merge pull request #812 from stenioanibal/v2.0.0
Simplify events structure - V2.0.0
2024-08-23 11:54:17 -03:00
Stênio Aníbal
9418faff30 Merge branch 'ev2' into v2.0.0 2024-08-23 11:41:28 -03:00
Stênio Aníbal
99161de094 Fix intrinsic type issues on chatbot controllers 2024-08-23 11:41:14 -03:00
Davidson Gomes
c3c1ffe7e5 fix: manager translate 2024-08-23 11:10:55 -03:00
Stênio Aníbal
03c32de743 Merge branch 'ev2' into v2.0.0 2024-08-23 10:56:17 -03:00
Stênio Aníbal
05ee65f422 Simplify events structure and fix minor issues 2024-08-23 10:53:31 -03:00
Davidson Gomes
6328c64192 fix: messageType null 2024-08-23 08:35:00 -03:00
Davidson Gomes
fcc4fc2665 fix: dockerfile 2024-08-23 08:07:04 -03:00
Davidson Gomes
a83a358620 refactor: channel integration folders 2024-08-23 07:55:26 -03:00
Davidson Gomes
fff11ea452 fix: update baileys version 2024-08-22 23:08:42 -03:00
Diego Marino
9099adf363 Merge remote-tracking branch 'upstream/v2.0.0' into v2.0.0 2024-08-22 21:33:55 -03:00
Davidson Gomes
e77a974b59 fix: whatsapp web version on .env 2024-08-22 20:18:50 -03:00
Davidson Gomes
0e9cd21981 feat: evolution channel in instance create 2024-08-22 19:49:51 -03:00
Davidson Gomes
2196f65b7a fix: dify agent integration 2024-08-22 18:15:30 -03:00
Davidson Gomes
e9f4477d11 feat: flowise integration 2024-08-21 17:33:45 -03:00
Davidson Gomes
0e6a78d011 feat: flowise integration 2024-08-21 17:21:23 -03:00
Davidson Gomes
61523c0a79 feat: generic chatbot 2024-08-21 16:37:24 -03:00
Davidson Gomes
891d00ccba changelog 2024-08-21 16:22:56 -03:00
Davidson Gomes
e0ac6ab5d5
Merge pull request #803 from stenioanibal/v2.0.0
Improvements for events management and Chatwoot integration - V2.0.0
2024-08-21 16:21:31 -03:00
Davidson Gomes
52234089e4 feat: generic chatbot 2024-08-21 15:37:13 -03:00
Davidson Gomes
1ebd6f79c2 feat: generic chatbot 2024-08-21 15:36:54 -03:00
Stênio Aníbal
beb7942d7c Merge branch 'ev2' into v2.0.0 2024-08-21 15:02:52 -03:00
Stênio Aníbal
cca063dfed Fix not found event message for the event services 2024-08-21 15:02:40 -03:00
Davidson Gomes
16bc363d5f refactor: openai services 2024-08-21 14:58:48 -03:00
Stênio Aníbal
4aac2da253 Merge branch 'ev2' into v2.0.0 2024-08-21 14:56:55 -03:00
Stênio Aníbal
0aeecde847 Add BOT_CONTACT env option to Chatwoot 2024-08-21 14:56:41 -03:00
Stênio Aníbal
912df56c55 Remove event emit from channel service preventing exceptions 2024-08-21 14:56:12 -03:00
Stênio Aníbal
6585e8f0c2 Fix events structure to prevent "Instance not found" exception 2024-08-21 14:55:18 -03:00
Davidson Gomes
1bf76ecb94 refactor: dify services 2024-08-21 14:48:59 -03:00
Davidson Gomes
35bde8498b feat: generic chatbot 2024-08-21 14:42:26 -03:00
Davidson Gomes
9a09a6662a
Merge pull request #802 from judsonjuniorr/v2-webhook-fix
Fix webhook validation
2024-08-21 14:01:17 -03:00
Davidson Gomes
73d65b0eb6
Merge branch 'v2.0.0' into v2-webhook-fix 2024-08-21 14:01:09 -03:00
Davidson Gomes
e7d971867b refactor: chatbot integration 2024-08-21 13:52:09 -03:00
Davidson Gomes
9209c9992d refactor: event integration 2024-08-21 13:47:41 -03:00
Davidson Gomes
edeb1efd2a refactor: chatbot integration 2024-08-21 13:37:22 -03:00
Judson Cairo
dcef6919cb Fix webhook validation 2024-08-21 11:04:18 -03:00
Stênio Aníbal
475fced33b Merge branch 'ev2' into v2.0.0 2024-08-21 10:45:12 -03:00
Davidson Gomes
8876797172 refactor: openai integration 2024-08-21 09:29:49 -03:00
Davidson Gomes
b58ad83c12
Merge pull request #800 from dev-luizf/fix/manage-webhook
Fix webhook creation
2024-08-21 07:23:04 -03:00
Diego Marino
839fe74a2c Put Meta Data in Message
Add externalAdReplyBody in Message for controlling ADS replies.
2024-08-20 22:50:25 -03:00
dev-luizf
68f57aa507 fix: fix webhook integration 2024-08-20 18:48:17 -03:00
Davidson Gomes
583ce33868 refactor: channel controller 2024-08-20 18:47:24 -03:00
Davidson Gomes
3b39f13180 refactor: adjusts in module init 2024-08-20 18:41:12 -03:00
Davidson Gomes
2ec0b842c1 refactor: integrations folder 2024-08-20 16:22:02 -03:00
Davidson Gomes
884362e70c refactor: channel folder 2024-08-20 15:49:32 -03:00
Davidson Gomes
df77aadd04 refactor: event folder 2024-08-20 15:36:55 -03:00
Davidson Gomes
7b79591e42 refactor: event folder 2024-08-20 15:27:32 -03:00
Davidson Gomes
64ed0faa83 refactor: integrations router folder structure 2024-08-20 13:13:49 -03:00
Davidson Gomes
d68d42b984 refactor: integrations folder structure 2024-08-20 12:27:04 -03:00
Davidson Gomes
1673132c3e
Merge pull request #798 from stenioanibal/v2.0.0
Finish WebSocket refactor - V2.0.0
2024-08-20 11:40:19 -03:00
Stênio Aníbal
ec9e227413 Merge branch 'ev2' into v2.0.0 2024-08-20 11:26:34 -03:00
Stênio Aníbal
82634c0cb2 Merge websocket new events to the defaults 2024-08-20 11:26:05 -03:00
Davidson Gomes
8b5b4994f2
Merge pull request #789 from stenioanibal/v2.0.0
V2.0.0 - Refactor websocket structure
2024-08-20 11:19:36 -03:00
Davidson Gomes
ff52be5ac5 chore: adjusts in env for manager 2024-08-20 08:56:30 -03:00
Davidson Gomes
e555bc3930 feat: translation in manager: English, Portuguese, Spanish and French 2024-08-20 07:36:12 -03:00
Davidson Gomes
046c64c65d feat: translation in manager: English, Portuguese, Spanish and French 2024-08-20 07:29:14 -03:00
Davidson Gomes
9ae5255d5f fix: send pushName for openai assistant 2024-08-19 11:25:42 -03:00
Davidson Gomes
87a5663da7
Merge pull request #790 from judsonjuniorr/v2-advanced-operators-triggers
Advanced operators trigger for OpenAI/Dify/Typebot
2024-08-19 11:14:08 -03:00
Davidson Gomes
5300c345d9
Merge pull request #796 from matheusmaiberg/v2.0.0
feat: adicionada capacidade de OpenAI para interpretar o contexto de contatos de maneira mais precisa & adicionado informacoes do contato (remoteJid, pushName) no body da function
2024-08-19 11:13:45 -03:00
Matheus Almeida
0cfd143db0 feat: adicionada capacidade de OpenAI para interpretar o contexto de contatos de maneira mais precisa 2024-08-17 23:03:55 -03:00
Judson Cairo
fcd038924d Advanced operators trigger fro OpenAI/Dify/Typebot 2024-08-17 08:32:05 -03:00
Stênio Aníbal
cb36f04534 Remove unused import and bad additional websocket event 2024-08-16 18:31:02 -03:00
Stênio Aníbal
fbff945d5b Merge branch 'ev2' into v2.0.0 2024-08-16 17:46:14 -03:00
Stênio Aníbal
dc04eb16fc Refactor websocket structure 2024-08-16 17:45:09 -03:00
Davidson Gomes
a77fa414e5 changelog 2024-08-16 17:07:34 -03:00
Davidson Gomes
0dbb5f53f1 changelog 2024-08-16 16:24:34 -03:00
Davidson Gomes
b921a4d324 feat: IA send images and Sentry implemented 2024-08-16 11:31:46 -03:00
Davidson Gomes
3ef80bd6c5 feat: openai send images 2024-08-16 07:23:34 -03:00
Davidson Gomes
fb93c890ca feat: dify send images 2024-08-15 20:24:57 -03:00
Davidson Gomes
19f0296718 fix: chatwoot translations and s3 region 2024-08-15 15:41:30 -03:00
Davidson Gomes
38ec114fff
Merge pull request #779 from fabioselau077/bugfix/s3_upload_files
[v2] - Região no S3 e fix do size no uploadFile
2024-08-15 15:34:34 -03:00
Davidson Gomes
212d09ef5a
Merge pull request #780 from judsonjuniorr/V2-fix-chatwoot-translations
Fixed chatwoot translation files on build
2024-08-15 15:33:46 -03:00
Judson Cairo
a679776f89 Fixed chatwoot translation files on build 2024-08-15 15:32:17 -03:00
Davidson Gomes
00cb80f173 fix: docker 2024-08-15 14:05:52 -03:00
Davidson Gomes
60eb923f64 chore: Update tsup configuration
Modified: tsup.config.ts

This commit updates the tsup configuration file. The changes made aim to improve the project's build process and optimize the bundle size. No new functionality or bug fixes are introduced in this commit.
2024-08-15 14:00:24 -03:00
Davidson Gomes
975f41d58e fix: migrations 2024-08-15 13:13:08 -03:00
Davidson Gomes
285a950c67 changelog 2024-08-15 12:31:47 -03:00
Davidson Gomes
c4f91ead54 changelog 2024-08-15 12:31:12 -03:00
Davidson Gomes
785a72cbc8 feat: openai now identifies images 2024-08-15 12:29:08 -03:00
Fabio
b475d1d5ea set region from env and fix size in uploadFile 2024-08-15 11:26:30 -04:00
Stênio Aníbal
000d8fd436 Merge branch 'ev2' into v2.0.0 2024-08-15 11:49:42 -03:00
Davidson Gomes
061696e140 feat: dify now identifies images 2024-08-15 11:12:07 -03:00
Stênio Aníbal
16b910f955 Merge branch 'ev2' into v2.0.0 2024-08-15 10:12:44 -03:00
Davidson Gomes
376cafa350
Merge pull request #773 from judsonjuniorr/V2-integration-unification
V2 integration unification
2024-08-14 18:36:27 -03:00
Judson Cairo
448aefb989 Typo fix 2024-08-14 17:50:11 -03:00
Judson Cairo
1059c92583 Unification of integrations, Typebot & OpenAI & Dify 2024-08-14 17:47:31 -03:00
Judson Cairo
b68814795d Fixed mime types version 2024-08-14 17:41:25 -03:00
Stênio Aníbal
2772c2f31f Merge branch 'ev2' into v2.0.0 2024-08-14 17:02:40 -03:00
Davidson Gomes
360f8066a7 fix: crypto.randumUUID is not a function on Manager 2024-08-14 16:01:14 -03:00
Davidson Gomes
b3991cf6bb feat: Added ignoreJids in chatwoot settings 2024-08-14 14:59:47 -03:00
Davidson Gomes
daa4c76967 update package.json 2024-08-14 11:36:54 -03:00
Davidson Gomes
790b13f123 changelog 2024-08-14 11:34:28 -03:00
Davidson Gomes
b08287f568 changelog 2024-08-14 11:32:53 -03:00
Davidson Gomes
1d31f533f4 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-08-14 11:28:33 -03:00
Davidson Gomes
881a011493 chore: Deprecate buttons and list in new Baileys version
Updated CHANGELOG.md, package.json, src/api/dto/chat.dto.ts, and src/api/services/channels/whatsapp.baileys.service.ts to deprecate buttons and list due to the new Baileys version. This change improves compatibility and maintainability of the codebase.
2024-08-14 11:27:54 -03:00
Stênio Aníbal
707ac9db2c Fix cors settings for websocket when it's set for any origin 2024-08-14 10:36:48 -03:00
Stênio Aníbal
e385932bbc add jetbrains related files to gitignore 2024-08-14 10:30:29 -03:00
Davidson Gomes
78da13fcab
Merge pull request #759 from judsonjuniorr/V2-duplicated-label-creation
Changed labels to be unique on the same instance
2024-08-13 15:56:24 -03:00
Davidson Gomes
7f83263b63
Merge pull request #758 from judsonjuniorr/v2-instance-cleanup
Remove instance from redis even if using database
2024-08-13 15:55:45 -03:00
Davidson Gomes
04f6e11cbd fix: adjusts in migrations 2024-08-13 13:15:13 -03:00
Judson Cairo
f0a6fb111e Removed console.log 2024-08-13 10:23:39 -03:00
Judson Cairo
48febec36a Changed labels to be unique on the same instance 2024-08-12 21:35:31 -03:00
Judson Cairo
041b3c5e1f Remove instance from redis even if using database 2024-08-12 21:03:51 -03:00
Davidson Gomes
dbb6ea9147 fix: adjusts 2.0.9 2024-08-12 13:24:19 -03:00
Davidson Gomes
6800b63945
Merge pull request #750 from judsonjuniorr/v2-path-mappings
V2 Path mapping & deps fix & bundler changed to tsup
2024-08-12 09:43:08 -03:00
Davidson Gomes
b3dacdb1e6
Merge pull request #749 from judsonjuniorr/v2-database-scripts
Improve database scripts to retrieve the provider from env file
2024-08-12 09:41:56 -03:00
Davidson Gomes
404edaa4e1
Merge pull request #747 from judsonjuniorr/v2-update-contacts-database
V2 update contacts database
2024-08-12 09:41:18 -03:00
Davidson Gomes
367d44a4d3
Merge pull request #746 from judsonjuniorr/v2-save-chat-name
V2 save chat name
2024-08-12 09:40:51 -03:00
Judson Cairo
32e58debc6 Path mapping & deps fix & bundler changed to tsup 2024-08-11 20:47:17 -03:00
Judson Cairo
66ae86b6f5 Improve database scripts to retrieve the provider from env file 2024-08-11 16:29:42 -03:00
Judson Cairo
7b1e4e9e3d Add chat name to fetch chats request 2024-08-11 15:49:43 -03:00
Judson Cairo
93cc25b513 Add migration for unique index in contacts 2024-08-11 15:33:46 -03:00
Judson Cairo
77cf4125dd Added migration for name column in chats 2024-08-11 15:29:39 -03:00
Judson Cairo
54e47c09c4 Fixed contacts update in the database 2024-08-10 23:43:53 -03:00
Judson Cairo
dacd408f8d Make contacts unique for the same instance
Avoid duplicated contacts in the database
2024-08-10 23:42:45 -03:00
Judson Cairo
d31b2c7f97 Remove unnecessary logs 2024-08-10 23:16:14 -03:00
Judson Cairo
926197b1ba Save chat names for groups identification 2024-08-10 23:15:20 -03:00
Judson Cairo
668f477218 Validate if session exists before deleting it 2024-08-10 23:15:02 -03:00
Davidson Gomes
feb7b795e9 refactor: .env.example 2024-08-09 14:38:33 -03:00
Davidson Gomes
0f299993d9 chore: adjusts in docker files 2024-08-09 12:41:16 -03:00
Davidson Gomes
e7ff09752e fix: StopBotFromMe working with chatwoot 2024-08-09 09:55:50 -03:00
Davidson Gomes
0dfbed4eb9 changelog 2024-08-09 08:01:47 -03:00
Davidson Gomes
9bf17f27f0 prisma: adjusts for mysql and postgres 2024-08-09 07:59:50 -03:00
Davidson Gomes
678f2c2b5d prisma: adjusts for mysql and postgres 2024-08-09 07:58:33 -03:00
Davidson Gomes
840f9c6f57 chore: adjusts in docker files 2024-08-09 07:17:09 -03:00
Davidson Gomes
9367be0fb1 chore: adjusting details 2024-08-09 06:53:43 -03:00
Davidson Gomes
fa05cf85ab changelog 2024-08-09 06:49:49 -03:00
Davidson Gomes
56a165db54 feat: added general session button in typebot, dify and openai in manager 2024-08-08 23:14:51 -03:00
Davidson Gomes
9329330297
Merge pull request #744 from rcesar/v2.0.0
Fix conversationId when is dify agent
2024-08-08 22:16:34 -03:00
Davidson Gomes
4d9f6ef416 fix: import contacts with image in chatwoot 2024-08-08 22:09:23 -03:00
Davidson Gomes
55d37250aa changelog 2024-08-08 20:31:45 -03:00
Davidson Gomes
bf3cb7c804 changelog 2024-08-08 20:23:52 -03:00
Davidson Gomes
801515a8f4 fix: adjusts in telemetry 2024-08-08 20:19:35 -03:00
Davidson Gomes
83d88ad70a fix: adjusts in telemetry 2024-08-08 20:18:20 -03:00
Davidson Gomes
6f2971cf24 feat: function for openai assistant added 2024-08-08 19:35:32 -03:00
Davidson Gomes
df3092b876 changelog 2024-08-08 19:24:51 -03:00
Davidson Gomes
a49b1e5ac4 changelog 2024-08-08 19:22:36 -03:00
Davidson Gomes
e3ba803247 changelog 2024-08-08 19:12:53 -03:00
Davidson Gomes
543a82d0f9 feat: function for openai assistant added 2024-08-08 19:03:07 -03:00
Davidson Gomes
26a974a239 feat: function for openai assistant added 2024-08-08 18:47:52 -03:00
Davidson Gomes
e7ca3cf254 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-08-08 17:51:27 -03:00
Davidson Gomes
59edf4ffb7 feat: Variables passed to the input in dify 2024-08-08 17:51:12 -03:00
Renan Cesar
0e4034ffac Fix conversationId when is dify agent 2024-08-08 16:28:40 -03:00
Davidson Gomes
d0a723b8ef
Merge pull request #739 from fmedeiros95/v2.0.0
Improve reconnection logic for ban and block cases and add disconnection information to BaileysStartupService and Instance model
2024-08-06 15:03:11 -03:00
Felipe Medeiros
1c3bea4225 feat: add disconnection information to BaileysStartupService and Instance model
- Updated BaileysStartupService to include disconnection handling logic.
- Enhanced Instance model to store disconnection status and details.
2024-08-06 10:38:53 -03:00
Felipe Medeiros
258f56759c refactor: update reconnection logic to prevent reconnection in cases of banishment or blocking
Handled specific errors to improve reconnection logic:
- 401: Triggered logout to handle unauthorized access.
- 402: Recognized as temporary ban, reconnection attempts paused.
- 403: Recognized as forbidden, reconnection attempts stopped.
- 406: Recognized as permanent ban, reconnection attempts halted.
2024-08-06 01:48:42 -03:00
Davidson Gomes
d82945a735 changelog 2024-08-03 14:05:08 -03:00
Davidson Gomes
de8e4a0ca3 fix(dify agent integration): Updated dify agent integration to use streaming response mode and handle message data in chunks. Modified CHANGELOG.md and src/api/integrations/dify/services/dify.service.ts.
This commit addresses an issue with the dify agent integration by updating it to use a streaming response mode. This allows for handling message data in smaller chunks, improving performance and reducing memory usage. The commit also includes updates to the CHANGELOG.md file and the dify.service.ts file, where the actual changes were implemented.
2024-08-03 14:04:39 -03:00
Davidson Gomes
2aa0e08ae4 fix: Added description column on typebot, dify and openai 2024-08-03 13:51:24 -03:00
Davidson Gomes
8438c442b4 fix: Credentials verify on manager login 2024-08-03 13:37:54 -03:00
Davidson Gomes
1d530ac2e9 changelog 2024-08-03 13:36:51 -03:00
Davidson Gomes
9c5eb4bfd1 fix: Session is now individual per instance and remoteJid
Changes made:
- Added `instanceId` to sessions in DifyService, OpenaiService, and TypebotService to ensure that sessions are individual per instance and remoteJid.
- Decreased delay time in BaileysStartupService from 2000ms to 1000ms.

The bug fix ensures that sessions are unique per instance and remoteJid, which improves the overall functionality of the application. The delay time reduction in BaileysStartupService speeds up the pairing code request process.

The modified files are DifyService, OpenaiService, TypebotService, and BaileysStartupService.
2024-08-03 13:36:31 -03:00
Davidson Gomes
c74333719f changelog 2024-08-03 13:20:47 -03:00
Davidson Gomes
819ef70b7b fix: Resolve issue with connecting to instance
Corrected an issue with connecting to the instance by updating the connection status in the Whatsapp Baileys service.

Modified files:
- Whatsapp Baileys service (src/api/services/channels/whatsapp.baileys.service.ts)
2024-08-03 13:20:22 -03:00
Davidson Gomes
9f2801d289 Fix: Resolved issue with connecting to instance
Modified: index.router.ts, whatsapp.baileys.service.ts

Fixed an issue with connecting to the instance by modifying the code in index.router.ts and whatsapp.baileys.service.ts. This change resolves a critical problem that was preventing the application from connecting to the necessary instance.
2024-08-03 13:17:02 -03:00
Davidson Gomes
b92a985cf8 chore(readme): update on readme 2024-08-03 12:56:16 -03:00
Davidson Gomes
c6db03ffa2 fix: Adjusts in restart instance 2024-08-03 12:54:23 -03:00
Davidson Gomes
7ed1965f57 fix: BusinessId added on create instances in manager 2024-08-03 11:27:19 -03:00
Davidson Gomes
8df38e871a fix: BusinessId added on create instances in manager 2024-08-03 11:27:07 -03:00
Davidson Gomes
385307edc6 chore(readme): update on readme 2024-08-03 10:00:26 -03:00
Davidson Gomes
7ad96f54ca fix: update typebot, openai and dify 2024-08-02 19:42:54 -03:00
Davidson Gomes
671b677569 fix: fetchInstances with clientName parameter 2024-08-02 19:22:44 -03:00
Davidson Gomes
3fa6b1fcc5 fix: get models openai 2024-08-02 10:49:06 -03:00
Davidson Gomes
fd64ea07d0 v2.0.5-rc 2024-08-01 18:01:36 -03:00
Davidson Gomes
359908041b fix: instance screen scroll bar in manager 2024-08-01 18:00:49 -03:00
Davidson Gomes
fc5b8668e6 Merge branch 'v2.0.0' of github.com:EvolutionAPI/evolution-api into v2.0.0 2024-08-01 17:15:40 -03:00
Davidson Gomes
67409e1bf5 Add speech-to-text functionality using OpenAI
This commit introduces a new feature that transcribes audio messages to text using OpenAI's Whisper model. The following files were modified to implement this feature:

- `CHANGELOG.md`: Added a new entry under the 'Features' section to document the speech-to-text functionality.
- `prisma/postgresql-schema.prisma`: Added a new boolean field `speechToText` to the `OpenaiSetting` model.
- `src/api/integrations/openai/dto/openai.dto.ts`: Added a new optional boolean property `speechToText` to the `OpenaiSettingDto` class.
- `src/api/integrations/openai/services/openai.service.ts`: Implemented the `speechToText` method to handle the transcription process.
- `src/api/integrations/openai/validate/openai.schema.ts`: Added a new required boolean schema for the `speechToText` property in the `openaiSettingSchema`.
- `src/api/integrations/typebot/services/typebot.service.ts`: Updated the `audioMessage` property to consider the new `speechToText` field.
- `src/api/services/channels/whatsapp.baileys.service.ts` and `src/api/services/channels/whatsapp.business.service.ts`: Added logic to handle the transcription of audio messages when the `speechToText` setting is enabled.

The purpose of this change is to provide a more accessible way for users to interact with audio messages by converting them to text. This improvement will be particularly useful for users with hearing impairments or those in noisy environments.
2024-08-01 17:15:20 -03:00
Davidson Gomes
b6e90bb037
Merge pull request #725 from oriondesign2015/patch-1
Atualização Stack Evolution API v2
2024-07-31 18:51:04 -03:00
OrionDesign
af5ef4d53c
Update evolution_api_v2.yaml 2024-07-31 18:47:27 -03:00
OrionDesign
b4d01da68d
Update evolution_api_v2.yaml 2024-07-31 18:37:16 -03:00
OrionDesign
9b4f80dfc5
Update evolution_api_v2.yaml 2024-07-30 19:40:42 -03:00
OrionDesign
f09fedb7c0
Atualização Stack Evolution API v2
Adição de algumas environments que imagino que estejam faltando.
2024-07-30 19:39:17 -03:00
Davidson Gomes
a73b74ceaa updates on manager 2024-07-30 18:39:00 -03:00
Davidson Gomes
a49c63bc2b chore: Update CHANGELOG and API routes
Updated CHANGELOG.md with details of the current release.
Modified src/api/routes/index.router.ts to improve the API routing.

These changes are part of the ongoing maintenance and improvement of the project.
2024-07-30 18:38:13 -03:00
Davidson Gomes
8118c68dce v2.0.4-rc 2024-07-30 17:07:45 -03:00
Davidson Gomes
ef2291b9a9 v2.0.4-rc 2024-07-30 15:39:00 -03:00
Davidson Gomes
bb65b566e5 chore: Update dify and openai services
Modified the implementation of Dify and OpenAI services to improve overall functionality. These changes aim to enhance the stability and performance of the integration layer, although no new features have been added.

Changes affected the following files:
- dify.service.ts
- openai.service.ts
2024-07-30 15:38:27 -03:00
Davidson Gomes
881c1c2aa6 v2.0.4-rc 2024-07-30 14:52:19 -03:00
Davidson Gomes
fcb9dd29f3 v2.0.4-rc 2024-07-30 14:14:17 -03:00
Davidson Gomes
7cd0d2430d feat: update new manager for dify 2024-07-30 14:12:46 -03:00
Davidson Gomes
35016087d6 changelog 2024-07-30 13:35:31 -03:00
Davidson Gomes
a5d72a0dfd feat: Integration with Dify
Adds support for Dify integration, including new routes, services, and controllers. The configuration for Dify has been added to the environment file, and the necessary changes have been made to the `.env.example` file. Additionally, the WhatsApp Baileys service has been updated to handle Dify notifications.

Modified files:
- `.env.example`
- `package.json`
- `src/api/integrations/openai/services/openai.service.ts`
- `src/api/routes/index.router.ts`
- `src/api/server.module.ts`
- `src/api/services/channel.service.ts`
- `src/api/services/channels/whatsapp.baileys.service.ts`
- `src/config/env.config.ts`
- `src/validate/validate.schema.ts`

Introduced files:
- `src/api/integrations/dify/`
- `src/api/integrations/dify/controllers/dify.controller.ts`
- `src/api/integrations/dify/dto/dify.dto.ts`
- `src/api/integrations/dify/routes/dify.router.ts`
- `src/api/integrations/dify/services/dify.service.ts`
- `src/api/integrations/dify/validate/dify.schema.ts`
2024-07-30 13:34:35 -03:00
Davidson Gomes
b604e4ecc7 feat: Introduce dify tables with related migrations
This commit introduces a new feature, dify tables, along with related migration scripts. The `prisma/migrations/20240730152156_create_dify_tables/migration.sql` file contains the migration for creating the dify tables, while the `prisma/postgresql-schema.prisma` file has been modified to include the necessary schema changes for these tables. This change improves data organization and simplifies data management for the project.
2024-07-30 12:22:39 -03:00
Davidson Gomes
66814b403e chore: Update monitor service and instance controller
Refactored the instance controller and monitor service to improve the connection handling and management of WhatsApp instances.

- Modified the instance controller to close the WebSocket connection and restart the instance instead of reloading it.
- Updated the monitor service to remove the instance from the `waInstances` object and emit an event to clean up and remove the instance data.
- Fixed an issue where the instance was not being removed from the `waInstances` object.

Files affected:
- CHANGELOG.md
- src/api/controllers/instance.controller.ts
- src/api/services/monitor.service.ts
2024-07-30 11:15:21 -03:00
Davidson Gomes
95bc5e6b21 chore: Updated dependencies and added new manager
In this commit, the following changes were made:

- Updated the version of the project to 2.0.4-beta.
- Added the new manager with version 2.0.0.
- Updated the Baileys version.
- Modified several files such as CHANGELOG.md, Dockerfile, package.json, src/api/routes/index.router.ts, and src/api/routes/view.router.ts.
- Deleted the views/manager.hbs file and added the manager/ folder.

These changes update the dependencies and include a new manager, which may impact the application's functionality.
2024-07-30 09:17:49 -03:00
Davidson Gomes
5047e6281a fix: Correct openai session deletion and pause functionality
This commit fixes an issue where openai sessions were not being properly deleted or paused. It updates the `openai.service.ts` and `openai.schema.ts` files to correctly handle session deletion and pausing.

The `openai.service.ts` file now includes additional checks for session status before deleting or updating. The `openai.schema.ts` file has been updated to include a new 'delete' status option.

These changes ensure that openai sessions are properly managed and that the bot can be paused and resumed as intended. This improves the overall functionality and user experience of the application.
2024-07-29 19:07:26 -03:00
Davidson Gomes
7ba1f2fdf4 fix: Correct pause and listen to my messages from Typebot integration
This commit fixes an issue where the bot was not pausing and listening to my messages from the Typebot integration. The changes include modifying the Typebot service, Typebot schema, and WhatsApp Baileys and Business services to properly handle the pause and message listening functionality. The affected files are typebot.service.ts, typebot.schema.ts, and both WhatsApp services.

The specific modifications include adding a new 'delete' status option in the Typebot schema, updating the Typebot service to handle the 'delete' status, and adjusting the WhatsApp services to properly send Typebot messages based on the new schema. This ensures that the bot can pause and listen to messages from Typebot integration, providing a better user experience.
2024-07-29 17:53:18 -03:00
Davidson Gomes
21375bcb4d changelog 2024-07-29 17:30:26 -03:00
Davidson Gomes
7bfb4f93bb Fix: Corrected openai trigger validation
Corrected an issue in the validation of openai triggers by changing the 'findFirst' method to 'findMany' and implementing a loop to find the correct trigger match. This change improves the accuracy of trigger validation and ensures that all possible matches are considered.

Impact: This fix ensures that the correct trigger is identified, improving the overall functionality of the openai integration.

Affected files:
- openai.service.ts
2024-07-29 17:29:55 -03:00
Davidson Gomes
c03e0cc954 fix: corrected typebot trigger validation
Explanation:
This commit fixes an issue in the validation of typebot triggers. The 'findFirst' method was used to search for triggers, but it only returns the first match found. To solve this problem, the 'findMany' method was used instead, and a loop was added to search for all matches. This change ensures that all triggers that match the validation criteria are returned.

The modified file is:
- typebot.service.ts: this is the main file where the changes were made. It was necessary to modify the function that validates the triggers, replacing the 'findFirst' method with the 'findMany' method and adding a loop to search for all matches.

This change improves the validation of typebot triggers, ensuring that all matches are returned, and prevents errors in the trigger validation process.
2024-07-29 17:29:18 -03:00
Davidson Gomes
b3b1fb30c7 fix: adjusts for new manager 2024-07-29 15:10:04 -03:00
Davidson Gomes
2a7f9698d2 fix: adjusts for new manager 2024-07-29 15:09:40 -03:00
Davidson Gomes
089810fb55 fix: Update Baileys version in package.json and CHANGELOG.md
This commit updates the Baileys version from 'github:EvolutionAPI/Baileys' to '6.7.5' in the package.json file. Additionally, it includes an update to the CHANGELOG.md file, adding a new section for version 2.0.4-beta with a fixed issue related to Baileys. This change improves the stability and compatibility of the project with the latest Baileys version.
2024-07-29 09:34:29 -03:00
Davidson Gomes
24866834e9 version 2024-07-29 09:03:37 -03:00
Davidson Gomes
c3bb632a1a fix: Fixed Typebot start call with active session by updating instanceId references in TypebotService
In this commit, I fixed an issue with the start call of Typebot when there is an active session. I noticed that there were inconsistencies in the way the instanceId was being referenced in the TypebotService.

To resolve this, I modified the TypebotService to update the instanceId references to the correct format. Specifically, I changed the following files:
- CHANGELOG.md: added a note about the fix for the Typebot start call with active session
- src/api/integrations/typebot/services/typebot.service.ts: updated the instanceId references in the startTypebot, createNewSession, and other related methods.

This change ensures that the Typebot start call with active session works as intended, improving the overall functionality of the Typebot integration.
2024-07-29 09:02:51 -03:00
Davidson Gomes
bda0f6a198 changelog 2024-07-29 08:53:42 -03:00
Davidson Gomes
d00e3677f5 chore: adjust TriggerType for OpenAI and Typebot integrations
Modifies the TriggerType enum to include a 'none' option and updates the OpenAI and Typebot services to handle this new option. Additionally, the services now require a trigger operator and value when the trigger type is set to 'keyword'.

Modified files:
- prisma/postgresql-schema.prisma
- src/api/integrations/openai/services/openai.service.ts
- src/api/integrations/typebot/services/typebot.service.ts

Untracked file:
- prisma/migrations/20240729115127_modify_trigger_type_openai_typebot_table/
2024-07-29 08:53:15 -03:00
Davidson Gomes
f95d34a1da chore: Update WhatsApp Business service to stop processing read messages from non-broadcast and non-me jids
Modifies the WhatsApp Business service to skip processing read messages from non-broadcast and non-me jids, improving performance and reducing unnecessary computations. Affects src/api/services/channels/whatsapp.business.service.ts.
2024-07-28 19:54:45 -03:00
Davidson Gomes
0bb2b92853 feat: Sending template approval status webhook 2024-07-25 19:38:34 -03:00
Davidson Gomes
31cb83a40c chore: Update changelog with new webhook feature and bug fix
- Add new section "Features" with webhook url by submitted template
- Equations and adjustments for the new manager under "Fixed" section
- CHANGELOG.md modified
2024-07-23 17:14:26 -03:00
Davidson Gomes
4746d3991e chore: Add webhookUrl to Message model, DTOs, and services
Adds webhookUrl field to Message model, SendMessageDto, SendTemplateDto, SendContactDto, and related services to enable sending messages to a specified webhook URL. This change allows for more flexible message handling and delivery options.

Modified files:
- prisma/postgresql-schema.prisma
- src/api/dto/sendMessage.dto.ts
- src/api/services/channels/whatsapp.business.service.ts
- src/validate/message.schema.ts

Untracked files:
- prisma/migrations/20240723200254_add_webhookurl_on_message/
2024-07-23 17:13:37 -03:00
Davidson Gomes
50591e9ed6 chore: Update package version and changelog
Bumped package version from 2.0.2-beta to 2.0.3-beta to reflect recent changes.
Updated the changelog accordingly. The modification was made in the package.json file.
This change is a preparation for the next release and does not introduce new features or bug fixes.
2024-07-23 12:35:56 -03:00
Davidson Gomes
388a4f7630 chore: Update changelog
Update the CHANGELOG.md file to reflect the recent changes in the project. This commit includes the addition and modification of the changelog to keep track of the updates made in the v2.0.0 branch.
2024-07-23 12:35:36 -03:00
Davidson Gomes
c1d3209f2f chore: equations and adjustments for the new manager 2024-07-23 12:34:58 -03:00
Davidson Gomes
837f7f310a fix(CHANGELOG.md): Update version 2.0.2-beta release date and remove assistant details
This commit updates the release date of version 2.0.2-beta in the CHANGELOG.md file and removes the detailed description of Open AI assistants implementation, as it is not necessary for this section. The main purpose of this commit is to keep the CHANGELOG.md file clean and concise, only mentioning the high-level changes and updates.

Note that the focus of this commit is on the CHANGELOG.md file, which is a crucial file for tracking the project's versioning and changes over time. By providing a clear and concise commit message, other developers can easily understand the purpose of this change and its impact on the project's versioning and documentation.
2024-07-18 21:34:02 -03:00
Davidson Gomes
f8e303f3a3 fix: Implement open chat completion and refactor code
Remove unnecessary initialization of empty arrays for systemMessages, assistantMessages, and userMessages in OpenaiService.
Also, implement a function to handle open chat completion and refactor the code for better readability and maintainability.
Affected files: openai.service.ts
2024-07-18 21:33:21 -03:00
Davidson Gomes
51749e8712 feat: Open AI assistants implemented 2024-07-18 21:11:46 -03:00
Davidson Gomes
29b9e688a8 chore: Crud openai complete 2024-07-18 10:14:53 -03:00
Davidson Gomes
5b13de377b feat: started openai integration, added models to the database
This commit introduces a new openai integration in the project, along with necessary changes in the database schema. The package.json file has been updated to include the openai package, and the prisma/postgresql-schema.prisma file has been modified to include OpenaiCreds, OpenaiAssistant, OpenaiAssistantThread, and OpenaiChatCompletion models. These models will handle the integration with OpenAI's API for various tasks.

Some of the key changes include:

- Addition of OpenaiCreds model to manage API credentials.
- Addition of OpenaiAssistant model to handle OpenAI assistant instances.
- Addition of OpenaiAssistantThread model to manage OpenAI assistant threads.
- Addition of OpenaiChatCompletion model to handle OpenAI chat completions.

These changes will enable seamless integration with OpenAI's API and allow for better management of assistant instances, threads, and chat completions.
2024-07-18 08:48:56 -03:00
Davidson Gomes
aa2da01401 fix: Correction in start typebot, create it if not exists
- Corrected an issue where the start typebot function would throw an error if the typebot was not found.
- Added a condition to create a new typebot if it doesn't exist.
- Updated CHANGELOG.md with the details of the changes.

Files affected:
- CHANGELOG.md
- src/api/integrations/typebot/services/typebot.service.ts
2024-07-18 08:25:59 -03:00
Davidson Gomes
9aa2b1b3bf chore: Add apiKey and ServerUrl to prefilledVariables in typebot service
Update typebot.service.ts to add apiKey and ServerUrl to prefilledVariables.
This change is necessary for the typebot service to correctly prefill variables with the required credentials.
The deleted file .github/workflows/publish_docker_image_v2.yml was not related to this change.

Note: This change does not affect the current functionality but provides a better way to handle credentials.

Confidence: 90%
2024-07-18 08:15:53 -03:00
Davidson Gomes
b907d85a7e Fix: Fixed global exchange name and updated database connection client name
This commit resolves an issue with the global exchange name and updates the database connection client name. The `.env.example`, `CHANGELOG.md`, and `src/api/integrations/rabbitmq/libs/amqp.server.ts` files were modified. The exchange name in the AMQP server and global queues initialization has been changed to use the value from the configuration service. Additionally, the database connection client name has been updated in the `.env.example` file. The change in the `CHANGELOG.md` file has been updated accordingly.
2024-07-17 18:55:35 -03:00
Davidson Gomes
7e9132fcfe chore: Remove DEL\_TEMP\_INSTANCES variable and related functionality
The DEL\_TEMP\_INSTANCES variable and its related functionality have been removed from the .env.example, CHANGELOG.md, and src/api/services/monitor.service.ts files. The `delInstanceFiles` and `deleteTempInstances` methods have been removed from the MonitoringService class. This change simplifies the codebase and removes unnecessary functionality that was not being used.

Please note that this change does not impact the current functionalities of the application. However, it's important to update the documentation and any other related files accordingly. Make sure to test the application thoroughly to ensure there are no unintended consequences from this change.
2024-07-17 18:52:40 -03:00
Davidson Gomes
d76816eb9c Fix: Resolve 'not find name' issue in WhatsApp service
Resolves an issue where a name was not being found in the WhatsApp service. This fix updates the 'name' property in the WhatsApp service to use 'remoteJid' instead of 'id' when searching for contacts. This change affects the 'src/api/services/channels/whatsapp.baileys.service.ts' file and is reflected in the latest CHANGELOG.md update.

Note: The 'not find name' issue was initially addressed in the previous CHANGELOG.md version but was reintroduced due to a change in the contacts search logic. This commit aims to definitively resolve the issue.
2024-07-17 18:49:39 -03:00
Davidson Gomes
d1098cfcae fix: Update version and fix data saving function
This commit updates the package version from 2.0.1-beta to 2.0.2-beta and fixes an issue with the function of saving or not saving data in the database. It modifies the package.json and CHANGELOG.md files.

Note: The CHANGELOG.md file includes a detailed list of changes and can be reviewed for more information.
2024-07-17 18:43:44 -03:00
Davidson Gomes
1e96878e5f fix: Improve database saving functionality
This commit fixes an issue with data being inconsistently saved in the database. It introduces a new configuration option to enable/disable saving of chat and contact data, as well as message updates and historic data.

The following files were modified:
- .env.example
- CHANGELOG.md
- src/api/services/channels/whatsapp.baileys.service.ts
- src/config/env.config.ts

The 'DATABASE_SAVE_DATA_NEW_MESSAGE', 'DATABASE_SAVE_DATA_MESSAGE_UPDATE', 'DATABASE_SAVE_DATA_CONTACTS', 'DATABASE_SAVE_DATA_CHATS', and 'DATABASE_SAVE_DATA_HISTORIC' options have been added to the 'SaveData' interface in 'env.config.ts'. These options control whether new messages, message updates, contacts, chats, and historic data are saved in the database, respectively. The 'DATABASE_SAVE_DATA_HISTORIC' option is new and allows for more granular control over what data is saved.

The 'WhatsappBaileysService' in 'whatsapp.baileys.service.ts' has been updated to check these configuration options before saving data in the database. This ensures that data is only saved when explicitly allowed.

The 'CHANGELOG.md' has been updated to reflect these changes.
2024-07-17 18:41:11 -03:00
Davidson Gomes
19e9ff9cc8 Fix: Resolved issue with Chatwoot not receiving messages sent by Typebot
Modified: CHANGELOG.md, src/api/integrations/typebot/services/typebot.service.ts

This commit resolves an issue where Chatwoot was not receiving messages sent by Typebot. The necessary changes were made to the typebot service file and the changelog was updated accordingly.
2024-07-17 15:49:03 -03:00
Davidson Gomes
6188944100 chore: Update README.md with new contributors
- Added new contributors to the README.md file
- Updated the Comunidade Hub Connect link with a new one
- Added four new content creators to the README.md file
- The changes will improve the visibility of the project and its contributors
- The updated file is README.md
2024-07-15 17:43:19 -03:00
Davidson Gomes
a03ce984f6 chore: Update telemetry and add new integrations
Refactored the telemetry guard to use a new sendTelemetry utility function,
which allows for easier tracking of API routes. Also, added telemetry events
for message sending in the Chatwoot and Typebot services.

Additionally, updated the README.md to include new content creators and
added new integrations with Typebot and Chatwoot services.

Modified:
- README.md
- package.json
- src/api/guards/telemetry.guard.ts
- src/api/integrations/chatwoot/services/chatwoot.service.ts
- src/api/integrations/typebot/services/typebot.service.ts

Added:
- src/utils/sendTelemetry.ts
2024-07-15 12:43:20 -03:00
Davidson Gomes
22a24b1b88 chore: Implement telemetry and update README
Updated README.md to include a notice about the implementation of telemetry. The telemetry collects data on the routes used, the most accessed routes, and the version of the API in use, without collecting any sensitive or personal data. This change will help identify improvements and provide a better experience for users.
2024-07-15 09:36:08 -03:00
Davidson Gomes
e33893d943 chore: Add telemetry system
Added new file 'telemetry.guard.ts' in 'src/api/guards' directory.
Modified 'index.router.ts' in 'src/api/routes' directory to integrate the new telemetry system.

This change improves the monitoring and data gathering capabilities of the application, allowing for better performance analysis and potential issue detection.
2024-07-15 09:25:40 -03:00
Davidson Gomes
7a675e7b37 fix(CHANGELOG): update version from alpha to beta
- Updated the version from 2.0.0 (alpha) to 2.0.0 (beta) in the CHANGELOG.md file.
- This change reflects the progression of the project towards a beta version.
2024-07-14 12:29:16 -03:00
Davidson Gomes
cb1921d28c chore: Updated Docker image tag for v2.0.0 in publish workflow
This commit updates the Docker image tag from 'v2.0.0-alpha' to 'v2.0.0-beta' in the 'publish\_docker\_image\_v2.yml' workflow file. The change aims to reflect the progress of the version towards a more stable release.

The main file affected by this change is '.github/workflows/publish\_docker\_image\_v2.yml'.
2024-07-14 12:27:56 -03:00
Davidson Gomes
585421c514 chore: Update changelog with new features and bug fixes
- Update CHANGELOG.md with new typebot integration improvements
  - Media sent to typebot now goes as a template string, example: imageMessage|MESSAGE\_ID
  - Added debounce time for typebot messages
  - Tagging in chatwoot contact by instance
  - Ignore jids configuration added to typebot (will be used for both groups and contacts)
  - When S3 integration enabled, the media sent to typebot now goes as a template string, example: imageMessage|MEDIA\_URL
- Fix typo in CHANGELOG.md: * Media sent to typebot now goes as a template string, example: imageMessage:MESSAGE\_ID (corrected to |)

Please review the updated changelog for accuracy and completeness.
2024-07-14 10:50:38 -03:00
Davidson Gomes
484736facd fix: Updated media handling in WhatsApp Baileys and Typebot services
This commit fixes issues with media handling in the WhatsApp Baileys and Typebot services. Specifically, it updates the way media messages are processed and stored. The changes include:

- Importing the `S3` class from the configuration in the Typebot service (`src/api/integrations/typebot/services/typebot.service.ts`).
- Modifying the `getTypeMessage` method in the Typebot service to handle media messages more efficiently.
- Refactoring the `BaileysStartupService` in the WhatsApp Baileys service (`src/api/services/channels/whatsapp.baileys.service.ts`) to handle media messages more consistently.

These changes improve the handling and storage of media messages, ensuring that they are processed correctly and efficiently.
2024-07-14 10:39:32 -03:00
Davidson Gomes
e6916acf45 chore: Improve 'getBase64FromMediaMessage' function in Whatsapp Baileys service
The 'getBase64FromMediaMessage' function in the Whatsapp Baileys service has been improved. Now, the 'getBuffer' parameter has a default value of 'false', making it optional. This change simplifies the function call and enhances readability.

Modified file:
- src/api/services/channels/whatsapp.baileys.service.ts
2024-07-13 16:15:55 -03:00
Davidson Gomes
d80b0d14ac chore: Whatsapp Baileys service - disable webhook media download when S3 is not enabled
This change disables the download of media messages through the Whatsapp Baileys service's local webhook when the S3 storage is not enabled. This is to prevent unnecessary media downloads and potential storage issues. The modified file is 'whatsapp.baileys.service.ts'.
2024-07-13 16:12:16 -03:00
Davidson Gomes
db1ab7404b chore: Update environment variables and add Minio/S3 integration
Updated .env.example with new environment variables for Minio/S3 integration.
Added configuration for Minio/S3 endpoint, bucket, access key, secret key, and other related settings.
Updated CHANGELOG.md to include the Minio/S3 integration.

This change allows for the addition of Minio/S3 as a storage option for the project, improving flexibility and scalability.
2024-07-13 16:09:20 -03:00
Davidson Gomes
e73d9c1982 chore: Integration with MinIO and S3
Adds support for MinIO and S3 for storing media files. Modified several files to implement this feature, including package.json, prisma/postgresql-schema.prisma, src/api/integrations/typebot/services/typebot.service.ts, src/api/routes/index.router.ts, src/api/services/channels/whatsapp.baileys.service.ts, and src/config/env.config.ts. Added untracked files for the new S3 integration. Also added a new S3Controller and S3Service for handling S3 related operations.

This change allows for more flexible media storage options and enables the use of MinIO or S3 for storing media files.
2024-07-13 16:07:16 -03:00
Davidson Gomes
f7a731a193 chore: Add ignoreJid feature to typebot and improve comparison
Adds a new feature to the typebot integration that allows ignoring specific remote JIDs. Also improves the comparison functionality. The main changes are in the typebot controller, DTO, route, and service. Additionally, the WhatsApp Business Service and event configuration files have been updated.

The main files modified are:
- typebot.controller.ts
- typebot.dto.ts
- typebot.router.ts
- typebot.service.ts
- typebot.schema.ts
- whatsapp.business.service.ts
- event.config.ts
2024-07-13 13:55:42 -03:00
Davidson Gomes
e3a97d0071 refactor: using stream instead of temp files in chatwoot and repository services
This commit refactors the code in the `chatwoot.service.ts` and `repository.service.ts` files to use streams instead of temporary files. This change reduces the number of disk operations, making the application faster and more efficient.

In the `chatwoot.service.ts` file, the `createReadStream`, `unlinkSync`, and `writeFileSync` functions have been replaced with the `Readable` stream. The `sendData` method has been updated to accept a `fileStream` and `fileName` instead of a file path. The `processImage` method has been refactored to use a stream instead of writing the image to a file.

In the `repository.service.ts` file, the `initStoreFolders` method has been removed, as it is no longer needed.

These changes improve the maintainability of the codebase by reducing the number of disk operations and simplifying the code. This refactoring also makes the application more efficient and faster, as it reduces the number of disk operations.

Motivation:
The motivation behind this refactoring is to improve the performance and efficiency of the application by reducing the number of disk operations.

Impact:
This refactoring reduces the number of disk operations, making the application faster and more efficient. It also simplifies the codebase and improves its maintainability.
2024-07-13 08:10:36 -03:00
Davidson Gomes
d3ab402d94 chore: Update changelog with new changes
- Add support for ignoring jids configuration in typebot
- Update regex and fallback implementation in typebot
- Enable tagging in chatwoot contact by instance
- Add support for managing WhatsApp templates via official API

The changelog has been updated to reflect the recent changes in the project. This includes the addition of a new feature to ignore jids configuration in typebot, updates to the regex and fallback implementation in typebot, the ability to enable tagging in chatwoot contact by instance, and support for managing WhatsApp templates via the official API. These changes improve the functionality and maintainability of the project.
2024-07-12 20:18:39 -03:00
Davidson Gomes
b2bf5d2318 chore: Ignore specific JIDs in Typebot integration
Implements the ability to ignore specific JIDs in the Typebot integration, improving the flexibility of the feature. This change includes modifications in the Prisma schema, DTOs, services, and validation schema.

- Adds 'ignoreJids' field to the PostgreSQL schema (prisma/postgresql-schema.prisma).
- Updates TypebotDto and TypebotSettingDto to include 'ignoreJids' (src/api/integrations/typebot/dto/typebot.dto.ts).
- Modifies TypebotService to handle 'ignoreJids' when creating and updating Typebot instances (src/api/integrations/typebot/services/typebot.service.ts).
- Adds 'ignoreJids' to the Typebot validation schema (src/api/integrations/typebot/validate/typebot.schema.ts).

This update allows for more precise control over which JIDs are processed by the Typebot integration, reducing unnecessary processing and improving performance.
2024-07-12 20:14:57 -03:00
Davidson Gomes
480cc67927 feat: Fixes and implementation of regex and fallback in typebot 2024-07-12 20:03:53 -03:00
Davidson Gomes
a52a687493 chore: Remove unused fileExists function in use-multi-file-auth-state-prisma.ts
Explanation:
This commit removes an unused `fileExists` function from the `use-multi-file-auth-state-prisma.ts` file. This change simplifies the code and reduces the potential for confusion or maintenance issues in the future. The previously implemented `fileExists` function was commented out and not used in any other part of the file, so it was safe to remove. This change does not affect the functionality of the module and is a pure code improvement.

Affected files:
- `src/utils/use-multi-file-auth-state-prisma.ts`
2024-07-12 14:15:16 -03:00
Davidson Gomes
634ee9b4b3 fix: Resolve 'no such file or directory' error (#123)
This commit fixes an issue where a 'no such file or directory' error was being thrown. The error was caused by the absence of a temporary directory used for storing data. To resolve this issue, the `initStoreFolders` method was added to the `PrismaRepository` class, which creates the necessary store path and temporary directory during initialization.

The modifications include changes to the `repository.service.ts` file, where the `initStoreFolders` method was implemented. The `fs` and `path` modules were imported to facilitate file system operations.

With these changes, the error should no longer occur, ensuring the proper functioning of the application.
2024-07-12 14:01:18 -03:00
Davidson Gomes
49ad9812a4 fix: Correction in response returns from buttons, lists and templates
Fixes the display of unnecessary logs in the webhook controller and updates the way context data is handled in the Whatsapp Business service. Adds private methods to handle different types of messages, such as buttons, reactions and contacts.

Modified files:
- webhook.controller.ts
- whatsapp.business.service.ts
2024-07-12 13:45:31 -03:00
Davidson Gomes
c782305456 Remove template model and related functionality (prisma/postgresql-schema.prisma, src/api/services/template.service.ts)
This commit removes the Template model, including its related functionality, from the project. The template table has been removed from the database schema, and all related functions and methods in the template service have been deleted. This change was made because the project now uses the persistence of the meta, eliminating the need for a separate template model.

Please note that this change may affect other parts of the application that rely on the Template model. Ensure that all necessary adjustments have been made before merging this commit.
2024-07-12 13:25:59 -03:00
Davidson Gomes
ca3dadfb35 Fix: Resolve issue with template association in Instance model
The Issue:
The Instance model in the postgresql-schema.prisma file previously had a Template field that was a single Template object, but this caused issues with the association of multiple templates to a single instance.

The Change:
This commit resolves the issue by changing the Template field to an array of Template objects. This allows for multiple templates to be associated with a single instance.

The Impact:
This change allows for more flexible use of templates in the system and resolves a previous limitation in the association of templates to instances.

Affected Files:
- prisma/postgresql-schema.prisma
- src/api/services/template.service.ts

Note: The migration folder added in the untracked files section is a result of the Prisma schema change and can be safely ignored in this commit message.
2024-07-12 13:01:17 -03:00
Davidson Gomes
99a091ec61 fix: Correção no retorno dos envios na API oficial do WhatsApp
Correção no serviço WhatsApp Business para retornar a mensagem após o envio.
Além disso, foi adicionada a capacidade de deletar templates por ID.

Arquivos modificados:
- whatsapp.business.service.ts
- template.service.ts
2024-07-12 12:55:16 -03:00
Davidson Gomes
26bddf3c53 Add support for managing WhatsApp templates via official API
This commit introduces changes to support managing WhatsApp templates using the official WhatsApp Business API. The following modifications have been made:

- Implemented a new Template model in the Prisma schema, including fields for template ID, name, language, and associated Instance (business ID, instance ID, and created/updated timestamps).
- Modified the Instance model in the Prisma schema to include a Template relationship.
- Updated InstanceController to include a new `businessId` property in the InstanceDto.
- Added a new TemplateRouter, TemplateController, and TemplateService to handle template-related requests and services.
- Updated the WebhookService to utilize the new TemplateService.
- Added new TypebotController, WebhookController, and WAMonitoringService methods to handle template-related events.
- Updated the validate schema to include a new template schema.

The main goal of this commit is to enable managing WhatsApp templates, including creating, updating, and deleting templates, as well as associating them with specific instances.
2024-07-12 12:32:44 -03:00
Davidson Gomes
a145935366 chore: Add businessId to Instance model
Updated the Instance model to include a new optional string property called businessId. This change affects the following files:

- prisma/postgresql-schema.prisma
- src/api/controllers/instance.controller.ts
- src/api/dto/instance.dto.ts
- src/api/services/monitor.service.ts
- src/validate/instance.schema.ts

A new untracked migration folder has been created to manage database schema updates:

- prisma/migrations/20240712144948_add_business_id_column_to_instances/

This change allows for storing a business identifier alongside the instance, enhancing the ability to categorize and manage instances more effectively.
2024-07-12 11:52:29 -03:00
Davidson Gomes
f6d4f940a3 chore: Update cloud API message sending for lists and buttons
This commit updates the way messages are sent to the cloud API for lists and buttons,
adjusting the structure of the request payload. The affected files include:
- sendMessage.dto.ts: updates the format of the Button class
- sendMessage.router.ts: adds a new route for sending button messages
- whatsapp.business.service.ts: updates the handling of list and button messages
- message.schema.ts: adds a new schema for button messages

These changes improve the integration with the cloud API and allow for better handling of lists and buttons in messages.
2024-07-12 09:40:15 -03:00
Davidson Gomes
4737c71ae1 refactor: change webhook reception for all instances
This commit refactors the webhook reception to handle all instances at once. Previously, each instance had its own webhook endpoint, but now there is a single endpoint for all instances. This change simplifies the codebase and reduces the potential for errors.

The main changes include:
- Modifying the `InstanceController` to update the webhook URL for all instances.
- Modifying the `WebhookController` to handle the reception of webhooks for all instances.
- Modifying the `IndexRouter` and `WebhookRouter` to add a new route for the webhook reception endpoint.
- Modifying the `ServerModule` to inject the `PrismaRepository` into the `WebhookService`.
- Modifying the `WebhookService` to handle the reception of webhooks for all instances.

These changes improve the maintainability and scalability of the application, as there is no longer a need to manage individual webhook endpoints for each instance.
2024-07-12 08:52:18 -03:00
Davidson Gomes
90e03e6d1e ajuste 2024-07-03 18:58:57 -03:00
Davidson Gomes
3637b95f8f chore: Update Dockerfile and whatsapp.baileys.service.ts
Update and modifications in Dockerfile and src/api/services/channels/whatsapp.baileys.service.ts files. These changes improve the performance and maintainability of the Node.js project.
2024-07-03 18:35:12 -03:00
Davidson Gomes
b3a0899f4f chore: Update GitHub actions workflow
Update the GitHub actions workflow file to improve the CI/CD pipeline. The changes include modifying the existing `publish_docker_image_v2.yml` file. These changes ensure the project's version 2.0.0 remains up-to-date and compatible with the latest GitHub actions and Docker image publishing process.
2024-07-03 18:04:52 -03:00
Davidson Gomes
ebc78d63ac chore: Update GitHub Actions workflow in v2.0.0
Update to the GitHub Actions workflow in the v2.0.0 branch. This change modifies the
`.github/workflows/publish_docker_image_v2.yml` file, which is part of the CI/CD
pipeline for publishing Docker images. The specific modifications and their impact
are not detailed in the provided information.
2024-07-03 18:01:34 -03:00
Davidson Gomes
7e48f1bba1 chore: Update WhatsApp Baileys service
Updated the WhatsApp Baileys service at 'src/api/services/channels/whatsapp.baileys.service.ts' to improve test coverage and reliability. This change does not alter the functionality of the service but enhances its maintainability.
2024-07-03 17:59:43 -03:00
Davidson Gomes
aab62e4b03 chore: Update CHANGELOG, Dockerfile and add CI workflow for publishing latest Docker image
- Update CHANGELOG.md to include the new Docker workflow
- Update Dockerfile to improve the build process
- Add a new GitHub Actions workflow (.github/workflows/publish\_docker\_image\_latest.yml) to publish the latest Docker image on push to the 'v2.0.0' branch

This change allows for easier deployment of the latest version of the application, with an updated Dockerfile and a new GitHub Actions workflow to handle publishing the Docker image.
2024-07-03 17:25:38 -03:00
Davidson Gomes
6cea02252e chore: Clear logs in Whatsapp Baileys Service
This commit removes console logs from the Whatsapp Baileys Service in the `whatsapp.baileys.service.ts` file. The logs that were removed were not necessary for the functionality of the service and were only used for debugging purposes. By removing them, we improve the performance and readability of the code.

Modified files:
- src/api/services/channels/whatsapp.baileys.service.ts
2024-07-03 13:22:09 -03:00
Davidson Gomes
8e72983304 fix: Correction in the generation of the queue name 'rabbit'
Fixes a bug in the generation of the 'rabbit' queue name in the 'channel.service.ts' file. The variable 'transformedWe' was replaced by 'event' to generate the queue name. This ensures that the queue name is generated correctly, avoiding possible errors or malfunctions in the system.
2024-06-30 11:25:12 -03:00
Davidson Gomes
b5683aed2a chore: Update 'baileys' dependency to use 'EvolutionAPI' repository
The 'baileys' dependency in the 'package.json' file has been updated to use the 'EvolutionAPI' repository instead of 'WhiskeySockets'. This change ensures that the latest version of 'baileys' is used, which includes improvements in group message sending and cache utilization.

Modified files:
- package.json
2024-06-27 17:49:48 -03:00
Davidson Gomes
228dcf8aa5 chore: Improve code consistency and readability
Refactored the initialization of `LocalSettings` in `channel.service.ts` to only set the properties that have been explicitly provided. This refactoring improves code consistency and readability. Also, removed the unused `initStoreFolders` method from `repository.service.ts` and its related imports. In addition, updated the import style for `PrismaClient` in `repository.service.ts`.

The modified files are:
- src/api/controllers/instance.controller.ts
- src/api/repository/repository.service.ts
- src/api/services/channel.service.ts
- src/api/services/channels/whatsapp.baileys.service.ts
2024-06-27 09:01:02 -03:00
Davidson Gomes
457628b996 fix: Adjusted group message sending with cache improvement
This commit addresses an adjustment in the process of sending messages to groups, with a focus on improving cache utilization. The main modifications include:

- Updated 'package.json' to use the latest 'baileys' version from 'WhiskeySockets' repository.
- Modified 'src/api/services/channels/whatsapp.baileys.service.ts' for better handling of group metadata cache.

The force update group metadata cache function has been removed to streamline the codebase and improve cache handling. This change will ensure that group metadata is updated more efficiently and reduce the overall processing time.
2024-06-27 02:02:34 -03:00
Davidson Gomes
5ea276398f chore: Improve performance of status update and message sending in groups
The performance of sending status updates and messages in groups has been significantly improved. The batch size for sending messages has been reduced from 200 to 1, which allows for more efficient processing.

The `whatsapp.baileys.service.ts` file has been modified to implement this change. The previous batch size was set to 200, which has been updated to 1. This change reduces the number of participants processed in each batch, resulting in improved performance.

This modification also includes a conditional statement to ensure that no further processing is performed when there are no more batches left. This enhancement aims to optimize the overall process of sending status updates and messages in groups.
2024-06-26 23:22:51 -03:00
Davidson Gomes
d342a7b621 chore: Refactor WAMonitoringService instance retrieval and improve code readability
Refactored WAMonitoringService to retrieve instances using Prisma's `findMany` method with a dynamic `where` clause.
This change simplifies the code and makes it more maintainable.
It also removes the deprecated `for...of` loop and the unnecessary instantiation of objects.
The new implementation provides better performance and is more aligned with the current best practices.

Modified files:
- src/api/services/monitor.service.ts
2024-06-26 19:27:06 -03:00
Davidson Gomes
b70ab5a4c3 fix: Update message function to support different message types
The updateMessage function was updated to support different message types such as text, image, and video.
A new private function formatUpdateMessage was added to handle the logic of formatting the message based on its type.
The function checks the message type and returns the corresponding format for the message.
If the message type is not supported, it will return null and throw a BadRequestException.
The createJid function is now called in the updateMessage function to get the jid of the recipient.
This change improves the flexibility of the updateMessage function and ensures that it can handle different types of messages.
2024-06-26 18:23:18 -03:00
Davidson Gomes
6cb3357f08 fix: Correction in WhatsApp sticker sending
Corrected an issue where stickers were not being sent properly in WhatsApp channels. The bug was caused by a mistake in the 'src/api/services/channels/whatsapp.baileys.service.ts' file. This fix resolves the problem and ensures that stickers are sent correctly in WhatsApp channels.
2024-06-26 17:52:51 -03:00
Davidson Gomes
99f4fe2e43 fix: Ghost emoji correction in message sending
Corrects an issue where a ghost emoji was being displayed in message sending. The 'Mentions' class was removed and its properties were moved to the 'Options' class. The 'everyOne' and 'mentioned' properties were replaced by 'mentionsEveryOne' and 'mentioned', respectively. This change improves the code readability and maintainability.

The affected files are:
- src/api/dto/sendMessage.dto.ts
- src/api/services/channels/whatsapp.baileys.service.ts
- src/api/services/channels/whatsapp.business.service.ts
2024-06-26 17:27:38 -03:00
Davidson Gomes
0ded76d366 chore: Recover lost messages from cache in WhatsApp Baileys service 2024-06-26 16:57:55 -03:00
Davidson Gomes
a737fed5cb chore: Updated WhatsApp baileys service
Modified the WhatsApp baileys service to improve the overall functionality. This change aims to enhance the user experience and maintain code quality.

Please note that only the 'src/api/services/channels/whatsapp.baileys.service.ts' file has been modified.
2024-06-26 16:13:21 -03:00
Davidson Gomes
79cadadcc7 chore: Update group metadata cache (#GI234)
- Updated the group metadata cache to improve performance.
- Added verbose logging for cache updates and requests.
- Affected file: `whatsapp.baileys.service.ts`.

Please note that this change does not alter the functionality or behavior of the application. It is a maintenance task to optimize cache management.
2024-06-26 15:38:04 -03:00
Davidson Gomes
75922e603b chore: Update group metadata cache on participants update
Refactored WhatsappBaileysService to update group metadata cache when a participants update event is triggered. This will improve the accuracy of the group metadata and ensure that it stays up-to-date with the latest changes in the group.

Modified:
- src/api/services/channels/whatsapp.baileys.service.ts
2024-06-26 15:23:06 -03:00
Davidson Gomes
d0eee796ba fix: Resolve generation of pairing code
In this commit, we have fixed an issue related to the generation of the pairing code. The changes include modifying the `whatsapp.baileys.service.ts` file, where we have updated the `connectToWhatsapp` method to accept a phone number parameter. Additionally, we have made changes to the `browser` variable to handle phone number and browser options. These changes improve the reliability of the pairing code generation.
2024-06-26 13:55:11 -03:00
Davidson Gomes
47d6fd5d31 chore: Update privacy settings, refactor code and improve performance
In this commit, several changes were made to improve the codebase and update privacy settings. Specifically, the following changes were made:

- The `PrivacySetting` class was refactored to `PrivacySettingDto` in `chat.dto.ts`.
- The `put` method was changed to `post` in `chat.router.ts` for updating the profile picture.
- Several methods in `channel.service.ts` were refactored to improve performance and readability. Specifically, the `setWebhook`, `setRabbitmq`, `setSqs`, `fetchContacts`, and `fetchMessages` methods were improved.
- The `updatePrivacySettings` method in `whatsapp.baileys.service.ts` was refactored to reduce complexity and improve readability.

These changes were made to improve the overall performance and maintainability of the codebase. Additionally, the privacy settings for the WhatsApp client were updated to provide better control over user data.
2024-06-26 08:08:12 -03:00
Davidson Gomes
4120318ec4 feat: update dependencies and improve channel services
Updated dependencies in package.json to ensure compatibility and performance. Enhanced functionality in channel.service.ts and whatsapp.baileys.service.ts for better service handling and reliability. This update aims to improve overall system stability and performance.
2024-06-18 11:28:10 -03:00
Davidson Gomes
4349959daa
Merge pull request #647 from francisbreit/evolution-api-v2.0.0-alpha-fr1
Update criador_de_inbox.json for Evolution v2.0
2024-06-17 14:28:38 -03:00
Davidson Gomes
549224ac16 fix: update WhatsApp Baileys service
Modified the WhatsApp Baileys service in channels to fix an issue. This change addresses a bug that was causing incorrect message handling. The update ensures more reliable communication through the WhatsApp API.
2024-06-17 13:48:46 -03:00
Davidson Gomes
d45e303d55 fix: add TypeScript types to use-multi-file-auth-state-prisma.ts functions
Added TypeScript types to functions in use-multi-file-auth-state-prisma.ts to improve type safety and code readability. This change helps catch type-related errors during development and enhances the maintainability of the codebase.
2024-06-17 13:42:18 -03:00
Davidson Gomes
85106667a2 feat: update message sending logic
Refactored sendMessage.controller.ts, chat.dto.ts, and sendMessage.dto.ts to improve message handling. Updated chatwoot.service.ts and sendMessage.router.ts for better integration with Chatwoot. Enhanced whatsapp.baileys.service.ts for more reliable WhatsApp communication. Adjusted chat.schema.ts and message.schema.ts for validation improvements. These changes enhance the overall messaging functionality and reliability.
2024-06-15 12:46:52 -03:00
Francis Breit
371ab944b3
Update criador_de_inbox.json for Evolution v2.0
Update criador_de_inbox.json for Evolution v2.0
2024-06-14 13:16:42 -03:00
Davidson Gomes
2d49c73023 fix: add validation to prevent group calls in whatsapp.baileys.service.ts
Added a check to prevent group calls by throwing a BadRequestException when a group JID is detected. This change ensures that only individual calls are processed, preventing unsupported group call attempts and improving error handling.
2024-06-14 09:45:02 -03:00
Davidson Gomes
92a0d8ccc9 feat: update API routes and services for better cache handling
Modified instance.router.ts to change HTTP method from PUT to POST for 'restart' route. Updated whatsapp.baileys.service.ts to correct cache configuration logic, ensuring proper usage of cached group metadata. Removed obsolete Typebot-related schema definitions from instance.schema.ts for cleaner validation. These changes improve API functionality and maintainability.
2024-06-14 09:25:18 -03:00
Davidson Gomes
7dfc09ff16 feat: update Baileys library and add fake call feature
Updated the Baileys library reference in package.json and refactored imports across multiple files to use the new library. Added a new feature to handle fake calls in sendMessage.controller.ts and related DTOs. This change improves the integration with the Baileys library and introduces the ability to simulate calls, enhancing the testing capabilities. Main files modified: package.json, instance.controller.ts, sendMessage.controller.ts, chat.dto.ts, instance.dto.ts, sendMessage.dto.ts, chatwoot.service.ts, chatwoot-import-helper.ts, sendMessage.router.ts, cache.service.ts, channel.service.ts, whatsapp.baileys.service.ts, whatsapp.business.service.ts, wa.types.ts, rediscache.ts, use-multi-file-auth-state-prisma.ts, use-multi-file-auth-state-provider-files.ts, use-multi-file-auth-state-redis-db.ts, message.schema.ts.
2024-06-14 08:44:19 -03:00
Davidson Gomes
61d6ddfa81 fix: update default values for WA_BUSINESS configuration
Updated the default values for TOKEN_WEBHOOK, URL, and VERSION in the WA_BUSINESS configuration. This change ensures that the application has more meaningful default settings, improving the initial setup experience. The impact is limited to default behavior when environment variables are not set.
2024-06-13 18:53:20 -03:00
Davidson Gomes
06ba1fd17b chore: update baileys version in package.json
Updated the baileys version in package.json to ensure compatibility with the latest features and bug fixes. This change is necessary to maintain the stability and performance of the application.
2024-06-12 18:56:17 -03:00
Davidson Gomes
f1c31a70bc fix: adjust settings in whatsapp.baileys.service.ts
Increased retryRequestDelayMs, added maxMsgRetryCount, and updated connectTimeoutMs and qrTimeout values for better performance. Adjusted transactionOpts for more efficient retries. These changes aim to enhance connection stability and message handling efficiency.
2024-06-12 18:39:57 -03:00
Davidson Gomes
7799e6626f fix: baileys ignore newsletter 2024-06-12 15:42:37 -03:00
Davidson Gomes
aa79c1bfd7 feat: tagging in chatwoot contact by instance 2024-06-12 15:18:37 -03:00
Davidson Gomes
7451b0d1e3 feat: tagging in chatwoot contact by instance 2024-06-12 15:18:26 -03:00
Davidson Gomes
18d4c68025 fix: messageId baileys 2024-06-12 11:23:51 -03:00
Davidson Gomes
a7887f0b1c fix: messageId baileys 2024-06-12 09:55:40 -03:00
Davidson Gomes
fa14b7b1a9 feat: Added debounce time for typebot messages 2024-06-11 17:56:45 -03:00
Davidson Gomes
2776f113cb feat: Added debounce time for typebot messages 2024-06-11 17:56:20 -03:00
Davidson Gomes
0bf8e55144 fix: provider variables are no longer mandatory in the env 2024-06-11 13:06:35 -03:00
Davidson Gomes
87c68df0f6 fix: provider variables are no longer mandatory in the env 2024-06-11 12:40:00 -03:00
Davidson Gomes
f551242e86 fix: reply message 2024-06-11 11:07:49 -03:00
Davidson Gomes
31258a9b85 feat: Organization configuration and logo in chatwoot bot contact 2024-06-11 10:09:04 -03:00
Davidson Gomes
a8937bd8b1 fix: get message id for typebot 2024-06-10 18:32:05 -03:00
Davidson Gomes
fa3306b0f4 adjusts in typebot 2024-06-10 16:38:11 -03:00
Davidson Gomes
4824ccafd6 fix: get base64 for media message 2024-06-10 15:55:40 -03:00
Davidson Gomes
f40cdb62ba fix: get message id for typebot 2024-06-10 15:48:48 -03:00
Davidson Gomes
8c6e1a579f fix: reply with media message 2024-06-10 15:15:13 -03:00
Davidson Gomes
95022578ba fix: reply with media message 2024-06-10 15:03:41 -03:00
Davidson Gomes
99999eae5d fix: reply with media message 2024-06-10 14:50:03 -03:00
Davidson Gomes
2eb09c1853 fix: reply with media message 2024-06-10 14:49:46 -03:00
Davidson Gomes
99ebb81838 chore: Dockerfile 2024-06-10 14:16:40 -03:00
Davidson Gomes
6d6f7293f9 fix: audio convertion with stream to mp4 2024-06-10 14:01:07 -03:00
Davidson Gomes
9cd50833cf fix: audio convertion with stream 2024-06-10 13:15:24 -03:00
Davidson Gomes
c1cbc0d30c test: audio convertion 2024-06-10 13:01:38 -03:00
Davidson Gomes
ed6e28744e test: audio convertion 2024-06-10 12:34:06 -03:00
Davidson Gomes
28e5b2f65e fix: instances 2024-06-10 11:52:19 -03:00
Davidson Gomes
4879bdb527 fix: instances 2024-06-10 11:33:36 -03:00
Davidson Gomes
7ebf237c1c fix: init store folders 2024-06-10 11:28:28 -03:00
Davidson Gomes
21d984969a fix: Correction of audio sending, now we can speed it up and have the audio wireframe 2024-06-10 07:45:43 -03:00
Davidson Gomes
b3adedca0b docker 2024-06-09 21:56:43 -03:00
Davidson Gomes
f6cca7df92 docker 2024-06-09 21:54:10 -03:00
Davidson Gomes
1737e61d60 docker 2024-06-09 21:51:12 -03:00
Davidson Gomes
dae04c5a2f docker 2024-06-09 21:43:53 -03:00
Davidson Gomes
7b2f8fa5e1 docker 2024-06-09 21:23:09 -03:00
Davidson Gomes
11a52c3f43 docker 2024-06-09 17:38:45 -03:00
Davidson Gomes
d61d5e9631 docker 2024-06-09 17:35:05 -03:00
Davidson Gomes
2e61de5297 docker 2024-06-09 17:31:47 -03:00
Davidson Gomes
b7936d77f5 docker 2024-06-09 17:11:45 -03:00
Davidson Gomes
184009bc4b docker 2024-06-09 16:54:44 -03:00
Davidson Gomes
8369b857da docker 2024-06-09 16:51:47 -03:00
Davidson Gomes
585692cae3 git actions v2 2024-06-09 16:15:44 -03:00
Davidson Gomes
56950bc274 git actions v2 2024-06-09 15:07:56 -03:00
Davidson Gomes
e132434846 git actions v2 2024-06-09 15:03:15 -03:00
Davidson Gomes
5abb94f187 git actions v2 2024-06-09 14:57:49 -03:00
Davidson Gomes
a2dbfed19c git actions v2 2024-06-09 14:55:20 -03:00
Davidson Gomes
7dd4d8ae86 git actions v2 2024-06-09 14:53:48 -03:00
Davidson Gomes
6c8e84eed4 git actions v2 2024-06-09 14:50:22 -03:00
Davidson Gomes
14e7a68c32 git actions v2 2024-06-09 14:49:09 -03:00
Davidson Gomes
71a97e047a git actions v2 2024-06-09 14:41:02 -03:00
Davidson Gomes
35aa19853c git actions v2 2024-06-09 14:31:22 -03:00
Davidson Gomes
caf8d0c826 git actions v2 2024-06-09 14:26:23 -03:00
Davidson Gomes
43c8842dc6 git actions v2 2024-06-09 14:24:57 -03:00
Davidson Gomes
9e25904dc9 Review integration with official WhatsApp API 2024-06-09 14:18:19 -03:00
Davidson Gomes
585bf84af4 Adjust search for chats, messages and contacts 2024-06-09 09:28:15 -03:00
Davidson Gomes
620cd8b06b readme 2024-06-09 08:58:22 -03:00
Davidson Gomes
828ac2f383
Merge branch 'develop' into v2.0.0 2024-06-09 08:55:22 -03:00
Davidson Gomes
9f1c2e4e5f MySQL implementation via prism orm 2024-06-09 08:51:51 -03:00
Davidson Gomes
72de0a6e4d Chatwoot review and improvements 2024-06-09 08:44:06 -03:00
Davidson Gomes
3342a22cc7 sync history set 2024-06-08 22:27:26 -03:00
Davidson Gomes
fff0ca5c79 Merge tag '1.8.1' into develop
v
2024-06-08 21:33:12 -03:00
Davidson Gomes
bd069200ea Merge branch 'release/1.8.1' 2024-06-08 21:33:02 -03:00
Davidson Gomes
c898f1e62a v1.8.1 2024-06-08 21:32:50 -03:00
Davidson Gomes
81a62373f8 changelog 2024-06-08 21:32:01 -03:00
Davidson Gomes
2002e1c38d changelog 2024-06-08 21:31:02 -03:00
Davidson Gomes
e7b0bb53b9 changelog 2024-06-08 21:30:38 -03:00
Davidson Gomes
1f817df5f6 fix: Correction of variables breaking lines in typebot 2024-06-08 21:27:58 -03:00
Davidson Gomes
49daf5719b changelog 2024-06-08 21:24:33 -03:00
Davidson Gomes
ee9cdc51c0 adjusts in typebot 2024-06-08 19:22:12 -03:00
Davidson Gomes
b7a34ec81a adjusts in keepOpen typebot 2024-06-08 19:10:01 -03:00
Davidson Gomes
9178fd74a9 changelog 2024-06-08 19:05:16 -03:00
Davidson Gomes
fe9803b828 feat: Now you can register several typebots with triggers 2024-06-08 19:04:57 -03:00
Davidson Gomes
56df0caab0 fix: now in typebot we wait until the terminal block to accept the user's message, if it arrives before the block is sent, it is ignored 2024-06-08 15:09:55 -03:00
Davidson Gomes
ff31ef912e readme 2024-06-08 14:05:57 -03:00
Davidson Gomes
360d378c33 readme 2024-06-08 14:04:45 -03:00
Davidson Gomes
be65b93d59 fix: Correction of variables breaking lines in typebot 2024-06-08 13:41:44 -03:00
Davidson Gomes
de89f03f13 integrations 2024-06-08 10:31:52 -03:00
Davidson Gomes
cbb5d1d048 integrations: adjusts in payloads 2024-06-07 19:16:51 -03:00
Davidson Gomes
2cb6bdb38b readme 2024-06-07 13:31:23 -03:00
Davidson Gomes
da687041af prisma orm: mysql 2024-06-07 13:30:29 -03:00
Davidson Gomes
52c1394ce2 readme 2024-06-07 13:12:46 -03:00
Davidson Gomes
cf2ebdad63 todo 2024-06-07 13:03:03 -03:00
Davidson Gomes
dbb309eaa0 changelog 2024-06-07 13:00:54 -03:00
Davidson Gomes
8fd082ad80 chore: Simplified payloads and endpoints 2024-06-07 13:00:35 -03:00
Davidson Gomes
a578384e85 chore: Simplified payloads and instance endpoint 2024-06-07 11:09:08 -03:00
Davidson Gomes
eed32a3bd9 chore: optimization in instance registration 2024-06-07 08:28:22 -03:00
Davidson Gomes
0bb9940d05 changelog 2024-06-06 18:45:42 -03:00
Davidson Gomes
ea0ef20979 changelog 2024-06-06 18:43:15 -03:00
Davidson Gomes
85b0627737 adjustis in instance controller 2024-06-06 18:30:45 -03:00
Davidson Gomes
bdd1b8fa21 log: removed excessive verbose logs 2024-06-06 18:04:45 -03:00
Davidson Gomes
51c873c19e prisma orm: all endpoints ok 2024-06-06 17:01:48 -03:00
Davidson Gomes
161814a9e5 added typebot integration activation 2024-06-06 16:44:18 -03:00
Davidson Gomes
1be9c7f95d added chatwoot integration activation 2024-06-06 16:38:43 -03:00
Davidson Gomes
99c8cc0242 prima orm: instance controller ok 2024-06-06 16:14:22 -03:00
Davidson Gomes
b309d686ec version: 2.0.0 2024-06-06 14:56:18 -03:00
Davidson Gomes
36ec67cef9 feat: prisma and remove mongodb 2024-06-06 14:47:58 -03:00
Davidson Gomes
35f97e08dd feat: prisma 2024-06-06 01:13:23 -03:00
Davidson Gomes
272bed1351 feat: prisma 2024-06-06 01:08:24 -03:00
Davidson Gomes
8eced6c575 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-06-05 21:48:53 -03:00
Davidson Gomes
afcf6eab71 cacheGroupMetadata 2024-06-05 21:48:37 -03:00
Davidson Gomes
9633412ef6 cacheGroupMetadata 2024-06-05 21:39:33 -03:00
Davidson Gomes
8034e7f587 cacheGroupMetadata 2024-06-05 21:25:55 -03:00
Davidson Gomes
5be01e1c18
Merge pull request #629 from cark7/develop
fix: added validation when sending gif image
2024-06-04 16:59:36 -03:00
Carlos Chinchilla
6371773416 fix: added validation when sending gif image 2024-06-04 15:14:02 -03:00
Davidson Gomes
52230edc5c session worker compatibility 2024-06-03 19:06:00 -03:00
Davidson Gomes
dd123c6a99 Adjust to repository from session worker 2024-06-01 19:47:43 -03:00
Davidson Gomes
5b2a0fdcb1 Adjust to repository from session worker 2024-06-01 19:29:37 -03:00
Davidson Gomes
9354af3bc7 Adjust to repository from session worker 2024-06-01 19:20:59 -03:00
Davidson Gomes
f48f331d43 New method of saving sessions to a file using worker 2024-06-01 13:28:29 -03:00
Davidson Gomes
696261d749 New method of saving sessions to a file using worker 2024-06-01 09:54:56 -03:00
Davidson Gomes
0e9d036fe0
Merge pull request #622 from jrCleber/main
Adiciona templates para Relatório de Bug e Solicitação de Recursos
2024-05-29 10:34:23 -03:00
Cleber Wilson
8e19fe2fb5 labels para filtros adicionada 2024-05-29 10:33:23 -03:00
Cleber Wilson
861b690217 Adiciona templates para Relatório de Bug e Solicitação de Recursos
- Cria um template para Relatório de Bug com os seguintes campos:
  - Termos de aceite
  - Descrição detalhada do problema
  - Expectativa versus observação
  - Capturas de tela/vídeos
  - Versão da API
  - Ambiente
  - Especificações adicionais do ambiente
  - Logs (se aplicável)
  - Notas adicionais

- Cria um template para Solicitação de Recursos com os seguintes campos:
  - Termos de aceite
  - Tipo de recurso
  - Motivação para a solicitação
  - Exemplos de uso
  - Ideias de desenvolvimento
  - Notas adicionais
2024-05-29 10:08:42 -03:00
Davidson Gomes
f7c9541f5e Merge tag '1.8.0' into develop
v
2024-05-27 16:36:08 -03:00
Davidson Gomes
05b5ae8a84 Merge branch 'release/1.8.0' 2024-05-27 16:36:03 -03:00
Davidson Gomes
2e9c14a0a8 fix: security fix in fetch instance with client key when not connected to mongodb 2024-05-27 16:35:59 -03:00
Davidson Gomes
3350cec589 fix: security fix in fetch instance with client key when not connected to mongodb 2024-05-27 16:35:55 -03:00
Davidson Gomes
bd7a42646b Merge tag '1.8.0' into develop
v
2024-05-27 16:24:29 -03:00
Davidson Gomes
2ae4ddee18 Merge branch 'release/1.8.0' 2024-05-27 16:24:25 -03:00
Davidson Gomes
2fb6e2b209 fix: Build in docker for linux/amd64, linux/arm64 platforms 2024-05-27 16:24:21 -03:00
Davidson Gomes
91f869b136 Merge tag '1.8.0' into develop
v
2024-05-27 16:17:30 -03:00
Davidson Gomes
1284a97625 Merge branch 'release/1.8.0' 2024-05-27 16:17:27 -03:00
Davidson Gomes
3a5cfbf36f fix: Build in docker for linux/amd64, linux/arm64 platforms 2024-05-27 16:17:22 -03:00
Davidson Gomes
47b8ecd43b Merge tag '1.8.0' into develop
v
2024-05-27 16:09:16 -03:00
Davidson Gomes
25ce1a4689 Merge branch 'release/1.8.0' 2024-05-27 16:09:12 -03:00
Davidson Gomes
a5156709ab fix: Build in docker for linux/amd64, linux/arm64 platforms 2024-05-27 16:09:07 -03:00
Davidson Gomes
fd2d37d862 Merge tag '1.8.0' into develop
v
2024-05-27 16:07:19 -03:00
Davidson Gomes
87bf433e9a Merge branch 'release/1.8.0' 2024-05-27 16:07:15 -03:00
Davidson Gomes
b5ec79daae fix: Build in docker for linux/amd64, linux/arm64 platforms 2024-05-27 16:07:03 -03:00
Davidson Gomes
3b19200997 Merge tag '1.7.6' into develop
v
2024-05-27 15:54:45 -03:00
Davidson Gomes
0ab040080c Merge branch 'release/1.7.6' 2024-05-27 15:54:42 -03:00
Davidson Gomes
5719896d18 fix: git actions 2024-05-27 15:54:31 -03:00
Davidson Gomes
e9e1cb6ebc Merge tag '1.7.6' into develop
v
2024-05-27 15:51:22 -03:00
Davidson Gomes
ceee6a7e74 Merge branch 'release/1.7.6' 2024-05-27 15:51:19 -03:00
Davidson Gomes
ebfc6d4fa5 fix: git actions 2024-05-27 15:51:06 -03:00
Davidson Gomes
0d62557a15
Merge pull request #609 from stack-app-br/main
chore: build docker image to platforms: linux/amd64,linux/arm64
2024-05-27 15:45:28 -03:00
Davidson Gomes
097c09328f
Merge pull request #615 from deivisonrpg/fix-merge-brazil-contacts
fix(chatwoot): add merge_brazil_contacts flag to ChannelStartupService and add logs
2024-05-27 15:34:56 -03:00
Davidson Gomes
732103292b
Merge pull request #618 from edisoncm-ti/develop
fix: Correction to Postgres connection string in environment files
2024-05-27 15:34:29 -03:00
edisoncm-ti
3191e9b450 fix: Correction to Postgres connection string in environment files 2024-05-27 15:14:52 -03:00
Davidson Gomes
bf88fdbb31 fix: adjust send presence 2024-05-27 12:57:18 -03:00
Davidson Gomes
4c3fb5e762 correction in message formatting when generated by AI as markdown in typebot 2024-05-27 09:27:42 -03:00
Davidson Gomes
e4b6f4ff0d correction in message formatting when generated by AI as markdown in typebot 2024-05-27 09:23:53 -03:00
Deivison Lincoln
ca0b0d4602 Add merge_brazil_contacts flag to ChannelStartupService 2024-05-25 10:09:37 -03:00
Deivison Lincoln
d7c3779ff7 fix: Add merge_brazil_contacts flag to ChannelStartupService 2024-05-25 10:05:04 -03:00
Davidson Gomes
f0d40eea15 New global mode for rabbitmq events 2024-05-24 18:48:54 -03:00
Davidson Gomes
68dcc1c86a adjusts in create instance 2024-05-23 11:56:52 -03:00
Davidson Gomes
f7dcab3736 Now in the manager, when logging in with the client's apikey, the listing only shows the instance corresponding to the provided apikey (only with MongoDB) 2024-05-23 11:31:45 -03:00
Davidson Gomes
2fcb476c50 Now in the manager, when logging in with the client's apikey, the listing only shows the instance corresponding to the provided apikey (only with MongoDB) 2024-05-23 11:30:47 -03:00
Antonio Milesi Bastos
44a7cd62c8
Merge pull request #1 from stack-app-br/releases/1.7.5
chore: build docker image to platforms: linux/amd64,linux/arm64
2024-05-21 11:56:53 -03:00
@milesibastos
f7f0f8251b chore: build docker image to platforms: linux/amd64,linux/arm64 2024-05-21 11:48:13 -03:00
Davidson Gomes
395b81a6ac Merge tag '1.7.5' into develop
v
2024-05-21 08:53:58 -03:00
Davidson Gomes
da06ed1185 Merge branch 'release/1.7.5' 2024-05-21 08:53:53 -03:00
Davidson Gomes
67afbd6a77 v1.7.5 2024-05-21 08:53:35 -03:00
Davidson Gomes
8fce53b4af fixed version whatsapp web for baileys 2024-05-21 08:38:08 -03:00
Davidson Gomes
65bba23519 update baileys version 2024-05-20 19:53:23 -03:00
Davidson Gomes
283b497788 downgrade baileys version 2024-05-20 19:39:56 -03:00
Davidson Gomes
8cc1b8daa8
Merge pull request #590 from Ckk3/fix-envvar-CLEAN_STORE_CLEANING_INTERVAL
Corrigindo variável inexistente do arquivo env.config.ts e substituindo pela correta CLEAN_STORE_CLEANING_INTERVAL
2024-05-09 14:15:09 -03:00
Davidson Gomes
9ccdb45a7a
Merge pull request #587 from deivisonrpg/chatwoot-merge-contact-with-nine
feature(chatwoot): add merge_brazil_contacts function to solve nine digit in brazilian numbers
2024-05-09 14:12:31 -03:00
Davidson Gomes
f78d360c38
Merge pull request #586 from deivisonrpg/chatwoot-update-contact
refactor(chatwoot): optimize ChatwootService method for updating contact inform…
2024-05-09 14:11:07 -03:00
Ckk3
6144fbe856 changing CLEAN_STORE_CLEANING_TERMINAL to CLEAN_STORE_CLEANING_INTERVAL 2024-05-09 13:21:28 -03:00
Deivison Lincoln
8446be7646 fix(chatwoot): fix grupos 2024-05-08 16:47:21 -03:00
Deivison Lincoln
8875ab1e93 feat: add merge_brazil_contacts flag to instance controller 2024-05-08 15:26:56 -03:00
Deivison Lincoln
7c207a50e1 feat: add merge_brazil_contacts to swagger doc 2024-05-08 15:11:37 -03:00
Deivison Lincoln
dcc32479ff feature(chatwoot): add merge_brazil_contacts function to solve nine digit in brazilian numbers 2024-05-08 15:03:37 -03:00
Deivison Lincoln
09911c472d refactor: optimize ChatwootService method for updating contact information 2024-05-08 14:34:03 -03:00
Davidson Gomes
7a0149ee23
Merge pull request #571 from stack-app-br/main
chore: build docker image to platforms: linux/amd64, linux/arm64
2024-05-08 11:02:11 -03:00
Davidson Gomes
3ae8cf32b0
Merge pull request #584 from Al1st1c/fix/swagger-auth
Fix/swagger auth
2024-05-08 09:56:59 -03:00
Davidson Gomes
11cf947bbb
Merge pull request #583 from deivisonrpg/chore-update-aws-sdk-v3
chore(aws sqs): update aws sdk v3
2024-05-08 09:56:24 -03:00
Davidson Gomes
60a20f61af
Merge pull request #582 from deivisonrpg/hotfix-getOpenConversationByContact
fix(chatwoot): getOpenConversationByContact and init queries error
2024-05-08 09:55:08 -03:00
Davidson Gomes
e65c7b6bcf
Merge pull request #577 from neanderdev/mark-chat-as-unread
feat: method to mark chat as unread
2024-05-08 09:54:37 -03:00
Al1stic
80c892aca3 fix env 2024-05-06 19:31:37 -03:00
dev2
39ee266598 fix: correcao swagger sem authkey 2024-05-06 19:28:57 -03:00
Deivison Lincoln
aa58d7744e chore: update AWS SDK dependency to version 3.569.0 2024-05-06 17:28:41 -03:00
Deivison Lincoln
ea3b0b3712 fix: optimize ChatwootService method for retrieving open conversations 2024-05-06 16:30:16 -03:00
Deivison Lincoln
d9d8707123 chore: update baileys to version 6.7.2 2024-05-06 16:29:37 -03:00
Neander de Souza
8e9a1e2ba5 feat: method to mark chat as unread 2024-05-06 09:08:36 -03:00
Davidson Gomes
e29b4865e8 update baileys 2024-05-01 19:20:40 -03:00
@milesibastos
4b60ca175d chore: build docker image to platforms: linux/amd64,linux/arm64 2024-04-30 17:48:35 -03:00
Davidson Gomes
2fbbc7b5a9 Merge tag '1.7.4' into develop
v
2024-04-28 09:47:24 -03:00
Davidson Gomes
633dbb82d3 Merge branch 'release/1.7.4' 2024-04-28 09:47:19 -03:00
Davidson Gomes
95907b3cea v 1.7.4 2024-04-28 09:47:06 -03:00
Davidson Gomes
14c210c771 fix: new version baileys 2024-04-28 09:41:22 -03:00
Davidson Gomes
00e7fcc46b changelog 2024-04-27 13:13:43 -03:00
Davidson Gomes
720efcbcbf
Merge pull request #566 from judsonjuniorr/feat/cw-inbox-name
Chatwoot inbox name
2024-04-27 13:13:06 -03:00
Davidson Gomes
d95791cc18 changelog 2024-04-27 13:12:29 -03:00
Davidson Gomes
d45b7af3b6 fix: recovering messages 2024-04-27 13:11:33 -03:00
Davidson Gomes
0ad3acaf07 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-04-24 18:55:49 -03:00
Davidson Gomes
e27818ecda adjusts in integration 2024-04-24 18:55:38 -03:00
Davidson Gomes
ff21cf4d4c
Merge pull request #558 from jaison-x/pr2
feat(chatwoot): send private message on error message sent from chatwoot
2024-04-23 19:11:10 -03:00
Davidson Gomes
dc19c7fdec
Merge pull request #555 from jaison-x/pr
fix(chatwoot): fix bug when chatwoot params reopen_conversation and conversation_pending are enabled
2024-04-23 19:10:57 -03:00
jaison-x
6c8ffd8ec6
feat(chatwoot): send private message on error message sent from chatwoot 2024-04-23 17:26:22 -03:00
jaison-x
96fdb210be feat(chatwoot): send private message on error message sent from chatwoot 2024-04-23 17:15:41 -03:00
jaison-x
84ad8e0d6e feat(chatwoot): send private message on error message sent from chatwoot 2024-04-23 15:09:28 -03:00
Davidson Gomes
53361682f4 Recovering messages 2024-04-23 08:01:59 -03:00
jaison-x
0ee243f284 fix(chatwoot): fix bug when chatwoot params reopen_conversation and conversation_pending are enabled 2024-04-22 13:41:06 -03:00
Judson Cairo
26ff0b634f Revert "Update current inbox if exists"
This reverts commit f44ab0f678.
2024-04-21 16:49:15 -03:00
Judson Cairo
f44ab0f678 Update current inbox if exists 2024-04-21 16:46:49 -03:00
Judson Cairo
1f128747bb Fix inbox name on cw config 2024-04-21 16:37:27 -03:00
Judson Cairo
3bf975d90f Set chatwoot custom inbox name 2024-04-21 16:33:20 -03:00
Davidson Gomes
92f8951be4 Merge tag '2.3.9' into develop
v
2024-04-18 21:24:30 -03:00
Davidson Gomes
e071f56767 Merge branch 'release/2.3.9' 2024-04-18 21:24:27 -03:00
Davidson Gomes
c85619efcf fix: Recovering messages lost with redis cache 2024-04-18 17:33:09 -03:00
Davidson Gomes
27f9ae1e56 fix: Recovering messages lost with redis cache 2024-04-18 17:31:10 -03:00
Davidson Gomes
7449102d95 fix: Recovering messages lost with redis cache 2024-04-18 17:31:05 -03:00
Davidson Gomes
234a2c71b5
Merge pull request #543 from PauloAK/history-set-message-status
Adicionado message.status ao webhook MESSAGES_SET
2024-04-18 16:05:44 -03:00
Davidson Gomes
4dd5533202 fix: Adjusts in proxy on fetchAgent 2024-04-18 12:54:00 -03:00
Davidson Gomes
a4d1740754 fix: Adjusts in proxy on fetchAgent 2024-04-18 12:53:55 -03:00
Davidson Gomes
1a2ea1c38a Merge tag '1.7.3' into develop
* Revert fix audio encoding
* Recovering messages lost with redis cache
* Adjusts in redis for save instances
* Adjusts in proxy
* Revert pull request #523
* Added instance name on logs
* Added support for Spanish
* Fix error: invalid operator. The allowed operators for identifier are equal_to,not_equal_to in chatwoot
2024-04-18 12:12:40 -03:00
Davidson Gomes
371ec9b8d5 Merge branch 'release/1.7.3' 2024-04-18 12:12:27 -03:00
Davidson Gomes
5e288d57ea changelog 2024-04-18 12:12:11 -03:00
Davidson Gomes
61bd5b3484 fix: Adjusts in redis for save instances 2024-04-18 10:39:24 -03:00
Paulo Kramer
bb974e10f5 Added message status to the messaging-history.set 2024-04-18 01:34:52 -03:00
Davidson Gomes
4ed1335f89 changelog 2024-04-17 19:58:31 -03:00
Davidson Gomes
4274c7afdb Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-04-17 18:48:11 -03:00
Davidson Gomes
27f67142c8 changelog 2024-04-17 18:46:50 -03:00
Davidson Gomes
ac8aba6ba4
Merge pull request #542 from nestordavalos/develop
 feat: add support for Spanish
2024-04-17 18:45:38 -03:00
Davidson Gomes
07ff61c070 changelog 2024-04-17 18:25:35 -03:00
nestordavalos
3645ac6704 Merge branch 'develop' of https://github.com/EvolutionAPI/evolution-api into develop 2024-04-17 17:20:42 -04:00
nestordavalos
9764719245 feat: add support for Spanish 2024-04-17 17:20:37 -04:00
Davidson Gomes
b3aeed7fc1 fix: retry messages 2024-04-17 18:14:11 -03:00
Davidson Gomes
5ae5d8546e fix: retry messages 2024-04-17 18:10:43 -03:00
Davidson Gomes
d190d8b1af Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-04-17 12:43:55 -03:00
Davidson Gomes
c45538684d fix: fix audio encoding 2024-04-17 12:43:49 -03:00
Davidson Gomes
575e7bf4c4
Merge pull request #539 from jaison-x/pr2
fix: this.localProxy.proxy can be undefined
2024-04-17 12:08:54 -03:00
jaison-x
a4338d8472 fix: this.localProxy.proxy can be undefined 2024-04-17 11:03:55 -03:00
Davidson Gomes
7d542cf115
Merge pull request #538 from jaison-x/pr
fix(chatwoot): error: invalid operator. The allowed operators for identifier are [equal_to,not_equal_to]
2024-04-17 11:03:35 -03:00
jaison-x
9c9a542bbe fix(chatwoot): error: invalid operator. The allowed operators for identifier are [equal_to,not_equal_to]
In chatwoot version 3.8 we can't use the filter operator 'contains' for the field 'identifier'
2024-04-17 10:50:25 -03:00
Davidson Gomes
b6c56551bc fix: Revert pull request #523 2024-04-16 19:13:25 -03:00
Davidson Gomes
1379228196 fix: Revert pull request #523 2024-04-16 19:12:03 -03:00
Davidson Gomes
d6e19b9273 adjusts in v1.7.3 2024-04-16 19:08:44 -03:00
Davidson Gomes
5e0e4051dc Merge tag '1.7.2' into develop
* Mobile connection via sms (test)

* Adjusts in redis
* Send global event in websocket
* Adjusts in proxy
* Fix audio encoding
* Fix conversation read on chatwoot version 3.7
* Fix when receiving/sending messages from whatsapp desktop with ephemeral messages enabled
* Changed returned sessions on typebot status change
* Reorganization of files and folders
2024-04-12 17:32:30 -03:00
Davidson Gomes
8caf3a0a7b Merge branch 'release/1.7.2' 2024-04-12 17:32:18 -03:00
Davidson Gomes
96ae97664c v 1.7.2 2024-04-12 17:31:58 -03:00
Davidson Gomes
901b121695 fix: reorganization of files and folders 2024-04-12 17:28:02 -03:00
Davidson Gomes
3e88c9f0c7 fix: reorganization of files and folders 2024-04-12 17:23:28 -03:00
Davidson Gomes
94f5c130bf fix: reorganization of files and folders 2024-04-12 17:22:11 -03:00
Davidson Gomes
eb04c3f113 fix: reorganization of files and folders 2024-04-12 17:15:13 -03:00
Davidson Gomes
8ece6fb998 fix: reorganization of files and folders 2024-04-12 17:13:15 -03:00
Davidson Gomes
794213b5c6 fix: quoted messages 2024-04-12 15:53:06 -03:00
Davidson Gomes
ef4a9ab66b fix: retry messages 2024-04-12 15:11:04 -03:00
Davidson Gomes
86e978faad fix: send contact.upsert via webhook 2024-04-12 12:51:13 -03:00
Davidson Gomes
d5d8f2a318 fix: send contact.upsert via webhook 2024-04-12 12:33:31 -03:00
Davidson Gomes
4ca1fad335 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-04-12 12:00:24 -03:00
Davidson Gomes
0edf6bdcb1 fix: audio encoding 2024-04-12 12:00:14 -03:00
Davidson Gomes
c2839ddd56
Merge pull request #528 from jaison-x/pr
fix(chatwoot): fix conversation read on chatwoot version 3.7
2024-04-12 11:48:37 -03:00
jaison-x
28581f88b2 fix(chatwoot): fix conversation read on chatwoot version 3.7
if contact has more than one conversation, we could get the wrong conversation.
2024-04-12 11:30:19 -03:00
Davidson Gomes
833c625d18
Merge pull request #527 from jaison-x/pr
fix(chatwoot): fix when receiving/sending messages from whatsapp desktop with ephemeral messages enabled
2024-04-12 11:22:13 -03:00
Davidson Gomes
6e2a3a410a fix: audio encoding 2024-04-12 11:20:18 -03:00
jaison-x
3e85af9589 fix(chatwoot): fix when receiving/sending messages from whatsapp desktop with ephemeral messages enabled 2024-04-12 10:59:28 -03:00
Davidson Gomes
589dec52a3 ajustes proxy 2024-04-09 16:52:22 -03:00
Davidson Gomes
a5477509bd adjusts in redis 2024-04-09 07:43:20 -03:00
Davidson Gomes
5d951a96b5 adjusts in redis 2024-04-09 07:40:45 -03:00
Davidson Gomes
76552f6ae5 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-04-09 07:31:46 -03:00
Davidson Gomes
e153515847 adjusts in redis 2024-04-09 07:31:37 -03:00
Davidson Gomes
3bc692d894 adjusts in redis 2024-04-09 07:30:15 -03:00
Davidson Gomes
73360d66cd
Merge pull request #523 from gabrielgranado/main
changed returned sessions on typebot status change
2024-04-09 06:46:24 -03:00
Davidson Gomes
04575d8051 adjusts in websocket 2024-04-09 06:44:59 -03:00
Joao Gabriel
9aba51cb45 changed returned sessions on typebot status change 2024-04-08 22:55:12 -03:00
Davidson Gomes
1172b6c871 mobile connection 2024-04-08 19:09:59 -03:00
Davidson Gomes
240f01f378 Merge tag '1.7.1' into develop
v
2024-04-03 10:45:55 -03:00
Davidson Gomes
5975117636 Merge branch 'release/1.7.1' 2024-04-03 10:45:51 -03:00
Davidson Gomes
51b285f665 v 1.7.1 2024-04-03 10:45:29 -03:00
Davidson Gomes
b3958d4735 Merge tag '1.7.1' into develop
v
2024-04-03 10:20:14 -03:00
Davidson Gomes
128119d494 Merge branch 'release/1.7.1' 2024-04-03 10:20:09 -03:00
Davidson Gomes
324dc01699 v 1.7.1 2024-04-03 10:19:59 -03:00
Davidson Gomes
f11d468e31 ajustes wa business 2024-04-03 08:14:56 -03:00
Davidson Gomes
aa5ed13752 ajustes wa business 2024-04-03 07:36:51 -03:00
Davidson Gomes
10ce7da18d changelog 2024-04-03 07:15:23 -03:00
Davidson Gomes
73bd55dfac changelog 2024-04-03 07:06:41 -03:00
Davidson Gomes
db10f81d53
Merge pull request #507 from Azzybot/patch-7
Reconhecer tipos de mensagens
2024-04-03 07:06:23 -03:00
Davidson Gomes
717aac4438
Merge pull request #506 from Azzybot/patch-6
Recurso para coletar tipo de mensagem
2024-04-03 07:06:01 -03:00
Davidson Gomes
077a464481
Merge pull request #505 from Azzybot/patch-5
Removido obrigatoriedade de descrição dos rows do sendList
2024-04-03 07:05:09 -03:00
Davidson Gomes
9bf18592fc ajustes wa oficial 2024-04-03 07:01:35 -03:00
Luis-Fernando
677e196c96
Ajuste Metodo getMessage 2024-04-02 20:43:58 -03:00
Luis-Fernando
19e6896f0d
Reconhecer tipos de mensagens
Adicionado metodos para capturar diferentes tipos de mensagens alem do tipo texto.

Incluido:
AUDIO, VIDEO, IMAGEM, DOCUMENTOS E VISUALIZAÇÃO ÚNICA, Etc...
2024-04-02 18:59:08 -03:00
Luis-Fernando
ba537baab2
Recurso para coletar tipo de mensagem
Variável {{messageType}} adicionada para ser usada dentro do fluxo e a partir disso usar condições para fluxo seguir de acordo com o tipo de mensagem recebida:

Exemplo:
if {{messageTyp}} = audioMessage
if {{messageTyp}} = videoMessage
if {{messageTyp}} = imageMessage
if {{messageTyp}} = document
if {{messageTyp}} = conversation

Entre outras...

Exemplo:

![VideoCapture_20240402-144703](https://github.com/EvolutionAPI/evolution-api/assets/136400011/60b74721-9f14-4d60-99f2-369c42cd60de)
![VideoCapture_20240402-144739](https://github.com/EvolutionAPI/evolution-api/assets/136400011/f4febd4b-c42e-4678-bfd4-f1aa076c92f5)
![VideoCapture_20240402-144724](https://github.com/EvolutionAPI/evolution-api/assets/136400011/7eb0ba56-a05a-4015-8863-76e29e0613f6)
2024-04-02 18:37:00 -03:00
Luis-Fernando
2b8b6b086b
Removido obrigatoriedade de descrição dos rows do sendList
Removida a obrigatoriedade da descrição do rows para ser algo opcional.

Isso permite os "circulos" das opções ficarem mais alinhados com os titulos sem a necessidade de adicionar espaço em branco caso não queira adicionar a descrição.

{
"number": "559999999999 (Recipient number with Country Code)",
"options": {
"delay": 1200,
"presence": "composing"
},
"listMessage": {
"title": "List Title",
"description": "List description",
"buttonText": "Click Here",
"footerText": "footer list\nhttps://examplelink.com.br",
"sections": [
{
"title": "Row tilte 01",
"rows": [
{
"title": "Title row 01",
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,",
"rowId": "rowId 001"
},
{
"title": "Title row 02",
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,",
"rowId": "rowId 002"
}
]
}
}

Depois:

{
"number": "559999999999 (Recipient number with Country Code)",
"options": {
"delay": 1200,
"presence": "composing"
},
"listMessage": {
"title": "List Title",
"description": "List description",
"buttonText": "Click Here",
"footerText": "footer list\nhttps://examplelink.com.br",
"sections": [
{
"title": "Row tilte 01",
"rows": [
{
"title": "Title row 01",
// "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,", //podendo remover por completo como foi feito no Title row 02 abaixo ou apenas comentar a descrição
"rowId": "rowId 001"
},
{
"title": "Title row 02",
"rowId": "rowId 002"
}
]
}
}
2024-04-02 17:59:54 -03:00
Davidson Gomes
cf3ec2b601 ajustes 2024-04-02 16:05:14 -03:00
Davidson Gomes
35eaa7852c Merge tag '1.7.0' into develop
v
2024-03-27 16:36:29 -03:00
Davidson Gomes
b87558d301 Merge branch 'release/1.7.0' 2024-03-27 16:36:26 -03:00
Davidson Gomes
9f1003e94e rabbitmq 2024-03-27 15:05:00 -03:00
Davidson Gomes
73c003907b rabbitmq 2024-03-27 14:54:51 -03:00
Davidson Gomes
b65d292af4 Merge tag '1.7.0' into develop
v
2024-03-27 14:26:06 -03:00
Davidson Gomes
43bdbf1018 Merge branch 'release/1.7.0' 2024-03-27 14:26:03 -03:00
Davidson Gomes
ec7986420d rabbitmq 2024-03-27 13:21:39 -03:00
Davidson Gomes
0b23153316 Merge tag '1.7.0' into develop
v
2024-03-27 12:30:15 -03:00
Davidson Gomes
ad4f5e5e65 Merge branch 'release/1.7.0' 2024-03-27 12:30:11 -03:00
Davidson Gomes
1d48532146 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-03-27 09:54:22 -03:00
Davidson Gomes
950803b2aa rabbitmq 2024-03-27 09:54:05 -03:00
Davidson Gomes
a41d92f4da
Merge pull request #479 from dv336699/develop
feat(endpoint): add setPresence endpoint
2024-03-24 06:44:15 -03:00
Davidson Gomes
70d4eb393f Merge tag '1.7.0' into develop
* Added update message endpoint
* Add translate capabilities to QRMessages in CW
* Join in Group by Invite Code
* Read messages from whatsapp in chatwoot
* Add support to use use redis in cacheservice
* Add support for labels
* Command to clearcache from chatwoot inbox
* Whatsapp Cloud API Oficial

* Proxy configuration improvements
* Correction in sending lists
* Adjust in webhook_base64
* Correction in typebot text formatting
* Correction in chatwoot text formatting and render list message
* Only use a axios request to get file mimetype if necessary
* When possible use the original file extension
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
* Remove message ids cache in chatwoot to use chatwoot's api itself
* Adjusts the quoted message, now has contextInfo in the message Raw
* Collecting responses with text or numbers in Typebot
* Added sendList endpoint to swagger documentation
* Implemented a function to synchronize message deletions on WhatsApp, automatically reflecting in Chatwoot.
* Improvement on numbers validation
* Fix polls in message sending
* Sending status message
* Message 'connection successfully' spamming
* Invalidate the conversation cache if reopen_conversation is false and the conversation was resolved
* Fix looping when deleting a message in chatwoot
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
* Correction in the sendList Function
* Implement contact upsert in messaging-history.set
* Improve proxy error handling
* Refactor fetching participants for group in WhatsApp service
* Fixed problem where the typebot final keyword did not work
* Typebot's wait now pauses the flow and composing is defined by the delay_message parameter in set typebot
* Composing over 20s now loops until finished
2024-03-19 14:10:33 -03:00
Davidson Gomes
9f162127d0 Merge branch 'release/1.7.0' 2024-03-19 14:10:15 -03:00
Davidson Gomes
4cd30dabc4 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-03-19 14:09:56 -03:00
Davidson Gomes
8f78728863 Merge tag '1.7.0' into develop
v
2024-03-19 14:09:44 -03:00
Davidson Gomes
e7c5d33d50 Merge branch 'release/1.7.0' 2024-03-19 14:09:40 -03:00
Diego Vieira
5400f31acb feat(endpoint): move setPresence endpoint to instance 2024-03-19 08:31:53 +00:00
Diego Vieira
e58f1d778e feat(endpoint): add setPresence endpoint 2024-03-19 00:58:45 +00:00
Davidson Gomes
5f5db2011e
Merge pull request #478 from jaison-x/pr2
fix: add missing example env variables
2024-03-18 15:35:59 -03:00
Davidson Gomes
aea4d89f62
Merge pull request #477 from jaison-x/pr
fix(chatwoot): fix config name
2024-03-18 15:35:13 -03:00
jaison-x
ccda17d704 fix: add missing example env variables 2024-03-18 14:41:36 -03:00
jaison-x
4ab6c438cf fix(chatwoot): fix config name 2024-03-18 14:37:50 -03:00
Davidson Gomes
219e63c226
Merge pull request #475 from jaison-x/message-select
fix: add option to select specific fields on find message repository
2024-03-17 09:32:21 -03:00
Davidson Gomes
ee1e4623a3
Merge pull request #474 from jaison-x/edit-message
feat(chatwoot): show edited messages from WhatsApp in Chatwoot
2024-03-17 09:31:42 -03:00
Davidson Gomes
5982212903
Merge pull request #473 from jaison-x/pr
feat(chatwoot): read last message on WhatsApp when a message is sent from Chatwoot
2024-03-17 09:30:04 -03:00
jaison-x
32e6ecb12d fix: add option to select specific fields on find message repository 2024-03-15 14:09:07 -03:00
jaison-x
3b774558f4 feat(chatwoot): show edited messages from WhatsApp in Chatwoot 2024-03-15 14:01:21 -03:00
jaison-x
072171da18 feat(chatwoot): read last message on WhatsApp when a message is sent from Chatwoot 2024-03-15 13:46:04 -03:00
Davidson Gomes
8292221790 Merge tag '1.7.0' into develop
v
2024-03-11 18:24:11 -03:00
Davidson Gomes
901954de33 Merge branch 'release/1.7.0' 2024-03-11 18:24:06 -03:00
Davidson Gomes
286fe03500 v 1.7.0 2024-03-11 18:23:58 -03:00
Davidson Gomes
9c4f02634b test 2024-03-08 14:12:00 -03:00
Davidson Gomes
434f39de1f test 2024-03-08 13:52:12 -03:00
Davidson Gomes
e72b543f38 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-03-08 13:48:58 -03:00
Davidson Gomes
826e818802 test 2024-03-08 13:48:38 -03:00
Davidson Gomes
cbf846d32f
Merge pull request #462 from lindenbergp/patch-1
Update variables  .env.example docker
2024-03-08 13:38:42 -03:00
Davidson Gomes
55811a39a5 ajuste connection 2024-03-08 13:35:27 -03:00
Davidson Gomes
a81f5953fc test 2024-03-08 12:58:23 -03:00
Davidson Gomes
bd09328ec2 test 2024-03-08 12:08:41 -03:00
Davidson Gomes
17ecc88f80 test 2024-03-08 12:02:13 -03:00
Davidson Gomes
7bc4c7b36e ajustes rabbitmq 2024-03-08 11:09:08 -03:00
Davidson Gomes
79189ac5d7 ajustes rabbitmq 2024-03-08 10:59:52 -03:00
Davidson Gomes
060c4e6e72 ajustes rabbitmq 2024-03-08 10:54:11 -03:00
Davidson Gomes
8f7c518487 ajustes rabbitmq 2024-03-08 10:46:43 -03:00
Davidson Gomes
12761cbfce ajustes rabbitmq 2024-03-08 10:10:40 -03:00
Davidson Gomes
2b30c273a4 ajustes rabbitmq 2024-03-08 09:47:04 -03:00
Davidson Gomes
03684a893d ajustes rabbitmq 2024-03-08 09:34:08 -03:00
Lindenberg Pinheiro
fef27111b9
Update variables .env.example docker
- Variáveis do Docker referente ao feat #395 
- Docker variables related to the feat #395
2024-03-07 20:50:50 -03:00
Davidson Gomes
b04ed66686
Merge pull request #451 from judsonjuniorr/feat/rabbit-per-events
RabbitMQ improvements
2024-03-07 20:00:04 -03:00
Davidson Gomes
f5df8bca20
Merge pull request #461 from judsonjuniorr/refactor/temp_delete_option
Refactor/temp delete option
2024-03-07 19:59:17 -03:00
Davidson Gomes
060af66c09
Merge pull request #460 from judsonjuniorr/fix/numbers-validation
Change the way numbers are validated on whatsapp
2024-03-07 19:59:05 -03:00
Judson Cairo
a6adbd61db Implemented an option to toggle temp instances deletion 2024-03-07 19:26:43 -03:00
Judson Cairo
bab58054f7 Change the way numbers are validated on whatsapp 2024-03-07 19:18:32 -03:00
Judson Cairo
e27e990cd6 Adapt to make compatible with current running services 2024-03-07 18:36:15 -03:00
Judson Cairo
196c2e0ed8 Removed logs & updated version 2024-03-07 18:28:56 -03:00
Davidson Gomes
499bd4328a
Merge pull request #457 from gabrielporfiro/main
fix: incorrect images in project
2024-03-07 17:50:49 -03:00
Gabriel Porfiro
e389047aaf
Update docker-compose.yaml 2024-03-06 18:52:01 -03:00
Gabriel Porfiro
da04ff284b
Update docker-compose.yaml 2024-03-06 18:51:36 -03:00
Judson Cairo
10b48aed97 Update RABBITMQ_MODE to global in .env.example and Dockerfile 2024-03-04 20:27:34 -03:00
Judson Cairo
ac6e9ae994 Improvements in RabbitMQ, added 2 new modes 2024-03-04 20:24:15 -03:00
Judson Cairo
7dd589fb6c Make rabbitMQ per events 2024-03-04 12:16:26 -03:00
Davidson Gomes
6b930058d1 feat wa_business: send audio message 2024-03-02 12:03:11 -03:00
Davidson Gomes
aef3495a79 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-02-28 13:48:07 -03:00
Davidson Gomes
da341a95c6 fix: writing over 20s now loops until finished 2024-02-28 13:47:54 -03:00
Davidson Gomes
bca5ec6482 fix: writing over 20s now loops until finished 2024-02-28 13:47:32 -03:00
Davidson Gomes
f0a0cb7269
Merge pull request #434 from jaison-x/pr
feat(chatwoot): add some translations on chatwoot messages
2024-02-21 12:39:53 -03:00
jaison-x
238b7618b4 feat(chatwoot): add some translations on chatwoot messages
Add typescript to transpile .json files inside src folder.
2024-02-21 12:05:41 -03:00
Davidson Gomes
4f206f67c9
Merge pull request #433 from w3nder/develop
Add blockUser functionality
2024-02-20 18:26:46 -03:00
w3nder
fa513bf784 Update blockUserSchema in validate.schema.ts 2024-02-20 17:47:38 -03:00
w3nder
a68b0b3878 Add check number and ignore Group or Broadcast 2024-02-20 17:47:32 -03:00
w3nder
249489e697 Add blockUser functionality 2024-02-20 17:05:07 -03:00
Davidson Gomes
e2c67d7dae fix: integration 2024-02-19 16:04:48 -03:00
Davidson Gomes
703bc310a7 fix: create instance baileys 2024-02-18 11:57:44 -03:00
Davidson Gomes
4caecfa680 fix: adjusts in media 2024-02-18 10:40:51 -03:00
Davidson Gomes
fd4fde2543 fix: adjusts in media 2024-02-18 10:22:33 -03:00
Davidson Gomes
763c5de03f fix: adjusts in messageType 2024-02-18 09:57:14 -03:00
Davidson Gomes
4e160a46dd fix: adjusts in messageType 2024-02-18 09:41:23 -03:00
Davidson Gomes
56aaf18663 fix: adjusts in fetch instances 2024-02-18 09:22:54 -03:00
Davidson Gomes
df841aed27 fix: adjusts in fetch instances 2024-02-18 09:06:59 -03:00
Davidson Gomes
d4372a0332 fix: adjusts in messageType 2024-02-18 08:55:14 -03:00
Davidson Gomes
1595da789d fix: adjusts in messageType 2024-02-18 08:43:40 -03:00
Davidson Gomes
7e65cb1d19 fix: find intance by number 2024-02-18 08:11:24 -03:00
Davidson Gomes
a931ee7afb fix: logout wa business instance 2024-02-18 07:52:21 -03:00
Davidson Gomes
bc6944736e fix: expose integration in fetch instance 2024-02-18 07:44:42 -03:00
Davidson Gomes
16c2e28e9c fix: remve console.log 2024-02-18 07:27:24 -03:00
Davidson Gomes
ab89ef8db3 feat: whatsapp cloud api components in template 2024-02-17 18:41:35 -03:00
Davidson Gomes
9ef14d11f8 feat: whatsapp cloud api webhooks 2024-02-17 18:02:00 -03:00
Davidson Gomes
e753990da3 feat: whatsapp cloud api 2024-02-17 17:54:23 -03:00
Davidson Gomes
f469c2e65d feat: whatsapp cloud api 2024-02-17 17:43:25 -03:00
Davidson Gomes
0525501b87 feat: whatsapp cloud api 2024-02-17 17:42:49 -03:00
Davidson Gomes
3a37fd9d32 fix: typebot's wait now pauses the flow and composing is defined by the delay_message parameter in set typebot 2024-02-16 10:31:15 -03:00
Davidson Gomes
b095c9dfb9 fix: keyword_finish dont work 2024-02-16 10:15:31 -03:00
Davidson Gomes
cd00effcfe
Merge pull request #421 from judsonjuniorr/Groups-participant-names
Refactor fetching participants for group in WhatsApp service
2024-02-16 08:29:21 -03:00
Davidson Gomes
1cd0334ccd
Merge pull request #420 from judsonjuniorr/proxy-error-handler
Improve proxy error handling
2024-02-16 08:27:49 -03:00
Davidson Gomes
3b1a16844e fix: update create jid to BR numbers 2024-02-15 18:50:08 -03:00
Judson Cairo
6995e8a451 Refactor fetching participants for group in WhatsApp service 2024-02-14 16:25:38 -03:00
Judson Cairo
1dd0f319fc Fix error handling in testProxy method 2024-02-14 16:08:32 -03:00
Judson Cairo
5ce96369cf Refactor testProxy error handling and logging 2024-02-14 16:05:52 -03:00
Judson Cairo
0791d78e28 Improve proxy error handling 2024-02-14 15:27:34 -03:00
Davidson Gomes
cecbb7c34e Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-02-13 08:33:08 -03:00
Davidson Gomes
525daff5fe
Merge pull request #419 from judsonjuniorr/improvement/contacts-saving
Implement contact upsert in messaging-history.set
2024-02-12 19:59:21 -03:00
Judson Cairo
b2c51b4b8c Implement contact upsert in messaging-history.set 2024-02-12 11:46:51 -03:00
Davidson Gomes
ffddb05ba3 gitignore .vscode 2024-02-10 16:30:54 -03:00
Davidson Gomes
4bb81b9a41
Merge pull request #411 from judsonjuniorr/feat/labels
Changed label update to chat instead of contacts
2024-02-09 09:09:25 -03:00
Judson Cairo
3df4e8d2ba Changed label update to chat instead of contacts 2024-02-08 15:38:27 -03:00
Davidson Gomes
3edef873bc
Merge pull request #409 from judsonjuniorr/feat/labels
Feat/labels
2024-02-08 14:49:01 -03:00
Davidson Gomes
c04b5cb851
Merge pull request #410 from jaison-x/clear-cache
feat(chatwoot): command to clearcache from chatwoot inbox
2024-02-08 14:47:12 -03:00
Davidson Gomes
fabd717d92
Merge pull request #408 from jaison-x/pr
fix(chatwoot): fix qrcode filename
2024-02-08 14:46:56 -03:00
jaison-x
945bcf5fad feat(chatwoot): command to clearcache from chatwoot inbox 2024-02-08 13:49:16 -03:00
jaison-x
d35d755379 feat(chatwoot): command to clearcache from chatwoot inbox 2024-02-08 13:34:50 -03:00
Judson Cairo
a2622cb38e Remove unused classes and imports from label dto 2024-02-08 13:33:53 -03:00
jaison-x
b58fd78450 fix(chatwoot): fix qrcode filename 2024-02-08 13:33:16 -03:00
Judson Cairo
e8d32066b4 Add 'add' field to the 'label' object in swagger.yaml and update event handling in whatsapp.service.ts 2024-02-08 13:31:56 -03:00
Judson Cairo
6d3779eb83 Merge branch 'develop' into feat/labels 2024-02-08 13:10:23 -03:00
Judson Cairo
c7bed04c80 Add labels property to ContactRaw model and update labels in LABELS_ASSOCIATION event 2024-02-08 13:05:06 -03:00
Davidson Gomes
b0e956cfa9
Merge pull request #406 from judsonjuniorr/contact-upsert-improvement
Extracted profile picture request from contacts.upsert function
2024-02-08 12:52:09 -03:00
Davidson Gomes
8608b7cded
Merge pull request #404 from judsonjuniorr/instance-deletion
Temp instance deletion
2024-02-08 12:51:36 -03:00
Judson Cairo
23f1b4ac03 Implementation of Whatsapp labels management 2024-02-08 09:16:24 -03:00
Judson Cairo
27900c214f Extracted profile picture request from contacts.upsert function 2024-02-07 18:42:12 -03:00
Judson Cairo
704701e251 Add list method to AuthRepository and delete temp instances in WAMonitoringService 2024-02-07 16:34:26 -03:00
Judson Cairo
34c53d352a Refactor code and remove commented out sections 2024-02-07 15:16:37 -03:00
Davidson Gomes
32026d1fd4
Merge pull request #402 from judsonjuniorr/improv-name-validation
Improvement on whatsapp number validation
2024-02-07 10:37:33 -03:00
Judson Cairo
35cdce0d52 Check multiple numbers only once in the database 2024-02-07 08:53:47 -03:00
Judson Cairo
e59098cf61 Changed whatsapp number response to 200
Nothing is being created so the code 201 is not correct
2024-02-07 08:44:54 -03:00
Davidson Gomes
d8ca480b19
Merge pull request #395 from jaison-x/import-messages-chatwoot
feat(chatwoot): import history messages to chatwoot on whatsapp connection
2024-02-05 15:26:21 -03:00
Davidson Gomes
803b123ade
Merge pull request #397 from deivisonrpg/fix/chatwoot-add-identifier-to-contact-filter
Fix(chatwoot): Include identifier to contact filter
2024-02-04 15:04:08 -03:00
Deivison Lincoln
cffb673fba Include identifier to contact filter in chatwoot 2024-02-02 18:20:24 -03:00
jaison-x
1f6535d61b fix: param for Object.entries cant be undefined 2024-02-02 16:46:29 -03:00
jaison-x
8a5ebe83a3 feat(chatwoot): import history messages to chatwoot on whatsapp connection
Messages are imported direct to chatwoot database. Media and group messages are ignored.

New env.yml variables:
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI: URI to connect direct on chatwoot database.
CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE: Indicates to use a text placeholder on media messages.

New instance setting:
sync_full_history: Indicates to request a full history sync to baileys.

New chatwoot options:
import_contacts: Indicates to import contacts.
import_messages: Indicates to import messages.
days_limit_import_messages: Number of days to limit history messages to import.
2024-02-02 15:32:34 -03:00
Davidson Gomes
cc17d61016
Merge pull request #394 from deivisonrpg/feat/chatwoot-reject-message-wpp-not-exists
Feat Chatwoot - Reject Message If is not a valid wpp number
2024-02-02 14:05:45 -03:00
Davidson Gomes
0547ff719c
Merge pull request #393 from deivisonrpg/fix/chatwoot-validate-9-digit
Fix/chatwoot validate 9 digit
2024-02-02 14:05:02 -03:00
Deivison Lincoln
c130846fe8
Change message_type
Change message_type to 'outgoing'
2024-02-02 08:57:44 -03:00
Deivison Lincoln
b3adde3a7a Feat Reject Message If is not a valid wpp number 2024-02-01 23:42:52 -03:00
Deivison Lincoln
54603002a6 Fix for brazil 9 digit 2024-02-01 22:13:19 -03:00
Deivison Lincoln
b995cdfc32 Fix for contats find payload 2024-02-01 18:53:36 -03:00
Davidson Gomes
b09546577a
Merge pull request #390 from leandrosroc/develop
feat: If contact stored with name, name added in return
2024-02-01 17:45:53 -03:00
Davidson Gomes
6e84c1dc4c
Merge pull request #392 from jaison-x/hotfix
hotfix: bug on chatwoot sdk
2024-02-01 17:44:48 -03:00
jaison-x
f41f3aaba8 Update chatwoot.service.ts
hotfix: bug on chatwoot sdk
2024-02-01 17:31:50 -03:00
Leandro Santos Rocha
8fa61e4632
Merge branch 'EvolutionAPI:develop' into develop 2024-02-01 16:20:04 -03:00
Davidson Gomes
7dacd752d3
Merge pull request #382 from yvescleuder/fix-with-nine-number-brazil
Fix with nine number brazil
2024-01-31 11:51:45 -03:00
Leandro Santos Rocha
7439d2401d
Fix error ; 2024-01-31 11:39:04 -03:00
Leandro Santos Rocha
dfb1ee0c56
Adjust to use the same jid 2024-01-31 11:37:19 -03:00
Leandro Santos Rocha
3da73b821d
Removed console.log 2024-01-31 10:55:37 -03:00
Leandro Rocha
66b82ac10a If contact stored with name, name added in return 2024-01-31 10:50:04 -03:00
Davidson Gomes
058acc5042 changelog 2024-01-29 11:43:42 -03:00
Davidson Gomes
cdf822291f lint 2024-01-29 11:35:30 -03:00
Davidson Gomes
3f9e872e1c
Merge pull request #381 from edisoncm-ti/develop
fix: collecting responses with text or numbers in Typebot
2024-01-29 11:30:22 -03:00
Davidson Gomes
94aa3067f6
Merge pull request #380 from drauber/qr_translation
Add translate capabilities to QRMessages in CW
2024-01-29 11:30:00 -03:00
Davidson Gomes
bff8064597
Merge pull request #379 from judsonjuniorr/sendList-swagger-docs
Added sendList endpoint to swagger documentation
2024-01-29 11:29:15 -03:00
Davidson Gomes
6b2d4e2585
Merge pull request #378 from moraisamilton/develop
Implemented a function to synchronize message deletions on WhatsApp, automatically reflecting in Chatwoot.
2024-01-29 11:28:59 -03:00
Davidson Gomes
56dfc2ae82
Merge pull request #377 from judsonjuniorr/validate-numbers
Improvement on numbers validation
2024-01-29 11:27:48 -03:00
Yves Clêuder Lima de Jesus
535d5ee47f fix: change method search for filter 2024-01-28 10:36:42 -03:00
Yves Clêuder Lima de Jesus
838905f3dd fix: position splice 2024-01-27 22:37:58 -03:00
Yves Clêuder Lima de Jesus
59f5208c5c fix: search number without 9 in number from brazil 2024-01-27 22:29:04 -03:00
Edison Martins
32a1a715ea
Merge branch 'EvolutionAPI:develop' into develop 2024-01-26 19:11:34 -03:00
edisoncm-ti
3755d3870e fix: collecting responses with text or numbers in Typebot 2024-01-26 19:10:20 -03:00
Douglas Rauber at Nitro
0edc8a9284 Add translate capabilities to QRMessages in CW 2024-01-25 16:19:08 -03:00
Amilton Morais
5449d63602 Merge branch 'develop' of https://github.com/moraisamilton/evolution-api into develop 2024-01-24 13:46:02 -03:00
Amilton Morais
dfa72fd6af Update start.sh 2024-01-24 13:43:19 -03:00
Amilton Morais
0e50da324b Implemented a function to synchronize message deletions on WhatsApp, automatically reflecting in Chatwoot
A new variable has been created, and a function has been implemented to manage the deletion of messages on WhatsApp. Now, when deleting a message for everyone on WhatsApp, the same action will be automatically performed on Chatwoot, ensuring consistency across platforms
2024-01-24 13:38:29 -03:00
Judson Junior
679f8118f6 Added sendList endpoint to swagger documentation 2024-01-23 23:59:12 -03:00
Amilton Morais
804d177782 Udate "@whiskeysockets/baileys": "6.6.0" and models
The message.model.ts class was updated to version 6.6.0 of baileys. 'unknown','desktop' was included to avoid errors using version 6.6.0 of baileys
2024-01-23 19:34:36 -03:00
Judson Junior
eb96c9fece Added new validation on the 9 digit
This is to prevent returning another jid when only one digit is different and not the 9 digit
2024-01-23 18:37:31 -03:00
Judson Junior
ed6c50621c Improved the method of numbers validation 2024-01-23 18:16:15 -03:00
Davidson Gomes
7f74de07ed
Merge pull request #375 from judsonjuniorr/poll-sending
Fix polls in message sending
2024-01-22 13:44:49 -03:00
Judson Junior
9e5bf93580 Fix polls in message sending 2024-01-22 13:39:11 -03:00
Davidson Gomes
9d685da12d
Merge pull request #374 from judsonjuniorr/proxy-improvements
Proxy improvements
2024-01-21 18:16:15 -03:00
Davidson Gomes
6bb40eb502
Merge pull request #373 from leandrosroc/develop
Join in Group by Invite Code
2024-01-21 18:14:40 -03:00
Davidson Gomes
1ceee572cf
Merge pull request #372 from edisoncm-ti/develop
Typebot: Remove quebra de linha no index final do array | Obtem a resposta de um sendList (Lista)
2024-01-21 18:13:26 -03:00
Davidson Gomes
391ffea4ab
Merge pull request #371 from judsonjuniorr/develop
Add number parameter to OnWhatsAppDto constructor
2024-01-21 18:12:31 -03:00
Judson Junior
5292e569d9 Remove unused dependencies and refactor proxy handling
In some tests made on the testProxy function, the `new ProxyAgent()` was not working, even adding it the IP result was the same.

I've change it to the `new HttpsProxyAgent()` and it worked.

Refactored the proxy agent to center the same function/creation the same where it is used
2024-01-21 13:54:42 -03:00
Judson Junior
82e111f1be Fix proxy handling in WAStartupService preventing instance to be created 2024-01-21 13:01:35 -03:00
Judson Junior
1e9b3a1e42 Update proxy controller to use a different IP lookup service 2024-01-21 13:01:06 -03:00
Judson Junior
35520d85a2 Add https-proxy-agent dependency and handle NotFoundException in ProxyController 2024-01-21 13:00:23 -03:00
Leandro Rocha
e19e37eef4 Join in Group by Invite Code 2024-01-21 02:13:24 -03:00
edisoncm-ti
814795f566 Merge branch 'develop' of https://github.com/edisoncm-ti/evolution-api into develop 2024-01-20 18:42:40 -03:00
edisoncm-ti
1a633dcf10 feat: obter a resposta de um sendList (Lista) e prosseguir o fluxo Typebot 2024-01-20 18:31:26 -03:00
edisoncm-ti
c9b0e66641 feat: Obter a resposta de um sendList (Lista) e prosseguir o fluxo Typebot 2024-01-20 18:28:00 -03:00
Judson Junior
440ff2f3ea Add number parameter to OnWhatsAppDto constructor 2024-01-20 11:44:10 -03:00
edisoncm-ti
96be63f50b fix: remove quebra de linha no index final do array quando usado variavel no Typebot 2024-01-20 11:09:05 -03:00
Davidson Gomes
69a323691f
Merge pull request #370 from leandrosroc/main
fix: Sending status message
2024-01-19 16:38:59 -03:00
Leandro Santos Rocha
4357fcf7ef
Adjusted so that when it is "list", it sends correctly 2024-01-18 21:30:49 -03:00
Leandro Rocha
5f79513617 fix: Sending status message 2024-01-18 20:25:58 -03:00
Davidson Gomes
ba3ccbbc9a
Merge pull request #369 from jaison-x/pr
fix: message 'connection successfully' spamming
2024-01-18 11:55:07 -03:00
jaison-x
f182436673 fix: message 'connection successfully' spamming 2024-01-17 19:56:26 -03:00
Davidson Gomes
793b907fe6
Merge pull request #363 from jaison-x/read_messages_chatwoot
feat(chatwoot): read messages from whatsapp in chatwoot
2024-01-16 09:39:17 -03:00
jaison-x
c75dfcd499 feat(chatwoot): read messages from whatsapp in chatwoot
It works only with messages read from whatsapp to chatwoot.
2024-01-15 20:40:29 -03:00
Davidson Gomes
29a48f7914
Merge pull request #360 from jaison-x/cache
feat(cacheservice): add support to use use redis in cacheservice
2024-01-15 10:21:35 -03:00
jaison-x
095a8aa9dd fix: process.env can be null 2024-01-12 16:15:44 -03:00
jaison-x
2d8b5f04e9 feat(cacheservice): add suport to use use redis in cacheservice 2024-01-12 16:04:55 -03:00
Davidson Gomes
ba9f97bc3e
Merge pull request #355 from AlanMartines/main
Fix: Corrects the generation of the hash variable name
2024-01-11 12:57:17 -03:00
Davidson Gomes
ed51f44ee8
Merge pull request #351 from jaison-x/cache-chatwoot
fix(chatwoot): invalidate the conversation cache if reopen_conversation is false and the conversation was resolved
2024-01-11 12:56:37 -03:00
Alan Martines
933d787108 Fix: Corrects the generation of the hash variable name, error when generating with white spaces and special characters. 2024-01-10 09:27:25 -04:00
jaison-x
0bc12733a3 fix(chatwoot): invalidate the conversation cache if reopen_conversation is false and the conversation was resolved 2024-01-08 22:20:16 -03:00
Davidson Gomes
8cfd9c44ab Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-01-07 19:11:07 -03:00
Davidson Gomes
3ddff84be0 test: docker with platform arm 2024-01-07 19:10:56 -03:00
Davidson Gomes
afb5361a1b
Merge pull request #342 from jaison-x/cache-chatwoot
perf(chatwoot): create cache for the most used/expensive functions in chatwoot
2024-01-04 17:05:39 -03:00
jaison-x
f376047632 perf(chatwoot): create cache for the most used/expensive functions in chatwoot 2024-01-03 18:42:54 -03:00
Davidson Gomes
7373eea842 feat: Added update message endpoint 2024-01-03 10:18:20 -03:00
Davidson Gomes
a446df4620 fix: Adjusts the quoted message, now has contextInfo in the message Raw 2024-01-02 14:04:54 -03:00
Davidson Gomes
306c6dd21d fix: Adjusts the quoted message, now has contextInfo in the message Raw 2024-01-02 13:49:31 -03:00
Davidson Gomes
380ba8860c Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2024-01-02 12:03:22 -03:00
Davidson Gomes
6c8c8ddcfc version: baileys 6.5.0 2024-01-02 12:03:11 -03:00
Davidson Gomes
0c09c5e140
Merge pull request #338 from jaison-x/pr
fix(chatwoot): fix looping when deleting a message in chatwoot
2024-01-01 21:47:35 -03:00
jaison-x
b761fba8cb fix(chatwoot): fix looping when deleting a message in chatwoot 2024-01-01 18:11:25 -03:00
Davidson Gomes
dfceda3942 version: 1.6.2 2023-12-29 19:15:51 -03:00
Davidson Gomes
85d1825236 version: 1.6.2 2023-12-29 19:12:29 -03:00
Davidson Gomes
8f8c7e26c7 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-29 19:11:28 -03:00
Davidson Gomes
181768d91f
Merge pull request #336 from jaison-x/adjust-filename-chatwoot
perf(chatwoot): only use a axios request to get file mimetype if necessary
2023-12-29 19:11:22 -03:00
Davidson Gomes
2dcd4d8fd3 fix: Correction in chatwoot text formatting and render list message 2023-12-29 19:10:59 -03:00
jaison-x
d909550134 fix(chatwoot): add file extension to var fileName 2023-12-29 18:42:07 -03:00
jaison-x
c564ec41e2 perf(chatwoot): Only use a axios request to get mimetype file if necessary 2023-12-29 18:15:05 -03:00
Davidson Gomes
af94a0e174
Merge pull request #334 from jaison-x/adjust-filename-chatwoot
fix(chatwoot): when possible use the original file extension
2023-12-29 17:10:43 -03:00
jaison-x
fcd8815fca fix(chatwoot): when possible use the original file extension
In some cases mimeTypes.extension() return false to csv and other file types
2023-12-29 14:52:16 -03:00
Davidson Gomes
5bd3f28117
Merge pull request #332 from jaison-x/adjust-filename-chatwoot
fix(chatwoot): when receiving a file from whatsapp, use the original filename in chatwoot if possible
2023-12-29 10:36:17 -03:00
Davidson Gomes
384bde333e
Merge pull request #331 from jaison-x/pr
refactor(chatwoot): remove message ids cache in chatwoot to use chatwoot's api itself
2023-12-29 10:36:01 -03:00
Davidson Gomes
d06ec604b9 version: 1.6.2 2023-12-29 10:34:23 -03:00
Davidson Gomes
d8ce23f2a0 fix: exchange rabbitmq 2023-12-29 09:46:59 -03:00
Davidson Gomes
3ccb983377 fix: chatwoot service 2023-12-28 18:24:29 -03:00
Davidson Gomes
19fb9fcd31 fix: webhook 2023-12-28 18:20:38 -03:00
Davidson Gomes
5f4a1b96ce fix: correction in typebot text formatting 2023-12-28 18:08:30 -03:00
Davidson Gomes
6983f385fc fix: correction in typebot text formatting 2023-12-28 18:07:24 -03:00
Davidson Gomes
2aadd1cac5 fix: Adjust in webhook_base64 2023-12-28 17:32:19 -03:00
jaison-x
bfa7d429bd refactor(chatwoot): remove message ids cache in chatwoot to use chatwoot's api itself.
Remove use of disc cache to optimize performance.

BREAKING CHANGE: to make this, we need to use the param `source_id` from message in chatwoot.
This param is only available from api in chatwoot version => 3.4.0.
2023-12-28 14:43:50 -03:00
Davidson Gomes
3238150b92 fix: Proxy configuration improvements 2023-12-28 10:36:23 -03:00
Davidson Gomes
3603571967 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-28 10:36:01 -03:00
Davidson Gomes
7c2a8c0abb fix: Proxy configuration improvements 2023-12-28 10:35:41 -03:00
jaison-x
8b5f73badd fix: added support to use source_id to check chatwoot's webhook needs to be ignored.
With this, messageCache is used to support Chatwoot version <= 3.3.1.

After this version we can remove use of message cache and use only the source_id field to check chatwoot's webhook needs to be ignored. It's have much better performance.
2023-12-27 13:56:32 -03:00
Davidson Gomes
ff57fd3d23
Merge pull request #322 from w3nder/develop
fix: Correção na Função sendList
2023-12-27 10:09:14 -03:00
jaison-x
49aa1ea17c fix: when receiving a file from whatsapp, use the original filename in chatwoot when possible 2023-12-26 01:21:05 -03:00
jaison-x
7430897085 fix: when receiving a file from whatsapp, use the original filename in chatwoot when possible 2023-12-25 23:58:07 -03:00
jaison-x
82894a1c4f refactor: change the message ids cache in chatwoot to use a in memory cache
Remove use of disc cache for optimize performance.
To make this, we need change to use only one instance of ChatwootService in entire application.
2023-12-25 22:29:03 -03:00
w3nder
3bb4217a45 fix: Correção na Função sendList
Ao disparar uma lista de mensagens, agora enviamos elas com o tipo 'PRODUCT_LIST' e realizamos a correção necessária na função patchMessageBeforeSending para o tipo 'SINGLE_SELECT'
2023-12-24 14:32:05 -03:00
Davidson Gomes
dfc8330035 Merge tag '1.6.1' into develop
* Fixed Lid Messages
* Fixed sending variables to typebot
* Fixed sending variables from typebot
* Correction sending s3/minio media to chatwoot and typebot
* Fixed the problem with typebot closing at the end of the flow, now this is optional with the TYPEBOT_KEEP_OPEN variable
* Fixed chatwoot Bold, Italic and Underline formatting using Regex
* Added the sign_delimiter property to the Chatwoot configuration, allowing you to set a different delimiter for the signature. Default when not defined \n
* Include instance Id field in the instance configuration
* Fixed the pairing code
* Adjusts in typebot
* Fix the problem when disconnecting the instance and connecting again using mongodb
* Options to disable docs and manager
* When deleting a message in whatsapp, delete the message in chatwoot too
2023-12-22 11:44:21 -03:00
Davidson Gomes
45e03d87c7 Merge branch 'release/1.6.1' 2023-12-22 11:44:12 -03:00
Davidson Gomes
3e358e5d26 version: 1.6.1 2023-12-22 11:43:58 -03:00
Davidson Gomes
dc5dae04eb fix: when deleting a message in whatsapp, delete the message in chatwoot too 2023-12-22 11:43:10 -03:00
Davidson Gomes
9128b1f47d fix: when deleting a message in whatsapp, delete the message in chatwoot too 2023-12-22 11:43:03 -03:00
Davidson Gomes
16a8226ba7
Merge pull request #317 from jaison-x/pr
fix: when deleting a message in whatsapp, delete the message in chatwoot too
2023-12-21 16:37:01 -03:00
jaison-x
9ecaf3199d Merge branch 'pr' of https://github.com/jaison-x/evolution-api into pr 2023-12-21 07:42:37 -03:00
jaison-x
a44cd0373e fix: simple adjust in key object 2023-12-21 07:42:33 -03:00
jaison-x
2c0b629302
Update whatsapp.service.ts 2023-12-21 00:23:33 -03:00
jaison-x
89a37a1771 fix: show message Connection successfully established after a sucessfull connection on chatwoot 2023-12-20 18:11:41 -03:00
jaison-x
cadc038966 Merge remote-tracking branch 'upstream/develop' into pr 2023-12-20 17:54:52 -03:00
jaison-x
07e8449379 fix: when deleting a message in whatsapp, delete the message in chatwoot too
The message model schema was changed. Old format in message model was field chatwootMessageId. Now we have a document chatwoot with new properties.

I cant find a simple way to create a migration function up then the old field was no migrate to new format.
2023-12-20 17:53:37 -03:00
Davidson Gomes
71e908ad1a
Merge pull request #312 from stgcompany/develop
Exclude all .env files on .gitignore and renamed one to .env.example
2023-12-20 12:22:03 -03:00
Davidson Gomes
035c85b775
Merge pull request #313 from gabrielpastori1/issue-template
Add issue templates
2023-12-20 12:21:06 -03:00
Gabriel Pastori
a87b753151 Update issue templates 2023-12-20 12:13:24 -03:00
Eduardo Chaves
edaa4aff7e Add any .env file to .gitignore 2023-12-20 10:31:14 -03:00
Eduardo Chaves
be02610349 Renamed .env to .env.example 2023-12-20 10:29:32 -03:00
Davidson Gomes
1f65731165 fix: Add options to disable docs and manager 2023-12-20 10:03:44 -03:00
Davidson Gomes
fb61fb7849
Merge pull request #310 from gabrielpastori1/disable-docs-manager
Add options to disable docs and manager
2023-12-20 10:02:46 -03:00
Davidson Gomes
060a945aea fix: Fix the problem when disconnecting the instance and connecting again using mongodb 2023-12-20 09:56:53 -03:00
Davidson Gomes
2797250f34 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-20 09:56:32 -03:00
Davidson Gomes
97b3f9b3c7 fix: Fix the problem when disconnecting the instance and connecting again using mongodb 2023-12-20 09:55:51 -03:00
Gabriel Pastori
9363301d2a Add DISABLE_DOCS and DISABLE_MANAGER 2023-12-19 21:18:40 -03:00
Davidson Gomes
d93a826e28
Merge pull request #309 from jaison-x/pr
fix: message can be undefined
2023-12-19 18:59:59 -03:00
jaison-x
244fe0835e Update chatwoot.service.ts
fix: message can be undefined
2023-12-19 18:49:31 -03:00
Davidson Gomes
5f1a5d6589
Merge pull request #308 from PurpShell/fix/message-retry
Fix: message retry mechanism
2023-12-19 17:34:39 -03:00
Rajeh Taher
4e27c22292
fix: message retry 2023-12-19 22:28:50 +02:00
Davidson Gomes
53ee270096
Merge pull request #307 from gabrielpastori1/chatwoot-format
Chatwoot Agent Name
2023-12-19 17:15:32 -03:00
Gabriel Pastori
a00ad20c08 chatwoot agent available_name 2023-12-19 16:41:52 -03:00
Davidson Gomes
e8764dd1c6 fix: Fix the problem when disconnecting the instance and connecting again using mongodb 2023-12-19 14:55:16 -03:00
Davidson Gomes
a869d38499 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-19 14:27:47 -03:00
Davidson Gomes
7bf7c96587
Merge pull request #301 from drauber/addLogInfo
Add connected number and instance name to connected log
2023-12-19 14:27:41 -03:00
Davidson Gomes
72b857a92f
Merge pull request #299 from gabrielpastori1/chatwoot-format
Chatwoot format
2023-12-19 14:27:05 -03:00
Douglas Rauber at Nitro
380d6a43a5 Add connected number and instance name to connected log 2023-12-19 08:02:29 -03:00
Gabriel Pastori
076f2b492e fix: chatwoot media process 2023-12-18 21:23:56 -03:00
Davidson Gomes
547f981c47 fix: adjusts in typebot 2023-12-18 16:46:04 -03:00
Davidson Gomes
8bfc62a3b2 fix: adjusts in typebot 2023-12-18 16:27:37 -03:00
Davidson Gomes
d39776a314 fix: fixed the pairing code 2023-12-18 15:27:22 -03:00
Davidson Gomes
35641d0543 fix: fixed the pairing code 2023-12-18 15:24:19 -03:00
Davidson Gomes
038cd6f149
Merge pull request #293 from gabrielpastori1/chatwoot-format
Chatwoot format
2023-12-18 12:15:00 -03:00
Davidson Gomes
38978dd447 test: adjusts baileys lids 2023-12-18 12:07:02 -03:00
Gabriel Pastori
fb24b7eaa7
Merge branch 'develop' into chatwoot-format 2023-12-17 13:30:54 -03:00
Gabriel Pastori
b4ce45bc4b Add new env and fix message formatting in Chatwoot to changelog 2023-12-17 13:25:03 -03:00
Gabriel Pastori
8d04198309 fix: monospace and bold 2023-12-17 13:24:43 -03:00
Davidson Gomes
da796347c4 fix: include instance Id field in the instance configuration 2023-12-17 09:37:18 -03:00
Davidson Gomes
2d6a29664a fix: include instance Id field in the instance configuration 2023-12-17 07:59:24 -03:00
Davidson Gomes
4ba5cfceaf fix: include instance Id field in the instance configuration 2023-12-17 07:50:17 -03:00
Davidson Gomes
7cc324e1c0 fix: include instance Id field in the instance configuration 2023-12-17 07:04:33 -03:00
Davidson Gomes
cf89601269 fix: include instance Id field in the instance configuration 2023-12-17 06:59:05 -03:00
Davidson Gomes
c07e23bf8d
Merge pull request #290 from gabrielpastori1/chatwoot-format
Chatwoot format
2023-12-17 06:32:37 -03:00
Gabriel Pastori
5aa89d85f3 fix: remove comments 2023-12-16 18:39:46 -03:00
Gabriel Pastori
4ed1edf53d chatwoot_sign_delimiter 2023-12-16 17:23:39 -03:00
Gabriel Pastori
1be1326b52 Refactor message formatting in ChatwootService (Bold, italic, etc) 2023-12-16 15:58:01 -03:00
Davidson Gomes
42ae7d1568
Merge pull request #286 from gomessguii/feature/dockerfile-optimization
Dockerfile modified to use multi-stage build
2023-12-15 14:51:49 -03:00
Guilherme Oliveira
b781c83545 Dockerfile modified to use multi-stage build 2023-12-15 14:46:31 -03:00
Davidson Gomes
e48cea18e7
Merge pull request #283 from gabrielpastori1/typeboot-keep-open
simple add keep open
2023-12-15 13:53:06 -03:00
Gabriel Pastori
ff82987144 simple add keep open 2023-12-15 12:39:07 -03:00
Davidson Gomes
f612a45550 fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 17:20:37 -03:00
Davidson Gomes
182dce4840 fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 16:42:03 -03:00
Davidson Gomes
4e41e072d6 fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 16:13:15 -03:00
Davidson Gomes
a369c16db8 fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 15:59:06 -03:00
Davidson Gomes
1fc820787a fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 15:57:34 -03:00
Davidson Gomes
d3a83ba89e fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 15:35:17 -03:00
Davidson Gomes
20fb66e2f7 fix: correction sending s3/minio media to chatwoot and typebot 2023-12-14 11:50:05 -03:00
Davidson Gomes
a44646161b fix: variables in typebot 2023-12-14 08:35:45 -03:00
Davidson Gomes
87027ea2d0 update: manager 2023-12-12 18:16:02 -03:00
Davidson Gomes
c9757cbb4b fix: fixed lids messages 2023-12-12 17:45:12 -03:00
Davidson Gomes
9a8f4aefe0 Merge tag '1.6.0' into develop
* Added AWS SQS Integration
* Added support for new typebot API
* Added endpoint sendPresence
* New Instance Manager
* Added auto_create to the chatwoot set to create the inbox automatically or not
* Added reply, delete and message reaction in chatwoot v3.3.1

* Adjusts in proxy
* Adjusts in start session for Typebot
* Added mimetype field when sending media
* Ajusts in validations to messages.upsert
* Fixed messages not received: error handling when updating contact in chatwoot
* Fix workaround to manage param data as an array in mongodb
* Removed await from webhook when sending a message
* Update typebot.service.ts - element.underline change ~ for *
* Adjusts in proxy
* Removed api restart on receiving an error
* Fixes in mongodb and chatwoot
* Adjusted return from queries in mongodb
* Added restart instance when update profile picture
* Correction of chatwoot functioning with admin flows
* Fixed problem that did not generate qrcode with the chatwoot_conversation_pending option enabled
* Fixed issue where CSAT opened a new ticket when reopen_conversation was disabled
* Fixed issue sending contact to Chatwoot via iOS

- Chatwoot: v3.3.1
- Typebot: v2.20.0
2023-12-12 17:44:42 -03:00
Davidson Gomes
3545b80050 Merge branch 'release/1.6.0' 2023-12-12 17:44:24 -03:00
Davidson Gomes
379855714e version: 1.6.0 2023-12-12 17:44:00 -03:00
Davidson Gomes
ff06cd7643 feat: Added support for new typebot API 2023-12-12 16:55:46 -03:00
Davidson Gomes
ade3952016 fix: Fixed issue sending contact to Chatwoot via iOS 2023-12-12 16:28:01 -03:00
Davidson Gomes
f246516a6e fix: fixed issue where CSAT opened a new ticket when reopen_conversation was disabled 2023-12-12 16:08:09 -03:00
Davidson Gomes
c296bf4178 fix: Fixed problem that did not generate qrcode with the chatwoot_conversation_pending option enabled 2023-12-12 15:46:10 -03:00
Davidson Gomes
1568554a1c feat: added reply, delete and message reaction in chatwoot v3.3.1 2023-12-12 15:24:54 -03:00
Davidson Gomes
ae66be197e feat: added reply, delete and message reaction in chatwoot v3.3.1 2023-12-12 15:16:09 -03:00
Davidson Gomes
3e904aa160 fix: correction of chatwoot functioning with admin flows 2023-12-12 13:56:47 -03:00
Davidson Gomes
64c1440c46 fix: correction of chatwoot functioning with admin flows 2023-12-12 13:56:41 -03:00
Davidson Gomes
f069a41390 fix: added restart instance when update profile pricture 2023-12-11 18:17:18 -03:00
Davidson Gomes
d4a33e2290 fix: added restart instance when update profile pricture 2023-12-11 18:16:11 -03:00
Davidson Gomes
7ee5bcecff fix: added restart instance when update profile pricture 2023-12-11 18:15:24 -03:00
Davidson Gomes
48f6ee8846 feat: added auto_create to the chatwoot set to create the inbox automatically or not 2023-12-11 17:32:19 -03:00
Davidson Gomes
7a24f52782 feat: added auto_create to the chatwoot set to create the inbox automatically or not 2023-12-11 17:32:07 -03:00
Davidson Gomes
324d46120b feat: new manager 2023-12-11 15:31:43 -03:00
Davidson Gomes
87baec5ff8
Merge pull request #250 from gabrielpastori1/manager
Add Manager
2023-12-11 15:27:43 -03:00
Gabriel Pastori
b2e144f35c add manager 2023-12-11 15:06:42 -03:00
Davidson Gomes
87a8e25662
Merge pull request #249 from gabrielpastori1/typebot-auto-create-session
fix: only create if is paused
2023-12-11 12:57:51 -03:00
Gabriel Pastori
8e88f00fb2 fix: only create if is paused 2023-12-11 12:42:09 -03:00
Davidson Gomes
d14505d59a
Merge pull request #248 from gabrielpastori1/fix-chatwoot-find
Fix chatwoot find
2023-12-11 12:32:19 -03:00
Davidson Gomes
1e6d4347fa Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-11 12:09:08 -03:00
Davidson Gomes
b8d9a8c072 fix: adjusted return from queries in mongodb 2023-12-11 12:08:58 -03:00
Gabriel Pastori
fd15ae5e8c Fix condition to check for empty result object 2023-12-11 12:00:33 -03:00
Davidson Gomes
fb6377414b
Merge pull request #237 from gabrielpastori1/add-send-presence
Add sendPresence
2023-12-11 10:47:26 -03:00
Davidson Gomes
9a5dbe055e fix: adjusts in connection 2023-12-08 18:44:52 -03:00
Gabriel Pastori
42dd280aca change sendPresence from sendMessage to chat 2023-12-08 18:40:48 -03:00
Davidson Gomes
41b2946cdc Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-12-06 15:22:08 -03:00
Davidson Gomes
a90f0f2c59 Fixes in mongodb and chatwoot 2023-12-06 15:21:50 -03:00
Gabriel Pastori
4222c0e53b Fix logger message in sendPresence route 2023-12-06 00:32:27 -03:00
Gabriel Pastori
ee0f0f0be0 add send presence router 2023-12-06 00:31:35 -03:00
Davidson Gomes
f8d874453c
Merge pull request #233 from gabrielpastori1/typebot-auto-create-session
Add session creation for typebot service
2023-12-05 18:49:31 -03:00
Gabriel Pastori
aa891489f0 Add session creation for typebot service 2023-12-03 21:00:26 -03:00
Davidson Gomes
4c69b059d4 proxy 2023-12-01 21:24:38 -03:00
Davidson Gomes
359bd9f762 fix: adjusts in proxy 2023-12-01 20:09:22 -03:00
Davidson Gomes
2de0b61726 fix: adjusts in proxy 2023-12-01 20:09:19 -03:00
Davidson Gomes
d75163aa57 test: adjusts wasocket 2023-12-01 15:04:57 -03:00
Davidson Gomes
e49f30641e test: adjusts wasocket 2023-12-01 14:30:20 -03:00
Davidson Gomes
1631c2c342 test: adjusts wasocket 2023-12-01 09:42:56 -03:00
Davidson Gomes
cf7de369b2 test: adjusts wasocket 2023-12-01 08:22:40 -03:00
Davidson Gomes
78c03d8f2f test: adjusts wasocket 2023-12-01 08:21:36 -03:00
Davidson Gomes
876320b849 feat: added compatibility with typebot v2 2023-11-30 17:13:05 -03:00
Davidson Gomes
a1d13f8ff3 changelog 2023-11-30 07:12:14 -03:00
Davidson Gomes
3c19bdfaa9 fix: Removed await from webhook when sending a message 2023-11-30 07:09:11 -03:00
Davidson Gomes
4fa895086e fix: adjusts in validation to messages.upsert 2023-11-30 07:02:25 -03:00
Davidson Gomes
9945d8debb Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-11-30 07:01:48 -03:00
Davidson Gomes
4362de2198 fix: adjusts in validation to messages.upsert 2023-11-30 07:01:26 -03:00
Davidson Gomes
a5c5879e4f fix: adjusts in validation to messages.upsert 2023-11-30 07:01:08 -03:00
Davidson Gomes
1a57f4f33d
Merge pull request #215 from suissa/patch-3
Update typebot.service.ts - element.underline change ~ for *
2023-11-29 08:47:52 -03:00
Davidson Gomes
a99e173168
Merge pull request #224 from jaison-x/pr
fix: workaround to manage param data as an array in mongodb
2023-11-29 08:46:12 -03:00
Davidson Gomes
e02a28f61e
Merge pull request #228 from raimartinsb/develop
fix messages not received: error handling when updating contact
2023-11-29 08:45:24 -03:00
raimartinsb
26d3ff97ce fix messages not received: error handling when updating contact 2023-11-28 11:10:29 -03:00
Davidson Gomes
57fb3c9785 fix: fixed lids messages 2023-11-27 19:58:23 -03:00
Davidson Gomes
edeb970a82 fix: fixed lids messages 2023-11-27 19:57:59 -03:00
jaison-x
e17baddf01 fix: workaround to manage param data as an array in mongodb
When saving data from a group session (sender-key-xxxxx@g.us::xxxxx::xx) we receive the data param as an array.
In mongodb we can't save an array as a root document. Bacause this, in this case we save the array in a property called content_array.
2023-11-24 18:59:19 -03:00
Davidson Gomes
a277d36696 feat: sqs 2023-11-20 17:53:29 -03:00
Davidson Gomes
6c9e86e17a feat: sqs 2023-11-20 17:52:36 -03:00
Davidson Gomes
e75ef21eb6
Merge pull request #216 from craines/main
fix: Removed await from webhook when sending a message
2023-11-18 16:38:32 -03:00
craines
04e5443b82 fix: send reaction 2023-11-15 21:52:56 -03:00
craines
8b4cdf3b9b fix: Removed await from webhook when sending a message 2023-11-14 16:47:25 -03:00
Jean Carlo Nascimento
37f1620f7c
Update typebot.service.ts - element.underline change ~ for *
There's no underline in WhatsApp ~ use strikethrough instead, I switched to * bold.
2023-11-12 19:11:47 -03:00
Davidson Gomes
b0a0e805cf
Merge pull request #187 from jaison-x/deleting-instances
Deleting instances
2023-11-09 14:41:43 -03:00
Davidson Gomes
c619e253a2
Merge pull request #198 from gabrielpastori1/fix-typebot-error-handle
Handle erros in Typebot
2023-11-09 14:32:30 -03:00
Davidson Gomes
2bd111f1e2
Merge pull request #197 from vitorogen/develop
Handle optional chaining for 'settings.msg_call', this change prevent…
2023-11-05 19:44:27 -03:00
Davidson Gomes
40174b50eb
Merge pull request #190 from w3nder/develop
fix: size of group participants
2023-11-05 19:43:45 -03:00
Davidson Gomes
e0fe28717f
Merge pull request #186 from jaison-x/adjust-mongo-deletion
-> Adjusting function cleaningStoreFiles to remove itens from missing…
2023-11-05 19:42:24 -03:00
Gabriel Pastori
ac5fc22043 try catch entire sendTypebot 2023-10-30 18:05:18 -03:00
Gabriel Pastori
e30f196dad remove duplicate 2023-10-29 13:22:41 -03:00
Gabriel Pastori
9e4e1ce8ec Merge branch 'fix-typebot-error-handle' of https://github.com/gabrielpastori1/ticketme-evolution-api into fix-typebot-error-handle 2023-10-29 13:01:37 -03:00
Gabriel Pastori
f710898844 fix: in error catch in createNewSession 2023-10-29 12:59:29 -03:00
Gabriel Pastori
94633484ca
Merge branch 'develop' into fix-typebot-error-handle 2023-10-29 12:54:05 -03:00
Gabriel Pastori
0817c2589f expand try catch for all function 2023-10-29 12:49:26 -03:00
Gabriel Pastori
8a99386b33 handle erros 2023-10-28 21:21:12 -03:00
Vitor
52d6a563d6 Handle optional chaining for 'settings.msg_call', this change prevents 'TypeError: Cannot read properties of undefined' errors when 'msg_call' is undefined. 2023-10-27 22:49:57 -03:00
Davidson Gomes
d0a5ae1da4 fix: Removed senderKeyDistributionMessage 2023-10-26 18:01:17 -03:00
Davidson Gomes
783c00a1d9 fix: Added mimetype field when sending media 2023-10-25 10:29:24 -03:00
Davidson Gomes
bc70ec8b07 fix: start session 2023-10-25 08:19:44 -03:00
Davidson Gomes
50e1efe5d7 fix: start session 2023-10-25 07:00:58 -03:00
Davidson Gomes
d8629e53f1 fix: start session 2023-10-24 13:16:35 -03:00
Davidson Gomes
cc9df1dabb fix: start session 2023-10-24 12:06:20 -03:00
Davidson Gomes
cd6cb8182e fix: start session 2023-10-24 12:05:58 -03:00
Wender Teixeira
5b0e90e5b9
Update whatsapp.service.ts 2023-10-19 22:41:16 -03:00
jaison-x
3c3bbc84b3 -> When deleting a instance in connecting state, the event remove.instance was not triggered; 2023-10-18 19:52:33 -03:00
Jaison
23615cff4f -> Adjusting function cleaningStoreFiles to remove itens from missing mongo collections;
-> AuthModel was using a wrong filter;
2023-10-18 18:57:11 -03:00
Davidson Gomes
daadc6cb68 fix: adjusts in proxy 2023-10-18 18:09:26 -03:00
Davidson Gomes
e157a2a36b fix: adjusts in proxy 2023-10-18 18:09:01 -03:00
Davidson Gomes
d8d7debfee fix: lid messages 2023-10-11 17:27:49 -03:00
Davidson Gomes
a82b206fe6 test: messages.upsert 2023-10-10 10:00:11 -03:00
Davidson Gomes
a4416214c8 Merge tag '1.5.4' into develop
* Baileys logger typing issue resolved
* Solved problem with duplicate messages in chatwoot
2023-10-09 20:43:50 -03:00
Davidson Gomes
8fe75cd210 Merge branch 'release/1.5.4' 2023-10-09 20:43:40 -03:00
Davidson Gomes
303effebbc version: 1.5.4 2023-10-09 20:43:30 -03:00
Davidson Gomes
f32a34190d fix: adjusts logger 2023-10-09 20:17:01 -03:00
Davidson Gomes
8588ef1d8a fix: adjusts logger 2023-10-09 20:15:53 -03:00
Davidson Gomes
51ec4821f3 fix: adjusts logger 2023-10-09 20:14:50 -03:00
Davidson Gomes
957033a7bb ajustes 2023-10-09 19:57:26 -03:00
Davidson Gomes
62c74deac3 fix: Solved problem with duplicate messages in chatwoot 2023-10-09 18:00:14 -03:00
Davidson Gomes
29fd448998 Merge tag '1.5.3' into develop
* Swagger documentation
* Added base 64 sending option via webhook

* Remove rabbitmq queues when delete instances
* Improvement in restart instance to completely redo the connection
* Update node version: v20
* Correction of messages sent by the api and typebot not appearing in chatwoot
* Adjustment to start typebot, added startSession parameter
* Chatwoot now receives messages sent via api and typebot
* Fixed problem with starting with an input in typebot
* Added check to ensure variables are not empty before executing foreach in start typebot
2023-10-06 18:55:52 -03:00
Davidson Gomes
e55cb08a6a Merge branch 'release/1.5.3' 2023-10-06 18:55:44 -03:00
Davidson Gomes
047359e8dc version: 1.5.3 2023-10-06 18:55:36 -03:00
Davidson Gomes
eb814e181a adjusts in swagger 2023-10-06 18:45:26 -03:00
Davidson Gomes
857031ff5a adjusts in swagger 2023-10-06 18:05:37 -03:00
Davidson Gomes
d5eeb68714 feat: webhook base64 option 2023-10-05 17:05:41 -03:00
Davidson Gomes
966b287026 feat: webhook base64 option 2023-10-05 16:01:47 -03:00
Davidson Gomes
a348729109 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-10-05 15:59:59 -03:00
Davidson Gomes
1f29b7733e
Merge pull request #163 from w3nder/develop
Fix: Variables null
2023-10-05 15:59:39 -03:00
Davidson Gomes
e26ae30f6f feat: webhook base64 option 2023-10-05 15:57:53 -03:00
Davidson Gomes
547943a05c Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-10-05 15:54:53 -03:00
Davidson Gomes
46aa229531 fix: adjusts in swagger 2023-10-05 15:54:46 -03:00
Davidson Gomes
28bd796289
Merge pull request #161 from moraisamilton/develop
Recuperar base64 de media enviada por webhook
2023-10-05 15:54:20 -03:00
Wender Teixeira
6a3f82ed7e
Fix: Variables null 2023-10-05 11:43:18 -03:00
Amilton Morais
523f3301c0
Update wa.types.ts
Foi criado novas propriedades para recuperar Base64 da media enviada por webhook.
2023-10-03 17:20:14 -03:00
Amilton Morais
f085343a99
Update whatsapp.service.ts
Foi criado novo código para recuperar Base64 da media enviada por webhook.
2023-10-03 17:18:58 -03:00
Amilton Morais
f76a924700
Update webhook.service.ts
Foi criado novo variavel "webhook_base64:false' para retorno erro.
2023-10-03 17:13:58 -03:00
Amilton Morais
f8e3b76a4a
Update webhook.model.ts
Foi criado novas propriedades para recuperar Base64 da media enviada por webhook.
2023-10-03 16:59:06 -03:00
Amilton Morais
b8f1e8a7ef
Update instance.dto.ts
Foi criado novas propriedades "webhook_base64?: boolean;" para recuperar Base64 da media enviada por webhook.
2023-10-03 16:56:44 -03:00
Amilton Morais
d007fc49d8
Update instance.controller.ts
Foi criado novas propriedades para recuperar Base64 da media enviada por webhook.
2023-10-03 16:45:05 -03:00
Amilton Morais
f6d8ebd8d3
Update dev-env.yml
Inserido nova variável WEBHOOK_BASE64 para recuperar Base64 da media enviar por webhook.
2023-10-03 16:39:04 -03:00
Davidson Gomes
6ff9c4578a Fixed problem with starting with an input in typebot 2023-10-02 18:23:03 -03:00
Davidson Gomes
33acfe1464 chatwoot now receives messages sent via api and typebot 2023-10-02 17:59:54 -03:00
Davidson Gomes
f5eeb16bb1 Adjustment to start typebot, added startSession parameter 2023-10-02 17:05:22 -03:00
Davidson Gomes
c35c5faaa4 correction of messages sent by the api and typebot not appearing in chatwoot 2023-10-02 16:17:28 -03:00
Davidson Gomes
8425ebc13f
Merge pull request #156 from EvolutionAPI/revert-154-evolution-api-1.5.2-develop-francis
Revert "Start Typebot com opção de ativar chatbot ou não"
2023-10-02 16:10:45 -03:00
Davidson Gomes
6fc37a4298
Revert "Start Typebot com opção de ativar chatbot ou não" 2023-10-02 19:10:34 +00:00
Davidson Gomes
99f3e77c12
Merge pull request #154 from francisbreit/evolution-api-1.5.2-develop-francis
Start Typebot com opção de ativar chatbot ou não
2023-10-02 16:10:29 -03:00
Davidson Gomes
a9c087c45f correction of messages sent by the api and typebot not appearing in chatwoot 2023-10-02 16:10:04 -03:00
Francis Breit
3f4333087f
Start Typebot com opção de ativar chatbot ou não
Foi criada a variável enabled_typebot (não obrigatória)
enabled_typebot igual a true ou vazio: o comportamento do "startTypebot" atua como a nova funcionalidadede sessões persistentes (v1.5.2) onde o flow do Typebot disparado atua como chatbot.
enabled_typebot igual a false: o comportamento do "startTypebot" atua como era na Evolution v.1.5.1 onde o flow do Typebot disparado atua como mensagem simples, nao ativa o chatbot e funciona apenas como mensagens simples.
Obs1: Se setada como true ou se for omitida essa variável no comando start Typebot, enabled_typebot será assumida como true, ou seja, start typebot aciona o flow com o chatbot ativado, imediatamente após o envio, aguardando interação do contato.. Se, antes do acionamento do start typebot, tiver um outro chatbot ativo, o mesmo será substituído pelo novo, ora enviado.
Obs2: Se setada como false, dispara apenas como notificação e não ativa o bot. se tiver outro bot ativo na instancia o mesmo continuará ativo, após disparada a mensagem
2023-10-02 11:56:24 -03:00
Davidson Gomes
e1ac29683d wip: swagger 2023-10-02 09:24:53 -03:00
Davidson Gomes
5c74cbfe19 improvement in restart instance to completely redo the connection 2023-09-30 16:36:32 -03:00
Davidson Gomes
3fdb3fa673 fix: Remove rabbitmq queues when delete instances 2023-09-30 07:20:57 -03:00
Davidson Gomes
ba584974cb Merge tag '1.5.2' into develop
v
2023-09-28 17:58:59 -03:00
Davidson Gomes
bddd6408ac Merge branch 'release/1.5.2' 2023-09-28 17:58:55 -03:00
Davidson Gomes
413ad66a07 version: 1.5.2 2023-09-28 17:58:37 -03:00
Davidson Gomes
0ef5d884cc version: 1.5.2 2023-09-28 17:56:47 -03:00
Davidson Gomes
f6b6d23e93
Merge pull request #133 from francisbreit/fetch-instances
Correção de nao recebimento de midias armazenadas mo minio/s3 Update whatsapp.service.ts
2023-09-28 17:47:17 -03:00
Davidson Gomes
50be69f3d3
Merge pull request #132 from IsraelXabregas/chatwoot-model-fix-schema-db
Fix chatwootSchema in chatwoot model to store reopen_conversation and conversation_pending options
2023-09-28 17:45:13 -03:00
Davidson Gomes
5a75e4d5e6
Merge pull request #131 from matheuskshn/develop
Melhoria no método "startTypebot" para criar sessão persistente quando acionado
2023-09-28 17:44:00 -03:00
Davidson Gomes
ec463df9d6
Merge pull request #126 from francisbreit/main
Novo manager para Evo 1.5.1 - atualização Set Typebot
2023-09-28 17:42:06 -03:00
Francis Breit
b648334323
Corrigir nao recebimento de midias minio/s3 - finalizado- Update whatsapp.service.tsUpdate whatsapp.service.ts
Correção nao recebimento de midias com urls do minio/s3 .
Urls sem o nome da extensão da midia impediam o envio das mensagens por erro na detecção do mimetype.
Imagem e Video
2023-09-26 14:15:50 -03:00
Francis Breit
916972aeb1
Update whatsapp.service.ts 2023-09-26 13:52:11 -03:00
Francis Breit
3893e01af9
Corrigir nao recebimento de midias minio/s3 Update whatsapp.service.ts
Correção nao recebimento de midias com urls do minio/s3 .
Urls sem o nome da extensão da midia impediam o envio das mensagens por erro na detecção do mimetype.
2023-09-26 13:27:58 -03:00
Israel Xabregas Ramos
7835f32c8b Fix chatwootSchema in chatwoot model to store reopen_conversation and conversation_pending options 2023-09-25 20:45:14 -03:00
Matheus Gomes
37302244ee Update typebot.service.ts 2023-09-25 16:37:43 -03:00
Matheus Gomes
f1be7ddb83 Update typebot.service.ts 2023-09-25 16:22:41 -03:00
Matheus Gomes
7447a65a83 Update typebot.service.ts 2023-09-25 16:05:18 -03:00
Matheus Gomes
129009d602 Update typebot.service.ts 2023-09-25 15:55:12 -03:00
Matheus Gomes
c656bd6f4b Enhancement of Session Initialization in "StartTypebot" Function
Enhanced "StartTypebot" to initialize sessionIDs during the initial interaction, improving user experience on WhatsApp and preventing unexpected bot restarts.
2023-09-25 02:38:37 -03:00
Francis Breit
36528d7484
Inclusão de Listening From Me no est Typebot Update manager.json
Correção e inclusão de Listening From Me
2023-09-22 13:28:29 -03:00
Francis Breit
f9c85b6a67
Novo manager para Evo 1.5.1 - atualização Set Typebot
Incluída a opção da variável listening_from_me do Set Typebot
2023-09-21 10:04:00 -03:00
Davidson Gomes
4dfe6bdbe8
Merge pull request #122 from francisbreit/fetch-instances
Update monitor.service.ts - Evolution ap i 1.5.1 - Problemas ao ler / consultar instancias (FETCH_INSTANCES)
2023-09-20 15:09:28 -03:00
Francis Breit
ee343f2fa1
Update monitor.service.ts
Evolution ap i 1.5.1 - Problemas ao ler / consultar instancias (FETCH_INSTANCES)

Ao consultar instancias as mesmas nao apareciam, seja via manager, seja via postman
2023-09-20 11:13:43 -03:00
Davidson Gomes
1a1f5f85b2 Merge tag '1.5.1' into develop
* Added listening_from_me option in Set Typebot
* Added variables options in Start Typebot
* Added webhooks for typebot events
* Added ChamaAI integration
* Added webhook to send errors
* Added support for messaging with ads on chatwoot

* Fix looping connection messages in chatwoot
* Improved performance of fetch instances
2023-09-17 13:55:02 -03:00
Davidson Gomes
bd64b0c884 Merge branch 'release/1.5.1' 2023-09-17 13:54:49 -03:00
Davidson Gomes
e1c8928ed9 Added support for messaging with ads on chatwoot 2023-09-17 13:52:54 -03:00
Davidson Gomes
1f98940445 Added support for messaging with ads on chatwoot 2023-09-17 13:48:42 -03:00
Davidson Gomes
707aa22a6d Added support for messaging with ads on chatwoot 2023-09-17 13:48:27 -03:00
Davidson Gomes
32da15fa8a Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-09-17 13:35:58 -03:00
Davidson Gomes
97cd6e289a
Merge pull request #111 from AdsonCicilioti/ads-preview-1.5.1
Initial support for preview and reference from Ads messages on Chatwoot
2023-09-17 13:35:28 -03:00
Davidson Gomes
def6576fb9
Merge branch 'develop' into ads-preview-1.5.1 2023-09-17 13:35:18 -03:00
Davidson Gomes
196c10b253
Merge pull request #108 from raimartinsb/EvolutionAPI-develop
[Improvement] - Send and Update source_id of messages to chatwoot
2023-09-17 13:32:27 -03:00
AdsonCicilioti
cfdca38d59 add: fixed crop (cover) ads imge thumbnail with Jimp library 2023-09-13 00:04:02 -03:00
AdsonCicilioti
ccd90a69ee add: initial support for preview and reference from messages with Ads metadata 2023-09-12 13:43:17 -03:00
AdsonCicilioti
c16f962d2b chore: compreensive var name for conversation term 2023-09-12 13:39:40 -03:00
Davidson Gomes
8fccf69ceb Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-09-11 09:39:13 -03:00
Davidson Gomes
adc8833670 fix: Debug Bad Request 2023-09-11 09:39:09 -03:00
Davidson Gomes
ecbf90ded8
Merge pull request #99 from moskoweb/bug-bad-request
fix: Debug Bad Request
2023-09-11 09:38:28 -03:00
raimartinsb
c5d2d7782a Merge branch 'develop' of https://github.com/EvolutionAPI/evolution-api into EvolutionAPI-develop 2023-09-11 08:08:18 -03:00
raimartinsb
72dae22ef4 Configuration to update source_id only when desired 2023-09-11 07:44:09 -03:00
Alan Mosko
9a9cd41009
wip 2023-09-06 16:24:13 -03:00
Alan Mosko
0c4c8162c2
wip 2023-09-06 16:18:48 -03:00
Alan Mosko
d47cc5d5f4
wip 2023-09-06 16:11:59 -03:00
raimartinsb
cb942e512d improved message update 2023-09-06 13:28:42 -03:00
raimartinsb
bd0a479645 added source_id in media messages 2023-09-06 09:11:15 -03:00
Davidson Gomes
cd0da914f4
Merge pull request #96 from moskoweb/fetch-profile
Get Info JID Correct
2023-09-05 21:42:21 -03:00
Davidson Gomes
7a7e72897a
Merge pull request #95 from w3nder/develop
Melhorando o desempenho no carregamento da instância.
2023-09-05 21:41:29 -03:00
Alan Mosko
c1542054c9
Merge branch 'develop' into fetch-profile 2023-09-05 17:47:41 -03:00
Alan Mosko
250e67e7ae Update whatsapp.service.ts 2023-09-05 17:44:47 -03:00
Wender Teixeira
cdbe839b35
Update monitor.service.ts 2023-09-05 11:49:02 -03:00
Wender Teixeira
240a77dcce
Update monitor.service.ts
Fix monitor
2023-09-05 11:48:38 -03:00
Wender Teixeira
1dc5bb8bd1
Update monitor.service.ts 2023-09-05 11:47:24 -03:00
Davidson Gomes
23534da27d fix: added delay in chatwoot receive webhook 2023-09-05 08:39:51 -03:00
Wender Teixeira
8652d4031c
Update monitor.service.ts 2023-09-04 19:00:42 -03:00
Davidson Gomes
384e311c7a fix: added delay in chatwoot receive webhook 2023-09-04 16:48:04 -03:00
Davidson Gomes
2791f88b4c fix: added delay in chatwoot receive webhook 2023-09-04 16:13:43 -03:00
Wender Teixeira
402d5af19a
Update monitor.service.ts 2023-09-04 15:18:32 -03:00
Wender Teixeira
b554d8c19c
Update monitor.service.ts (loadInstances)
Melhorando é organizando o loadInstances
2023-09-04 15:11:23 -03:00
Wender Teixeira
7d9dd64303
Update monitor.service.ts
Isso permite que as operações assíncronas sejam executadas em paralelo
2023-09-04 15:06:18 -03:00
Davidson Gomes
41bea8931f test: process exit when errors 2023-09-04 13:08:16 -03:00
Davidson Gomes
f83d8de476 test: process exit when errors 2023-09-04 13:00:16 -03:00
Davidson Gomes
af2a652098
Merge pull request #90 from moskoweb/patch-6
fix: Group Create
2023-09-01 07:02:10 -03:00
Davidson Gomes
a3c911263d
Merge pull request #92 from francisbreit/main
fix: Update manager.json
2023-09-01 06:52:02 -03:00
Davidson Gomes
836c677837
Merge branch 'develop' into main 2023-09-01 06:51:40 -03:00
Davidson Gomes
7e4dbfdd7e fix: Added log when send event to rabbitMQ and Websocket 2023-08-31 18:24:30 -03:00
Davidson Gomes
6eda556242 fix: create rabbitmq queues on set config 2023-08-31 17:10:19 -03:00
Davidson Gomes
3ea454c7ed fix: create rabbitmq queues on set config 2023-08-31 17:01:09 -03:00
Davidson Gomes
9123d7014d fix: create rabbitmq queues on set config 2023-08-31 16:49:50 -03:00
Francis Breit
3ea3abe81a
Update manager.json
- Added the following settings for instances: Set Typebot and Typebot Change Session Status.
- Fixed bug in Webhook settings
2023-08-31 07:55:53 -03:00
raimartinsb
7289c3d7f9 Add source_id and update message 2023-08-31 07:52:36 -03:00
Alan Mosko
d00e1df29c
[Melhoria] Group Create
Verifica todos os participantes e pega apenas os que existe no WhatsApp
2023-08-30 15:09:03 -03:00
Davidson Gomes
16a18c4f22 fix: update error.config.ts 2023-08-30 13:27:47 -03:00
Davidson Gomes
30b156d92f
Merge pull request #89 from w3nder/develop
Update error.config.ts
2023-08-30 13:25:22 -03:00
Davidson Gomes
931f9d33e4
Merge pull request #87 from moskoweb/phone-name
fix: navigator client name
2023-08-30 13:24:40 -03:00
Wender Teixeira
e61fe4d092
Update error.config.ts
encerramento controlado para lidar com erros não capturados no aplicativo.
2023-08-30 12:38:53 -03:00
Davidson Gomes
5bc33ac654
Merge pull request #88 from moskoweb/patch-5
Correção de Erro
2023-08-29 21:00:41 -03:00
Alan Mosko
878ba5a869
Correção de Erro
```This comparison appears to be unintentional because the types 'string' and 'number' have no overlap.```
2023-08-29 18:57:31 -03:00
Alan Mosko
92632b2b96 wip 2023-08-29 14:29:50 -03:00
Davidson Gomes
d803a9e298
Merge pull request #85 from w3nder/develop
Fix set event rabbitmq/websocket
2023-08-29 11:29:14 -03:00
Davidson Gomes
b9f67533dd
Merge pull request #83 from moskoweb/patch-4
fix: DEL_INSTANCE
2023-08-29 11:27:57 -03:00
Davidson Gomes
7ade78bedf
Merge pull request #78 from AdsonCicilioti/docker-net-declaration
clean: docker network declaration and build of the `evolution/api` image
2023-08-29 11:27:10 -03:00
Davidson Gomes
b4eca48f4d
Merge pull request #59 from unilogica/main
Bugfix Internal Error 500: fetchInstances (apikey not found)
2023-08-29 11:24:03 -03:00
Davidson Gomes
2cf8e317fa
Merge pull request #57 from helioelias/main
Fix: For webhook to work with localhost
2023-08-29 11:15:08 -03:00
Wender Teixeira
821a422ab5
Fix set event rabbitmq/websocket 2023-08-28 23:26:40 -03:00
Alan Mosko
91c7b4f2cd
Correção DEL_INSTANCE 2023-08-28 09:59:04 -03:00
AdsonCicilioti
adb43ec5b3 clean: correct docker network declaration 2023-08-26 02:53:02 -03:00
AdsonCicilioti
c9721d7bc9 clean: docker build will be remove in future releases / build into compose file 2023-08-26 02:36:45 -03:00
AdsonCicilioti
bbc2b8a396 clean: declarative bridge network instead shellscript check 2023-08-26 00:29:58 -03:00
Davidson Gomes
54cfa67d52 Added webhook to send errors 2023-08-25 09:31:13 -03:00
Davidson Gomes
9b72b3e332 Added webhook to send errors 2023-08-25 09:01:48 -03:00
Davidson Gomes
c03919be2d Added ChamaAI integration 2023-08-23 08:58:49 -03:00
Davidson Gomes
706cc6f49c Added webhooks for typebot events 2023-08-23 08:15:53 -03:00
Davidson Gomes
10c7e81e02 Added webhooks for typebot events 2023-08-23 07:54:46 -03:00
Davidson Gomes
03637b2d4d Added listening_from_me option in Set Typebot 2023-08-23 07:27:40 -03:00
Davidson Gomes
b7218a05be feat: Inegration with Chama AI 2023-08-19 15:13:35 -03:00
Davidson Gomes
a2cd57d9c6 feat: Inegration with Chama AI 2023-08-19 10:42:41 -03:00
Unilógica
001849eeaa
Merge branch 'EvolutionAPI:main' into main 2023-08-18 18:02:53 -03:00
Davidson Gomes
bf09a70096 Merge tag '1.5.0' into develop
* New instance manager in /manager route
* Added extra files for chatwoot and appsmith
* Added Get Last Message and Archive for Chat
* Added env var QRCODE_COLOR
* Added websocket to send events
* Added rabbitmq to send events
* Added Typebot integration
* Added proxy endpoint
* Added send and date_time in webhook data

* Solved problem when disconnecting from the instance the instance was deleted
* Encoded spaces in chatwoot webhook
* Adjustment in the saving of contacts, saving the information of the number and Jid
* Update Dockerfile
* If you pass empty events in create instance and set webhook it is understood as all
* Fixed issue that did not output base64 averages
* Messages sent by the api now arrive in chatwoot

- Chatwoot: v2.18.0 - v3.0.0
- Typebot: v2.16.0
- Manager Evolution API
2023-08-18 12:49:12 -03:00
Davidson Gomes
530aec92a9 Merge branch 'release/1.5.0' 2023-08-18 12:48:53 -03:00
Davidson Gomes
deb8f2a0b7 Added send and date_time in webhook data 2023-08-18 12:48:30 -03:00
Davidson Gomes
5c247e3d2c Added send and date_time in webhook data 2023-08-18 12:46:47 -03:00
Davidson Gomes
04b9a070c4 Added send and date_time in webhook data 2023-08-18 12:46:46 -03:00
Davidson Gomes
dd2caf720c Added Typebot integration 2023-08-18 12:24:05 -03:00
Davidson Gomes
0d16a7aab0 Added Typebot integration 2023-08-18 11:59:04 -03:00
Davidson Gomes
31325d0999 Added Typebot integration 2023-08-18 11:58:41 -03:00
Davidson Gomes
6f99784224 Added Typebot integration 2023-08-18 11:38:50 -03:00
Davidson Gomes
201e6f7e7b Added rabbitmq to send events 2023-08-18 10:38:32 -03:00
Davidson Gomes
c4d41134b8 Messages sent by the api now arrive in chatwoot 2023-08-18 09:33:17 -03:00
Davidson Gomes
680c92ecec Messages sent by the api now arrive in chatwoot 2023-08-18 09:25:34 -03:00
Davidson Gomes
deb07d2b7f Messages sent by the api now arrive in chatwoot 2023-08-18 08:44:13 -03:00
Davidson Gomes
3a14fc373a adjust params rabbitmq 2023-08-17 18:19:46 -03:00
Allyson de Paula
29e429a02e Merge branch 'main' of https://github.com/unilogica/evolution-api 2023-08-17 13:07:05 -03:00
Allyson de Paula
907a0ee135 Proxy test 2023-08-12 15:05:10 -03:00
Unilógica
22a03f77ab
Merge pull request #1 from unilogica/develop
Develop
2023-08-12 15:01:54 -03:00
Unilógica
9761b10bf6
Merge branch 'EvolutionAPI:develop' into develop 2023-08-12 12:41:15 -03:00
Davidson Gomes
c364d3fdca feat: Added Typebot integration 2023-08-11 20:49:39 -03:00
Davidson Gomes
07ad5756eb fix: Fixed issue that did not output base64 averages 2023-08-09 16:57:23 -03:00
Allyson de Paula
6e401eecde Bugfix Internal Error 500: fetchInstances (apikey not found) 2023-08-09 16:56:38 -03:00
Helio Elias
f32e259d2f Fix isURL function to by pass url with localhost, when webhook is enable 2023-08-08 21:06:58 -03:00
Helio Elias
83ed0e6454
Merge branch 'EvolutionAPI:main' into main 2023-08-08 21:02:19 -03:00
Davidson Gomes
da568e4ea5 feat: Added version in logs 2023-08-07 19:46:34 -03:00
Davidson Gomes
ad819bf3ba feat: Added Typebot integration 2023-08-07 19:03:15 -03:00
Davidson Gomes
b502ebd23a feat: Added Typebot integration 2023-08-07 18:54:12 -03:00
Davidson Gomes
7c5d94c19e feat: Added Typebot integration 2023-08-07 15:43:57 -03:00
Davidson Gomes
a16b5f4644 feat: added proxy endpoint 2023-08-07 12:10:53 -03:00
Davidson Gomes
f3cb8c531b feat: added proxy endpoint 2023-08-07 12:10:33 -03:00
Davidson Gomes
469e696ab7 Added Typebot integration 2023-08-04 16:15:59 -03:00
Davidson Gomes
d99ccd9df6 Added Typebot integration 2023-08-04 15:03:08 -03:00
Davidson Gomes
3b3118d764 Added Typebot integration 2023-08-04 15:00:55 -03:00
Davidson Gomes
84386847e2 readme buy me coffe 2023-08-03 07:32:29 -03:00
Davidson Gomes
0da3d100b3 feat: Added rabbitmq to send events 2023-08-02 21:33:59 -03:00
Davidson Gomes
56d621bab8 feat: Added rabbitmq to send events 2023-08-02 21:14:21 -03:00
Davidson Gomes
f1571b5f66 feat: Added rabbitmq to send events 2023-08-02 17:41:15 -03:00
Davidson Gomes
55f8e179af feat: Added rabbitmq to send events 2023-08-02 17:39:07 -03:00
Davidson Gomes
ab5289a136 feat: Added rabbitmq to send events 2023-08-02 17:29:09 -03:00
Davidson Gomes
e05c48979d feat: Added rabbitmq to send events 2023-08-02 17:28:52 -03:00
Davidson Gomes
24c880343b feat: Added websocket with lib socket.io 2023-08-02 16:11:19 -03:00
Davidson Gomes
b3b4ee7a28 fix: If you pass empty events in create instance and set webhook it is understood as all 2023-08-02 14:48:02 -03:00
Helio Elias
e26b440a66
Merge pull request #1 from helioelias/fix/dockers
Fix/dockers
2023-08-02 13:29:13 -03:00
Helio Elias
d6194316e1 Fix Dockers 2023-08-02 13:25:00 -03:00
Davidson Gomes
341148612f feat: Added websocket with lib socket.io 2023-08-02 13:21:15 -03:00
Davidson Gomes
79864e97d6 feat: Added websocket with lib socket.io 2023-08-02 13:08:30 -03:00
Davidson Gomes
ed5e66e430 fix: Update view manager 2023-08-01 18:01:29 -03:00
Davidson Gomes
074a861fb4 fix: Update Dockerfile 2023-07-31 16:02:40 -03:00
Davidson Gomes
b88656829e feat: Added env var QRCODE_COLOR 2023-07-31 15:51:05 -03:00
Davidson Gomes
aefe6a5943 feat: Added Get Last Message and Archive for Chat 2023-07-31 15:30:48 -03:00
Davidson Gomes
3d743f8498 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-31 15:30:33 -03:00
Davidson Gomes
0186fff67d
feat: Added Get Last Message and Archive for Chat
Added Get Last Message and Archive for Chat
2023-07-31 15:30:26 -03:00
Davidson Gomes
38f61cdf75 fix: Update Dockerfile 2023-07-31 15:28:00 -03:00
Davidson Gomes
84366002db fix: Update Dockerfile 2023-07-31 15:27:47 -03:00
Davidson Gomes
eff5bb74b5
Merge pull request #50 from EvolutionAPI/revert-43-docker
Revert "Update Dockerfile"
2023-07-31 15:26:00 -03:00
Davidson Gomes
2614088fae
Revert "Update Dockerfile" 2023-07-31 15:25:48 -03:00
Davidson Gomes
3699e04db9
Merge pull request #43 from moskoweb/docker
Update Dockerfile
2023-07-31 15:25:09 -03:00
Davidson Gomes
0dca009c01 fix: Adjustment in the saving of contacts, saving the information of the number and Jid 2023-07-31 13:42:37 -03:00
Davidson Gomes
1b39eb1a23 add: Added extra files for chatwoot and appsmith 2023-07-31 13:13:41 -03:00
Davidson Gomes
2637aebb7f fix: Encoded spaces in chatwoot webhook 2023-07-31 12:34:01 -03:00
Davidson Gomes
8afcfde078 add: Added extra files for chatwoot and appsmith 2023-07-31 12:26:50 -03:00
Davidson Gomes
9ea1eaf3ed fix: Encoded spaces in chatwoot webhook 2023-07-31 10:55:24 -03:00
Davidson Gomes
66d06afaf7 feat: New instance manager in /manager route 2023-07-30 11:03:12 -03:00
Davidson Gomes
cffcca9722 fix: adjust in instance name in chatwoot 2023-07-29 11:30:37 -03:00
Davidson Gomes
fe2b9774d8 fix: Solved problem when disconnecting from the instance the instance was deleted 2023-07-29 11:09:56 -03:00
Alan Mosko
3d02fabef4 Update Dockerfile 2023-07-27 10:47:26 -03:00
Davidson Gomes
f89c2b1f63 Merge tag '1.4.8' into develop
* Fixed error return bug
2023-07-27 10:28:47 -03:00
Davidson Gomes
ee755d5a6c Merge branch 'release/1.4.8' 2023-07-27 10:28:40 -03:00
Davidson Gomes
65e2ecf88e version: 1.4.8 2023-07-27 10:28:26 -03:00
Davidson Gomes
332ec69ee8 fix: Adjusts in return errors 2023-07-27 10:27:41 -03:00
Alan Mosko
1ce30f8431 Update whatsapp.service.ts 2023-07-27 10:20:18 -03:00
Alan Mosko
3ae6944307 Update whatsapp.service.ts 2023-07-27 09:24:38 -03:00
Alan Mosko
52533d4b38 Adição de Get Last Message e Archive por Chat 2023-07-27 09:23:44 -03:00
Davidson Gomes
38409d9336 Merge tag '1.4.7' into develop
* Fixed error return bug
* Fixed problem of getting message when deleting message in chatwoot
* Change in error return pattern
2023-07-27 08:53:02 -03:00
Davidson Gomes
d344e513c4 Merge branch 'release/1.4.7' 2023-07-27 08:52:52 -03:00
Davidson Gomes
9af7f67930 version: 1.4.7 2023-07-27 08:52:45 -03:00
Davidson Gomes
f95d938fb6 fix: Adjusts in return errors 2023-07-27 08:51:58 -03:00
Davidson Gomes
f74a7e87bd version: 1.4.7 2023-07-27 08:48:03 -03:00
Davidson Gomes
d3fce5fc89 fix: Fixed problem of getting message when deleting message in chatwoot 2023-07-27 08:45:02 -03:00
Davidson Gomes
14f3f3d2ac fix: fixed error return bug 2023-07-27 08:36:37 -03:00
Davidson Gomes
127d5b97c4 fix: fixed error return bug 2023-07-27 08:36:18 -03:00
Davidson Gomes
7ef1c097e8 text: Fix problem No Session 2023-07-26 21:45:49 -03:00
Davidson Gomes
80e3116cd8 text: Fix problem No Session 2023-07-26 21:45:23 -03:00
Davidson Gomes
46bac55bb3 Merge tag '1.4.6' into develop
* Fixed bug of creating new inbox by chatwoot
* When conversation reopens is pending when conversation pending is true
* Added docker-compose file with dockerhub image
2023-07-26 18:42:10 -03:00
Davidson Gomes
2cadafd5c1 Merge branch 'release/1.4.6' 2023-07-26 18:41:39 -03:00
Davidson Gomes
bb27dca21c
Merge pull request #36 from moskoweb/groupJid-query-or-body
Correção Validação de Grupo por Query e Body
2023-07-26 18:41:06 -03:00
Davidson Gomes
86fc9fbffa
Merge branch 'develop' into groupJid-query-or-body 2023-07-26 18:40:54 -03:00
Alan Mosko
9bdbfc6f4f wip 2023-07-26 18:28:18 -03:00
Davidson Gomes
28a7d9c62b fix: Adjusts in instance name 2023-07-26 18:02:45 -03:00
Davidson Gomes
2ca344b17c Merge tag '1.4.6' into develop
* Fixed bug of creating new inbox by chatwoot
* When conversation reopens is pending when conversation pending is true
* Added docker-compose file with dockerhub image
2023-07-26 17:54:42 -03:00
Davidson Gomes
1bf2278f31 version: 1.4.6 2023-07-26 17:54:29 -03:00
Davidson Gomes
6188ab0d30 Merge branch 'main' of github.com:EvolutionAPI/evolution-api 2023-07-26 17:47:53 -03:00
Davidson Gomes
f016b53013 Merge tag '1.4.6' into develop
* Fixed bug of creating new inbox by chatwoot
* When conversation reopens is pending when conversation pending is true
* Added docker-compose file with dockerhub image
2023-07-26 17:47:01 -03:00
Davidson Gomes
127cd3e843 Merge branch 'release/1.4.6' 2023-07-26 17:46:52 -03:00
Davidson Gomes
457dbe5831 version: 1.4.6 2023-07-26 17:46:45 -03:00
Davidson Gomes
8d73fb1161
Merge pull request #35 from EvolutionAPI/revert-34-groupJid-query-or-body
Revert "GroupJid por Query ou por Body"
2023-07-26 17:45:41 -03:00
Davidson Gomes
af5746bb39
Revert "GroupJid por Query ou por Body" 2023-07-26 17:45:28 -03:00
Davidson Gomes
3f27d018c7
Merge pull request #34 from moskoweb/groupJid-query-or-body
fix: GroupJid por Query ou por Body
2023-07-26 17:45:16 -03:00
Davidson Gomes
68402393b5
Merge branch 'main' into groupJid-query-or-body 2023-07-26 17:43:28 -03:00
Davidson Gomes
2ad33857f4 Merge tag '1.4.6' into develop
* Fixed bug of creating new inbox by chatwoot
* When conversation reopens is pending when conversation pending is true
* Added docker-compose file with dockerhub image
2023-07-26 17:41:18 -03:00
Davidson Gomes
d3c7677dc7 Merge branch 'release/1.4.6' 2023-07-26 17:41:10 -03:00
Davidson Gomes
73e92f9ef5 version: 1.4.6 2023-07-26 17:41:06 -03:00
Davidson Gomes
fcc8748daf Merge branch 'release/1.4.6' 2023-07-26 17:40:07 -03:00
Davidson Gomes
312ee249b6 version: 1.4.6 2023-07-26 17:39:59 -03:00
Davidson Gomes
e4548f6961 fix: Added docker-compose file with dockerhub image 2023-07-26 17:39:32 -03:00
Davidson Gomes
1b93aac8c5 fix: When conversation reopens is pending when conversation pending is true 2023-07-26 17:33:31 -03:00
Alan Mosko
e7ed666037 Update abstract.router.ts 2023-07-26 17:27:25 -03:00
Davidson Gomes
85ca0683ed fix: fixed bug of creating new inbox by chatwoot 2023-07-26 17:15:09 -03:00
Davidson Gomes
78689a23e5
Code Formatter
fix: Code Formatter
2023-07-26 12:44:01 -03:00
Davidson Gomes
ba63a55883
Merge branch 'develop' into formatter 2023-07-26 12:43:37 -03:00
Alan Mosko
dc3d59bae1 wip 2023-07-26 11:12:00 -03:00
Alan Mosko
0a851b935e Update .gitignore 2023-07-26 11:10:23 -03:00
Alan Mosko
ddc75d710f wip 2023-07-26 11:08:14 -03:00
Alan Mosko
5482601b41 Squashed commit of the following:
commit fb6e58b3c4
Merge: 1d3d557 67e9845
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:39:37 2023 -0300

    Merge branch 'release/1.4.5'

commit 67e98456bb
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:39:27 2023 -0300

    fix: Fix mids going duplicated in chatwoot

commit 3e47420534
Merge: 3f41974 1d3d557
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:38:44 2023 -0300

    Merge tag '1.4.5' into develop

    * Fixed problems in localization template in chatwoot
    * Fix mids going duplicated in chatwoot

commit 1d3d557c43
Merge: 6b926dc 3f41974
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:38:36 2023 -0300

    Merge branch 'release/1.4.5'

commit 3f41974a75
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:38:22 2023 -0300

    fix: Fix mids going duplicated in chatwoot

commit 3e3c7397a5
Merge: de0c9a1 dcb5170
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:36:10 2023 -0300

    Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop

commit dcb51702e7
Merge: 4769d75 dd0c1e2
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:36:01 2023 -0300

    Merge pull request #30 from codephix/patch-1

    Update whatsapp.service.ts

commit de0c9a1eff
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Wed Jul 26 09:34:10 2023 -0300

    fix: fixed problems in localization template

commit dd0c1e20a7
Author: CodePhix <contato@codephix.com>
Date:   Tue Jul 25 19:59:42 2023 -0300

    Update whatsapp.service.ts

commit 4769d75dc3
Merge: ecae077 6b926dc
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 16:20:04 2023 -0300

    Merge tag '1.4.4' into develop

    * Fixed chatwoot line wrap issue
    * Solved receive location in chatwoot
    * When requesting the pairing code, it also brings the qr code
    * Option reopen_conversation in chatwoot endpoint
    * Option conversation_pending in chatwoot endpoint

commit 6b926dc697
Merge: 2b6dbfd ecae077
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 16:19:54 2023 -0300

    Merge branch 'release/1.4.4'

commit ecae077c6d
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 16:16:49 2023 -0300

    fix: Option conversation_pending in chatwoot endpoint

commit 78ab1bed35
Merge: 6bb1abd 2b6dbfd
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 15:31:16 2023 -0300

    Merge tag '1.4.4' into develop

    * Fixed chatwoot line wrap issue
    * Solved receive location in chatwoot
    * When requesting the pairing code, it also brings the qr code
    * Option reopen_conversation in chatwoot endpoint
    * Option conversation_pending in chatwoot endpoint

commit 2b6dbfde6b
Merge: 82b1567 6bb1abd
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 15:31:06 2023 -0300

    Merge branch 'release/1.4.4'

commit 6bb1abd7f0
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 15:29:42 2023 -0300

    fix: Option conversation_pending in chatwoot endpoint

commit aef92240cc
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 15:20:21 2023 -0300

    fix: Option conversation_pending in chatwoot endpoint

commit f0d8c2d095
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 13:19:15 2023 -0300

    fix: Solved receive location in chatwoot

commit 14529f2c35
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 12:47:35 2023 -0300

    fix: When requesting the pairing code, it also brings the qr code

commit 89f40d54d9
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 12:41:54 2023 -0300

    fix: Solved receive location in chatwoot

commit 4c006970a2
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 11:52:26 2023 -0300

    fix: Fixed chatwoot line wrap issue

commit de676041df
Merge: 1cd7291 82b1567
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:51:53 2023 -0300

    Merge tag '1.4.3' into develop

    * Adjusts in settings with options always_online, read_messages and read_status
    * Fixed send webhook for event CALL
    * Create instance with settings

commit 82b1567ae5
Merge: f95f312 1cd7291
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:51:42 2023 -0300

    Merge branch 'release/1.4.3'

commit 1cd7291068
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:51:28 2023 -0300

    version: 1.4.3

commit fdee1df5b3
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:42:45 2023 -0300

    fix: Create instance with settings

commit c314d00ccd
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:42:34 2023 -0300

    fix: Create instance with settings

commit 62e2a8a6e3
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 10:23:18 2023 -0300

    fix: Fixed send webhook for event CALL

commit a12231a0aa
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Tue Jul 25 09:57:28 2023 -0300

    fix: Adjusts in settings with options always_online, read_messages and read_status

commit 183efd427a
Merge: 4d9ca4b f95f312
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:52:58 2023 -0300

    Merge tag '1.4.2' into develop

    * Fixed validation is set settings
    * Adjusts in group validations
    * Ajusts in sticker message to chatwoot

commit f95f3126c3
Merge: cc91f2e 4d9ca4b
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:52:46 2023 -0300

    Merge branch 'release/1.4.2'

commit 4d9ca4b451
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:52:34 2023 -0300

    version: 1.4.2

commit c76334a68a
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:32:29 2023 -0300

    fix: Ajusts in sticker message to chatwoot

commit f475391ba6
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:32:15 2023 -0300

    fix: Ajusts in sticker message to chatwoot

commit b77f22790b
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:13:18 2023 -0300

    fix: Fixed validation is set settings

commit 757a578c6e
Merge: c582476 f8e1892
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:12:51 2023 -0300

    Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop

commit c5824767c8
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:11:49 2023 -0300

    fix: Fixed validation is set settings

commit 84f3f07279
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:11:15 2023 -0300

    fix: Fixed validation is set settings

commit f8e1892eee
Merge: 036a8ed 58ed6f3
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:08:24 2023 -0300

    fix: group validation

    Group validation

commit 036a8edca0
Merge: 3d8e6f4 ef4be6a
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 20:07:05 2023 -0300

    fix: Promote All Participants in Create Group

    Promote All Participants in Create Group

commit 58ed6f395f
Author: Alan Mosko <moskoweb@gmail.com>
Date:   Mon Jul 24 19:59:09 2023 -0300

    Validação de Grupo

commit ef4be6a612
Author: Alan Mosko <moskoweb@gmail.com>
Date:   Mon Jul 24 19:53:03 2023 -0300

    Start

commit 3d8e6f4394
Merge: 8b6e577 0cc1f18
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 19:08:39 2023 -0300

    fix: Fixed mentions

    Fixed mentions

commit 0cc1f18a7e
Author: Alan Mosko <moskoweb@gmail.com>
Date:   Mon Jul 24 19:05:32 2023 -0300

    [BUG] Correção de mencionar

    Caso seja enviado everyOne como false sem passar nada no mentioned

commit 8b6e577b8f
Merge: f9abd90 cc91f2e
Author: Davidson Gomes <davidsongviolao@gmail.com>
Date:   Mon Jul 24 18:28:57 2023 -0300

    Merge tag '1.4.1' into develop

    * Fixed reconnect with pairing code or qrcode
    * Fixed problem in createJid
2023-07-26 10:59:15 -03:00
Alan Mosko
249aecbc0d wip 2023-07-26 10:58:13 -03:00
Alan Mosko
03f3020e9f wip 2023-07-26 10:30:56 -03:00
Alan Mosko
e151eb85f0 wip 2023-07-26 10:30:26 -03:00
Davidson Gomes
348586553e Merge tag '1.4.5' into develop
* Fixed problems in localization template in chatwoot
* Fix mids going duplicated in chatwoot
2023-07-26 09:39:45 -03:00
Davidson Gomes
fb6e58b3c4 Merge branch 'release/1.4.5' 2023-07-26 09:39:37 -03:00
Davidson Gomes
67e98456bb fix: Fix mids going duplicated in chatwoot 2023-07-26 09:39:27 -03:00
Davidson Gomes
3e47420534 Merge tag '1.4.5' into develop
* Fixed problems in localization template in chatwoot
* Fix mids going duplicated in chatwoot
2023-07-26 09:38:44 -03:00
Davidson Gomes
1d3d557c43 Merge branch 'release/1.4.5' 2023-07-26 09:38:36 -03:00
Davidson Gomes
3f41974a75 fix: Fix mids going duplicated in chatwoot 2023-07-26 09:38:22 -03:00
Davidson Gomes
3e3c7397a5 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-26 09:36:10 -03:00
Davidson Gomes
dcb51702e7
Merge pull request #30 from codephix/patch-1
Update whatsapp.service.ts
2023-07-26 09:36:01 -03:00
Davidson Gomes
de0c9a1eff fix: fixed problems in localization template 2023-07-26 09:34:10 -03:00
CodePhix
dd0c1e20a7
Update whatsapp.service.ts 2023-07-25 19:59:42 -03:00
Davidson Gomes
4769d75dc3 Merge tag '1.4.4' into develop
* Fixed chatwoot line wrap issue
* Solved receive location in chatwoot
* When requesting the pairing code, it also brings the qr code
* Option reopen_conversation in chatwoot endpoint
* Option conversation_pending in chatwoot endpoint
2023-07-25 16:20:04 -03:00
Davidson Gomes
6b926dc697 Merge branch 'release/1.4.4' 2023-07-25 16:19:54 -03:00
Davidson Gomes
ecae077c6d fix: Option conversation_pending in chatwoot endpoint 2023-07-25 16:16:49 -03:00
Davidson Gomes
78ab1bed35 Merge tag '1.4.4' into develop
* Fixed chatwoot line wrap issue
* Solved receive location in chatwoot
* When requesting the pairing code, it also brings the qr code
* Option reopen_conversation in chatwoot endpoint
* Option conversation_pending in chatwoot endpoint
2023-07-25 15:31:16 -03:00
Davidson Gomes
2b6dbfde6b Merge branch 'release/1.4.4' 2023-07-25 15:31:06 -03:00
Davidson Gomes
6bb1abd7f0 fix: Option conversation_pending in chatwoot endpoint 2023-07-25 15:29:42 -03:00
Davidson Gomes
aef92240cc fix: Option conversation_pending in chatwoot endpoint 2023-07-25 15:20:21 -03:00
Davidson Gomes
f0d8c2d095 fix: Solved receive location in chatwoot 2023-07-25 13:19:15 -03:00
Davidson Gomes
14529f2c35 fix: When requesting the pairing code, it also brings the qr code 2023-07-25 12:47:35 -03:00
Davidson Gomes
89f40d54d9 fix: Solved receive location in chatwoot 2023-07-25 12:41:54 -03:00
Davidson Gomes
4c006970a2 fix: Fixed chatwoot line wrap issue 2023-07-25 11:52:26 -03:00
Davidson Gomes
de676041df Merge tag '1.4.3' into develop
* Adjusts in settings with options always_online, read_messages and read_status
* Fixed send webhook for event CALL
* Create instance with settings
2023-07-25 10:51:53 -03:00
Davidson Gomes
82b1567ae5 Merge branch 'release/1.4.3' 2023-07-25 10:51:42 -03:00
Davidson Gomes
1cd7291068 version: 1.4.3 2023-07-25 10:51:28 -03:00
Davidson Gomes
fdee1df5b3 fix: Create instance with settings 2023-07-25 10:42:45 -03:00
Davidson Gomes
c314d00ccd fix: Create instance with settings 2023-07-25 10:42:34 -03:00
Davidson Gomes
62e2a8a6e3 fix: Fixed send webhook for event CALL 2023-07-25 10:23:18 -03:00
Davidson Gomes
a12231a0aa fix: Adjusts in settings with options always_online, read_messages and read_status 2023-07-25 09:57:28 -03:00
Davidson Gomes
183efd427a Merge tag '1.4.2' into develop
* Fixed validation is set settings
* Adjusts in group validations
* Ajusts in sticker message to chatwoot
2023-07-24 20:52:58 -03:00
Davidson Gomes
f95f3126c3 Merge branch 'release/1.4.2' 2023-07-24 20:52:46 -03:00
Davidson Gomes
4d9ca4b451 version: 1.4.2 2023-07-24 20:52:34 -03:00
Davidson Gomes
c76334a68a fix: Ajusts in sticker message to chatwoot 2023-07-24 20:32:29 -03:00
Davidson Gomes
f475391ba6 fix: Ajusts in sticker message to chatwoot 2023-07-24 20:32:15 -03:00
Davidson Gomes
b77f22790b fix: Fixed validation is set settings 2023-07-24 20:13:18 -03:00
Davidson Gomes
757a578c6e Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-24 20:12:51 -03:00
Davidson Gomes
c5824767c8 fix: Fixed validation is set settings 2023-07-24 20:11:49 -03:00
Davidson Gomes
84f3f07279 fix: Fixed validation is set settings 2023-07-24 20:11:15 -03:00
Davidson Gomes
f8e1892eee
fix: group validation
Group validation
2023-07-24 20:08:24 -03:00
Davidson Gomes
036a8edca0
fix: Promote All Participants in Create Group
Promote All Participants in Create Group
2023-07-24 20:07:05 -03:00
Alan Mosko
58ed6f395f
Validação de Grupo 2023-07-24 19:59:09 -03:00
Alan Mosko
ef4be6a612 Start 2023-07-24 19:53:03 -03:00
Davidson Gomes
3d8e6f4394
fix: Fixed mentions
Fixed mentions
2023-07-24 19:08:39 -03:00
Alan Mosko
0cc1f18a7e
[BUG] Correção de mencionar
Caso seja enviado everyOne como false sem passar nada no mentioned
2023-07-24 19:05:32 -03:00
Davidson Gomes
8b6e577b8f Merge tag '1.4.1' into develop
* Fixed reconnect with pairing code or qrcode
* Fixed problem in createJid
2023-07-24 18:28:57 -03:00
Davidson Gomes
cc91f2e5db Merge branch 'release/1.4.1' 2023-07-24 18:28:45 -03:00
Davidson Gomes
8d1f2313ac version: 1.4.1 2023-07-24 18:28:39 -03:00
Davidson Gomes
f9abd90cc9 fix: connection state 2023-07-24 18:28:01 -03:00
Davidson Gomes
f7293255cf fix: Fixed reconnect with pairing code or qrcode 2023-07-24 18:21:11 -03:00
Davidson Gomes
7d6a130cf9 Merge tag '1.4.0' into develop
* Added connection functionality via pairing code
* Added fetch profile endpoint in chat controller
* Created settings controller
* Added reject call and send text message when receiving a call
* Added setting to ignore group messages
* Added connection with pairing code in chatwoot with command /init:{NUMBER}
* Added encoding option in endpoint sendWhatsAppAudio

* Added link preview option in send text message
* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
* Fixed issue where it was not possible to open a conversation when sent at first by me on my cell phone in chatwoot
* Now it only updates the contact name if it is the same as the phone number in chatwoot
* Now accepts all chatwoot inbox templates
* Command to create new instances set to /new_instance:{NAME}:{NUMBER}
* Fix in chatwoot set, sign msg can now be disabled

- Chatwoot: v2.18.0 - v3.0.0 (Beta)
2023-07-24 17:05:43 -03:00
Davidson Gomes
be7bb2e39f Merge branch 'release/1.4.0' 2023-07-24 17:05:33 -03:00
Davidson Gomes
1c30728880 version: 1.4.0 2023-07-24 17:05:18 -03:00
Davidson Gomes
8d91e7cb1d feat: Added encoding option in endpoint sendWhatsAppAudio 2023-07-24 16:21:29 -03:00
Davidson Gomes
68d980795a fix: fix in chatwoot set, sign msg can now be disabled 2023-07-24 15:13:46 -03:00
Davidson Gomes
45c11a5a8e fix: fix in chatwoot set, sign msg can now be disabled 2023-07-24 15:12:13 -03:00
Davidson Gomes
4d00351db7 fix: command to create new instances set to /new_instance:<NAME>:<NUMBER> 2023-07-24 15:05:26 -03:00
Davidson Gomes
fff420b652 fix: command to create new instances set to /new_instance:<NAME>:<NUMBER> 2023-07-24 15:05:03 -03:00
Davidson Gomes
7103a95305 feat: Added connection with pairing code in chatwoot 2023-07-24 13:43:18 -03:00
Davidson Gomes
bcada5d553 fix: Now accepts all chatwoot inbox templates 2023-07-24 13:03:40 -03:00
Davidson Gomes
c9b24ff612 fix: adjusts for chatwoot v3 2023-07-24 12:55:27 -03:00
Davidson Gomes
854c7ed04d fix: Improvement for Validation of Numbers and Groups 2023-07-24 12:02:38 -03:00
Davidson Gomes
c0054959cd
fix: Improvement for Validation of Numbers and Groups
Improvement for Validation of Numbers and Groups
2023-07-24 12:00:33 -03:00
Davidson Gomes
1aa837d220 fix: Adjusts in chatwoot integration 2023-07-24 11:58:52 -03:00
Alan Mosko
95df402c4c wip 2023-07-24 11:57:15 -03:00
Davidson Gomes
2f3d6f7e63 fix: Fixed problem with fileSha256 appearing when sending a sticker in chatwoot 2023-07-24 11:48:10 -03:00
Alan Mosko
ffe1523170 Update whatsapp.service.ts 2023-07-24 11:42:06 -03:00
Davidson Gomes
a73d5f4b4d Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-24 11:18:12 -03:00
Davidson Gomes
f35b62ed12 fix: Adjusts in createJid 2023-07-24 11:18:08 -03:00
Davidson Gomes
20abdd2908
fix: Adjusts in createJid to sendContact
Adjusts in createJid to sendContact
2023-07-24 11:17:35 -03:00
Alan Mosko
28c2c7285c Gerar Wuid no SendContact 2023-07-24 11:15:58 -03:00
Davidson Gomes
3ca8ab12a4
fix: Adjusts in createJid
Adjusts in createJid
2023-07-24 11:13:30 -03:00
Alan Mosko
fd82aa143c wip 2023-07-24 11:10:32 -03:00
Davidson Gomes
1fcbd4f9fd feat: Added reject call and send text message when receiving a call and Added setting to ignore group messages 2023-07-24 10:18:16 -03:00
Davidson Gomes
73d9cd62a5 feat: Created settings Controller 2023-07-24 09:42:29 -03:00
Davidson Gomes
be699d24a1 feat: Added fetch profile endpoint in chat controller and link preview option in send text message 2023-07-23 22:26:38 -03:00
Davidson Gomes
798eb90bed feat: Added fetch profile endpoint in chat controller and link preview option in send text message 2023-07-23 22:24:21 -03:00
Davidson Gomes
c252f5f8d9
Merge pull request #20 from EvolutionAPI/revert-18-fetch-profile
Revert "Adição de FetchProfile"
2023-07-23 22:05:38 -03:00
Davidson Gomes
76d77ad76f
Revert "Adição de FetchProfile" 2023-07-23 22:05:21 -03:00
Davidson Gomes
69f5cdd61a
feat: added fetchProfile endpoint in chat controller
Added fetchProfile endpoint in chat controller
2023-07-23 21:30:11 -03:00
Davidson Gomes
9f52f20660
feat: Add LinkPreview Option
Add LinkPreview Option
2023-07-23 21:25:20 -03:00
Alan Mosko
90048afa9d
Add LinkPreview Option 2023-07-23 11:24:16 -03:00
Alan Mosko
1ec3ed32ee Melhorias 2023-07-23 10:18:00 -03:00
Davidson Gomes
16ed5821e2 Added connection functionality via pairing code 2023-07-21 20:58:37 -03:00
Davidson Gomes
b681e33944 Added connection functionality via pairing code 2023-07-21 20:38:10 -03:00
Davidson Gomes
8f4d44a212 Added connection functionality via pairing code 2023-07-21 20:37:58 -03:00
Davidson Gomes
93a5d07f9a Merge tag '1.3.2' into develop
* Fix in update settings that needed to restart after updated
* Correction in the use of the api with mongodb
* Adjustments to search endpoint for contacts, chats, messages and Status messages
* Now when deleting the instance, the data referring to it in mongodb is also deleted
* It is now validated if the instance name contains uppercase and special characters
* For compatibility reasons, container mode has been removed
* Added docker-compose files example
2023-07-21 17:20:19 -03:00
Davidson Gomes
40c230c7db Merge branch 'release/1.3.2' 2023-07-21 17:20:08 -03:00
Davidson Gomes
d0fa3b92f8 version: 1.3.2 2023-07-21 17:19:59 -03:00
Davidson Gomes
2a7727cf5f Merge tag '1.3.2' into develop
* Fix in update settings that needed to restart after updated
* Correction in the use of the api with mongodb
* Adjustments to search endpoint for contacts, chats, messages and Status messages
* Now when deleting the instance, the data referring to it in mongodb is also deleted
* It is now validated if the instance name contains uppercase and special characters
* For compatibility reasons, container mode has been removed
* Added docker-compose files example
2023-07-21 17:18:50 -03:00
Davidson Gomes
98722e7acf Merge branch 'release/1.3.2' 2023-07-21 17:18:40 -03:00
Davidson Gomes
683fe4c3db fix: added docker-compose files example 2023-07-21 16:00:58 -03:00
Alan Mosko
e851696430 Adição de Profile Route 2023-07-21 15:32:28 -03:00
Davidson Gomes
b2ccf965bb fix: added docker-compose files example 2023-07-21 15:14:46 -03:00
Davidson Gomes
f847f38812 fix: added docker-compose files example 2023-07-21 15:13:49 -03:00
Davidson Gomes
19039aa281 fix: For compatibility reasons, container mode has been removed 2023-07-21 13:12:55 -03:00
Davidson Gomes
091b920a22 fix: It is now validated if the instance name contains uppercase and special characters 2023-07-21 12:40:58 -03:00
Davidson Gomes
d7f264c1c2 fix: It is now validated if the instance name contains uppercase and special characters 2023-07-21 12:26:43 -03:00
Davidson Gomes
897f8164b9 fix: Now when deleting the instance, the data referring to it in mongodb is also deleted 2023-07-21 12:13:03 -03:00
Helio Elias
04a6f7c954 fix docker and create docker-compose with all services 2023-07-21 15:02:09 +00:00
Davidson Gomes
796287a776 fix: Adjustments to search endpoint for contacts, chats, messages and Status messages 2023-07-21 11:38:36 -03:00
Davidson Gomes
763e30bd1d fix: fix in update settings that needed to restart after updated 2023-07-21 09:34:39 -03:00
Davidson Gomes
5121374d60 Merge tag '1.3.1' into develop
version: 1.3.1
2023-07-21 08:26:24 -03:00
Davidson Gomes
3e3a175bdc Merge branch 'release/1.3.1' 2023-07-21 08:26:15 -03:00
Davidson Gomes
4a1aa9130b version: 1.3.1 2023-07-21 08:26:05 -03:00
Davidson Gomes
5a3f5f60b6 test: container mode with chatwoot 2023-07-20 10:08:57 -03:00
Davidson Gomes
8c1600be55 Merge tag '1.3.1' into develop
* Adjust in create store files
2023-07-20 07:49:54 -03:00
Davidson Gomes
7d3ae2347b Merge branch 'release/1.3.1' 2023-07-20 07:49:43 -03:00
Davidson Gomes
27add47db4 fix: Adjust in create store files 2023-07-20 07:49:32 -03:00
Davidson Gomes
836bcab036 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-20 07:15:36 -03:00
Davidson Gomes
2d20a07dfb fix: Adjust in create store files 2023-07-20 07:14:07 -03:00
Davidson Gomes
24c5c70466
fix: remove comments in .env to docker
fix: remove comments in .env to docker
2023-07-19 12:32:47 -03:00
Davidson Gomes
22ead22499
Merge branch 'develop' into patch-1 2023-07-19 12:32:06 -03:00
Davidson Gomes
65e1620b43 Merge tag '1.3.0' into develop
* Added messages.delete event
* Added restart instance endpoint
* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:<INSTANCE_NAME>'
* Change Baileys version to: 6.4.0
* Send contact in chatwoot
* Send contact array in chatwoot
* Added apiKey in webhook and serverUrl in fetchInstance if EXPOSE_IN_FETCH_INSTANCES: true
* Translation set to default (english) in chatwoot

* Fixed error to send message in large groups
* Docker files adjusted
* Fixed in the postman collection the webhookByEvent parameter by webhook_by_events
* Added validations in create instance
* Removed link preview endpoint, now it's done automatically from sending conventional text
* Added group membership validation before sending message to groups
* Adjusts in docker files
* Adjusts in returns in endpoints chatwoot and webhook
* Fixed ghost mentions in send text message
* Fixed bug that saved contacts from groups came without number in chatwoot
* Fixed problem to receive csat in chatwoot
* Fixed require fileName for document only in base64 for send media message
* Bug fix when sending mobile message change contact name to number in chatwoot
* Bug fix when connecting whatsapp does not send confirmation message
* Fixed quoted message with id or message directly
* Adjust in validation for mexican and argentine numbers
* Adjust in create store files

- Chatwoot: v2.18.0
2023-07-19 11:33:42 -03:00
Davidson Gomes
acac09375e Merge branch 'release/1.3.0' 2023-07-19 11:33:32 -03:00
Davidson Gomes
83cf859da3 version: 1.3.0 2023-07-19 11:33:23 -03:00
Alan Mosko
956c391f13
Remoção de Comentários dos Valores
Ao subir um container de testes, verifiquei que os comentários subiram como valores dos campos, o que invalidou algumas conigurações.
2023-07-19 10:15:05 -03:00
Davidson Gomes
7767a2607e test: chatwoot 2023-07-19 08:18:07 -03:00
Davidson Gomes
429d1ac183 fix: Adjust in create store files 2023-07-19 08:14:11 -03:00
Davidson Gomes
f42928f88f fix: Adjust in create store files 2023-07-19 08:13:59 -03:00
Davidson Gomes
2d816ab92d
Merge pull request #5 from w3nder/develop
fix: create store folder
2023-07-19 08:11:16 -03:00
Davidson Gomes
aa75380662 fix: Adjust in validation for mexican and argentine numbers 2023-07-19 08:02:24 -03:00
Davidson Gomes
3cf0ced62e test: status/stories 2023-07-18 20:23:18 -03:00
Davidson Gomes
41fa700fb3 feat: translation set to default (english) in chatwoot 2023-07-18 16:01:05 -03:00
Davidson Gomes
a4ef9fb9b7 feat: translation set to default (english) in chatwoot 2023-07-18 15:55:24 -03:00
Davidson Gomes
1db23b5277 fix: Adjusts to receive contact with no whatsapp 2023-07-18 15:53:53 -03:00
Davidson Gomes
584f0cbac0 fix: Adjusts to receive contact with more numbers 2023-07-18 15:13:41 -03:00
Davidson Gomes
dc432a19a3 fix: Adjusts to receive contact with more numbers 2023-07-18 14:57:18 -03:00
Davidson Gomes
6727b1cfca fix: Adjusts to receive contact with more numbers 2023-07-18 14:49:38 -03:00
Davidson Gomes
8c7b0698f3 feat: Added apiKey in webhook and serverUrl in fetchInstance if EXPOSE_IN_FETCH_INSTANCES: true 2023-07-18 14:30:40 -03:00
Davidson Gomes
69e1622e82 feat: Send contact array in chatwoot 2023-07-18 13:17:03 -03:00
w3nder
af7a5d3248 Merge branch 'develop' of github.com:EvolutionAPI/evolution-api into develop 2023-07-18 13:08:59 -03:00
w3nder
7b1a4554ad fix: create folder store 2023-07-18 13:08:53 -03:00
Davidson Gomes
b3e213c133 fix: Added replace special caracters and espaces in instanceName 2023-07-18 12:58:53 -03:00
Davidson Gomes
a9fafec79d fix: Bug fix when connecting whatsapp does not send confirmation message 2023-07-18 12:50:18 -03:00
Davidson Gomes
7cacf7bbaf fix: Bug fix when connecting whatsapp does not send confirmation message 2023-07-18 12:47:03 -03:00
Davidson Gomes
44bf39f7b7 feat: Send contact in chatwoot 2023-07-18 12:36:26 -03:00
Davidson Gomes
0db8f7295b feat: Send contact in chatwoot 2023-07-18 12:33:55 -03:00
Davidson Gomes
c1226062b1 test: contacts update 2023-07-18 11:25:34 -03:00
Davidson Gomes
819ed168da fix: Fixed require fileName for document only in base64 for send media message 2023-07-18 11:23:40 -03:00
Davidson Gomes
19940953e2 fix: Fixed require fileName for document only in base64 for send media message 2023-07-18 11:21:55 -03:00
Davidson Gomes
f4af3eaf5d fix: adjusts in docker files 2023-07-18 11:00:40 -03:00
Davidson Gomes
718563fe6a fix: adjusts in docker files 2023-07-18 10:58:53 -03:00
Davidson Gomes
7e996ad6fa fix: change Baileys version, fixed problem to receive csat in chatwoot 2023-07-18 10:56:26 -03:00
Davidson Gomes
0b07fb6a49 fix: fixed bug that saved contacts from groups came without number in chatwoot 2023-07-17 15:40:46 -03:00
Davidson Gomes
0cb87e6ed9 feat: Created automation for creating instances in the chatwoot bot with the command #inbox_whatsapp:<INSTANCE_NAME> 2023-07-17 15:37:49 -03:00
Davidson Gomes
71a3e75ae2 fix: Fixed ghost mentions in send text message 2023-07-17 14:57:52 -03:00
Davidson Gomes
a2448ea4c1 fix: adjusts in returns in endpoints chatwoot and webhook 2023-07-17 11:33:18 -03:00
Davidson Gomes
8a14141021 fix: adjusts in returns in endpoints chatwoot and webhook 2023-07-17 11:33:08 -03:00
Davidson Gomes
69353892d9 feat: Added restart instance endpoint 2023-07-16 21:55:12 -03:00
Davidson Gomes
7a2fcc3469 fix: adjusts in dockerfile 2023-07-16 19:21:17 -03:00
Davidson Gomes
dfa6dd5011 fix: adjusts in dockerfile 2023-07-16 19:15:39 -03:00
Davidson Gomes
654400c0cf fix: adjusts in dockerfile 2023-07-16 19:14:00 -03:00
Davidson Gomes
3c15fc1b0d fix: adjusts in dockerfile 2023-07-16 19:05:17 -03:00
Davidson Gomes
4b32485e3c fix: adjusts in dockerfile 2023-07-16 18:52:21 -03:00
Davidson Gomes
b90736ed25 fix: adjusts in dockerfile 2023-07-16 18:51:03 -03:00
Davidson Gomes
f28d5c7781 fix: adjusts in dockerfile 2023-07-16 18:44:10 -03:00
Davidson Gomes
0654627478 fix: adjusts in dockerfile 2023-07-16 18:35:48 -03:00
Davidson Gomes
2e91a2ecdb fix: adjusts in env files 2023-07-16 18:26:53 -03:00
Davidson Gomes
66a8ceb27a feat: added messages.delete event 2023-07-16 18:16:51 -03:00
Davidson Gomes
e6b0addb6c feat: added messages.delete event 2023-07-16 18:16:05 -03:00
Davidson Gomes
c00f132145 fix: Added group membership validation before sending message to groups 2023-07-16 18:01:43 -03:00
Davidson Gomes
b9eb8d45b2 fix: removed link preview endpoint, now it's done automatically from sending conventional text 2023-07-16 17:57:37 -03:00
Davidson Gomes
ec7ad70458 fix: Now it's getting the API URL directly in the request, no longer need the variable in the env file 2023-07-16 17:38:01 -03:00
Davidson Gomes
64e19699fb fix: Docker files adjusted 2023-07-16 15:05:02 -03:00
Davidson Gomes
6d3e1b0cbe fix: Fixed error to send message in large groups 2023-07-16 15:01:38 -03:00
Davidson Gomes
d3a53e1d3c Merge tag '1.2.2' into develop
* Tweak in route "/" with version info
* Adjusts chatwoot version

- Chatwoot: v2.18.0
2023-07-15 09:37:39 -03:00
Davidson Gomes
23bbb3ee32 Merge branch 'release/1.2.2' 2023-07-15 09:37:25 -03:00
Davidson Gomes
56bfcd52b7 fix: Adjusts chatwoot version 2023-07-15 09:37:17 -03:00
Davidson Gomes
1c19b6de1e fix: Adjusts chatwoot version 2023-07-15 09:37:03 -03:00
Davidson Gomes
85bed0bdf1 Merge tag '1.2.1-3' into develop
* Adjusts in docker files
* Save picture url groups in chatwoot
2023-07-14 19:05:19 -03:00
Davidson Gomes
0102796769 Merge branch 'release/1.2.1-3' 2023-07-14 19:04:43 -03:00
Davidson Gomes
50b2a72f1b fix: change Baileys fork 2023-07-14 19:04:34 -03:00
Davidson Gomes
04cc239756 Merge tag '1.2.1-2' into develop
v
2023-07-14 19:04:00 -03:00
Davidson Gomes
0c20da2481 Merge branch 'release/1.2.1-2' 2023-07-14 19:03:51 -03:00
Davidson Gomes
72d2a563f3 fix: change Baileys fork 2023-07-14 19:03:41 -03:00
Davidson Gomes
6f3f8c944d Merge tag '1.2.1-1' into develop
* Adjusts in docker files
* Save picture url groups in chatwoot
2023-07-14 18:38:18 -03:00
Davidson Gomes
ed60fd2e82 Merge branch 'release/1.2.1-1' 2023-07-14 18:38:07 -03:00
Davidson Gomes
636fef4693 fix: change Baileys fork 2023-07-14 18:36:44 -03:00
Davidson Gomes
77775e2f85 Merge branch 'release/1.2.1' 2023-07-14 18:04:32 -03:00
Davidson Gomes
b260959a6e fix: Save picture url groups in chatwoot 2023-07-14 18:04:20 -03:00
Davidson Gomes
2a04f7b378 feat: Save picture url groups in chatwoot 2023-07-14 17:54:48 -03:00
Davidson Gomes
d4766f9c81 feat: Save picture url groups in chatwoot 2023-07-14 17:22:30 -03:00
Davidson Gomes
7f4c9b5b11 feat: Save picture url groups in chatwoot 2023-07-14 17:04:39 -03:00
Davidson Gomes
70f7c8ce89 feat: Save picture url groups in chatwoot 2023-07-14 17:04:15 -03:00
Davidson Gomes
f33a6aba39 fix: Adjusts in docker files 2023-07-14 15:29:04 -03:00
Davidson Gomes
236d717f10 Merge branch 'helioelias-feature/mongo-express-rebrow' into develop 2023-07-14 15:27:49 -03:00
Davidson Gomes
0fc160f57c fix: Adjusts in docker files 2023-07-14 15:27:33 -03:00
Helio Elias
666023d89a docker-compose full services 2023-07-14 18:04:36 +00:00
Helio Elias
8c4f2991c7 Change network in docker-compose(api, mongo and redis), add mongo-express and rebrow, tools for maintenance and visualize data 2023-07-14 17:59:29 +00:00
Helio Elias
4453dff36d Change network in docker-compose(api, mongo and redis), add mongo-express and rebrow, tools for maintenance and visualize data 2023-07-14 17:35:42 +00:00
Davidson Gomes
90b043561f Merge tag '1.2.0-1' into develop
v
2023-07-14 14:18:01 -03:00
Davidson Gomes
43a8b34673 Merge branch 'release/1.2.0-1' 2023-07-14 14:17:57 -03:00
Davidson Gomes
6005d33c94 feat: Added verbose logs and format chatwoot service 2023-07-14 14:17:48 -03:00
Davidson Gomes
cffb4736ce Merge tag '1.2.0' into develop
* Native integration with chatwoot
* Added returning or non-returning participants option in fetchAllGroups
* Added group integration to chatwoot
* Added automation on create instance to chatwoot
* Added verbose logs and format chatwoot service

* Adjusts in docker-compose files
* Adjusts in number validation for AR and MX numbers
* Adjusts in env files, removed save old_messages
* Fix when sending a message to a group I don't belong returns a bad request
* Fits the format on return from the fetchAllGroups endpoint
* Adjust in send document with caption from chatwoot
* Fixed message with undefind in chatwoot
* Changed message in path /
* Test duplicate message media in groups chatwoot
* Optimize send message from group with mentions
* Fixed name of the profile status in fetchInstances
* Fixed error 500 when logout in instance with status = close
2023-07-14 13:17:44 -03:00
Davidson Gomes
be54331d05 Merge branch 'release/1.2.0' 2023-07-14 13:17:18 -03:00
Davidson Gomes
e19b8255d3 feat: Added verbose logs and format chatwoot service 2023-07-14 13:16:54 -03:00
Davidson Gomes
d680900f07 feat: Added verbose logs and format chatwoot service 2023-07-14 11:56:42 -03:00
Davidson Gomes
78bd4fd7de fix: Fixed error 500 when logout in instance with status = close 2023-07-14 09:43:04 -03:00
Davidson Gomes
01d4a95d2d fix: Fixed error 500 when logout in instance with status = close 2023-07-14 09:42:56 -03:00
Davidson Gomes
bb4490307d fix: Fixed name of the profile status in fetchInstances 2023-07-14 08:42:26 -03:00
Davidson Gomes
be492a3e3f fix: optimize send message from group with mentions 2023-07-14 08:31:43 -03:00
Davidson Gomes
a7b05f1e85 fix: optimize send message from group with mentions 2023-07-14 06:40:33 -03:00
Davidson Gomes
1c5ae4eb4d fix: optimize send message from group with mentions 2023-07-13 20:12:29 -03:00
Davidson Gomes
16d03d20ac fix: optimize send message from group with mentions 2023-07-13 20:05:38 -03:00
Davidson Gomes
8f062fab7d fix: optimize send message from group with mentions 2023-07-13 20:05:26 -03:00
Davidson Gomes
2565b934a5 fix: test duplicate message media in groups chatwoot 2023-07-13 19:55:23 -03:00
Davidson Gomes
7e88a9084d fix: test duplicate message media in groups chatwoot 2023-07-13 19:23:59 -03:00
Davidson Gomes
ef03292e35 fix: fixed message with undefind in chatwoot 2023-07-13 17:31:32 -03:00
Davidson Gomes
d309ede623 fix: fixed message with undefind in chatwoot 2023-07-13 17:31:15 -03:00
Davidson Gomes
834a80c35a feat: automation chatwoot 2023-07-13 16:34:16 -03:00
Davidson Gomes
99b0288d1b feat: automation chatwoot 2023-07-13 16:26:01 -03:00
Davidson Gomes
926f58f336 feat: automation chatwoot 2023-07-13 16:19:31 -03:00
Davidson Gomes
b7bfe99520 feat: automation chatwoot 2023-07-13 15:53:40 -03:00
Davidson Gomes
fa60b68425 feat: automation chatwoot 2023-07-13 15:45:14 -03:00
Davidson Gomes
8622e1e4ff feat: automation chatwoot 2023-07-13 15:39:40 -03:00
Davidson Gomes
3e13ae9740 feat: added group integration to chatwoot 2023-07-13 12:41:29 -03:00
Davidson Gomes
e5cd577fbf feat: added group integration to chatwoot 2023-07-13 12:32:24 -03:00
Davidson Gomes
86985231ff feat: added group integration to chatwoot 2023-07-13 12:32:10 -03:00
Davidson Gomes
e64926a429 fix: Adjust in send document with caption from chatwoot 2023-07-13 11:35:42 -03:00
Davidson Gomes
6232190cfe fix: Adjust in send document with caption from chatwoot 2023-07-13 11:35:30 -03:00
Davidson Gomes
eb83d89307 feat: Show webhook_url for chatwoot 2023-07-13 11:19:48 -03:00
Davidson Gomes
b4a9941452 feat: Native integration with chatwoot 2023-07-13 08:29:08 -03:00
Davidson Gomes
be782ba512 feat: Added returning or non-returning participants option in fetchAllGroups 2023-07-13 07:19:32 -03:00
Davidson Gomes
db54f247a2 feat: chatwoot integration completed 2023-07-13 00:34:34 -03:00
Davidson Gomes
0fc3b47c88 feat: chatwoot integration completed 2023-07-13 00:27:18 -03:00
Davidson Gomes
3eda2a1f2a feat: chatwoot integration completed 2023-07-12 21:01:06 -03:00
Davidson Gomes
c45b2adad6 Merge branch 'feature/connect-chatwoot' into develop 2023-07-12 20:58:38 -03:00
Davidson Gomes
702dbebfbe feat: chatwoot integration completed 2023-07-12 20:58:18 -03:00
Davidson Gomes
052303cc93 feat: chatwoot integration completed 2023-07-12 20:28:51 -03:00
Davidson Gomes
69380146e4 fix: Adjusts in env files, removed save old_messages 2023-07-12 16:39:02 -03:00
Davidson Gomes
514fb56209 feat: chatwoot service and webhook endpoint 2023-07-12 16:37:21 -03:00
Davidson Gomes
57b61070d9 feat: Save chatwoot creds 2023-07-12 15:41:07 -03:00
Davidson Gomes
86ce00365a fix: Adjusts in env files, removed save old_messages 2023-07-12 14:39:43 -03:00
Davidson Gomes
a8bd32bef3 fix: Adjusts in env files, removed save old_messages 2023-07-12 14:31:05 -03:00
Davidson Gomes
ae8801dd8a fix: Adjusts in env files, removed save old_messages 2023-07-12 14:10:24 -03:00
Davidson Gomes
0a4e52e663 fix: Adjusts in env files, removed save old_messages 2023-07-12 11:52:00 -03:00
Davidson Gomes
95045db74e fix: Adjusts in number validation for AR and MX numbers 2023-07-12 11:15:45 -03:00
Davidson Gomes
19e7c0be0b Merge tag '1.1.5' into develop
v
2023-07-12 07:21:04 -03:00
Davidson Gomes
3fcbf458b6 Merge branch 'release/1.1.5' 2023-07-12 07:21:01 -03:00
Davidson Gomes
4580146cdb fix: adjusts in temp folder and return with event send_messages 2023-07-12 07:20:25 -03:00
Davidson Gomes
ea6a7c1c87 Merge branch 'release/1.1.4-1' 2023-07-12 07:17:05 -03:00
Davidson Gomes
06cde721b3 fix: adjusts in temp folder and return with event send_messages 2023-07-12 07:16:45 -03:00
Davidson Gomes
31486e5963 fix: adjusts in temp folder and return with event send_messages 2023-07-12 07:05:18 -03:00
Davidson Gomes
1b52bdf425 Merge tag '1.1.4' into develop
* Route to send status broadcast
* Added verbose logs
* Insert allContacts in payload of endpoint sendStatus

* Adjusted set in webhook to go empty when enabled false
* Adjust in store files
* Fixed the problem when do not save contacts when receive messages
* Changed owner of the jid for instanceName
* Create .env for installation in docker
2023-07-08 11:01:28 -03:00
Davidson Gomes
9b59895ad2 Merge branch 'release/1.1.4' 2023-07-08 11:01:21 -03:00
Davidson Gomes
c7600ff059 fix: Create .env for installation in docker 2023-07-08 11:01:10 -03:00
Davidson Gomes
b1769edb65 fix: Create .env for installation in docker 2023-07-08 11:00:33 -03:00
Davidson Gomes
14ad09e867 fix: Create .env for installation in docker 2023-07-08 10:56:57 -03:00
Davidson Gomes
26a99d3696 fix: Create .env for installation in docker 2023-07-08 10:53:48 -03:00
Davidson Gomes
c973730acc fix: Create .env for installation in docker 2023-07-08 10:50:20 -03:00
Davidson Gomes
048bea376d fix: Changed owner of the jid for instanceName 2023-07-08 07:47:06 -03:00
Davidson Gomes
eca4285ea8 fix: Fixed the problem when do not save contacts when receive messages 2023-07-08 07:15:34 -03:00
Davidson Gomes
437803da07 feat: Added verbose logs 2023-07-08 06:52:56 -03:00
Davidson Gomes
a7be7c3e19 fix: Adjust in store files 2023-07-07 15:55:33 -03:00
Davidson Gomes
5bd7dd3022 fix: Adjusted set in webhook to go empty when enabled false 2023-07-07 13:14:53 -03:00
Davidson Gomes
27aa0add4e fix: Adjusted set in webhook to go empty when enabled false 2023-07-07 13:12:51 -03:00
Davidson Gomes
24712c4c2d feat: Route to send status broadcast 2023-07-06 16:39:58 -03:00
Davidson Gomes
4bf4b4a045 feat: Route to send status broadcast 2023-07-06 16:03:48 -03:00
Davidson Gomes
9604f5c317 feat: Route to send status broadcast 2023-07-06 13:57:13 -03:00
Davidson Gomes
69c1059644 feat: Route to send status broadcast 2023-07-06 13:55:14 -03:00
Davidson Gomes
26b2903995 Merge tag '1.1.3' into develop
* Added configuration for Baileys log level in env
* Added audio to mp4 converter in optionally get Base64 From MediaMessage
* Added organization name in vcard
* Added email in vcard
* Added url in vcard
* Added verbose logs

* Added timestamp internally in urls to avoid caching
* Correction in decryption of poll votes
* Change in the way the api sent and saved the sent messages, now it goes in the messages.upsert event
* Fixed cash when sending stickers via url
* Improved how Redis works for instances
* Fixed problem when disconnecting the instance it removes the instance
* Fixed problem sending ack when preview is done by me
* Adjust in store files
2023-07-06 11:44:58 -03:00
Davidson Gomes
97abb256d5 Merge branch 'release/1.1.3' 2023-07-06 11:44:47 -03:00
Davidson Gomes
a342911dae changelog to release 1.1.3 2023-07-06 11:44:20 -03:00
Davidson Gomes
1f43563295 file postman removed 2023-07-06 11:38:18 -03:00
Davidson Gomes
f23ebf1e99 feat: Added verbose logs 2023-07-06 11:37:30 -03:00
Davidson Gomes
d66b751c2e doc: adjusts in readme 2023-07-06 09:34:48 -03:00
Davidson Gomes
6a7c76a9ba added url in vcard 2023-07-05 21:20:13 -03:00
Davidson Gomes
2338787dbb added url in vcard 2023-07-05 21:20:04 -03:00
Davidson Gomes
a216c9cc37 change changelog file 2023-07-05 21:15:01 -03:00
Davidson Gomes
b7da8d2193 added email in vcard 2023-07-05 21:14:44 -03:00
Davidson Gomes
41f191902b added organization name in vcard 2023-07-05 20:56:42 -03:00
Davidson Gomes
37397c7a69 change changelog file 2023-07-05 20:16:39 -03:00
Davidson Gomes
153695288e change changelog file 2023-07-05 20:06:45 -03:00
Davidson Gomes
a5e29758a4 added organization name in vcard 2023-07-05 20:05:24 -03:00
Davidson Gomes
964427e533 change changelog file 2023-07-05 19:17:06 -03:00
Davidson Gomes
0a925df2a9 adjust in store files 2023-07-05 19:16:47 -03:00
Davidson Gomes
db95de6731 log verbose in file redis 2023-07-05 15:58:46 -03:00
Davidson Gomes
bc2191eae6 log verbose in file redis 2023-07-05 15:49:46 -03:00
Davidson Gomes
9fed844e59 log verbose in file redis 2023-07-05 15:48:02 -03:00
Davidson Gomes
a2c125ee90 log verbose in file redis 2023-07-05 15:45:41 -03:00
Davidson Gomes
a2779612be log verbose in file redis 2023-07-05 12:54:19 -03:00
Davidson Gomes
f51c3b6519 feat: Added audio to mp4 converter in optionally get Base64 From MediaMessage 2023-07-04 17:16:31 -03:00
Davidson Gomes
870968a7c5 fix: Fixed problem when disconnecting the instance it removes the instance 2023-07-04 14:27:38 -03:00
Davidson Gomes
c4f39ab85c fix: Improved how Redis works for instances 2023-07-04 12:38:29 -03:00
Davidson Gomes
8cb431ad40 Fixed cash when sending stickers via url 2023-07-02 21:31:10 -03:00
Davidson Gomes
77f98c2438 Added destructor in redis connection 2023-07-02 20:17:13 -03:00
Davidson Gomes
d7d0e5ec82 Correction in decryption of poll votes 2023-07-02 19:58:05 -03:00
Davidson Gomes
2519efb3ea Added timestamp internally in urls to avoid caching 2023-07-01 10:17:29 -03:00
Davidson Gomes
b1c527cb71 Merge tag '1.1.2' into develop
* Fixed baileys version in package.json
* Fixed problem that did not validate if the token passed in create instance already existed
* Fixed problem that does not delete instance files in server mode
2023-06-28 13:45:14 -03:00
Davidson Gomes
b87f687e55 Merge branch 'release/1.1.2' 2023-06-28 13:45:04 -03:00
Davidson Gomes
a62d27ffc2 fix: fix problems in create instance and delete instance files 2023-06-28 13:44:58 -03:00
Davidson Gomes
a9a1c6c49b Merge tag '1.1.2' into develop
* Fixed problem that did not validate if the token passed in create instance already existed
* Fixed problem that does not delete instance files in server mode
2023-06-28 13:44:07 -03:00
Davidson Gomes
4989d6ddfa Merge branch 'release/1.1.2' 2023-06-28 13:43:48 -03:00
Davidson Gomes
fd01b9de36 fix: fix problems in create instance and delete instance files 2023-06-28 13:43:36 -03:00
Davidson Gomes
1017010e15 fix: fix problems in create instance and delete instance files 2023-06-28 13:42:35 -03:00
Davidson Gomes
e0bd06489f Merge tag '1.1.1' into develop
* Added group invitation sending
* Added webhook configuration per event in the individual instance registration
2023-06-28 10:29:48 -03:00
Davidson Gomes
4a6301c2af Merge branch 'release/1.1.1' 2023-06-28 10:29:37 -03:00
Davidson Gomes
bca830dc54 feat: Added group invitation sending and Added webhook configuration per event in the individual instance registration 2023-06-28 10:29:24 -03:00
Davidson Gomes
77bde5325e Merge tag '1.1.0-2' into develop
Adjusts reame.md
2023-06-23 08:39:41 -03:00
Davidson Gomes
bdca506dd4 Merge branch 'release/1.1.0-2' 2023-06-23 08:39:28 -03:00
Davidson Gomes
34faaa28ca Adjusts readme.md 2023-06-23 08:39:12 -03:00
Davidson Gomes
a08d433d0a Merge tag '1.1.0-1' into develop
v
2023-06-21 16:53:16 -03:00
Davidson Gomes
6d08162012 Merge branch 'release/1.1.0-1' 2023-06-21 16:53:13 -03:00
Davidson Gomes
2481650028 Remove recording of old messages on sync 2023-06-21 16:52:50 -03:00
Davidson Gomes
5e551fee41 Merge tag '1.1.0' into develop
* Improved fetch instances endpoint, now it also fetch other instances even if they are not connected
* Added conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg
* Route to fetch all groups that the connection is part of
* Route to fetch all privacy settings
* Route to update the privacy settings
* Route to update group subject
* Route to update group description
* Route to accept invite code
* Added configuration of events by webhook of instances
* Now the api key can be exposed in fetch instances if the EXPOSE_IN_FETCH_INSTANCES variable is set to true
* Added option to generate qrcode as soon as the instance is created
* The created instance token can now also be optionally defined manually in the creation endpoint
* Route to send Sticker

* Adjust dockerfile variables
* tweaks in docker-compose to pass variables
* Adjust the route getProfileBusiness to fetchProfileBusiness
* fix error after logout and try to get status or to connect again
* fix sending narrated audio on whatsapp android and ios
* fixed the problem of not disabling the global webhook by the variable
* Adjustment in the recording of temporary files and periodic cleaning
* Fix for container mode also work only with files
2023-06-21 11:18:43 -03:00
Davidson Gomes
e05690af4c Merge branch 'release/1.1.0' 2023-06-21 11:18:25 -03:00
Davidson Gomes
8e65dd0546 changelog release 1.1.0 2023-06-21 11:18:11 -03:00
Davidson Gomes
509442a2f3 changelog release 1.1.0 2023-06-21 11:17:40 -03:00
Davidson Gomes
a5102d1b94 new postman file 2023-06-21 11:16:44 -03:00
Davidson Gomes
19ee2b3f34 fix: fix for container mode also work only with files 2023-06-20 19:31:39 -03:00
Davidson Gomes
5d29c2d881 fix: fix for container mode also work only with files 2023-06-20 19:29:47 -03:00
Davidson Gomes
a08bbab9dc feat: route to send Sticker 2023-06-20 16:47:26 -03:00
Davidson Gomes
84f6394f1f fix: Adjustment in the recording of temporary files and periodic cleaning 2023-06-20 14:57:30 -03:00
Davidson Gomes
d359949310 fix: Adjustment in the recording of temporary files and periodic cleaning 2023-06-20 14:57:19 -03:00
Davidson Gomes
30cd8a03eb feat: the created instance token can now also be optionally defined manually in the creation endpoint 2023-06-20 09:07:26 -03:00
Davidson Gomes
1b7015c0df conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg 2023-06-19 22:37:42 -03:00
Davidson Gomes
55b14641e0 conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg 2023-06-19 22:30:59 -03:00
Davidson Gomes
4936d7fcc6 conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg 2023-06-19 22:29:07 -03:00
Davidson Gomes
b8fa43296d conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg 2023-06-19 22:28:39 -03:00
Davidson Gomes
631dd01c92 feat: added option to generate qrcode as soon as the instance is created 2023-06-13 17:42:30 -03:00
Davidson Gomes
fdc72bc84e feat: added option to generate qrcode as soon as the instance is created 2023-06-13 17:35:13 -03:00
Davidson Gomes
c63da9cd6e feat: added option to generate qrcode as soon as the instance is created 2023-06-13 17:23:52 -03:00
Davidson Gomes
849d570bcb fixed docker files and quoted message option 2023-06-13 14:08:26 -03:00
Davidson Gomes
85e6efb8b0 fixed docker files and quoted message option 2023-06-13 13:14:53 -03:00
Davidson Gomes
485c8c3113 fixed docker files and quoted message option 2023-06-13 13:11:24 -03:00
Davidson Gomes
f2d0a8eb8c fixed the problem of not disabling the global webhook by the variable and apikey only appears if it is enabled to be exposed 2023-06-13 11:52:30 -03:00
Davidson Gomes
9201bc1022 fix sending narrated audio on whatsapp android and ios 2023-06-13 11:41:17 -03:00
Davidson Gomes
2847a95c57 feat: expose api key in fetch instances 2023-06-12 16:07:38 -03:00
Davidson Gomes
fc30bb9852 feat: Added configuration of events by webhook of instances 2023-06-12 14:40:26 -03:00
Davidson Gomes
0f360d34e8 fix: readme 2023-06-12 13:45:51 -03:00
Davidson Gomes
ec435e086f fix: readme 2023-06-12 13:41:33 -03:00
Davidson Gomes
1efe7f7cde fix: readme 2023-06-12 13:35:47 -03:00
Davidson Gomes
5759341c52 feat: accept invite code 2023-06-12 12:08:53 -03:00
Davidson Gomes
ea9ba27f22 feat: Route to update group description 2023-06-12 12:05:52 -03:00
Davidson Gomes
a28bbce1f9 feat: Route to update group subject 2023-06-12 12:02:10 -03:00
Davidson Gomes
75b48aa8ac fix error after logout and try to get status or to connect again 2023-06-12 10:32:47 -03:00
Davidson Gomes
573e56cd8c feat: Route to update the privacy settings 2023-06-11 19:24:19 -03:00
Davidson Gomes
ab28b4c0c5 feat: Route to update the privacy settings 2023-06-11 11:38:26 -03:00
Davidson Gomes
55e36f24a5 feat: Route to fetch all privacy settings 2023-06-11 11:04:52 -03:00
Davidson Gomes
ea8d6bf6c8 feat: Route to fetch all groups that the connection is part of 2023-06-11 11:00:40 -03:00
Davidson Gomes
75b8bcb853 feat: Added conversion of audios for sending recorded audio 2023-06-11 10:36:59 -03:00
Davidson Gomes
2b2cc2effc feat: Added conversion of audios for sending recorded audio 2023-06-11 10:29:49 -03:00
Davidson Gomes
ae1c5908ae feat: Improved fetch instances endpoint and prepare changelog to version 1.1.0 in homolog 2023-06-10 18:56:11 -03:00
Davidson Gomes
f067cb99c8 fix: adjust in docker-compose file and added all variables in dockerfile 2023-06-10 18:11:28 -03:00
Davidson Gomes
7e7d3a1659 fix: adjust in docker-compose file and added all variables in dockerfile 2023-06-10 17:46:45 -03:00
Davidson Gomes
c5f364f3e4 fix: adjust in docker-compose file and added all variables in dockerfile 2023-06-10 15:48:28 -03:00
Davidson Gomes
2a6366ef85 Merge tag '1.0.9' into develop
* Adjust dockerfile variables
2023-06-10 12:06:13 -03:00
Davidson Gomes
66fa855485 Merge branch 'release/1.0.9' 2023-06-10 12:06:03 -03:00
Davidson Gomes
829b078b25 fix: adjust dockerfile variables 2023-06-10 12:05:54 -03:00
Davidson Gomes
5cf1eacd1f fix: adjust dockerfile variables 2023-06-10 12:04:33 -03:00
Davidson Gomes
7041cd7483 Merge tag '1.0.8' into develop
* Added Docker compose file
* Added ChangeLog file
2023-06-09 10:21:22 -03:00
355 changed files with 50767 additions and 8576 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -1,5 +1,7 @@
.git .git
*Dockerfile* *Dockerfile*
*docker-compose* *docker-compose*
package-lock.json
.env
node_modules node_modules
dist dist

291
.env.example Normal file
View File

@ -0,0 +1,291 @@
SERVER_TYPE=http
SERVER_PORT=8080
# Server URL - Set your application url
SERVER_URL=http://localhost:8080
SSL_CONF_PRIVKEY=/path/to/cert.key
SSL_CONF_FULLCHAIN=/path/to/cert.crt
SENTRY_DSN=
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
CORS_ORIGIN=*
CORS_METHODS=GET,POST,PUT,DELETE
CORS_CREDENTIALS=true
# Determine the logs to be displayed
LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET
LOG_COLOR=true
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
LOG_BAILEYS=error
# Set the maximum number of listeners that can be registered for an event
EVENT_EMITTER_MAX_LISTENERS=50
# Determine how long the instance should be deleted from memory in case of no connection.
# Default time: 5 minutes
# If you don't even want an expiration, enter the value false
DEL_INSTANCE=false
# Provider: postgresql | mysql
DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution?schema=public'
# Client name for the database connection
# It is used to separate an API installation from another that uses the same database.
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
# Choose the data you want to save in the application's database
DATABASE_SAVE_DATA_INSTANCE=true
DATABASE_SAVE_DATA_NEW_MESSAGE=true
DATABASE_SAVE_MESSAGE_UPDATE=true
DATABASE_SAVE_DATA_CONTACTS=true
DATABASE_SAVE_DATA_CHATS=true
DATABASE_SAVE_DATA_LABELS=true
DATABASE_SAVE_DATA_HISTORIC=true
DATABASE_SAVE_IS_ON_WHATSAPP=true
DATABASE_SAVE_IS_ON_WHATSAPP_DAYS=7
DATABASE_DELETE_MESSAGE=true
# RabbitMQ - Environment variables
RABBITMQ_ENABLED=false
RABBITMQ_URI=amqp://localhost
RABBITMQ_EXCHANGE_NAME=evolution
RABBITMQ_FRAME_MAX=8192
# Global events - By enabling this variable, events from all instances are sent in the same event queue.
RABBITMQ_GLOBAL_ENABLED=false
# Prefix key to queue name
RABBITMQ_PREFIX_KEY=evolution
# Choose the events you want to send to RabbitMQ
RABBITMQ_EVENTS_APPLICATION_STARTUP=false
RABBITMQ_EVENTS_INSTANCE_CREATE=false
RABBITMQ_EVENTS_INSTANCE_DELETE=false
RABBITMQ_EVENTS_QRCODE_UPDATED=false
RABBITMQ_EVENTS_MESSAGES_SET=false
RABBITMQ_EVENTS_MESSAGES_UPSERT=false
RABBITMQ_EVENTS_MESSAGES_EDITED=false
RABBITMQ_EVENTS_MESSAGES_UPDATE=false
RABBITMQ_EVENTS_MESSAGES_DELETE=false
RABBITMQ_EVENTS_SEND_MESSAGE=false
RABBITMQ_EVENTS_SEND_MESSAGE_UPDATE=false
RABBITMQ_EVENTS_CONTACTS_SET=false
RABBITMQ_EVENTS_CONTACTS_UPSERT=false
RABBITMQ_EVENTS_CONTACTS_UPDATE=false
RABBITMQ_EVENTS_PRESENCE_UPDATE=false
RABBITMQ_EVENTS_CHATS_SET=false
RABBITMQ_EVENTS_CHATS_UPSERT=false
RABBITMQ_EVENTS_CHATS_UPDATE=false
RABBITMQ_EVENTS_CHATS_DELETE=false
RABBITMQ_EVENTS_GROUPS_UPSERT=false
RABBITMQ_EVENTS_GROUP_UPDATE=false
RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
RABBITMQ_EVENTS_CONNECTION_UPDATE=false
RABBITMQ_EVENTS_REMOVE_INSTANCE=false
RABBITMQ_EVENTS_LOGOUT_INSTANCE=false
RABBITMQ_EVENTS_CALL=false
RABBITMQ_EVENTS_TYPEBOT_START=false
RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS=false
# SQS - Environment variables
SQS_ENABLED=false
SQS_ACCESS_KEY_ID=
SQS_SECRET_ACCESS_KEY=
SQS_ACCOUNT_ID=
SQS_REGION=
# Websocket - Environment variables
WEBSOCKET_ENABLED=false
WEBSOCKET_GLOBAL_EVENTS=false
# Pusher - Environment variables
PUSHER_ENABLED=false
PUSHER_GLOBAL_ENABLED=false
PUSHER_GLOBAL_APP_ID=
PUSHER_GLOBAL_KEY=
PUSHER_GLOBAL_SECRET=
PUSHER_GLOBAL_CLUSTER=
PUSHER_GLOBAL_USE_TLS=true
# Choose the events you want to send to Pusher
PUSHER_EVENTS_APPLICATION_STARTUP=true
PUSHER_EVENTS_QRCODE_UPDATED=true
PUSHER_EVENTS_MESSAGES_SET=true
PUSHER_EVENTS_MESSAGES_UPSERT=true
PUSHER_EVENTS_MESSAGES_EDITED=true
PUSHER_EVENTS_MESSAGES_UPDATE=true
PUSHER_EVENTS_MESSAGES_DELETE=true
PUSHER_EVENTS_SEND_MESSAGE=true
PUSHER_EVENTS_SEND_MESSAGE_UPDATE=true
PUSHER_EVENTS_CONTACTS_SET=true
PUSHER_EVENTS_CONTACTS_UPSERT=true
PUSHER_EVENTS_CONTACTS_UPDATE=true
PUSHER_EVENTS_PRESENCE_UPDATE=true
PUSHER_EVENTS_CHATS_SET=true
PUSHER_EVENTS_CHATS_UPSERT=true
PUSHER_EVENTS_CHATS_UPDATE=true
PUSHER_EVENTS_CHATS_DELETE=true
PUSHER_EVENTS_GROUPS_UPSERT=true
PUSHER_EVENTS_GROUPS_UPDATE=true
PUSHER_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
PUSHER_EVENTS_CONNECTION_UPDATE=true
PUSHER_EVENTS_LABELS_EDIT=true
PUSHER_EVENTS_LABELS_ASSOCIATION=true
PUSHER_EVENTS_CALL=true
PUSHER_EVENTS_TYPEBOT_START=false
PUSHER_EVENTS_TYPEBOT_CHANGE_STATUS=false
# WhatsApp Business API - Environment variables
# Token used to validate the webhook on the Facebook APP
WA_BUSINESS_TOKEN_WEBHOOK=evolution
WA_BUSINESS_URL=https://graph.facebook.com
WA_BUSINESS_VERSION=v20.0
WA_BUSINESS_LANGUAGE=en_US
# Global Webhook Settings
# Each instance's Webhook URL and events will be requested at the time it is created
WEBHOOK_GLOBAL_ENABLED=false
# Define a global webhook that will listen for enabled events from all instances
WEBHOOK_GLOBAL_URL=''
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
# Set the events you want to hear
WEBHOOK_EVENTS_APPLICATION_STARTUP=false
WEBHOOK_EVENTS_QRCODE_UPDATED=true
WEBHOOK_EVENTS_MESSAGES_SET=true
WEBHOOK_EVENTS_MESSAGES_UPSERT=true
WEBHOOK_EVENTS_MESSAGES_EDITED=true
WEBHOOK_EVENTS_MESSAGES_UPDATE=true
WEBHOOK_EVENTS_MESSAGES_DELETE=true
WEBHOOK_EVENTS_SEND_MESSAGE=true
WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=true
WEBHOOK_EVENTS_CONTACTS_SET=true
WEBHOOK_EVENTS_CONTACTS_UPSERT=true
WEBHOOK_EVENTS_CONTACTS_UPDATE=true
WEBHOOK_EVENTS_PRESENCE_UPDATE=true
WEBHOOK_EVENTS_CHATS_SET=true
WEBHOOK_EVENTS_CHATS_UPSERT=true
WEBHOOK_EVENTS_CHATS_UPDATE=true
WEBHOOK_EVENTS_CHATS_DELETE=true
WEBHOOK_EVENTS_GROUPS_UPSERT=true
WEBHOOK_EVENTS_GROUPS_UPDATE=true
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
WEBHOOK_EVENTS_REMOVE_INSTANCE=false
WEBHOOK_EVENTS_LOGOUT_INSTANCE=false
WEBHOOK_EVENTS_LABELS_EDIT=true
WEBHOOK_EVENTS_LABELS_ASSOCIATION=true
WEBHOOK_EVENTS_CALL=true
# This events is used with Typebot
WEBHOOK_EVENTS_TYPEBOT_START=false
WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
# This event is used to send errors
WEBHOOK_EVENTS_ERRORS=false
WEBHOOK_EVENTS_ERRORS_WEBHOOK=
WEBHOOK_REQUEST_TIMEOUT_MS=60000
WEBHOOK_RETRY_MAX_ATTEMPTS=10
WEBHOOK_RETRY_INITIAL_DELAY_SECONDS=5
WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF=true
WEBHOOK_RETRY_MAX_DELAY_SECONDS=300
WEBHOOK_RETRY_JITTER_FACTOR=0.2
# Comma separated list of HTTP status codes that should not trigger retries
WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES=400,401,403,404,422
# Name that will be displayed on smartphone connection
CONFIG_SESSION_PHONE_CLIENT=Evolution API
# Browser Name = Chrome | Firefox | Edge | Opera | Safari
CONFIG_SESSION_PHONE_NAME=Chrome
# Whatsapp Web version for baileys channel
# https://web.whatsapp.com/check-update?version=0&platform=web
# CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200
# Set qrcode display limit
QRCODE_LIMIT=30
# Color of the QRCode on base64
QRCODE_COLOR='#175197'
# Typebot - Environment variables
TYPEBOT_ENABLED=false
# old | latest
TYPEBOT_API_VERSION=latest
# Chatwoot - Environment variables
CHATWOOT_ENABLED=false
# If you leave this option as false, when deleting the message for everyone on WhatsApp, it will not be deleted on Chatwoot.
CHATWOOT_MESSAGE_READ=true
# 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.
CHATWOOT_MESSAGE_DELETE=true
# 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.
CHATWOOT_BOT_CONTACT=true
# This db connection is used to import messages from whatsapp to chatwoot database
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://user:passwprd@host:5432/chatwoot?sslmode=disable
CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
# OpenAI - Environment variables
OPENAI_ENABLED=false
# Dify - Environment variables
DIFY_ENABLED=false
# n8n - Environment variables
N8N_ENABLED=false
# EvoAI - Environment variables
EVOAI_ENABLED=false
# Cache - Environment variables
# Redis Cache enabled
CACHE_REDIS_ENABLED=true
CACHE_REDIS_URI=redis://localhost:6379/6
CACHE_REDIS_TTL=604800
# Prefix serves to differentiate data from one installation to another that are using the same redis
CACHE_REDIS_PREFIX_KEY=evolution
# Enabling this variable will save the connection information in Redis and not in the database.
CACHE_REDIS_SAVE_INSTANCES=false
# Local Cache enabled
CACHE_LOCAL_ENABLED=false
# Amazon S3 - Environment variables
S3_ENABLED=false
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET=evolution
S3_PORT=443
S3_ENDPOINT=s3.domain.com
S3_REGION=eu-west-3
S3_USE_SSL=true
# AMAZON S3 - Environment variables
# S3_ENABLED=true
# S3_BUCKET=bucket_name
# S3_ACCESS_KEY=access_key_id
# S3_SECRET_KEY=secret_access_key
# S3_ENDPOINT=s3.amazonaws.com # region: s3.eu-west-3.amazonaws.com
# S3_REGION=eu-west-3
# MINIO Use SSL - Environment variables
# S3_ENABLED=true
# S3_ACCESS_KEY=access_key_id
# S3_SECRET_KEY=secret_access_key
# S3_BUCKET=bucket_name
# S3_PORT=443
# S3_ENDPOINT=s3.domain.com
# S3_USE_SSL=true
# S3_REGION=eu-south
# Evolution Audio Converter - Environment variables - https://github.com/EvolutionAPI/evolution-audio-converter
# API_AUDIO_CONVERTER=http://localhost:4040/process-audio
# API_AUDIO_CONVERTER_KEY=429683C4C977415CAAFCCE10F7D57E11
# Define a global apikey to access all instances.
# OBS: This key must be inserted in the request header to create an instance.
AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
# If you leave this option as true, the instances will be exposed in the fetch instances endpoint.
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
LANGUAGE=en
# Define a global proxy to be used if the instance does not have one
# PROXY_HOST=
# PROXY_PORT=80
# PROXY_PROTOCOL=http
# PROXY_USERNAME=
# PROXY_PASSWORD=

View File

@ -1,42 +1,46 @@
module.exports = { module.exports = {
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
sourceType: 'CommonJS', project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: false,
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
}, },
plugins: ['@typescript-eslint/eslint-plugin'], plugins: ['@typescript-eslint', 'simple-import-sort', 'import'],
extends: [ extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:prettier/recommended'
],
globals: { globals: {
Atomics: 'readonly', Atomics: 'readonly',
SharedArrayBuffer: 'readonly', SharedArrayBuffer: 'readonly',
}, },
root: true, root: true,
env: { env: {
node: true, node: true,
jest: true, jest: true,
}, },
ignorePatterns: ['.eslintrc.js'], ignorePatterns: ['.eslintrc.js'],
rules: { rules: {
'@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/ban-types': [ 'import/first': 'error',
'error', 'import/no-duplicates': 'error',
{ 'simple-import-sort/imports': 'error',
extendDefaults: true, 'simple-import-sort/exports': 'error',
types: { '@typescript-eslint/ban-types': [
'{}': false, 'error',
Object: false, {
}, extendDefaults: true,
types: {
'{}': false,
Object: false,
}, },
], },
'prettier/prettier': ['error', { endOfLine: 'auto' }], ],
'prettier/prettier': ['error', { endOfLine: 'auto' }],
}, },
}; };

View File

@ -0,0 +1,107 @@
name: Bug Report
description: Create a report to help us improve.
labels:
- bug
- en
# - help wanted
# Automatically assign the issue to:
# assignees: DavidsonGomes
body:
- type: checkboxes
id: terms
attributes:
label: Welcome!
description: |
The issue tracker is only for reporting bugs and feature requests.
For user-related support questions, please visit:
- [Discord](https://evolution-api.com/discord)
- [WhatsApp Group](https://evolution-api.com/whatsapp)
<br/>
**DO NOT OPEN AN ISSUE FOR GENERAL SUPPORT QUESTIONS.**
options:
- label: Yes, I have searched for similar issues on [GitHub](https://github.com/EvolutionAPI/evolution-api/issues) and found none.
required: true
- type: textarea
attributes:
label: What did you do?
description: |
How to write a good bug report?
- Respect the issue template as much as possible.
- The title should be short and descriptive.
- Explain the conditions that led you to report this issue: the context.
- The context should lead to something, an idea or problem you are facing.
- Be clear and concise.
- 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)
placeholder: Describe the problem you encountered in detail.
validations:
required: true
- type: textarea
attributes:
label: What did you expect?
placeholder: Describe what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: What did you observe instead of what you expected?
placeholder: Explain what actually happens when you follow the steps above.
validations:
required: true
- type: textarea
attributes:
label: Screenshots/Videos
placeholder: |
If possible, add screenshots or videos that illustrate the problem. This can be extremely helpful in understanding the issue better.
- type: textarea
attributes:
label: Which version of the API are you using?
description: |
Enter the version number found in the `version` property of the **package.json**.
placeholder: Paste the version here.
validations:
required: true
- type: dropdown
id: select
attributes:
label: What is your environment?
options:
- Windows
- Linux
- Mac
- Docker
- Other
validations:
required: true
- type: textarea
attributes:
label: Other environment specifications
placeholder: 'Hardware/Software: [e.g., CPU, GPU]'
validations:
required: false
- type: textarea
attributes:
label: If applicable, paste the log output
description: |
Please attach any logs that might be related to the issue.
If the logs contain sensitive information, consider sending them privately to one of the project maintainers.
placeholder: Paste the application log here.
validations:
required: false
- type: textarea
attributes:
label: Additional Notes
description: Include any other information you think might be useful to understand or resolve the bug.
validations:
required: false

View File

@ -0,0 +1,86 @@
name: Feature Request
description: Suggest ideas for the project.
labels:
- enhancement
- en
# Automatically assign the issue to:
# assignees: DavidsonGomes
body:
- type: checkboxes
id: terms
attributes:
label: Welcome!
description: '**DO NOT OPEN FOR GENERAL SUPPORT QUESTIONS.**'
options:
- label: Yes, I have searched for similar requests on [GitHub](https://github.com/code-chat-br/whatsapp-api/issues) and found none.
required: true
- type: dropdown
attributes:
label: What type of feature?
description: |
How to write a good feature request?
- Respect the issue template as much as possible.
- The title should be short and descriptive.
- Explain the conditions that led you to suggest this feature: the context.
- The context should lead to something, an idea or problem you are facing.
- Be clear and concise.
- 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)
options:
- Integration
- Functionality
- Endpoint
- Database adjustment
- Other
validations:
required: true
- type: textarea
attributes:
label: What is the motivation for the request?
description: |
What problem does the feature seek to solve?
Clearly and in detail describe the functionality you want to be implemented.
Explain how it fits into the context of the project.
placeholder: Detailed description
validations:
required: true
- type: textarea
attributes:
label: Usage Examples
description: |
Provide specific examples of how this functionality could be used.
This can include scenarios or use cases where the feature would be particularly beneficial.
placeholder: text - image - video - flowcharts
validations:
required: false
- type: textarea
attributes:
label: How should the feature be developed?
description: |
Should it be inserted directly into the code?
Should it be built as a different application that acts as an extension of the API?
For example: a `worker`?
Discuss how this new functionality could impact other parts of the project, if applicable.
---
If you have ideas on how this functionality could be implemented, please share them here.
This is not mandatory, but it can be helpful for the development team.
placeholder: Insert feature ideas here
validations:
required: false
- type: textarea
attributes:
label: Additional Notes
description: Any other information you believe is relevant to your request.
placeholder: Insert your observations here.
validations:
required: false

View File

@ -0,0 +1,108 @@
name: Relatório de bug
description: Crie um relatório para nos ajudar a melhorar.
labels:
- bug
- pt-br
# - help wanted
# Atrubuir automaticamente a issue a:
# assignees: DavidsonGomes
body:
- type: checkboxes
id: termos
attributes:
label: Bem-vido!
description: |
O rastreador de problemas é apenas para relatar bugs e solicitações de recursos.
Para perguntas de suporte relacionadas ao usuário final, acesse:
- [Discord](https://evolution-api.com/discord)
- [Grupo do WhatsApp](https://evolution-api.com/whatsapp)
<br/>
**NÃO ABRA UM PROBLEMA PARA PERGUNTAS GERAIS DE SUPORTE.**
options:
- label: Sim, pesquisei problemas semelhantes no [GitHub](https://github.com/EvolutionAPI/evolution-api/issues) e não encontrei nenhum.
required: true
- type: textarea
attributes:
label: O que você fez?
description: |
Como escrever um bom relatório de bug?
- Respeite o modelo de problema tanto quanto possível.
- O título deve ser curto e descritivo.
- Explique as condições que o levaram a reportar este problema: o contexto.
- O contexto deve levar a algo, ideia ou problema que você está enfrentando.
- Seja claro e conciso.
- Formate suas mensagens para ajudar o leitor a se concentrar no que importa e entender a estrutura da sua mensagem, use [sintaxe Markdown](https://help.github.com/articles/github-flavored-markdown)
placeholder: Descreva detalhadamente o problema que você encontrou.
validations:
required: true
- type: textarea
attributes:
label: O que você esperava?
placeholder: Descreva o que você esperava que acontecesse.
validations:
required: true
- type: textarea
attributes:
label: O que vc observou ao invés do que esperava?
placeholder: Explique o que realmente acontece quando você segue os passos acima.
validations:
required: true
- type: textarea
attributes:
label: Capturas de Tela/Vídeos
placeholder: |
Se possível, adicione capturas de tela ou vídeos que ilustrem o problema. Isso pode ser extremamente útil para entender melhor o problema.
- type: textarea
attributes:
label: Qual versão da API você está usando?
description: |
Insira o número da sua versão que está na propriedade `version` do **package.json**.
placeholder: Cole aqui a versão.
validations:
required: true
- type: dropdown
id: select
attributes:
label: Qual é o seu ambiente?
options:
- Windows
- Linux
- Mac
- Docker
- Outro
validations:
required: true
- type: textarea
attributes:
label: Outras expecificações do ambiente
placeholder: 'Hardware/Software: [ex: CPU, GPU]'
validations:
required: false
- type: textarea
attributes:
label: Se aplicável, cole a saída do log
description: |
Por favor, anexe os logs que possam estar relacionados ao problema.
Se os logs contiverem informações sensíveis, considere enviá-los de forma privada para um dos mantenedores do projeto.
placeholder: Cole aqui o log da aplicação
validations:
required: false
- type: textarea
attributes:
label: Notas Adicionais
description: Inclua aqui qualquer outra informação que você ache que possa ser útil para entender ou resolver o bug.
validations:
required: false

View File

@ -0,0 +1,86 @@
name: Solicitação de recursos
description: Sugira ideias para o projeto.
labels:
- enhancement
- pt-br
# Automatically assign the issue to:
# assignees: DavidsonGomes
body:
- type: checkboxes
id: termos
attributes:
label: Bem-vindo!
description: '**NÃO ABRA PARA PERGUNTAS GERAIS DE SUPORTE.**'
options:
- label: Sim, pesquisei solicitações semelhantes no [GitHub](https://github.com/code-chat-br/whatsapp-api/issues) e não encontrei nenhum.
required: true
- type: dropdown
attributes:
label: Qual tipo de recurso?
description: |
Como escrever uma boa solicitação de bug?
- Respeite o modelo de problema tanto quanto possível.
- O título deve ser curto e descritivo.
- Explique as condições que o levaram a reportar este problema: o contexto.
- O contexto deve levar a algo, ideia ou problema que você está enfrentando.
- Seja claro e conciso.
- Formate suas mensagens para ajudar o leitor a se concentrar no que importa e entender a estrutura da sua mensagem, use [sintaxe Markdown](https://help.github.com/articles/github-flavored-markdown)
options:
- Integração
- Funcionalidade
- Endpoint
- Ajuste de banco de dados
- Outro
validations:
required: true
- type: textarea
attributes:
label: Qual a motivação para a solicitação?
description: |
Qual problema o recurso busca resolver?
Descreva claramente e em detalhes a funcionalidade que você deseja que seja implementada.
Explique como isso se encaixa no contexto do projeto.
placeholder: Descrição detalhada
validations:
required: true
- type: textarea
attributes:
label: Exemplos de Uso
description: |
Forneça exemplos específicos de como essa funcionalidade poderia ser utilizada.
Isso pode incluir cenários ou casos de uso onde a funcionalidade seria particularmente benéfica.
placeholder: texto - imagem - video - fluxogramas
validations:
required: false
- type: textarea
attributes:
label: Como o recurso deve ser desenvolvido?
description: |
Deve ser inserido diretamente no código?
Deve ser construído uma aplicação diferente que atuará como uma extenção da api?
Por exemplo: um `worker`?
Discuta como essa nova funcionalidade poderia impactar outras partes do projeto, se aplicável.
---
Se você tem ideias sobre como essa funcionalidade pode ser implementada, por favor, compartilhe-as aqui.
Isso não é obrigatório, mas pode ser útil para a equipe de desenvolvimento.
placeholder: Insira ideias para o recurso
validations:
required: false
- type: textarea
attributes:
label: Notas Adicionais
description: Qualquer outra informação que você acredita ser relevante para a sua solicitação.
placeholder: Insira aqui as sua observções.
validations:
required: false

View File

@ -0,0 +1,28 @@
name: Check Code Quality
on: [pull_request]
jobs:
check-lint-and-build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install packages
run: npm install
- name: Check linting
run: npm run lint:check
- name: Check build
run: npm run db:generate
- name: Check build
run: npm run build

View File

@ -0,0 +1,48 @@
name: Build Docker image
on:
push:
tags:
- "*.*.*"
jobs:
build_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: evoapicloud/evolution-api
tags: type=semver,pattern=v{{version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -0,0 +1,48 @@
name: Build Docker image
on:
push:
branches:
- develop
jobs:
build_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: evoapicloud/evolution-api
tags: homolog
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -0,0 +1,48 @@
name: Build Docker image
on:
push:
branches:
- main
jobs:
build_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: evoapicloud/evolution-api
tags: latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

28
.gitignore vendored
View File

@ -2,6 +2,12 @@
/dist /dist
/node_modules /node_modules
.cursor*
/Docker/.env
.vscode
# Logs # Logs
logs/**.json logs/**.json
*.log *.log
@ -11,22 +17,34 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
lerna-debug.log* lerna-debug.log*
/docker-compose-data
/docker-data
# Package # Package
/yarn.lock /yarn.lock
/package-lock.json /pnpm-lock.yaml
# IDE - VSCode # IDEs
.vscode/* .vscode/*
!.vscode/settings.json !.vscode/settings.json
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
.nova/*
# Prisma .idea/*
/prisma/migrations
# Project related # Project related
/instances/* /instances/*
!/instances/.gitkeep !/instances/.gitkeep
/test/ /test/
/src/env.yml /src/env.yml
/store
*.env
/temp/*
.DS_Store
*.DS_Store
.tool-versions
/prisma/migrations/*

View File

@ -2,8 +2,11 @@ module.exports = {
semi: true, semi: true,
trailingComma: 'all', trailingComma: 'all',
singleQuote: true, singleQuote: true,
printWidth: 90, printWidth: 120,
arrowParens: 'always',
tabWidth: 2, tabWidth: 2,
bracketSameLine: true, useTabs: false,
bracketSpacing: true bracketSameLine: false,
bracketSpacing: true,
parser: 'typescript'
} }

11
.vscode/settings.json vendored
View File

@ -5,7 +5,12 @@
"editor.smoothScrolling": true, "editor.smoothScrolling": true,
"editor.tabSize": 2, "editor.tabSize": 2,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true, "source.fixAll.eslint": "explicit",
"source.fixAll": true "source.fixAll": "explicit"
} },
"prisma-smart-formatter.typescript.defaultFormatter": "esbenp.prettier-vscode",
"prisma-smart-formatter.prisma.defaultFormatter": "Prisma.prisma",
"i18n-ally.localesPaths": [
"store/messages"
]
} }

View File

@ -1,3 +1,944 @@
# 2.3.0 (2025-06-17 09:19)
### Feature
* Add support to get Catalogs and Collections with new routes: '{{baseUrl}}/chat/fetchCatalogs' and '{{baseUrl}}/chat/fetchCollections'
* Add NATS integration support to the event system
* Add message location support meta
* Add S3_SKIP_POLICY env variable to disable setBucketPolicy for incompatible providers
* Add EvoAI integration with models, services, and routes
* Add N8n integration with models, services, and routes
### Fixed
* Shell injection vulnerability
* Update Baileys Version v6.7.18
* Audio send duplicate from chatwoot
* Chatwoot csat creating new conversation in another language
* Refactor SQS controller to correct bug in sqs events by instance
* Adjustin cloud api send audio and video
* Preserve animation in GIF and WebP stickers
* Preventing use conversation from other inbox for the same user
* Ensure full WhatsApp compatibility for audio conversion (libopus, 48kHz, mono)
* Enhance message fetching and processing logic
* Added lid on whatsapp numbers router
* Now if the CONFIG_SESSION_PHONE_VERSION variable is not filled in it automatically searches for the most updated version
### Security
* Change execSync to execFileSync
* Enhance WebSocket authentication and connection handling
# 2.2.3 (2025-02-03 11:52)
### Fixed
* Fix cache in local file system
* Update Baileys Version
# 2.2.2 (2025-01-31 06:55)
### Features
* Added prefix key to queue name in RabbitMQ
### Fixed
* Update Baileys Version
# 2.2.1 (2025-01-22 14:37)
### Features
* Retry system for send webhooks
* Message filtering to support timestamp range queries
* Chats filtering to support timestamp range queries
### Fixed
* Correction of webhook global
* Fixed send audio with whatsapp cloud api
* Refactor on fetch chats
* Refactor on Evolution Channel
# 2.2.0 (2024-10-18 10:00)
### Features
* Fake Call function
* Send List with Baileys
* Send Buttons with Baileys
* Added unreadMessages to chats
* Pusher event integration
* Add support for splitMessages and timePerChar in Integrations
* Audio Converter via API
* Send PTV messages with Baileys
### Fixed
* Fixed prefilledVariables in startTypebot
* Fix duplicate file upload
* Mark as read from me and groups
* Fetch chats query
* Ads messages in chatwoot
* Add indexes to improve performance in Evolution
* Add logical or permanent message deletion based on env config
* Add support for fetching multiple instances by key
* Update instance.controller.ts to filter by instanceName
* Receive template button reply message
# 2.1.2 (2024-10-06 10:09)
### Features
* Sync lost messages on chatwoot
* Set the maximum number of listeners that can be registered for events
* Now is possible send medias with form-data
### Fixed
* Fetch status message
* Adjusts in migrations
* Update pushName in chatwoot
* Validate message before sending chatwoot
* Adds the message status to the return of the "prepareMessage" function
* Fixed openai setting when send a message with chatwoot
* Fix buildkey function in hSet and hDelete
* Fix mexico number
* Update baileys version
* Update in Baileys version that fixes timeout when updating profile picture
* Adjusts for fix timeout error on send status message
* Chatwoot verbose logs
* Adjusts on prisma connections
* License terms updated
* Fixed send message to group without no cache (local or redis)
* Fixed startTypebot with startSession = true
* Fixed issue of always creating a new label when saving chatwoot
* Fixed getBase64FromMediaMessage with convertToMp4
* Fixed bug when send message when don't have mentionsEveryOne on payload
* Does not search message without chatwoot Message Id for reply
* Fixed bot fallback not working on integrations
# 2.1.1 (2024-09-22 10:31)
### Features
* Define a global proxy to be used if the instance does not have one
* Save is on whatsapp on the database
* Add headers to the instance's webhook registration
* Debounce message break is now "\n" instead of white space
* Single view messages are now supported in chatwoot
* Chatbots can now send any type of media
### Fixed
* Validate if cache exists before accessing it
* Missing autoCreate chatwoot in instance create
* Fixed bugs in the frontend, on the event screens
* Fixed use chatwoot with evolution channel
* Fix chatwoot reply quote with Cloud API
* Use exchange name from .env on RabbitMQ
* Fixed chatwoot screen
* It is now possible to send images via the Evolution Channel
* Removed "version" from docker-compose as it is obsolete (https://dev.to/ajeetraina/do-we-still-use-version-in-compose-3inp)
* Fixed typebot ignoreJids being used only from default settings
* Fixed Chatwoot inbox creation on save
* Changed axios timeout for manager requests for 30s
* Update in Baileys version that fixes timeout when updating profile picture
* Fixed issue when sending links in markdown by chatbots like Dify
* Fixed issue with chatbots not respecting settings
# 2.1.0 (2024-08-26 15:33)
### Features
* Improved layout manager
* Translation in manager: English, Portuguese, Spanish and French
* Evolution Bot Integration
* Option to disable chatwoot bot contact with CHATWOOT_BOT_CONTACT
* Added flowise integration
* Added evolution channel on instance create
* Change in license to Apache-2.0
* Mark All in events
### Fixed
* Refactor integrations structure for modular system
* Fixed dify agent integration
* Update Baileys Version
* Fixed proxy config in manager
* Fixed send messages in groups
* S3 saving media sent from me
* Fixed duplication bot when use startTypebot
### Break Changes
* Payloads for events changed (create Instance and set events). Check postman to understand
# 2.0.10 (2024-08-16 16:23)
### Features
* OpenAI send images when markdown
* Dify send images when markdown
* Sentry implemented
### Fixed
* Fix on get profilePicture
* Added S3_REGION on minio settings
# 2.0.9 (2024-08-15 12:31)
### Features
* Added ignoreJids in chatwoot settings
* Dify now identifies images
* Openai now identifies images
### Fixed
* Path mapping & deps fix & bundler changed to tsup
* Improve database scripts to retrieve the provider from env file
* Update contacts database with unique index
* Save chat name
* Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys
* Update Baileys version 6.7.6
* Deprecate buttons and list in new Baileys version
* Changed labels to be unique on the same instance
* Remove instance from redis even if using database
* Unified integration session system so they don't overlap
* Temporary fix for pictureUrl bug in groups
* Fix on migrations
# 2.0.9-rc (2024-08-09 18:00)
### Features
* Added general session button in typebot, dify and openai in manager
* Added compatibility with mysql through prisma
### Fixed
* Import contacts with image in chatwoot
* Fix conversationId when is dify agent
* Fixed loading of selects in the manager
* Add restart button to sessions screen
* Adjustments to docker files
* StopBotFromMe working with chatwoot
# 2.0.8-rc (2024-08-08 20:23)
### Features
* Variables passed to the input in dify
* OwnerJid passed to typebot
* Function for openai assistant added
### Fixed
* Adjusts in telemetry
# 2.0.7-rc (2024-08-03 14:04)
### Fixed
* BusinessId added on create instances in manager
* Adjusts in restart instance
* Resolve issue with connecting to instance
* Session is now individual per instance and remoteJid
* Credentials verify on manager login
* Added description column on typebot, dify and openai
* Fixed dify agent integration
# 2.0.6-rc (2024-08-02 19:23)
### Features
* Get models for OpenAI
### Fixed
* fetchInstances with clientName parameter
* fixed update typebot, openai and dify
# 2.0.5-rc (2024-08-01 18:01)
### Features
* Speech to Text with Openai
### Fixed
* ClientName on infos
* Instance screen scroll bar in manager
# 2.0.4-rc (2024-07-30 14:13)
### Features
* New manager v2.0
* Dify integration
### Fixed
* Update Baileys Version
* Adjusts for new manager
* Corrected openai trigger validation
* Corrected typebot trigger validation
# 2.0.3-beta (2024-07-29 09:03)
### Features
* Webhook url by submitted template to send status updates
* Sending template approval status webhook
### Fixed
* Equations and adjustments for the new manager
* Adjust TriggerType for OpenAI and Typebot integrations
* Fixed Typebot start call with active session
# 2.0.2-beta (2024-07-18 21:33)
### Feature
* Open AI implemented
### Fixed
* Fixed the function of saving or not saving data in the database
* Resolve not find name
* Removed DEL_TEMP_INSTANCES as it is not being used
* Fixed global exchange name
* Add apiKey and serverUrl to prefilledVariables in typebot service
* Correction in start typebot, if it doesn't exist, create it
# 2.0.1-beta (2024-07-17 17:01)
### Fixed
* Resolved issue with Chatwoot not receiving messages sent by Typebot
# 2.0.0-beta (2024-07-14 17:00)
### Feature
* Added prisma orm, connection to postgres and mysql
* Added chatwoot integration activation
* Added typebot integration activation
* Now you can register several typebots with triggers
* Media sent to typebot now goes as a template string, example: imageMessage|MESSAGE_ID
* Organization configuration and logo in chatwoot bot contact
* Added debounce time for typebot messages
* Tagging in chatwoot contact by instance
* Add support for managing WhatsApp templates via official API
* Fixes and implementation of regex and fallback in typebot
* Ignore jids configuration added to typebot (will be used for both groups and contacts)
* Minio and S3 integration
* When S3 integration enabled, the media sent to typebot now goes as a template string, example: imageMessage|MEDIA_URL
### Fixed
* Removed excessive verbose logs
* Optimization in instance registration
* Now in typebot we wait until the terminal block to accept the user's message, if it arrives before the block is sent, it is ignored
* Correction of audio sending, now we can speed it up and have the audio wireframe
* Reply with media message on Chatwoot
* improvements in sending status and groups
* Correction in response returns from buttons, lists and templates
* EvolutionAPI/Baileys implemented
### Break changes
* jwt authentication removed
* Connection to mongodb removed
* Standardized all request bodies to use camelCase
* Change in webhook information from owner to instanceId
* Changed the .env file configuration, removed the yml version and added .env to the repository root
* Removed the mobile type connection with Baileys
* Simplified payloads and endpoints
* Improved Typebot
- Now you can register several typebots
- Start configuration by trigger or for all
- Session search by typebot or remoteJid
- KeepOpen configuration (keeps the session even when the bot ends, to run once per contact)
- StopBotFromMe configuration, allows me to stop the bot if I send a chat message.
* Changed the way the goal webhook is configured
# 1.8.2 (2024-07-03 13:50)
### Fixed
* Corretion in globall rabbitmq queue name
* Improvement in the use of mongodb database for credentials
* Fixed base64 in webhook for documentWithCaption
* Fixed Generate pairing code
# 1.8.1 (2024-06-08 21:32)
### Feature
* New method of saving sessions to a file using worker, made in partnership with [codechat](https://github.com/code-chat-br/whatsapp-api)
### Fixed
* Correction of variables breaking lines in typebot
### Fixed
* Correction of variables breaking lines in typebot
# 1.8.0 (2024-05-27 16:10)
### Feature
* Now in the manager, when logging in with the client's apikey, the listing only shows the instance corresponding to the provided apikey (only with MongoDB)
* New global mode for rabbitmq events
* Build in docker for linux/amd64, linux/arm64 platforms
### Fixed
* Correction in message formatting when generated by AI as markdown in typebot
* Security fix in fetch instance with client key when not connected to mongodb
# 1.7.5 (2024-05-21 08:50)
### Fixed
* Add merge_brazil_contacts function to solve nine digit in brazilian numbers
* Optimize ChatwootService method for updating contact
* Fix swagger auth
* Update aws sdk v3
* Fix getOpenConversationByContact and init queries error
* Method to mark chat as unread
* Added environment variable to manually select the WhatsApp web version for the baileys lib (optional)
# 1.7.4 (2024-04-28 09:46)
### Fixed
* Adjusts in proxy on fetchAgent
* Recovering messages lost with redis cache
* Log when init redis cache service
* Recovering messages lost with redis cache
* Chatwoot inbox name
* Update Baileys version
# 1.7.3 (2024-04-18 12:07)
### Fixed
* Revert fix audio encoding
* Recovering messages lost with redis cache
* Adjusts in redis for save instances
* Adjusts in proxy
* Revert pull request #523
* Added instance name on logs
* Added support for Spanish
* Fix error: invalid operator. The allowed operators for identifier are equal_to,not_equal_to in chatwoot
# 1.7.2 (2024-04-12 17:31)
### Feature
* Mobile connection via sms (test)
### Fixed
* Adjusts in redis
* Send global event in websocket
* Adjusts in proxy
* Fix audio encoding
* Fix conversation read on chatwoot version 3.7
* Fix when receiving/sending messages from whatsapp desktop with ephemeral messages enabled
* Changed returned sessions on typebot status change
* Reorganization of files and folders
# 1.7.1 (2024-04-03 10:19)
### Fixed
* Correction when sending files with captions on Whatsapp Business
* Correction in receiving messages with response on WhatsApp Business
* Correction when sending a reaction to a message on WhatsApp Business
* Correction of receiving reactions on WhatsApp business
* Removed mandatory description of rows from sendList
* Feature to collect message type in typebot
# 1.7.0 (2024-03-11 18:23)
### Feature
* Added update message endpoint
* Add translate capabilities to QRMessages in CW
* Join in Group by Invite Code
* Read messages from whatsapp in chatwoot
* Add support to use use redis in cacheservice
* Add support for labels
* Command to clearcache from chatwoot inbox
* Whatsapp Cloud API Oficial
### Fixed
* Proxy configuration improvements
* Correction in sending lists
* Adjust in webhook_base64
* Correction in typebot text formatting
* Correction in chatwoot text formatting and render list message
* Only use a axios request to get file mimetype if necessary
* When possible use the original file extension
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
* Remove message ids cache in chatwoot to use chatwoot's api itself
* Adjusts the quoted message, now has contextInfo in the message Raw
* Collecting responses with text or numbers in Typebot
* Added sendList endpoint to swagger documentation
* Implemented a function to synchronize message deletions on WhatsApp, automatically reflecting in Chatwoot.
* Improvement on numbers validation
* Fix polls in message sending
* Sending status message
* Message 'connection successfully' spamming
* Invalidate the conversation cache if reopen_conversation is false and the conversation was resolved
* Fix looping when deleting a message in chatwoot
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
* Correction in the sendList Function
* Implement contact upsert in messaging-history.set
* Improve proxy error handling
* Refactor fetching participants for group in WhatsApp service
* Fixed problem where the typebot final keyword did not work
* Typebot's wait now pauses the flow and composing is defined by the delay_message parameter in set typebot
* Composing over 20s now loops until finished
# 1.6.1 (2023-12-22 11:43)
### Fixed
* Fixed Lid Messages
* Fixed sending variables to typebot
* Fixed sending variables from typebot
* Correction sending s3/minio media to chatwoot and typebot
* Fixed the problem with typebot closing at the end of the flow, now this is optional with the TYPEBOT_KEEP_OPEN variable
* Fixed chatwoot Bold, Italic and Underline formatting using Regex
* Added the sign_delimiter property to the Chatwoot configuration, allowing you to set a different delimiter for the signature. Default when not defined \n
* Include instance Id field in the instance configuration
* Fixed the pairing code
* Adjusts in typebot
* Fix the problem when disconnecting the instance and connecting again using mongodb
* Options to disable docs and manager
* When deleting a message in whatsapp, delete the message in chatwoot too
# 1.6.0 (2023-12-12 17:24)
### Feature
* Added AWS SQS Integration
* Added support for new typebot API
* Added endpoint sendPresence
* New Instance Manager
* Added auto_create to the chatwoot set to create the inbox automatically or not
* Added reply, delete and message reaction in chatwoot v3.3.1
### Fixed
* Adjusts in proxy
* Adjusts in start session for Typebot
* Added mimetype field when sending media
* Ajusts in validations to messages.upsert
* Fixed messages not received: error handling when updating contact in chatwoot
* Fix workaround to manage param data as an array in mongodb
* Removed await from webhook when sending a message
* Update typebot.service.ts - element.underline change ~ for *
* Removed api restart on receiving an error
* Fixes in mongodb and chatwoot
* Adjusted return from queries in mongodb
* Added restart instance when update profile picture
* Correction of chatwoot functioning with admin flows
* Fixed problem that did not generate qrcode with the chatwoot_conversation_pending option enabled
* Fixed issue where CSAT opened a new ticket when reopen_conversation was disabled
* Fixed issue sending contact to Chatwoot via iOS
### Integrations
* Chatwoot: v3.3.1
* Typebot: v2.20.0
# 1.5.4 (2023-10-09 20:43)
### Fixed
* Baileys logger typing issue resolved
* Solved problem with duplicate messages in chatwoot
# 1.5.3 (2023-10-06 18:55)
### Feature
* Swagger documentation
* Added base 64 sending option via webhook
### Fixed
* Remove rabbitmq queues when delete instances
* Improvement in restart instance to completely redo the connection
* Update node version: v20
* Correction of messages sent by the api and typebot not appearing in chatwoot
* Adjustment to start typebot, added startSession parameter
* Chatwoot now receives messages sent via api and typebot
* Fixed problem with starting with an input in typebot
* Added check to ensure variables are not empty before executing foreach in start typebot
# 1.5.2 (2023-09-28 17:56)
### Fixed
* Fix chatwootSchema in chatwoot model to store reopen_conversation and conversation_pending options
* Problem resolved when sending files from minio to typebot
* Improvement in the "startTypebot" method to create persistent session when triggered
* New manager for Evo 1.5.2 - Set Typebot update
* Resolved problems when reading/querying instances
# 1.5.1 (2023-09-17 13:50)
### Feature
* Added listening_from_me option in Set Typebot
* Added variables options in Start Typebot
* Added webhooks for typebot events
* Added ChamaAI integration
* Added webhook to send errors
* Added support for messaging with ads on chatwoot
### Fixed
* Fix looping connection messages in chatwoot
* Improved performance of fetch instances
# 1.5.0 (2023-08-18 12:47)
### Feature
* New instance manager in /manager route
* Added extra files for chatwoot and appsmith
* Added Get Last Message and Archive for Chat
* Added env var QRCODE_COLOR
* Added websocket to send events
* Added rabbitmq to send events
* Added Typebot integration
* Added proxy endpoint
* Added send and date_time in webhook data
### Fixed
* Solved problem when disconnecting from the instance the instance was deleted
* Encoded spaces in chatwoot webhook
* Adjustment in the saving of contacts, saving the information of the number and Jid
* Update Dockerfile
* If you pass empty events in create instance and set webhook it is understood as all
* Fixed issue that did not output base64 averages
* Messages sent by the api now arrive in chatwoot
### Integrations
* Chatwoot: v2.18.0 - v3.0.0
* Typebot: v2.16.0
* Manager Evolution API
# 1.4.8 (2023-07-27 10:27)
### Fixed
* Fixed error return bug
# 1.4.7 (2023-07-27 08:47)
### Fixed
* Fixed error return bug
* Fixed problem of getting message when deleting message in chatwoot
* Change in error return pattern
# 1.4.6 (2023-07-26 17:54)
### Fixed
* Fixed bug of creating new inbox by chatwoot
* When conversation reopens is pending when conversation pending is true
* Added docker-compose file with dockerhub image
# 1.4.5 (2023-07-26 09:32)
### Fixed
* Fixed problems in localization template in chatwoot
* Fix mids going duplicated in chatwoot
# 1.4.4 (2023-07-25 15:24)
### Fixed
* Fixed chatwoot line wrap issue
* Solved receive location in chatwoot
* When requesting the pairing code, it also brings the qr code
* Option reopen_conversation in chatwoot endpoint
* Option conversation_pending in chatwoot endpoint
# 1.4.3 (2023-07-25 10:51)
### Fixed
* Adjusts in settings with options always_online, read_messages and read_status
* Fixed send webhook for event CALL
* Create instance with settings
# 1.4.2 (2023-07-24 20:52)
### Fixed
* Fixed validation is set settings
* Adjusts in group validations
* Ajusts in sticker message to chatwoot
# 1.4.1 (2023-07-24 18:28)
### Fixed
* Fixed reconnect with pairing code or qrcode
* Fixed problem in createJid
# 1.4.0 (2023-07-24 17:03)
### Features
* Added connection functionality via pairing code
* Added fetch profile endpoint in chat controller
* Created settings controller
* Added reject call and send text message when receiving a call
* Added setting to ignore group messages
* Added connection with pairing code in chatwoot with command /init:{NUMBER}
* Added encoding option in endpoint sendWhatsAppAudio
### Fixed
* Added link preview option in send text message
* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
* Fixed issue where it was not possible to open a conversation when sent at first by me on my cell phone in chatwoot
* Now it only updates the contact name if it is the same as the phone number in chatwoot
* Now accepts all chatwoot inbox templates
* Command to create new instances set to /new_instance:{NAME}:{NUMBER}
* Fix in chatwoot set, sign msg can now be disabled
### Integrations
* Chatwoot: v2.18.0 - v3.0.0 (Beta)
# 1.3.2 (2023-07-21 17:19)
### Fixed
* Fix in update settings that needed to restart after updated
* Correction in the use of the api with mongodb
* Adjustments to search endpoint for contacts, chats, messages and Status messages
* Now when deleting the instance, the data referring to it in mongodb is also deleted
* It is now validated if the instance name contains uppercase and special characters
* For compatibility reasons, container mode has been removed
* Added docker-compose files example
### Integrations
* Chatwoot: v2.18.0
# 1.3.1 (2023-07-20 07:48)
### Fixed
* Adjust in create store files
### Integrations
* Chatwoot: v2.18.0
# 1.3.0 (2023-07-19 11:33)
### Features
* Added messages.delete event
* Added restart instance endpoint
* Created automation for creating instances in the chatwoot bot with the command '#inbox_whatsapp:{INSTANCE_NAME}
* Change Baileys version to: 6.4.0
* Send contact in chatwoot
* Send contact array in chatwoot
* Added apiKey in webhook and serverUrl in fetchInstance if EXPOSE_IN_FETCH_INSTANCES: true
* Translation set to default (english) in chatwoot
### Fixed
* Fixed error to send message in large groups
* Docker files adjusted
* Fixed in the postman collection the webhookByEvent parameter by webhook_by_events
* Added validations in create instance
* Removed link preview endpoint, now it's done automatically from sending conventional text
* Added group membership validation before sending message to groups
* Adjusts in docker files
* Adjusts in returns in endpoints chatwoot and webhook
* Fixed ghost mentions in send text message
* Fixed bug that saved contacts from groups came without number in chatwoot
* Fixed problem to receive csat in chatwoot
* Fixed require fileName for document only in base64 for send media message
* Bug fix when sending mobile message change contact name to number in chatwoot
* Bug fix when connecting whatsapp does not send confirmation message
* Fixed quoted message with id or message directly
* Adjust in validation for mexican and argentine numbers
* Adjust in create store files
### Integrations
* Chatwoot: v2.18.0
# 1.2.2 (2023-07-15 09:36)
### Fixed
* Tweak in route "/" with version info
* Adjusts chatwoot version
### Integrations
* Chatwoot: v2.18.0
# 1.2.1 (2023-07-14 19:04)
### Fixed
* Adjusts in docker files
* Save picture url groups in chatwoot
# 1.2.0 (2023-07-14 15:28)
### Features
* Native integration with chatwoot
* Added returning or non-returning participants option in fetchAllGroups
* Added group integration to chatwoot
* Added automation on create instance to chatwoot
* Added verbose logs and format chatwoot service
### Fixed
* Adjusts in docker-compose files
* Adjusts in number validation for AR and MX numbers
* Adjusts in env files, removed save old_messages
* Fix when sending a message to a group I don't belong returns a bad request
* Fits the format on return from the fetchAllGroups endpoint
* Adjust in send document with caption from chatwoot
* Fixed message with undefind in chatwoot
* Changed message in path /
* Test duplicate message media in groups chatwoot
* Optimize send message from group with mentions
* Fixed name of the profile status in fetchInstances
* Fixed error 500 when logout in instance with status = close
# 1.1.5 (2023-07-12 07:17)
### Fixed
* Adjusts in temp folder
* Return with event send_message
# 1.1.4 (2023-07-08 11:01)
### Features
* Route to send status broadcast
* Added verbose logs
* Insert allContacts in payload of endpoint sendStatus
### Fixed
* Adjusted set in webhook to go empty when enabled false
* Adjust in store files
* Fixed the problem when do not save contacts when receive messages
* Changed owner of the jid for instanceName
* Create .env for installation in docker
# 1.1.3 (2023-07-06 11:43)
### Features
* Added configuration for Baileys log level in env
* Added audio to mp4 converter in optionally get Base64 From MediaMessage
* Added organization name in vcard
* Added email in vcard
* Added url in vcard
* Added verbose logs
### Fixed
* Added timestamp internally in urls to avoid caching
* Correction in decryption of poll votes
* Change in the way the api sent and saved the sent messages, now it goes in the messages.upsert event
* Fixed cash when sending stickers via url
* Improved how Redis works for instances
* Fixed problem when disconnecting the instance it removes the instance
* Fixed problem sending ack when preview is done by me
* Adjust in store files
# 1.1.2 (2023-06-28 13:43)
### Fixed
* Fixed baileys version in package.json
* Fixed problem that did not validate if the token passed in create instance already existed
* Fixed problem that does not delete instance files in server mode
# 1.1.1 (2023-06-28 10:27)
### Features
* Added group invitation sending
* Added webhook configuration per event in the individual instance registration
### Fixed
* Adjust dockerfile variables
# 1.1.0 (2023-06-21 11:17)
### Features
* Improved fetch instances endpoint, now it also fetch other instances even if they are not connected
* Added conversion of audios for sending recorded audio, now it is possible to send mp3 audios and not just ogg
* Route to fetch all groups that the connection is part of
* Route to fetch all privacy settings
* Route to update the privacy settings
* Route to update group subject
* Route to update group description
* Route to accept invite code
* Added configuration of events by webhook of instances
* Now the api key can be exposed in fetch instances if the EXPOSE_IN_FETCH_INSTANCES variable is set to true
* Added option to generate qrcode as soon as the instance is created
* The created instance token can now also be optionally defined manually in the creation endpoint
* Route to send Sticker
### Fixed
* Adjust dockerfile variables
* tweaks in docker-compose to pass variables
* Adjust the route getProfileBusiness to fetchProfileBusiness
* fix error after logout and try to get status or to connect again
* fix sending narrated audio on whatsapp android and ios
* fixed the problem of not disabling the global webhook by the variable
* Adjustment in the recording of temporary files and periodic cleaning
* Fix for container mode also work only with files
* Remove recording of old messages on sync
# 1.0.9 (2023-06-10)
### Fixed
* Adjust dockerfile variables
# 1.0.8 (2023-06-09) # 1.0.8 (2023-06-09)
### Features ### Features
@ -20,4 +961,4 @@
* Sending the local webhook url as destination in the webhook data for webhook redirection * Sending the local webhook url as destination in the webhook data for webhook redirection
* Startup modes, server or container * Startup modes, server or container
* Server Mode works normally as everyone is used to * Server Mode works normally as everyone is used to
* Container mode made to use one instance per container, when starting the application an instance is already created and the qrcode is generated and it starts sending webhook without having to call it manually, it only allows one instance at a time. * Container mode made to use one instance per container, when starting the application an instance is already created and the qrcode is generated and it starts sending webhook without having to call it manually, it only allows one instance at a time.

View File

@ -1,80 +0,0 @@
CORS_ORIGIN='*' # Or separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
CORS_METHODS='POST,GET,PUT,DELETE'
CORS_CREDENTIALS=true
# Determine the logs to be displayed
LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK'
LOG_COLOR=true
# Determine how long the instance should be deleted from memory in case of no connection.
# Default time: 5 minutes
# If you don't even want an expiration, enter the value false
DEL_INSTANCE=5
# Temporary data storage
STORE_CLEANING_INTERVAL=7200 # seconds ===2h
STORE_MESSAGE=true
STORE_CONTACTS=false
STORE_CHATS=false
# Permanent data storage
DATABASE_ENABLED=false
DATABASE_CONNECTION_URI='<uri>'
DATABASE_CONNECTION_DB_PREFIX_NAME='evolution'
DATABASE_SAVE_DATA_INSTANCE=false
DATABASE_SAVE_DATA_OLD_MESSAGE=false
DATABASE_SAVE_DATA_NEW_MESSAGE=true
DATABASE_SAVE_MESSAGE_UPDATE=true
DATABASE_SAVE_DATA_CONTACTS=true
DATABASE_SAVE_DATA_CHATS=true
REDIS_ENABLED=true
REDIS_URI='<uri>/1'
REDIS_PREFIX_KEY='evolution'
# Webhook Settings
## Define a global webhook that will listen for enabled events from all instances
WEBHOOK_GLOBAL_URL='<url>'
WEBHOOK_GLOBAL_ENABLED=false
WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
## Set the events you want to hear
WEBHOOK_EVENTS_STATUS_INSTANCE=true
WEBHOOK_EVENTS_APPLICATION_STARTUP=true
WEBHOOK_EVENTS_QRCODE_UPDATED=true
WEBHOOK_EVENTS_MESSAGES_SET=true
WEBHOOK_EVENTS_MESSAGES_UPDATE=true
WEBHOOK_EVENTS_MESSAGES_UPSERT=true
WEBHOOK_EVENTS_SEND_MESSAGE=true
WEBHOOK_EVENTS_CONTACTS_SET=true
WEBHOOK_EVENTS_CONTACTS_UPSERT=true
WEBHOOK_EVENTS_CONTACTS_UPDATE=true
WEBHOOK_EVENTS_PRESENCE_UPDATE=true
WEBHOOK_EVENTS_CHATS_SET=true
WEBHOOK_EVENTS_CHATS_UPSERT=true
WEBHOOK_EVENTS_CHATS_UPDATE=true
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
WEBHOOK_EVENTS_GROUPS_UPSERT=false
WEBHOOK_EVENTS_GROUPS_UPDATE=false
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
## This event fires every time a new token is requested via the refresh route
WEBHOOK_EVENTS_NEW_JWT_TOKEN=true
CONFIG_SESSION_PHONE_CLIENT='Evolution API'
CONFIG_SESSION_PHONE_NAME='Chrome'
# Set qrcode display limit
QRCODE_LIMIT=6
# Defines an authentication type for the api
AUTHENTICATION_TYPE='jwt' # or 'apikey'
## Define a global apikey to access all instances.
### OBS: This key must be inserted in the request header to create an instance.
AUTHENTICATION_API_KEY='t8OOEeISKzpmc3jjcMqBWYSaJsafdefer'
## Set the secret key to encrypt and decrypt your token and its expiration time
AUTHENTICATION_JWT_EXPIRIN_IN=3600 # seconds - 3600s ===1h | zero (0) - never expires
AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG'
AUTHENTICATION_INSTANCE_NAME='evolution'
AUTHENTICATION_INSTANCE_WEBHOOK_URL='<url>'
AUTHENTICATION_INSTANCE_MODE='container' # or 'server'
AUTHENTICATION_INSTANCE_WEBHOOK_BY_EVENTS=false

View File

@ -0,0 +1,31 @@
version: '3.3'
services:
minio:
container_name: minio
image: quay.io/minio/minio
networks:
- evolution-net
command: server /data --console-address ":9001"
restart: always
ports:
- 5432:5432
environment:
- MINIO_ROOT_USER=USER
- MINIO_ROOT_PASSWORD=PASSWORD
- MINIO_BROWSER_REDIRECT_URL=http:/localhost:9001
- MINIO_SERVER_URL=http://localhost:9000
volumes:
- minio_data:/data
expose:
- 9000
- 9001
volumes:
minio_data:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -0,0 +1,27 @@
version: '3.3'
services:
mysql:
container_name: mysql
image: percona/percona-server:8.0
networks:
- evolution-net
restart: always
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=root
- TZ=America/Bahia
volumes:
- mysql_data:/var/lib/mysql
expose:
- 3306
volumes:
mysql_data:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -0,0 +1,42 @@
version: '3.3'
services:
postgres:
container_name: postgres
image: postgres:15
networks:
- evolution-net
command: ["postgres", "-c", "max_connections=1000"]
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=PASSWORD
volumes:
- postgres_data:/var/lib/postgresql/data
expose:
- 5432
pgadmin:
image: dpage/pgadmin4:latest
networks:
- evolution-net
environment:
- PGADMIN_DEFAULT_EMAIL=EMAIL
- PGADMIN_DEFAULT_PASSWORD=PASSWORD
volumes:
- pgadmin_data:/var/lib/pgadmin
ports:
- 4000:80
links:
- postgres
volumes:
postgres_data:
pgadmin_data:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -0,0 +1,25 @@
version: '3.3'
services:
rabbitmq:
container_name: rabbitmq
image: rabbitmq:management
environment:
- RABBITMQ_ERLANG_COOKIE=33H2CdkzF5WrnJ4ud6nkUdRTKXvbCHeFjvVL71p
- RABBITMQ_DEFAULT_VHOST=default
- RABBITMQ_DEFAULT_USER=USER
- RABBITMQ_DEFAULT_PASS=PASSWORD
volumes:
- rabbitmq_data:/var/lib/rabbitmq/
ports:
- 5672:5672
- 15672:15672
volumes:
rabbitmq_data:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -0,0 +1,23 @@
version: '3.3'
services:
redis:
image: redis:latest
networks:
- evolution-net
container_name: redis
command: >
redis-server --port 6379 --appendonly yes
volumes:
- evolution_redis:/data
ports:
- 6379:6379
volumes:
evolution_redis:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -0,0 +1,32 @@
#!/bin/bash
source ./Docker/scripts/env_functions.sh
if [ "$DOCKER_ENV" != "true" ]; then
export_env_vars
fi
if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]; then
export DATABASE_URL
echo "Deploying migrations for $DATABASE_PROVIDER"
echo "Database URL: $DATABASE_URL"
# rm -rf ./prisma/migrations
# cp -r ./prisma/$DATABASE_PROVIDER-migrations ./prisma/migrations
npm run db:deploy
if [ $? -ne 0 ]; then
echo "Migration failed"
exit 1
else
echo "Migration succeeded"
fi
npm run db:generate
if [ $? -ne 0 ]; then
echo "Prisma generate failed"
exit 1
else
echo "Prisma generate succeeded"
fi
else
echo "Error: Database provider $DATABASE_PROVIDER invalid."
exit 1
fi

18
Docker/scripts/env_functions.sh Executable file
View File

@ -0,0 +1,18 @@
export_env_vars() {
if [ -f .env ]; then
while IFS='=' read -r key value; do
if [[ -z "$key" || "$key" =~ ^\s*# || -z "$value" ]]; then
continue
fi
key=$(echo "$key" | tr -d '[:space:]')
value=$(echo "$value" | tr -d '[:space:]')
value=$(echo "$value" | tr -d "'" | tr -d "\"")
export "$key=$value"
done < .env
else
echo ".env file not found"
exit 1
fi
}

View File

@ -0,0 +1,23 @@
#!/bin/bash
source ./Docker/scripts/env_functions.sh
if [ "$DOCKER_ENV" != "true" ]; then
export_env_vars
fi
if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]; then
export DATABASE_URL
echo "Generating database for $DATABASE_PROVIDER"
echo "Database URL: $DATABASE_URL"
npm run db:generate
if [ $? -ne 0 ]; then
echo "Prisma generate failed"
exit 1
else
echo "Prisma generate succeeded"
fi
else
echo "Error: Database provider $DATABASE_PROVIDER invalid."
exit 1
fi

View File

@ -0,0 +1,147 @@
version: "3.7"
services:
evolution_v2:
image: atendai/evolution-api:v2.2.3
volumes:
- evolution_instances:/evolution/instances
networks:
- network_public
environment:
- SERVER_URL=https://evo2.site.com
- DEL_INSTANCE=false
- DATABASE_PROVIDER=postgresql
- DATABASE_CONNECTION_URI=postgresql://postgres:SENHA@postgres:5432/evolution
- DATABASE_SAVE_DATA_INSTANCE=true
- DATABASE_SAVE_DATA_NEW_MESSAGE=true
- DATABASE_SAVE_MESSAGE_UPDATE=true
- DATABASE_SAVE_DATA_CONTACTS=true
- DATABASE_SAVE_DATA_CHATS=true
- DATABASE_SAVE_DATA_LABELS=true
- DATABASE_SAVE_DATA_HISTORIC=true
- DATABASE_CONNECTION_CLIENT_NAME=evolution_v2
- RABBITMQ_ENABLED=false
- RABBITMQ_URI=amqp://admin:admin@rabbitmq:5672/default
- RABBITMQ_EXCHANGE_NAME=evolution_v2
- RABBITMQ_GLOBAL_ENABLED=false
- RABBITMQ_EVENTS_APPLICATION_STARTUP=false
- RABBITMQ_EVENTS_INSTANCE_CREATE=false
- RABBITMQ_EVENTS_INSTANCE_DELETE=false
- RABBITMQ_EVENTS_QRCODE_UPDATED=false
- RABBITMQ_EVENTS_MESSAGES_SET=false
- RABBITMQ_EVENTS_MESSAGES_UPSERT=true
- RABBITMQ_EVENTS_MESSAGES_EDITED=false
- RABBITMQ_EVENTS_MESSAGES_UPDATE=false
- RABBITMQ_EVENTS_MESSAGES_DELETE=false
- RABBITMQ_EVENTS_SEND_MESSAGE=false
- RABBITMQ_EVENTS_SEND_MESSAGE_UPDATE=false
- RABBITMQ_EVENTS_CONTACTS_SET=false
- RABBITMQ_EVENTS_CONTACTS_UPSERT=false
- RABBITMQ_EVENTS_CONTACTS_UPDATE=false
- RABBITMQ_EVENTS_PRESENCE_UPDATE=false
- RABBITMQ_EVENTS_CHATS_SET=false
- RABBITMQ_EVENTS_CHATS_UPSERT=false
- RABBITMQ_EVENTS_CHATS_UPDATE=false
- RABBITMQ_EVENTS_CHATS_DELETE=false
- RABBITMQ_EVENTS_GROUPS_UPSERT=false
- RABBITMQ_EVENTS_GROUP_UPDATE=false
- RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
- RABBITMQ_EVENTS_CONNECTION_UPDATE=true
- RABBITMQ_EVENTS_CALL=false
- RABBITMQ_EVENTS_TYPEBOT_START=false
- RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS=false
- SQS_ENABLED=false
- SQS_ACCESS_KEY_ID=
- SQS_SECRET_ACCESS_KEY=
- SQS_ACCOUNT_ID=
- SQS_REGION=
- WEBSOCKET_ENABLED=false
- WEBSOCKET_GLOBAL_EVENTS=false
- WA_BUSINESS_TOKEN_WEBHOOK=evolution
- WA_BUSINESS_URL=https://graph.facebook.com
- WA_BUSINESS_VERSION=v20.0
- WA_BUSINESS_LANGUAGE=pt_BR
- WEBHOOK_GLOBAL_URL=''
- WEBHOOK_GLOBAL_ENABLED=false
- WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
- WEBHOOK_EVENTS_APPLICATION_STARTUP=false
- WEBHOOK_EVENTS_QRCODE_UPDATED=true
- WEBHOOK_EVENTS_MESSAGES_SET=true
- WEBHOOK_EVENTS_MESSAGES_UPSERT=true
- WEBHOOK_EVENTS_MESSAGES_EDITED=true
- WEBHOOK_EVENTS_MESSAGES_UPDATE=true
- WEBHOOK_EVENTS_MESSAGES_DELETE=true
- WEBHOOK_EVENTS_SEND_MESSAGE=true
- WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=true
- WEBHOOK_EVENTS_CONTACTS_SET=true
- WEBHOOK_EVENTS_CONTACTS_UPSERT=true
- WEBHOOK_EVENTS_CONTACTS_UPDATE=true
- WEBHOOK_EVENTS_PRESENCE_UPDATE=true
- WEBHOOK_EVENTS_CHATS_SET=true
- WEBHOOK_EVENTS_CHATS_UPSERT=true
- WEBHOOK_EVENTS_CHATS_UPDATE=true
- WEBHOOK_EVENTS_CHATS_DELETE=true
- WEBHOOK_EVENTS_GROUPS_UPSERT=true
- WEBHOOK_EVENTS_GROUPS_UPDATE=true
- WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
- WEBHOOK_EVENTS_CONNECTION_UPDATE=true
- WEBHOOK_EVENTS_LABELS_EDIT=true
- WEBHOOK_EVENTS_LABELS_ASSOCIATION=true
- WEBHOOK_EVENTS_CALL=true
- WEBHOOK_EVENTS_TYPEBOT_START=false
- WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
- WEBHOOK_EVENTS_ERRORS=false
- WEBHOOK_EVENTS_ERRORS_WEBHOOK=
- CONFIG_SESSION_PHONE_CLIENT=Evolution API V2
- CONFIG_SESSION_PHONE_NAME=Chrome
- CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200
- QRCODE_LIMIT=30
- OPENAI_ENABLED=true
- DIFY_ENABLED=true
- TYPEBOT_ENABLED=true
- TYPEBOT_API_VERSION=latest
- CHATWOOT_ENABLED=true
- CHATWOOT_MESSAGE_READ=true
- CHATWOOT_MESSAGE_DELETE=true
- CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://postgres:PASSWORD@postgres:5432/chatwoot?sslmode=disable
- CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
- CACHE_REDIS_ENABLED=true
- CACHE_REDIS_URI=redis://evo_redis:6379/1
- CACHE_REDIS_PREFIX_KEY=evolution_v2
- CACHE_REDIS_SAVE_INSTANCES=false
- CACHE_LOCAL_ENABLED=false
- S3_ENABLED=true
- S3_ACCESS_KEY=
- S3_SECRET_KEY=
- S3_BUCKET=evolution
- S3_PORT=443
- S3_ENDPOINT=files.site.com
- S3_USE_SSL=true
- AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
- LANGUAGE=en
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == evolution-manager
labels:
- traefik.enable=true
- traefik.http.routers.evolution_v2.rule=Host(`evo2.site.com`)
- traefik.http.routers.evolution_v2.entrypoints=websecure
- traefik.http.routers.evolution_v2.tls.certresolver=letsencryptresolver
- traefik.http.routers.evolution_v2.priority=1
- traefik.http.routers.evolution_v2.service=evolution_v2
- traefik.http.services.evolution_v2.loadbalancer.server.port=8080
- traefik.http.services.evolution_v2.loadbalancer.passHostHeader=true
volumes:
evolution_instances:
external: true
name: evolution_v2_data
networks:
network_public:
external: true
name: network_public

View File

@ -1,87 +1,58 @@
FROM node:16.18-alpine FROM node:20-alpine AS builder
RUN apk update && apk upgrade && \ RUN apk update && \
apk add --no-cache git apk add --no-cache git ffmpeg wget curl bash openssl
LABEL version="2.3.0" description="Api to control whatsapp features through http requests."
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
LABEL contact="contato@evolution-api.com"
WORKDIR /evolution WORKDIR /evolution
COPY ./package.json . COPY ./package.json ./tsconfig.json ./
ENV DOCKER_ENV=true
ENV CORS_ORIGIN="*"
ENV CORS_METHODS="POST,GET,PUT,DELETE"
ENV CORS_CREDENTIALS=true
ENV LOG_LEVEL="ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK"
ENV LOG_COLOR=true
ENV DEL_INSTANCE=false
ENV STORE_CLEANING_INTERVAL=7200
ENV STORE_MESSAGE=true
ENV STORE_CONTACTS=true
ENV STORE_CHATS=true
ENV DATABASE_ENABLED=$DATABASE_ENABLED
ENV DATABASE_CONNECTION_URI=$DATABASE_CONNECTION_URI
ENV DATABASE_CONNECTION_DB_PREFIX_NAME=$DATABASE_CONNECTION_DB_PREFIX_NAME
ENV DATABASE_SAVE_DATA_INSTANCE=false
ENV DATABASE_SAVE_DATA_OLD_MESSAGE=false
ENV DATABASE_SAVE_DATA_NEW_MESSAGE=true
ENV DATABASE_SAVE_MESSAGE_UPDATE=false
ENV DATABASE_SAVE_DATA_CONTACTS=true
ENV DATABASE_SAVE_DATA_CHATS=true
ENV REDIS_ENABLED=$REDIS_ENABLED
ENV REDIS_URI=$REDIS_URI
ENV WEBHOOK_GLOBAL_URL=$WEBHOOK_GLOBAL_URL
ENV WEBHOOK_GLOBAL_ENABLED=true
ENV WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=$WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS
ENV WEBHOOK_EVENTS_STATUS_INSTANCE=true
ENV WEBHOOK_EVENTS_APPLICATION_STARTUP=true
ENV WEBHOOK_EVENTS_QRCODE_UPDATED=true
ENV WEBHOOK_EVENTS_MESSAGES_SET=true
ENV WEBHOOK_EVENTS_MESSAGES_UPDATE=true
ENV WEBHOOK_EVENTS_MESSAGES_UPSERT=true
ENV WEBHOOK_EVENTS_SEND_MESSAGE=true
ENV WEBHOOK_EVENTS_CONTACTS_SET=true
ENV WEBHOOK_EVENTS_CONTACTS_UPSERT=true
ENV WEBHOOK_EVENTS_CONTACTS_UPDATE=true
ENV WEBHOOK_EVENTS_PRESENCE_UPDATE=true
ENV WEBHOOK_EVENTS_CHATS_SET=true
ENV WEBHOOK_EVENTS_CHATS_UPSERT=true
ENV WEBHOOK_EVENTS_CHATS_UPDATE=true
ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true
ENV WEBHOOK_EVENTS_GROUPS_UPSERT=true
ENV WEBHOOK_EVENTS_GROUPS_UPDATE=true
ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=true
ENV CONFIG_SESSION_PHONE_CLIENT="Evolution API"
ENV CONFIG_SESSION_PHONE_NAME="Chrome"
ENV QRCODE_LIMIT=30
ENV AUTHENTICATION_TYPE="apikey"
ENV AUTHENTICATION_API_KEY=$AUTHENTICATION_API_KEY
ENV AUTHENTICATION_JWT_EXPIRIN_IN=0
ENV AUTHENTICATION_JWT_SECRET="L0YWtjb2w554WFqPG"
ENV AUTHENTICATION_INSTANCE_NAME=$AUTHENTICATION_INSTANCE_NAME
ENV AUTHENTICATION_INSTANCE_WEBHOOK_URL=$AUTHENTICATION_INSTANCE_WEBHOOK_URL
ENV AUTHENTICATION_INSTANCE_MODE=$AUTHENTICATION_INSTANCE_MODE
ENV AUTHENTICATION_INSTANCE_WEBHOOK_BY_EVENTS=$AUTHENTICATION_INSTANCE_WEBHOOK_BY_EVENTS
RUN npm install RUN npm install
COPY . . COPY ./src ./src
COPY ./public ./public
COPY ./prisma ./prisma
COPY ./manager ./manager
COPY ./.env.example ./.env
COPY ./runWithProvider.js ./
COPY ./tsup.config.ts ./
COPY ./Docker ./Docker
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/*
RUN ./Docker/scripts/generate_database.sh
RUN npm run build RUN npm run build
CMD [ "node", "./dist/src/main.js" ] FROM node:20-alpine AS final
RUN apk update && \
apk add tzdata ffmpeg bash openssl
ENV TZ=America/Sao_Paulo
WORKDIR /evolution
COPY --from=builder /evolution/package.json ./package.json
COPY --from=builder /evolution/package-lock.json ./package-lock.json
COPY --from=builder /evolution/node_modules ./node_modules
COPY --from=builder /evolution/dist ./dist
COPY --from=builder /evolution/prisma ./prisma
COPY --from=builder /evolution/manager ./manager
COPY --from=builder /evolution/public ./public
COPY --from=builder /evolution/.env ./.env
COPY --from=builder /evolution/Docker ./Docker
COPY --from=builder /evolution/runWithProvider.js ./runWithProvider.js
COPY --from=builder /evolution/tsup.config.ts ./tsup.config.ts
ENV DOCKER_ENV=true
EXPOSE 8080
ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ]

View File

@ -0,0 +1,241 @@
{
"name": "[Evolution] Configurar Admin",
"nodes": [
{
"parameters": {
"values": {
"string": [
{
"name": "api_access_token",
"value": "CHATWOOT_ADMIN_USER_TOKEN"
},
{
"name": "chatwoot_url",
"value": "https://CHATWOOT_URL"
},
{
"name": "n8n_url",
"value": "https://N8N_URL"
},
{
"name": "organization",
"value": "ORGANIZATION_NAME"
},
{
"name": "logo",
"value": "ORGANIZATION_LOGO"
}
]
},
"options": {}
},
"id": "7a89a538-2cae-4032-8896-09627c07bc68",
"name": "Info Base",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
620,
480
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/contacts/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"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}",
"options": {}
},
"id": "12a39df3-6b95-4f83-a0bc-50b25adaca7f",
"name": "Cria Contato Bot",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1020,
480
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/inboxes/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
"options": {}
},
"id": "bed7c54d-e232-4fe4-9584-0515e9679868",
"name": "Cria Inbox Start",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
820,
480
]
},
{
"parameters": {},
"id": "36ada769-a757-4193-989b-0cc4ea504b80",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
420,
480
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"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}",
"options": {}
},
"id": "f5bbb285-71a8-4c58-a4d7-e56002d697f0",
"name": "Cria Automação Empresas",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1220,
480
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/1/automation_rules/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"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}",
"options": {}
},
"id": "a36bebdc-a318-40a2-8532-c7f476f8adb7",
"name": "Cria Automação Inboxes",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1420,
480
]
},
{
"parameters": {
"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**",
"width": 894.6435495898575
},
"id": "db66e867-e9f4-452d-b521-725eeac652c8",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
420,
280
]
}
],
"pinData": {},
"connections": {
"Info Base": {
"main": [
[
{
"node": "Cria Inbox Start",
"type": "main",
"index": 0
}
]
]
},
"Cria Contato Bot": {
"main": [
[
{
"node": "Cria Automação Empresas",
"type": "main",
"index": 0
}
]
]
},
"Cria Inbox Start": {
"main": [
[
{
"node": "Cria Contato Bot",
"type": "main",
"index": 0
}
]
]
},
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Info Base",
"type": "main",
"index": 0
}
]
]
},
"Cria Automação Empresas": {
"main": [
[
{
"node": "Cria Automação Inboxes",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "78f155dc-7809-4bfc-9282-63f49b07fc4d",
"id": "BSATyGpGWLR4ZwNm",
"meta": {
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
},
"tags": []
}

View File

@ -0,0 +1,456 @@
{
"name": "[Evolution] Criador de Empresas",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "criadorchatwoot",
"options": {}
},
"id": "5a47c10a-e43c-4fa5-baad-4b6cc511bfcd",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
1420,
860
],
"webhookId": "6fe428e3-1752-453c-9358-abf18b793387"
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/accounts",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $json.name_company }}"
},
{
"name": "locale",
"value": "pt_BR"
}
]
},
"options": {}
},
"id": "8295c119-3a96-424e-9386-43d75f6816f5",
"name": "Cria Conta",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2020,
860
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/users",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $('Info Base').item.json.name_admin }}"
},
{
"name": "email",
"value": "={{ $('Info Base').item.json[\"email\"] }}"
},
{
"name": "password",
"value": "={{ $('Info Base').item.json[\"password\"] }}"
}
]
},
"options": {}
},
"id": "4fe5007a-3a6b-490a-a446-e45cc168189f",
"name": "Cria Usuario",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2220,
860
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/platform/api/v1/accounts/{{ $node[\"Cria Conta\"].json[\"id\"] }}/account_users",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json[\"api_access_token\"] }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "user_id",
"value": "={{ $node[\"Cria Usuario\"].json[\"id\"] }}"
},
{
"name": "role",
"value": "administrator"
}
]
},
"options": {}
},
"id": "848c55e2-5678-4291-9602-c94d994da95b",
"name": "Add Usuario a Conta",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2420,
860
]
},
{
"parameters": {
"fromEmail": "={{ $('Info Base').item.json[\"from_email\"] }}",
"toEmail": "={{ $('LimpaDados').item.json.email }}",
"subject": "=Bem vindo à {{ $('Info Base').item.json[\"organization\"] }}",
"text": "=Olá seja bem vindo:\n\nAbaixo segue seus dados de acesso:\n\nURL: {{ $('Info Base').item.json[\"chatwoot_url\"] }}\n\nuser: {{ $('LimpaDados').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados').item.json[\"password\"] }}",
"options": {}
},
"id": "27f3b24f-1cf2-4d0d-a354-ecba066059f6",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2,
"position": [
3220,
860
],
"credentials": {
"smtp": {
"id": "6BxluEUV8zrXKoVG",
"name": "[Dgcode] SMTP"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "api_access_token",
"value": "CHATWOOT_PLATFORM_TOKEN"
},
{
"name": "chatwoot_url",
"value": "https://CHATWOOT_URL"
},
{
"name": "n8n_url",
"value": "https://N8N_URL"
},
{
"name": "organization",
"value": "ORGANIZATION_NAME"
},
{
"name": "logo",
"value": "ORGANIZATION_LOGO"
},
{
"name": "from_email",
"value": "FROM_EMAIL"
},
{
"name": "name",
"value": "={{ $json.name_company }}"
},
{
"name": "email",
"value": "={{ $json.email }}"
},
{
"name": "password",
"value": "={{ $json.password }}"
},
{
"name": "name_company",
"value": "={{ $json.name_company }}"
}
]
},
"options": {}
},
"id": "38b4069d-e51e-4db7-933f-941b1be6d124",
"name": "Info Base",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
1820,
860
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "name_admin",
"value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome Usuario Administrador: ([^\\n]+)/)[1];}}"
},
{
"name": "name_company",
"value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome da Empresa: ([^\\n]+)/)[1];}}"
},
{
"name": "email",
"value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Email: ([^\\s]+)/)[1];}}"
},
{
"name": "password",
"value": "={{$node[\"Webhook\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Senha: ([^\\s]+)/)[1];}}"
}
]
},
"options": {}
},
"id": "28e29e73-aadc-49ca-bd6d-b57ee0160a21",
"name": "LimpaDados",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
1620,
860
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Add Usuario a Conta').item.json.account_id }}/contacts/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Cria Usuario').item.json.access_token }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"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}",
"options": {}
},
"id": "bb671443-bdb4-4f56-99af-f0baef246a3e",
"name": "Cria Contato Bot",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2820,
860
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Add Usuario a Conta').item.json.account_id }}/automation_rules/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Cria Usuario').item.json.access_token }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"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={{ $('Cria Usuario').item.json.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 \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\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}",
"options": {}
},
"id": "e016a2af-b212-4e00-a3ff-8cd03530aa06",
"name": "Cria Automação",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
3020,
860
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $json.account_id }}/inboxes/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Cria Usuario').item.json.access_token }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
"options": {}
},
"id": "d3c42148-8920-4c98-a874-eb7113f2dd22",
"name": "Cria Inbox Start",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2620,
860
]
},
{
"parameters": {
"content": "## Workflow Criador de Empresas\n**Cria Contas (Empresas) e Usuários através de tema**\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 PlatformApp encontrado no acesso ao Super Admin**\n**Tema para criar novas empresa:**\n\nTema Criador de Empresa:\n\nNome Usuario Administrador: Joao Linhares\nNome da Empresa: Oficina Linhates\nEmail: machineteste24@gmail.com\nSenha: Mfcd62!!",
"height": 304.02684563758396,
"width": 1129.7777777777778
},
"id": "d07516c0-4c8e-43ab-ba86-c8d063b09be5",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1420,
520
]
}
],
"pinData": {},
"connections": {
"Webhook": {
"main": [
[
{
"node": "LimpaDados",
"type": "main",
"index": 0
}
]
]
},
"Cria Conta": {
"main": [
[
{
"node": "Cria Usuario",
"type": "main",
"index": 0
}
]
]
},
"Cria Usuario": {
"main": [
[
{
"node": "Add Usuario a Conta",
"type": "main",
"index": 0
}
]
]
},
"Add Usuario a Conta": {
"main": [
[
{
"node": "Cria Inbox Start",
"type": "main",
"index": 0
}
]
]
},
"Info Base": {
"main": [
[
{
"node": "Cria Conta",
"type": "main",
"index": 0
}
]
]
},
"LimpaDados": {
"main": [
[
{
"node": "Info Base",
"type": "main",
"index": 0
}
]
]
},
"Cria Contato Bot": {
"main": [
[
{
"node": "Cria Automação",
"type": "main",
"index": 0
}
]
]
},
"Cria Automação": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
},
"Cria Inbox Start": {
"main": [
[
{
"node": "Cria Contato Bot",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {},
"versionId": "3ffd6d3f-6966-4de4-af8f-1fda464bc1b8",
"id": "79R6qQDtfyCwgYjJ",
"meta": {
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
},
"tags": []
}

View File

@ -0,0 +1,577 @@
{
"name": "criador_de_inbox_evo_v2.0",
"nodes": [
{
"parameters": {
"method": "POST",
"url": "={{ $json.evolution_url }}/instance/create",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "apikey",
"value": "={{ $json.global_api_key }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "instanceName",
"value": "={{ $json.instanceName }}"
},
{
"name": "qrcode",
"value": "={{ $json.qrcode }}"
},
{
"name": "chatwootAccountId",
"value": "={{ $json.chatwootAccountId }}"
},
{
"name": "chatwootToken",
"value": "={{ $json.chatwootToken }}"
},
{
"name": "chatwootUrl",
"value": "={{ $json.chatwootUrl }}"
},
{
"name": "chatwootSignMsg",
"value": "={{ $json.chatwootSignMsg }}"
},
{
"name": "chatwootReopenConversation",
"value": "={{ $json.chatwootReopenConversation }}"
},
{
"name": "chatwootConversationPending",
"value": "={{ $json.chatwootConversationPending }}"
},
{
"name": "rejectCall",
"value": "={{ $json.rejectCall }}"
},
{
"name": "msgCall",
"value": "={{ $json.msgCall }}"
},
{
"name": "groupsIgnore",
"value": "={{ $json.groupsIgnore }}"
},
{
"name": "alwaysOnline",
"value": "={{ $json.alwaysOnline }}"
},
{
"name": "readMessages",
"value": "={{ $json.readMessages }}"
},
{
"name": "readStatus",
"value": "={{ $json.readStatus }}"
},
{
"name": "chatwootImportContacts",
"value": "={{ $json.chatwootImportContacts }}"
},
{
"name": "chatwootImportMessages",
"value": "={{ $json.chatwootImportMessages }}"
},
{
"name": "chatwootDaysLimitImportMessages",
"value": "={{ $json.chatwootDaysLimitImportMessages }}"
},
{
"name": "syncFullHistory",
"value": "={{ $json.syncFullHistory }}"
},
{
"name": "chatwootMergeBrazilContacts",
"value": "={{ $json.chatwootMergeBrazilContacts }}"
},
{
"name": "integration",
"value": "={{ $json.integration }}"
},
{
"name": "chatwootNameInbox",
"value": "={{ $json.chatwootNameInbox }}"
},
{
"name": "token",
"value": "={{ $json.token }}"
}
]
},
"options": {}
},
"id": "7da41431-cc8e-4eb4-9894-7bf413819fe3",
"name": "Cria Instancia",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
900,
680
]
},
{
"parameters": {
"url": "={{ $('Info Base').item.json[\"chatwootUrl\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwootAccountId\"] }}/inboxes/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json.chatwootToken }}"
}
]
},
"options": {}
},
"id": "d51fbbfe-4579-4fba-949f-c29e0b806feb",
"name": "Lista Inboxes",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1120,
680
]
},
{
"parameters": {
"content": "## Workflow Para Criar Inbox - Evolution 2.0 ou superior\n**Aqui você configura a comunicação entre o chatwoot e a Evolution API para criar novas instâncias a partir do chatwoot**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e Evolution API**",
"width": 1129.7777777777778
},
"id": "7c66af51-b01e-4b76-8a8c-0193e87ec9d5",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
460,
460
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "chatwootUrl",
"value": "https://chatwootUrl - preencha"
},
{
"name": "evolution_url",
"value": "https://evolution_url - preencha"
},
{
"name": "global_api_key",
"value": "global_api_key - preencha"
},
{
"name": "organization",
"value": "={{ $json.query.organization }}"
},
{
"name": "instanceName",
"value": "={{ $json.body.messages[0].content.split(':')[1] }}-cwId-{{ $json.body.messages[0].account_id }}"
},
{
"name": "chatwootToken",
"value": "={{ $json.query.utoken }}"
},
{
"name": "msgCall",
"value": "Não aceitamos chamadas, por favor deixe uma mensagem!"
},
{
"name": "integration",
"value": "WHATSAPP-BAILEYS"
},
{
"name": "chatwootNameInbox",
"value": "={{ $json.body.messages[0].content.split(':')[1] }}"
},
{
"name": "chatwootAccountId",
"value": "={{ $json.body.messages[0].account_id.toString() }}"
},
{
"name": "token",
"value": "=AfRw{{ Date.now() }}BeH4"
}
],
"boolean": [
{
"name": "qrcode",
"value": true
},
{
"name": "chatwootSignMsg",
"value": true
},
{
"name": "chatwootReopenConversation",
"value": true
},
{
"name": "chatwootConversationPending"
},
{
"name": "rejectCall"
},
{
"name": "groupsIgnore"
},
{
"name": "alwaysOnline",
"value": true
},
{
"name": "readMessages",
"value": true
},
{
"name": "readStatus"
},
{
"name": "chatwootImportMessages",
"value": true
},
{
"name": "chatwootImportContacts",
"value": true
},
{
"name": "syncFullHistory"
},
{
"name": "chatwootMergeBrazilContacts",
"value": true
}
],
"number": [
{
"name": "chatwootDaysLimitImportMessages",
"value": 60
}
]
},
"options": {
"dotNotation": false
}
},
"id": "eaffbc44-3701-4f8d-b923-92061cfb995f",
"name": "Info Base",
"type": "n8n-nodes-base.set",
"typeVersion": 2,
"position": [
680,
680
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.name }}",
"value2": "=Start {{ $('Info Base').item.json[\"organization\"] }}"
}
]
}
},
"id": "82eb24c8-2269-4622-b012-d6f6ad35c149",
"name": "é Start Inbox?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1800,
600
]
},
{
"parameters": {
"batchSize": 1,
"options": {}
},
"id": "b9de1318-ab0b-4529-b30a-2daea64dbcfe",
"name": "Split In Batches",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 2,
"position": [
1560,
680
]
},
{
"parameters": {
"method": "DELETE",
"url": "={{ $('Info Base').item.json[\"chatwootUrl\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwootAccountId\"] }}/inboxes/{{ $json.id }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json.chatwootToken }}"
}
]
},
"options": {}
},
"id": "db2ad958-7642-41eb-8e9a-e8b1668230d1",
"name": "Deleta Inbox Start",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2040,
480
]
},
{
"parameters": {},
"id": "6d68d3a7-d613-471f-8492-9ec473481521",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1800,
780
]
},
{
"parameters": {
"fieldToSplitOut": "payload",
"options": {}
},
"id": "be833e77-b2ae-44c6-b4fc-ad24ffc8ad9a",
"name": "Ajusta lista",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 2.2,
"position": [
1340,
680
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "inbox_whatsapp",
"options": {}
},
"id": "faae80e0-9070-4a0c-83bc-d47643a64653",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
460,
680
],
"webhookId": "85cb0c27-4223-4339-b7b4-35a16c0a04b8"
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.name }}",
"value2": "={{ $('Webhook').item.json[\"body\"][\"messages\"][0][\"content\"].split(':')[1] }}"
}
]
}
},
"id": "4ea7b74f-bdc5-4619-8e99-1f5d33c7e28e",
"name": "é_pre-existente?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1980,
700
]
},
{
"parameters": {
"method": "PATCH",
"url": "={{ $('Info Base').item.json[\"chatwootUrl\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwootAccountId\"] }}/inboxes/{{ $json.id }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "api_access_token",
"value": "={{ $('Info Base').item.json.chatwootToken }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n\"channel\": {\n\"webhook_url\": \"{{ $('Info Base').item.json[\"evolution_url\"] }}/chatwoot/webhook/{{ encodeURIComponent($('Info Base').item.json[\"instanceName\"]) }}\"\n}\n}",
"options": {}
},
"id": "74d6db21-d49e-48d6-b1a8-ff8bddca67d1",
"name": "Update_webhook_url",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
2200,
700
]
}
],
"pinData": {},
"connections": {
"Cria Instancia": {
"main": [
[
{
"node": "Lista Inboxes",
"type": "main",
"index": 0
}
]
]
},
"Lista Inboxes": {
"main": [
[
{
"node": "Ajusta lista",
"type": "main",
"index": 0
}
]
]
},
"Info Base": {
"main": [
[
{
"node": "Cria Instancia",
"type": "main",
"index": 0
}
]
]
},
"é Start Inbox?": {
"main": [
[
{
"node": "Deleta Inbox Start",
"type": "main",
"index": 0
}
],
[
{
"node": "é_pre-existente?",
"type": "main",
"index": 0
}
]
]
},
"Split In Batches": {
"main": [
[
{
"node": "é Start Inbox?",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Deleta Inbox Start": {
"main": [
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
},
"Ajusta lista": {
"main": [
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Info Base",
"type": "main",
"index": 0
}
]
]
},
"é_pre-existente?": {
"main": [
[
{
"node": "Update_webhook_url",
"type": "main",
"index": 0
}
],
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
},
"Update_webhook_url": {
"main": [
[
{
"node": "Split In Batches",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "68f9fa60-e295-4b74-8cb3-c4723d6cb2b2",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "8ed3edb9203bfe03a4b94f63390235285fbb1c230430fdae73a456b9fae762d5"
},
"id": "f6dLbF7I7nrjcDc4",
"tags": []
}

675
LICENSE
View File

@ -1,674 +1,21 @@
GNU GENERAL PUBLIC LICENSE # Evolution API License
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Evolution API is licensed under the Apache License 2.0, with the following additional conditions:
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble 1. Evolution API may be utilized commercially, including as a backend service for other applications or as an application development platform for enterprises. Should the conditions below be met, a commercial license must be obtained from the producer:
The GNU General Public License is a free, copyleft license for a. LOGO and copyright information: In the process of using Evolution API's frontend components, you may not remove or modify the LOGO or copyright information in the Evolution API console or applications. This restriction is inapplicable to uses of Evolution API that do not involve its frontend components.
software and other kinds of works.
The licenses for most software and other practical works are designed b. Usage Notification Requirement: If Evolution API is used as part of any project, including closed-source systems (e.g., proprietary software), the user is required to display a clear notification within the system that Evolution API is being utilized. This notification should be visible to system administrators and accessible from the system's documentation or settings page. Failure to comply with this requirement may result in the necessity for a commercial license, as determined by the producer.
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not Please contact contato@evolution-api.com to inquire about licensing matters.
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you 2. As a contributor, you should agree that:
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary.
gratis or for a fee, you must pass on to the recipients the same b. Your contributed code may be used for commercial purposes, including but not limited to its cloud business operations.
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps: Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0.
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains © 2024 Evolution API
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

319
README.md
View File

@ -1,267 +1,120 @@
<h1 align="center">Evolution Api</h1> <h1 align="center">Evolution Api</h1>
<!--
</br>
<hr style="height: 5px;background: #007500;margin: 20px 0;box-shadow: 0px 3px 5px 0px rgb(204 204 204);">-->
<!-- <div align="center"> --> <div align="center">
<!-- [![Telegram Group](https://img.shields.io/badge/Group-Telegram-%2333C1FF)](#) [![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)](#) [![Whatsapp Group](https://img.shields.io/badge/Group-WhatsApp-%2322BC18)](https://evolution-api.com/whatsapp)
[![License](https://img.shields.io/badge/license-GPL--3.0-orange)](./LICENSE) [![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord)
[![Support](https://img.shields.io/badge/Buy%20me-coffe-orange)](https://app.picpay.com/user/davidsongomes1998) --> [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman)
[![Documentation](https://img.shields.io/badge/Documentation-Official-green)](https://doc.evolution-api.com)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE)
[![Support](https://img.shields.io/badge/Donation-picpay-green)](https://app.picpay.com/user/davidsongomes1998)
[![Sponsors](https://img.shields.io/badge/Github-sponsor-orange)](https://github.com/sponsors/EvolutionAPI)
<!-- </div> --> </div>
<!-- <div align="center"><img src="./public/images/cover.png"></div>-> --> <div align="center"><img src="./public/images/cover.png"></div>
## WhatsApp-Api-NodeJs ## Evolution API
This project is based on the [CodeChat](https://github.com/code-chat-br/whatsapp-api). The original project is an implementation of [Baileys](https://github.com/adiwajshing/Baileys), serving as a Restful API service that controls WhatsApp functions.</br> Evolution API began as a WhatsApp controller API based on [CodeChat](https://github.com/code-chat-br/whatsapp-api), which in turn implemented the [Baileys](https://github.com/WhiskeySockets/Baileys) library. While originally focused on WhatsApp, Evolution API has grown into a comprehensive platform supporting multiple messaging services and integrations. We continue to acknowledge CodeChat for laying the groundwork.
The code allows the creation of multiservice chats, service bots, or any other system that utilizes WhatsApp. The documentation provides instructions on how to set up and use the project, as well as additional information about its features and configuration options.
## Infrastructure Today, Evolution API is not limited to WhatsApp. It integrates with various platforms such as Typebot, Chatwoot, Dify, and OpenAI, offering a broad array of functionalities beyond messaging. Evolution API supports both the Baileys-based WhatsApp API and the official WhatsApp Business API, with upcoming support for Instagram and Messenger.
### Nvm installation ## Looking for a Lightweight Version?
For those who need a more streamlined and performance-optimized version, check out [Evolution API Lite](https://github.com/EvolutionAPI/evolution-api-lite). It's designed specifically for microservices, focusing solely on connectivity without integrations or audio conversion features. Ideal for environments that prioritize simplicity and efficiency.
```sh ## Types of Connections
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
```
>
> After finishing, restart the terminal to load the new information.
>
### Docker installation \[optional\] Evolution API supports multiple types of connections to WhatsApp, enabling flexible and powerful integration options:
```sh - *WhatsApp API - Baileys*:
curl -fsSL https://get.docker.com -o get-docker.sh - A free API based on WhatsApp Web, leveraging the [Baileys library](https://github.com/WhiskeySockets/Baileys).
- This connection type allows control over WhatsApp Web functionalities through a RESTful API, suitable for multi-service chats, service bots, and other WhatsApp-integrated systems.
- Note: This method relies on the web version of WhatsApp and may have limitations compared to official APIs.
sudo sh get-docker.sh - *WhatsApp Cloud API*:
- The official API provided by Meta (formerly Facebook).
- This connection type offers a robust and reliable solution designed for businesses needing higher volumes of messaging and better integration support.
- The Cloud API supports features such as end-to-end encryption, advanced analytics, and more comprehensive customer service tools.
- To use this API, you must comply with Meta's policies and potentially pay for usage based on message volume and other factors.
sudo usermod -aG docker ${USER} ## Integrations
```
### Nodejs installation
```sh Evolution API supports various integrations to enhance its functionality. Below is a list of available integrations and their uses:
nvm install 16.17.0
```
### pm2 installation - [Typebot](https://typebot.io/):
```sh - Build conversational bots using Typebot, integrated directly into Evolution with trigger management.
npm i -g pm2
```
```sh - [Chatwoot](https://www.chatwoot.com/):
docker --version - Direct integration with Chatwoot for handling customer service for your business.
node --version - [RabbitMQ](https://www.rabbitmq.com/):
``` - Receive events from the Evolution API via RabbitMQ.
## MongoDb [optional]
After installing docker and docker-compose, up the container. - [Amazon SQS](https://aws.amazon.com/pt/sqs/):
- [compose from mongodb](./mongodb/docker-compose.yaml) - Receive events from the Evolution API via Amazon SQS.
In the same directory where the file is located, run the following command: - [Socket.io](https://socket.io/):
```sh - Receive events from the Evolution API via WebSocket.
bash docker.sh
```
Using the database is optional.
## Application startup - [Dify](https://dify.ai/):
- Integrate your Evolution API directly with Dify AI for seamless trigger management and multiple agents.
Cloning the Repository - [OpenAI](https://openai.com/):
``` - Integrate your Evolution API with OpenAI for AI capabilities, including audio-to-text conversion, available across all Evolution integrations.
git clone https://github.com/code-chat-br/whatsapp-api.git
```
Go to the project directory and install all dependencies.</br> - Amazon S3 / Minio:
```sh - Store media files received in [Amazon S3](https://aws.amazon.com/pt/s3/) or [Minio](https://min.io/).
cd whatsapp-api
npm i ## Telemetry Notice
```
Finally, run the command below to start the application: To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users.
```sh
# Under development
npm run start
# In production ## Evolution Support Premium
npm run start:prod
# pm2 Join our Evolution Pro community for expert support and a weekly call to answer questions. Visit the link below to learn more and subscribe:
pm2 start 'npm run start:prod' --name ApiCodechat
```
## Authentication
You can define two authentication **types** for the routes in the **[env file](./src/dev-env.yml)**. [Click here to learn more](https://evolution-api.com/suporte-pro)
Authentications must be inserted in the request header.
1. **apikey**
2. **jwt:** A JWT is a standard for authentication and information exchange defined with a signature.
> Authentications are generated at instance creation time.
**Note:** There is also the possibility to define a global api key, which can access and control all instances.
### Connection
#### Create an instance
##### HTTP
> *NOTE:* This key must be inserted in the request header to create an instance.
```http
POST /instance/create HTTP/1.1
Host: localhost:8080
Content-Type: application/json
apikey: t8OOEeISKzpmc3jjcMqBWYSaJH2PIxns
{
"instanceName": "codechat"
}
```
##### cURL
```bash
curl --location --request POST 'http://localhost:8080/instance/create' \
--header 'Content-Type: application/json' \
--header 'apikey: t8OOEeISKzpmc3jjcMqBWYSaJH2PIxns' \
--data-raw '{
"instanceName": "codechat"
}'
```
### Response
```ts
{
"instance": {
"instanceName": "codechat",
"status": "created"
},
"hash": {
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. [...]"
// or
// "apikey": "88513847-1B0E-4188-8D76-4A2750C9B6C3"
}
}
```
#### Connection with qrcode
##### HTTP
```http
GET /instance/connect/codechat HTTP/1.1
Host: localhost:8080
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. [...]
```
```http
GET /instance/connect/codechat HTTP/1.1
Host: localhost:8080
apikey: 88513847-1B0E-4188-8D76-4A2750C9B6C3
```
##### cURL
```bash
curl --location --request GET 'http://localhost:8080/instance/connect/codechat' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. [...]'
```
```bash
curl --location --request GET 'http://localhost:8080/instance/connect/codechat' \
--header 'apikey: 88513847-1B0E-4188-8D76-4A2750C9B6C3'
```
### Response
```ts
{
"code": "2@nXSUgRJSBY6T0XJmiFKZ0 [...] ,XsgJhJHYa+0MPpXANdPHHt6Ke/I7O2QyXT/Lsge0uSg=",
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhE [...] LkMtqAAAAABJRU5ErkJggg=="
}
```
### App in Docker
- [docker run](./docker.sh)
- [docker-compose](./docker-compose.yml)
- [env for docker](./Docker/.env)
- [DockerHub-codechat/api](https://hub.docker.com/r/codechat/api)
After building the application, in the same directory as the files above, run the following command:
```sh
docker-compose up
```
## Send Messages
| | |
|-----|---|
| Send Text | ✔ |
| Send Buttons | ✔ |
| Send Template | ❌ |
| Send Media: audio - video - image - document - gif <br></br>base64: ```true``` | ✔ |
| Send Media File | ❌ |
| Send Audio type WhatsApp | ✔ |
| Send Location | ✔ |
| Send List | ✔ |
| Send Link Preview | ✔ |
| Send Contact | ✔ |
| Send Reaction - emoji | ✔ |
| Send Poll Message | ✔ |
## Postman collections
- [Postman Json](./postman.json)
## Webhook Events
| Name | Event | TypeData | Description |
|------|-------|-----------|------------|
| APPLICATION_STARTUP | application.startup | json | Notifies you when a application startup |
| QRCODE_UPDATED | qrcode.updated | json | Sends the base64 of the qrcode for reading |
| CONNECTION_UPDATE | connection.update | json | Informs the status of the connection with whatsapp |
| MESSAGES_SET | message.set | json | Sends a list of all your messages uploaded on whatsapp</br>This event occurs only once |
| MESSAGES_UPSERT | message.upsert | json | Notifies you when a message is received |
| MESSAGES_UPDATE | message.update | json | Tells you when a message is updated |
| SEND_MESSAGE | send.message | json | Notifies when a message is sent |
| CONTACTS_SET | contacts.set | json | Performs initial loading of all contacts</br>This event occurs only once |
| CONTACTS_UPSERT | contacts.upsert | json | Reloads all contacts with additional information</br>This event occurs only once |
| CONTACTS_UPDATE | contacts.update | json | Informs you when the chat is updated |
| PRESENCE_UPDATE | presence.update | json | Informs if the user is online, if he is performing some action like writing or recording and his last seen</br>'unavailable' | 'available' | 'composing' | 'recording' | 'paused' |
| CHATS_SET | chats.set | json | Send a list of all loaded chats |
| CHATS_UPDATE | chats.update | json | Informs you when the chat is updated |
| CHATS_UPSERT | chats.upsert | json | Sends any new chat information |
| GROUPS_UPSERT | groups.upsert | JSON | Notifies when a group is created |
| GROUPS_UPDATE | groups.update | JSON | Notifies when a group has its information updated |
| GROUP_PARTICIPANTS_UPDATE | group-participants.update | JSON | Notifies when an action occurs involving a participant</br>'add' | 'remove' | 'promote' | 'demote' |
| NEW_TOKEN | new.jwt | JSON | Notifies when the token (jwt) is updated
## Env File
See additional settings that can be applied through the **env** file by clicking **[here](./src/dev-env.yml)**.
> **Attention⚠:** rename the **dev-env.yml** file to **env.yml**.
## SSL
To install the SSL certificate, follow the **[instructions](https://certbot.eff.org/instructions?ws=other&os=ubuntufocal)** below.
# Note
This code is in no way affiliated with WhatsApp. Use at your own discretion. Don't spam this.
This code was produced based on the baileys library and it is still under development.
# Donate to the project. # Donate to the project.
#### Pix: 2b526ada-4ef4-4db4-bbeb-f60da2421fce #### Github Sponsors
#### PicPay https://github.com/sponsors/EvolutionAPI
<div align="center"> # Content Creator Partners
<a href="https://app.picpay.com/user/davidsongomes1998" target="_blank" rel="noopener noreferrer">
<img src="./public/images/picpay-image.png" style="width: 50% !important;">
</a>
</div>
</br> We are proud to collaborate with the following content creators who have contributed valuable insights and tutorials about Evolution API:
- [Promovaweb](https://www.youtube.com/@promovaweb)
- [Sandeco](https://www.youtube.com/@canalsandeco)
- [Comunidade ZDG](https://www.youtube.com/@ComunidadeZDG)
- [Francis MNO](https://www.youtube.com/@FrancisMNO)
- [Pablo Cabral](https://youtube.com/@pablocabral)
- [XPop Digital](https://www.youtube.com/@xpopdigital)
- [Costar Wagner Dev](https://www.youtube.com/@costarwagnerdev)
- [Dante Testa](https://youtube.com/@dantetesta_)
- [Rubén Salazar](https://youtube.com/channel/UCnYGZIE2riiLqaN9sI6riig)
- [OrionDesign](youtube.com/OrionDesign_Oficial)
- [IMPA 365](youtube.com/@impa365_ofc)
- [Comunidade Hub Connect](https://youtube.com/@comunidadehubconnect)
- [dSantana Automações](https://www.youtube.com/channel/UCG7DjUmAxtYyURlOGAIryNQ?view_as=subscriber)
- [Edison Martins](https://www.youtube.com/@edisonmartinsmkt)
- [Astra Online](https://www.youtube.com/@astraonlineweb)
- [MKT Seven Automações](https://www.youtube.com/@sevenautomacoes)
- [Vamos automatizar](https://www.youtube.com/vamosautomatizar)
## License
Evolution API is licensed under the Apache License 2.0, with the following additional conditions:
1. **LOGO and copyright information**: In the process of using Evolution API's frontend components, you may not remove or modify the LOGO or copyright information in the Evolution API console or applications. This restriction is inapplicable to uses of Evolution API that do not involve its frontend components.
2. **Usage Notification Requirement**: If Evolution API is used as part of any project, including closed-source systems (e.g., proprietary software), the user is required to display a clear notification within the system that Evolution API is being utilized. This notification should be visible to system administrators and accessible from the system's documentation or settings page. Failure to comply with this requirement may result in the necessity for a commercial license, as determined by the producer.
Please contact contato@evolution-api.com to inquire about licensing matters.
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
© 2024 Evolution API

25
docker-compose.dev.yaml Normal file
View File

@ -0,0 +1,25 @@
services:
api:
container_name: evolution_api
image: evolution/api:local
build: .
restart: always
ports:
- 8080:8080
volumes:
- evolution_instances:/evolution/instances
networks:
- evolution-net
env_file:
- .env
expose:
- 8080
volumes:
evolution_instances:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

@ -1,18 +1,60 @@
version: '3.3'
networks:
evolution-net:
driver: bridge
services: services:
base: api:
container_name: evolution_api container_name: evolution_api
image: davidsongomes/evolution-api:latest image: evoapicloud/evolution-api:latest
restart: always
depends_on:
- redis
- postgres
ports: ports:
- 8080:8080 - 8080:8080
volumes: volumes:
- /data/instances:/evolution/instances - evolution_instances:/evolution/instances
command: ['node', './dist/src/main.js']
networks: networks:
- evolution-net - evolution-net
env_file:
- .env
expose:
- 8080
redis:
image: redis:latest
networks:
- evolution-net
container_name: redis
command: >
redis-server --port 6379 --appendonly yes
volumes:
- evolution_redis:/data
ports:
- 6379:6379
postgres:
container_name: postgres
image: postgres:15
networks:
- evolution-net
command: ["postgres", "-c", "max_connections=1000", "-c", "listen_addresses=*"]
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=evolution
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres_data:/var/lib/postgresql/data
expose:
- 5432
volumes:
evolution_instances:
evolution_redis:
postgres_data:
networks:
evolution-net:
name: evolution-net
driver: bridge

View File

150
local_install.sh Executable file
View File

@ -0,0 +1,150 @@
#!/bin/bash
# Definir cores para melhor legibilidade
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Função para log
log() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
log_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
# Verificar se está rodando como root
if [ "$(id -u)" = "0" ]; then
log_error "Este script não deve ser executado como root"
exit 1
fi
# Verificar sistema operacional
OS="$(uname -s)"
case "${OS}" in
Linux*)
if [ ! -x "$(command -v curl)" ]; then
log_warning "Curl não está instalado. Tentando instalar..."
if [ -x "$(command -v apt-get)" ]; then
sudo apt-get update && sudo apt-get install -y curl
elif [ -x "$(command -v yum)" ]; then
sudo yum install -y curl
else
log_error "Não foi possível instalar curl automaticamente. Por favor, instale manualmente."
exit 1
fi
fi
;;
Darwin*)
if [ ! -x "$(command -v curl)" ]; then
log_error "Curl não está instalado. Por favor, instale o Xcode Command Line Tools."
exit 1
fi
;;
*)
log_error "Sistema operacional não suportado: ${OS}"
exit 1
;;
esac
# Verificar conexão com a internet antes de prosseguir
if ! ping -c 1 8.8.8.8 &> /dev/null; then
log_error "Sem conexão com a internet. Por favor, verifique sua conexão."
exit 1
fi
# Adicionar verificação de espaço em disco
REQUIRED_SPACE=1000000 # 1GB em KB
AVAILABLE_SPACE=$(df -k . | awk 'NR==2 {print $4}')
if [ $AVAILABLE_SPACE -lt $REQUIRED_SPACE ]; then
log_error "Espaço em disco insuficiente. Necessário pelo menos 1GB livre."
exit 1
fi
# Adicionar tratamento de erro para comandos npm
npm_install_with_retry() {
local max_attempts=3
local attempt=1
while [ $attempt -le $max_attempts ]; do
log "Tentativa $attempt de $max_attempts para npm install"
if npm install; then
return 0
fi
attempt=$((attempt + 1))
[ $attempt -le $max_attempts ] && log_warning "Falha na instalação. Tentando novamente em 5 segundos..." && sleep 5
done
log_error "Falha ao executar npm install após $max_attempts tentativas"
return 1
}
# Adicionar timeout para comandos
execute_with_timeout() {
timeout 300 $@ || log_error "Comando excedeu o tempo limite de 5 minutos: $@"
}
# Verificar se o NVM já está instalado
if [ -d "$HOME/.nvm" ]; then
log "NVM já está instalado."
else
log "Instalando NVM..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
fi
# Carregar o NVM no ambiente atual
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# Verificar se a versão do Node.js já está instalada
if command -v node >/dev/null 2>&1 && [ "$(node -v)" = "v20.10.0" ]; then
log "Node.js v20.10.0 já está instalado."
else
log "Instalando Node.js v20.10.0..."
nvm install v20.10.0
fi
nvm use v20.10.0
# Verificar as versões instaladas
log "Verificando as versões instaladas:"
log "Node.js: $(node -v)"
log "npm: $(npm -v)"
# Instala dependências do projeto
log "Instalando dependências do projeto..."
rm -rf node_modules
npm install
# Deploy do banco de dados
log "Deploy do banco de dados..."
npm run db:generate
npm run db:deploy
# Iniciar o projeto
log "Iniciando o projeto..."
if [ "$1" = "-dev" ]; then
npm run dev:server
else
npm run build
npm run start:prod
fi
log "Instalação concluída com sucesso!"
# Criar arquivo de log
LOGFILE="./installation_log_$(date +%Y%m%d_%H%M%S).log"
exec 1> >(tee -a "$LOGFILE")
exec 2>&1
# Adicionar trap para limpeza em caso de interrupção
cleanup() {
log "Limpando recursos temporários..."
# Adicione comandos de limpeza aqui
}
trap cleanup EXIT

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

381
manager/dist/assets/index-D-oOjDYe.js vendored Normal file

File diff suppressed because one or more lines are too long

14
manager/dist/index.html vendored Normal file
View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="https://evolution-api.com/files/evo/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Evolution Manager</title>
<script type="module" crossorigin src="/assets/index-D-oOjDYe.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CXH2BdD4.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@ -1,28 +0,0 @@
version: '3.8'
networks:
api-net:
driver: bridge
services:
mongodb:
container_name: mongodb
# This image already has a single replica set
image: mongo
restart: always
volumes:
# sudo mkdir -p /data/mongodb
- /data/mongodb:/data/db
ports:
- 26712:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
# Set a password to access the bank
MONGO_INITDB_ROOT_PASSWORD: <password>
networks:
- api-net
expose:
- 26712

12330
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,27 @@
{ {
"name": "evolution-api", "name": "evolution-api",
"version": "1.2.0", "version": "2.3.0",
"description": "Rest api for communication with WhatsApp", "description": "Rest api for communication with WhatsApp",
"main": "index.js", "main": "./dist/main.js",
"type": "commonjs",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc --noEmit && tsup",
"start": "ts-node --files --transpile-only ./src/main.ts", "start": "tsnd -r tsconfig-paths/register --files --transpile-only ./src/main.ts",
"start:prod": "bash start.sh", "start:prod": "node dist/main",
"dev:server": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts", "dev:server": "tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts",
"test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts" "test": "tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts",
"lint": "eslint --fix --ext .ts src",
"lint:check": "eslint --ext .ts src",
"db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
"db:deploy": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
"db:deploy:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate deploy --schema prisma\\DATABASE_PROVIDER-schema.prisma\"",
"db:studio": "node runWithProvider.js \"npx prisma studio --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"",
"db:migrate:dev": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate dev --schema ./prisma/DATABASE_PROVIDER-schema.prisma && cp -r ./prisma/migrations/* ./prisma/DATABASE_PROVIDER-migrations\"",
"db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\""
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/DavidsonGomes/evolution-api.git" "url": "git+https://github.com/EvolutionAPI/evolution-api.git"
}, },
"keywords": [ "keywords": [
"chat", "chat",
@ -32,59 +41,87 @@
], ],
"author": { "author": {
"name": "Davidson Gomes", "name": "Davidson Gomes",
"email": "contato@agenciadgcode.com" "email": "contato@evolution-api.com"
}, },
"license": "GPL-3.0", "license": "Apache-2.0",
"bugs": { "bugs": {
"url": "https://github.com/DavidsonGomes/evolution-api/issues" "url": "https://github.com/EvolutionAPI/evolution-api/issues"
}, },
"homepage": "https://github.com/DavidsonGomes/evolution-api#readme", "homepage": "https://github.com/EvolutionAPI/evolution-api#readme",
"dependencies": { "dependencies": {
"@adiwajshing/keyed-db": "^0.2.4", "@adiwajshing/keyed-db": "^0.2.4",
"@evolution/base": "github:WhiskeySockets/Baileys", "@aws-sdk/client-sqs": "^3.723.0",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@figuro/chatwoot-sdk": "^1.1.16",
"@hapi/boom": "^10.0.1", "@hapi/boom": "^10.0.1",
"axios": "^1.3.5", "@paralleldrive/cuid2": "^2.2.2",
"class-validator": "^0.13.2", "@prisma/client": "^6.1.0",
"compression": "^1.7.4", "@sentry/node": "^8.47.0",
"amqplib": "^0.10.5",
"audio-decode": "^2.2.3",
"axios": "^1.7.9",
"baileys": "github:EvolutionAPI/Baileys",
"class-validator": "^0.14.1",
"compression": "^1.7.5",
"cors": "^2.8.5", "cors": "^2.8.5",
"cross-env": "^7.0.3", "dayjs": "^1.11.13",
"dayjs": "^1.11.7", "dotenv": "^16.4.7",
"eventemitter2": "^6.4.9", "eventemitter2": "^6.4.9",
"express": "^4.18.2", "express": "^4.21.2",
"express-async-errors": "^3.1.1", "express-async-errors": "^3.1.1",
"hbs": "^4.2.0", "fluent-ffmpeg": "^2.1.3",
"form-data": "^4.0.1",
"https-proxy-agent": "^7.0.6",
"i18next": "^23.7.19",
"jimp": "^0.16.13", "jimp": "^0.16.13",
"join": "^3.0.0", "json-schema": "^0.4.0",
"js-yaml": "^4.1.0",
"jsonschema": "^1.4.1", "jsonschema": "^1.4.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^9.0.2",
"link-preview-js": "^3.0.4", "link-preview-js": "^3.0.13",
"mongoose": "^6.10.5", "long": "^5.2.3",
"mediainfo.js": "^0.3.4",
"mime": "^4.0.0",
"mime-types": "^2.1.35",
"minio": "^8.0.3",
"multer": "^1.4.5-lts.1",
"nats": "^2.29.1",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"node-mime-types": "^1.1.0", "node-cron": "^3.0.3",
"openai": "^4.77.3",
"pg": "^8.13.1",
"pino": "^8.11.0", "pino": "^8.11.0",
"qrcode": "^1.5.1", "prisma": "^6.1.0",
"pusher": "^5.2.0",
"qrcode": "^1.5.4",
"qrcode-terminal": "^0.12.0", "qrcode-terminal": "^0.12.0",
"redis": "^4.6.5", "redis": "^4.7.0",
"uuid": "^9.0.0" "sharp": "^0.32.6",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1",
"tsup": "^8.3.5"
}, },
"devDependencies": { "devDependencies": {
"@types/compression": "^1.7.2", "@types/compression": "^1.7.5",
"@types/cors": "^2.8.13", "@types/cors": "^2.8.17",
"@types/express": "^4.17.17", "@types/express": "^4.17.18",
"@types/js-yaml": "^4.0.5", "@types/json-schema": "^7.0.15",
"@types/jsonwebtoken": "^8.5.9", "@types/mime": "^4.0.0",
"@types/node": "^18.15.11", "@types/mime-types": "^2.1.4",
"@types/qrcode": "^1.5.0", "@types/node": "^22.10.5",
"@types/qrcode-terminal": "^0.12.0", "@types/node-cron": "^3.0.11",
"@types/uuid": "^8.3.4", "@types/qrcode": "^1.5.5",
"@typescript-eslint/eslint-plugin": "^5.57.1", "@types/qrcode-terminal": "^0.12.2",
"@typescript-eslint/parser": "^5.57.1", "@types/uuid": "^10.0.0",
"eslint": "^8.38.0", "@typescript-eslint/eslint-plugin": "^6.21.0",
"eslint-config-prettier": "^8.8.0", "@typescript-eslint/parser": "^6.21.0",
"eslint-plugin-prettier": "^4.2.1", "eslint": "^8.45.0",
"prettier": "^2.8.7", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^3.4.2",
"ts-node-dev": "^2.0.0", "ts-node-dev": "^2.0.0",
"typescript": "^4.9.5" "tsconfig-paths": "^4.2.0",
"typescript": "^5.7.2"
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/*
Warnings:
- A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `Setting`
ADD COLUMN IF NOT EXISTS `wavoipToken` VARCHAR(100);

View File

@ -0,0 +1,588 @@
-- CreateTable
CREATE TABLE `Instance` (
`id` VARCHAR(191) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`connectionStatus` ENUM('open', 'close', 'connecting') NOT NULL DEFAULT 'open',
`ownerJid` VARCHAR(100) NULL,
`profileName` VARCHAR(100) NULL,
`profilePicUrl` VARCHAR(500) NULL,
`integration` VARCHAR(100) NULL,
`number` VARCHAR(100) NULL,
`businessId` VARCHAR(100) NULL,
`token` VARCHAR(255) NULL,
`clientName` VARCHAR(100) NULL,
`disconnectionReasonCode` INTEGER NULL,
`disconnectionObject` JSON NULL,
`disconnectionAt` TIMESTAMP NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NULL,
UNIQUE INDEX `Instance_name_key`(`name`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Session` (
`id` VARCHAR(191) NOT NULL,
`sessionId` VARCHAR(191) NOT NULL,
`creds` TEXT NULL,
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE INDEX `Session_sessionId_key`(`sessionId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Chat` (
`id` VARCHAR(191) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`labels` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Contact` (
`id` VARCHAR(191) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`pushName` VARCHAR(100) NULL,
`profilePicUrl` VARCHAR(500) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Message` (
`id` VARCHAR(191) NOT NULL,
`key` JSON NOT NULL,
`pushName` VARCHAR(100) NULL,
`participant` VARCHAR(100) NULL,
`messageType` VARCHAR(100) NOT NULL,
`message` JSON NOT NULL,
`contextInfo` JSON NULL,
`source` ENUM('ios', 'android', 'web', 'unknown', 'desktop') NOT NULL,
`messageTimestamp` INTEGER NOT NULL,
`chatwootMessageId` INTEGER NULL,
`chatwootInboxId` INTEGER NULL,
`chatwootConversationId` INTEGER NULL,
`chatwootContactInboxSourceId` VARCHAR(100) NULL,
`chatwootIsRead` BOOLEAN NULL DEFAULT false,
`instanceId` VARCHAR(191) NOT NULL,
`typebotSessionId` VARCHAR(191) NULL,
`openaiSessionId` VARCHAR(191) NULL,
`webhookUrl` VARCHAR(500) NULL,
`difySessionId` VARCHAR(191) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `MessageUpdate` (
`id` VARCHAR(191) NOT NULL,
`keyId` VARCHAR(100) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`fromMe` BOOLEAN NOT NULL,
`participant` VARCHAR(100) NULL,
`pollUpdates` JSON NULL,
`status` VARCHAR(30) NOT NULL,
`messageId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Webhook` (
`id` VARCHAR(191) NOT NULL,
`url` VARCHAR(500) NOT NULL,
`enabled` BOOLEAN NULL DEFAULT true,
`events` JSON NULL,
`webhookByEvents` BOOLEAN NULL DEFAULT false,
`webhookBase64` BOOLEAN NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Webhook_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Chatwoot` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NULL DEFAULT true,
`accountId` VARCHAR(100) NULL,
`token` VARCHAR(100) NULL,
`url` VARCHAR(500) NULL,
`nameInbox` VARCHAR(100) NULL,
`signMsg` BOOLEAN NULL DEFAULT false,
`signDelimiter` VARCHAR(100) NULL,
`number` VARCHAR(100) NULL,
`reopenConversation` BOOLEAN NULL DEFAULT false,
`conversationPending` BOOLEAN NULL DEFAULT false,
`mergeBrazilContacts` BOOLEAN NULL DEFAULT false,
`importContacts` BOOLEAN NULL DEFAULT false,
`importMessages` BOOLEAN NULL DEFAULT false,
`daysLimitImportMessages` INTEGER NULL,
`organization` VARCHAR(100) NULL,
`logo` VARCHAR(500) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Chatwoot_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Label` (
`id` VARCHAR(191) NOT NULL,
`labelId` VARCHAR(100) NULL,
`name` VARCHAR(100) NOT NULL,
`color` VARCHAR(100) NOT NULL,
`predefinedId` VARCHAR(100) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Label_labelId_key`(`labelId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Proxy` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT false,
`host` VARCHAR(100) NOT NULL,
`port` VARCHAR(100) NOT NULL,
`protocol` VARCHAR(100) NOT NULL,
`username` VARCHAR(100) NOT NULL,
`password` VARCHAR(100) NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Proxy_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Setting` (
`id` VARCHAR(191) NOT NULL,
`rejectCall` BOOLEAN NOT NULL DEFAULT false,
`msgCall` VARCHAR(100) NULL,
`groupsIgnore` BOOLEAN NOT NULL DEFAULT false,
`alwaysOnline` BOOLEAN NOT NULL DEFAULT false,
`readMessages` BOOLEAN NOT NULL DEFAULT false,
`readStatus` BOOLEAN NOT NULL DEFAULT false,
`syncFullHistory` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Setting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Rabbitmq` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT false,
`events` JSON NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Rabbitmq_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Sqs` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT false,
`events` JSON NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Sqs_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Websocket` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT false,
`events` JSON NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Websocket_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Typebot` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`url` VARCHAR(500) NOT NULL,
`typebot` VARCHAR(100) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `TypebotSession` (
`id` VARCHAR(191) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`pushName` VARCHAR(100) NULL,
`sessionId` VARCHAR(100) NOT NULL,
`status` ENUM('opened', 'closed', 'paused') NOT NULL,
`prefilledVariables` JSON NULL,
`awaitUser` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`typebotId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `TypebotSetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`typebotIdFallback` VARCHAR(100) NULL,
`ignoreJids` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `TypebotSetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Media` (
`id` VARCHAR(191) NOT NULL,
`fileName` VARCHAR(500) NOT NULL,
`type` VARCHAR(100) NOT NULL,
`mimetype` VARCHAR(100) NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`messageId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Media_fileName_key`(`fileName`),
UNIQUE INDEX `Media_messageId_key`(`messageId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `OpenaiCreds` (
`id` VARCHAR(191) NOT NULL,
`name` VARCHAR(255) NULL,
`apiKey` VARCHAR(255) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `OpenaiCreds_name_key`(`name`),
UNIQUE INDEX `OpenaiCreds_apiKey_key`(`apiKey`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `OpenaiBot` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`botType` ENUM('assistant', 'chatCompletion') NOT NULL,
`assistantId` VARCHAR(255) NULL,
`functionUrl` VARCHAR(500) NULL,
`model` VARCHAR(100) NULL,
`systemMessages` JSON NULL,
`assistantMessages` JSON NULL,
`userMessages` JSON NULL,
`maxTokens` INTEGER NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`openaiCredsId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `OpenaiSession` (
`id` VARCHAR(191) NOT NULL,
`sessionId` VARCHAR(255) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`status` ENUM('opened', 'closed', 'paused') NOT NULL,
`awaitUser` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`openaiBotId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `OpenaiSetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`speechToText` BOOLEAN NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`openaiCredsId` VARCHAR(191) NOT NULL,
`openaiIdFallback` VARCHAR(100) NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `OpenaiSetting_openaiCredsId_key`(`openaiCredsId`),
UNIQUE INDEX `OpenaiSetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Template` (
`id` VARCHAR(191) NOT NULL,
`templateId` VARCHAR(255) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`template` JSON NOT NULL,
`webhookUrl` VARCHAR(500) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Template_templateId_key`(`templateId`),
UNIQUE INDEX `Template_name_key`(`name`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Dify` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`botType` ENUM('chatBot', 'textGenerator', 'agent', 'workflow') NOT NULL,
`apiUrl` VARCHAR(255) NULL,
`apiKey` VARCHAR(255) NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `DifySession` (
`id` VARCHAR(191) NOT NULL,
`sessionId` VARCHAR(255) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`status` ENUM('opened', 'closed', 'paused') NOT NULL,
`awaitUser` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`difyId` VARCHAR(191) NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `DifySetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`difyIdFallback` VARCHAR(100) NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `DifySetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_sessionId_fkey` FOREIGN KEY (`sessionId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Chat` ADD CONSTRAINT `Chat_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Contact` ADD CONSTRAINT `Contact_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_typebotSessionId_fkey` FOREIGN KEY (`typebotSessionId`) REFERENCES `TypebotSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_openaiSessionId_fkey` FOREIGN KEY (`openaiSessionId`) REFERENCES `OpenaiSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_difySessionId_fkey` FOREIGN KEY (`difySessionId`) REFERENCES `DifySession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `MessageUpdate` ADD CONSTRAINT `MessageUpdate_messageId_fkey` FOREIGN KEY (`messageId`) REFERENCES `Message`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `MessageUpdate` ADD CONSTRAINT `MessageUpdate_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Webhook` ADD CONSTRAINT `Webhook_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Chatwoot` ADD CONSTRAINT `Chatwoot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Label` ADD CONSTRAINT `Label_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Proxy` ADD CONSTRAINT `Proxy_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Setting` ADD CONSTRAINT `Setting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Rabbitmq` ADD CONSTRAINT `Rabbitmq_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Sqs` ADD CONSTRAINT `Sqs_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Websocket` ADD CONSTRAINT `Websocket_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Typebot` ADD CONSTRAINT `Typebot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `TypebotSession` ADD CONSTRAINT `TypebotSession_typebotId_fkey` FOREIGN KEY (`typebotId`) REFERENCES `Typebot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `TypebotSession` ADD CONSTRAINT `TypebotSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `TypebotSetting` ADD CONSTRAINT `TypebotSetting_typebotIdFallback_fkey` FOREIGN KEY (`typebotIdFallback`) REFERENCES `Typebot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `TypebotSetting` ADD CONSTRAINT `TypebotSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Media` ADD CONSTRAINT `Media_messageId_fkey` FOREIGN KEY (`messageId`) REFERENCES `Message`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Media` ADD CONSTRAINT `Media_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiCreds` ADD CONSTRAINT `OpenaiCreds_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiBot` ADD CONSTRAINT `OpenaiBot_openaiCredsId_fkey` FOREIGN KEY (`openaiCredsId`) REFERENCES `OpenaiCreds`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiBot` ADD CONSTRAINT `OpenaiBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiSession` ADD CONSTRAINT `OpenaiSession_openaiBotId_fkey` FOREIGN KEY (`openaiBotId`) REFERENCES `OpenaiBot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiSession` ADD CONSTRAINT `OpenaiSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_openaiCredsId_fkey` FOREIGN KEY (`openaiCredsId`) REFERENCES `OpenaiCreds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_openaiIdFallback_fkey` FOREIGN KEY (`openaiIdFallback`) REFERENCES `OpenaiBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `OpenaiSetting` ADD CONSTRAINT `OpenaiSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Template` ADD CONSTRAINT `Template_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Dify` ADD CONSTRAINT `Dify_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `DifySession` ADD CONSTRAINT `DifySession_difyId_fkey` FOREIGN KEY (`difyId`) REFERENCES `Dify`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `DifySession` ADD CONSTRAINT `DifySession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `DifySetting` ADD CONSTRAINT `DifySetting_difyIdFallback_fkey` FOREIGN KEY (`difyIdFallback`) REFERENCES `Dify`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `DifySetting` ADD CONSTRAINT `DifySetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,173 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Contact` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `Chat`
ADD COLUMN `name` VARCHAR(100) NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySession`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance`
MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Label`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSession`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session`
MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSession`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `TypebotSetting`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket`
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `Contact_remoteJid_instanceId_key` ON `Contact` (`remoteJid`, `instanceId`);

View File

@ -0,0 +1,150 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
*/
-- DropIndex
DROP INDEX `Label_labelId_key` ON `Label`;
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` ADD COLUMN `ignoreJids` JSON NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;

View File

@ -0,0 +1,208 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to drop the column `difySessionId` on the `Message` table. All the data in the column will be lost.
- You are about to drop the column `openaiSessionId` on the `Message` table. All the data in the column will be lost.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to drop the `DifySession` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `OpenaiSession` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TypebotSession` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `DifySession` DROP FOREIGN KEY `DifySession_difyId_fkey`;
-- DropForeignKey
ALTER TABLE `DifySession` DROP FOREIGN KEY `DifySession_instanceId_fkey`;
-- DropForeignKey
ALTER TABLE `Message` DROP FOREIGN KEY `Message_difySessionId_fkey`;
-- DropForeignKey
ALTER TABLE `Message` DROP FOREIGN KEY `Message_openaiSessionId_fkey`;
-- DropForeignKey
ALTER TABLE `Message` DROP FOREIGN KEY `Message_typebotSessionId_fkey`;
-- DropForeignKey
ALTER TABLE `OpenaiSession` DROP FOREIGN KEY `OpenaiSession_instanceId_fkey`;
-- DropForeignKey
ALTER TABLE `OpenaiSession` DROP FOREIGN KEY `OpenaiSession_openaiBotId_fkey`;
-- DropForeignKey
ALTER TABLE `TypebotSession` DROP FOREIGN KEY `TypebotSession_instanceId_fkey`;
-- DropForeignKey
ALTER TABLE `TypebotSession` DROP FOREIGN KEY `TypebotSession_typebotId_fkey`;
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Message` DROP COLUMN `difySessionId`,
DROP COLUMN `openaiSessionId`,
ADD COLUMN `sessionId` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- DropTable
DROP TABLE `DifySession`;
-- DropTable
DROP TABLE `OpenaiSession`;
-- DropTable
DROP TABLE `TypebotSession`;
-- CreateTable
CREATE TABLE `IntegrationSession` (
`id` VARCHAR(191) NOT NULL,
`sessionId` VARCHAR(255) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`pushName` VARCHAR(191) NULL,
`status` ENUM('opened', 'closed', 'paused') NOT NULL,
`awaitUser` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
`parameters` JSON NULL,
`openaiBotId` VARCHAR(191) NULL,
`difyId` VARCHAR(191) NULL,
`typebotId` VARCHAR(191) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Message` ADD CONSTRAINT `Message_sessionId_fkey` FOREIGN KEY (`sessionId`) REFERENCES `IntegrationSession`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_openaiBotId_fkey` FOREIGN KEY (`openaiBotId`) REFERENCES `OpenaiBot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_difyId_fkey` FOREIGN KEY (`difyId`) REFERENCES `Dify`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `IntegrationSession` ADD CONSTRAINT `IntegrationSession_typebotId_fkey` FOREIGN KEY (`typebotId`) REFERENCES `Typebot`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,269 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to drop the column `difyId` on the `IntegrationSession` table. All the data in the column will be lost.
- You are about to drop the column `openaiBotId` on the `IntegrationSession` table. All the data in the column will be lost.
- You are about to drop the column `typebotId` on the `IntegrationSession` table. All the data in the column will be lost.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
*/
-- DropForeignKey
ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_difyId_fkey`;
-- DropForeignKey
ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_openaiBotId_fkey`;
-- DropForeignKey
ALTER TABLE `IntegrationSession` DROP FOREIGN KEY `IntegrationSession_typebotId_fkey`;
-- DropIndex
DROP INDEX `Message_typebotSessionId_fkey` ON `Message`;
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` DROP COLUMN `difyId`,
DROP COLUMN `openaiBotId`,
DROP COLUMN `typebotId`,
ADD COLUMN `botId` VARCHAR(191) NULL,
ADD COLUMN `context` JSON NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL,
MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- CreateTable
CREATE TABLE `GenericBot` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`apiUrl` VARCHAR(255) NULL,
`apiKey` VARCHAR(255) NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `GenericSetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`botIdFallback` VARCHAR(100) NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `GenericSetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Flowise` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`apiUrl` VARCHAR(255) NULL,
`apiKey` VARCHAR(255) NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `FlowiseSetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`flowiseIdFallback` VARCHAR(100) NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `FlowiseSetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `GenericBot` ADD CONSTRAINT `GenericBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `GenericSetting` ADD CONSTRAINT `GenericSetting_botIdFallback_fkey` FOREIGN KEY (`botIdFallback`) REFERENCES `GenericBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `GenericSetting` ADD CONSTRAINT `GenericSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Flowise` ADD CONSTRAINT `Flowise_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `FlowiseSetting` ADD CONSTRAINT `FlowiseSetting_flowiseIdFallback_fkey` FOREIGN KEY (`flowiseIdFallback`) REFERENCES `Flowise`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `FlowiseSetting` ADD CONSTRAINT `FlowiseSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,159 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `GenericBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `GenericBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `GenericSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `GenericSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
*/
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `GenericBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `GenericSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` ADD COLUMN `type` VARCHAR(100) NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;

View File

@ -0,0 +1,219 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to drop the `GenericBot` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `GenericSetting` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `GenericBot` DROP FOREIGN KEY `GenericBot_instanceId_fkey`;
-- DropForeignKey
ALTER TABLE `GenericSetting` DROP FOREIGN KEY `GenericSetting_botIdFallback_fkey`;
-- DropForeignKey
ALTER TABLE `GenericSetting` DROP FOREIGN KEY `GenericSetting_instanceId_fkey`;
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- DropTable
DROP TABLE `GenericBot`;
-- DropTable
DROP TABLE `GenericSetting`;
-- CreateTable
CREATE TABLE `EvolutionBot` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT true,
`description` VARCHAR(255) NULL,
`apiUrl` VARCHAR(255) NULL,
`apiKey` VARCHAR(255) NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL,
`triggerOperator` ENUM('contains', 'equals', 'startsWith', 'endsWith', 'regex') NULL,
`triggerValue` VARCHAR(191) NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `EvolutionBotSetting` (
`id` VARCHAR(191) NOT NULL,
`expire` INTEGER NULL DEFAULT 0,
`keywordFinish` VARCHAR(100) NULL,
`delayMessage` INTEGER NULL,
`unknownMessage` VARCHAR(100) NULL,
`listeningFromMe` BOOLEAN NULL DEFAULT false,
`stopBotFromMe` BOOLEAN NULL DEFAULT false,
`keepOpen` BOOLEAN NULL DEFAULT false,
`debounceTime` INTEGER NULL,
`ignoreJids` JSON NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`botIdFallback` VARCHAR(100) NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `EvolutionBotSetting_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `EvolutionBot` ADD CONSTRAINT `EvolutionBot_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `EvolutionBotSetting` ADD CONSTRAINT `EvolutionBotSetting_botIdFallback_fkey` FOREIGN KEY (`botIdFallback`) REFERENCES `EvolutionBot`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `EvolutionBotSetting` ADD CONSTRAINT `EvolutionBotSetting_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,174 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
*/
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Message` ADD COLUMN `status` INTEGER NULL;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` ADD COLUMN `headers` JSON NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- CreateTable
CREATE TABLE `IsOnWhatsapp` (
`id` VARCHAR(191) NOT NULL,
`remoteJid` VARCHAR(100) NOT NULL,
`jidOptions` VARCHAR(191) NOT NULL,
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
UNIQUE INDEX `IsOnWhatsapp_remoteJid_key`(`remoteJid`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@ -0,0 +1,232 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
*/
-- AlterTable
ALTER TABLE `Chat` ADD COLUMN `unreadMessages` INTEGER NOT NULL DEFAULT 0,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBot` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBotSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Flowise` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `FlowiseSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `IsOnWhatsapp` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Message` MODIFY `status` VARCHAR(30) NULL;
-- AlterTable
ALTER TABLE `OpenaiBot` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` ADD COLUMN `splitMessages` BOOLEAN NULL DEFAULT false,
ADD COLUMN `timePerChar` INTEGER NULL DEFAULT 50,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- CreateTable
CREATE TABLE `Pusher` (
`id` VARCHAR(191) NOT NULL,
`enabled` BOOLEAN NOT NULL DEFAULT false,
`appId` VARCHAR(100) NOT NULL,
`key` VARCHAR(100) NOT NULL,
`secret` VARCHAR(100) NOT NULL,
`cluster` VARCHAR(100) NOT NULL,
`useTLS` BOOLEAN NOT NULL DEFAULT false,
`events` JSON NOT NULL,
`createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` TIMESTAMP NOT NULL,
`instanceId` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Pusher_instanceId_key`(`instanceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateIndex
CREATE INDEX `Chat_remoteJid_idx` ON `Chat`(`remoteJid`);
-- CreateIndex
CREATE INDEX `Contact_remoteJid_idx` ON `Contact`(`remoteJid`);
-- CreateIndex
CREATE INDEX `Setting_instanceId_idx` ON `Setting`(`instanceId`);
-- CreateIndex
CREATE INDEX `Webhook_instanceId_idx` ON `Webhook`(`instanceId`);
-- AddForeignKey
ALTER TABLE `Pusher` ADD CONSTRAINT `Pusher_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- RenameIndex
ALTER TABLE `Chat` RENAME INDEX `Chat_instanceId_fkey` TO `Chat_instanceId_idx`;
-- RenameIndex
ALTER TABLE `Contact` RENAME INDEX `Contact_instanceId_fkey` TO `Contact_instanceId_idx`;
-- RenameIndex
ALTER TABLE `Message` RENAME INDEX `Message_instanceId_fkey` TO `Message_instanceId_idx`;
-- RenameIndex
ALTER TABLE `MessageUpdate` RENAME INDEX `MessageUpdate_instanceId_fkey` TO `MessageUpdate_instanceId_idx`;
-- RenameIndex
ALTER TABLE `MessageUpdate` RENAME INDEX `MessageUpdate_messageId_fkey` TO `MessageUpdate_messageId_idx`;

View File

@ -0,0 +1,175 @@
/*
Warnings:
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
- A unique constraint covering the columns `[instanceId,remoteJid]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `IsOnWhatsapp` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Pusher` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE `Setting` ADD COLUMN `wavoipToken` VARCHAR(100) NULL,
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NULL;
-- AlterTable
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- AlterTable
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
MODIFY `updatedAt` TIMESTAMP NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `Chat_instanceId_remoteJid_key` ON `Chat`(`instanceId`, `remoteJid`);

View File

@ -0,0 +1,26 @@
/*
Warnings:
- A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
SET @column_exists := (
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'Setting'
AND column_name = 'wavoipToken'
);
SET @sql := IF(@column_exists = 0,
'ALTER TABLE Setting ADD COLUMN wavoipToken VARCHAR(100);',
'SELECT "Column already exists";'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
ALTER TABLE Chat ADD CONSTRAINT unique_remote_instance UNIQUE (remoteJid, instanceId);

View File

@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "mysql"

743
prisma/mysql-schema.prisma Normal file
View File

@ -0,0 +1,743 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_CONNECTION_URI")
}
enum InstanceConnectionStatus {
open
close
connecting
}
enum DeviceMessage {
ios
android
web
unknown
desktop
}
enum SessionStatus {
opened
closed
paused
}
enum TriggerType {
all
keyword
none
advanced
}
enum TriggerOperator {
contains
equals
startsWith
endsWith
regex
}
enum OpenaiBotType {
assistant
chatCompletion
}
enum DifyBotType {
chatBot
textGenerator
agent
workflow
}
model Instance {
id String @id @default(cuid())
name String @unique @db.VarChar(255)
connectionStatus InstanceConnectionStatus @default(open)
ownerJid String? @db.VarChar(100)
profileName String? @db.VarChar(100)
profilePicUrl String? @db.VarChar(500)
integration String? @db.VarChar(100)
number String? @db.VarChar(100)
businessId String? @db.VarChar(100)
token String? @db.VarChar(255)
clientName String? @db.VarChar(100)
disconnectionReasonCode Int? @db.Int
disconnectionObject Json? @db.Json
disconnectionAt DateTime? @db.Timestamp
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime? @updatedAt @db.Timestamp
Chat Chat[]
Contact Contact[]
Message Message[]
Webhook Webhook?
Chatwoot Chatwoot?
Label Label[]
Proxy Proxy?
Setting Setting?
Rabbitmq Rabbitmq?
Nats Nats?
Sqs Sqs?
Websocket Websocket?
Typebot Typebot[]
Session Session?
MessageUpdate MessageUpdate[]
TypebotSetting TypebotSetting?
Media Media[]
OpenaiCreds OpenaiCreds[]
OpenaiBot OpenaiBot[]
OpenaiSetting OpenaiSetting?
Template Template[]
Dify Dify[]
DifySetting DifySetting?
IntegrationSession IntegrationSession[]
EvolutionBot EvolutionBot[]
EvolutionBotSetting EvolutionBotSetting?
Flowise Flowise[]
FlowiseSetting FlowiseSetting?
Pusher Pusher?
N8n N8n[]
}
model Session {
id String @id @default(cuid())
sessionId String @unique
creds String? @db.Text
createdAt DateTime @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
Instance Instance @relation(fields: [sessionId], references: [id], onDelete: Cascade)
}
model Chat {
id String @id @default(cuid())
remoteJid String @db.VarChar(100)
name String? @db.VarChar(100)
labels Json? @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime? @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
unreadMessages Int @default(0)
@@unique([instanceId, remoteJid])
@@index([instanceId])
@@index([remoteJid])
}
model Contact {
id String @id @default(cuid())
remoteJid String @db.VarChar(100)
pushName String? @db.VarChar(100)
profilePicUrl String? @db.VarChar(500)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime? @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
@@unique([remoteJid, instanceId])
@@index([remoteJid])
@@index([instanceId])
}
model Message {
id String @id @default(cuid())
key Json @db.Json
pushName String? @db.VarChar(100)
participant String? @db.VarChar(100)
messageType String @db.VarChar(100)
message Json @db.Json
contextInfo Json? @db.Json
source DeviceMessage
messageTimestamp Int @db.Int
chatwootMessageId Int? @db.Int
chatwootInboxId Int? @db.Int
chatwootConversationId Int? @db.Int
chatwootContactInboxSourceId String? @db.VarChar(100)
chatwootIsRead Boolean? @default(false)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
typebotSessionId String?
MessageUpdate MessageUpdate[]
Media Media?
webhookUrl String? @db.VarChar(500)
status String? @db.VarChar(30)
sessionId String?
session IntegrationSession? @relation(fields: [sessionId], references: [id])
@@index([instanceId])
}
model MessageUpdate {
id String @id @default(cuid())
keyId String @db.VarChar(100)
remoteJid String @db.VarChar(100)
fromMe Boolean
participant String? @db.VarChar(100)
pollUpdates Json? @db.Json
status String @db.VarChar(30)
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
messageId String
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
@@index([instanceId])
@@index([messageId])
}
model Webhook {
id String @id @default(cuid())
url String @db.VarChar(500)
headers Json? @db.Json
enabled Boolean? @default(true)
events Json? @db.Json
webhookByEvents Boolean? @default(false)
webhookBase64 Boolean? @default(false)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
@@index([instanceId])
}
model Chatwoot {
id String @id @default(cuid())
enabled Boolean? @default(true)
accountId String? @db.VarChar(100)
token String? @db.VarChar(100)
url String? @db.VarChar(500)
nameInbox String? @db.VarChar(100)
signMsg Boolean? @default(false)
signDelimiter String? @db.VarChar(100)
number String? @db.VarChar(100)
reopenConversation Boolean? @default(false)
conversationPending Boolean? @default(false)
mergeBrazilContacts Boolean? @default(false)
importContacts Boolean? @default(false)
importMessages Boolean? @default(false)
daysLimitImportMessages Int? @db.Int
organization String? @db.VarChar(100)
logo String? @db.VarChar(500)
ignoreJids Json?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Label {
id String @id @default(cuid())
labelId String? @db.VarChar(100)
name String @db.VarChar(100)
color String @db.VarChar(100)
predefinedId String? @db.VarChar(100)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
}
model Proxy {
id String @id @default(cuid())
enabled Boolean @default(false)
host String @db.VarChar(100)
port String @db.VarChar(100)
protocol String @db.VarChar(100)
username String @db.VarChar(100)
password String @db.VarChar(100)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Setting {
id String @id @default(cuid())
rejectCall Boolean @default(false)
msgCall String? @db.VarChar(100)
groupsIgnore Boolean @default(false)
alwaysOnline Boolean @default(false)
readMessages Boolean @default(false)
readStatus Boolean @default(false)
syncFullHistory Boolean @default(false)
wavoipToken String? @db.VarChar(100)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
@@index([instanceId])
}
model Rabbitmq {
id String @id @default(cuid())
enabled Boolean @default(false)
events Json @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Nats {
id String @id @default(cuid())
enabled Boolean @default(false)
events Json @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Sqs {
id String @id @default(cuid())
enabled Boolean @default(false)
events Json @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Websocket {
id String @id @default(cuid())
enabled Boolean @default(false)
events Json @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Pusher {
id String @id @default(cuid())
enabled Boolean @default(false)
appId String @db.VarChar(100)
key String @db.VarChar(100)
secret String @db.VarChar(100)
cluster String @db.VarChar(100)
useTLS Boolean @default(false)
events Json @db.Json
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Typebot {
id String @id @default(cuid())
enabled Boolean @default(true)
description String? @db.VarChar(255)
url String @db.VarChar(500)
typebot String @db.VarChar(100)
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime? @updatedAt @db.Timestamp
ignoreJids Json?
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
TypebotSetting TypebotSetting[]
}
model TypebotSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
typebotIdFallback String? @db.VarChar(100)
ignoreJids Json?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model IntegrationSession {
id String @id @default(cuid())
sessionId String @db.VarChar(255)
remoteJid String @db.VarChar(100)
pushName String?
status SessionStatus
awaitUser Boolean @default(false)
context Json?
type String? @db.VarChar(100)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Message Message[]
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
parameters Json?
botId String?
}
model Media {
id String @id @default(cuid())
fileName String @db.VarChar(500)
type String @db.VarChar(100)
mimetype String @db.VarChar(100)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
messageId String @unique
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
}
model OpenaiCreds {
id String @id @default(cuid())
name String? @unique @db.VarChar(255)
apiKey String? @unique @db.VarChar(255)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
OpenaiAssistant OpenaiBot[]
OpenaiSetting OpenaiSetting?
}
model OpenaiBot {
id String @id @default(cuid())
enabled Boolean @default(true)
description String? @db.VarChar(255)
botType OpenaiBotType
assistantId String? @db.VarChar(255)
functionUrl String? @db.VarChar(500)
model String? @db.VarChar(100)
systemMessages Json? @db.Json
assistantMessages Json? @db.Json
userMessages Json? @db.Json
maxTokens Int? @db.Int
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
OpenaiCreds OpenaiCreds @relation(fields: [openaiCredsId], references: [id], onDelete: Cascade)
openaiCredsId String
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
OpenaiSetting OpenaiSetting[]
}
model OpenaiSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
speechToText Boolean? @default(false)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])
openaiCredsId String @unique
Fallback OpenaiBot? @relation(fields: [openaiIdFallback], references: [id])
openaiIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Template {
id String @id @default(cuid())
templateId String @unique @db.VarChar(255)
name String @unique @db.VarChar(255)
template Json @db.Json
webhookUrl String? @db.VarChar(500)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
}
model Dify {
id String @id @default(cuid())
enabled Boolean @default(true)
description String? @db.VarChar(255)
botType DifyBotType
apiUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255)
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
DifySetting DifySetting[]
}
model DifySetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback Dify? @relation(fields: [difyIdFallback], references: [id])
difyIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model EvolutionBot {
id String @id @default(cuid())
enabled Boolean @default(true)
description String? @db.VarChar(255)
apiUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255)
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
EvolutionBotSetting EvolutionBotSetting[]
}
model EvolutionBotSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback EvolutionBot? @relation(fields: [botIdFallback], references: [id])
botIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Flowise {
id String @id @default(cuid())
enabled Boolean @default(true)
description String? @db.VarChar(255)
apiUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255)
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
FlowiseSetting FlowiseSetting[]
}
model FlowiseSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Int
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Int
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false)
stopBotFromMe Boolean? @default(false)
keepOpen Boolean? @default(false)
debounceTime Int? @db.Int
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback Flowise? @relation(fields: [flowiseIdFallback], references: [id])
flowiseIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model IsOnWhatsapp {
id String @id @default(cuid())
remoteJid String @unique @db.VarChar(100)
jidOptions String
createdAt DateTime @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
}
model N8n {
id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean
description String? @db.VarChar(255)
webhookUrl String? @db.VarChar(255)
basicAuthUser String? @db.VarChar(255)
basicAuthPass String? @db.VarChar(255)
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
ignoreJids Json?
splitMessages Boolean? @default(false) @db.Boolean
timePerChar Int? @default(50) @db.Integer
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
N8nSetting N8nSetting[]
}
model N8nSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
ignoreJids Json?
splitMessages Boolean? @default(false) @db.Boolean
timePerChar Int? @default(50) @db.Integer
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback N8n? @relation(fields: [n8nIdFallback], references: [id])
n8nIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
model Evoai {
id String @id @default(cuid())
enabled Boolean @default(true) @db.Boolean
description String? @db.VarChar(255)
agentUrl String? @db.VarChar(255)
apiKey String? @db.VarChar(255)
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
ignoreJids Json?
splitMessages Boolean? @default(false) @db.Boolean
timePerChar Int? @default(50) @db.Integer
triggerType TriggerType?
triggerOperator TriggerOperator?
triggerValue String?
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
EvoaiSetting EvoaiSetting[]
}
model EvoaiSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
ignoreJids Json?
splitMessages Boolean? @default(false) @db.Boolean
timePerChar Int? @default(50) @db.Integer
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id])
evoaiIdFallback String? @db.VarChar(100)
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}

View File

@ -0,0 +1,375 @@
-- CreateEnum
CREATE TYPE "InstanceConnectionStatus" AS ENUM ('open', 'close', 'connecting');
-- CreateEnum
CREATE TYPE "DeviceMessage" AS ENUM ('ios', 'android', 'web', 'unknown', 'desktop');
-- CreateEnum
CREATE TYPE "TypebotSessionStatus" AS ENUM ('open', 'closed', 'paused');
-- CreateEnum
CREATE TYPE "TriggerType" AS ENUM ('all', 'keyword');
-- CreateEnum
CREATE TYPE "TriggerOperator" AS ENUM ('contains', 'equals', 'startsWith', 'endsWith');
-- CreateTable
CREATE TABLE "Instance" (
"id" TEXT NOT NULL,
"name" VARCHAR(255) NOT NULL,
"connectionStatus" "InstanceConnectionStatus" NOT NULL DEFAULT 'open',
"ownerJid" VARCHAR(100),
"profilePicUrl" VARCHAR(500),
"integration" VARCHAR(100),
"number" VARCHAR(100),
"token" VARCHAR(255),
"clientName" VARCHAR(100),
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP,
CONSTRAINT "Instance_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Session" (
"id" TEXT NOT NULL,
"sessionId" TEXT NOT NULL,
"creds" TEXT,
"createdAt" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Chat" (
"id" TEXT NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"labels" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Chat_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Contact" (
"id" TEXT NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"pushName" VARCHAR(100),
"profilePicUrl" VARCHAR(500),
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Contact_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Message" (
"id" TEXT NOT NULL,
"key" JSONB NOT NULL,
"pushName" VARCHAR(100),
"participant" VARCHAR(100),
"messageType" VARCHAR(100) NOT NULL,
"message" JSONB NOT NULL,
"contextInfo" JSONB,
"source" "DeviceMessage" NOT NULL,
"messageTimestamp" INTEGER NOT NULL,
"chatwootMessageId" INTEGER,
"chatwootInboxId" INTEGER,
"chatwootConversationId" INTEGER,
"chatwootContactInboxSourceId" VARCHAR(100),
"chatwootIsRead" BOOLEAN,
"instanceId" TEXT NOT NULL,
"typebotSessionId" TEXT,
CONSTRAINT "Message_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "MessageUpdate" (
"id" TEXT NOT NULL,
"keyId" VARCHAR(100) NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"fromMe" BOOLEAN NOT NULL,
"participant" VARCHAR(100),
"pollUpdates" JSONB,
"status" VARCHAR(30) NOT NULL,
"messageId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "MessageUpdate_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Webhook" (
"id" TEXT NOT NULL,
"url" VARCHAR(500) NOT NULL,
"enabled" BOOLEAN DEFAULT true,
"events" JSONB,
"webhookByEvents" BOOLEAN DEFAULT false,
"webhookBase64" BOOLEAN DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Webhook_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Chatwoot" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN DEFAULT true,
"accountId" VARCHAR(100),
"token" VARCHAR(100),
"url" VARCHAR(500),
"nameInbox" VARCHAR(100),
"signMsg" BOOLEAN DEFAULT false,
"signDelimiter" VARCHAR(100),
"number" VARCHAR(100),
"reopenConversation" BOOLEAN DEFAULT false,
"conversationPending" BOOLEAN DEFAULT false,
"mergeBrazilContacts" BOOLEAN DEFAULT false,
"importContacts" BOOLEAN DEFAULT false,
"importMessages" BOOLEAN DEFAULT false,
"daysLimitImportMessages" INTEGER,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Chatwoot_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Label" (
"id" TEXT NOT NULL,
"labelId" VARCHAR(100),
"name" VARCHAR(100) NOT NULL,
"color" VARCHAR(100) NOT NULL,
"predefinedId" VARCHAR(100),
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Label_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Proxy" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT false,
"host" VARCHAR(100) NOT NULL,
"port" VARCHAR(100) NOT NULL,
"protocol" VARCHAR(100) NOT NULL,
"username" VARCHAR(100) NOT NULL,
"password" VARCHAR(100) NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Proxy_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Setting" (
"id" TEXT NOT NULL,
"rejectCall" BOOLEAN NOT NULL DEFAULT false,
"msgCall" VARCHAR(100),
"groupsIgnore" BOOLEAN NOT NULL DEFAULT false,
"alwaysOnline" BOOLEAN NOT NULL DEFAULT false,
"readMessages" BOOLEAN NOT NULL DEFAULT false,
"readStatus" BOOLEAN NOT NULL DEFAULT false,
"syncFullHistory" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Setting_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Rabbitmq" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT false,
"events" JSONB NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Rabbitmq_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Sqs" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT false,
"events" JSONB NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Sqs_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Websocket" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT false,
"events" JSONB NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Websocket_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Typebot" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT true,
"url" VARCHAR(500) NOT NULL,
"typebot" VARCHAR(100) NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Typebot_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "TypebotSession" (
"id" TEXT NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"pushName" VARCHAR(100),
"sessionId" VARCHAR(100) NOT NULL,
"status" VARCHAR(100) NOT NULL,
"prefilledVariables" JSONB,
"awaitUser" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"typebotId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "TypebotSession_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "TypebotSetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "TypebotSetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Instance_name_key" ON "Instance"("name");
-- CreateIndex
CREATE UNIQUE INDEX "Instance_token_key" ON "Instance"("token");
-- CreateIndex
CREATE UNIQUE INDEX "Session_sessionId_key" ON "Session"("sessionId");
-- CreateIndex
CREATE UNIQUE INDEX "Webhook_instanceId_key" ON "Webhook"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Chatwoot_instanceId_key" ON "Chatwoot"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Label_labelId_key" ON "Label"("labelId");
-- CreateIndex
CREATE UNIQUE INDEX "Proxy_instanceId_key" ON "Proxy"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Setting_instanceId_key" ON "Setting"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Rabbitmq_instanceId_key" ON "Rabbitmq"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Sqs_instanceId_key" ON "Sqs"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "Websocket_instanceId_key" ON "Websocket"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "TypebotSetting_instanceId_key" ON "TypebotSetting"("instanceId");
-- AddForeignKey
ALTER TABLE "Session" ADD CONSTRAINT "Session_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Chat" ADD CONSTRAINT "Chat_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Contact" ADD CONSTRAINT "Contact_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Message" ADD CONSTRAINT "Message_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Message" ADD CONSTRAINT "Message_typebotSessionId_fkey" FOREIGN KEY ("typebotSessionId") REFERENCES "TypebotSession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "MessageUpdate" ADD CONSTRAINT "MessageUpdate_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "MessageUpdate" ADD CONSTRAINT "MessageUpdate_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Webhook" ADD CONSTRAINT "Webhook_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Chatwoot" ADD CONSTRAINT "Chatwoot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Label" ADD CONSTRAINT "Label_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Proxy" ADD CONSTRAINT "Proxy_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Setting" ADD CONSTRAINT "Setting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Rabbitmq" ADD CONSTRAINT "Rabbitmq_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Sqs" ADD CONSTRAINT "Sqs_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Websocket" ADD CONSTRAINT "Websocket_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Typebot" ADD CONSTRAINT "Typebot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "TypebotSession" ADD CONSTRAINT "TypebotSession_typebotId_fkey" FOREIGN KEY ("typebotId") REFERENCES "Typebot"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "TypebotSession" ADD CONSTRAINT "TypebotSession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "TypebotSetting" ADD CONSTRAINT "TypebotSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Instance" ADD COLUMN "profileName" VARCHAR(100);

View File

@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Chatwoot" ADD COLUMN "logo" VARCHAR(500),
ADD COLUMN "organization" VARCHAR(100);

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "Typebot" ADD COLUMN "debounceTime" INTEGER;
-- AlterTable
ALTER TABLE "TypebotSetting" ADD COLUMN "debounceTime" INTEGER;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Instance" ADD COLUMN "businessId" VARCHAR(100);

View File

@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "Template" (
"id" TEXT NOT NULL,
"name" VARCHAR(255) NOT NULL,
"language" VARCHAR(255) NOT NULL,
"templateId" VARCHAR(255) NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Template_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Template_templateId_key" ON "Template"("templateId");
-- CreateIndex
CREATE UNIQUE INDEX "Template_instanceId_key" ON "Template"("instanceId");
-- AddForeignKey
ALTER TABLE "Template" ADD CONSTRAINT "Template_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "Template_instanceId_key";

View File

@ -0,0 +1,11 @@
/*
Warnings:
- You are about to drop the `Template` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Template" DROP CONSTRAINT "Template_instanceId_fkey";
-- DropTable
DROP TABLE "Template";

View File

@ -0,0 +1,8 @@
-- AlterEnum
ALTER TYPE "TriggerOperator" ADD VALUE 'regex';
-- AlterTable
ALTER TABLE "TypebotSetting" ADD COLUMN "typebotIdFallback" VARCHAR(100);
-- AddForeignKey
ALTER TABLE "TypebotSetting" ADD CONSTRAINT "TypebotSetting_typebotIdFallback_fkey" FOREIGN KEY ("typebotIdFallback") REFERENCES "Typebot"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "Typebot" ADD COLUMN "ignoreJids" JSONB;
-- AlterTable
ALTER TABLE "TypebotSetting" ADD COLUMN "ignoreJids" JSONB;

View File

@ -0,0 +1,24 @@
-- CreateTable
CREATE TABLE "Media" (
"id" TEXT NOT NULL,
"fileName" VARCHAR(500) NOT NULL,
"type" VARCHAR(100) NOT NULL,
"mimetype" VARCHAR(100) NOT NULL,
"createdAt" DATE DEFAULT CURRENT_TIMESTAMP,
"messageId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Media_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Media_fileName_key" ON "Media"("fileName");
-- CreateIndex
CREATE UNIQUE INDEX "Media_messageId_key" ON "Media"("messageId");
-- AddForeignKey
ALTER TABLE "Media" ADD CONSTRAINT "Media_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Media" ADD CONSTRAINT "Media_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,118 @@
-- AlterTable
ALTER TABLE "Message" ADD COLUMN "openaiSessionId" TEXT;
-- CreateTable
CREATE TABLE "OpenaiCreds" (
"id" TEXT NOT NULL,
"apiKey" VARCHAR(255) NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "OpenaiCreds_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "OpenaiBot" (
"id" TEXT NOT NULL,
"botType" VARCHAR(100) NOT NULL,
"assistantId" VARCHAR(255),
"model" VARCHAR(100),
"systemMessages" JSONB,
"assistantMessages" JSONB,
"userMessages" JSONB,
"maxTokens" INTEGER,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"openaiCredsId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "OpenaiBot_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "OpenaiSession" (
"id" TEXT NOT NULL,
"sessionId" VARCHAR(255) NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"status" "TypebotSessionStatus" NOT NULL,
"awaitUser" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"openaiBotId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "OpenaiSession_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "OpenaiSetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"openaiCredsId" TEXT NOT NULL,
"openaiIdFallback" VARCHAR(100),
"instanceId" TEXT NOT NULL,
CONSTRAINT "OpenaiSetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiCreds_apiKey_key" ON "OpenaiCreds"("apiKey");
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiCreds_instanceId_key" ON "OpenaiCreds"("instanceId");
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiBot_assistantId_key" ON "OpenaiBot"("assistantId");
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiSetting_instanceId_key" ON "OpenaiSetting"("instanceId");
-- AddForeignKey
ALTER TABLE "Message" ADD CONSTRAINT "Message_openaiSessionId_fkey" FOREIGN KEY ("openaiSessionId") REFERENCES "OpenaiSession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiCreds" ADD CONSTRAINT "OpenaiCreds_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiBot" ADD CONSTRAINT "OpenaiBot_openaiCredsId_fkey" FOREIGN KEY ("openaiCredsId") REFERENCES "OpenaiCreds"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiBot" ADD CONSTRAINT "OpenaiBot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiSession" ADD CONSTRAINT "OpenaiSession_openaiBotId_fkey" FOREIGN KEY ("openaiBotId") REFERENCES "OpenaiBot"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiSession" ADD CONSTRAINT "OpenaiSession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_openaiCredsId_fkey" FOREIGN KEY ("openaiCredsId") REFERENCES "OpenaiCreds"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_openaiIdFallback_fkey" FOREIGN KEY ("openaiIdFallback") REFERENCES "OpenaiBot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OpenaiSetting" ADD CONSTRAINT "OpenaiSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "OpenaiBot" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true;

View File

@ -0,0 +1,12 @@
/*
Warnings:
- A unique constraint covering the columns `[name]` on the table `OpenaiCreds` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "OpenaiCreds" ADD COLUMN "name" VARCHAR(255),
ALTER COLUMN "apiKey" DROP NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiCreds_name_key" ON "OpenaiCreds"("name");

View File

@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "OpenaiCreds_instanceId_key";

View File

@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[openaiCredsId]` on the table `OpenaiSetting` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "OpenaiSetting_openaiCredsId_key" ON "OpenaiSetting"("openaiCredsId");

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Message" ADD COLUMN "webhookUrl" VARCHAR(500);

View File

@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "Template" (
"id" TEXT NOT NULL,
"templateId" VARCHAR(255) NOT NULL,
"name" VARCHAR(255) NOT NULL,
"template" JSONB NOT NULL,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Template_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Template_templateId_key" ON "Template"("templateId");
-- CreateIndex
CREATE UNIQUE INDEX "Template_name_key" ON "Template"("name");
-- AddForeignKey
ALTER TABLE "Template" ADD CONSTRAINT "Template_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Template" ADD COLUMN "webhookUrl" VARCHAR(500);

View File

@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX "Instance_token_key";

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "TriggerType" ADD VALUE 'none';

View File

@ -0,0 +1,20 @@
/*
Warnings:
- The values [open] on the enum `TypebotSessionStatus` will be removed. If these variants are still used in the database, this will fail.
- Changed the type of `status` on the `TypebotSession` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "TypebotSessionStatus_new" AS ENUM ('opened', 'closed', 'paused');
ALTER TABLE "TypebotSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
ALTER TABLE "OpenaiSession" ALTER COLUMN "status" TYPE "TypebotSessionStatus_new" USING ("status"::text::"TypebotSessionStatus_new");
ALTER TYPE "TypebotSessionStatus" RENAME TO "TypebotSessionStatus_old";
ALTER TYPE "TypebotSessionStatus_new" RENAME TO "TypebotSessionStatus";
DROP TYPE "TypebotSessionStatus_old";
COMMIT;
-- AlterTable
ALTER TABLE "TypebotSession" DROP COLUMN "status",
ADD COLUMN "status" "TypebotSessionStatus" NOT NULL;

View File

@ -0,0 +1,103 @@
/*
Warnings:
- Changed the type of `botType` on the `OpenaiBot` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- CreateEnum
CREATE TYPE "OpenaiBotType" AS ENUM ('assistant', 'chatCompletion');
-- CreateEnum
CREATE TYPE "DifyBotType" AS ENUM ('chatBot', 'textGenerator', 'agent', 'workflow');
-- DropIndex
DROP INDEX "OpenaiBot_assistantId_key";
-- AlterTable
ALTER TABLE "Message" ADD COLUMN "difySessionId" TEXT;
-- AlterTable
ALTER TABLE "OpenaiBot" DROP COLUMN "botType",
ADD COLUMN "botType" "OpenaiBotType" NOT NULL;
-- CreateTable
CREATE TABLE "Dify" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT true,
"botType" "DifyBotType" NOT NULL,
"apiUrl" VARCHAR(255),
"apiKey" VARCHAR(255),
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Dify_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "DifySession" (
"id" TEXT NOT NULL,
"sessionId" VARCHAR(255) NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"status" "TypebotSessionStatus" NOT NULL,
"awaitUser" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"difyId" TEXT NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "DifySession_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "DifySetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"difyIdFallback" VARCHAR(100),
"instanceId" TEXT NOT NULL,
CONSTRAINT "DifySetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "DifySetting_instanceId_key" ON "DifySetting"("instanceId");
-- AddForeignKey
ALTER TABLE "Message" ADD CONSTRAINT "Message_difySessionId_fkey" FOREIGN KEY ("difySessionId") REFERENCES "DifySession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Dify" ADD CONSTRAINT "Dify_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DifySession" ADD CONSTRAINT "DifySession_difyId_fkey" FOREIGN KEY ("difyId") REFERENCES "Dify"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DifySession" ADD CONSTRAINT "DifySession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DifySetting" ADD CONSTRAINT "DifySetting_difyIdFallback_fkey" FOREIGN KEY ("difyIdFallback") REFERENCES "Dify"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "DifySetting" ADD CONSTRAINT "DifySetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "OpenaiSetting" ADD COLUMN "speechToText" BOOLEAN DEFAULT false;

View File

@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "Dify" ADD COLUMN "description" VARCHAR(255);
-- AlterTable
ALTER TABLE "OpenaiBot" ADD COLUMN "description" VARCHAR(255);
-- AlterTable
ALTER TABLE "Typebot" ADD COLUMN "description" VARCHAR(255);

View File

@ -0,0 +1,7 @@
-- AlterTable
ALTER TABLE "Instance" ADD COLUMN "disconnectionAt" TIMESTAMP,
ADD COLUMN "disconnectionObject" JSONB,
ADD COLUMN "disconnectionReasonCode" INTEGER;
-- AlterTable
ALTER TABLE "OpenaiBot" ADD COLUMN "functionUrl" VARCHAR(500);

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Chat" ADD COLUMN "name" VARCHAR(100);

View File

@ -0,0 +1,17 @@
/*
Warnings:
- A unique constraint covering the columns `[remoteJid,instanceId]` on the table `Contact` will be added. If there are existing duplicate values, this will fail.
*/
-- Remove the duplicates
DELETE FROM "Contact"
WHERE ctid NOT IN (
SELECT min(ctid)
FROM "Contact"
GROUP BY "remoteJid", "instanceId"
);
-- CreateIndex
CREATE UNIQUE INDEX "Contact_remoteJid_instanceId_key" ON "Contact"("remoteJid", "instanceId");

View File

@ -0,0 +1,11 @@
/*
Warnings:
- A unique constraint covering the columns `[labelId,instanceId]` on the table `Label` will be added. If there are existing duplicate values, this will fail.
*/
-- DropIndex
DROP INDEX "Label_labelId_key";
-- CreateIndex
CREATE UNIQUE INDEX "Label_labelId_instanceId_key" ON "Label"("labelId", "instanceId");

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Chatwoot" ADD COLUMN "ignoreJids" JSONB;

View File

@ -0,0 +1,92 @@
/*
Warnings:
- You are about to drop the column `difySessionId` on the `Message` table. All the data in the column will be lost.
- You are about to drop the column `openaiSessionId` on the `Message` table. All the data in the column will be lost.
- You are about to drop the column `typebotSessionId` on the `Message` table. All the data in the column will be lost.
- You are about to drop the `DifySession` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `OpenaiSession` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TypebotSession` table. If the table is not empty, all the data it contains will be lost.
*/
-- CreateEnum
CREATE TYPE "SessionStatus" AS ENUM ('opened', 'closed', 'paused');
-- DropForeignKey
ALTER TABLE "DifySession" DROP CONSTRAINT "DifySession_difyId_fkey";
-- DropForeignKey
ALTER TABLE "DifySession" DROP CONSTRAINT "DifySession_instanceId_fkey";
-- DropForeignKey
ALTER TABLE "Message" DROP CONSTRAINT "Message_difySessionId_fkey";
-- DropForeignKey
ALTER TABLE "Message" DROP CONSTRAINT "Message_openaiSessionId_fkey";
-- DropForeignKey
ALTER TABLE "Message" DROP CONSTRAINT "Message_typebotSessionId_fkey";
-- DropForeignKey
ALTER TABLE "OpenaiSession" DROP CONSTRAINT "OpenaiSession_instanceId_fkey";
-- DropForeignKey
ALTER TABLE "OpenaiSession" DROP CONSTRAINT "OpenaiSession_openaiBotId_fkey";
-- DropForeignKey
ALTER TABLE "TypebotSession" DROP CONSTRAINT "TypebotSession_instanceId_fkey";
-- DropForeignKey
ALTER TABLE "TypebotSession" DROP CONSTRAINT "TypebotSession_typebotId_fkey";
-- AlterTable
ALTER TABLE "Message" DROP COLUMN "difySessionId",
DROP COLUMN "openaiSessionId",
DROP COLUMN "typebotSessionId",
ADD COLUMN "sessionId" TEXT;
-- DropTable
DROP TABLE "DifySession";
-- DropTable
DROP TABLE "OpenaiSession";
-- DropTable
DROP TABLE "TypebotSession";
-- DropEnum
DROP TYPE "TypebotSessionStatus";
-- CreateTable
CREATE TABLE "IntegrationSession" (
"id" TEXT NOT NULL,
"sessionId" VARCHAR(255) NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"pushName" TEXT,
"status" "SessionStatus" NOT NULL,
"awaitUser" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
"parameters" JSONB,
"openaiBotId" TEXT,
"difyId" TEXT,
"typebotId" TEXT,
CONSTRAINT "IntegrationSession_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Message" ADD CONSTRAINT "Message_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "IntegrationSession"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "IntegrationSession" ADD CONSTRAINT "IntegrationSession_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "IntegrationSession" ADD CONSTRAINT "IntegrationSession_openaiBotId_fkey" FOREIGN KEY ("openaiBotId") REFERENCES "OpenaiBot"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "IntegrationSession" ADD CONSTRAINT "IntegrationSession_difyId_fkey" FOREIGN KEY ("difyId") REFERENCES "Dify"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "IntegrationSession" ADD CONSTRAINT "IntegrationSession_typebotId_fkey" FOREIGN KEY ("typebotId") REFERENCES "Typebot"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "TriggerType" ADD VALUE 'advanced';

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "IntegrationSession" ADD COLUMN "context" JSONB;

View File

@ -0,0 +1,22 @@
/*
Warnings:
- You are about to drop the column `difyId` on the `IntegrationSession` table. All the data in the column will be lost.
- You are about to drop the column `openaiBotId` on the `IntegrationSession` table. All the data in the column will be lost.
- You are about to drop the column `typebotId` on the `IntegrationSession` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "IntegrationSession" DROP CONSTRAINT "IntegrationSession_difyId_fkey";
-- DropForeignKey
ALTER TABLE "IntegrationSession" DROP CONSTRAINT "IntegrationSession_openaiBotId_fkey";
-- DropForeignKey
ALTER TABLE "IntegrationSession" DROP CONSTRAINT "IntegrationSession_typebotId_fkey";
-- AlterTable
ALTER TABLE "IntegrationSession" DROP COLUMN "difyId",
DROP COLUMN "openaiBotId",
DROP COLUMN "typebotId",
ADD COLUMN "botId" TEXT;

View File

@ -0,0 +1,57 @@
-- CreateTable
CREATE TABLE "GenericBot" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT true,
"description" VARCHAR(255),
"apiUrl" VARCHAR(255),
"apiKey" VARCHAR(255),
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "GenericBot_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "GenericSetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"botIdFallback" VARCHAR(100),
"instanceId" TEXT NOT NULL,
CONSTRAINT "GenericSetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "GenericSetting_instanceId_key" ON "GenericSetting"("instanceId");
-- AddForeignKey
ALTER TABLE "GenericBot" ADD CONSTRAINT "GenericBot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "GenericSetting" ADD CONSTRAINT "GenericSetting_botIdFallback_fkey" FOREIGN KEY ("botIdFallback") REFERENCES "GenericBot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "GenericSetting" ADD CONSTRAINT "GenericSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,57 @@
-- CreateTable
CREATE TABLE "Flowise" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT true,
"description" VARCHAR(255),
"apiUrl" VARCHAR(255),
"apiKey" VARCHAR(255),
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "Flowise_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "FlowiseSetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"flowiseIdFallback" VARCHAR(100),
"instanceId" TEXT NOT NULL,
CONSTRAINT "FlowiseSetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "FlowiseSetting_instanceId_key" ON "FlowiseSetting"("instanceId");
-- AddForeignKey
ALTER TABLE "Flowise" ADD CONSTRAINT "Flowise_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "FlowiseSetting" ADD CONSTRAINT "FlowiseSetting_flowiseIdFallback_fkey" FOREIGN KEY ("flowiseIdFallback") REFERENCES "Flowise"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "FlowiseSetting" ADD CONSTRAINT "FlowiseSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "IntegrationSession" ADD COLUMN "type" VARCHAR(100);

View File

@ -0,0 +1,79 @@
/*
Warnings:
- You are about to drop the `GenericBot` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `GenericSetting` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "GenericBot" DROP CONSTRAINT "GenericBot_instanceId_fkey";
-- DropForeignKey
ALTER TABLE "GenericSetting" DROP CONSTRAINT "GenericSetting_botIdFallback_fkey";
-- DropForeignKey
ALTER TABLE "GenericSetting" DROP CONSTRAINT "GenericSetting_instanceId_fkey";
-- DropTable
DROP TABLE "GenericBot";
-- DropTable
DROP TABLE "GenericSetting";
-- CreateTable
CREATE TABLE "EvolutionBot" (
"id" TEXT NOT NULL,
"enabled" BOOLEAN NOT NULL DEFAULT true,
"description" VARCHAR(255),
"apiUrl" VARCHAR(255),
"apiKey" VARCHAR(255),
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"triggerType" "TriggerType",
"triggerOperator" "TriggerOperator",
"triggerValue" TEXT,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"instanceId" TEXT NOT NULL,
CONSTRAINT "EvolutionBot_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "EvolutionBotSetting" (
"id" TEXT NOT NULL,
"expire" INTEGER DEFAULT 0,
"keywordFinish" VARCHAR(100),
"delayMessage" INTEGER,
"unknownMessage" VARCHAR(100),
"listeningFromMe" BOOLEAN DEFAULT false,
"stopBotFromMe" BOOLEAN DEFAULT false,
"keepOpen" BOOLEAN DEFAULT false,
"debounceTime" INTEGER,
"ignoreJids" JSONB,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
"botIdFallback" VARCHAR(100),
"instanceId" TEXT NOT NULL,
CONSTRAINT "EvolutionBotSetting_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "EvolutionBotSetting_instanceId_key" ON "EvolutionBotSetting"("instanceId");
-- AddForeignKey
ALTER TABLE "EvolutionBot" ADD CONSTRAINT "EvolutionBot_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EvolutionBotSetting" ADD CONSTRAINT "EvolutionBotSetting_botIdFallback_fkey" FOREIGN KEY ("botIdFallback") REFERENCES "EvolutionBot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EvolutionBotSetting" ADD CONSTRAINT "EvolutionBotSetting_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,14 @@
-- CreateTable
CREATE TABLE "is_on_whatsapp" (
"id" TEXT NOT NULL,
"remote_jid" VARCHAR(100) NOT NULL,
"name" TEXT,
"jid_options" TEXT NOT NULL,
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP NOT NULL,
CONSTRAINT "is_on_whatsapp_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "is_on_whatsapp_remote_jid_key" ON "is_on_whatsapp"("remote_jid");

View File

@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `name` on the `is_on_whatsapp` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "is_on_whatsapp" DROP COLUMN "name";

View File

@ -0,0 +1,22 @@
/*
Warnings:
- You are about to drop the `is_on_whatsapp` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "is_on_whatsapp";
-- CreateTable
CREATE TABLE "IsOnWhatsapp" (
"id" TEXT NOT NULL,
"remoteJid" VARCHAR(100) NOT NULL,
"jidOptions" TEXT NOT NULL,
"createdAt" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP NOT NULL,
CONSTRAINT "IsOnWhatsapp_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "IsOnWhatsapp_remoteJid_key" ON "IsOnWhatsapp"("remoteJid");

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Webhook" ADD COLUMN "headers" JSONB;

Some files were not shown because too many files have changed in this diff Show More