Commit Graph

65 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
Davidson Gomes
23640a71b8 fix: fetch instances 2024-10-29 07:43:48 -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
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
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
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
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
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
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
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
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
2776f113cb feat: Added debounce time for typebot messages 2024-06-11 17:56:20 -03:00
Davidson Gomes
31258a9b85 feat: Organization configuration and logo in chatwoot bot contact 2024-06-11 10:09:04 -03:00
Davidson Gomes
28e5b2f65e fix: instances 2024-06-10 11:52:19 -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
72de0a6e4d Chatwoot review and improvements 2024-06-09 08:44:06 -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
bdd1b8fa21 log: removed excessive verbose logs 2024-06-06 18:04:45 -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
36ec67cef9 feat: prisma and remove mongodb 2024-06-06 14:47:58 -03:00