mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-25 01:48:39 -06:00
Merge branch 'ev2' into v2.0.0
This commit is contained in:
commit
2772c2f31f
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,5 +1,9 @@
|
|||||||
# 2.0.9 (pre release)
|
# 2.0.9 (pre release)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Added ignoreJids in chatwoot settings
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Path mapping & deps fix & bundler changed to tsup
|
* Path mapping & deps fix & bundler changed to tsup
|
||||||
@ -7,8 +11,12 @@
|
|||||||
* Update contacts database with unique index
|
* Update contacts database with unique index
|
||||||
* Save chat name
|
* Save chat name
|
||||||
* Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys
|
* Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys
|
||||||
|
* Update Baileys version 6.7.6
|
||||||
|
* Deprecate buttons and list in new Baileys version
|
||||||
|
* Changed labels to be unique on the same instance
|
||||||
|
* Remove instance from redis even if using database
|
||||||
|
|
||||||
# 2.0.9-rc (release candidate)
|
# 2.0.9-rc (2024-08-09 18:00)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
@ -113,4 +113,6 @@ We are proud to collaborate with the following content creators who have contrib
|
|||||||
- [Comunidade Hub Connect](https://youtube.com/@comunidadehubconnect)
|
- [Comunidade Hub Connect](https://youtube.com/@comunidadehubconnect)
|
||||||
- [dSantana Automações](https://www.youtube.com/channel/UCG7DjUmAxtYyURlOGAIryNQ?view_as=subscriber)
|
- [dSantana Automações](https://www.youtube.com/channel/UCG7DjUmAxtYyURlOGAIryNQ?view_as=subscriber)
|
||||||
- [Edison Martins](https://www.youtube.com/@edisonmartinsmkt)
|
- [Edison Martins](https://www.youtube.com/@edisonmartinsmkt)
|
||||||
- [Astra Online](https://www.youtube.com/@astraonlineweb)
|
- [Astra Online](https://www.youtube.com/@astraonlineweb)
|
||||||
|
- [MKT Seven Automações](https://www.youtube.com/@sevenautomacoes)
|
||||||
|
- [Vamos automatizar](https://www.youtube.com/vamosautomatizar)
|
356
manager/dist/assets/index-BXAjm9gh.js
vendored
Normal file
356
manager/dist/assets/index-BXAjm9gh.js
vendored
Normal file
File diff suppressed because one or more lines are too long
356
manager/dist/assets/index-oK8_wIXQ.js
vendored
356
manager/dist/assets/index-oK8_wIXQ.js
vendored
File diff suppressed because one or more lines are too long
2
manager/dist/index.html
vendored
2
manager/dist/index.html
vendored
@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Evolution Manager</title>
|
<title>Evolution Manager</title>
|
||||||
<script type="module" crossorigin src="/assets/index-oK8_wIXQ.js"></script>
|
<script type="module" crossorigin src="/assets/index-BXAjm9gh.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DZ0gaAHg.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-DZ0gaAHg.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
"@sentry/node": "^7.59.2",
|
"@sentry/node": "^7.59.2",
|
||||||
"amqplib": "^0.10.3",
|
"amqplib": "^0.10.3",
|
||||||
"axios": "^1.6.5",
|
"axios": "^1.6.5",
|
||||||
"baileys": "github:WhiskeySockets/Baileys",
|
"baileys": "6.7.6",
|
||||||
"class-validator": "^0.14.1",
|
"class-validator": "^0.14.1",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
@ -121,6 +121,6 @@
|
|||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"tsconfig-paths": "^4.2.0",
|
"tsconfig-paths": "^4.2.0",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^5.5.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,150 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `DifySession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `OpenaiSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `TypebotSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
- You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropIndex
|
||||||
|
DROP INDEX `Label_labelId_key` ON `Label`;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Chatwoot` ADD COLUMN `ignoreJids` JSON NULL,
|
||||||
|
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `DifySession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL,
|
||||||
|
MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `OpenaiSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Typebot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `TypebotSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `TypebotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
MODIFY `updatedAt` TIMESTAMP NOT NULL;
|
@ -208,6 +208,7 @@ model Chatwoot {
|
|||||||
daysLimitImportMessages Int? @db.Int
|
daysLimitImportMessages Int? @db.Int
|
||||||
organization String? @db.VarChar(100)
|
organization String? @db.VarChar(100)
|
||||||
logo String? @db.VarChar(500)
|
logo String? @db.VarChar(500)
|
||||||
|
ignoreJids Json?
|
||||||
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
|
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
@ -216,7 +217,7 @@ model Chatwoot {
|
|||||||
|
|
||||||
model Label {
|
model Label {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
labelId String? @unique @db.VarChar(100)
|
labelId String? @db.VarChar(100)
|
||||||
name String @db.VarChar(100)
|
name String @db.VarChar(100)
|
||||||
color String @db.VarChar(100)
|
color String @db.VarChar(100)
|
||||||
predefinedId String? @db.VarChar(100)
|
predefinedId String? @db.VarChar(100)
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Chatwoot" ADD COLUMN "ignoreJids" JSONB;
|
@ -208,6 +208,7 @@ model Chatwoot {
|
|||||||
daysLimitImportMessages Int? @db.Integer
|
daysLimitImportMessages Int? @db.Integer
|
||||||
organization String? @db.VarChar(100)
|
organization String? @db.VarChar(100)
|
||||||
logo String? @db.VarChar(500)
|
logo String? @db.VarChar(500)
|
||||||
|
ignoreJids Json?
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys';
|
import {
|
||||||
|
proto,
|
||||||
|
WAPresence,
|
||||||
|
WAPrivacyGroupAddValue,
|
||||||
|
WAPrivacyOnlineValue,
|
||||||
|
WAPrivacyValue,
|
||||||
|
WAReadReceiptsValue,
|
||||||
|
} from 'baileys';
|
||||||
|
|
||||||
export class OnWhatsAppDto {
|
export class OnWhatsAppDto {
|
||||||
constructor(
|
constructor(
|
||||||
@ -84,7 +91,7 @@ export class PrivacySettingDto {
|
|||||||
status: WAPrivacyValue;
|
status: WAPrivacyValue;
|
||||||
online: WAPrivacyOnlineValue;
|
online: WAPrivacyOnlineValue;
|
||||||
last: WAPrivacyValue;
|
last: WAPrivacyValue;
|
||||||
groupadd: WAPrivacyValue;
|
groupadd: WAPrivacyGroupAddValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DeleteMessage {
|
export class DeleteMessage {
|
||||||
|
@ -16,4 +16,5 @@ export class ChatwootDto {
|
|||||||
autoCreate?: boolean;
|
autoCreate?: boolean;
|
||||||
organization?: string;
|
organization?: string;
|
||||||
logo?: string;
|
logo?: string;
|
||||||
|
ignoreJids?: string[];
|
||||||
}
|
}
|
||||||
|
@ -1738,6 +1738,36 @@ export class ChatwootService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.provider?.ignoreJids && this.provider?.ignoreJids.length > 0) {
|
||||||
|
const ignoreJids: any = this.provider?.ignoreJids;
|
||||||
|
|
||||||
|
let ignoreGroups = false;
|
||||||
|
let ignoreContacts = false;
|
||||||
|
|
||||||
|
if (ignoreJids.includes('@g.us')) {
|
||||||
|
ignoreGroups = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignoreJids.includes('@s.whatsapp.net')) {
|
||||||
|
ignoreContacts = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignoreGroups && body?.key?.remoteJid.endsWith('@g.us')) {
|
||||||
|
this.logger.warn('Ignoring message from group: ' + body?.key?.remoteJid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignoreContacts && body?.key?.remoteJid.endsWith('@s.whatsapp.net')) {
|
||||||
|
this.logger.warn('Ignoring message from contact: ' + body?.key?.remoteJid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignoreJids.includes(body?.key?.remoteJid)) {
|
||||||
|
this.logger.warn('Ignoring message from jid: ' + body?.key?.remoteJid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (event === 'contact.is_not_in_wpp') {
|
if (event === 'contact.is_not_in_wpp') {
|
||||||
const getConversation = await this.createConversation(instance, body);
|
const getConversation = await this.createConversation(instance, body);
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ export const chatwootSchema: JSONSchema7 = {
|
|||||||
mergeBrazilContacts: { type: 'boolean', enum: [true, false] },
|
mergeBrazilContacts: { type: 'boolean', enum: [true, false] },
|
||||||
importMessages: { type: 'boolean', enum: [true, false] },
|
importMessages: { type: 'boolean', enum: [true, false] },
|
||||||
daysLimitImportMessages: { type: 'number' },
|
daysLimitImportMessages: { type: 'number' },
|
||||||
|
ignoreJids: { type: 'array', items: { type: 'string' } },
|
||||||
},
|
},
|
||||||
required: ['enabled', 'accountId', 'token', 'url', 'signMsg', 'reopenConversation', 'conversationPending'],
|
required: ['enabled', 'accountId', 'token', 'url', 'signMsg', 'reopenConversation', 'conversationPending'],
|
||||||
...isNotEmpty('enabled', 'accountId', 'token', 'url', 'signMsg', 'reopenConversation', 'conversationPending'),
|
...isNotEmpty('enabled', 'accountId', 'token', 'url', 'signMsg', 'reopenConversation', 'conversationPending'),
|
||||||
|
@ -345,6 +345,7 @@ export class ChannelStartupService {
|
|||||||
daysLimitImportMessages: data.daysLimitImportMessages,
|
daysLimitImportMessages: data.daysLimitImportMessages,
|
||||||
organization: data.organization,
|
organization: data.organization,
|
||||||
logo: data.logo,
|
logo: data.logo,
|
||||||
|
ignoreJids: data.ignoreJids,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -369,6 +370,9 @@ export class ChannelStartupService {
|
|||||||
importContacts: data.importContacts,
|
importContacts: data.importContacts,
|
||||||
importMessages: data.importMessages,
|
importMessages: data.importMessages,
|
||||||
daysLimitImportMessages: data.daysLimitImportMessages,
|
daysLimitImportMessages: data.daysLimitImportMessages,
|
||||||
|
organization: data.organization,
|
||||||
|
logo: data.logo,
|
||||||
|
ignoreJids: data.ignoreJids,
|
||||||
instanceId: this.instanceId,
|
instanceId: this.instanceId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -378,7 +382,7 @@ export class ChannelStartupService {
|
|||||||
this.clearCacheChatwoot();
|
this.clearCacheChatwoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async findChatwoot() {
|
public async findChatwoot(): Promise<ChatwootDto> {
|
||||||
if (!this.configService.get<Chatwoot>('CHATWOOT').ENABLED) {
|
if (!this.configService.get<Chatwoot>('CHATWOOT').ENABLED) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -393,6 +397,8 @@ export class ChannelStartupService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ignoreJidsArray = Array.isArray(data.ignoreJids) ? data.ignoreJids.map((event) => String(event)) : [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
enabled: data.enabled,
|
enabled: data.enabled,
|
||||||
accountId: data.accountId,
|
accountId: data.accountId,
|
||||||
@ -407,6 +413,9 @@ export class ChannelStartupService {
|
|||||||
importContacts: data.importContacts,
|
importContacts: data.importContacts,
|
||||||
importMessages: data.importMessages,
|
importMessages: data.importMessages,
|
||||||
daysLimitImportMessages: data.daysLimitImportMessages,
|
daysLimitImportMessages: data.daysLimitImportMessages,
|
||||||
|
organization: data.organization,
|
||||||
|
logo: data.logo,
|
||||||
|
ignoreJids: ignoreJidsArray,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ import {
|
|||||||
Options,
|
Options,
|
||||||
SendAudioDto,
|
SendAudioDto,
|
||||||
SendContactDto,
|
SendContactDto,
|
||||||
SendListDto,
|
|
||||||
SendLocationDto,
|
SendLocationDto,
|
||||||
SendMediaDto,
|
SendMediaDto,
|
||||||
SendPollDto,
|
SendPollDto,
|
||||||
@ -1560,7 +1559,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
|
|
||||||
if (events['messaging-history.set']) {
|
if (events['messaging-history.set']) {
|
||||||
const payload = events['messaging-history.set'];
|
const payload = events['messaging-history.set'];
|
||||||
this.messageHandle['messaging-history.set'](payload);
|
this.messageHandle['messaging-history.set'](payload as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (events['messages.upsert']) {
|
if (events['messages.upsert']) {
|
||||||
@ -2617,27 +2616,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async listMessage(data: SendListDto) {
|
public async listMessage() {
|
||||||
return await this.sendMessageWithTyping(
|
throw new BadRequestException('Method not available on WhatsApp Baileys');
|
||||||
data.number,
|
|
||||||
{
|
|
||||||
listMessage: {
|
|
||||||
title: data.title,
|
|
||||||
description: data?.description,
|
|
||||||
buttonText: data?.buttonText,
|
|
||||||
footerText: data?.footerText,
|
|
||||||
sections: data.sections,
|
|
||||||
listType: 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
delay: data?.delay,
|
|
||||||
presence: 'composing',
|
|
||||||
quoted: data?.quoted,
|
|
||||||
mentionsEveryOne: data?.mentionsEveryOne,
|
|
||||||
mentioned: data?.mentioned,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async contactMessage(data: SendContactDto) {
|
public async contactMessage(data: SendContactDto) {
|
||||||
@ -3443,38 +3423,36 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async fetchAllGroups(getParticipants: GetParticipant) {
|
public async fetchAllGroups(getParticipants: GetParticipant) {
|
||||||
try {
|
const fetch = Object.values(await this?.client?.groupFetchAllParticipating());
|
||||||
const fetch = Object.values(await this?.client?.groupFetchAllParticipating());
|
|
||||||
let groups = [];
|
|
||||||
for (const group of fetch) {
|
|
||||||
const picture = await this.profilePicture(group.id);
|
|
||||||
|
|
||||||
const result = {
|
let groups = [];
|
||||||
id: group.id,
|
for (const group of fetch) {
|
||||||
subject: group.subject,
|
const picture = null;
|
||||||
subjectOwner: group.subjectOwner,
|
// const picture = await this.profilePicture(group.id);
|
||||||
subjectTime: group.subjectTime,
|
|
||||||
pictureUrl: picture.profilePictureUrl,
|
|
||||||
size: group.participants.length,
|
|
||||||
creation: group.creation,
|
|
||||||
owner: group.owner,
|
|
||||||
desc: group.desc,
|
|
||||||
descId: group.descId,
|
|
||||||
restrict: group.restrict,
|
|
||||||
announce: group.announce,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (getParticipants.getParticipants == 'true') {
|
const result = {
|
||||||
result['participants'] = group.participants;
|
id: group.id,
|
||||||
}
|
subject: group.subject,
|
||||||
|
subjectOwner: group.subjectOwner,
|
||||||
|
subjectTime: group.subjectTime,
|
||||||
|
pictureUrl: picture?.profilePictureUrl,
|
||||||
|
size: group.participants.length,
|
||||||
|
creation: group.creation,
|
||||||
|
owner: group.owner,
|
||||||
|
desc: group.desc,
|
||||||
|
descId: group.descId,
|
||||||
|
restrict: group.restrict,
|
||||||
|
announce: group.announce,
|
||||||
|
};
|
||||||
|
|
||||||
groups = [...groups, result];
|
if (getParticipants.getParticipants == 'true') {
|
||||||
|
result['participants'] = group.participants;
|
||||||
}
|
}
|
||||||
|
|
||||||
return groups;
|
groups = [...groups, result];
|
||||||
} catch (error) {
|
|
||||||
throw new NotFoundException('Error fetching group', error.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async inviteCode(id: GroupJid) {
|
public async inviteCode(id: GroupJid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user