@queenanya/baileys 6.9.5 → 7.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/README.md +56 -13
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +4 -1
- package/lib/Socket/business.d.ts +46 -9
- package/lib/Socket/chats.d.ts +10 -2
- package/lib/Socket/chats.js +40 -1
- package/lib/Socket/groups.d.ts +17 -3
- package/lib/Socket/groups.js +12 -1
- package/lib/Socket/index.d.ts +46 -9
- package/lib/Socket/messages-recv.d.ts +45 -9
- package/lib/Socket/messages-recv.js +166 -15
- package/lib/Socket/messages-send.d.ts +39 -5
- package/lib/Socket/messages-send.js +153 -37
- package/lib/Socket/newsletter.d.ts +140 -0
- package/lib/Socket/newsletter.js +249 -0
- package/lib/Socket/registration.d.ts +46 -12
- package/lib/Socket/socket.js +4 -3
- package/lib/Store/make-in-memory-store.js +5 -1
- package/lib/Types/Chat.d.ts +5 -0
- package/lib/Types/Events.d.ts +32 -1
- package/lib/Types/GroupMetadata.d.ts +1 -1
- package/lib/Types/Label.d.ts +11 -0
- package/lib/Types/Message.d.ts +39 -27
- package/lib/Types/Newsletter.d.ts +79 -0
- package/lib/Types/Newsletter.js +18 -0
- package/lib/Types/Socket.d.ts +7 -0
- package/lib/Types/index.d.ts +9 -0
- package/lib/Types/index.js +1 -0
- package/lib/Utils/chat-utils.js +16 -0
- package/lib/Utils/crypto.d.ts +1 -1
- package/lib/Utils/crypto.js +4 -2
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +50 -22
- package/lib/Utils/generics.d.ts +30 -10
- package/lib/Utils/generics.js +82 -10
- package/lib/Utils/history.d.ts +4 -0
- package/lib/Utils/history.js +3 -0
- package/lib/Utils/logger.d.ts +1 -3
- package/lib/Utils/messages-media.d.ts +10 -1
- package/lib/Utils/messages-media.js +61 -18
- package/lib/Utils/messages.js +72 -69
- package/lib/Utils/noise-handler.d.ts +1 -1
- package/lib/Utils/noise-handler.js +2 -2
- package/lib/Utils/process-message.d.ts +3 -2
- package/lib/Utils/process-message.js +47 -24
- package/lib/Utils/signal.js +21 -16
- package/lib/WABinary/decode.d.ts +2 -2
- package/lib/WABinary/decode.js +6 -4
- package/lib/WABinary/encode.d.ts +1 -2
- package/lib/WABinary/encode.js +1 -1
- package/lib/WABinary/jid-utils.d.ts +3 -1
- package/lib/WABinary/jid-utils.js +4 -1
- package/package.json +31 -27
|
@@ -102,8 +102,8 @@ function decryptPollVote({ encPayload, encIv }, { pollCreatorJid, pollMsgId, pol
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
exports.decryptPollVote = decryptPollVote;
|
|
105
|
-
const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, keyStore, logger, options, getMessage }) => {
|
|
106
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
105
|
+
const processMessage = async (message, { shouldProcessHistoryMsg, placeholderResendCache, ev, creds, keyStore, logger, options, getMessage }) => {
|
|
106
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
107
107
|
const meId = creds.me.id;
|
|
108
108
|
const { accountSettings } = creds;
|
|
109
109
|
const chat = { id: (0, WABinary_1.jidNormalizedUser)((0, exports.getChatId)(message.key)) };
|
|
@@ -137,14 +137,21 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
137
137
|
isLatest,
|
|
138
138
|
}, 'got history notification');
|
|
139
139
|
if (process) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
if (histNotification.syncType !== WAProto_1.proto.HistorySync.HistorySyncType.ON_DEMAND) {
|
|
141
|
+
ev.emit('creds.update', {
|
|
142
|
+
processedHistoryMessages: [
|
|
143
|
+
...(creds.processedHistoryMessages || []),
|
|
144
|
+
{ key: message.key, messageTimestamp: message.messageTimestamp }
|
|
145
|
+
]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
146
148
|
const data = await (0, history_1.downloadAndProcessHistorySyncNotification)(histNotification, options);
|
|
147
|
-
ev.emit('messaging-history.set', {
|
|
149
|
+
ev.emit('messaging-history.set', {
|
|
150
|
+
...data,
|
|
151
|
+
isLatest: histNotification.syncType !== WAProto_1.proto.HistorySync.HistorySyncType.ON_DEMAND
|
|
152
|
+
? isLatest
|
|
153
|
+
: undefined
|
|
154
|
+
});
|
|
148
155
|
}
|
|
149
156
|
break;
|
|
150
157
|
case WAProto_1.proto.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE:
|
|
@@ -187,14 +194,21 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
187
194
|
case WAProto_1.proto.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:
|
|
188
195
|
const response = protocolMsg.peerDataOperationRequestResponseMessage;
|
|
189
196
|
if (response) {
|
|
197
|
+
placeholderResendCache === null || placeholderResendCache === void 0 ? void 0 : placeholderResendCache.del(response.stanzaId);
|
|
198
|
+
// TODO: IMPLEMENT HISTORY SYNC ETC (sticker uploads etc.).
|
|
190
199
|
const { peerDataOperationResult } = response;
|
|
191
200
|
for (const result of peerDataOperationResult) {
|
|
192
201
|
const { placeholderMessageResendResponse: retryResponse } = result;
|
|
193
202
|
if (retryResponse) {
|
|
194
203
|
const webMessageInfo = WAProto_1.proto.WebMessageInfo.decode(retryResponse.webMessageInfoBytes);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
204
|
+
// wait till another upsert event is available, don't want it to be part of the PDO response message
|
|
205
|
+
setTimeout(() => {
|
|
206
|
+
ev.emit('messages.upsert', {
|
|
207
|
+
messages: [webMessageInfo],
|
|
208
|
+
type: 'notify',
|
|
209
|
+
requestId: response.stanzaId
|
|
210
|
+
});
|
|
211
|
+
}, 500);
|
|
198
212
|
}
|
|
199
213
|
}
|
|
200
214
|
}
|
|
@@ -208,11 +222,11 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
208
222
|
};
|
|
209
223
|
ev.emit('messages.reaction', [{
|
|
210
224
|
reaction,
|
|
211
|
-
key: content.reactionMessage.key,
|
|
225
|
+
key: (_d = content.reactionMessage) === null || _d === void 0 ? void 0 : _d.key,
|
|
212
226
|
}]);
|
|
213
227
|
}
|
|
214
228
|
else if (message.messageStubType) {
|
|
215
|
-
const jid = message.key.remoteJid;
|
|
229
|
+
const jid = (_e = message.key) === null || _e === void 0 ? void 0 : _e.remoteJid;
|
|
216
230
|
//let actor = whatsappID (message.participant)
|
|
217
231
|
let participants;
|
|
218
232
|
const emitParticipantsUpdate = (action) => (ev.emit('group-participants.update', { id: jid, author: message.participant, participants, action }));
|
|
@@ -225,6 +239,10 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
225
239
|
};
|
|
226
240
|
const participantsIncludesMe = () => participants.find(jid => (0, WABinary_1.areJidsSameUser)(meId, jid));
|
|
227
241
|
switch (message.messageStubType) {
|
|
242
|
+
case Types_1.WAMessageStubType.GROUP_PARTICIPANT_CHANGE_NUMBER:
|
|
243
|
+
participants = message.messageStubParameters || [];
|
|
244
|
+
emitParticipantsUpdate('modify');
|
|
245
|
+
break;
|
|
228
246
|
case Types_1.WAMessageStubType.GROUP_PARTICIPANT_LEAVE:
|
|
229
247
|
case Types_1.WAMessageStubType.GROUP_PARTICIPANT_REMOVE:
|
|
230
248
|
participants = message.messageStubParameters || [];
|
|
@@ -252,34 +270,39 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
252
270
|
emitParticipantsUpdate('promote');
|
|
253
271
|
break;
|
|
254
272
|
case Types_1.WAMessageStubType.GROUP_CHANGE_ANNOUNCE:
|
|
255
|
-
const announceValue = (
|
|
273
|
+
const announceValue = (_f = message.messageStubParameters) === null || _f === void 0 ? void 0 : _f[0];
|
|
256
274
|
emitGroupUpdate({ announce: announceValue === 'true' || announceValue === 'on' });
|
|
257
275
|
break;
|
|
258
276
|
case Types_1.WAMessageStubType.GROUP_CHANGE_RESTRICT:
|
|
259
|
-
const restrictValue = (
|
|
277
|
+
const restrictValue = (_g = message.messageStubParameters) === null || _g === void 0 ? void 0 : _g[0];
|
|
260
278
|
emitGroupUpdate({ restrict: restrictValue === 'true' || restrictValue === 'on' });
|
|
261
279
|
break;
|
|
262
280
|
case Types_1.WAMessageStubType.GROUP_CHANGE_SUBJECT:
|
|
263
|
-
const name = (
|
|
281
|
+
const name = (_h = message.messageStubParameters) === null || _h === void 0 ? void 0 : _h[0];
|
|
264
282
|
chat.name = name;
|
|
265
283
|
emitGroupUpdate({ subject: name });
|
|
266
284
|
break;
|
|
285
|
+
case Types_1.WAMessageStubType.GROUP_CHANGE_DESCRIPTION:
|
|
286
|
+
const description = (_j = message.messageStubParameters) === null || _j === void 0 ? void 0 : _j[0];
|
|
287
|
+
chat.description = description;
|
|
288
|
+
emitGroupUpdate({ desc: description });
|
|
289
|
+
break;
|
|
267
290
|
case Types_1.WAMessageStubType.GROUP_CHANGE_INVITE_LINK:
|
|
268
|
-
const code = (
|
|
291
|
+
const code = (_k = message.messageStubParameters) === null || _k === void 0 ? void 0 : _k[0];
|
|
269
292
|
emitGroupUpdate({ inviteCode: code });
|
|
270
293
|
break;
|
|
271
294
|
case Types_1.WAMessageStubType.GROUP_MEMBER_ADD_MODE:
|
|
272
|
-
const memberAddValue = (
|
|
295
|
+
const memberAddValue = (_l = message.messageStubParameters) === null || _l === void 0 ? void 0 : _l[0];
|
|
273
296
|
emitGroupUpdate({ memberAddMode: memberAddValue === 'all_member_add' });
|
|
274
297
|
break;
|
|
275
298
|
case Types_1.WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:
|
|
276
|
-
const approvalMode = (
|
|
299
|
+
const approvalMode = (_m = message.messageStubParameters) === null || _m === void 0 ? void 0 : _m[0];
|
|
277
300
|
emitGroupUpdate({ joinApprovalMode: approvalMode === 'on' });
|
|
278
301
|
break;
|
|
279
302
|
case Types_1.WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:
|
|
280
|
-
const participant = (
|
|
281
|
-
const action = (
|
|
282
|
-
const method = (
|
|
303
|
+
const participant = (_o = message.messageStubParameters) === null || _o === void 0 ? void 0 : _o[0];
|
|
304
|
+
const action = (_p = message.messageStubParameters) === null || _p === void 0 ? void 0 : _p[1];
|
|
305
|
+
const method = (_q = message.messageStubParameters) === null || _q === void 0 ? void 0 : _q[2];
|
|
283
306
|
emitGroupRequestJoin(participant, action, method);
|
|
284
307
|
break;
|
|
285
308
|
}
|
|
@@ -292,7 +315,7 @@ const processMessage = async (message, { shouldProcessHistoryMsg, ev, creds, key
|
|
|
292
315
|
const meIdNormalised = (0, WABinary_1.jidNormalizedUser)(meId);
|
|
293
316
|
const pollCreatorJid = (0, generics_1.getKeyAuthor)(creationMsgKey, meIdNormalised);
|
|
294
317
|
const voterJid = (0, generics_1.getKeyAuthor)(message.key, meIdNormalised);
|
|
295
|
-
const pollEncKey = (
|
|
318
|
+
const pollEncKey = (_r = pollMsg.messageContextInfo) === null || _r === void 0 ? void 0 : _r.messageSecret;
|
|
296
319
|
try {
|
|
297
320
|
const voteMsg = decryptPollVote(content.pollUpdateMessage.vote, {
|
|
298
321
|
pollEncKey,
|
package/lib/Utils/signal.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNextPreKeysNode = exports.getNextPreKeys = exports.extractDeviceJids = exports.parseAndInjectE2ESessions = exports.xmppPreKey = exports.xmppSignedPreKey = exports.generateOrGetPreKeys = exports.getPreKeys = exports.createSignalIdentity = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
4
5
|
const Defaults_1 = require("../Defaults");
|
|
5
6
|
const WABinary_1 = require("../WABinary");
|
|
6
7
|
const crypto_1 = require("./crypto");
|
|
@@ -66,22 +67,26 @@ const parseAndInjectE2ESessions = async (node, repository) => {
|
|
|
66
67
|
for (const node of nodes) {
|
|
67
68
|
(0, WABinary_1.assertNodeErrorFree)(node);
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
jid
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
const chunkSize = 100;
|
|
71
|
+
const chunks = (0, lodash_1.chunk)(nodes, chunkSize);
|
|
72
|
+
for (const nodesChunk of chunks) {
|
|
73
|
+
await Promise.all(nodesChunk.map(async (node) => {
|
|
74
|
+
const signedKey = (0, WABinary_1.getBinaryNodeChild)(node, 'skey');
|
|
75
|
+
const key = (0, WABinary_1.getBinaryNodeChild)(node, 'key');
|
|
76
|
+
const identity = (0, WABinary_1.getBinaryNodeChildBuffer)(node, 'identity');
|
|
77
|
+
const jid = node.attrs.jid;
|
|
78
|
+
const registrationId = (0, WABinary_1.getBinaryNodeChildUInt)(node, 'registration', 4);
|
|
79
|
+
await repository.injectE2ESession({
|
|
80
|
+
jid,
|
|
81
|
+
session: {
|
|
82
|
+
registrationId: registrationId,
|
|
83
|
+
identityKey: (0, crypto_1.generateSignalPubKey)(identity),
|
|
84
|
+
signedPreKey: extractKey(signedKey),
|
|
85
|
+
preKey: extractKey(key)
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
85
90
|
};
|
|
86
91
|
exports.parseAndInjectE2ESessions = parseAndInjectE2ESessions;
|
|
87
92
|
const extractDeviceJids = (result, myJid, excludeZeroDevices) => {
|
package/lib/WABinary/decode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { BinaryNode, BinaryNodeCodingOptions } from './types';
|
|
3
|
-
export declare const decompressingIfRequired: (buffer: Buffer) => Buffer
|
|
3
|
+
export declare const decompressingIfRequired: (buffer: Buffer) => Promise<Buffer>;
|
|
4
4
|
export declare const decodeDecompressedBinaryNode: (buffer: Buffer, opts: Pick<BinaryNodeCodingOptions, 'DOUBLE_BYTE_TOKENS' | 'SINGLE_BYTE_TOKENS' | 'TAGS'>, indexRef?: {
|
|
5
5
|
index: number;
|
|
6
6
|
}) => BinaryNode;
|
|
7
|
-
export declare const decodeBinaryNode: (buff: Buffer) => BinaryNode
|
|
7
|
+
export declare const decodeBinaryNode: (buff: Buffer) => Promise<BinaryNode>;
|
package/lib/WABinary/decode.js
CHANGED
|
@@ -24,12 +24,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.decodeBinaryNode = exports.decodeDecompressedBinaryNode = exports.decompressingIfRequired = void 0;
|
|
27
|
+
const util_1 = require("util");
|
|
27
28
|
const zlib_1 = require("zlib");
|
|
28
29
|
const constants = __importStar(require("./constants"));
|
|
29
30
|
const jid_utils_1 = require("./jid-utils");
|
|
30
|
-
const
|
|
31
|
+
const inflatePromise = (0, util_1.promisify)(zlib_1.inflate);
|
|
32
|
+
const decompressingIfRequired = async (buffer) => {
|
|
31
33
|
if (2 & buffer.readUInt8()) {
|
|
32
|
-
buffer =
|
|
34
|
+
buffer = await inflatePromise(buffer.slice(1));
|
|
33
35
|
}
|
|
34
36
|
else { // nodes with no compression have a 0x00 prefix, we remove that
|
|
35
37
|
buffer = buffer.slice(1);
|
|
@@ -245,8 +247,8 @@ const decodeDecompressedBinaryNode = (buffer, opts, indexRef = { index: 0 }) =>
|
|
|
245
247
|
};
|
|
246
248
|
};
|
|
247
249
|
exports.decodeDecompressedBinaryNode = decodeDecompressedBinaryNode;
|
|
248
|
-
const decodeBinaryNode = (buff) => {
|
|
249
|
-
const decompBuff = (0, exports.decompressingIfRequired)(buff);
|
|
250
|
+
const decodeBinaryNode = async (buff) => {
|
|
251
|
+
const decompBuff = await (0, exports.decompressingIfRequired)(buff);
|
|
250
252
|
return (0, exports.decodeDecompressedBinaryNode)(decompBuff, constants);
|
|
251
253
|
};
|
|
252
254
|
exports.decodeBinaryNode = decodeBinaryNode;
|
package/lib/WABinary/encode.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { BinaryNode, BinaryNodeCodingOptions } from './types';
|
|
3
|
-
export declare const encodeBinaryNode: ({ tag, attrs, content }: BinaryNode, opts?: Pick<BinaryNodeCodingOptions, 'TAGS' | 'TOKEN_MAP'>, buffer?: number[]) =>
|
|
2
|
+
export declare const encodeBinaryNode: ({ tag, attrs, content }: BinaryNode, opts?: Pick<BinaryNodeCodingOptions, 'TAGS' | 'TOKEN_MAP'>, buffer?: number[]) => number[];
|
package/lib/WABinary/encode.js
CHANGED
|
@@ -223,6 +223,6 @@ const encodeBinaryNode = ({ tag, attrs, content }, opts = constants, buffer = [0
|
|
|
223
223
|
else {
|
|
224
224
|
throw new Error(`invalid children for header "${tag}": ${content} (${typeof content})`);
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return buffer;
|
|
227
227
|
};
|
|
228
228
|
exports.encodeBinaryNode = encodeBinaryNode;
|
|
@@ -3,7 +3,7 @@ export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
|
|
|
3
3
|
export declare const SERVER_JID = "server@c.us";
|
|
4
4
|
export declare const PSA_WID = "0@c.us";
|
|
5
5
|
export declare const STORIES_JID = "status@broadcast";
|
|
6
|
-
export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid';
|
|
6
|
+
export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter';
|
|
7
7
|
export type JidWithDevice = {
|
|
8
8
|
user: string;
|
|
9
9
|
device?: number;
|
|
@@ -26,4 +26,6 @@ export declare const isJidBroadcast: (jid: string | undefined) => boolean | unde
|
|
|
26
26
|
export declare const isJidGroup: (jid: string | undefined) => boolean | undefined;
|
|
27
27
|
/** is the jid the status broadcast */
|
|
28
28
|
export declare const isJidStatusBroadcast: (jid: string) => boolean;
|
|
29
|
+
/** is the jid a newsletter */
|
|
30
|
+
export declare const isJidNewsletter: (jid: string | undefined) => boolean | undefined;
|
|
29
31
|
export declare const jidNormalizedUser: (jid: string | undefined) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jidNormalizedUser = exports.isJidStatusBroadcast = exports.isJidGroup = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.S_WHATSAPP_NET = void 0;
|
|
3
|
+
exports.jidNormalizedUser = exports.isJidNewsletter = exports.isJidStatusBroadcast = exports.isJidGroup = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.S_WHATSAPP_NET = void 0;
|
|
4
4
|
exports.S_WHATSAPP_NET = '@s.whatsapp.net';
|
|
5
5
|
exports.OFFICIAL_BIZ_JID = '16505361212@c.us';
|
|
6
6
|
exports.SERVER_JID = 'server@c.us';
|
|
@@ -48,6 +48,9 @@ exports.isJidGroup = isJidGroup;
|
|
|
48
48
|
/** is the jid the status broadcast */
|
|
49
49
|
const isJidStatusBroadcast = (jid) => jid === 'status@broadcast';
|
|
50
50
|
exports.isJidStatusBroadcast = isJidStatusBroadcast;
|
|
51
|
+
/** is the jid a newsletter */
|
|
52
|
+
const isJidNewsletter = (jid) => (jid === null || jid === void 0 ? void 0 : jid.endsWith('@newsletter'));
|
|
53
|
+
exports.isJidNewsletter = isJidNewsletter;
|
|
51
54
|
const jidNormalizedUser = (jid) => {
|
|
52
55
|
const result = (0, exports.jidDecode)(jid);
|
|
53
56
|
if (!result) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@queenanya/baileys",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "WhatsApp API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -43,42 +43,46 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
46
|
-
"@hapi/boom": "^
|
|
47
|
-
"@queenanya/
|
|
46
|
+
"@hapi/boom": "^10.0.1",
|
|
47
|
+
"@queenanya/invite": "latest",
|
|
48
48
|
"async-lock": "^1.4.1",
|
|
49
|
-
"audio-decode": "^2.
|
|
50
|
-
"axios": "^1.
|
|
49
|
+
"audio-decode": "^2.2.0",
|
|
50
|
+
"axios": "^1.7.2",
|
|
51
51
|
"cache-manager": "4.0.1",
|
|
52
|
-
"futoin-hkdf": "^1.5.
|
|
52
|
+
"futoin-hkdf": "^1.5.3",
|
|
53
53
|
"json": "^11.0.0",
|
|
54
|
-
"libphonenumber-js": "^1.
|
|
54
|
+
"libphonenumber-js": "^1.11.4",
|
|
55
55
|
"libsignal": "npm:@queenanya/libsignal@latest",
|
|
56
|
+
"lodash": "^4.17.21",
|
|
57
|
+
"megajs": "1.1.7",
|
|
56
58
|
"music-metadata": "^7.12.3",
|
|
57
59
|
"node-cache": "^5.1.2",
|
|
58
|
-
"pino": "^
|
|
59
|
-
"protobufjs": "^7.2
|
|
60
|
-
"
|
|
61
|
-
"
|
|
60
|
+
"pino": "^9.3.0",
|
|
61
|
+
"protobufjs": "^7.3.2",
|
|
62
|
+
"release-it": "^17.6.0",
|
|
63
|
+
"uuid": "^10.0.0",
|
|
64
|
+
"ws": "^8.18.0"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
67
|
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|
|
65
|
-
"@types/got": "^9.6.
|
|
66
|
-
"@types/jest": "^
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"@types/sharp": "^0.
|
|
69
|
-
"@types/ws": "^8.
|
|
70
|
-
"conventional-changelog-cli": "^
|
|
71
|
-
"eslint": "^
|
|
72
|
-
"jest": "^
|
|
73
|
-
"jimp": "^0.
|
|
68
|
+
"@types/got": "^9.6.12",
|
|
69
|
+
"@types/jest": "^29.5.12",
|
|
70
|
+
"@types/node": "^20.14.10",
|
|
71
|
+
"@types/sharp": "^0.31.1",
|
|
72
|
+
"@types/ws": "^8.5.11",
|
|
73
|
+
"conventional-changelog-cli": "^5.0.0",
|
|
74
|
+
"eslint": "^9.7.0",
|
|
75
|
+
"jest": "^29.7.0",
|
|
76
|
+
"jimp": "^0.22.12",
|
|
74
77
|
"json": "^11.0.0",
|
|
75
|
-
"link-preview-js": "^3.0.
|
|
76
|
-
"
|
|
78
|
+
"link-preview-js": "^3.0.5",
|
|
79
|
+
"megajs": "1.1.7",
|
|
80
|
+
"open": "^10.1.0",
|
|
77
81
|
"qrcode-terminal": "^0.12.0",
|
|
78
|
-
"release-it": "^
|
|
79
|
-
"sharp": "^0.
|
|
80
|
-
"ts-jest": "^
|
|
81
|
-
"ts-node": "^10.
|
|
82
|
+
"release-it": "^17.6.0",
|
|
83
|
+
"sharp": "^0.33.4",
|
|
84
|
+
"ts-jest": "^29.2.2",
|
|
85
|
+
"ts-node": "^10.9.2",
|
|
82
86
|
"typedoc": "^0.24.7",
|
|
83
87
|
"typescript": "^4.6.4"
|
|
84
88
|
},
|
|
@@ -86,7 +90,7 @@
|
|
|
86
90
|
"jimp": "^0.16.1",
|
|
87
91
|
"link-preview-js": "^3.0.0",
|
|
88
92
|
"qrcode-terminal": "^0.12.0",
|
|
89
|
-
"sharp": "^0.32.
|
|
93
|
+
"sharp": "^0.32.6"
|
|
90
94
|
},
|
|
91
95
|
"peerDependenciesMeta": {
|
|
92
96
|
"jimp": {
|