@itsliaaa/baileys 0.1.10 → 0.1.12
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.
- package/WAProto/index.js +59 -19
- package/lib/Utils/messages-media.js +4 -2
- package/lib/Utils/messages.js +4 -2
- package/package.json +1 -1
package/WAProto/index.js
CHANGED
|
@@ -6766,6 +6766,10 @@ export const proto = $root.proto = (() => {
|
|
|
6766
6766
|
case 60:
|
|
6767
6767
|
m.capabilities[i] = 60;
|
|
6768
6768
|
break;
|
|
6769
|
+
case "AI_SUBSCRIPTION_ENABLED":
|
|
6770
|
+
case 61:
|
|
6771
|
+
m.capabilities[i] = 61;
|
|
6772
|
+
break;
|
|
6769
6773
|
}
|
|
6770
6774
|
}
|
|
6771
6775
|
}
|
|
@@ -6862,6 +6866,7 @@ export const proto = $root.proto = (() => {
|
|
|
6862
6866
|
values[valuesById[58] = "JSON_PATCH_STREAMING"] = 58;
|
|
6863
6867
|
values[valuesById[59] = "AI_TAB_FORCE_CLIPPY"] = 59;
|
|
6864
6868
|
values[valuesById[60] = "UNIFIED_RESPONSE_EMBEDDED_SCREENS"] = 60;
|
|
6869
|
+
values[valuesById[61] = "AI_SUBSCRIPTION_ENABLED"] = 61;
|
|
6865
6870
|
return values;
|
|
6866
6871
|
})();
|
|
6867
6872
|
|
|
@@ -26066,10 +26071,6 @@ export const proto = $root.proto = (() => {
|
|
|
26066
26071
|
case 3:
|
|
26067
26072
|
m.limitSharingTrigger = 3;
|
|
26068
26073
|
break;
|
|
26069
|
-
case "DEPRECATION":
|
|
26070
|
-
case 4:
|
|
26071
|
-
m.limitSharingTrigger = 4;
|
|
26072
|
-
break;
|
|
26073
26074
|
}
|
|
26074
26075
|
if (d.limitSharingInitiatedByMe != null) {
|
|
26075
26076
|
m.limitSharingInitiatedByMe = Boolean(d.limitSharingInitiatedByMe);
|
|
@@ -35922,10 +35923,6 @@ export const proto = $root.proto = (() => {
|
|
|
35922
35923
|
case 3:
|
|
35923
35924
|
m.trigger = 3;
|
|
35924
35925
|
break;
|
|
35925
|
-
case "DEPRECATION":
|
|
35926
|
-
case 4:
|
|
35927
|
-
m.trigger = 4;
|
|
35928
|
-
break;
|
|
35929
35926
|
}
|
|
35930
35927
|
if (d.limitSharingSettingTimestamp != null) {
|
|
35931
35928
|
if ($util.Long)
|
|
@@ -35990,7 +35987,6 @@ export const proto = $root.proto = (() => {
|
|
|
35990
35987
|
values[valuesById[1] = "CHAT_SETTING"] = 1;
|
|
35991
35988
|
values[valuesById[2] = "BIZ_SUPPORTS_FB_HOSTING"] = 2;
|
|
35992
35989
|
values[valuesById[3] = "UNKNOWN_GROUP"] = 3;
|
|
35993
|
-
values[valuesById[4] = "DEPRECATION"] = 4;
|
|
35994
35990
|
return values;
|
|
35995
35991
|
})();
|
|
35996
35992
|
|
|
@@ -68131,10 +68127,32 @@ export const proto = $root.proto = (() => {
|
|
|
68131
68127
|
this[ks[i]] = p[ks[i]];
|
|
68132
68128
|
}
|
|
68133
68129
|
|
|
68134
|
-
VideoEndCard.prototype.username =
|
|
68135
|
-
VideoEndCard.prototype.caption =
|
|
68136
|
-
VideoEndCard.prototype.thumbnailImageUrl =
|
|
68137
|
-
VideoEndCard.prototype.profilePictureUrl =
|
|
68130
|
+
VideoEndCard.prototype.username = null;
|
|
68131
|
+
VideoEndCard.prototype.caption = null;
|
|
68132
|
+
VideoEndCard.prototype.thumbnailImageUrl = null;
|
|
68133
|
+
VideoEndCard.prototype.profilePictureUrl = null;
|
|
68134
|
+
|
|
68135
|
+
let $oneOfFields;
|
|
68136
|
+
|
|
68137
|
+
Object.defineProperty(VideoEndCard.prototype, "_username", {
|
|
68138
|
+
get: $util.oneOfGetter($oneOfFields = ["username"]),
|
|
68139
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
68140
|
+
});
|
|
68141
|
+
|
|
68142
|
+
Object.defineProperty(VideoEndCard.prototype, "_caption", {
|
|
68143
|
+
get: $util.oneOfGetter($oneOfFields = ["caption"]),
|
|
68144
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
68145
|
+
});
|
|
68146
|
+
|
|
68147
|
+
Object.defineProperty(VideoEndCard.prototype, "_thumbnailImageUrl", {
|
|
68148
|
+
get: $util.oneOfGetter($oneOfFields = ["thumbnailImageUrl"]),
|
|
68149
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
68150
|
+
});
|
|
68151
|
+
|
|
68152
|
+
Object.defineProperty(VideoEndCard.prototype, "_profilePictureUrl", {
|
|
68153
|
+
get: $util.oneOfGetter($oneOfFields = ["profilePictureUrl"]),
|
|
68154
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
68155
|
+
});
|
|
68138
68156
|
|
|
68139
68157
|
VideoEndCard.create = function create(properties) {
|
|
68140
68158
|
return new VideoEndCard(properties);
|
|
@@ -68210,23 +68228,25 @@ export const proto = $root.proto = (() => {
|
|
|
68210
68228
|
if (!o)
|
|
68211
68229
|
o = {};
|
|
68212
68230
|
var d = {};
|
|
68213
|
-
if (o.defaults) {
|
|
68214
|
-
d.username = "";
|
|
68215
|
-
d.caption = "";
|
|
68216
|
-
d.thumbnailImageUrl = "";
|
|
68217
|
-
d.profilePictureUrl = "";
|
|
68218
|
-
}
|
|
68219
68231
|
if (m.username != null && m.hasOwnProperty("username")) {
|
|
68220
68232
|
d.username = m.username;
|
|
68233
|
+
if (o.oneofs)
|
|
68234
|
+
d._username = "username";
|
|
68221
68235
|
}
|
|
68222
68236
|
if (m.caption != null && m.hasOwnProperty("caption")) {
|
|
68223
68237
|
d.caption = m.caption;
|
|
68238
|
+
if (o.oneofs)
|
|
68239
|
+
d._caption = "caption";
|
|
68224
68240
|
}
|
|
68225
68241
|
if (m.thumbnailImageUrl != null && m.hasOwnProperty("thumbnailImageUrl")) {
|
|
68226
68242
|
d.thumbnailImageUrl = m.thumbnailImageUrl;
|
|
68243
|
+
if (o.oneofs)
|
|
68244
|
+
d._thumbnailImageUrl = "thumbnailImageUrl";
|
|
68227
68245
|
}
|
|
68228
68246
|
if (m.profilePictureUrl != null && m.hasOwnProperty("profilePictureUrl")) {
|
|
68229
68247
|
d.profilePictureUrl = m.profilePictureUrl;
|
|
68248
|
+
if (o.oneofs)
|
|
68249
|
+
d._profilePictureUrl = "profilePictureUrl";
|
|
68230
68250
|
}
|
|
68231
68251
|
return d;
|
|
68232
68252
|
};
|
|
@@ -85427,6 +85447,7 @@ export const proto = $root.proto = (() => {
|
|
|
85427
85447
|
BusinessBroadcastListAction.prototype.participants = $util.emptyArray;
|
|
85428
85448
|
BusinessBroadcastListAction.prototype.listName = null;
|
|
85429
85449
|
BusinessBroadcastListAction.prototype.labelIds = $util.emptyArray;
|
|
85450
|
+
BusinessBroadcastListAction.prototype.audienceExpression = null;
|
|
85430
85451
|
|
|
85431
85452
|
let $oneOfFields;
|
|
85432
85453
|
|
|
@@ -85440,6 +85461,11 @@ export const proto = $root.proto = (() => {
|
|
|
85440
85461
|
set: $util.oneOfSetter($oneOfFields)
|
|
85441
85462
|
});
|
|
85442
85463
|
|
|
85464
|
+
Object.defineProperty(BusinessBroadcastListAction.prototype, "_audienceExpression", {
|
|
85465
|
+
get: $util.oneOfGetter($oneOfFields = ["audienceExpression"]),
|
|
85466
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
85467
|
+
});
|
|
85468
|
+
|
|
85443
85469
|
BusinessBroadcastListAction.create = function create(properties) {
|
|
85444
85470
|
return new BusinessBroadcastListAction(properties);
|
|
85445
85471
|
};
|
|
@@ -85459,6 +85485,8 @@ export const proto = $root.proto = (() => {
|
|
|
85459
85485
|
for (var i = 0; i < m.labelIds.length; ++i)
|
|
85460
85486
|
w.uint32(34).string(m.labelIds[i]);
|
|
85461
85487
|
}
|
|
85488
|
+
if (m.audienceExpression != null && Object.hasOwnProperty.call(m, "audienceExpression"))
|
|
85489
|
+
w.uint32(42).string(m.audienceExpression);
|
|
85462
85490
|
return w;
|
|
85463
85491
|
};
|
|
85464
85492
|
|
|
@@ -85491,6 +85519,10 @@ export const proto = $root.proto = (() => {
|
|
|
85491
85519
|
m.labelIds.push(r.string());
|
|
85492
85520
|
break;
|
|
85493
85521
|
}
|
|
85522
|
+
case 5: {
|
|
85523
|
+
m.audienceExpression = r.string();
|
|
85524
|
+
break;
|
|
85525
|
+
}
|
|
85494
85526
|
default:
|
|
85495
85527
|
r.skipType(t & 7);
|
|
85496
85528
|
break;
|
|
@@ -85527,6 +85559,9 @@ export const proto = $root.proto = (() => {
|
|
|
85527
85559
|
m.labelIds[i] = String(d.labelIds[i]);
|
|
85528
85560
|
}
|
|
85529
85561
|
}
|
|
85562
|
+
if (d.audienceExpression != null) {
|
|
85563
|
+
m.audienceExpression = String(d.audienceExpression);
|
|
85564
|
+
}
|
|
85530
85565
|
return m;
|
|
85531
85566
|
};
|
|
85532
85567
|
|
|
@@ -85560,6 +85595,11 @@ export const proto = $root.proto = (() => {
|
|
|
85560
85595
|
d.labelIds[j] = m.labelIds[j];
|
|
85561
85596
|
}
|
|
85562
85597
|
}
|
|
85598
|
+
if (m.audienceExpression != null && m.hasOwnProperty("audienceExpression")) {
|
|
85599
|
+
d.audienceExpression = m.audienceExpression;
|
|
85600
|
+
if (o.oneofs)
|
|
85601
|
+
d._audienceExpression = "audienceExpression";
|
|
85602
|
+
}
|
|
85563
85603
|
return d;
|
|
85564
85604
|
};
|
|
85565
85605
|
|
|
@@ -698,7 +698,8 @@ export const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, opt
|
|
|
698
698
|
const auth = encodeURIComponent(uploadInfo.auth);
|
|
699
699
|
// Lia@Changes 06-02-26 --- Switch media path map for newsletter uploads
|
|
700
700
|
const mediaPathMap = newsletter ? NEWSLETTER_MEDIA_PATH_MAP : MEDIA_PATH_MAP
|
|
701
|
-
const
|
|
701
|
+
const serverThumb = newsletter ? '&server_thumb_gen=1' : ''
|
|
702
|
+
const url = `https://${hostname}${mediaPathMap[mediaType]}/${fileEncSha256B64}?auth=${auth}&token=${fileEncSha256B64}${serverThumb}`;
|
|
702
703
|
let result;
|
|
703
704
|
try {
|
|
704
705
|
result = await uploadMedia({
|
|
@@ -715,7 +716,8 @@ export const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, opt
|
|
|
715
716
|
meta_hmac: result.meta_hmac,
|
|
716
717
|
fbid: result.fbid,
|
|
717
718
|
ts: result.ts,
|
|
718
|
-
|
|
719
|
+
thumbnailDirectPath: result.thumbnail_info?.thumbnail_direct_path,
|
|
720
|
+
thumbnailSha256: result.thumbnail_info?.thumbnail_sha256
|
|
719
721
|
};
|
|
720
722
|
break;
|
|
721
723
|
}
|
package/lib/Utils/messages.js
CHANGED
|
@@ -133,7 +133,7 @@ export const prepareWAMessageMedia = async (message, options) => {
|
|
|
133
133
|
logger?.info({ key: cacheableKey }, 'Preparing raw media for newsletter');
|
|
134
134
|
const { filePath, fileSha256, fileLength } = await getRawMediaUploadData(uploadData.media, options.mediaTypeOverride || mediaType, logger);
|
|
135
135
|
const fileSha256B64 = fileSha256.toString('base64');
|
|
136
|
-
const [{ mediaUrl, directPath }] = await Promise.all([
|
|
136
|
+
const [{ mediaUrl, directPath, thumbnailDirectPath, thumbnailSha256 }] = await Promise.all([
|
|
137
137
|
(async () => {
|
|
138
138
|
const result = options.upload(filePath, {
|
|
139
139
|
fileEncSha256B64: fileSha256B64,
|
|
@@ -177,6 +177,8 @@ export const prepareWAMessageMedia = async (message, options) => {
|
|
|
177
177
|
directPath,
|
|
178
178
|
fileSha256,
|
|
179
179
|
fileLength,
|
|
180
|
+
thumbnailDirectPath,
|
|
181
|
+
thumbnailSha256,
|
|
180
182
|
...uploadData
|
|
181
183
|
})
|
|
182
184
|
});
|
|
@@ -1448,7 +1450,7 @@ export const generateWAMessageFromContent = (jid, message, options) => {
|
|
|
1448
1450
|
const timestamp = unixTimestampSeconds(options.timestamp);
|
|
1449
1451
|
const isNewsletter = isJidNewsletter(jid);
|
|
1450
1452
|
const { quoted, userJid } = options;
|
|
1451
|
-
if (quoted) {
|
|
1453
|
+
if (quoted && !isNewsletter) {
|
|
1452
1454
|
const participant = quoted.key.fromMe
|
|
1453
1455
|
? userJid // TODO: Add support for LIDs
|
|
1454
1456
|
: quoted.participant || quoted.key.participant || quoted.key.remoteJid;
|