@rennzsync/baileys 10.2.2 → 10.2.4

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.
@@ -1,4 +1,4 @@
1
- import { decrypt, encrypt } from 'libsignal/src/crypto';
1
+ import { decrypt, encrypt } from 'libsignal/src/crypto.js';
2
2
  import { SenderKeyMessage } from './sender-key-message.js';
3
3
  import { SenderKeyName } from './sender-key-name.js';
4
4
  import { SenderKeyRecord } from './sender-key-record.js';
@@ -1,5 +1,5 @@
1
1
  import * as nodeCrypto from 'crypto';
2
- import { generateKeyPair } from 'libsignal/src/curve';
2
+ import { generateKeyPair } from 'libsignal/src/curve.js';
3
3
  export function generateSenderKey() {
4
4
  return nodeCrypto.randomBytes(32);
5
5
  }
@@ -1,4 +1,4 @@
1
- import { calculateMAC } from 'libsignal/src/crypto';
1
+ import { calculateMAC } from 'libsignal/src/crypto.js';
2
2
  import { SenderMessageKey } from './sender-message-key.js';
3
3
  export class SenderChainKey {
4
4
  constructor(iteration, chainKey) {
@@ -1,4 +1,4 @@
1
- import { calculateSignature, verifySignature } from 'libsignal/src/curve';
1
+ import { calculateSignature, verifySignature } from 'libsignal/src/curve.js';
2
2
  import { proto } from '../../../WAProto/index.js';
3
3
  import { CiphertextMessage } from './ciphertext-message.js';
4
4
  export class SenderKeyMessage extends CiphertextMessage {
@@ -1,4 +1,4 @@
1
- import { deriveSecrets } from 'libsignal/src/crypto';
1
+ import { deriveSecrets } from 'libsignal/src/crypto.js';
2
2
  export class SenderMessageKey {
3
3
  constructor(iteration, seed) {
4
4
  const derivative = deriveSecrets(seed, Buffer.alloc(32), Buffer.from('WhisperGroup'));
@@ -1,5 +1,5 @@
1
1
  import * as libsignal from 'libsignal';
2
- import { PreKeyWhisperMessage } from 'libsignal/src/protobufs';
2
+ import { PreKeyWhisperMessage } from 'libsignal/src/protobufs.js';
3
3
  import { LRUCache } from 'lru-cache';
4
4
  import { generateSignalPubKey } from '../Utils/index.js';
5
5
  import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, transferDevice, WAJIDDomains } from '../WABinary/index.js';
@@ -1,10 +1,15 @@
1
1
  import { createRequire } from "module";
2
2
  const require = createRequire(import.meta.url);
3
- const cacheManager = require("cache-manager");
4
3
  import * as WAProto_1 from "../../WAProto/index.js";
5
4
  import * as Utils_1 from "../Utils/index.js";
6
5
  import logger from "../Utils/logger.js";
7
6
  export default async function makeCacheManagerAuthState(store, sessionKey) {
7
+ let cacheManager;
8
+ try {
9
+ cacheManager = require("cache-manager");
10
+ } catch {
11
+ throw new Error("makeCacheManagerAuthState requires the optional 'cache-manager' package. Install it with: npm install cache-manager");
12
+ }
8
13
  const defaultKey = file => `${sessionKey}:${file}`;
9
14
  const databaseConn = await cacheManager.caching(store);
10
15
  const writeData = async (file, data) => {
@@ -1,5 +1,5 @@
1
1
  import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from 'crypto';
2
- import * as curve from 'libsignal/src/curve';
2
+ import * as curve from 'libsignal/src/curve.js';
3
3
  import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
4
4
  export { md5, hkdf } from 'whatsapp-rust-bridge';
5
5
  // insure browser & node compatibility
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rennzsync/baileys",
3
3
  "type": "module",
4
- "version": "10.2.2",
4
+ "version": "10.2.4",
5
5
  "description": "renz/baileys — WhatsApp Multi-Device library rebased @whiskeysockets/baileys 7.0.0-rc14, using the original libsignal (GPL-3.0) Signal Protocol engine. Maintained by RennZz-Dev. Focus: multimedia WhatsApp bots, low RAM footprint.",
6
6
  "license": "MIT",
7
7
  "author": "RennZz-Dev (https://github.com/renzxhub)",