vialeys 0.0.1 → 0.0.2
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 +11 -5
- package/WAProto/AICommon/AICommon.js +13991 -9169
- package/WAProto/AICommon/AICommon.proto +110 -3
- package/WAProto/CompanionReg/CompanionReg.js +114 -0
- package/WAProto/CompanionReg/CompanionReg.proto +3 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.js +652 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +19 -0
- package/WAProto/E2E/E2E.js +77193 -51248
- package/WAProto/E2E/E2E.proto +68 -12
- package/WAProto/HistorySync/HistorySync.js +3375 -178
- package/WAProto/HistorySync/HistorySync.proto +3 -3
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +98 -49
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +2 -2
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +75226 -48422
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +6 -0
- package/WAProto/StatusAttributions/StatusAttributions.js +21 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +3 -0
- package/WAProto/SyncAction/SyncAction.js +9423 -2023
- package/WAProto/SyncAction/SyncAction.proto +208 -15
- package/WAProto/Wa6/Wa6.js +83 -0
- package/WAProto/Wa6/Wa6.proto +3 -0
- package/WAProto/Web/Web.js +92664 -63403
- package/WAProto/Web/Web.proto +31 -13
- package/engine-requirements.js +9 -7
- package/lib/Defaults/baileys-version.json +2 -2
- package/lib/Defaults/connection.js +51 -0
- package/lib/Defaults/constants.js +62 -0
- package/lib/Defaults/history.js +17 -0
- package/lib/Defaults/index.js +36 -142
- package/lib/Defaults/media.js +48 -0
- package/lib/Defaults/prefix.js +18 -0
- package/lib/Signal/Group/group-session-builder.js +10 -42
- package/lib/Signal/Group/group_cipher.js +9 -6
- package/lib/Signal/Group/index.js +39 -53
- package/lib/Signal/Group/keyhelper.js +8 -41
- package/lib/Signal/Group/sender-chain-key.js +4 -4
- package/lib/Signal/Group/sender-key-distribution-message.js +5 -5
- package/lib/Signal/Group/sender-key-message.js +12 -8
- package/lib/Signal/Group/sender-key-state.js +4 -4
- package/lib/Signal/Group/sender-message-key.js +2 -2
- package/lib/Signal/libsignal.js +45 -69
- package/lib/Signal/lid-mapping.js +15 -11
- package/lib/Socket/Client/types.js +2 -2
- package/lib/Socket/Client/websocket.js +16 -14
- package/lib/Socket/business.js +41 -32
- package/lib/Socket/chats.js +123 -98
- package/lib/Socket/community.js +50 -40
- package/lib/Socket/groups.js +59 -47
- package/lib/Socket/index.js +4 -4
- package/lib/Socket/messages-recv.js +226 -171
- package/lib/Socket/messages-send.js +187 -143
- package/lib/Socket/newsletter.js +61 -47
- package/lib/Socket/socket.js +133 -90
- package/lib/Socket/usync.js +6 -6
- package/lib/Store/index.js +27 -11
- package/lib/Store/make-cache-manager-store.js +14 -15
- package/lib/Store/make-in-memory-store.js +28 -24
- package/lib/Types/LabelAssociation.js +2 -2
- package/lib/Types/Message.js +6 -6
- package/lib/Types/MexUpdates.js +5 -4
- package/lib/Types/State.js +4 -4
- package/lib/Types/index.js +28 -12
- package/lib/Utils/auth-utils.js +28 -26
- package/lib/Utils/baileys-event-stream.js +68 -69
- package/lib/Utils/business.js +63 -53
- package/lib/Utils/chat-utils.js +81 -71
- package/lib/Utils/crypto.js +25 -45
- package/lib/Utils/decode-wa-message.js +319 -311
- package/lib/Utils/event-buffer.js +21 -22
- package/lib/Utils/generics.js +103 -73
- package/lib/Utils/history.js +21 -21
- package/lib/Utils/index.js +27 -13
- package/lib/Utils/link-preview.js +7 -30
- package/lib/Utils/logger.js +5 -5
- package/lib/Utils/lt-hash.js +3 -3
- package/lib/Utils/message-retry-manager.js +4 -4
- package/lib/Utils/messages-media.js +104 -109
- package/lib/Utils/messages.js +203 -171
- package/lib/Utils/noise-handler.js +28 -19
- package/lib/Utils/process-message.js +370 -136
- package/lib/Utils/signal.js +36 -25
- package/lib/Utils/use-multi-file-auth-state.js +18 -22
- package/lib/Utils/validate-connection.js +52 -45
- package/lib/WABinary/decode.js +6 -32
- package/lib/WABinary/encode.js +3 -29
- package/lib/WABinary/generic-utils.js +4 -4
- package/lib/WABinary/index.js +27 -11
- package/lib/WAM/encode.js +16 -8
- package/lib/WAM/index.js +27 -11
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +20 -16
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +7 -4
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +0 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +2 -2
- package/lib/WAUSync/Protocols/index.js +27 -11
- package/lib/WAUSync/USyncQuery.js +17 -10
- package/lib/WAUSync/index.js +27 -11
- package/lib/index.js +62 -37
- package/package.json +1 -1
- package/WAProto/index.d.ts +0 -55
- package/lib/index.d.ts +0 -13
package/lib/WAM/encode.js
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const {
|
|
6
|
+
FLAG_BYTE,
|
|
7
|
+
FLAG_EVENT,
|
|
8
|
+
FLAG_EXTENDED,
|
|
9
|
+
FLAG_FIELD,
|
|
10
|
+
FLAG_GLOBAL,
|
|
11
|
+
WEB_EVENTS,
|
|
12
|
+
WEB_GLOBALS
|
|
13
|
+
} = require("./constants")
|
|
6
14
|
const getHeaderBitLength = (key) => (key < 256 ? 2 : 3)
|
|
7
15
|
|
|
8
16
|
const encodeWAM = (binaryInfo) => {
|
|
@@ -33,25 +41,25 @@ function encodeWAMHeader(binaryInfo) {
|
|
|
33
41
|
|
|
34
42
|
function encodeGlobalAttributes(binaryInfo, globals) {
|
|
35
43
|
for (const [key, _value] of Object.entries(globals)) {
|
|
36
|
-
const id =
|
|
44
|
+
const id = WEB_GLOBALS.find(a => a?.name === key)?.id
|
|
37
45
|
let value = _value
|
|
38
46
|
if (typeof value === 'boolean') {
|
|
39
47
|
value = value ? 1 : 0
|
|
40
48
|
}
|
|
41
|
-
binaryInfo.buffer.push(serializeData(id, value,
|
|
49
|
+
binaryInfo.buffer.push(serializeData(id, value, FLAG_GLOBAL))
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
function encodeEvents(binaryInfo) {
|
|
46
54
|
for (const [name, { props, globals },] of binaryInfo.events.map((a) => Object.entries(a)[0])) {
|
|
47
55
|
encodeGlobalAttributes(binaryInfo, globals)
|
|
48
|
-
const event =
|
|
56
|
+
const event = WEB_EVENTS.find((a) => a.name === name)
|
|
49
57
|
const props_ = Object.entries(props)
|
|
50
58
|
let extended = false
|
|
51
59
|
for (const [, value] of props_) {
|
|
52
60
|
extended || (extended = value !== null)
|
|
53
61
|
}
|
|
54
|
-
const eventFlag = extended ?
|
|
62
|
+
const eventFlag = extended ? FLAG_EVENT : FLAG_EVENT | FLAG_EXTENDED
|
|
55
63
|
binaryInfo.buffer.push(serializeData(event.id, -event.weight, eventFlag))
|
|
56
64
|
for (let i = 0; i < props_.length; i++) {
|
|
57
65
|
const [key, _value] = props_[i]
|
|
@@ -61,7 +69,7 @@ function encodeEvents(binaryInfo) {
|
|
|
61
69
|
if (typeof value === 'boolean') {
|
|
62
70
|
value = value ? 1 : 0
|
|
63
71
|
}
|
|
64
|
-
const fieldFlag = extended ?
|
|
72
|
+
const fieldFlag = extended ? FLAG_EVENT : FLAG_FIELD | FLAG_EXTENDED
|
|
65
73
|
binaryInfo.buffer.push(serializeData(id, value, fieldFlag))
|
|
66
74
|
}
|
|
67
75
|
}
|
|
@@ -72,7 +80,7 @@ function serializeData(key, value, flag) {
|
|
|
72
80
|
let buffer
|
|
73
81
|
let offset = 0
|
|
74
82
|
if (value === null) {
|
|
75
|
-
if (flag ===
|
|
83
|
+
if (flag === FLAG_GLOBAL) {
|
|
76
84
|
buffer = Buffer.alloc(bufferLength)
|
|
77
85
|
offset = serializeHeader(buffer, offset, key, flag)
|
|
78
86
|
return buffer
|
|
@@ -151,7 +159,7 @@ function serializeHeader(buffer, offset, key, flag) {
|
|
|
151
159
|
offset += 1
|
|
152
160
|
}
|
|
153
161
|
else {
|
|
154
|
-
buffer.writeUInt8(flag |
|
|
162
|
+
buffer.writeUInt8(flag | FLAG_BYTE, offset)
|
|
155
163
|
offset += 1
|
|
156
164
|
buffer.writeUInt16LE(key, offset)
|
|
157
165
|
offset += 2
|
package/lib/WAM/index.js
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
let desc = Object.getOwnPropertyDescriptor(m, k)
|
|
7
|
+
|
|
6
8
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return m[k]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
|
-
Object.defineProperty(o, k2, desc)
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k
|
|
12
|
-
o[k2] = m[k]
|
|
13
|
-
}))
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
Object.defineProperty(o, k2, desc)
|
|
18
|
+
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k
|
|
21
|
+
o[k2] = m[k]
|
|
22
|
+
}
|
|
23
|
+
))
|
|
24
|
+
|
|
25
|
+
const __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) {
|
|
27
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) {
|
|
28
|
+
__createBinding(exports, m, p)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
}
|
|
18
32
|
|
|
19
|
-
Object.defineProperty(exports, "__esModule", {
|
|
33
|
+
Object.defineProperty(exports, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
})
|
|
20
36
|
|
|
21
37
|
__exportStar(require("./constants"), exports)
|
|
22
38
|
__exportStar(require("./encode"), exports)
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const {
|
|
6
|
+
getBinaryNodeChild,
|
|
7
|
+
getBinaryNodeChildren,
|
|
8
|
+
getBinaryNodeChildString
|
|
9
|
+
} = require("../../WABinary")
|
|
6
10
|
|
|
7
11
|
class USyncBotProfileProtocol {
|
|
8
12
|
constructor() {
|
|
@@ -23,41 +27,41 @@ class USyncBotProfileProtocol {
|
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
parser(node) {
|
|
26
|
-
const botNode =
|
|
27
|
-
const profile =
|
|
30
|
+
const botNode = getBinaryNodeChild(node, 'bot')
|
|
31
|
+
const profile = getBinaryNodeChild(botNode, 'profile')
|
|
28
32
|
|
|
29
|
-
const commandsNode =
|
|
30
|
-
const promptsNode =
|
|
33
|
+
const commandsNode = getBinaryNodeChild(profile, 'commands')
|
|
34
|
+
const promptsNode = getBinaryNodeChild(profile, 'prompts')
|
|
31
35
|
|
|
32
36
|
const commands = []
|
|
33
37
|
const prompts = []
|
|
34
38
|
|
|
35
39
|
if (commandsNode) {
|
|
36
|
-
for (const command of
|
|
40
|
+
for (const command of getBinaryNodeChildren(commandsNode, 'command')) {
|
|
37
41
|
commands.push({
|
|
38
|
-
name:
|
|
39
|
-
description:
|
|
42
|
+
name: getBinaryNodeChildString(command, 'name') || '',
|
|
43
|
+
description: getBinaryNodeChildString(command, 'description') || ''
|
|
40
44
|
})
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
if (promptsNode) {
|
|
45
|
-
for (const prompt of
|
|
49
|
+
for (const prompt of getBinaryNodeChildren(promptsNode, 'prompt')) {
|
|
46
50
|
prompts.push(
|
|
47
|
-
`${
|
|
51
|
+
`${getBinaryNodeChildString(prompt, 'emoji') || ''} ${getBinaryNodeChildString(prompt, 'text') || ''}`
|
|
48
52
|
)
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
return {
|
|
53
|
-
isDefault: !!
|
|
57
|
+
isDefault: !!getBinaryNodeChild(profile, 'default'),
|
|
54
58
|
jid: node.attrs.jid,
|
|
55
|
-
name:
|
|
56
|
-
attributes:
|
|
57
|
-
description:
|
|
58
|
-
category:
|
|
59
|
+
name: getBinaryNodeChildString(profile, 'name') || '',
|
|
60
|
+
attributes: getBinaryNodeChildString(profile, 'attributes') || '',
|
|
61
|
+
description: getBinaryNodeChildString(profile, 'description') || '',
|
|
62
|
+
category: getBinaryNodeChildString(profile, 'category') || '',
|
|
59
63
|
personaId: profile.attrs['persona_id'] || '',
|
|
60
|
-
commandsDescription:
|
|
64
|
+
commandsDescription: getBinaryNodeChildString(commandsNode, 'description') || '',
|
|
61
65
|
commands,
|
|
62
66
|
prompts
|
|
63
67
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const { assertNodeErrorFree } = require("../../WABinary")
|
|
6
6
|
|
|
7
7
|
class USyncContactProtocol {
|
|
8
8
|
constructor() {
|
|
@@ -24,7 +24,7 @@ class USyncContactProtocol {
|
|
|
24
24
|
}
|
|
25
25
|
parser(node) {
|
|
26
26
|
if (node.tag === 'contact') {
|
|
27
|
-
|
|
27
|
+
assertNodeErrorFree(node)
|
|
28
28
|
return node?.attrs?.type === 'in'
|
|
29
29
|
}
|
|
30
30
|
return false
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const {
|
|
6
|
+
getBinaryNodeChild,
|
|
7
|
+
assertNodeErrorFree
|
|
8
|
+
} = require("../../WABinary")
|
|
6
9
|
|
|
7
10
|
class USyncDeviceProtocol {
|
|
8
11
|
constructor() {
|
|
@@ -26,9 +29,9 @@ class USyncDeviceProtocol {
|
|
|
26
29
|
const deviceList = []
|
|
27
30
|
let keyIndex = undefined
|
|
28
31
|
if (node.tag === 'devices') {
|
|
29
|
-
|
|
30
|
-
const deviceListNode =
|
|
31
|
-
const keyIndexNode =
|
|
32
|
+
assertNodeErrorFree(node)
|
|
33
|
+
const deviceListNode = getBinaryNodeChild(node, 'device-list')
|
|
34
|
+
const keyIndexNode = getBinaryNodeChild(node, 'key-index-list')
|
|
32
35
|
if (Array.isArray(deviceListNode?.content)) {
|
|
33
36
|
for (const { tag, attrs } of deviceListNode.content) {
|
|
34
37
|
const id = +attrs.id
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const { assertNodeErrorFree } = require("../../WABinary")
|
|
6
6
|
|
|
7
7
|
class USyncDisappearingModeProtocol {
|
|
8
8
|
constructor() {
|
|
@@ -19,7 +19,7 @@ class USyncDisappearingModeProtocol {
|
|
|
19
19
|
}
|
|
20
20
|
parser(node) {
|
|
21
21
|
if (node.tag === 'disappearing_mode') {
|
|
22
|
-
|
|
22
|
+
assertNodeErrorFree(node)
|
|
23
23
|
const duration = +node?.attrs?.duration
|
|
24
24
|
const setAt = new Date(+(node?.attrs?.t || 0) * 1000)
|
|
25
25
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const { assertNodeErrorFree } = require("../../WABinary")
|
|
6
6
|
|
|
7
7
|
class USyncStatusProtocol {
|
|
8
8
|
constructor() {
|
|
@@ -19,7 +19,7 @@ class USyncStatusProtocol {
|
|
|
19
19
|
}
|
|
20
20
|
parser(node) {
|
|
21
21
|
if (node.tag === 'status') {
|
|
22
|
-
|
|
22
|
+
assertNodeErrorFree(node)
|
|
23
23
|
let status = node?.content?.toString() || null
|
|
24
24
|
const setAt = new Date(+(node?.attrs?.t || 0) * 1000)
|
|
25
25
|
if (!status) {
|
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
let desc = Object.getOwnPropertyDescriptor(m, k)
|
|
7
|
+
|
|
6
8
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return m[k]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
|
-
Object.defineProperty(o, k2, desc)
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k
|
|
12
|
-
o[k2] = m[k]
|
|
13
|
-
}))
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
Object.defineProperty(o, k2, desc)
|
|
18
|
+
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k
|
|
21
|
+
o[k2] = m[k]
|
|
22
|
+
}
|
|
23
|
+
))
|
|
24
|
+
|
|
25
|
+
const __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) {
|
|
27
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) {
|
|
28
|
+
__createBinding(exports, m, p)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
}
|
|
18
32
|
|
|
19
|
-
Object.defineProperty(exports, "__esModule", {
|
|
33
|
+
Object.defineProperty(exports, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
})
|
|
20
36
|
|
|
21
37
|
__exportStar(require("./USyncBotProfileProtocol"), exports)
|
|
22
38
|
__exportStar(require("./USyncContactProtocol"), exports)
|
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const { getBinaryNodeChild } = require("../WABinary")
|
|
6
|
+
const {
|
|
7
|
+
USyncLIDProtocol,
|
|
8
|
+
USyncDeviceProtocol,
|
|
9
|
+
USyncContactProtocol,
|
|
10
|
+
USyncStatusProtocol,
|
|
11
|
+
USyncBotProfileProtocol,
|
|
12
|
+
USyncDisappearingModeProtocol
|
|
13
|
+
} = require("./Protocols")
|
|
7
14
|
|
|
8
15
|
class USyncQuery {
|
|
9
16
|
constructor() {
|
|
@@ -36,11 +43,11 @@ class USyncQuery {
|
|
|
36
43
|
list: [],
|
|
37
44
|
sideList: [],
|
|
38
45
|
}
|
|
39
|
-
const usyncNode =
|
|
46
|
+
const usyncNode = getBinaryNodeChild(result, 'usync')
|
|
40
47
|
//TODO: implement error backoff, refresh etc.
|
|
41
48
|
//TODO: see if there are any errors in the result node
|
|
42
49
|
//const resultNode = getBinaryNodeChild(usyncNode, 'result')
|
|
43
|
-
const listNode =
|
|
50
|
+
const listNode = getBinaryNodeChild(usyncNode, 'list')
|
|
44
51
|
if (Array.isArray(listNode?.content) && typeof listNode !== 'undefined') {
|
|
45
52
|
queryResult.list = listNode.content.map((node) => {
|
|
46
53
|
const id = node?.attrs?.jid
|
|
@@ -62,27 +69,27 @@ class USyncQuery {
|
|
|
62
69
|
return queryResult
|
|
63
70
|
}
|
|
64
71
|
withLIDProtocol() {
|
|
65
|
-
this.protocols.push(new
|
|
72
|
+
this.protocols.push(new USyncLIDProtocol())
|
|
66
73
|
return this
|
|
67
74
|
}
|
|
68
75
|
withDeviceProtocol() {
|
|
69
|
-
this.protocols.push(new
|
|
76
|
+
this.protocols.push(new USyncDeviceProtocol())
|
|
70
77
|
return this
|
|
71
78
|
}
|
|
72
79
|
withContactProtocol() {
|
|
73
|
-
this.protocols.push(new
|
|
80
|
+
this.protocols.push(new USyncContactProtocol())
|
|
74
81
|
return this
|
|
75
82
|
}
|
|
76
83
|
withStatusProtocol() {
|
|
77
|
-
this.protocols.push(new
|
|
84
|
+
this.protocols.push(new USyncStatusProtocol())
|
|
78
85
|
return this
|
|
79
86
|
}
|
|
80
87
|
withBotProfileProtocol() {
|
|
81
|
-
this.protocols.push(new
|
|
88
|
+
this.protocols.push(new USyncBotProfileProtocol())
|
|
82
89
|
return this
|
|
83
90
|
}
|
|
84
91
|
withDisappearingModeProtocol() {
|
|
85
|
-
this.protocols.push(new
|
|
92
|
+
this.protocols.push(new USyncDisappearingModeProtocol())
|
|
86
93
|
return this
|
|
87
94
|
}
|
|
88
95
|
}
|
package/lib/WAUSync/index.js
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
let desc = Object.getOwnPropertyDescriptor(m, k)
|
|
7
|
+
|
|
6
8
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return m[k]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
|
-
Object.defineProperty(o, k2, desc)
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k
|
|
12
|
-
o[k2] = m[k]
|
|
13
|
-
}))
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
Object.defineProperty(o, k2, desc)
|
|
18
|
+
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k
|
|
21
|
+
o[k2] = m[k]
|
|
22
|
+
}
|
|
23
|
+
))
|
|
24
|
+
|
|
25
|
+
const __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) {
|
|
27
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) {
|
|
28
|
+
__createBinding(exports, m, p)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
}
|
|
18
32
|
|
|
19
|
-
Object.defineProperty(exports, "__esModule", {
|
|
33
|
+
Object.defineProperty(exports, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
})
|
|
20
36
|
|
|
21
37
|
__exportStar(require("./Protocols"), exports)
|
|
22
38
|
__exportStar(require("./USyncQuery"), exports)
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
console.log(`
|
|
3
|
-
░█░█░▀█▀░█▀█░█░░░█▀▀░█░█░█▀▀
|
|
4
|
-
░▀▄▀░░█░░█▀█░█░░░█▀▀░░█░░▀▀█
|
|
5
|
-
░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀░░▀░░▀▀▀
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
console.log(`
|
|
4
|
+
> VIALEYS | Modified Baileys
|
|
5
|
+
> Thanks for using this Framework!
|
|
6
|
+
`.split('\n').map(line =>
|
|
10
7
|
line.split('').map((ch, i, arr) => {
|
|
11
8
|
const t = i / (arr.length-1 || 1);
|
|
12
9
|
const r = Math.round(255 + (0-255)*t);
|
|
@@ -15,35 +12,63 @@ Thanks for using this modified Baileys!
|
|
|
15
12
|
return `\x1b[38;2;${r};${g};${b}m` + ch;
|
|
16
13
|
}).join('') + '\x1b[0m'
|
|
17
14
|
).join('\n'));
|
|
18
|
-
|
|
19
|
-
if (k2 === undefined) k2 = k
|
|
20
|
-
|
|
15
|
+
const __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k
|
|
17
|
+
|
|
18
|
+
let desc = Object.getOwnPropertyDescriptor(m, k)
|
|
19
|
+
|
|
21
20
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
-
desc = {
|
|
21
|
+
desc = {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return m[k]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
o
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Object.
|
|
36
|
-
exports
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
|
|
29
|
+
Object.defineProperty(o, k2, desc)
|
|
30
|
+
|
|
31
|
+
}) : (function(o, m, k, k2) {
|
|
32
|
+
if (k2 === undefined) k2 = k
|
|
33
|
+
o[k2] = m[k]
|
|
34
|
+
}
|
|
35
|
+
))
|
|
36
|
+
|
|
37
|
+
const __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
38
|
+
for (var p in m) {
|
|
39
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) {
|
|
40
|
+
__createBinding(exports, m, p)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46
|
+
value: true
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
exports.proto =
|
|
50
|
+
exports.makeWASocket = null
|
|
51
|
+
|
|
52
|
+
const { proto } = require("../WAProto")
|
|
53
|
+
|
|
54
|
+
Object.defineProperty(exports, "proto", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return proto
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const { default: socket } = require("./Socket")
|
|
62
|
+
|
|
63
|
+
exports.makeWASocket = socket
|
|
64
|
+
|
|
65
|
+
__exportStar(require("../WAProto"), exports)
|
|
66
|
+
__exportStar(require("./Utils"), exports)
|
|
67
|
+
__exportStar(require("./Types"), exports)
|
|
68
|
+
__exportStar(require("./Store"), exports)
|
|
69
|
+
__exportStar(require("./Defaults"), exports)
|
|
70
|
+
__exportStar(require("./WABinary"), exports)
|
|
71
|
+
__exportStar(require("./WAM"), exports)
|
|
72
|
+
__exportStar(require("./WAUSync"), exports)
|
|
73
|
+
|
|
74
|
+
exports.default = socket
|
package/package.json
CHANGED
package/WAProto/index.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Adv } from './Adv'
|
|
2
|
-
import { AICommon } from 'AICommon'
|
|
3
|
-
import { BotMetadata } from './BotMetadata'
|
|
4
|
-
import { Cert } from './Cert'
|
|
5
|
-
import { WAChatLockSettings } from './ChatLockSettings'
|
|
6
|
-
import { CompanionReg } from './CompanionReg'
|
|
7
|
-
import { DeviceCapabilities } from './DeviceCapabilities'
|
|
8
|
-
import { E2E } from './WAE2E'
|
|
9
|
-
import { Ephemeral } from './Ephemeral'
|
|
10
|
-
import { HistorySync } from './HistorySync'
|
|
11
|
-
import { LidMigrationSyncPayload } from './LidMigrationSyncPayload'
|
|
12
|
-
import { MdStorageChatRowOpaqueData } from './MdStorageChatRowOpaqueData'
|
|
13
|
-
import { MdStorageMsgRowOpaqueData } from './MdStorageMsgRowOpaqueData'
|
|
14
|
-
import { MmsRetry } from './MmsRetry'
|
|
15
|
-
import { Protocol } from './Protocol'
|
|
16
|
-
import { Reporting } from './Reporting'
|
|
17
|
-
import { ServerSync } from './ServerSync'
|
|
18
|
-
import { SignalLocalStorageProtocol } from './SignalLocalStorageProtocol'
|
|
19
|
-
import { SignalWhisperTextProtocol } from './SignalWhisperTextProtocol'
|
|
20
|
-
import { StatusAttributions } from './StatusAttributions'
|
|
21
|
-
import { SyncAction } from './SyncAction'
|
|
22
|
-
import { UserPassword } from './UserPassword'
|
|
23
|
-
import { VnameCert } from './VnameCert'
|
|
24
|
-
import { Wa6 } from './Wa6'
|
|
25
|
-
import { Web } from './Web'
|
|
26
|
-
|
|
27
|
-
const proto = {
|
|
28
|
-
...Adv,
|
|
29
|
-
...AICommon,
|
|
30
|
-
...BotMetadata,
|
|
31
|
-
...Cert,
|
|
32
|
-
...ChatLockSettings,
|
|
33
|
-
...CompanionReg,
|
|
34
|
-
...DeviceCapabilities,
|
|
35
|
-
...E2E,
|
|
36
|
-
...Ephemeral,
|
|
37
|
-
...HistorySync,
|
|
38
|
-
...LidMigrationSyncPayload,
|
|
39
|
-
...MdStorageChatRowOpaqueData,
|
|
40
|
-
...MdStorageMsgRowOpaqueData,
|
|
41
|
-
...MmsRetry,
|
|
42
|
-
...Protocol,
|
|
43
|
-
...Reporting,
|
|
44
|
-
...ServerSync,
|
|
45
|
-
...SignalLocalStorageProtocol,
|
|
46
|
-
...SignalWhisperTextProtocol,
|
|
47
|
-
...StatusAttributions,
|
|
48
|
-
...SyncAction,
|
|
49
|
-
...UserPassword,
|
|
50
|
-
...VnameCert,
|
|
51
|
-
...Wa6,
|
|
52
|
-
...Web
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { proto }
|
package/lib/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { proto } from '../WAProto';
|
|
2
|
-
import makeWASocket from './Socket';
|
|
3
|
-
export * from '../WAProto';
|
|
4
|
-
export * from './Utils';
|
|
5
|
-
export * from './Types';
|
|
6
|
-
export * from './Store';
|
|
7
|
-
export * from './Defaults';
|
|
8
|
-
export * from './WABinary';
|
|
9
|
-
export * from './WAM';
|
|
10
|
-
export * from './WAUSync';
|
|
11
|
-
export type WASocket = ReturnType<typeof makeWASocket>;
|
|
12
|
-
export { makeWASocket, proto };
|
|
13
|
-
export default makeWASocket;
|