fix: adjusts 2.0.9

This commit is contained in:
Davidson Gomes 2024-08-12 13:24:19 -03:00
parent 6800b63945
commit dbb6ea9147
4 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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",

View File

@ -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) {

View File

@ -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 {