diff --git a/CHANGELOG.md b/CHANGELOG.md index ef049988..ff9c7b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 2.0.9 (pre release) + +### Fixed + +* Path mapping & deps fix & bundler changed to tsup +* Improve database scripts to retrieve the provider from env file +* Update contacts database with unique index +* Save chat name +* Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys + # 2.0.9-rc (release candidate) ### Features diff --git a/package.json b/package.json index 71391058..70bbe036 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "dev:server": "clear && tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts", "test": "clear && tsnd -r tsconfig-paths/register --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts", "lint": "eslint --fix --ext .ts src", - "db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:deploy": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:studio": "node runWithProvider.js \"npx prisma studio --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", @@ -106,6 +105,7 @@ "@types/express": "^4.17.17", "@types/js-yaml": "^4.0.5", "@types/json-schema": "^7.0.15", + "@types/mime": "^4.0.0", "@types/node": "^18.15.11", "@types/node-windows": "^0.1.2", "@types/qrcode": "^1.5.0", diff --git a/src/api/integrations/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatwoot/services/chatwoot.service.ts index 07bd1bcd..ca39032a 100644 --- a/src/api/integrations/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatwoot/services/chatwoot.service.ts @@ -1827,7 +1827,8 @@ export class ChatwootService { let nameFile: string; const messageBody = body?.message[body?.messageType]; - const originalFilename = messageBody?.fileName || messageBody?.message?.documentMessage?.fileName; + const originalFilename = + messageBody?.fileName || messageBody?.filename || messageBody?.message?.documentMessage?.fileName; if (originalFilename) { const parsedFile = path.parse(originalFilename); if (parsedFile.name && parsedFile.ext) { diff --git a/src/api/services/channels/whatsapp.business.service.ts b/src/api/services/channels/whatsapp.business.service.ts index 6e0c4e60..4022d49e 100644 --- a/src/api/services/channels/whatsapp.business.service.ts +++ b/src/api/services/channels/whatsapp.business.service.ts @@ -1345,7 +1345,7 @@ export class BusinessStartupService extends ChannelStartupService { public async getBase64FromMediaMessage(data: any) { try { const msg = data.message; - const messageType = msg.messageType + 'Message'; + const messageType = msg.messageType.includes('Message') ? msg.messageType : msg.messageType + 'Message'; const mediaMessage = msg.message[messageType]; return {