Commit Graph

46 Commits

Author SHA1 Message Date
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 Cairo
a57842519b Change tables & columns maps 2024-08-29 15:45:42 -03:00
Judson Cairo
8b5ca0c9c4 Add DIRECT_URI on env and prisma 2024-08-29 15:10:04 -03:00
Judson Cairo
ce6438b9a8 Save is on whatsapp on the database 2024-08-28 11:19:47 -03:00
Davidson Gomes
d776770d09 refactor: evolution bot 2024-08-25 10:22:22 -03:00
Davidson Gomes
aeea61ef4b fix: get integrations sessions by type 2024-08-24 13:18:58 -03:00
Davidson Gomes
0e6a78d011 feat: flowise integration 2024-08-21 17:21:23 -03:00
Davidson Gomes
35bde8498b feat: generic chatbot 2024-08-21 14:42:26 -03:00
Davidson Gomes
8876797172 refactor: openai integration 2024-08-21 09:29:49 -03:00
Davidson Gomes
046c64c65d feat: translation in manager: English, Portuguese, Spanish and French 2024-08-20 07:29:14 -03:00
Judson Cairo
fcd038924d Advanced operators trigger fro OpenAI/Dify/Typebot 2024-08-17 08:32:05 -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
Davidson Gomes
b3991cf6bb feat: Added ignoreJids in chatwoot settings 2024-08-14 14:59:47 -03:00
Judson Cairo
48febec36a Changed labels to be unique on the same instance 2024-08-12 21:35:31 -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
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
926197b1ba Save chat names for groups identification 2024-08-10 23:15:20 -03:00
Davidson Gomes
26a974a239 feat: function for openai assistant added 2024-08-08 18:47:52 -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
Davidson Gomes
2aa0e08ae4 fix: Added description column on typebot, dify and openai 2024-08-03 13:51:24 -03:00
Davidson Gomes
385307edc6 chore(readme): update on readme 2024-08-03 10:00:26 -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
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
2a7f9698d2 fix: adjusts for new manager 2024-07-29 15:09:40 -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
0bb2b92853 feat: Sending template approval status webhook 2024-07-25 19:38:34 -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
c1d3209f2f chore: equations and adjustments for the new manager 2024-07-23 12:34:58 -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
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
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
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
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
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
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
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
da687041af prisma orm: mysql 2024-06-07 13:30:29 -03:00