Commit Graph

84 Commits

Author SHA1 Message Date
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
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
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
Jesus
0f2498bbaa Fix prettier errors 2025-01-07 08:50:34 +01:00
Davidson Gomes
23640a71b8 fix: fetch instances 2024-10-29 07:43:48 -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
yousseefs
11d31123ac fix: received messages but chat doesnt exists 2024-10-28 20:23:20 +00: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
da77af5bd1 feat: send list and buttons 2024-10-18 15:34:22 -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
Felipe Medeiros
23abcbecd3 refactor: remove a função "offerCall" do controller sendMessage 2024-10-07 11:05:17 -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
Felipe Medeiros
070840d364
Merge branch 'EvolutionAPI:v2.0.0' into v2.0.0 2024-10-07 01:33:13 -03:00
Felipe Medeiros
b80b203670 feat: adiciona a funcionalidade de fake call 2024-10-07 01:13:02 -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
ec2d7e349f feat: send media with form-data 2024-10-04 14:45:16 -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
Felipe Medeiros
65c6ecff88 feat: adiciona headers no cadastro de webhook da instância 2024-09-06 20:46:10 -03:00
Davidson Gomes
ff78954383
Revert "V2 fix chatwoot reply quote" 2024-09-05 09:26:33 -03:00
Judson Cairo
1161a8a0e2 Await chatwoot creation and change log to error 2024-09-01 16:46:09 -03:00
Robson Martins
265cba9e3e
v2.0.0-robsoncombr-fix-missing-autoCreate 2024-08-31 23:32:15 -03:00
Davidson Gomes
e809f38865 fix: fixed send messages in groups 2024-08-23 15:36:59 -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
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
0e9cd21981 feat: evolution channel in instance create 2024-08-22 19:49:51 -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
583ce33868 refactor: channel controller 2024-08-20 18:47:24 -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
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
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
b921a4d324 feat: IA send images and Sentry implemented 2024-08-16 11:31:46 -03:00
Judson Cairo
32e58debc6 Path mapping & deps fix & bundler changed to tsup 2024-08-11 20:47:17 -03:00
Davidson Gomes
c6db03ffa2 fix: Adjusts in restart instance 2024-08-03 12:54:23 -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
0bb2b92853 feat: Sending template approval status webhook 2024-07-25 19:38:34 -03:00
Davidson Gomes
c1d3209f2f chore: equations and adjustments for the new manager 2024-07-23 12:34:58 -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
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
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
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