@genuxofficial/baileys 3.0.0 → 4.0.0
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/WAProto.proto +24 -206
- package/WAProto/index.d.ts +219 -2233
- package/WAProto/index.js +525 -6773
- package/WAProto/shizo.x +1 -0
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +231 -0
- package/lib/Defaults/index.js +17 -1
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.js +3 -2
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
- package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -2
- package/lib/Socket/business.d.ts +7 -9
- package/lib/Socket/chats.d.ts +5 -8
- package/lib/Socket/chats.js +8 -38
- package/lib/Socket/groups.d.ts +5 -7
- package/lib/Socket/groups.js +2 -14
- package/lib/Socket/index.d.ts +9 -9
- package/lib/Socket/index.js +2 -2
- package/lib/Socket/messages-recv.d.ts +8 -10
- package/lib/Socket/messages-recv.js +11 -18
- package/lib/Socket/messages-send.d.ts +7 -14
- package/lib/Socket/messages-send.js +13 -36
- package/lib/Socket/newsletter.d.ts +7 -9
- package/lib/Socket/newsletter.js +3 -11
- package/lib/Socket/registration.d.ts +271 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +4 -5
- package/lib/Socket/socket.js +18 -15
- package/lib/Socket/usync.d.ts +4 -4
- package/lib/Store/index.d.ts +2 -1
- package/lib/Store/index.js +3 -1
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.js +10 -8
- package/lib/Store/make-ordered-dictionary.js +2 -2
- package/lib/Types/Auth.d.ts +6 -0
- package/lib/Types/Chat.d.ts +0 -4
- package/lib/Types/Contact.d.ts +1 -1
- package/lib/Types/GroupMetadata.d.ts +0 -6
- package/lib/Types/Message.d.ts +5 -29
- package/lib/Types/Message.js +2 -0
- package/lib/Types/Socket.d.ts +4 -7
- package/lib/Utils/auth-utils.d.ts +1 -1
- package/lib/Utils/auth-utils.js +9 -2
- package/lib/Utils/business.js +3 -15
- package/lib/Utils/chat-utils.d.ts +4 -4
- package/lib/Utils/chat-utils.js +2 -1
- package/lib/Utils/decode-wa-message.d.ts +2 -4
- package/lib/Utils/decode-wa-message.js +24 -145
- package/lib/Utils/event-buffer.js +6 -4
- package/lib/Utils/generics.d.ts +4 -7
- package/lib/Utils/generics.js +17 -9
- package/lib/Utils/lt-hash.d.ts +3 -3
- package/lib/Utils/lt-hash.js +45 -11
- package/lib/Utils/messages-media.d.ts +4 -4
- package/lib/Utils/messages-media.js +57 -69
- package/lib/Utils/messages.js +39 -33
- package/lib/Utils/noise-handler.d.ts +2 -1
- package/lib/Utils/noise-handler.js +10 -5
- package/lib/Utils/use-multi-file-auth-state.js +11 -48
- package/lib/Utils/validate-connection.d.ts +1 -0
- package/lib/Utils/validate-connection.js +44 -10
- package/lib/WABinary/constants.js +5 -5
- package/lib/WABinary/encode.js +10 -23
- package/lib/WABinary/generic-utils.d.ts +5 -3
- package/lib/WABinary/generic-utils.js +19 -34
- package/lib/WABinary/jid-utils.d.ts +2 -11
- package/lib/WABinary/jid-utils.js +2 -27
- package/lib/WAM/BinaryInfo.d.ts +2 -2
- package/lib/WAM/constants.d.ts +2 -3
- package/lib/WAM/encode.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +12 -21
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +3 -3
- package/lib/WAUSync/USyncQuery.d.ts +0 -2
- package/lib/WAUSync/USyncQuery.js +0 -10
- package/lib/WAUSync/USyncUser.d.ts +0 -2
- package/lib/WAUSync/USyncUser.js +0 -4
- package/package.json +5 -6
- package/LICENSE +0 -21
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -53
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -24
- /package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +0 -0
- /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.USyncBotProfileProtocol = void 0;
|
4
|
-
const WABinary_1 = require("../../WABinary");
|
5
|
-
class USyncBotProfileProtocol {
|
6
|
-
constructor() {
|
7
|
-
this.name = 'bot';
|
8
|
-
}
|
9
|
-
getQueryElement() {
|
10
|
-
return {
|
11
|
-
tag: 'bot',
|
12
|
-
attrs: {},
|
13
|
-
content: [{ tag: 'profile', attrs: { v: '1' } }]
|
14
|
-
};
|
15
|
-
}
|
16
|
-
getUserElement(user) {
|
17
|
-
return {
|
18
|
-
tag: 'bot',
|
19
|
-
attrs: {},
|
20
|
-
content: [{ tag: 'profile', attrs: { 'persona_id': user.personaId } }]
|
21
|
-
};
|
22
|
-
}
|
23
|
-
parser(node) {
|
24
|
-
const botNode = (0, WABinary_1.getBinaryNodeChild)(node, 'bot');
|
25
|
-
const profile = (0, WABinary_1.getBinaryNodeChild)(botNode, 'profile');
|
26
|
-
const commandsNode = (0, WABinary_1.getBinaryNodeChild)(profile, 'commands');
|
27
|
-
const promptsNode = (0, WABinary_1.getBinaryNodeChild)(profile, 'prompts');
|
28
|
-
const commands = [];
|
29
|
-
const prompts = [];
|
30
|
-
for (const command of (0, WABinary_1.getBinaryNodeChildren)(commandsNode, 'command')) {
|
31
|
-
commands.push({
|
32
|
-
name: (0, WABinary_1.getBinaryNodeChildString)(command, 'name'),
|
33
|
-
description: (0, WABinary_1.getBinaryNodeChildString)(command, 'description')
|
34
|
-
});
|
35
|
-
}
|
36
|
-
for (const prompt of (0, WABinary_1.getBinaryNodeChildren)(promptsNode, 'prompt')) {
|
37
|
-
prompts.push(`${(0, WABinary_1.getBinaryNodeChildString)(prompt, 'emoji')} ${(0, WABinary_1.getBinaryNodeChildString)(prompt, 'text')}`);
|
38
|
-
}
|
39
|
-
return {
|
40
|
-
isDefault: !!(0, WABinary_1.getBinaryNodeChild)(profile, 'default'),
|
41
|
-
jid: node.attrs.jid,
|
42
|
-
name: (0, WABinary_1.getBinaryNodeChildString)(profile, 'name'),
|
43
|
-
attributes: (0, WABinary_1.getBinaryNodeChildString)(profile, 'attributes'),
|
44
|
-
description: (0, WABinary_1.getBinaryNodeChildString)(profile, 'description'),
|
45
|
-
category: (0, WABinary_1.getBinaryNodeChildString)(profile, 'category'),
|
46
|
-
personaId: profile.attrs['persona_id'],
|
47
|
-
commandsDescription: (0, WABinary_1.getBinaryNodeChildString)(commandsNode, 'description'),
|
48
|
-
commands,
|
49
|
-
prompts
|
50
|
-
};
|
51
|
-
}
|
52
|
-
}
|
53
|
-
exports.USyncBotProfileProtocol = USyncBotProfileProtocol;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { USyncQueryProtocol } from '../../Types/USync';
|
2
|
-
import { BinaryNode } from '../../WABinary';
|
3
|
-
export declare class USyncLIDProtocol implements USyncQueryProtocol {
|
4
|
-
name: string;
|
5
|
-
getQueryElement(): BinaryNode;
|
6
|
-
getUserElement(): null;
|
7
|
-
parser(node: BinaryNode): string | null;
|
8
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.USyncLIDProtocol = void 0;
|
4
|
-
class USyncLIDProtocol {
|
5
|
-
constructor() {
|
6
|
-
this.name = 'lid';
|
7
|
-
}
|
8
|
-
getQueryElement() {
|
9
|
-
return {
|
10
|
-
tag: 'lid',
|
11
|
-
attrs: {},
|
12
|
-
};
|
13
|
-
}
|
14
|
-
getUserElement() {
|
15
|
-
return null;
|
16
|
-
}
|
17
|
-
parser(node) {
|
18
|
-
if (node.tag === 'lid') {
|
19
|
-
return node.attrs.val;
|
20
|
-
}
|
21
|
-
return null;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
exports.USyncLIDProtocol = USyncLIDProtocol;
|
File without changes
|
File without changes
|