Adds support for Dify integration, including new routes, services, and controllers. The configuration for Dify has been added to the environment file, and the necessary changes have been made to the `.env.example` file. Additionally, the WhatsApp Baileys service has been updated to handle Dify notifications.
Modified files:
- `.env.example`
- `package.json`
- `src/api/integrations/openai/services/openai.service.ts`
- `src/api/routes/index.router.ts`
- `src/api/server.module.ts`
- `src/api/services/channel.service.ts`
- `src/api/services/channels/whatsapp.baileys.service.ts`
- `src/config/env.config.ts`
- `src/validate/validate.schema.ts`
Introduced files:
- `src/api/integrations/dify/`
- `src/api/integrations/dify/controllers/dify.controller.ts`
- `src/api/integrations/dify/dto/dify.dto.ts`
- `src/api/integrations/dify/routes/dify.router.ts`
- `src/api/integrations/dify/services/dify.service.ts`
- `src/api/integrations/dify/validate/dify.schema.ts`
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.
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.
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.