sanka-baileyss 2.3.3 → 2.3.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,58 +1,53 @@
1
- "use strict"
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true })
4
-
5
- const generics_1 = require("../../Utils/generics")
6
- const sender_key_state_1 = require("./sender-key-state")
7
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SenderKeyRecord = void 0;
4
+ const generics_1 = require("../../Utils/generics");
5
+ const sender_key_state_1 = require("./sender-key-state");
8
6
  class SenderKeyRecord {
9
7
  constructor(serialized) {
10
- this.MAX_STATES = 5
11
- this.senderKeyStates = []
8
+ this.MAX_STATES = 5;
9
+ this.senderKeyStates = [];
12
10
  if (serialized) {
13
11
  for (const structure of serialized) {
14
- this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(null, null, null, null, null, null, structure))
12
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(null, null, null, null, null, null, structure));
15
13
  }
16
14
  }
17
15
  }
18
16
  isEmpty() {
19
- return this.senderKeyStates.length === 0
17
+ return this.senderKeyStates.length === 0;
20
18
  }
21
19
  getSenderKeyState(keyId) {
22
20
  if (keyId === undefined && this.senderKeyStates.length) {
23
- return this.senderKeyStates[this.senderKeyStates.length - 1]
21
+ return this.senderKeyStates[this.senderKeyStates.length - 1];
24
22
  }
25
- return this.senderKeyStates.find(state => state.getKeyId() === keyId)
23
+ return this.senderKeyStates.find(state => state.getKeyId() === keyId);
26
24
  }
27
25
  addSenderKeyState(id, iteration, chainKey, signatureKey) {
28
- this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, null, signatureKey))
26
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, null, signatureKey));
29
27
  if (this.senderKeyStates.length > this.MAX_STATES) {
30
- this.senderKeyStates.shift()
28
+ this.senderKeyStates.shift();
31
29
  }
32
30
  }
33
31
  setSenderKeyState(id, iteration, chainKey, keyPair) {
34
- this.senderKeyStates.length = 0
35
- this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, keyPair))
32
+ this.senderKeyStates.length = 0;
33
+ this.senderKeyStates.push(new sender_key_state_1.SenderKeyState(id, iteration, chainKey, keyPair));
36
34
  }
37
35
  serialize() {
38
- return this.senderKeyStates.map(state => state.getStructure())
36
+ return this.senderKeyStates.map(state => state.getStructure());
39
37
  }
40
38
  static deserialize(data) {
41
- let parsed
39
+ let parsed;
42
40
  if (typeof data === 'string') {
43
- parsed = JSON.parse(data, generics_1.BufferJSON.reviver)
41
+ parsed = JSON.parse(data, generics_1.BufferJSON.reviver);
44
42
  }
45
43
  else if (data instanceof Uint8Array) {
46
- const str = Buffer.from(data).toString('utf-8')
47
- parsed = JSON.parse(str, generics_1.BufferJSON.reviver)
44
+ const str = Buffer.from(data).toString('utf-8');
45
+ parsed = JSON.parse(str, generics_1.BufferJSON.reviver);
48
46
  }
49
47
  else {
50
- parsed = data
48
+ parsed = data;
51
49
  }
52
- return new SenderKeyRecord(parsed)
50
+ return new SenderKeyRecord(parsed);
53
51
  }
54
52
  }
55
-
56
- module.exports = {
57
- SenderKeyRecord
58
- }
53
+ exports.SenderKeyRecord = SenderKeyRecord;
package/package.json CHANGED
@@ -1,65 +1 @@
1
- {
2
- "name": "sanka-baileyss",
3
- "version": "2.3.3",
4
- "description": "WhatsApp API Modification By Sanka_Vollerei",
5
- "keywords": [
6
- "Baileys",
7
- "whiskeysockets/baileys",
8
- "whatsapp",
9
- "meta",
10
- "whatsapp",
11
- "js-whatsapp",
12
- "whatsapp-api",
13
- "whatsapp-web",
14
- "whatsapp-chat",
15
- "whatsapp-group",
16
- "automation",
17
- "multi-device",
18
- "sanka-baileys"
19
- ],
20
- "homepage": "https://sankavollerei.com",
21
- "repository": {
22
- "url": "git@github.com:SankaVollereii/Sanka-Baileys.git"
23
- },
24
- "license": "MIT",
25
- "author": "Sanka Vollereii",
26
- "main": "lib/index.js",
27
- "files": [
28
- "lib/*",
29
- "WAProto/*",
30
- "check-node-version.js"
31
- ],
32
- "scripts": {
33
- "preinstall": "node ./check-node-version.js"
34
- },
35
- "dependencies": {
36
- "@adiwajshing/keyed-db": "^0.2.4",
37
- "@cacheable/node-cache": "^1.5.5",
38
- "@hapi/boom": "^10.0.1",
39
- "async-mutex": "^0.5.0",
40
- "audio-decode": "^2.2.3",
41
- "axios": "^1.9.0",
42
- "cache-manager": "^6.4.3",
43
- "jimp": "^1.6.0",
44
- "libsignal": "npm:@meta.inc/libsignal",
45
- "link-preview-js": "^3.1.0",
46
- "lodash": "^4.17.21",
47
- "long": "^5.3.2",
48
- "music-metadata": "^11.2.3",
49
- "pino": "^9.7",
50
- "protobufjs": "^7.5.3",
51
- "qrcode-terminal": "^0.12.0",
52
- "sharp": "^0.34.2",
53
- "ws": "^8.18.2"
54
- },
55
- "packageManager": "",
56
- "engines": {
57
- "node": ">=20.0.0"
58
- },
59
- "directories": {
60
- "lib": "lib"
61
- },
62
- "bugs": {
63
- "url": "https://github.com/WhiskeySockets/baileys/issues"
64
- }
65
- }
1
+ {"name":"sanka-baileyss","version":"2.3.4","description":"WhatsApp API Modification By Sanka_Vollerei","keywords":["Baileys","whiskeysockets/baileys","whatsapp","meta","whatsapp","js-whatsapp","whatsapp-api","whatsapp-web","whatsapp-chat","whatsapp-group","automation","multi-device","sanka-baileys"],"homepage":"https://sankavollerei.com","repository":{"url":"git@github.com:SankaVollereii/Sanka-Baileys.git"},"license":"MIT","author":"Sanka Vollereii","main":"lib/index.js","files":["lib/*","WAProto/*","check-node-version.js"],"scripts":{"build:all":"tsc && typedoc","build:docs":"typedoc","build:tsc":"tsc","changelog:last":"conventional-changelog -p angular -r 2","changelog:preview":"conventional-changelog -p angular -u","changelog:update":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","example":"node --inspect -r ts-node/register Example/example.ts","gen:protobuf":"sh WAProto/GenerateStatics.sh","lint":"eslint src --ext .js,.ts","lint:fix":"yarn lint --fix","prepack":"tsc","prepare":"tsc","preinstall":"node ./engine-requirements.js","release":"release-it","test":"jest"},"dependencies":{"@adiwajshing/keyed-db":"^0.2.4","@cacheable/node-cache":"1.5.3","@hapi/boom":"^9.1.3","@itsukichan/eslint-config":"^1.0.0","@itsukichan/libsignal-node":"^1.0.0","async-mutex":"^0.5.0","audio-decode":"^2.2.2","axios":"^1.6.0","cache-manager":"^5.7.6","link-preview-js":"^3.0.14","lodash":"^4.17.21","music-metadata":"^7.12.3","pino":"^9.6","protobufjs":"^7.2.4","qrcode-terminal":"^0.12.0","ws":"^8.13.0"},"devDependencies":{"@types/jest":"^27.5.1","@types/node":"^16.18.126","@types/ws":"^8.0.0","conventional-changelog-cli":"^2.2.2","eslint":"^8.0.0","jest":"^27.0.6","jimp":"^0.22.12","json":"^11.0.0","link-preview-js":"^3.0.5","open":"^8.4.2","release-it":"^15.10.3","sharp":"^0.32.6","ts-jest":"^27.0.3","ts-node":"^10.8.1","typedoc":"^0.27.9","typedoc-plugin-markdown":"4.4.2","typescript":"^5.8.2"},"peerDependencies":{"jimp":"^0.22.12","sharp":"^0.34.1"},"peerDependenciesMeta":{"jimp":{"optional":true},"sharp":{"optional":true}},"packageManager":"yarn@1.22.19","engines":{"node":">=20.0.0"},"directories":{"lib":"lib"},"bugs":{"url":"https://github.com/WhiskeySockets/baileys/issues"}}