@realvare/based 2.6.23 → 2.6.24
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.
|
@@ -69,7 +69,7 @@ const getImageProcessingLibrary = async () => {
|
|
|
69
69
|
return jimp;
|
|
70
70
|
})(),
|
|
71
71
|
(async () => {
|
|
72
|
-
const sharp = await (Promise.resolve().then(() => __importStar(require('
|
|
72
|
+
const sharp = await (Promise.resolve().then(() => __importStar(require('sharp'))).catch(() => { }));
|
|
73
73
|
return sharp;
|
|
74
74
|
})()
|
|
75
75
|
]);
|
|
@@ -479,8 +479,21 @@ async function generateThumbnail(file, mediaType, options) {
|
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
481
|
const getHttpStream = async (url, options = {}) => {
|
|
482
|
-
const
|
|
483
|
-
|
|
482
|
+
const { retryRequestDelayMs, maxMsgRetryCount } = options;
|
|
483
|
+
let retries = 0;
|
|
484
|
+
while (retries < maxMsgRetryCount) {
|
|
485
|
+
try {
|
|
486
|
+
const fetched = await axios_1.default.get(url.toString(), { ...options, responseType: 'stream' });
|
|
487
|
+
return fetched.data;
|
|
488
|
+
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
retries++;
|
|
491
|
+
if (retries >= maxMsgRetryCount) {
|
|
492
|
+
throw error;
|
|
493
|
+
}
|
|
494
|
+
await (0, generics_1.delay)(retryRequestDelayMs || 1000);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
484
497
|
};
|
|
485
498
|
exports.getHttpStream = getHttpStream;
|
|
486
499
|
const prepareStream = async (media, mediaType, { logger, saveOriginalFileIfRequired, opts } = {}) => {
|
package/lib/Utils/thumbnail.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realvare/based",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.24",
|
|
4
4
|
"description": "WhatsApp Web API by Sam",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baileys",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"automation",
|
|
12
12
|
"multi-device",
|
|
13
13
|
"lid",
|
|
14
|
-
"
|
|
14
|
+
"based"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://github.com/realvare/based.git",
|
|
17
17
|
"repository": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"music-metadata": "^7.12.3",
|
|
59
59
|
"pino": "^9.6",
|
|
60
60
|
"protobufjs": "^7.2.5",
|
|
61
|
-
"
|
|
61
|
+
"sharp": "^0.33.5",
|
|
62
62
|
"uuid": "^10.0.0",
|
|
63
63
|
"ws": "^8.18.0"
|
|
64
64
|
},
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@types/got": "^9.6.11",
|
|
68
68
|
"@types/jest": "^29.5.12",
|
|
69
69
|
"@types/node": "^20.14.0",
|
|
70
|
+
"@types/sharp": "^0.32.0",
|
|
70
71
|
"@types/ws": "^8.5.10",
|
|
71
72
|
"conventional-changelog-cli": "^2.2.2",
|
|
72
73
|
"eslint": "^8.57.0",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"open": "^10.1.0",
|
|
78
79
|
"qrcode-terminal": "^0.12.0",
|
|
79
80
|
"release-it": "^16.1.0",
|
|
80
|
-
"
|
|
81
|
+
"sharp": "^0.33.5",
|
|
81
82
|
"ts-jest": "^29.1.2",
|
|
82
83
|
"ts-node": "^10.9.2",
|
|
83
84
|
"typedoc": "^0.25.12",
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"audio-decode": "^2.1.3",
|
|
88
89
|
"link-preview-js": "^3.0.0",
|
|
89
90
|
"qrcode-terminal": "^0.12.0",
|
|
90
|
-
"
|
|
91
|
+
"sharp": "^0.33.0"
|
|
91
92
|
},
|
|
92
93
|
"peerDependenciesMeta": {
|
|
93
94
|
"audio-decode": {
|
|
@@ -96,6 +97,9 @@
|
|
|
96
97
|
"jimp": {
|
|
97
98
|
"optional": true
|
|
98
99
|
},
|
|
100
|
+
"sharp": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
99
103
|
"link-preview-js": {
|
|
100
104
|
"optional": true
|
|
101
105
|
}
|