diff --git a/package.json b/package.json index a6eb2470..d3d957cf 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "form-data": "^4.0.1", "https-proxy-agent": "^7.0.6", "i18next": "^23.7.19", - "jimp": "^0.16.13", + "jimp": "^1.6.0", "json-schema": "^0.4.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^9.0.2", @@ -95,7 +95,7 @@ "qrcode": "^1.5.4", "qrcode-terminal": "^0.12.0", "redis": "^4.7.0", - "sharp": "^0.32.6", + "sharp": "^0.34.2", "socket.io": "^4.8.1", "socket.io-client": "^4.8.1", "tsup": "^8.3.5" diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index 19018473..576211b6 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -26,7 +26,7 @@ import axios from 'axios'; import { proto } from 'baileys'; import dayjs from 'dayjs'; import FormData from 'form-data'; -import Jimp from 'jimp'; +import { Jimp, JimpMime } from 'jimp'; import Long from 'long'; import mimeTypes from 'mime-types'; import path from 'path'; @@ -2101,9 +2101,9 @@ export class ChatwootService { const fileData = Buffer.from(imgBuffer.data, 'binary'); const img = await Jimp.read(fileData); - await img.cover(320, 180); + img.cover({ w: 320, h: 180 }); - const processedBuffer = await img.getBufferAsync(Jimp.MIME_PNG); + const processedBuffer = await img.getBuffer(JimpMime.png); const fileStream = new Readable(); fileStream._read = () => {}; // _read is required but you can noop it diff --git a/tsconfig.json b/tsconfig.json index af814134..377a5d4a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ "outDir": "./dist", "noEmitOnError": true, "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "strict": false, "skipLibCheck": true, @@ -34,4 +35,4 @@ "src/**/*", "src/**/*.json" ] -} \ No newline at end of file +}