@nexustechpro/baileys 2.0.2 → 2.0.5
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/LICENSE +1 -1
- package/README.md +924 -1299
- package/lib/Defaults/baileys-version.json +6 -2
- package/lib/Defaults/index.js +172 -172
- package/lib/Signal/libsignal.js +380 -292
- package/lib/Signal/lid-mapping.js +264 -171
- package/lib/Socket/Client/index.js +2 -2
- package/lib/Socket/Client/types.js +10 -10
- package/lib/Socket/Client/websocket.js +45 -310
- package/lib/Socket/business.js +375 -375
- package/lib/Socket/chats.js +909 -963
- package/lib/Socket/communities.js +430 -430
- package/lib/Socket/groups.js +342 -342
- package/lib/Socket/index.js +22 -22
- package/lib/Socket/messages-recv.js +777 -743
- package/lib/Socket/messages-send.js +295 -305
- package/lib/Socket/mex.js +50 -50
- package/lib/Socket/newsletter.js +148 -148
- package/lib/Socket/nexus-handler.js +75 -261
- package/lib/Socket/socket.js +709 -1201
- package/lib/Store/index.js +5 -5
- package/lib/Store/make-cache-manager-store.js +81 -81
- package/lib/Store/make-in-memory-store.js +416 -416
- package/lib/Store/make-ordered-dictionary.js +81 -81
- package/lib/Store/object-repository.js +30 -30
- package/lib/Types/Auth.js +1 -1
- package/lib/Types/Bussines.js +1 -1
- package/lib/Types/Call.js +1 -1
- package/lib/Types/Chat.js +7 -7
- package/lib/Types/Contact.js +1 -1
- package/lib/Types/Events.js +1 -1
- package/lib/Types/GroupMetadata.js +1 -1
- package/lib/Types/Label.js +24 -24
- package/lib/Types/LabelAssociation.js +6 -6
- package/lib/Types/Message.js +10 -10
- package/lib/Types/Newsletter.js +28 -28
- package/lib/Types/Product.js +1 -1
- package/lib/Types/Signal.js +1 -1
- package/lib/Types/Socket.js +2 -2
- package/lib/Types/State.js +12 -12
- package/lib/Types/USync.js +1 -1
- package/lib/Types/index.js +25 -25
- package/lib/Utils/auth-utils.js +264 -256
- package/lib/Utils/baileys-event-stream.js +55 -55
- package/lib/Utils/browser-utils.js +27 -27
- package/lib/Utils/business.js +228 -230
- package/lib/Utils/chat-utils.js +694 -764
- package/lib/Utils/crypto.js +109 -135
- package/lib/Utils/decode-wa-message.js +310 -314
- package/lib/Utils/event-buffer.js +547 -547
- package/lib/Utils/generics.js +297 -297
- package/lib/Utils/history.js +91 -83
- package/lib/Utils/index.js +21 -20
- package/lib/Utils/key-store.js +17 -0
- package/lib/Utils/link-preview.js +97 -98
- package/lib/Utils/logger.js +2 -2
- package/lib/Utils/lt-hash.js +47 -47
- package/lib/Utils/make-mutex.js +39 -39
- package/lib/Utils/message-retry-manager.js +148 -148
- package/lib/Utils/messages-media.js +534 -534
- package/lib/Utils/messages.js +705 -705
- package/lib/Utils/noise-handler.js +255 -255
- package/lib/Utils/pre-key-manager.js +105 -105
- package/lib/Utils/process-message.js +412 -412
- package/lib/Utils/signal.js +160 -158
- package/lib/Utils/use-multi-file-auth-state.js +120 -120
- package/lib/Utils/validate-connection.js +194 -194
- package/lib/WABinary/constants.js +1300 -1300
- package/lib/WABinary/decode.js +237 -237
- package/lib/WABinary/encode.js +232 -232
- package/lib/WABinary/generic-utils.js +252 -211
- package/lib/WABinary/index.js +5 -5
- package/lib/WABinary/jid-utils.js +279 -95
- package/lib/WABinary/types.js +1 -1
- package/lib/WAM/BinaryInfo.js +9 -9
- package/lib/WAM/constants.js +22852 -22852
- package/lib/WAM/encode.js +149 -149
- package/lib/WAM/index.js +3 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +28 -28
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -53
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -26
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -37
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -50
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -28
- package/lib/WAUSync/Protocols/index.js +4 -4
- package/lib/WAUSync/USyncQuery.js +93 -93
- package/lib/WAUSync/USyncUser.js +22 -22
- package/lib/WAUSync/index.js +3 -3
- package/lib/index.js +66 -66
- package/package.json +171 -144
- package/lib/Signal/Group/ciphertext-message.js +0 -12
- package/lib/Signal/Group/group-session-builder.js +0 -30
- package/lib/Signal/Group/group_cipher.js +0 -100
- package/lib/Signal/Group/index.js +0 -12
- package/lib/Signal/Group/keyhelper.js +0 -18
- package/lib/Signal/Group/sender-chain-key.js +0 -26
- package/lib/Signal/Group/sender-key-distribution-message.js +0 -63
- package/lib/Signal/Group/sender-key-message.js +0 -66
- package/lib/Signal/Group/sender-key-name.js +0 -48
- package/lib/Signal/Group/sender-key-record.js +0 -41
- package/lib/Signal/Group/sender-key-state.js +0 -84
- package/lib/Signal/Group/sender-message-key.js +0 -26
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../../WABinary/index.js';
|
|
2
|
-
import { USyncUser } from '../USyncUser.js';
|
|
3
|
-
export class USyncBotProfileProtocol {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.name = 'bot';
|
|
6
|
-
}
|
|
7
|
-
getQueryElement() {
|
|
8
|
-
return {
|
|
9
|
-
tag: 'bot',
|
|
10
|
-
attrs: {},
|
|
11
|
-
content: [{ tag: 'profile', attrs: { v: '1' } }]
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
getUserElement(user) {
|
|
15
|
-
return {
|
|
16
|
-
tag: 'bot',
|
|
17
|
-
attrs: {},
|
|
18
|
-
content: [{ tag: 'profile', attrs: { persona_id: user.personaId } }]
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
parser(node) {
|
|
22
|
-
const botNode = getBinaryNodeChild(node, 'bot');
|
|
23
|
-
const profile = getBinaryNodeChild(botNode, 'profile');
|
|
24
|
-
const commandsNode = getBinaryNodeChild(profile, 'commands');
|
|
25
|
-
const promptsNode = getBinaryNodeChild(profile, 'prompts');
|
|
26
|
-
const commands = [];
|
|
27
|
-
const prompts = [];
|
|
28
|
-
for (const command of getBinaryNodeChildren(commandsNode, 'command')) {
|
|
29
|
-
commands.push({
|
|
30
|
-
name: getBinaryNodeChildString(command, 'name'),
|
|
31
|
-
description: getBinaryNodeChildString(command, 'description')
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
for (const prompt of getBinaryNodeChildren(promptsNode, 'prompt')) {
|
|
35
|
-
prompts.push(`${getBinaryNodeChildString(prompt, 'emoji')} ${getBinaryNodeChildString(prompt, 'text')}`);
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
isDefault: !!getBinaryNodeChild(profile, 'default'),
|
|
39
|
-
jid: node.attrs.jid,
|
|
40
|
-
name: getBinaryNodeChildString(profile, 'name'),
|
|
41
|
-
attributes: getBinaryNodeChildString(profile, 'attributes'),
|
|
42
|
-
description: getBinaryNodeChildString(profile, 'description'),
|
|
43
|
-
category: getBinaryNodeChildString(profile, 'category'),
|
|
44
|
-
personaId: profile.attrs['persona_id'],
|
|
45
|
-
commandsDescription: getBinaryNodeChildString(commandsNode, 'description'),
|
|
46
|
-
commands,
|
|
47
|
-
prompts
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../../WABinary/index.js';
|
|
2
|
+
import { USyncUser } from '../USyncUser.js';
|
|
3
|
+
export class USyncBotProfileProtocol {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.name = 'bot';
|
|
6
|
+
}
|
|
7
|
+
getQueryElement() {
|
|
8
|
+
return {
|
|
9
|
+
tag: 'bot',
|
|
10
|
+
attrs: {},
|
|
11
|
+
content: [{ tag: 'profile', attrs: { v: '1' } }]
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
getUserElement(user) {
|
|
15
|
+
return {
|
|
16
|
+
tag: 'bot',
|
|
17
|
+
attrs: {},
|
|
18
|
+
content: [{ tag: 'profile', attrs: { persona_id: user.personaId } }]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
parser(node) {
|
|
22
|
+
const botNode = getBinaryNodeChild(node, 'bot');
|
|
23
|
+
const profile = getBinaryNodeChild(botNode, 'profile');
|
|
24
|
+
const commandsNode = getBinaryNodeChild(profile, 'commands');
|
|
25
|
+
const promptsNode = getBinaryNodeChild(profile, 'prompts');
|
|
26
|
+
const commands = [];
|
|
27
|
+
const prompts = [];
|
|
28
|
+
for (const command of getBinaryNodeChildren(commandsNode, 'command')) {
|
|
29
|
+
commands.push({
|
|
30
|
+
name: getBinaryNodeChildString(command, 'name'),
|
|
31
|
+
description: getBinaryNodeChildString(command, 'description')
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
for (const prompt of getBinaryNodeChildren(promptsNode, 'prompt')) {
|
|
35
|
+
prompts.push(`${getBinaryNodeChildString(prompt, 'emoji')} ${getBinaryNodeChildString(prompt, 'text')}`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
isDefault: !!getBinaryNodeChild(profile, 'default'),
|
|
39
|
+
jid: node.attrs.jid,
|
|
40
|
+
name: getBinaryNodeChildString(profile, 'name'),
|
|
41
|
+
attributes: getBinaryNodeChildString(profile, 'attributes'),
|
|
42
|
+
description: getBinaryNodeChildString(profile, 'description'),
|
|
43
|
+
category: getBinaryNodeChildString(profile, 'category'),
|
|
44
|
+
personaId: profile.attrs['persona_id'],
|
|
45
|
+
commandsDescription: getBinaryNodeChildString(commandsNode, 'description'),
|
|
46
|
+
commands,
|
|
47
|
+
prompts
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
51
|
//# sourceMappingURL=UsyncBotProfileProtocol.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export class USyncLIDProtocol {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.name = 'lid';
|
|
4
|
-
}
|
|
5
|
-
getQueryElement() {
|
|
6
|
-
return {
|
|
7
|
-
tag: 'lid',
|
|
8
|
-
attrs: {}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
getUserElement(user) {
|
|
12
|
-
if (user.lid) {
|
|
13
|
-
return {
|
|
14
|
-
tag: 'lid',
|
|
15
|
-
attrs: { jid: user.lid }
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
parser(node) {
|
|
23
|
-
if (node.tag === 'lid') {
|
|
24
|
-
return node.attrs.val;
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
export class USyncLIDProtocol {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.name = 'lid';
|
|
4
|
+
}
|
|
5
|
+
getQueryElement() {
|
|
6
|
+
return {
|
|
7
|
+
tag: 'lid',
|
|
8
|
+
attrs: {}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
getUserElement(user) {
|
|
12
|
+
if (user.lid) {
|
|
13
|
+
return {
|
|
14
|
+
tag: 'lid',
|
|
15
|
+
attrs: { jid: user.lid }
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
parser(node) {
|
|
23
|
+
if (node.tag === 'lid') {
|
|
24
|
+
return node.attrs.val;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=UsyncLIDProtocol.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './USyncDeviceProtocol.js';
|
|
2
|
-
export * from './USyncContactProtocol.js';
|
|
3
|
-
export * from './USyncStatusProtocol.js';
|
|
4
|
-
export * from './USyncDisappearingModeProtocol.js';
|
|
1
|
+
export * from './USyncDeviceProtocol.js';
|
|
2
|
+
export * from './USyncContactProtocol.js';
|
|
3
|
+
export * from './USyncStatusProtocol.js';
|
|
4
|
+
export * from './USyncDisappearingModeProtocol.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
2
|
-
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
|
|
3
|
-
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
|
|
4
|
-
import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol } from './Protocols/index.js';
|
|
5
|
-
import { USyncUser } from './USyncUser.js';
|
|
6
|
-
export class USyncQuery {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.protocols = [];
|
|
9
|
-
this.users = [];
|
|
10
|
-
this.context = 'interactive';
|
|
11
|
-
this.mode = 'query';
|
|
12
|
-
}
|
|
13
|
-
withMode(mode) {
|
|
14
|
-
this.mode = mode;
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
withContext(context) {
|
|
18
|
-
this.context = context;
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
withUser(user) {
|
|
22
|
-
this.users.push(user);
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
parseUSyncQueryResult(result) {
|
|
26
|
-
if (!result || result.attrs.type !== 'result') {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const protocolMap = Object.fromEntries(this.protocols.map(protocol => {
|
|
30
|
-
return [protocol.name, protocol.parser];
|
|
31
|
-
}));
|
|
32
|
-
const queryResult = {
|
|
33
|
-
// TODO: implement errors etc.
|
|
34
|
-
list: [],
|
|
35
|
-
sideList: []
|
|
36
|
-
};
|
|
37
|
-
const usyncNode = getBinaryNodeChild(result, 'usync');
|
|
38
|
-
//TODO: implement error backoff, refresh etc.
|
|
39
|
-
//TODO: see if there are any errors in the result node
|
|
40
|
-
//const resultNode = getBinaryNodeChild(usyncNode, 'result')
|
|
41
|
-
const listNode = usyncNode ? getBinaryNodeChild(usyncNode, 'list') : undefined;
|
|
42
|
-
if (listNode?.content && Array.isArray(listNode.content)) {
|
|
43
|
-
queryResult.list = listNode.content.reduce((acc, node) => {
|
|
44
|
-
const id = node?.attrs.jid;
|
|
45
|
-
if (id) {
|
|
46
|
-
const data = Array.isArray(node?.content)
|
|
47
|
-
? Object.fromEntries(node.content
|
|
48
|
-
.map(content => {
|
|
49
|
-
const protocol = content.tag;
|
|
50
|
-
const parser = protocolMap[protocol];
|
|
51
|
-
if (parser) {
|
|
52
|
-
return [protocol, parser(content)];
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
return [protocol, null];
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
.filter(([, b]) => b !== null))
|
|
59
|
-
: {};
|
|
60
|
-
acc.push({ ...data, id });
|
|
61
|
-
}
|
|
62
|
-
return acc;
|
|
63
|
-
}, []);
|
|
64
|
-
}
|
|
65
|
-
//TODO: implement side list
|
|
66
|
-
//const sideListNode = getBinaryNodeChild(usyncNode, 'side_list')
|
|
67
|
-
return queryResult;
|
|
68
|
-
}
|
|
69
|
-
withDeviceProtocol() {
|
|
70
|
-
this.protocols.push(new USyncDeviceProtocol());
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
withContactProtocol() {
|
|
74
|
-
this.protocols.push(new USyncContactProtocol());
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
withStatusProtocol() {
|
|
78
|
-
this.protocols.push(new USyncStatusProtocol());
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
withDisappearingModeProtocol() {
|
|
82
|
-
this.protocols.push(new USyncDisappearingModeProtocol());
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
withBotProfileProtocol() {
|
|
86
|
-
this.protocols.push(new USyncBotProfileProtocol());
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
withLIDProtocol() {
|
|
90
|
-
this.protocols.push(new USyncLIDProtocol());
|
|
91
|
-
return this;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
1
|
+
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
2
|
+
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
|
|
3
|
+
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
|
|
4
|
+
import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol } from './Protocols/index.js';
|
|
5
|
+
import { USyncUser } from './USyncUser.js';
|
|
6
|
+
export class USyncQuery {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.protocols = [];
|
|
9
|
+
this.users = [];
|
|
10
|
+
this.context = 'interactive';
|
|
11
|
+
this.mode = 'query';
|
|
12
|
+
}
|
|
13
|
+
withMode(mode) {
|
|
14
|
+
this.mode = mode;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
withContext(context) {
|
|
18
|
+
this.context = context;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
withUser(user) {
|
|
22
|
+
this.users.push(user);
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
parseUSyncQueryResult(result) {
|
|
26
|
+
if (!result || result.attrs.type !== 'result') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const protocolMap = Object.fromEntries(this.protocols.map(protocol => {
|
|
30
|
+
return [protocol.name, protocol.parser];
|
|
31
|
+
}));
|
|
32
|
+
const queryResult = {
|
|
33
|
+
// TODO: implement errors etc.
|
|
34
|
+
list: [],
|
|
35
|
+
sideList: []
|
|
36
|
+
};
|
|
37
|
+
const usyncNode = getBinaryNodeChild(result, 'usync');
|
|
38
|
+
//TODO: implement error backoff, refresh etc.
|
|
39
|
+
//TODO: see if there are any errors in the result node
|
|
40
|
+
//const resultNode = getBinaryNodeChild(usyncNode, 'result')
|
|
41
|
+
const listNode = usyncNode ? getBinaryNodeChild(usyncNode, 'list') : undefined;
|
|
42
|
+
if (listNode?.content && Array.isArray(listNode.content)) {
|
|
43
|
+
queryResult.list = listNode.content.reduce((acc, node) => {
|
|
44
|
+
const id = node?.attrs.jid;
|
|
45
|
+
if (id) {
|
|
46
|
+
const data = Array.isArray(node?.content)
|
|
47
|
+
? Object.fromEntries(node.content
|
|
48
|
+
.map(content => {
|
|
49
|
+
const protocol = content.tag;
|
|
50
|
+
const parser = protocolMap[protocol];
|
|
51
|
+
if (parser) {
|
|
52
|
+
return [protocol, parser(content)];
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return [protocol, null];
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
.filter(([, b]) => b !== null))
|
|
59
|
+
: {};
|
|
60
|
+
acc.push({ ...data, id });
|
|
61
|
+
}
|
|
62
|
+
return acc;
|
|
63
|
+
}, []);
|
|
64
|
+
}
|
|
65
|
+
//TODO: implement side list
|
|
66
|
+
//const sideListNode = getBinaryNodeChild(usyncNode, 'side_list')
|
|
67
|
+
return queryResult;
|
|
68
|
+
}
|
|
69
|
+
withDeviceProtocol() {
|
|
70
|
+
this.protocols.push(new USyncDeviceProtocol());
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
withContactProtocol() {
|
|
74
|
+
this.protocols.push(new USyncContactProtocol());
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
withStatusProtocol() {
|
|
78
|
+
this.protocols.push(new USyncStatusProtocol());
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
withDisappearingModeProtocol() {
|
|
82
|
+
this.protocols.push(new USyncDisappearingModeProtocol());
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
withBotProfileProtocol() {
|
|
86
|
+
this.protocols.push(new USyncBotProfileProtocol());
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
withLIDProtocol() {
|
|
90
|
+
this.protocols.push(new USyncLIDProtocol());
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
94
|
//# sourceMappingURL=USyncQuery.js.map
|
package/lib/WAUSync/USyncUser.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export class USyncUser {
|
|
2
|
-
withId(id) {
|
|
3
|
-
this.id = id;
|
|
4
|
-
return this;
|
|
5
|
-
}
|
|
6
|
-
withLid(lid) {
|
|
7
|
-
this.lid = lid;
|
|
8
|
-
return this;
|
|
9
|
-
}
|
|
10
|
-
withPhone(phone) {
|
|
11
|
-
this.phone = phone;
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
withType(type) {
|
|
15
|
-
this.type = type;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
withPersonaId(personaId) {
|
|
19
|
-
this.personaId = personaId;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
export class USyncUser {
|
|
2
|
+
withId(id) {
|
|
3
|
+
this.id = id;
|
|
4
|
+
return this;
|
|
5
|
+
}
|
|
6
|
+
withLid(lid) {
|
|
7
|
+
this.lid = lid;
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
withPhone(phone) {
|
|
11
|
+
this.phone = phone;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
withType(type) {
|
|
15
|
+
this.type = type;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
withPersonaId(personaId) {
|
|
19
|
+
this.personaId = personaId;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=USyncUser.js.map
|
package/lib/WAUSync/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Protocols/index.js';
|
|
2
|
-
export * from './USyncQuery.js';
|
|
3
|
-
export * from './USyncUser.js';
|
|
1
|
+
export * from './Protocols/index.js';
|
|
2
|
+
export * from './USyncQuery.js';
|
|
3
|
+
export * from './USyncUser.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import gradient from 'gradient-string';
|
|
3
|
-
import makeWASocket from './Socket/index.js';
|
|
4
|
-
import NexusHandler from './Socket/nexus-handler.js';
|
|
5
|
-
const banner = `
|
|
6
|
-
╔══════════════════════════════════════════════════════════════════╗
|
|
7
|
-
║ ║
|
|
8
|
-
║ ███╗ ██╗███████╗██╗ ██╗██╗ ██╗███████╗ ║
|
|
9
|
-
║ ████╗ ██║██╔════╝╚██╗██╔╝██║ ██║██╔════╝ ║
|
|
10
|
-
║ ██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║███████╗ ║
|
|
11
|
-
║ ██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║╚════██║ ║
|
|
12
|
-
║ ██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝███████║ ║
|
|
13
|
-
║ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║
|
|
14
|
-
║ ║
|
|
15
|
-
║ ████████╗███████╗ ██████╗██╗ ██╗ ║
|
|
16
|
-
║ ╚══██╔══╝██╔════╝██╔════╝██║ ██║ ║
|
|
17
|
-
║ ██║ █████╗ ██║ ███████║ ║
|
|
18
|
-
║ ██║ ██╔══╝ ██║ ██╔══██║ ║
|
|
19
|
-
║ ██║ ███████╗╚██████╗██║ ██║ ║
|
|
20
|
-
║ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝ ║
|
|
21
|
-
║ ║
|
|
22
|
-
║ ██████╗ ██████╗ ██████╗ ║
|
|
23
|
-
║ ██╔══██╗██╔══██╗██╔═══██╗ ║
|
|
24
|
-
║ ██████╔╝██████╔╝██║ ██║ ║
|
|
25
|
-
║ ██╔═══╝ ██╔══██╗██║ ██║ ║
|
|
26
|
-
║ ██║ ██║ ██║╚██████╔╝ ║
|
|
27
|
-
║ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ║
|
|
28
|
-
║ ║
|
|
29
|
-
╚══════════════════════════════════════════════════════════════════╝
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
const info = `
|
|
33
|
-
┌───────────────────────────────────────────────────────────────────────┐
|
|
34
|
-
│ 📦 Package: @nexustechpro/baileys │
|
|
35
|
-
│ 🔖 Version: 2.0.
|
|
36
|
-
│ ⚡ Status: Production Ready │
|
|
37
|
-
├───────────────────────────────────────────────────────────────────────┤
|
|
38
|
-
│ 🚀 Advanced WhatsApp Web API Client │
|
|
39
|
-
│ ✨ Interactive Buttons • Products • Events • Media │
|
|
40
|
-
│ 🔐 End-to-End Encryption • Multi-Device Support │
|
|
41
|
-
│ 📱 Business API • Channels • Status Updates │
|
|
42
|
-
├───────────────────────────────────────────────────────────────────────┤
|
|
43
|
-
│ 💡 Built by NexusTech Pro Team │
|
|
44
|
-
│ 📚 Docs: github.com/nexustechpro2/baileys │
|
|
45
|
-
│ 💬 Support: Join our community for updates & assistance │
|
|
46
|
-
└───────────────────────────────────────────────────────────────────────┘
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
// Print banner with gradient
|
|
50
|
-
console.log(gradient(['#00D4FF', '#0099FF', '#00D4FF'])(banner));
|
|
51
|
-
|
|
52
|
-
// Print info with gradient
|
|
53
|
-
console.log(gradient(['#FFD700', '#FF6B6B', '#4ECDC4'])(info));
|
|
54
|
-
|
|
55
|
-
// Startup message
|
|
56
|
-
console.log(gradient(['#00FF88', '#FFFFFF'])('\n🎯 Initializing Baileys Socket Connection...\n'));
|
|
57
|
-
|
|
58
|
-
export * from '../WAProto/index.js';
|
|
59
|
-
export * from './Utils/index.js';
|
|
60
|
-
export * from './Store/index.js';
|
|
61
|
-
export * from './Types/index.js';
|
|
62
|
-
export * from './Defaults/index.js';
|
|
63
|
-
export * from './WABinary/index.js';
|
|
64
|
-
export * from './WAM/index.js';
|
|
65
|
-
export * from './WAUSync/index.js';
|
|
66
|
-
export { NexusHandler, makeWASocket };
|
|
1
|
+
"use strict";
|
|
2
|
+
import gradient from 'gradient-string';
|
|
3
|
+
import makeWASocket from './Socket/index.js';
|
|
4
|
+
import NexusHandler from './Socket/nexus-handler.js';
|
|
5
|
+
const banner = `
|
|
6
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
7
|
+
║ ║
|
|
8
|
+
║ ███╗ ██╗███████╗██╗ ██╗██╗ ██╗███████╗ ║
|
|
9
|
+
║ ████╗ ██║██╔════╝╚██╗██╔╝██║ ██║██╔════╝ ║
|
|
10
|
+
║ ██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║███████╗ ║
|
|
11
|
+
║ ██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║╚════██║ ║
|
|
12
|
+
║ ██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝███████║ ║
|
|
13
|
+
║ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║
|
|
14
|
+
║ ║
|
|
15
|
+
║ ████████╗███████╗ ██████╗██╗ ██╗ ║
|
|
16
|
+
║ ╚══██╔══╝██╔════╝██╔════╝██║ ██║ ║
|
|
17
|
+
║ ██║ █████╗ ██║ ███████║ ║
|
|
18
|
+
║ ██║ ██╔══╝ ██║ ██╔══██║ ║
|
|
19
|
+
║ ██║ ███████╗╚██████╗██║ ██║ ║
|
|
20
|
+
║ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝ ║
|
|
21
|
+
║ ║
|
|
22
|
+
║ ██████╗ ██████╗ ██████╗ ║
|
|
23
|
+
║ ██╔══██╗██╔══██╗██╔═══██╗ ║
|
|
24
|
+
║ ██████╔╝██████╔╝██║ ██║ ║
|
|
25
|
+
║ ██╔═══╝ ██╔══██╗██║ ██║ ║
|
|
26
|
+
║ ██║ ██║ ██║╚██████╔╝ ║
|
|
27
|
+
║ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ║
|
|
28
|
+
║ ║
|
|
29
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
const info = `
|
|
33
|
+
┌───────────────────────────────────────────────────────────────────────┐
|
|
34
|
+
│ 📦 Package: @nexustechpro/baileys │
|
|
35
|
+
│ 🔖 Version: 2.0.5 │
|
|
36
|
+
│ ⚡ Status: Production Ready │
|
|
37
|
+
├───────────────────────────────────────────────────────────────────────┤
|
|
38
|
+
│ 🚀 Advanced WhatsApp Web API Client │
|
|
39
|
+
│ ✨ Interactive Buttons • Products • Events • Media │
|
|
40
|
+
│ 🔐 End-to-End Encryption • Multi-Device Support │
|
|
41
|
+
│ 📱 Business API • Channels • Status Updates │
|
|
42
|
+
├───────────────────────────────────────────────────────────────────────┤
|
|
43
|
+
│ 💡 Built by NexusTech Pro Team │
|
|
44
|
+
│ 📚 Docs: github.com/nexustechpro2/baileys │
|
|
45
|
+
│ 💬 Support: Join our community for updates & assistance │
|
|
46
|
+
└───────────────────────────────────────────────────────────────────────┘
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
// Print banner with gradient
|
|
50
|
+
console.log(gradient(['#00D4FF', '#0099FF', '#00D4FF'])(banner));
|
|
51
|
+
|
|
52
|
+
// Print info with gradient
|
|
53
|
+
console.log(gradient(['#FFD700', '#FF6B6B', '#4ECDC4'])(info));
|
|
54
|
+
|
|
55
|
+
// Startup message
|
|
56
|
+
console.log(gradient(['#00FF88', '#FFFFFF'])('\n🎯 Initializing Baileys Socket Connection...\n'));
|
|
57
|
+
|
|
58
|
+
export * from '../WAProto/index.js';
|
|
59
|
+
export * from './Utils/index.js';
|
|
60
|
+
export * from './Store/index.js';
|
|
61
|
+
export * from './Types/index.js';
|
|
62
|
+
export * from './Defaults/index.js';
|
|
63
|
+
export * from './WABinary/index.js';
|
|
64
|
+
export * from './WAM/index.js';
|
|
65
|
+
export * from './WAUSync/index.js';
|
|
66
|
+
export { NexusHandler, makeWASocket };
|
|
67
67
|
export default makeWASocket;
|