@ostyado/baileys 1.0.7 → 1.0.8

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.
Files changed (210) hide show
  1. package/README.md +0 -0
  2. package/WAProto/GenerateStatics.sh +0 -0
  3. package/WAProto/WAProto.proto +0 -0
  4. package/WAProto/index.d.ts +0 -0
  5. package/WAProto/index.js +0 -0
  6. package/WASignalGroup/GroupProtocol.js +0 -0
  7. package/WASignalGroup/ciphertext_message.js +0 -0
  8. package/WASignalGroup/group_cipher.js +0 -0
  9. package/WASignalGroup/group_session_builder.js +0 -0
  10. package/WASignalGroup/index.js +0 -0
  11. package/WASignalGroup/keyhelper.js +0 -0
  12. package/WASignalGroup/protobufs.js +0 -0
  13. package/WASignalGroup/queue_job.js +0 -0
  14. package/WASignalGroup/sender_chain_key.js +0 -0
  15. package/WASignalGroup/sender_key_distribution_message.js +0 -0
  16. package/WASignalGroup/sender_key_message.js +0 -0
  17. package/WASignalGroup/sender_key_name.js +0 -0
  18. package/WASignalGroup/sender_key_record.js +0 -0
  19. package/WASignalGroup/sender_key_state.js +0 -0
  20. package/WASignalGroup/sender_message_key.js +0 -0
  21. package/lib/Defaults/baileys-version.json +0 -0
  22. package/lib/Defaults/index.d.ts +0 -0
  23. package/lib/Defaults/index.js +0 -0
  24. package/lib/Defaults/phonenumber-mcc.json +0 -0
  25. package/lib/Signal/Group/ciphertext-message.d.ts +0 -0
  26. package/lib/Signal/Group/ciphertext-message.js +0 -0
  27. package/lib/Signal/Group/group-session-builder.d.ts +0 -0
  28. package/lib/Signal/Group/group-session-builder.js +0 -0
  29. package/lib/Signal/Group/group_cipher.d.ts +0 -0
  30. package/lib/Signal/Group/group_cipher.js +0 -0
  31. package/lib/Signal/Group/index.d.ts +0 -0
  32. package/lib/Signal/Group/index.js +0 -0
  33. package/lib/Signal/Group/keyhelper.d.ts +0 -0
  34. package/lib/Signal/Group/keyhelper.js +0 -0
  35. package/lib/Signal/Group/queue-job.d.ts +0 -0
  36. package/lib/Signal/Group/queue-job.js +0 -0
  37. package/lib/Signal/Group/sender-chain-key.d.ts +0 -0
  38. package/lib/Signal/Group/sender-chain-key.js +0 -0
  39. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -0
  40. package/lib/Signal/Group/sender-key-distribution-message.js +0 -0
  41. package/lib/Signal/Group/sender-key-message.d.ts +0 -0
  42. package/lib/Signal/Group/sender-key-message.js +0 -0
  43. package/lib/Signal/Group/sender-key-name.d.ts +0 -0
  44. package/lib/Signal/Group/sender-key-name.js +0 -0
  45. package/lib/Signal/Group/sender-key-record.d.ts +0 -0
  46. package/lib/Signal/Group/sender-key-record.js +0 -0
  47. package/lib/Signal/Group/sender-key-state.d.ts +0 -0
  48. package/lib/Signal/Group/sender-key-state.js +0 -0
  49. package/lib/Signal/Group/sender-message-key.d.ts +0 -0
  50. package/lib/Signal/Group/sender-message-key.js +0 -0
  51. package/lib/Signal/Group/x +0 -0
  52. package/lib/Signal/libsignal.d.ts +0 -0
  53. package/lib/Signal/libsignal.js +0 -0
  54. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -0
  55. package/lib/Socket/Client/abstract-socket-client.js +0 -0
  56. package/lib/Socket/Client/index.d.ts +0 -0
  57. package/lib/Socket/Client/index.js +0 -0
  58. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -0
  59. package/lib/Socket/Client/mobile-socket-client.js +0 -0
  60. package/lib/Socket/Client/web-socket-client.d.ts +0 -0
  61. package/lib/Socket/Client/web-socket-client.js +0 -0
  62. package/lib/Socket/business.d.ts +0 -0
  63. package/lib/Socket/business.js +0 -0
  64. package/lib/Socket/chats.d.ts +0 -0
  65. package/lib/Socket/chats.js +0 -0
  66. package/lib/Socket/groups.d.ts +0 -0
  67. package/lib/Socket/groups.js +0 -0
  68. package/lib/Socket/index.d.ts +0 -0
  69. package/lib/Socket/index.js +0 -0
  70. package/lib/Socket/messages-recv.d.ts +0 -0
  71. package/lib/Socket/messages-recv.js +0 -0
  72. package/lib/Socket/messages-send.d.ts +0 -0
  73. package/lib/Socket/messages-send.js +0 -0
  74. package/lib/Socket/newsletter.d.ts +0 -0
  75. package/lib/Socket/newsletter.js +0 -0
  76. package/lib/Socket/registration.d.ts +0 -0
  77. package/lib/Socket/registration.js +0 -0
  78. package/lib/Socket/socket.d.ts +0 -0
  79. package/lib/Socket/socket.js +30 -65
  80. package/lib/Socket/usync.d.ts +0 -0
  81. package/lib/Socket/usync.js +0 -0
  82. package/lib/Store/index.d.ts +0 -0
  83. package/lib/Store/index.js +0 -0
  84. package/lib/Store/make-cache-manager-store.d.ts +0 -0
  85. package/lib/Store/make-cache-manager-store.js +0 -0
  86. package/lib/Store/make-in-memory-store.d.ts +0 -0
  87. package/lib/Store/make-in-memory-store.js +0 -0
  88. package/lib/Store/make-ordered-dictionary.d.ts +0 -0
  89. package/lib/Store/make-ordered-dictionary.js +0 -0
  90. package/lib/Store/object-repository.d.ts +0 -0
  91. package/lib/Store/object-repository.js +0 -0
  92. package/lib/Types/Auth.d.ts +0 -0
  93. package/lib/Types/Auth.js +0 -0
  94. package/lib/Types/Call.d.ts +0 -0
  95. package/lib/Types/Call.js +0 -0
  96. package/lib/Types/Chat.d.ts +0 -0
  97. package/lib/Types/Chat.js +0 -0
  98. package/lib/Types/Contact.d.ts +0 -0
  99. package/lib/Types/Contact.js +0 -0
  100. package/lib/Types/Events.d.ts +0 -0
  101. package/lib/Types/Events.js +0 -0
  102. package/lib/Types/GroupMetadata.d.ts +0 -0
  103. package/lib/Types/GroupMetadata.js +0 -0
  104. package/lib/Types/Label.d.ts +0 -0
  105. package/lib/Types/Label.js +0 -0
  106. package/lib/Types/LabelAssociation.d.ts +0 -0
  107. package/lib/Types/LabelAssociation.js +0 -0
  108. package/lib/Types/Message.d.ts +0 -0
  109. package/lib/Types/Message.js +0 -0
  110. package/lib/Types/Newsletter.d.ts +0 -0
  111. package/lib/Types/Newsletter.js +0 -0
  112. package/lib/Types/Product.d.ts +0 -0
  113. package/lib/Types/Product.js +0 -0
  114. package/lib/Types/Signal.d.ts +0 -0
  115. package/lib/Types/Signal.js +0 -0
  116. package/lib/Types/Socket.d.ts +0 -0
  117. package/lib/Types/Socket.js +0 -0
  118. package/lib/Types/State.d.ts +0 -0
  119. package/lib/Types/State.js +0 -0
  120. package/lib/Types/USync.d.ts +0 -0
  121. package/lib/Types/USync.js +0 -0
  122. package/lib/Types/index.d.ts +0 -0
  123. package/lib/Types/index.js +0 -0
  124. package/lib/Utils/auth-utils.d.ts +0 -0
  125. package/lib/Utils/auth-utils.js +0 -0
  126. package/lib/Utils/baileys-event-stream.d.ts +0 -0
  127. package/lib/Utils/baileys-event-stream.js +0 -0
  128. package/lib/Utils/business.d.ts +0 -0
  129. package/lib/Utils/business.js +0 -0
  130. package/lib/Utils/chat-utils.d.ts +0 -0
  131. package/lib/Utils/chat-utils.js +0 -0
  132. package/lib/Utils/crypto.d.ts +0 -0
  133. package/lib/Utils/crypto.js +0 -0
  134. package/lib/Utils/decode-wa-message.d.ts +0 -0
  135. package/lib/Utils/decode-wa-message.js +0 -0
  136. package/lib/Utils/event-buffer.d.ts +0 -0
  137. package/lib/Utils/event-buffer.js +0 -0
  138. package/lib/Utils/generics.d.ts +0 -0
  139. package/lib/Utils/generics.js +0 -0
  140. package/lib/Utils/history.d.ts +0 -0
  141. package/lib/Utils/history.js +0 -0
  142. package/lib/Utils/index.d.ts +0 -0
  143. package/lib/Utils/index.js +0 -0
  144. package/lib/Utils/link-preview.d.ts +0 -0
  145. package/lib/Utils/link-preview.js +0 -0
  146. package/lib/Utils/logger.d.ts +0 -0
  147. package/lib/Utils/logger.js +0 -0
  148. package/lib/Utils/lt-hash.d.ts +0 -0
  149. package/lib/Utils/lt-hash.js +0 -0
  150. package/lib/Utils/make-mutex.d.ts +0 -0
  151. package/lib/Utils/make-mutex.js +0 -0
  152. package/lib/Utils/messages-media.d.ts +0 -0
  153. package/lib/Utils/messages-media.js +0 -0
  154. package/lib/Utils/messages.d.ts +0 -0
  155. package/lib/Utils/messages.js +0 -0
  156. package/lib/Utils/noise-handler.d.ts +0 -0
  157. package/lib/Utils/noise-handler.js +0 -0
  158. package/lib/Utils/process-message.d.ts +0 -0
  159. package/lib/Utils/process-message.js +0 -0
  160. package/lib/Utils/signal.d.ts +0 -0
  161. package/lib/Utils/signal.js +0 -0
  162. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -0
  163. package/lib/Utils/use-multi-file-auth-state.js +0 -0
  164. package/lib/Utils/validate-connection.d.ts +0 -0
  165. package/lib/Utils/validate-connection.js +0 -0
  166. package/lib/WABinary/constants.d.ts +0 -0
  167. package/lib/WABinary/constants.js +0 -0
  168. package/lib/WABinary/decode.d.ts +0 -0
  169. package/lib/WABinary/decode.js +0 -0
  170. package/lib/WABinary/encode.d.ts +0 -0
  171. package/lib/WABinary/encode.js +0 -0
  172. package/lib/WABinary/generic-utils.d.ts +0 -0
  173. package/lib/WABinary/generic-utils.js +0 -0
  174. package/lib/WABinary/index.d.ts +0 -0
  175. package/lib/WABinary/index.js +0 -0
  176. package/lib/WABinary/jid-utils.d.ts +0 -0
  177. package/lib/WABinary/jid-utils.js +0 -0
  178. package/lib/WABinary/types.d.ts +0 -0
  179. package/lib/WABinary/types.js +0 -0
  180. package/lib/WAM/BinaryInfo.d.ts +0 -0
  181. package/lib/WAM/BinaryInfo.js +0 -0
  182. package/lib/WAM/constants.d.ts +0 -0
  183. package/lib/WAM/constants.js +0 -0
  184. package/lib/WAM/encode.d.ts +0 -0
  185. package/lib/WAM/encode.js +0 -0
  186. package/lib/WAM/index.d.ts +0 -0
  187. package/lib/WAM/index.js +0 -0
  188. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -0
  189. package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -0
  190. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -0
  191. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -0
  192. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -0
  193. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -0
  194. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -0
  195. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -0
  196. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -0
  197. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -0
  198. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -0
  199. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -0
  200. package/lib/WAUSync/Protocols/index.d.ts +0 -0
  201. package/lib/WAUSync/Protocols/index.js +0 -0
  202. package/lib/WAUSync/USyncQuery.d.ts +0 -0
  203. package/lib/WAUSync/USyncQuery.js +0 -0
  204. package/lib/WAUSync/USyncUser.d.ts +0 -0
  205. package/lib/WAUSync/USyncUser.js +0 -0
  206. package/lib/WAUSync/index.d.ts +0 -0
  207. package/lib/WAUSync/index.js +0 -0
  208. package/lib/index.d.ts +0 -0
  209. package/lib/index.js +1 -1
  210. package/package.json +4 -5
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
package/WAProto/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -20,16 +20,15 @@ const Client_1 = require("./Client");
20
20
  const makeSocket = (config) => {
21
21
  var _a, _b;
22
22
  const { waWebSocketUrl, connectTimeoutMs, logger, keepAliveIntervalMs, browser, auth: authState, printQRInTerminal, defaultQueryTimeoutMs, transactionOpts, qrTimeout, makeSignalRepository, } = config;
23
- const url = typeof waWebSocketUrl === 'string' ? new url_1.URL(waWebSocketUrl) : waWebSocketUrl;
24
- if (config.mobile || url.protocol === 'tcp:') {
25
- throw new boom_1.Boom('Mobile API is not supported anymore', {
26
- statusCode: Types_1.DisconnectReason.loggedOut
27
- });
23
+ let url = typeof waWebSocketUrl === 'string' ? new url_1.URL(waWebSocketUrl) : waWebSocketUrl;
24
+ config.mobile = config.mobile || url.protocol === 'tcp:';
25
+ if (config.mobile && url.protocol !== 'tcp:') {
26
+ url = new url_1.URL(`tcp://${Defaults_1.MOBILE_ENDPOINT}:${Defaults_1.MOBILE_PORT}`);
28
27
  }
29
- if (url.protocol === 'wss' && ((_a = authState === null || authState === void 0 ? void 0 : authState.creds) === null || _a === void 0 ? void 0 : _a.routingInfo)) {
28
+ if (!config.mobile && url.protocol === 'wss' && ((_a = authState === null || authState === void 0 ? void 0 : authState.creds) === null || _a === void 0 ? void 0 : _a.routingInfo)) {
30
29
  url.searchParams.append('ED', authState.creds.routingInfo.toString('base64url'));
31
30
  }
32
- const ws = new Client_1.WebSocketClient(url, config);
31
+ const ws = config.socket ? config.socket : config.mobile ? new Client_1.MobileSocketClient(url, config) : new Client_1.WebSocketClient(url, config);
33
32
  ws.connect();
34
33
  const ev = (0, Utils_1.makeEventBuffer)(logger);
35
34
  /** ephemeral key pair used to encrypt/decrypt communication. Unique for each connection */
@@ -37,7 +36,8 @@ const makeSocket = (config) => {
37
36
  /** WA noise protocol wrapper */
38
37
  const noise = (0, Utils_1.makeNoiseHandler)({
39
38
  keyPair: ephemeralKeyPair,
40
- NOISE_HEADER: Defaults_1.NOISE_WA_HEADER,
39
+ NOISE_HEADER: config.mobile ? Defaults_1.MOBILE_NOISE_HEADER : Defaults_1.NOISE_WA_HEADER,
40
+ mobile: config.mobile,
41
41
  logger,
42
42
  routingInfo: (_b = authState === null || authState === void 0 ? void 0 : authState.creds) === null || _b === void 0 ? void 0 : _b.routingInfo
43
43
  });
@@ -80,25 +80,6 @@ const makeSocket = (config) => {
80
80
  /** log & process any unexpected errors */
81
81
  const onUnexpectedError = (err, msg) => {
82
82
  logger.error({ err }, `unexpected error in '${msg}'`);
83
- const message = (err && ((err.stack || err.message) || String(err))).toLowerCase();
84
- // auto recover from cryptographic desyncs by re-uploading prekeys
85
- if (message.includes('bad mac') || (message.includes('mac') && message.includes('invalid'))) {
86
- try {
87
- uploadPreKeysToServerIfRequired(true)
88
- .catch(e => logger.warn({ e }, 'failed to re-upload prekeys after bad mac'));
89
- }
90
- catch (_e) {
91
- // ignore
92
- }
93
- }
94
- // gently back off when encountering rate limits (429)
95
- if (message.includes('429') || message.includes('rate limit')) {
96
- const wait = Math.min(30000, (config.backoffDelayMs || 5000));
97
- logger.info({ wait }, 'backing off due to rate limit');
98
- setTimeout(() => {
99
- // intentionally empty; wait to delay further sends
100
- }, wait);
101
- }
102
83
  };
103
84
  /** await the next incoming message */
104
85
  const awaitNextMessage = async (sendMsg) => {
@@ -135,7 +116,7 @@ const makeSocket = (config) => {
135
116
  let onRecv;
136
117
  let onErr;
137
118
  try {
138
- const result = await (0, Utils_1.promiseTimeout)(timeoutMs, (resolve, reject) => {
119
+ return await (0, Utils_1.promiseTimeout)(timeoutMs, (resolve, reject) => {
139
120
  onRecv = resolve;
140
121
  onErr = err => {
141
122
  reject(err || new boom_1.Boom('Connection Closed', { statusCode: Types_1.DisconnectReason.connectionClosed }));
@@ -144,7 +125,6 @@ const makeSocket = (config) => {
144
125
  ws.on('close', onErr); // if the socket closes, you'll never receive the message
145
126
  ws.off('error', onErr);
146
127
  });
147
- return result;
148
128
  }
149
129
  finally {
150
130
  ws.off(`TAG:${msgId}`, onRecv);
@@ -158,10 +138,9 @@ const makeSocket = (config) => {
158
138
  node.attrs.id = generateMessageTag();
159
139
  }
160
140
  const msgId = node.attrs.id;
161
- const [result] = await Promise.all([
162
- waitForMessage(msgId, timeoutMs),
163
- sendNode(node)
164
- ]);
141
+ const wait = waitForMessage(msgId, timeoutMs);
142
+ await sendNode(node);
143
+ const result = await wait;
165
144
  if ('tag' in result) {
166
145
  (0, WABinary_1.assertNodeErrorFree)(result);
167
146
  }
@@ -178,9 +157,12 @@ const makeSocket = (config) => {
178
157
  const result = await awaitNextMessage(init);
179
158
  const handshake = WAProto_1.proto.HandshakeMessage.decode(result);
180
159
  logger.trace({ handshake }, 'handshake recv from WA');
181
- const keyEnc = await noise.processHandshake(handshake, creds.noiseKey);
160
+ const keyEnc = noise.processHandshake(handshake, creds.noiseKey);
182
161
  let node;
183
- if (!creds.me) {
162
+ if (config.mobile) {
163
+ node = (0, Utils_1.generateMobileNode)(config);
164
+ }
165
+ else if (!creds.me) {
184
166
  node = (0, Utils_1.generateRegistrationNode)(creds, config);
185
167
  logger.info({ node }, 'not logged in, attempting registration...');
186
168
  }
@@ -250,11 +232,11 @@ const makeSocket = (config) => {
250
232
  const l0 = frame.tag;
251
233
  const l1 = frame.attrs || {};
252
234
  const l2 = Array.isArray(frame.content) ? (_a = frame.content[0]) === null || _a === void 0 ? void 0 : _a.tag : '';
253
- for (const key of Object.keys(l1)) {
235
+ Object.keys(l1).forEach(key => {
254
236
  anyTriggered = ws.emit(`${Defaults_1.DEF_CALLBACK_PREFIX}${l0},${key}:${l1[key]},${l2}`, frame) || anyTriggered;
255
237
  anyTriggered = ws.emit(`${Defaults_1.DEF_CALLBACK_PREFIX}${l0},${key}:${l1[key]}`, frame) || anyTriggered;
256
238
  anyTriggered = ws.emit(`${Defaults_1.DEF_CALLBACK_PREFIX}${l0},${key}`, frame) || anyTriggered;
257
- }
239
+ });
258
240
  anyTriggered = ws.emit(`${Defaults_1.DEF_CALLBACK_PREFIX}${l0},,${l2}`, frame) || anyTriggered;
259
241
  anyTriggered = ws.emit(`${Defaults_1.DEF_CALLBACK_PREFIX}${l0}`, frame) || anyTriggered;
260
242
  if (!anyTriggered && logger.level === 'debug') {
@@ -383,8 +365,8 @@ const makeSocket = (config) => {
383
365
  }
384
366
  end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
385
367
  };
386
-
387
368
  /** This method was created by snowi, and implemented by KyuuRzy */
369
+
388
370
  /** hey bro, if you delete this text */
389
371
  /** you are the most cursed human being who likes to claim other people's property 😹🙌🏻 */
390
372
  const requestPairingCode = async (phoneNumber, pairKey) => {
@@ -449,11 +431,12 @@ const makeSocket = (config) => {
449
431
  });
450
432
 
451
433
  return authState.creds.pairingCode;
452
- }
434
+ };
435
+
453
436
  async function generatePairingKey() {
454
437
  const salt = (0, crypto_1.randomBytes)(32);
455
438
  const randomIv = (0, crypto_1.randomBytes)(16);
456
- const key = await (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
439
+ const key = (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
457
440
  const ciphered = (0, Utils_1.aesEncryptCTR)(authState.creds.pairingEphemeralKeyPair.public, key, randomIv);
458
441
  return Buffer.concat([salt, randomIv, ciphered]);
459
442
  }
@@ -540,18 +523,12 @@ const makeSocket = (config) => {
540
523
  });
541
524
  // login complete
542
525
  ws.on('CB:success', async (node) => {
543
- try {
544
- await uploadPreKeysToServerIfRequired();
545
- await sendPassiveIq('active');
546
- logger.info('opened connection to WA');
547
- clearTimeout(qrTimer); // will never happen in all likelyhood -- but just in case WA sends success on first try
548
- ev.emit('creds.update', { me: { ...authState.creds.me, lid: node.attrs.lid } });
549
- ev.emit('connection.update', { connection: 'open' });
550
- }
551
- catch (err) {
552
- logger.error({ err }, 'error opening connection');
553
- end(err);
554
- }
526
+ await uploadPreKeysToServerIfRequired();
527
+ await sendPassiveIq('active');
528
+ logger.info('opened connection to WA');
529
+ clearTimeout(qrTimer); // will never happen in all likelyhood -- but just in case WA sends success on first try
530
+ ev.emit('creds.update', { me: { ...authState.creds.me, lid: node.attrs.lid } });
531
+ ev.emit('connection.update', { connection: 'open' });
555
532
  });
556
533
  ws.on('CB:stream:error', (node) => {
557
534
  logger.error({ node }, 'stream errored out');
@@ -566,20 +543,11 @@ const makeSocket = (config) => {
566
543
  ws.on('CB:ib,,downgrade_webclient', () => {
567
544
  end(new boom_1.Boom('Multi-device beta not joined', { statusCode: Types_1.DisconnectReason.multideviceMismatch }));
568
545
  });
569
- ws.on('CB:ib,,offline_preview', (node) => {
570
- logger.info('offline preview received', JSON.stringify(node));
571
- sendNode({
572
- tag: 'ib',
573
- attrs: {},
574
- content: [{ tag: 'offline_batch', attrs: { count: '100' } }]
575
- });
576
- });
577
546
  ws.on('CB:ib,,edge_routing', (node) => {
578
547
  const edgeRoutingNode = (0, WABinary_1.getBinaryNodeChild)(node, 'edge_routing');
579
548
  const routingInfo = (0, WABinary_1.getBinaryNodeChild)(edgeRoutingNode, 'routing_info');
580
549
  if (routingInfo === null || routingInfo === void 0 ? void 0 : routingInfo.content) {
581
550
  authState.creds.routingInfo = Buffer.from(routingInfo === null || routingInfo === void 0 ? void 0 : routingInfo.content);
582
- ev.emit('creds.update', authState.creds);
583
551
  }
584
552
  });
585
553
  let didStartBuffer = false;
@@ -628,10 +596,7 @@ const makeSocket = (config) => {
628
596
  type: 'md',
629
597
  ws,
630
598
  ev,
631
- authState: {
632
- creds,
633
- keys
634
- },
599
+ authState: { creds, keys },
635
600
  signalRepository,
636
601
  get user() {
637
602
  return authState.creds.me;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/Types/Auth.js CHANGED
File without changes
File without changes
package/lib/Types/Call.js CHANGED
File without changes
File without changes
package/lib/Types/Chat.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/WAM/encode.js CHANGED
File without changes
File without changes
package/lib/WAM/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const chalk = require("chalk")
4
- console.log(chalk.blue("Thank you for using custom baileys fork by Ostyado"));
4
+ console.log(chalk.yellow("Modified Baileys By Ostyado"));
5
5
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
6
  if (k2 === undefined) k2 = k;
7
7
  var desc = Object.getOwnPropertyDescriptor(m, k);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ostyado/baileys",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "WhatsApp API",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -37,6 +37,8 @@
37
37
  "gen:protobuf": "sh WAProto/GenerateStatics.sh",
38
38
  "lint": "eslint src --ext .js,.ts,.jsx,.tsx",
39
39
  "lint:fix": "eslint src --fix --ext .js,.ts,.jsx,.tsx",
40
+ "prepack": "tsc",
41
+ "prepare": "tsc",
40
42
  "release": "release-it",
41
43
  "test": "jest"
42
44
  },
@@ -50,7 +52,7 @@
50
52
  "chalk": "^4.1.2",
51
53
  "futoin-hkdf": "^1.5.1",
52
54
  "libphonenumber-js": "^1.10.20",
53
- "libsignal": "git+https://github.com/whiskeysockets/libsignal-node",
55
+ "libsignal": "npm:@shennmine/libsignal-node",
54
56
  "music-metadata": "^7.12.3",
55
57
  "node-cache": "^5.1.2",
56
58
  "pino": "^7.0.0",
@@ -100,8 +102,5 @@
100
102
  "optional": true
101
103
  }
102
104
  },
103
- "publishConfig": {
104
- "access": "public"
105
- },
106
105
  "packageManager": "yarn@1.22.19"
107
106
  }