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.
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/
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.
- Add new section "Features" with webhook url by submitted template
- Equations and adjustments for the new manager under "Fixed" section
- CHANGELOG.md modified
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/
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.
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.
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.
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
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.
- 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
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%
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.
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.
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.
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.
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.
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.
- 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
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
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.
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.
- 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.
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'.
- 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.
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.
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
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'.
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.
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.
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
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.
- 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.
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.
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`
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.
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
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.
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.
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
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.
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.
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.