@baileys-md/baileys 12.2.1 → 12.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,8 +72,8 @@ export const DEFAULT_CONNECTION_CONFIG = {
72
72
  "linkPreviewImageThumbnailWidth": 192,
73
73
  "transactionOpts": { "maxCommitRetries": 10, "delayBetweenTriesMs": 3000 },
74
74
  "generateHighQualityLinkPreview": true,
75
- "enableAutoSessionRecreation": true,
76
- "enableRecentMessageCache": true,
75
+ "enableAutoSessionRecreation": false,
76
+ "enableRecentMessageCache": false,
77
77
  "options": {},
78
78
  "appStateMacVerification": {
79
79
  "patch": false,
@@ -121,8 +121,8 @@ export const MEDIA_HKDF_KEY_MAPPING = {
121
121
  };
122
122
 
123
123
  export const MEDIA_KEYS = Object.keys(MEDIA_PATH_MAP);
124
- export const MIN_PREKEY_COUNT = 5;
125
- export const INITIAL_PREKEY_COUNT = 812;
124
+ export const MIN_PREKEY_COUNT = 2;
125
+ export const INITIAL_PREKEY_COUNT = 2;
126
126
  export const UPLOAD_TIMEOUT = 30000;
127
127
  export const MIN_UPLOAD_INTERVAL = 5000;
128
128
  export const DEFAULT_CACHE_TTLS = {
@@ -91,14 +91,26 @@ const extractVideoThumb = async (path, destPath, time, size) => new Promise((res
91
91
  });
92
92
  //=======================================================//
93
93
  export const extractImageThumb = async (bufferOrFilePath, width = 32) => {
94
- if (bufferOrFilePath instanceof Readable) {
95
- bufferOrFilePath = await toBuffer(bufferOrFilePath);
96
- }
97
- const image = await Jimp.read(bufferOrFilePath);
98
- const dimensions = { width: image.bitmap.width, height: image.bitmap.height };
99
- const resized = image.resize(width, Jimp.RESIZE_BILINEAR).quality(50);
100
- const buffer = await resized.getBufferAsync(Jimp.MIME_JPEG);
101
- return { buffer, original: dimensions };
94
+ if (bufferOrFilePath instanceof Readable) bufferOrFilePath = await toBuffer(bufferOrFilePath);
95
+ const {
96
+ read,
97
+ MIME_JPEG,
98
+ RESIZE_BILINEAR,
99
+ AUTO
100
+ } = Jimp;
101
+ const jimp = await read(bufferOrFilePath);
102
+ const dimensions = {
103
+ width: jimp.getWidth(),
104
+ height: jimp.getHeight()
105
+ };
106
+ const buffer = await jimp
107
+ .quality(50)
108
+ .resize(width, AUTO, RESIZE_BILINEAR)
109
+ .getBufferAsync(MIME_JPEG);
110
+ return {
111
+ buffer,
112
+ original: dimensions
113
+ };
102
114
  };
103
115
  //=======================================================//
104
116
  export const encodeBase64EncodedStringForUpload = (b64) => encodeURIComponent(b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=+$/, ""));
@@ -115,7 +115,7 @@ export const useMultiFileAuthState = async (folder) => {
115
115
  }
116
116
  },
117
117
  saveCreds: async () => {
118
- return writeData(creds, "creds.json");
118
+ return await writeData(creds, "creds.json");
119
119
  }
120
120
  };
121
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baileys-md/baileys",
3
- "version": "12.2.1",
3
+ "version": "12.3.1",
4
4
  "type": "module",
5
5
  "description": "Forked from Baileys core adaptado para @sixcore/baileys",
6
6
  "keywords": ["whatsapp","js-whatsapp","whatsapp-api","whatsapp-web","WhiskeySockets", "@whiskeysockets","whiskeysockets", "@whiskey", "sockets","socket","@whiskeysockets/baileys","whatsapp","whatsapp-chat","whatsapp-group","baileys","baileys-md", "newsletter","news letter" , "automation","multi-device","ttdl","tiktok","tiktok scraper","tiktok no watermark","tiktok no wm","ttnowm","ytdl","ytmp3","ytmp4","youtube","instagram","instagram-dl","igdl"],
@@ -23,7 +23,7 @@
23
23
  "axios": "1.3.2",
24
24
  "jimp": "0.16.2",
25
25
  "cache-manager": "^7.2.8",
26
- "libsignal-xeuka": "npm:@shennmine/libsignal-node@2.0.1",
26
+ "libsignal-xeuka": "npm:@baileys-md/libsignal",
27
27
  "long": "^5.3.2",
28
28
  "lru-cache": "^10.2.0",
29
29
  "music-metadata": "^7.14.0",