@badzz88/baileys 8.5.3 → 8.5.4
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/README.md +1 -1
- package/WAProto/WAProto.proto +1256 -75
- package/WAProto/index.d.ts +36042 -19649
- package/WAProto/index.js +181990 -135645
- package/engine-requirements.js +7 -15
- package/lib/Defaults/index.js +22 -17
- package/lib/Signal/Group/group_cipher.js +5 -5
- package/lib/Signal/Group/keyhelper.js +4 -4
- package/lib/Signal/Group/sender-chain-key.js +2 -2
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -1
- package/lib/Signal/Group/sender-key-message.js +3 -3
- package/lib/Signal/Group/sender-key-record.js +1 -1
- package/lib/Signal/Group/sender-message-key.js +5 -5
- package/lib/Signal/libsignal.js +39 -59
- package/lib/Signal/lid-mapping.js +28 -10
- package/lib/Socket/aigroups.js +5 -5
- package/lib/Socket/business.js +3 -11
- package/lib/Socket/chats.js +668 -319
- package/lib/Socket/communities.js +85 -89
- package/lib/Socket/graphql.js +435 -228
- package/lib/Socket/groups.js +132 -211
- package/lib/Socket/index.js +9 -7
- package/lib/Socket/interactive-handler.js +117 -60
- package/lib/Socket/interop.js +56 -175
- package/lib/Socket/managed-account.js +79 -48
- package/lib/Socket/messages-recv.js +898 -340
- package/lib/Socket/messages-send.js +462 -160
- package/lib/Socket/mex.js +40 -53
- package/lib/Socket/newsletter.js +291 -295
- package/lib/Socket/privacy.js +77 -265
- package/lib/Socket/registration.js +164 -157
- package/lib/Socket/socket.js +181 -199
- package/lib/Socket/username.js +144 -227
- package/lib/Store/make-cache-manager-store.js +2 -2
- package/lib/Store/make-in-memory-store.js +25 -141
- package/lib/Types/Auth.js +3 -3
- package/lib/Types/Label.js +1 -1
- package/lib/Types/LabelAssociation.js +1 -1
- package/lib/Types/Newsletter.js +96 -65
- package/lib/Types/State.js +4 -4
- package/lib/Types/index.js +1 -1
- package/lib/Utils/auth-utils.js +52 -57
- package/lib/Utils/browser-utils.js +1 -1
- package/lib/Utils/business.js +2 -6
- package/lib/Utils/chat-utils.js +102 -38
- package/lib/Utils/crypto.js +54 -84
- package/lib/Utils/decode-wa-message.js +316 -83
- package/lib/Utils/event-buffer.js +37 -61
- package/lib/Utils/generics.js +157 -103
- package/lib/Utils/group-history.js +3 -12
- package/lib/Utils/history.js +15 -15
- package/lib/Utils/index.js +1 -5
- package/lib/Utils/link-preview.js +3 -8
- package/lib/Utils/lt-hash.js +2 -35
- package/lib/Utils/make-mutex.js +1 -1
- package/lib/Utils/message-inspect.js +393 -0
- package/lib/Utils/message-retry-manager.js +27 -92
- package/lib/Utils/messages-media.js +159 -130
- package/lib/Utils/messages.js +144 -566
- package/lib/Utils/meta-ai-msmsg.js +62 -202
- package/lib/Utils/noise-handler.js +19 -21
- package/lib/Utils/offline-node-processor.js +3 -8
- package/lib/Utils/pre-key-manager.js +13 -23
- package/lib/Utils/process-message.js +197 -106
- package/lib/Utils/reporting-utils.js +2 -2
- package/lib/Utils/signal.js +28 -63
- package/lib/Utils/stanza-ack.js +39 -12
- package/lib/Utils/sync-action-utils.js +4 -7
- package/lib/Utils/tc-token-utils.js +20 -25
- package/lib/Utils/use-multi-file-auth-state.js +30 -14
- package/lib/Utils/validate-connection.js +59 -19
- package/lib/WABinary/decode.js +50 -16
- package/lib/WABinary/encode.js +54 -224
- package/lib/WABinary/generic-utils.js +7 -97
- package/lib/WABinary/jid-utils.js +27 -14
- package/lib/WAM/encode.js +7 -7
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +58 -1
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +7 -1
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +13 -5
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -4
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +20 -7
- package/lib/WAUSync/Protocols/USyncNewsletterProtocol.js +865 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +7 -2
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +1 -1
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +2 -1
- package/lib/WAUSync/Protocols/index.js +1 -0
- package/lib/WAUSync/USyncBackoff.js +26 -0
- package/lib/WAUSync/USyncQuery.js +77 -6
- package/lib/WAUSync/USyncUser.js +16 -8
- package/lib/WAUSync/index.js +1 -0
- package/lib/antiban.js +608 -854
- package/lib/index.js +1 -1
- package/package.json +16 -20
- package/lib/Socket/luxu.js +0 -387
- package/lib/Socket/text-router.js +0 -83
- package/lib/Store/keyed-db.js +0 -108
- package/lib/Types/Mex.js +0 -112
- package/lib/Utils/command-loader.d.ts +0 -31
- package/lib/Utils/command-loader.js +0 -100
- package/lib/Utils/companion-reg-client-utils.js +0 -42
- package/lib/Utils/curve25519-js.js +0 -275
- package/lib/Utils/native-bridge.js +0 -82
- package/lib/Utils/session-pool.d.ts +0 -16
- package/lib/Utils/session-pool.js +0 -94
- package/lib/Utils/sticker.d.ts +0 -17
- package/lib/Utils/sticker.js +0 -145
- package/lib/Utils/view-once-cache.d.ts +0 -9
- package/lib/Utils/view-once-cache.js +0 -79
|
@@ -14,11 +14,19 @@ class USyncDeviceProtocol {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
getUserElement(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
getUserElement(user) {
|
|
18
|
+
const { deviceHash, ts, expectedTs } = user
|
|
19
|
+
if (deviceHash == null && ts == null && expectedTs == null) {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
const attrs = {}
|
|
23
|
+
if (deviceHash != null) attrs.device_hash = deviceHash
|
|
24
|
+
if (ts != null) attrs.ts = String(ts)
|
|
25
|
+
if (expectedTs != null) attrs.expected_ts = String(expectedTs)
|
|
26
|
+
return {
|
|
27
|
+
tag: 'devices',
|
|
28
|
+
attrs
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
31
|
parser(node) {
|
|
24
32
|
const deviceList = []
|
|
@@ -20,10 +20,7 @@ class USyncDisappearingModeProtocol {
|
|
|
20
20
|
;(0, WABinary_1.assertNodeErrorFree)(node)
|
|
21
21
|
const duration = +node?.attrs.duration
|
|
22
22
|
const setAt = new Date(+(node?.attrs.t || 0) * 1000)
|
|
23
|
-
return {
|
|
24
|
-
duration,
|
|
25
|
-
setAt
|
|
26
|
-
}
|
|
23
|
+
return { duration, setAt }
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true })
|
|
3
3
|
exports.USyncFeatureProtocol = exports.USYNC_FEATURES = void 0
|
|
4
4
|
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
7
|
exports.USYNC_FEATURES = [
|
|
8
8
|
'document',
|
|
9
9
|
'encrypt',
|
|
@@ -15,12 +15,12 @@ exports.USYNC_FEATURES = [
|
|
|
15
15
|
'encrypt_url',
|
|
16
16
|
'encrypt_v2',
|
|
17
17
|
'voip',
|
|
18
|
-
'
|
|
18
|
+
'voip_legacy',
|
|
19
|
+
'multi_agent',
|
|
20
|
+
'bot_eligible'
|
|
19
21
|
]
|
|
20
22
|
class USyncFeatureProtocol {
|
|
21
|
-
|
|
22
|
-
* @param {string[]} [features] feature names to query (defaults to all known)
|
|
23
|
-
*/
|
|
23
|
+
|
|
24
24
|
constructor(features) {
|
|
25
25
|
this.name = 'feature'
|
|
26
26
|
this.features = features && features.length ? features : exports.USYNC_FEATURES
|
|
@@ -46,11 +46,24 @@ class USyncFeatureProtocol {
|
|
|
46
46
|
errorText: errorNode.attrs?.text
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
const CAMEL_MAP = {
|
|
50
|
+
encrypt_v2: 'encryptV2',
|
|
51
|
+
voip_legacy: 'voipLegacy',
|
|
52
|
+
multi_agent: 'multiAgent',
|
|
53
|
+
bot_eligible: 'botEligible',
|
|
54
|
+
encrypt_blist: 'encryptBlist',
|
|
55
|
+
encrypt_contact: 'encryptContact',
|
|
56
|
+
encrypt_group_gen2: 'encryptGroupGen2',
|
|
57
|
+
encrypt_image: 'encryptImage',
|
|
58
|
+
encrypt_location: 'encryptLocation',
|
|
59
|
+
encrypt_url: 'encryptUrl'
|
|
60
|
+
}
|
|
49
61
|
const features = {}
|
|
50
62
|
const children = Array.isArray(node.content) ? node.content : []
|
|
51
63
|
for (const child of children) {
|
|
52
64
|
if (child?.attrs && child.attrs.value !== undefined) {
|
|
53
|
-
|
|
65
|
+
const key = CAMEL_MAP[child.tag] || child.tag
|
|
66
|
+
features[key] = child.attrs.value
|
|
54
67
|
}
|
|
55
68
|
}
|
|
56
69
|
return features
|