@fanzxnothuman/baileys 2.0.17
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 +21 -0
- package/README.md +479 -0
- package/WAProto/index.js +204542 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.js +158 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Function/Download/tiktok.js +19 -0
- package/lib/Function/Tools/bypass.js +19 -0
- package/lib/Function/index.js +13 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.js +99 -0
- package/lib/Signal/Group/group_cipher.js +131 -0
- package/lib/Signal/Group/index.js +141 -0
- package/lib/Signal/Group/keyhelper.js +78 -0
- package/lib/Signal/Group/queue-job.js +54 -0
- package/lib/Signal/Group/sender-chain-key.js +39 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +76 -0
- package/lib/Signal/Group/sender-key-message.js +86 -0
- package/lib/Signal/Group/sender-key-name.js +53 -0
- package/lib/Signal/Group/sender-key-record.js +71 -0
- package/lib/Signal/Group/sender-key-state.js +123 -0
- package/lib/Signal/Group/sender-message-key.js +33 -0
- package/lib/Signal/libsignal.js +223 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.js +35 -0
- package/lib/Socket/Client/mobile-socket-client.js +96 -0
- package/lib/Socket/Client/web-socket-client.js +96 -0
- package/lib/Socket/business.js +289 -0
- package/lib/Socket/chats.js +1230 -0
- package/lib/Socket/dugong.js +689 -0
- package/lib/Socket/groups.js +401 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/messages-recv.js +1531 -0
- package/lib/Socket/messages-send.js +1011 -0
- package/lib/Socket/newsletter.js +526 -0
- package/lib/Socket/registration.js +212 -0
- package/lib/Socket/socket.js +842 -0
- package/lib/Socket/usync.js +67 -0
- package/lib/Store/index.js +16 -0
- package/lib/Store/make-cache-manager-store.js +90 -0
- package/lib/Store/make-in-memory-store.js +520 -0
- package/lib/Store/make-ordered-dictionary.js +78 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +10 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.js +12 -0
- package/lib/Types/Message.js +14 -0
- package/lib/Types/Newsletter.js +38 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +67 -0
- package/lib/Utils/auth-utils.js +223 -0
- package/lib/Utils/baileys-event-stream.js +67 -0
- package/lib/Utils/business.js +308 -0
- package/lib/Utils/chat-utils.js +1030 -0
- package/lib/Utils/crypto.js +210 -0
- package/lib/Utils/decode-wa-message.js +225 -0
- package/lib/Utils/event-buffer.js +559 -0
- package/lib/Utils/generics.js +599 -0
- package/lib/Utils/history.js +132 -0
- package/lib/Utils/index.js +49 -0
- package/lib/Utils/link-preview.js +112 -0
- package/lib/Utils/logger.js +11 -0
- package/lib/Utils/lt-hash.js +58 -0
- package/lib/Utils/make-mutex.js +41 -0
- package/lib/Utils/messages-media.js +978 -0
- package/lib/Utils/messages.js +1052 -0
- package/lib/Utils/noise-handler.js +185 -0
- package/lib/Utils/process-message.js +466 -0
- package/lib/Utils/signal.js +199 -0
- package/lib/Utils/use-multi-file-auth-state.js +129 -0
- package/lib/Utils/validate-connection.js +285 -0
- package/lib/WABinary/constants.js +1307 -0
- package/lib/WABinary/decode.js +287 -0
- package/lib/WABinary/encode.js +286 -0
- package/lib/WABinary/generic-utils.js +227 -0
- package/lib/WABinary/index.js +37 -0
- package/lib/WABinary/jid-utils.js +92 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.js +15260 -0
- package/lib/WAM/encode.js +153 -0
- package/lib/WAM/index.js +35 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +37 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +78 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +35 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +76 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.js +36 -0
- package/lib/WAUSync/USyncQuery.js +105 -0
- package/lib/WAUSync/USyncUser.js +26 -0
- package/lib/WAUSync/index.js +35 -0
- package/lib/index.js +65 -0
- package/package.json +109 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdditionalNode =
|
|
4
|
+
exports.getBinaryNodeFilter =
|
|
5
|
+
exports.binaryNodeToString =
|
|
6
|
+
exports.getBinaryNodeMessages =
|
|
7
|
+
exports.reduceBinaryNodeToDictionary =
|
|
8
|
+
exports.assertNodeErrorFree =
|
|
9
|
+
exports.getBinaryNodeChildUInt =
|
|
10
|
+
exports.getBinaryNodeChildString =
|
|
11
|
+
exports.getBinaryNodeChildBuffer =
|
|
12
|
+
exports.getBinaryNodeChild =
|
|
13
|
+
exports.getAllBinaryNodeChildren =
|
|
14
|
+
exports.getBinaryNodeChildren =
|
|
15
|
+
void 0;
|
|
16
|
+
const boom_1 = require("@hapi/boom");
|
|
17
|
+
const WAProto_1 = require("../../WAProto");
|
|
18
|
+
const Utils_1 = require("../Utils");
|
|
19
|
+
// some extra useful utilities
|
|
20
|
+
const getBinaryNodeChildren = (node, childTag) => {
|
|
21
|
+
if (Array.isArray(node?.content)) {
|
|
22
|
+
return node.content.filter((item) => item.tag === childTag);
|
|
23
|
+
}
|
|
24
|
+
return [];
|
|
25
|
+
};
|
|
26
|
+
exports.getBinaryNodeChildren = getBinaryNodeChildren;
|
|
27
|
+
const getAllBinaryNodeChildren = ({ content }) => {
|
|
28
|
+
if (Array.isArray(content)) {
|
|
29
|
+
return content;
|
|
30
|
+
}
|
|
31
|
+
return [];
|
|
32
|
+
};
|
|
33
|
+
exports.getAllBinaryNodeChildren = getAllBinaryNodeChildren;
|
|
34
|
+
const getBinaryNodeChild = (node, childTag) => {
|
|
35
|
+
if (Array.isArray(node?.content)) {
|
|
36
|
+
return node?.content.find((item) => item.tag === childTag);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.getBinaryNodeChild = getBinaryNodeChild;
|
|
40
|
+
const getBinaryNodeChildBuffer = (node, childTag) => {
|
|
41
|
+
const child = getBinaryNodeChild(node, childTag)?.content;
|
|
42
|
+
if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
|
|
43
|
+
return child;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.getBinaryNodeChildBuffer = getBinaryNodeChildBuffer;
|
|
47
|
+
const getBinaryNodeChildString = (node, childTag) => {
|
|
48
|
+
const child = getBinaryNodeChild(node, childTag)?.content;
|
|
49
|
+
if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
|
|
50
|
+
return Buffer.from(child).toString("utf-8");
|
|
51
|
+
} else if (typeof child === "string") {
|
|
52
|
+
return child;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.getBinaryNodeChildString = getBinaryNodeChildString;
|
|
56
|
+
const getBinaryNodeChildUInt = (node, childTag, length) => {
|
|
57
|
+
const buff = getBinaryNodeChildBuffer(node, childTag);
|
|
58
|
+
if (buff) {
|
|
59
|
+
return bufferToUInt(buff, length);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.getBinaryNodeChildUInt = getBinaryNodeChildUInt;
|
|
63
|
+
const assertNodeErrorFree = (node) => {
|
|
64
|
+
const errNode = getBinaryNodeChild(node, "error");
|
|
65
|
+
if (errNode) {
|
|
66
|
+
throw new boom_1.Boom(errNode.attrs.text || "Unknown error", {
|
|
67
|
+
data: +errNode.attrs.code,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
exports.assertNodeErrorFree = assertNodeErrorFree;
|
|
72
|
+
const reduceBinaryNodeToDictionary = (node, tag) => {
|
|
73
|
+
const nodes = getBinaryNodeChildren(node, tag);
|
|
74
|
+
const dict = nodes.reduce((dict, { attrs }) => {
|
|
75
|
+
dict[attrs.name || attrs.config_code] = attrs.value || attrs.config_value;
|
|
76
|
+
return dict;
|
|
77
|
+
}, {});
|
|
78
|
+
return dict;
|
|
79
|
+
};
|
|
80
|
+
exports.reduceBinaryNodeToDictionary = reduceBinaryNodeToDictionary;
|
|
81
|
+
const getBinaryNodeMessages = ({ content }) => {
|
|
82
|
+
const msgs = [];
|
|
83
|
+
if (Array.isArray(content)) {
|
|
84
|
+
for (const item of content) {
|
|
85
|
+
if (item.tag === "message") {
|
|
86
|
+
msgs.push(WAProto_1.proto.WebMessageInfo.decode(item.content));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return msgs;
|
|
91
|
+
};
|
|
92
|
+
exports.getBinaryNodeMessages = getBinaryNodeMessages;
|
|
93
|
+
function bufferToUInt(e, t) {
|
|
94
|
+
let a = 0;
|
|
95
|
+
for (let i = 0; i < t; i++) {
|
|
96
|
+
a = 256 * a + e[i];
|
|
97
|
+
}
|
|
98
|
+
return a;
|
|
99
|
+
}
|
|
100
|
+
const tabs = (n) => "\t".repeat(n);
|
|
101
|
+
function binaryNodeToString(node, i = 0) {
|
|
102
|
+
if (!node) {
|
|
103
|
+
return node;
|
|
104
|
+
}
|
|
105
|
+
if (typeof node === "string") {
|
|
106
|
+
return tabs(i) + node;
|
|
107
|
+
}
|
|
108
|
+
if (node instanceof Uint8Array) {
|
|
109
|
+
return tabs(i) + Buffer.from(node).toString("hex");
|
|
110
|
+
}
|
|
111
|
+
if (Array.isArray(node)) {
|
|
112
|
+
return node
|
|
113
|
+
.map((x) => tabs(i + 1) + binaryNodeToString(x, i + 1))
|
|
114
|
+
.join("\n");
|
|
115
|
+
}
|
|
116
|
+
const children = binaryNodeToString(node.content, i + 1);
|
|
117
|
+
const tag = `<${node.tag} ${Object.entries(node.attrs || {})
|
|
118
|
+
.filter(([, v]) => v !== undefined)
|
|
119
|
+
.map(([k, v]) => `${k}='${v}'`)
|
|
120
|
+
.join(" ")}`;
|
|
121
|
+
const content = children ? `>\n${children}\n${tabs(i)}</${node.tag}>` : "/>";
|
|
122
|
+
return tag + content;
|
|
123
|
+
}
|
|
124
|
+
exports.binaryNodeToString = binaryNodeToString;
|
|
125
|
+
const getBinaryNodeFilter = (node) => {
|
|
126
|
+
if (!Array.isArray(node)) return false;
|
|
127
|
+
|
|
128
|
+
return node.some(
|
|
129
|
+
(item) =>
|
|
130
|
+
["native_flow"].includes(item?.content?.[0]?.content?.[0]?.tag) ||
|
|
131
|
+
["interactive", "buttons", "list"].includes(item?.content?.[0]?.tag) ||
|
|
132
|
+
["hsm", "biz"].includes(item?.tag) ||
|
|
133
|
+
(["bot"].includes(item?.tag) && item?.attrs?.biz_bot === "1"),
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
exports.getBinaryNodeFilter = getBinaryNodeFilter;
|
|
137
|
+
const getAdditionalNode = (name) => {
|
|
138
|
+
if (name) name = name.toLowerCase();
|
|
139
|
+
const ts = Utils_1.unixTimestampSeconds(new Date()) - 77980457;
|
|
140
|
+
|
|
141
|
+
const order_response_name = {
|
|
142
|
+
review_and_pay: "order_details",
|
|
143
|
+
review_order: "order_status",
|
|
144
|
+
payment_info: "payment_info",
|
|
145
|
+
payment_status: "payment_status",
|
|
146
|
+
payment_method: "payment_method",
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const flow_name = {
|
|
150
|
+
cta_catalog: "cta_catalog",
|
|
151
|
+
mpm: "mpm",
|
|
152
|
+
call_request: "call_permission_request",
|
|
153
|
+
view_catalog: "automated_greeting_message_view_catalog",
|
|
154
|
+
wa_pay_detail: "wa_payment_transaction_details",
|
|
155
|
+
send_location: "send_location",
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
if (order_response_name[name]) {
|
|
159
|
+
return [
|
|
160
|
+
{
|
|
161
|
+
tag: "biz",
|
|
162
|
+
attrs: {
|
|
163
|
+
native_flow_name: order_response_name[name],
|
|
164
|
+
},
|
|
165
|
+
content: [],
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
} else if (flow_name[name] || name === "interactive" || name === "buttons") {
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
tag: "biz",
|
|
172
|
+
attrs: {
|
|
173
|
+
actual_actors: "2",
|
|
174
|
+
host_storage: "2",
|
|
175
|
+
privacy_mode_ts: `${ts}`,
|
|
176
|
+
},
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
tag: "engagement",
|
|
180
|
+
attrs: {
|
|
181
|
+
customer_service_state: "open",
|
|
182
|
+
conversation_state: "open",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
tag: "interactive",
|
|
187
|
+
attrs: {
|
|
188
|
+
type: "native_flow",
|
|
189
|
+
v: "1",
|
|
190
|
+
},
|
|
191
|
+
content: [
|
|
192
|
+
{
|
|
193
|
+
tag: "native_flow",
|
|
194
|
+
attrs: {
|
|
195
|
+
v: "9",
|
|
196
|
+
name: flow_name[name] ?? "mixed",
|
|
197
|
+
},
|
|
198
|
+
content: [],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
];
|
|
205
|
+
} else {
|
|
206
|
+
return [
|
|
207
|
+
{
|
|
208
|
+
tag: "biz",
|
|
209
|
+
attrs: {
|
|
210
|
+
actual_actors: "2",
|
|
211
|
+
host_storage: "2",
|
|
212
|
+
privacy_mode_ts: `${ts}`,
|
|
213
|
+
},
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
tag: "engagement",
|
|
217
|
+
attrs: {
|
|
218
|
+
customer_service_state: "open",
|
|
219
|
+
conversation_state: "open",
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
exports.getAdditionalNode = getAdditionalNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding =
|
|
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 (
|
|
9
|
+
!desc ||
|
|
10
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}
|
|
21
|
+
: function (o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
});
|
|
25
|
+
var __exportStar =
|
|
26
|
+
(this && this.__exportStar) ||
|
|
27
|
+
function (m, exports) {
|
|
28
|
+
for (var p in m)
|
|
29
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
30
|
+
__createBinding(exports, m, p);
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
__exportStar(require("./encode"), exports);
|
|
34
|
+
__exportStar(require("./decode"), exports);
|
|
35
|
+
__exportStar(require("./generic-utils"), exports);
|
|
36
|
+
__exportStar(require("./jid-utils"), exports);
|
|
37
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jidNormalizedUser =
|
|
4
|
+
exports.isJidNewsLetter =
|
|
5
|
+
exports.isJidStatusBroadcast =
|
|
6
|
+
exports.isJidGroup =
|
|
7
|
+
exports.isJidBroadcast =
|
|
8
|
+
exports.isLidUser =
|
|
9
|
+
exports.isJidUser =
|
|
10
|
+
exports.areJidsSameUser =
|
|
11
|
+
exports.jidDecode =
|
|
12
|
+
exports.jidEncode =
|
|
13
|
+
exports.STORIES_JID =
|
|
14
|
+
exports.PSA_WID =
|
|
15
|
+
exports.SERVER_JID =
|
|
16
|
+
exports.OFFICIAL_BIZ_JID =
|
|
17
|
+
exports.S_WHATSAPP_NET =
|
|
18
|
+
void 0;
|
|
19
|
+
exports.S_WHATSAPP_NET = "@s.whatsapp.net";
|
|
20
|
+
exports.OFFICIAL_BIZ_JID = "16505361212@c.us";
|
|
21
|
+
exports.SERVER_JID = "server@c.us";
|
|
22
|
+
exports.PSA_WID = "0@c.us";
|
|
23
|
+
exports.STORIES_JID = "status@broadcast";
|
|
24
|
+
const jidEncode = (user, server, device, agent) => {
|
|
25
|
+
return `${user || ""}${!!agent ? `_${agent}` : ""}${!!device ? `:${device}` : ""}@${server}`;
|
|
26
|
+
};
|
|
27
|
+
exports.jidEncode = jidEncode;
|
|
28
|
+
const jidDecode = (jid) => {
|
|
29
|
+
const sepIdx = typeof jid === "string" ? jid.indexOf("@") : -1;
|
|
30
|
+
if (sepIdx < 0) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const server = jid.slice(sepIdx + 1);
|
|
34
|
+
const userCombined = jid.slice(0, sepIdx);
|
|
35
|
+
const [userAgent, device] = userCombined.split(":");
|
|
36
|
+
const user = userAgent.split("_")[0];
|
|
37
|
+
return {
|
|
38
|
+
server,
|
|
39
|
+
user,
|
|
40
|
+
domainType: server === "lid" ? 1 : 0,
|
|
41
|
+
device: device ? +device : undefined,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.jidDecode = jidDecode;
|
|
45
|
+
/** is the jid a user */
|
|
46
|
+
const areJidsSameUser = (jid1, jid2) => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return (
|
|
49
|
+
((_a = (0, exports.jidDecode)(jid1)) === null || _a === void 0
|
|
50
|
+
? void 0
|
|
51
|
+
: _a.user) ===
|
|
52
|
+
((_b = (0, exports.jidDecode)(jid2)) === null || _b === void 0
|
|
53
|
+
? void 0
|
|
54
|
+
: _b.user)
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
exports.areJidsSameUser = areJidsSameUser;
|
|
58
|
+
/** is the jid a user */
|
|
59
|
+
const isJidUser = (jid) =>
|
|
60
|
+
jid === null || jid === void 0 ? void 0 : jid.endsWith("@s.whatsapp.net");
|
|
61
|
+
exports.isJidUser = isJidUser;
|
|
62
|
+
/** is the jid a group */
|
|
63
|
+
const isLidUser = (jid) =>
|
|
64
|
+
jid === null || jid === void 0 ? void 0 : jid.endsWith("@lid");
|
|
65
|
+
exports.isLidUser = isLidUser;
|
|
66
|
+
/** is the jid a broadcast */
|
|
67
|
+
const isJidBroadcast = (jid) =>
|
|
68
|
+
jid === null || jid === void 0 ? void 0 : jid.endsWith("@broadcast");
|
|
69
|
+
exports.isJidBroadcast = isJidBroadcast;
|
|
70
|
+
/** is the jid a group */
|
|
71
|
+
const isJidGroup = (jid) =>
|
|
72
|
+
jid === null || jid === void 0 ? void 0 : jid.endsWith("@g.us");
|
|
73
|
+
exports.isJidGroup = isJidGroup;
|
|
74
|
+
/** is the jid the status broadcast */
|
|
75
|
+
const isJidStatusBroadcast = (jid) => jid === "status@broadcast";
|
|
76
|
+
exports.isJidStatusBroadcast = isJidStatusBroadcast;
|
|
77
|
+
/** is the jid the newsletter */
|
|
78
|
+
const isJidNewsLetter = (jid) =>
|
|
79
|
+
jid === null || jid === void 0 ? void 0 : jid.endsWith("newsletter");
|
|
80
|
+
exports.isJidNewsLetter = isJidNewsLetter;
|
|
81
|
+
const jidNormalizedUser = (jid) => {
|
|
82
|
+
const result = (0, exports.jidDecode)(jid);
|
|
83
|
+
if (!result) {
|
|
84
|
+
return "";
|
|
85
|
+
}
|
|
86
|
+
const { user, server } = result;
|
|
87
|
+
return (0, exports.jidEncode)(
|
|
88
|
+
user,
|
|
89
|
+
server === "c.us" ? "s.whatsapp.net" : server,
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
exports.jidNormalizedUser = jidNormalizedUser;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BinaryInfo = void 0;
|
|
4
|
+
class BinaryInfo {
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this.protocolVersion = 5;
|
|
7
|
+
this.sequence = 0;
|
|
8
|
+
this.events = [];
|
|
9
|
+
this.buffer = [];
|
|
10
|
+
Object.assign(this, options);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.BinaryInfo = BinaryInfo;
|