@neelegirl/baileys 1.4.97 → 1.4.98

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neelegirl/baileys",
3
- "version": "1.4.97",
3
+ "version": "1.4.98",
4
4
  "description": "WhatsApp API",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -38,7 +38,7 @@
38
38
  "cache-manager": "4.0.1",
39
39
  "futoin-hkdf": "^1.5.1",
40
40
  "libphonenumber-js": "^1.10.20",
41
- "libsignal-baron": "^1.0.8",
41
+ "@neelegirl/libsignal": "^1.0.1",
42
42
  "music-metadata": "^7.12.3",
43
43
  "node-cache": "^5.1.2",
44
44
  "pino": "^7.0.0",
@@ -1,6 +1,6 @@
1
1
  const queue_job = require('./queue_job');
2
2
  const SenderKeyMessage = require('./sender_key_message');
3
- const crypto = require('libsignal-baron/src/crypto');
3
+ const crypto = require('@neelegirl/libsignal/src/crypto');
4
4
 
5
5
  class GroupCipher {
6
6
  constructor(senderKeyStore, senderKeyName) {
@@ -1,4 +1,4 @@
1
- const curve = require('libsignal-baron/src/curve');
1
+ const curve = require('@neelegirl/libsignal/src/curve');
2
2
  const nodeCrypto = require('crypto');
3
3
 
4
4
  exports.generateSenderKey = function() {
@@ -1,6 +1,6 @@
1
1
  const SenderMessageKey = require('./sender_message_key');
2
2
  //const HKDF = require('./hkdf');
3
- const crypto = require('libsignal-baron/src/crypto');
3
+ const crypto = require('@neelegirl/libsignal/src/crypto');
4
4
 
5
5
  class SenderChainKey {
6
6
  MESSAGE_KEY_SEED = Buffer.from([0x01]);
@@ -1,5 +1,5 @@
1
1
  const CiphertextMessage = require('./ciphertext_message');
2
- const curve = require('libsignal-baron/src/curve');
2
+ const curve = require('@neelegirl/libsignal/src/curve');
3
3
  const protobufs = require('./protobufs');
4
4
 
5
5
  class SenderKeyMessage extends CiphertextMessage {
@@ -1,4 +1,4 @@
1
- const { deriveSecrets } = require('libsignal-baron/src/crypto');
1
+ const { deriveSecrets } = require('@neelegirl/libsignal/src/crypto');
2
2
  class SenderMessageKey {
3
3
  iteration = 0;
4
4
 
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  }
28
28
  Object.defineProperty(exports, "__esModule", { value: true })
29
29
 
30
- const libsignal = __importStar(require("libsignal-baron"))
30
+ const libsignal = __importStar(require("@neelegirl/libsignal"))
31
31
  const WASignalGroup_1 = require("./WASignalGroup")
32
32
  const Utils_1 = require("../Utils")
33
33
  const WABinary_1 = require("../WABinary")
@@ -20,8 +20,8 @@ const MAX_SYNC_ATTEMPTS = 2
20
20
 
21
21
  const makeChatsSocket = (config) => {
22
22
  const { logger, markOnlineOnConnect, fireInitQueries, appStateMacVerification, shouldIgnoreJid, shouldSyncHistoryMessage, } = config
23
- const baron = usync_1.makeUSyncSocket(config)
24
- const { ev, ws, authState, generateMessageTag, sendNode, query, onUnexpectedError, groupFetchAllParticipating } = baron
23
+ const onimai = usync_1.makeUSyncSocket(config)
24
+ const { ev, ws, authState, generateMessageTag, sendNode, query, onUnexpectedError, groupFetchAllParticipating } = onimai
25
25
  let privacySettings
26
26
  let needToFlushWithAppStateSync = false
27
27
  let pendingAppStateSync = false
@@ -192,7 +192,7 @@ const makeChatsSocket = (config) => {
192
192
  id: targetJid
193
193
  })
194
194
 
195
- const result = await baron.executeUSyncQuery(usyncQuery)
195
+ const result = await onimai.executeUSyncQuery(usyncQuery)
196
196
 
197
197
  if (result) {
198
198
  return result.list
@@ -207,7 +207,7 @@ const makeChatsSocket = (config) => {
207
207
  usyncQuery.withUser(new WAUSync_1.USyncUser().withPhone(phone))
208
208
  }
209
209
 
210
- const results = await baron.executeUSyncQuery(usyncQuery)
210
+ const results = await onimai.executeUSyncQuery(usyncQuery)
211
211
 
212
212
  if (results) {
213
213
  return results.list.filter((a) => !!a.contact).map(({ contact, id, lid }) => ({ jid: id, exists: contact, lid }))
@@ -222,7 +222,7 @@ const makeChatsSocket = (config) => {
222
222
  usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid))
223
223
  }
224
224
 
225
- const result = await baron.executeUSyncQuery(usyncQuery)
225
+ const result = await onimai.executeUSyncQuery(usyncQuery)
226
226
 
227
227
  if (result) {
228
228
  return result.list
@@ -235,7 +235,7 @@ const makeChatsSocket = (config) => {
235
235
  usyncQuery.withUser(new WAUSync_1.USyncUser().withId(jid))
236
236
  }
237
237
 
238
- const result = await baron.executeUSyncQuery(usyncQuery)
238
+ const result = await onimai.executeUSyncQuery(usyncQuery)
239
239
  if (result) {
240
240
  return result.list
241
241
  }
@@ -980,7 +980,7 @@ const makeChatsSocket = (config) => {
980
980
  })
981
981
 
982
982
  return {
983
- ...baron,
983
+ ...onimai,
984
984
  star,
985
985
  addOrEditContact,
986
986
  removeContact,
@@ -29,7 +29,7 @@ const makeMessagesSocket = (config) => {
29
29
  patchMessageBeforeSending,
30
30
  cachedGroupMetadata,
31
31
  } = config;
32
- const baron = newsletter_1.makeNewsletterSocket(config);
32
+ const onimai = newsletter_1.makeNewsletterSocket(config);
33
33
  const {
34
34
  ev,
35
35
  authState,
@@ -44,7 +44,7 @@ const makeMessagesSocket = (config) => {
44
44
  groupToggleEphemeral,
45
45
  newsletterWMexQuery,
46
46
  executeUSyncQuery,
47
- } = baron;
47
+ } = onimai;
48
48
 
49
49
  const userDevicesCache =
50
50
  config.userDevicesCache ||
@@ -1114,7 +1114,7 @@ const makeMessagesSocket = (config) => {
1114
1114
  );
1115
1115
 
1116
1116
  return {
1117
- ...baron,
1117
+ ...onimai,
1118
1118
  getPrivacyTokens,
1119
1119
  assertSessions,
1120
1120
  relayMessage,
@@ -80,8 +80,8 @@ export declare const makeInMemoryStore: (config: BaileysInMemoryStoreConfig) =>
80
80
  getMessageLabels: (messageId: string) => string[]
81
81
  loadMessage: (jid: string, id: string) => Promise<proto.IWebMessageInfo | undefined>
82
82
  mostRecentMessage: (jid: string) => Promise<proto.IWebMessageInfo>
83
- fetchImageUrl: (jid: string, baron: WASocket | undefined) => Promise<string | null | undefined>
84
- fetchGroupMetadata: (jid: string, baron: WASocket | undefined) => Promise<GroupMetadata>
83
+ fetchImageUrl: (jid: string, onimai: WASocket | undefined) => Promise<string | null | undefined>
84
+ fetchGroupMetadata: (jid: string, onimai: WASocket | undefined) => Promise<GroupMetadata>
85
85
  fetchMessageReceipts: ({ remoteJid, id }: WAMessageKey) => Promise<proto.IUserReceipt[] | null | undefined>
86
86
  toJSON: () => {
87
87
  chats: KeyedDB<Chat, string>
@@ -368,19 +368,19 @@ const makeInMemoryStore = (config) => {
368
368
  const message = messages[jid]?.array.slice(-1)[0]
369
369
  return message
370
370
  },
371
- fetchImageUrl: async (jid, baron) => {
371
+ fetchImageUrl: async (jid, onimai) => {
372
372
  const contact = contacts[jid]
373
373
  if (!contact) {
374
- return baron?.profilePictureUrl(jid)
374
+ return onimai?.profilePictureUrl(jid)
375
375
  }
376
376
  if (typeof contact.imgUrl === 'undefined') {
377
- contact.imgUrl = await baron?.profilePictureUrl(jid)
377
+ contact.imgUrl = await onimai?.profilePictureUrl(jid)
378
378
  }
379
379
  return contact.imgUrl
380
380
  },
381
- fetchGroupMetadata: async (jid, baron) => {
381
+ fetchGroupMetadata: async (jid, onimai) => {
382
382
  if (!groupMetadata[jid]) {
383
- const metadata = await baron?.groupMetadata(jid)
383
+ const metadata = await onimai?.groupMetadata(jid)
384
384
  if (metadata) {
385
385
  groupMetadata[jid] = metadata
386
386
  }
@@ -29,7 +29,7 @@ var __importStar = (this && this.__importStar) || function(mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true })
30
30
 
31
31
  const crypto_1 = require("crypto")
32
- const libsignal = __importStar(require("libsignal-baron"))
32
+ const libsignal = __importStar(require("@neelegirl/libsignal"))
33
33
  const Defaults_1 = require("../Defaults")
34
34
 
35
35
  const generateSignalPubKey = (pubKey) => (