@rexxhayanasi/elaina-baileys 1.2.0-rc.1 → 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 });
@@ -41,7 +41,7 @@ const MIMETYPE_MAP = {
41
41
  audio: 'audio/ogg; codecs=opus',
42
42
  sticker: 'image/webp',
43
43
  'product-catalog-image': 'image/jpeg',
44
- 'sticker-pack': 'application/x-zip-compressed'
44
+ 'sticker-pack': 'application/x-zip-compressed',
45
45
  "ptv": "video/mp4",
46
46
  "newsletter-image": "image/jpeg",
47
47
  "newsletter-video": "video/mp4"
@@ -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
- const { bodyPath, fileSha256, fileLength, didSaveToTmpPath } = await (0, messages_media_1.prepareStream)(
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(bodyPath, {
161
+ const { mediaUrl, directPath } = await options.upload(streamToUpload, {
161
162
  fileEncSha256B64,
162
163
  mediaType,
163
164
  timeoutMs: options.mediaUploadTimeoutMs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rexxhayanasi/elaina-baileys",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.2.0-rc.3",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",