@vinzsocket/baileys 2.8.30 → 3.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/fix-imports.js +7 -16
- package/WAProto/index.js +1 -37306
- package/lib/Defaults/index.js +37 -33
- package/lib/Signal/Group/ciphertext-message.js +6 -2
- package/lib/Signal/Group/group-session-builder.js +12 -7
- package/lib/Signal/Group/group_cipher.js +18 -13
- package/lib/Signal/Group/index.js +77 -12
- package/lib/Signal/Group/keyhelper.js +15 -8
- package/lib/Signal/Group/queue-job.js +7 -2
- package/lib/Signal/Group/sender-chain-key.js +11 -6
- package/lib/Signal/Group/sender-key-distribution-message.js +10 -6
- package/lib/Signal/Group/sender-key-message.js +14 -9
- package/lib/Signal/Group/sender-key-name.js +6 -2
- package/lib/Signal/Group/sender-key-record.js +13 -9
- package/lib/Signal/Group/sender-key-state.js +10 -6
- package/lib/Signal/Group/sender-message-key.js +9 -4
- package/lib/Signal/libsignal.js +34 -28
- package/lib/Signal/lid-mapping.js +24 -19
- package/lib/Socket/Client/index.js +25 -3
- package/lib/Socket/Client/types.js +8 -4
- package/lib/Socket/Client/websocket.js +16 -11
- package/lib/Socket/business.js +38 -34
- package/lib/Socket/chats.js +100 -95
- package/lib/Socket/communities.js +55 -49
- package/lib/Socket/groups.js +56 -51
- package/lib/Socket/index.js +9 -6
- package/lib/Socket/messages-recv.js +150 -145
- package/lib/Socket/messages-send.js +109 -104
- package/lib/Socket/mex.js +12 -8
- package/lib/Socket/newsletter.js +27 -23
- package/lib/Socket/socket.js +111 -107
- package/lib/Store/index.js +47 -4
- package/lib/Store/make-cache-manager-store.js +17 -11
- package/lib/Store/make-in-memory-store.js +31 -29
- package/lib/Store/make-ordered-dictionary.js +7 -2
- package/lib/Store/object-repository.js +7 -2
- package/lib/Types/Auth.js +3 -2
- package/lib/Types/Bussines.js +3 -2
- package/lib/Types/Call.js +3 -2
- package/lib/Types/Chat.js +5 -2
- package/lib/Types/Contact.js +3 -2
- package/lib/Types/Events.js +1 -2
- package/lib/Types/GroupMetadata.js +3 -2
- package/lib/Types/Label.js +6 -3
- package/lib/Types/LabelAssociation.js +6 -3
- package/lib/Types/Message.js +16 -7
- package/lib/Types/Newsletter.js +8 -5
- package/lib/Types/Product.js +3 -2
- package/lib/Types/Signal.js +1 -2
- package/lib/Types/Socket.js +2 -3
- package/lib/Types/State.js +7 -4
- package/lib/Types/USync.js +1 -2
- package/lib/Types/index.js +153 -15
- package/lib/Utils/auth-utils.js +32 -25
- package/lib/Utils/baileys-event-stream.js +21 -15
- package/lib/Utils/business.js +71 -61
- package/lib/Utils/chat-utils.js +91 -77
- package/lib/Utils/crypto.js +54 -32
- package/lib/Utils/decode-wa-message.js +46 -39
- package/lib/Utils/event-buffer.js +24 -19
- package/lib/Utils/extended-messages.js +14 -9
- package/lib/Utils/generics.js +100 -64
- package/lib/Utils/history.js +30 -23
- package/lib/Utils/index.js +234 -22
- package/lib/Utils/lid-resolver.js +12 -5
- package/lib/Utils/link-preview.js +11 -7
- package/lib/Utils/logger.js +8 -4
- package/lib/Utils/lt-hash.js +8 -5
- package/lib/Utils/make-mutex.js +8 -3
- package/lib/Utils/mention.js +12 -4
- package/lib/Utils/message-retry-manager.js +10 -6
- package/lib/Utils/messages-media.js +127 -95
- package/lib/Utils/messages.js +122 -98
- package/lib/Utils/noise-handler.js +25 -21
- package/lib/Utils/process-message.js +72 -63
- package/lib/Utils/signal.js +45 -33
- package/lib/Utils/use-multi-file-auth-state.js +24 -20
- package/lib/Utils/validate-connection.js +54 -47
- package/lib/WABinary/constants.js +9 -6
- package/lib/WABinary/decode.js +17 -10
- package/lib/WABinary/encode.js +11 -6
- package/lib/WABinary/generic-utils.js +31 -17
- package/lib/WABinary/index.js +58 -6
- package/lib/WABinary/jid-utils.js +36 -20
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.js +6 -2
- package/lib/WAM/constants.js +1 -1
- package/lib/WAM/encode.js +16 -12
- package/lib/WAM/index.js +36 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +9 -5
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +10 -6
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +8 -4
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +8 -4
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +9 -4
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +23 -19
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +6 -2
- package/lib/WAUSync/Protocols/index.js +58 -6
- package/lib/WAUSync/USyncQuery.js +21 -17
- package/lib/WAUSync/USyncUser.js +6 -2
- package/lib/WAUSync/index.js +36 -4
- package/lib/index.js +112 -12
- package/package.json +8 -6
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.makeCacheManagerAuthState = exports.default = void 0;
|
|
5
|
+
var _index = require("../../WAProto/index.js");
|
|
6
|
+
var _index2 = require("../Utils/index.js");
|
|
7
|
+
var _logger = _interopRequireDefault(require("../Utils/logger.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
4
9
|
/**
|
|
5
10
|
* Creates an authentication state backed by any `cache-manager` compatible
|
|
6
11
|
* store (Redis, Memcached, the built-in memory store, etc). Useful when you
|
|
@@ -13,7 +18,7 @@ import logger from '../Utils/logger.js';
|
|
|
13
18
|
* @param store a `cache-manager` store config/instance, as accepted by `caching()`
|
|
14
19
|
* @param sessionKey a unique key prefix to namespace this session's data in the store
|
|
15
20
|
*/
|
|
16
|
-
|
|
21
|
+
const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
17
22
|
let caching;
|
|
18
23
|
try {
|
|
19
24
|
const cacheManagerModule = await import('cache-manager');
|
|
@@ -33,17 +38,17 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
|
33
38
|
if (file === 'creds') {
|
|
34
39
|
ttl = 63115200; // 2 years
|
|
35
40
|
}
|
|
36
|
-
await databaseConn.set(defaultKey(file), JSON.stringify(data, BufferJSON.replacer), ttl);
|
|
41
|
+
await databaseConn.set(defaultKey(file), JSON.stringify(data, _index2.BufferJSON.replacer), ttl);
|
|
37
42
|
};
|
|
38
43
|
const readData = async file => {
|
|
39
44
|
try {
|
|
40
45
|
const data = await databaseConn.get(defaultKey(file));
|
|
41
46
|
if (data) {
|
|
42
|
-
return JSON.parse(data, BufferJSON.reviver);
|
|
47
|
+
return JSON.parse(data, _index2.BufferJSON.reviver);
|
|
43
48
|
}
|
|
44
49
|
return null;
|
|
45
50
|
} catch (error) {
|
|
46
|
-
|
|
51
|
+
_logger.default.error(error);
|
|
47
52
|
return null;
|
|
48
53
|
}
|
|
49
54
|
};
|
|
@@ -51,7 +56,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
|
51
56
|
try {
|
|
52
57
|
return await databaseConn.del(defaultKey(file));
|
|
53
58
|
} catch {
|
|
54
|
-
|
|
59
|
+
_logger.default.error(`Error removing ${file} from session ${sessionKey}`);
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
const clearState = async () => {
|
|
@@ -62,7 +67,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
|
62
67
|
// ignore
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
|
-
const creds = (await readData('creds')) || initAuthCreds();
|
|
70
|
+
const creds = (await readData('creds')) || (0, _index2.initAuthCreds)();
|
|
66
71
|
return {
|
|
67
72
|
clearState,
|
|
68
73
|
saveCreds: () => writeData('creds', creds),
|
|
@@ -74,7 +79,7 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
|
74
79
|
await Promise.all(ids.map(async id => {
|
|
75
80
|
let value = await readData(`${type}-${id}`);
|
|
76
81
|
if (type === 'app-state-sync-key' && value) {
|
|
77
|
-
value = proto.Message.AppStateSyncKeyData.create(value);
|
|
82
|
+
value = _index.proto.Message.AppStateSyncKeyData.create(value);
|
|
78
83
|
}
|
|
79
84
|
data[id] = value;
|
|
80
85
|
}));
|
|
@@ -95,4 +100,5 @@ export const makeCacheManagerAuthState = async (store, sessionKey) => {
|
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
};
|
|
98
|
-
|
|
103
|
+
exports.makeCacheManagerAuthState = makeCacheManagerAuthState;
|
|
104
|
+
var _default = exports.default = makeCacheManagerAuthState;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
export const waChatKey = pin => ({
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.waMessageID = exports.waLabelAssociationKey = exports.waChatKey = exports.makeInMemoryStore = exports.default = void 0;
|
|
5
|
+
var _index = require("../../WAProto/index.js");
|
|
6
|
+
var _index2 = require("../Defaults/index.js");
|
|
7
|
+
var _LabelAssociation = require("../Types/LabelAssociation.js");
|
|
8
|
+
var _index3 = require("../Utils/index.js");
|
|
9
|
+
var _index4 = require("../WABinary/index.js");
|
|
10
|
+
var _makeOrderedDictionary = require("./make-ordered-dictionary.js");
|
|
11
|
+
var _objectRepository = require("./object-repository.js");
|
|
12
|
+
const waChatKey = pin => ({
|
|
14
13
|
key: c => (pin ? c.pinned ? '1' : '0' : '') + (c.archived ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') : '') + c.id,
|
|
15
14
|
compare: (k1, k2) => k2.localeCompare(k1)
|
|
16
15
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
exports.waChatKey = waChatKey;
|
|
17
|
+
const waMessageID = m => m.key.id || '';
|
|
18
|
+
exports.waMessageID = waMessageID;
|
|
19
|
+
const waLabelAssociationKey = exports.waLabelAssociationKey = {
|
|
20
|
+
key: la => la.type === _LabelAssociation.LabelAssociationType.Chat ? la.chatId + la.labelId : la.chatId + la.messageId + la.labelId,
|
|
20
21
|
compare: (k1, k2) => k2.localeCompare(k1)
|
|
21
22
|
};
|
|
22
|
-
const makeMessagesDictionary = () => makeOrderedDictionary(waMessageID);
|
|
23
|
+
const makeMessagesDictionary = () => (0, _makeOrderedDictionary.makeOrderedDictionary)(waMessageID);
|
|
23
24
|
/**
|
|
24
25
|
* An in-memory cache for chats, contacts, messages, group metadata, presences
|
|
25
26
|
* and labels. Bind it to your socket's event emitter with `store.bind(sock.ev)`
|
|
@@ -28,11 +29,11 @@ const makeMessagesDictionary = () => makeOrderedDictionary(waMessageID);
|
|
|
28
29
|
* Requires the optional `@adiwajshing/keyed-db` package to be installed
|
|
29
30
|
* (`npm install @adiwajshing/keyed-db`).
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
const makeInMemoryStore = config => {
|
|
32
33
|
const socket = config.socket;
|
|
33
34
|
const chatKey = config.chatKey || waChatKey(true);
|
|
34
35
|
const labelAssociationKey = config.labelAssociationKey || waLabelAssociationKey;
|
|
35
|
-
const logger = config.logger || DEFAULT_CONNECTION_CONFIG.logger.child({
|
|
36
|
+
const logger = config.logger || _index2.DEFAULT_CONNECTION_CONFIG.logger.child({
|
|
36
37
|
stream: 'in-mem-store'
|
|
37
38
|
});
|
|
38
39
|
let KeyedDB;
|
|
@@ -49,7 +50,7 @@ export const makeInMemoryStore = config => {
|
|
|
49
50
|
const state = {
|
|
50
51
|
connection: 'close'
|
|
51
52
|
};
|
|
52
|
-
const labels = new ObjectRepository();
|
|
53
|
+
const labels = new _objectRepository.ObjectRepository();
|
|
53
54
|
const labelAssociations = new KeyedDB(labelAssociationKey, labelAssociationKey.key);
|
|
54
55
|
const assertMessageList = jid => {
|
|
55
56
|
if (!messages[jid]) {
|
|
@@ -136,8 +137,8 @@ export const makeInMemoryStore = config => {
|
|
|
136
137
|
const contactHashes = validContacts.map(contactId => {
|
|
137
138
|
const {
|
|
138
139
|
user
|
|
139
|
-
} = jidDecode(contactId);
|
|
140
|
-
return [contactId, md5(Buffer.from(user + 'WA_ADD_NOTIF', 'utf8')).toString('base64').slice(0, 3)];
|
|
140
|
+
} = (0, _index4.jidDecode)(contactId);
|
|
141
|
+
return [contactId, (0, _index3.md5)(Buffer.from(user + 'WA_ADD_NOTIF', 'utf8')).toString('base64').slice(0, 3)];
|
|
141
142
|
});
|
|
142
143
|
contact = contacts[contactHashes.find(([, b]) => b === update.id)?.[0] || '']; // find contact by attrs.hash, when user is not saved as a contact
|
|
143
144
|
}
|
|
@@ -223,14 +224,14 @@ export const makeInMemoryStore = config => {
|
|
|
223
224
|
case 'append':
|
|
224
225
|
case 'notify':
|
|
225
226
|
for (const msg of newMessages) {
|
|
226
|
-
const jid = jidNormalizedUser(msg.key.remoteJid);
|
|
227
|
+
const jid = (0, _index4.jidNormalizedUser)(msg.key.remoteJid);
|
|
227
228
|
const list = assertMessageList(jid);
|
|
228
229
|
list.upsert(msg, 'append');
|
|
229
230
|
if (type === 'notify') {
|
|
230
231
|
if (!chats.get(jid)) {
|
|
231
232
|
ev.emit('chats.upsert', [{
|
|
232
233
|
id: jid,
|
|
233
|
-
conversationTimestamp: toNumber(msg.messageTimestamp),
|
|
234
|
+
conversationTimestamp: (0, _index3.toNumber)(msg.messageTimestamp),
|
|
234
235
|
unreadCount: 1
|
|
235
236
|
}]);
|
|
236
237
|
}
|
|
@@ -244,7 +245,7 @@ export const makeInMemoryStore = config => {
|
|
|
244
245
|
update,
|
|
245
246
|
key
|
|
246
247
|
} of updates) {
|
|
247
|
-
const list = assertMessageList(jidNormalizedUser(key.remoteJid));
|
|
248
|
+
const list = assertMessageList((0, _index4.jidNormalizedUser)(key.remoteJid));
|
|
248
249
|
if (update?.status) {
|
|
249
250
|
const listStatus = list.get(key.id)?.status;
|
|
250
251
|
if (listStatus && update?.status <= listStatus) {
|
|
@@ -328,7 +329,7 @@ export const makeInMemoryStore = config => {
|
|
|
328
329
|
const obj = messages[key.remoteJid];
|
|
329
330
|
const msg = obj?.get(key.id);
|
|
330
331
|
if (msg) {
|
|
331
|
-
updateMessageWithReceipt(msg, receipt);
|
|
332
|
+
(0, _index3.updateMessageWithReceipt)(msg, receipt);
|
|
332
333
|
}
|
|
333
334
|
}
|
|
334
335
|
});
|
|
@@ -340,7 +341,7 @@ export const makeInMemoryStore = config => {
|
|
|
340
341
|
const obj = messages[key.remoteJid];
|
|
341
342
|
const msg = obj?.get(key.id);
|
|
342
343
|
if (msg) {
|
|
343
|
-
updateMessageWithReaction(msg, reaction);
|
|
344
|
+
(0, _index3.updateMessageWithReaction)(msg, reaction);
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
347
|
});
|
|
@@ -360,7 +361,7 @@ export const makeInMemoryStore = config => {
|
|
|
360
361
|
for (const jid in json.messages) {
|
|
361
362
|
const list = assertMessageList(jid);
|
|
362
363
|
for (const msg of json.messages[jid]) {
|
|
363
|
-
list.upsert(proto.WebMessageInfo.create(msg), 'append');
|
|
364
|
+
list.upsert(_index.proto.WebMessageInfo.create(msg), 'append');
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
367
|
};
|
|
@@ -485,4 +486,5 @@ export const makeInMemoryStore = config => {
|
|
|
485
486
|
}
|
|
486
487
|
};
|
|
487
488
|
};
|
|
488
|
-
|
|
489
|
+
exports.makeInMemoryStore = makeInMemoryStore;
|
|
490
|
+
var _default = exports.default = makeInMemoryStore;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
exports.makeOrderedDictionary = makeOrderedDictionary;
|
|
6
|
+
function makeOrderedDictionary(idGetter) {
|
|
2
7
|
const array = [];
|
|
3
8
|
const dict = {};
|
|
4
9
|
const get = id => dict[id];
|
|
@@ -73,4 +78,4 @@ export function makeOrderedDictionary(idGetter) {
|
|
|
73
78
|
}
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
|
-
|
|
81
|
+
var _default = exports.default = makeOrderedDictionary;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.ObjectRepository = void 0;
|
|
5
|
+
class ObjectRepository {
|
|
2
6
|
constructor(entities = {}) {
|
|
3
7
|
this.entityMap = new Map(Object.entries(entities));
|
|
4
8
|
}
|
|
@@ -22,4 +26,5 @@ export class ObjectRepository {
|
|
|
22
26
|
toJSON() {
|
|
23
27
|
return this.findAll();
|
|
24
28
|
}
|
|
25
|
-
}
|
|
29
|
+
}
|
|
30
|
+
exports.ObjectRepository = ObjectRepository;
|
package/lib/Types/Auth.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Bussines.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Call.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Chat.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.ALL_WA_PATCH_NAMES = void 0;
|
|
5
|
+
const ALL_WA_PATCH_NAMES = exports.ALL_WA_PATCH_NAMES = ['critical_block', 'critical_unblock_low', 'regular_high', 'regular_low', 'regular'];
|
package/lib/Types/Contact.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Events.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=Events.js.map
|
|
1
|
+
var _index = require("../../WAProto/index.js");
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Label.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.LabelColor = void 0;
|
|
1
5
|
/** WhatsApp has 20 predefined colors */
|
|
2
|
-
|
|
6
|
+
var LabelColor;
|
|
3
7
|
(function (LabelColor) {
|
|
4
8
|
LabelColor[LabelColor["Color1"] = 0] = "Color1";
|
|
5
9
|
LabelColor[LabelColor["Color2"] = 1] = "Color2";
|
|
@@ -21,5 +25,4 @@ export var LabelColor;
|
|
|
21
25
|
LabelColor[LabelColor["Color18"] = 17] = "Color18";
|
|
22
26
|
LabelColor[LabelColor["Color19"] = 18] = "Color19";
|
|
23
27
|
LabelColor[LabelColor["Color20"] = 19] = "Color20";
|
|
24
|
-
})(LabelColor || (LabelColor = {}));
|
|
25
|
-
//# sourceMappingURL=Label.js.map
|
|
28
|
+
})(LabelColor || (exports.LabelColor = LabelColor = {}));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.LabelAssociationType = void 0;
|
|
1
5
|
/** Association type */
|
|
2
|
-
|
|
6
|
+
var LabelAssociationType;
|
|
3
7
|
(function (LabelAssociationType) {
|
|
4
8
|
LabelAssociationType["Chat"] = "label_jid";
|
|
5
9
|
LabelAssociationType["Message"] = "label_message";
|
|
6
|
-
})(LabelAssociationType || (LabelAssociationType = {}));
|
|
7
|
-
//# sourceMappingURL=LabelAssociation.js.map
|
|
10
|
+
})(LabelAssociationType || (exports.LabelAssociationType = LabelAssociationType = {}));
|
package/lib/Types/Message.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.WAMessageStubType = exports.WAMessageStatus = exports.WAMessageAddressingMode = void 0;
|
|
5
|
+
Object.defineProperty(exports, "WAProto", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return _index.proto;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _index = require("../../WAProto/index.js");
|
|
2
12
|
// export the WAMessage Prototypes
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
13
|
+
|
|
14
|
+
const WAMessageStubType = exports.WAMessageStubType = _index.proto.WebMessageInfo.StubType;
|
|
15
|
+
const WAMessageStatus = exports.WAMessageStatus = _index.proto.WebMessageInfo.Status;
|
|
16
|
+
var WAMessageAddressingMode;
|
|
7
17
|
(function (WAMessageAddressingMode) {
|
|
8
18
|
WAMessageAddressingMode["PN"] = "pn";
|
|
9
19
|
WAMessageAddressingMode["LID"] = "lid";
|
|
10
|
-
})(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
|
|
11
|
-
//# sourceMappingURL=Message.js.map
|
|
20
|
+
})(WAMessageAddressingMode || (exports.WAMessageAddressingMode = WAMessageAddressingMode = {}));
|
package/lib/Types/Newsletter.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.XWAPaths = exports.QueryIds = void 0;
|
|
5
|
+
var XWAPaths;
|
|
2
6
|
(function (XWAPaths) {
|
|
3
7
|
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
4
8
|
XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
|
|
@@ -12,8 +16,8 @@ export var XWAPaths;
|
|
|
12
16
|
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
13
17
|
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
|
|
14
18
|
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
15
|
-
})(XWAPaths || (XWAPaths = {}));
|
|
16
|
-
|
|
19
|
+
})(XWAPaths || (exports.XWAPaths = XWAPaths = {}));
|
|
20
|
+
var QueryIds;
|
|
17
21
|
(function (QueryIds) {
|
|
18
22
|
QueryIds["CREATE"] = "8823471724422422";
|
|
19
23
|
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
@@ -27,5 +31,4 @@ export var QueryIds;
|
|
|
27
31
|
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
28
32
|
QueryIds["DEMOTE"] = "6551828931592903";
|
|
29
33
|
QueryIds["DELETE"] = "30062808666639665";
|
|
30
|
-
})(QueryIds || (QueryIds = {}));
|
|
31
|
-
//# sourceMappingURL=Newsletter.js.map
|
|
34
|
+
})(QueryIds || (exports.QueryIds = QueryIds = {}));
|
package/lib/Types/Product.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
package/lib/Types/Signal.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=Signal.js.map
|
|
1
|
+
var _index = require("../../WAProto/index.js");
|
package/lib/Types/Socket.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=Socket.js.map
|
|
1
|
+
var _index = require("../../WAProto/index.js");
|
|
2
|
+
require("./Message.js");
|
package/lib/Types/State.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.SyncState = void 0;
|
|
5
|
+
var _boom = require("@hapi/boom");
|
|
6
|
+
var SyncState;
|
|
3
7
|
(function (SyncState) {
|
|
4
8
|
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
5
9
|
SyncState[SyncState["Connecting"] = 0] = "Connecting";
|
|
@@ -9,5 +13,4 @@ export var SyncState;
|
|
|
9
13
|
SyncState[SyncState["Syncing"] = 2] = "Syncing";
|
|
10
14
|
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
11
15
|
SyncState[SyncState["Online"] = 3] = "Online";
|
|
12
|
-
})(SyncState || (SyncState = {}));
|
|
13
|
-
//# sourceMappingURL=State.js.map
|
|
16
|
+
})(SyncState || (exports.SyncState = SyncState = {}));
|
package/lib/Types/USync.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=USync.js.map
|
|
1
|
+
var _index = require("../WAUSync/index.js");
|
package/lib/Types/index.js
CHANGED
|
@@ -1,16 +1,155 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
var _exportNames = {
|
|
5
|
+
DisconnectReason: true
|
|
6
|
+
};
|
|
7
|
+
exports.DisconnectReason = void 0;
|
|
8
|
+
var _Auth = require("./Auth.js");
|
|
9
|
+
Object.keys(_Auth).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
12
|
+
if (key in exports && exports[key] === _Auth[key]) return;
|
|
13
|
+
Object.defineProperty(exports, key, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _Auth[key];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
var _GroupMetadata = require("./GroupMetadata.js");
|
|
21
|
+
Object.keys(_GroupMetadata).forEach(function (key) {
|
|
22
|
+
if (key === "default" || key === "__esModule") return;
|
|
23
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
24
|
+
if (key in exports && exports[key] === _GroupMetadata[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _GroupMetadata[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var _Chat = require("./Chat.js");
|
|
33
|
+
Object.keys(_Chat).forEach(function (key) {
|
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
36
|
+
if (key in exports && exports[key] === _Chat[key]) return;
|
|
37
|
+
Object.defineProperty(exports, key, {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _Chat[key];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
var _Contact = require("./Contact.js");
|
|
45
|
+
Object.keys(_Contact).forEach(function (key) {
|
|
46
|
+
if (key === "default" || key === "__esModule") return;
|
|
47
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
48
|
+
if (key in exports && exports[key] === _Contact[key]) return;
|
|
49
|
+
Object.defineProperty(exports, key, {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return _Contact[key];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
var _State = require("./State.js");
|
|
57
|
+
Object.keys(_State).forEach(function (key) {
|
|
58
|
+
if (key === "default" || key === "__esModule") return;
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
60
|
+
if (key in exports && exports[key] === _State[key]) return;
|
|
61
|
+
Object.defineProperty(exports, key, {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () {
|
|
64
|
+
return _State[key];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
var _Message = require("./Message.js");
|
|
69
|
+
Object.keys(_Message).forEach(function (key) {
|
|
70
|
+
if (key === "default" || key === "__esModule") return;
|
|
71
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
72
|
+
if (key in exports && exports[key] === _Message[key]) return;
|
|
73
|
+
Object.defineProperty(exports, key, {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () {
|
|
76
|
+
return _Message[key];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
var _Socket = require("./Socket.js");
|
|
81
|
+
Object.keys(_Socket).forEach(function (key) {
|
|
82
|
+
if (key === "default" || key === "__esModule") return;
|
|
83
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
84
|
+
if (key in exports && exports[key] === _Socket[key]) return;
|
|
85
|
+
Object.defineProperty(exports, key, {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () {
|
|
88
|
+
return _Socket[key];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
var _Events = require("./Events.js");
|
|
93
|
+
Object.keys(_Events).forEach(function (key) {
|
|
94
|
+
if (key === "default" || key === "__esModule") return;
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
96
|
+
if (key in exports && exports[key] === _Events[key]) return;
|
|
97
|
+
Object.defineProperty(exports, key, {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () {
|
|
100
|
+
return _Events[key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
var _Product = require("./Product.js");
|
|
105
|
+
Object.keys(_Product).forEach(function (key) {
|
|
106
|
+
if (key === "default" || key === "__esModule") return;
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
108
|
+
if (key in exports && exports[key] === _Product[key]) return;
|
|
109
|
+
Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _Product[key];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
var _Call = require("./Call.js");
|
|
117
|
+
Object.keys(_Call).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
120
|
+
if (key in exports && exports[key] === _Call[key]) return;
|
|
121
|
+
Object.defineProperty(exports, key, {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return _Call[key];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
var _Signal = require("./Signal.js");
|
|
129
|
+
Object.keys(_Signal).forEach(function (key) {
|
|
130
|
+
if (key === "default" || key === "__esModule") return;
|
|
131
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
132
|
+
if (key in exports && exports[key] === _Signal[key]) return;
|
|
133
|
+
Object.defineProperty(exports, key, {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () {
|
|
136
|
+
return _Signal[key];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
var _Newsletter = require("./Newsletter.js");
|
|
141
|
+
Object.keys(_Newsletter).forEach(function (key) {
|
|
142
|
+
if (key === "default" || key === "__esModule") return;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
144
|
+
if (key in exports && exports[key] === _Newsletter[key]) return;
|
|
145
|
+
Object.defineProperty(exports, key, {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return _Newsletter[key];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
var DisconnectReason;
|
|
14
153
|
(function (DisconnectReason) {
|
|
15
154
|
DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
|
|
16
155
|
DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
|
|
@@ -22,5 +161,4 @@ export var DisconnectReason;
|
|
|
22
161
|
DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
|
|
23
162
|
DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
|
|
24
163
|
DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
|
|
25
|
-
})(DisconnectReason || (DisconnectReason = {}));
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
164
|
+
})(DisconnectReason || (exports.DisconnectReason = DisconnectReason = {}));
|