Commit Graph

59 Commits

Author SHA1 Message Date
Thiago Borges
490ba48501 teste 2025-07-09 11:28:29 -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
Jefferson Felix
3f8d89e970 fix: remove wildcard 2025-04-02 12:04:07 -03:00
Jefferson Felix
2a020928e8 fix: change execSync to execFileSync 2025-04-02 11:55:23 -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
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
Jesus
0f2498bbaa Fix prettier errors 2025-01-07 08:50:34 +01:00
Jesus
72a33ae59f fix: lint and prettify 2025-01-07 08:25:37 +01:00
Davidson Gomes
23640a71b8 fix: fetch instances 2024-10-29 07:43:48 -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
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
João Victor Souza
918cf295ad fix: clean instance without chatwoot 2024-09-11 11:03:38 -03:00
Davidson Gomes
80ae86b298 fix: chatwoot screen 2024-09-09 10:12:10 -03:00
Davidson Gomes
beafc62403 refactor: integration folders 2024-08-23 13:20:18 -03:00
Davidson Gomes
0e9cd21981 feat: evolution channel in instance create 2024-08-22 19:49:51 -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
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
b921a4d324 feat: IA send images and Sentry implemented 2024-08-16 11:31:46 -03:00
Judson Cairo
1059c92583 Unification of integrations, Typebot & OpenAI & Dify 2024-08-14 17:47:31 -03:00
Judson Cairo
f0a6fb111e Removed console.log 2024-08-13 10:23:39 -03:00
Judson Cairo
041b3c5e1f Remove instance from redis even if using database 2024-08-12 21:03:51 -03:00
Judson Cairo
32e58debc6 Path mapping & deps fix & bundler changed to tsup 2024-08-11 20:47:17 -03:00
Davidson Gomes
671b677569 fix: fetchInstances with clientName parameter 2024-08-02 19:22:44 -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
c1d3209f2f chore: equations and adjustments for the new manager 2024-07-23 12:34:58 -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
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
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
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
9f1c2e4e5f MySQL implementation via prism orm 2024-06-09 08:51:51 -03:00
Davidson Gomes
fe9803b828 feat: Now you can register several typebots with triggers 2024-06-08 19:04:57 -03:00
Davidson Gomes
be65b93d59 fix: Correction of variables breaking lines in typebot 2024-06-08 13:41:44 -03:00
Davidson Gomes
eed32a3bd9 chore: optimization in instance registration 2024-06-07 08:28:22 -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
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
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
8034e7f587 cacheGroupMetadata 2024-06-05 21:25:55 -03:00