@rexxhayanasi/elaina-baileys 1.2.0-rc.2 → 1.2.0-rc.3
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.
|
@@ -88,18 +88,13 @@ const getImageProcessingLibrary = async () => {
|
|
|
88
88
|
const hkdfInfoKey = (type) => {
|
|
89
89
|
if (type === 'sticker-pack') return 'WhatsApp Image Keys';
|
|
90
90
|
if (type === 'ptv') return 'WhatsApp Video Keys';
|
|
91
|
-
|
|
92
|
-
// Support Newsletter keys explicitly or fallback
|
|
93
91
|
if (type === 'newsletter-image') return 'WhatsApp Image Keys';
|
|
94
92
|
if (type === 'newsletter-video') return 'WhatsApp Video Keys';
|
|
95
93
|
|
|
96
94
|
const hkdfInfo = Defaults_1.MEDIA_HKDF_KEY_MAPPING[type];
|
|
97
|
-
|
|
98
|
-
// Fallback if type not found to prevent undefined key error
|
|
99
95
|
if (!hkdfInfo) {
|
|
100
96
|
return 'WhatsApp Image Keys';
|
|
101
97
|
}
|
|
102
|
-
|
|
103
98
|
return `WhatsApp ${hkdfInfo} Keys`;
|
|
104
99
|
};
|
|
105
100
|
exports.hkdfInfoKey = hkdfInfoKey;
|
|
@@ -770,9 +765,7 @@ const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, options },
|
|
|
770
765
|
const hosts = [...customUploadHosts, ...uploadInfo.hosts];
|
|
771
766
|
const chunks = [];
|
|
772
767
|
|
|
773
|
-
// --- MODIFIKASI: Panggil via objek toAsyncIterable_1 ---
|
|
774
768
|
try {
|
|
775
|
-
// Kita akses properti .toAsyncIterable karena diimpor sebagai objek
|
|
776
769
|
stream = toAsyncIterable_1.toAsyncIterable(stream);
|
|
777
770
|
} catch (error) {
|
|
778
771
|
throw new boom_1.Boom(error.message, { statusCode: 400 });
|
package/lib/Utils/messages.js
CHANGED
|
@@ -145,19 +145,20 @@ const assertColor = async (color) => {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
const isNewsletter = options.newsletter || (options.jid && (0, WABinary_1.isJidNewsletter)(options.jid));
|
|
148
|
-
|
|
149
148
|
if (isNewsletter) {
|
|
150
149
|
logger === null || logger === void 0 ? void 0 : logger.debug({ key: cacheableKey }, 'Preparing raw media for newsletter');
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
|
|
152
|
+
const { bodyPath, fileSha256, fileLength, didSaveToTmpPath, encWriteStream } = await (0, messages_media_1.prepareStream)(
|
|
153
153
|
uploadData.media,
|
|
154
154
|
options.mediaTypeOverride || mediaType,
|
|
155
155
|
{ logger, opts: options.options }
|
|
156
156
|
);
|
|
157
157
|
|
|
158
158
|
const fileEncSha256B64 = fileSha256.toString('base64');
|
|
159
|
+
const streamToUpload = bodyPath || encWriteStream;
|
|
159
160
|
|
|
160
|
-
const { mediaUrl, directPath } = await options.upload(
|
|
161
|
+
const { mediaUrl, directPath } = await options.upload(streamToUpload, {
|
|
161
162
|
fileEncSha256B64,
|
|
162
163
|
mediaType,
|
|
163
164
|
timeoutMs: options.mediaUploadTimeoutMs,
|