nishiki-bail 1.1.21 → 1.1.22

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.
@@ -101,19 +101,22 @@ export const prepareWAMessageMedia = async (message, options) => {
101
101
  logger?.info({ key: cacheableKey }, 'Preparing raw media for newsletter');
102
102
  const { filePath, fileSha256, fileLength } = await getRawMediaUploadData(uploadData.media, options.mediaTypeOverride || mediaType, logger);
103
103
  const fileSha256B64 = fileSha256.toString('base64');
104
- const { mediaUrl, directPath } = await options.upload(filePath, {
104
+ const { mediaUrl, directPath, thumbnailDirectPath, thumbnailSha256 } = await options.upload(filePath, {
105
105
  fileEncSha256B64: fileSha256B64,
106
106
  mediaType: mediaType,
107
- timeoutMs: options.mediaUploadTimeoutMs
107
+ timeoutMs: options.mediaUploadTimeoutMs,
108
+ newsletter: isNewsletter
108
109
  });
109
110
  await fs.unlink(filePath);
110
111
  const obj = WAProto.Message.fromObject({
111
112
  // todo: add more support here
112
113
  [`${mediaType}Message`]: MessageTypeProto[mediaType].fromObject({
113
- url: mediaUrl,
114
+ url: mediaUrl || directPath,
114
115
  directPath,
115
116
  fileSha256,
116
117
  fileLength,
118
+ thumbnailDirectPath,
119
+ thumbnailSha256,
117
120
  ...uploadData,
118
121
  media: undefined
119
122
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nishiki-bail",
3
3
  "type": "module",
4
- "version": "1.1.21",
4
+ "version": "1.1.22",
5
5
  "description": "666",
6
6
  "keywords": [
7
7
  "whatsapp"