@badzz88/baileys 8.5.7 → 8.5.8
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 +337 -1055
- package/WAProto/WAProto.proto +284 -264
- package/WAProto/index.js +5 -5
- package/engine-requirements.js +7 -15
- package/lib/Defaults/index.js +130 -187
- package/lib/Signal/Group/ciphertext-message.js +11 -14
- package/lib/Signal/Group/group-session-builder.js +29 -91
- package/lib/Signal/Group/group_cipher.js +81 -88
- package/lib/Signal/Group/index.js +12 -136
- package/lib/Signal/Group/keyhelper.js +15 -70
- package/lib/Signal/Group/sender-chain-key.js +25 -31
- package/lib/Signal/Group/sender-key-distribution-message.js +62 -65
- package/lib/Signal/Group/sender-key-message.js +65 -68
- package/lib/Signal/Group/sender-key-name.js +41 -43
- package/lib/Signal/Group/sender-key-record.js +40 -43
- package/lib/Signal/Group/sender-key-state.js +83 -96
- package/lib/Signal/Group/sender-message-key.js +25 -29
- package/lib/Signal/libsignal.js +425 -453
- package/lib/Signal/lid-mapping.js +276 -259
- package/lib/Socket/Client/index.js +3 -30
- package/lib/Socket/Client/types.js +10 -12
- package/lib/Socket/Client/websocket.js +53 -61
- package/lib/Socket/business.js +379 -422
- package/lib/Socket/chats.js +1193 -1816
- package/lib/Socket/communities.js +431 -549
- package/lib/Socket/graphql.js +672 -612
- package/lib/Socket/groups.js +374 -764
- package/lib/Socket/index.js +17 -38
- package/lib/Socket/interop.js +417 -503
- package/lib/Socket/messages-recv.js +1915 -2441
- package/lib/Socket/messages-send.js +1213 -1630
- package/lib/Socket/mex.js +9 -15
- package/lib/Socket/newsletter.js +747 -808
- package/lib/Socket/privacy.js +310 -441
- package/lib/Socket/socket.js +1025 -1022
- package/lib/Socket/username.js +8 -15
- package/lib/Store/index.js +10 -36
- package/lib/Store/make-cache-manager-store.js +80 -85
- package/lib/Store/make-in-memory-store.js +231 -591
- package/lib/Store/make-ordered-dictionary.js +72 -78
- package/lib/Store/object-repository.js +28 -25
- package/lib/Types/Auth.js +2 -38
- package/lib/Types/Bussines.js +2 -2
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.js +8 -4
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.js +24 -26
- package/lib/Types/LabelAssociation.js +6 -8
- package/lib/Types/Message.js +11 -95
- package/lib/Types/Mex.js +111 -112
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/State.js +56 -70
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.js +26 -55
- package/lib/Utils/auth-utils.js +288 -292
- package/lib/Utils/browser-utils.js +47 -113
- package/lib/Utils/business.js +224 -240
- package/lib/Utils/chat-utils.js +869 -1205
- package/lib/Utils/companion-reg-client-utils.js +34 -41
- package/lib/Utils/crypto.js +107 -144
- package/lib/Utils/decode-wa-message.js +308 -518
- package/lib/Utils/event-buffer.js +611 -596
- package/lib/Utils/generics.js +355 -515
- package/lib/Utils/history.js +134 -244
- package/lib/Utils/identity-change-handler.js +49 -51
- package/lib/Utils/index.js +23 -57
- package/lib/Utils/link-preview.js +77 -135
- package/lib/Utils/logger.js +3 -9
- package/lib/Utils/lt-hash.js +6 -37
- package/lib/Utils/make-mutex.js +33 -36
- package/lib/Utils/message-composer.js +233 -439
- package/lib/Utils/message-retry-manager.js +260 -265
- package/lib/Utils/messages-media.js +829 -855
- package/lib/Utils/messages.js +961 -2528
- package/lib/Utils/noise-handler.js +200 -195
- package/lib/Utils/offline-node-processor.js +33 -35
- package/lib/Utils/pre-key-manager.js +102 -103
- package/lib/Utils/process-message.js +560 -978
- package/lib/Utils/reporting-utils.js +253 -257
- package/lib/Utils/signal.js +195 -218
- package/lib/Utils/stanza-ack.js +29 -31
- package/lib/Utils/sticker.js +109 -144
- package/lib/Utils/sync-action-utils.js +45 -50
- package/lib/Utils/tc-token-utils.js +139 -137
- package/lib/Utils/use-multi-file-auth-state.js +109 -109
- package/lib/Utils/validate-connection.js +202 -218
- package/lib/WABinary/constants.js +1299 -1302
- package/lib/WABinary/decode.js +262 -343
- package/lib/WABinary/encode.js +4 -12
- package/lib/WABinary/generic-utils.js +187 -223
- package/lib/WABinary/index.js +6 -33
- package/lib/WABinary/jid-utils.js +88 -351
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.js +9 -12
- package/lib/WAM/constants.js +22853 -39486
- package/lib/WAM/encode.js +140 -132
- package/lib/WAM/index.js +4 -31
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +21 -23
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +9 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +7 -7
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +10 -10
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +7 -7
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +11 -12
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +4 -5
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +7 -7
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +7 -8
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +7 -7
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +8 -8
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +7 -7
- package/lib/WAUSync/Protocols/index.js +12 -39
- package/lib/WAUSync/USyncQuery.js +67 -49
- package/lib/WAUSync/USyncUser.js +11 -5
- package/lib/WAUSync/index.js +3 -31
- package/lib/index.js +15 -48
- package/package.json +129 -99
- package/LICENSE +0 -21
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Socket/aigroups.js +0 -240
- package/lib/Socket/interactive-handler.js +0 -522
- package/lib/Socket/managed-account.js +0 -183
- package/lib/Socket/registration.js +0 -427
- package/lib/Socket/text-router.js +0 -83
- package/lib/Types/Newsletter.js +0 -121
- package/lib/Utils/command-loader.d.ts +0 -31
- package/lib/Utils/command-loader.js +0 -100
- package/lib/Utils/consumer-application.js +0 -107
- package/lib/Utils/curve25519-js.js +0 -275
- package/lib/Utils/group-history.js +0 -60
- package/lib/Utils/jid-display-normalization.js +0 -218
- package/lib/Utils/meta-ai-msmsg.js +0 -262
- 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/view-once-cache.d.ts +0 -9
- package/lib/Utils/view-once-cache.js +0 -79
- package/lib/Utils/voip-rekey.js +0 -22
- package/lib/antiban.js +0 -4637
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
class USyncPictureProtocol {
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js'
|
|
2
|
+
|
|
3
|
+
export class USyncPictureProtocol {
|
|
6
4
|
constructor(type = 'image') {
|
|
7
5
|
this.name = 'picture'
|
|
8
6
|
// "image" for full resolution, "preview" for thumbnail
|
|
9
7
|
this.type = type
|
|
10
8
|
}
|
|
9
|
+
|
|
11
10
|
getQueryElement() {
|
|
12
11
|
return {
|
|
13
12
|
tag: 'picture',
|
|
14
13
|
attrs: { type: this.type }
|
|
15
14
|
}
|
|
16
15
|
}
|
|
16
|
+
|
|
17
17
|
getUserElement(user) {
|
|
18
18
|
const attrs = {}
|
|
19
19
|
if (user.pictureId != null) attrs.id = String(user.pictureId)
|
|
20
20
|
return Object.keys(attrs).length > 0 ? { tag: 'picture', attrs } : null
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
parser(node) {
|
|
23
24
|
if (node.tag !== 'picture') return null
|
|
24
|
-
|
|
25
|
+
assertNodeErrorFree(node)
|
|
25
26
|
const id = node.attrs?.id ?? null
|
|
26
27
|
const directPath = node.attrs?.direct_path ?? null
|
|
27
28
|
const hash = node.attrs?.hash ?? null
|
|
@@ -29,4 +30,3 @@ class USyncPictureProtocol {
|
|
|
29
30
|
return { id, directPath, hash }
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
exports.USyncPictureProtocol = USyncPictureProtocol
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
class USyncSidelistProtocol {
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js'
|
|
2
|
+
|
|
3
|
+
export class USyncSidelistProtocol {
|
|
6
4
|
constructor(useLidAddressing = true) {
|
|
7
5
|
this.name = 'sidelist'
|
|
8
6
|
// When true, sends addressing_mode="lid" — required for interop/LID-mode contacts
|
|
9
7
|
this.useLidAddressing = useLidAddressing
|
|
10
8
|
}
|
|
9
|
+
|
|
11
10
|
getQueryElement() {
|
|
12
11
|
const attrs = {}
|
|
13
12
|
if (this.useLidAddressing) attrs.addressing_mode = 'lid'
|
|
14
13
|
return { tag: 'sidelist', attrs }
|
|
15
14
|
}
|
|
15
|
+
|
|
16
16
|
getUserElement(user) {
|
|
17
17
|
if (user.sidelistDelete) {
|
|
18
18
|
return { tag: 'sidelist', attrs: { type: 'delete' } }
|
|
19
19
|
}
|
|
20
20
|
return null
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
parser(node) {
|
|
23
24
|
if (node.tag !== 'sidelist' && node.tag !== 'side_list') return null
|
|
24
|
-
|
|
25
|
-
// Returns minimal parsed data; the full side_list is parsed in USyncQuery
|
|
25
|
+
assertNodeErrorFree(node)
|
|
26
26
|
return { type: node.attrs?.type ?? null }
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
exports.USyncSidelistProtocol = USyncSidelistProtocol
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
class USyncStatusProtocol {
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js'
|
|
2
|
+
|
|
3
|
+
export class USyncStatusProtocol {
|
|
6
4
|
constructor() {
|
|
7
5
|
this.name = 'status'
|
|
8
6
|
}
|
|
7
|
+
|
|
9
8
|
getQueryElement() {
|
|
10
9
|
return {
|
|
11
10
|
tag: 'status',
|
|
12
11
|
attrs: {}
|
|
13
12
|
}
|
|
14
13
|
}
|
|
14
|
+
|
|
15
15
|
getUserElement() {
|
|
16
16
|
return null
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
parser(node) {
|
|
19
20
|
if (node.tag === 'status') {
|
|
20
|
-
|
|
21
|
+
assertNodeErrorFree(node)
|
|
21
22
|
let status = node?.content?.toString() ?? null
|
|
22
23
|
const setAt = new Date(+(node?.attrs.t || 0) * 1000)
|
|
23
24
|
if (!status) {
|
|
@@ -36,4 +37,3 @@ class USyncStatusProtocol {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
|
-
exports.USyncStatusProtocol = USyncStatusProtocol
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
class USyncTextStatusProtocol {
|
|
1
|
+
import { assertNodeErrorFree, getBinaryNodeChild } from '../../WABinary/index.js'
|
|
2
|
+
|
|
3
|
+
export class USyncTextStatusProtocol {
|
|
6
4
|
constructor() {
|
|
7
5
|
this.name = 'text_status'
|
|
8
6
|
}
|
|
7
|
+
|
|
9
8
|
getQueryElement() {
|
|
10
9
|
return {
|
|
11
10
|
tag: 'text_status',
|
|
12
11
|
attrs: {}
|
|
13
12
|
}
|
|
14
13
|
}
|
|
14
|
+
|
|
15
15
|
getUserElement() {
|
|
16
16
|
return null
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
parser(node) {
|
|
19
20
|
if (node.tag !== 'text_status') return null
|
|
20
|
-
|
|
21
|
+
assertNodeErrorFree(node)
|
|
21
22
|
const lastUpdateTimeSec = node.attrs?.last_update_time ? +node.attrs.last_update_time : 0
|
|
22
23
|
const ephemeralDurationSec = node.attrs?.ephemeral_duration_sec ? +node.attrs.ephemeral_duration_sec : 0
|
|
23
24
|
const text = node.attrs?.text ?? null
|
|
24
|
-
const emojiNode =
|
|
25
|
+
const emojiNode = getBinaryNodeChild(node, 'emoji')
|
|
25
26
|
const emoji = emojiNode?.attrs?.content ?? null
|
|
26
27
|
// expiry is lastUpdateTime + ephemeralDuration (both in ms); 0 means no expiry
|
|
27
28
|
const expiresAt = ephemeralDurationSec > 0
|
|
@@ -35,4 +36,3 @@ class USyncTextStatusProtocol {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
exports.USyncTextStatusProtocol = USyncTextStatusProtocol
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WABinary_1 = require('../../WABinary')
|
|
5
|
-
class USyncUsernameProtocol {
|
|
1
|
+
import { assertNodeErrorFree } from '../../WABinary/index.js'
|
|
2
|
+
|
|
3
|
+
export class USyncUsernameProtocol {
|
|
6
4
|
constructor() {
|
|
7
5
|
this.name = 'username'
|
|
8
6
|
}
|
|
7
|
+
|
|
9
8
|
getQueryElement() {
|
|
10
9
|
return {
|
|
11
10
|
tag: 'username',
|
|
12
11
|
attrs: {}
|
|
13
12
|
}
|
|
14
13
|
}
|
|
14
|
+
|
|
15
15
|
getUserElement(user) {
|
|
16
16
|
void user
|
|
17
17
|
return null
|
|
18
18
|
}
|
|
19
|
+
|
|
19
20
|
parser(node) {
|
|
20
21
|
if (node.tag === 'username') {
|
|
21
|
-
|
|
22
|
+
assertNodeErrorFree(node)
|
|
22
23
|
return typeof node.content === 'string' ? node.content : null
|
|
23
24
|
}
|
|
24
25
|
return null
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
exports.USyncUsernameProtocol = USyncUsernameProtocol
|
|
@@ -1,39 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc)
|
|
17
|
-
}
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k
|
|
20
|
-
o[k2] = m[k]
|
|
21
|
-
})
|
|
22
|
-
var __exportStar =
|
|
23
|
-
(this && this.__exportStar) ||
|
|
24
|
-
function (m, exports) {
|
|
25
|
-
for (var p in m)
|
|
26
|
-
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
27
|
-
}
|
|
28
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
29
|
-
__exportStar(require('./USyncDeviceProtocol'), exports)
|
|
30
|
-
__exportStar(require('./USyncContactProtocol'), exports)
|
|
31
|
-
__exportStar(require('./USyncStatusProtocol'), exports)
|
|
32
|
-
__exportStar(require('./USyncDisappearingModeProtocol'), exports)
|
|
33
|
-
__exportStar(require('./USyncUsernameProtocol'), exports)
|
|
34
|
-
__exportStar(require('./USyncBotProfileProtocol'), exports)
|
|
35
|
-
__exportStar(require('./USyncBusinessProtocol'), exports)
|
|
36
|
-
__exportStar(require('./USyncPictureProtocol'), exports)
|
|
37
|
-
__exportStar(require('./USyncTextStatusProtocol'), exports)
|
|
38
|
-
__exportStar(require('./USyncSidelistProtocol'), exports)
|
|
39
|
-
__exportStar(require('./USyncFeatureProtocol'), exports)
|
|
1
|
+
export * from './USyncDeviceProtocol.js'
|
|
2
|
+
export * from './USyncContactProtocol.js'
|
|
3
|
+
export * from './USyncStatusProtocol.js'
|
|
4
|
+
export * from './USyncDisappearingModeProtocol.js'
|
|
5
|
+
export * from './USyncUsernameProtocol.js'
|
|
6
|
+
export * from './USyncBotProfileProtocol.js'
|
|
7
|
+
export * from './USyncLIDProtocol.js'
|
|
8
|
+
export * from './USyncBusinessProtocol.js'
|
|
9
|
+
export * from './USyncPictureProtocol.js'
|
|
10
|
+
export * from './USyncTextStatusProtocol.js'
|
|
11
|
+
export * from './USyncSidelistProtocol.js'
|
|
12
|
+
export * from './USyncFeatureProtocol.js'
|
|
@@ -1,133 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { getBinaryNodeChild } from '../WABinary/index.js'
|
|
2
|
+
import { USyncBotProfileProtocol } from './Protocols/USyncBotProfileProtocol.js'
|
|
3
|
+
import { USyncLIDProtocol } from './Protocols/USyncLIDProtocol.js'
|
|
4
|
+
import { USyncBusinessProtocol } from './Protocols/USyncBusinessProtocol.js'
|
|
5
|
+
import { USyncPictureProtocol } from './Protocols/USyncPictureProtocol.js'
|
|
6
|
+
import { USyncTextStatusProtocol } from './Protocols/USyncTextStatusProtocol.js'
|
|
7
|
+
import { USyncSidelistProtocol } from './Protocols/USyncSidelistProtocol.js'
|
|
8
|
+
import { USyncFeatureProtocol } from './Protocols/USyncFeatureProtocol.js'
|
|
9
|
+
import {
|
|
10
|
+
USyncContactProtocol,
|
|
11
|
+
USyncDeviceProtocol,
|
|
12
|
+
USyncDisappearingModeProtocol,
|
|
13
|
+
USyncStatusProtocol,
|
|
14
|
+
USyncUsernameProtocol
|
|
15
|
+
} from './Protocols/index.js'
|
|
16
|
+
|
|
17
|
+
export class USyncQuery {
|
|
14
18
|
constructor() {
|
|
15
19
|
this.protocols = []
|
|
16
20
|
this.users = []
|
|
17
21
|
this.context = 'interactive'
|
|
18
22
|
this.mode = 'query'
|
|
19
23
|
}
|
|
24
|
+
|
|
20
25
|
withMode(mode) {
|
|
21
26
|
this.mode = mode
|
|
22
27
|
return this
|
|
23
28
|
}
|
|
29
|
+
|
|
24
30
|
withContext(context) {
|
|
25
31
|
this.context = context
|
|
26
32
|
return this
|
|
27
33
|
}
|
|
34
|
+
|
|
28
35
|
withUser(user) {
|
|
29
36
|
this.users.push(user)
|
|
30
37
|
return this
|
|
31
38
|
}
|
|
39
|
+
|
|
32
40
|
parseUSyncQueryResult(result) {
|
|
33
|
-
if (
|
|
41
|
+
if (result?.attrs.type !== 'result') {
|
|
34
42
|
return
|
|
35
43
|
}
|
|
36
44
|
const protocolMap = Object.fromEntries(
|
|
37
|
-
this.protocols.map(protocol =>
|
|
38
|
-
return [protocol.name, protocol.parser]
|
|
39
|
-
})
|
|
45
|
+
this.protocols.map(protocol => [protocol.name, protocol.parser])
|
|
40
46
|
)
|
|
41
47
|
const queryResult = {
|
|
42
|
-
// TODO: implement errors etc.
|
|
43
48
|
list: [],
|
|
44
49
|
sideList: []
|
|
45
50
|
}
|
|
46
|
-
const usyncNode =
|
|
47
|
-
|
|
48
|
-
//TODO: see if there are any errors in the result node
|
|
49
|
-
//const resultNode = getBinaryNodeChild(usyncNode, 'result')
|
|
51
|
+
const usyncNode = getBinaryNodeChild(result, 'usync')
|
|
52
|
+
|
|
50
53
|
const parseUserNodes = nodes => {
|
|
51
54
|
return nodes.reduce((acc, node) => {
|
|
52
55
|
const id = node?.attrs.jid
|
|
53
56
|
if (id) {
|
|
54
57
|
const data = Array.isArray(node?.content)
|
|
55
58
|
? Object.fromEntries(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
59
|
+
node.content.map(content => {
|
|
60
|
+
const protocol = content.tag
|
|
61
|
+
const parser = protocolMap[protocol]
|
|
62
|
+
if (!parser) {
|
|
63
|
+
return [protocol, null]
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return [protocol, parser(content)]
|
|
67
|
+
} catch (err) {
|
|
68
|
+
return [protocol, null]
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
)
|
|
68
72
|
: {}
|
|
69
73
|
acc.push({ ...data, id })
|
|
70
74
|
}
|
|
71
75
|
return acc
|
|
72
76
|
}, [])
|
|
73
77
|
}
|
|
74
|
-
|
|
78
|
+
|
|
79
|
+
const listNode = usyncNode ? getBinaryNodeChild(usyncNode, 'list') : undefined
|
|
75
80
|
if (listNode?.content && Array.isArray(listNode.content)) {
|
|
76
81
|
queryResult.list = parseUserNodes(listNode.content)
|
|
77
82
|
}
|
|
78
|
-
|
|
83
|
+
|
|
84
|
+
const sideListNode = usyncNode ? getBinaryNodeChild(usyncNode, 'side_list') : undefined
|
|
79
85
|
if (sideListNode?.content && Array.isArray(sideListNode.content)) {
|
|
80
86
|
queryResult.sideList = parseUserNodes(sideListNode.content)
|
|
81
87
|
}
|
|
88
|
+
|
|
82
89
|
return queryResult
|
|
83
90
|
}
|
|
91
|
+
|
|
84
92
|
withDeviceProtocol() {
|
|
85
|
-
this.protocols.push(new
|
|
93
|
+
this.protocols.push(new USyncDeviceProtocol())
|
|
86
94
|
return this
|
|
87
95
|
}
|
|
96
|
+
|
|
88
97
|
withContactProtocol() {
|
|
89
|
-
this.protocols.push(new
|
|
98
|
+
this.protocols.push(new USyncContactProtocol())
|
|
90
99
|
return this
|
|
91
100
|
}
|
|
101
|
+
|
|
92
102
|
withStatusProtocol() {
|
|
93
|
-
this.protocols.push(new
|
|
103
|
+
this.protocols.push(new USyncStatusProtocol())
|
|
94
104
|
return this
|
|
95
105
|
}
|
|
106
|
+
|
|
96
107
|
withDisappearingModeProtocol() {
|
|
97
|
-
this.protocols.push(new
|
|
108
|
+
this.protocols.push(new USyncDisappearingModeProtocol())
|
|
98
109
|
return this
|
|
99
110
|
}
|
|
111
|
+
|
|
100
112
|
withBotProfileProtocol() {
|
|
101
|
-
this.protocols.push(new
|
|
113
|
+
this.protocols.push(new USyncBotProfileProtocol())
|
|
102
114
|
return this
|
|
103
115
|
}
|
|
116
|
+
|
|
104
117
|
withLIDProtocol() {
|
|
105
|
-
this.protocols.push(new
|
|
118
|
+
this.protocols.push(new USyncLIDProtocol())
|
|
106
119
|
return this
|
|
107
120
|
}
|
|
121
|
+
|
|
108
122
|
withUsernameProtocol() {
|
|
109
|
-
this.protocols.push(new
|
|
123
|
+
this.protocols.push(new USyncUsernameProtocol())
|
|
110
124
|
return this
|
|
111
125
|
}
|
|
126
|
+
|
|
112
127
|
withBusinessProtocol(profileVersion) {
|
|
113
|
-
this.protocols.push(new
|
|
128
|
+
this.protocols.push(new USyncBusinessProtocol(profileVersion))
|
|
114
129
|
return this
|
|
115
130
|
}
|
|
131
|
+
|
|
116
132
|
withPictureProtocol(type) {
|
|
117
|
-
this.protocols.push(new
|
|
133
|
+
this.protocols.push(new USyncPictureProtocol(type))
|
|
118
134
|
return this
|
|
119
135
|
}
|
|
136
|
+
|
|
120
137
|
withTextStatusProtocol() {
|
|
121
|
-
this.protocols.push(new
|
|
138
|
+
this.protocols.push(new USyncTextStatusProtocol())
|
|
122
139
|
return this
|
|
123
140
|
}
|
|
141
|
+
|
|
124
142
|
withSidelistProtocol(useLidAddressing) {
|
|
125
|
-
this.protocols.push(new
|
|
143
|
+
this.protocols.push(new USyncSidelistProtocol(useLidAddressing))
|
|
126
144
|
return this
|
|
127
145
|
}
|
|
146
|
+
|
|
128
147
|
withFeatureProtocol(features) {
|
|
129
|
-
this.protocols.push(new
|
|
148
|
+
this.protocols.push(new USyncFeatureProtocol(features))
|
|
130
149
|
return this
|
|
131
150
|
}
|
|
132
151
|
}
|
|
133
|
-
exports.USyncQuery = USyncQuery
|
package/lib/WAUSync/USyncUser.js
CHANGED
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
3
|
-
exports.USyncUser = void 0
|
|
4
|
-
class USyncUser {
|
|
1
|
+
export class USyncUser {
|
|
5
2
|
withId(id) {
|
|
6
3
|
this.id = id
|
|
7
4
|
return this
|
|
8
5
|
}
|
|
6
|
+
|
|
9
7
|
withLid(lid) {
|
|
10
8
|
this.lid = lid
|
|
11
9
|
return this
|
|
12
10
|
}
|
|
11
|
+
|
|
13
12
|
withPhone(phone) {
|
|
14
13
|
this.phone = phone
|
|
15
14
|
return this
|
|
16
15
|
}
|
|
16
|
+
|
|
17
17
|
withUsername(username) {
|
|
18
18
|
this.username = username
|
|
19
19
|
return this
|
|
20
20
|
}
|
|
21
|
+
|
|
21
22
|
withUsernameKey(usernameKey) {
|
|
22
23
|
this.usernameKey = usernameKey
|
|
23
24
|
return this
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
withType(type) {
|
|
26
28
|
this.type = type
|
|
27
29
|
return this
|
|
28
30
|
}
|
|
31
|
+
|
|
29
32
|
withPersonaId(personaId) {
|
|
30
33
|
this.personaId = personaId
|
|
31
34
|
return this
|
|
32
35
|
}
|
|
36
|
+
|
|
33
37
|
withPictureId(pictureId) {
|
|
34
38
|
this.pictureId = pictureId
|
|
35
39
|
return this
|
|
36
40
|
}
|
|
41
|
+
|
|
37
42
|
withVerifiedNameSerial(serial) {
|
|
38
43
|
this.verifiedNameSerial = serial
|
|
39
44
|
return this
|
|
40
45
|
}
|
|
46
|
+
|
|
41
47
|
withBusinessProfileTag(tag) {
|
|
42
48
|
this.businessProfileTag = tag
|
|
43
49
|
return this
|
|
44
50
|
}
|
|
51
|
+
|
|
45
52
|
withSidelistDelete(del = true) {
|
|
46
53
|
this.sidelistDelete = del
|
|
47
54
|
return this
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
|
-
exports.USyncUser = USyncUser
|
package/lib/WAUSync/index.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(Object.create
|
|
5
|
-
? function (o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k)
|
|
8
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return m[k]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc)
|
|
17
|
-
}
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k
|
|
20
|
-
o[k2] = m[k]
|
|
21
|
-
})
|
|
22
|
-
var __exportStar =
|
|
23
|
-
(this && this.__exportStar) ||
|
|
24
|
-
function (m, exports) {
|
|
25
|
-
for (var p in m)
|
|
26
|
-
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
27
|
-
}
|
|
28
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
29
|
-
__exportStar(require('./Protocols/index'), exports)
|
|
30
|
-
__exportStar(require('./USyncQuery'), exports)
|
|
31
|
-
__exportStar(require('./USyncUser'), exports)
|
|
1
|
+
export * from './Protocols/index.js'
|
|
2
|
+
export * from './USyncQuery.js'
|
|
3
|
+
export * from './USyncUser.js'
|
package/lib/index.js
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(this && this.__createBinding) ||
|
|
4
|
-
(Object.create
|
|
5
|
-
? function (o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k)
|
|
8
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return m[k]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc)
|
|
17
|
-
}
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k
|
|
20
|
-
o[k2] = m[k]
|
|
21
|
-
})
|
|
22
|
-
var __exportStar =
|
|
23
|
-
(this && this.__exportStar) ||
|
|
24
|
-
function (m, exports) {
|
|
25
|
-
for (var p in m)
|
|
26
|
-
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
27
|
-
}
|
|
28
|
-
var __importDefault =
|
|
29
|
-
(this && this.__importDefault) ||
|
|
30
|
-
function (mod) {
|
|
31
|
-
return mod && mod.__esModule ? mod : { default: mod }
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
34
|
-
exports.makeWASocket = void 0
|
|
35
|
-
const chalk = require('chalk')
|
|
1
|
+
import makeWASocket from './Socket/index.js';
|
|
2
|
+
import chalk from "chalk";
|
|
36
3
|
console.log(chalk.bold.gray("-----------------------------------------\n"));
|
|
37
4
|
console.log(chalk.bold.cyan(`
|
|
38
5
|
⠀⠀⣠⠂⢀⣠⡴⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢤⣄⠀⠐⣄⠀⠀⠀
|
|
@@ -57,20 +24,20 @@ console.log(chalk.bold.cyan(`
|
|
|
57
24
|
¤═―— ⎧ 𝐁𝐀𝐃𝐙𝐙 𝐁𝐀𝐈𝐋𝐄𝐘𝐒 ⎭ ⊱―—═¤
|
|
58
25
|
Information:
|
|
59
26
|
Developer: @badzzne2
|
|
60
|
-
Version:
|
|
27
|
+
Version: 13.0
|
|
61
28
|
Status: Baileys Berhasil Terinstall
|
|
62
|
-
Update date:
|
|
29
|
+
Update date: 31/08/26
|
|
63
30
|
`));
|
|
64
31
|
console.log(chalk.bold.cyan("Follow Our Telegram Channel To See Update Information: t.me/FoxsSql\n"));
|
|
65
32
|
console.log(chalk.bold.gray("--------------------------------------------\n"));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
33
|
+
export * from '../WAProto/index.js';
|
|
34
|
+
export * from './Utils/index.js';
|
|
35
|
+
export * from './Types/index.js';
|
|
36
|
+
export * from './Defaults/index.js';
|
|
37
|
+
export * from './WABinary/index.js';
|
|
38
|
+
export * from './WAM/index.js';
|
|
39
|
+
export * from './WAUSync/index.js';
|
|
40
|
+
export * from './Store/index.js';
|
|
41
|
+
export { makeWASocket };
|
|
42
|
+
export default makeWASocket;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|