@queenanya/baileys 7.1.1 → 7.1.6

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.
@@ -26,12 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.encodeBinaryNode = void 0;
27
27
  const constants = __importStar(require("./constants"));
28
28
  const jid_utils_1 = require("./jid-utils");
29
- const encodeBinaryNode = (node, opts = constants, buffer = [0]) => {
30
- const encoded = encodeBinaryNodeInner(node, opts, buffer);
31
- return Buffer.from(encoded);
32
- };
33
- exports.encodeBinaryNode = encodeBinaryNode;
34
- const encodeBinaryNodeInner = ({ tag, attrs, content }, opts, buffer) => {
29
+ const encodeBinaryNode = ({ tag, attrs, content }, opts = constants, buffer = [0]) => {
35
30
  const { TAGS, TOKEN_MAP } = opts;
36
31
  const pushByte = (value) => buffer.push(value & 0xff);
37
32
  const pushInt = (value, n, littleEndian = false) => {
@@ -219,7 +214,7 @@ const encodeBinaryNodeInner = ({ tag, attrs, content }, opts, buffer) => {
219
214
  else if (Array.isArray(content)) {
220
215
  writeListStart(content.length);
221
216
  for (const item of content) {
222
- encodeBinaryNodeInner(item, opts, buffer);
217
+ (0, exports.encodeBinaryNode)(item, opts, buffer);
223
218
  }
224
219
  }
225
220
  else if (typeof content === 'undefined') {
@@ -230,3 +225,4 @@ const encodeBinaryNodeInner = ({ tag, attrs, content }, opts, buffer) => {
230
225
  }
231
226
  return buffer;
232
227
  };
228
+ exports.encodeBinaryNode = encodeBinaryNode;
@@ -3,7 +3,7 @@ export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
3
3
  export declare const SERVER_JID = "server@c.us";
4
4
  export declare const PSA_WID = "0@c.us";
5
5
  export declare const STORIES_JID = "status@broadcast";
6
- export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid';
6
+ export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call' | 'lid' | 'newsletter';
7
7
  export type JidWithDevice = {
8
8
  user: string;
9
9
  device?: number;
@@ -24,6 +24,8 @@ export declare const isLidUser: (jid: string | undefined) => boolean | undefined
24
24
  export declare const isJidBroadcast: (jid: string | undefined) => boolean | undefined;
25
25
  /** is the jid a group */
26
26
  export declare const isJidGroup: (jid: string | undefined) => boolean | undefined;
27
+ /** is the jid a newsletter */
28
+ export declare const isJidNewsletter: (jid: string | undefined) => boolean | undefined;
27
29
  /** is the jid the status broadcast */
28
30
  export declare const isJidStatusBroadcast: (jid: string) => boolean;
29
31
  export declare const jidNormalizedUser: (jid: string | undefined) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jidNormalizedUser = exports.isJidStatusBroadcast = exports.isJidGroup = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.S_WHATSAPP_NET = void 0;
3
+ exports.jidNormalizedUser = exports.isJidStatusBroadcast = exports.isJidNewsletter = exports.isJidGroup = exports.isJidBroadcast = exports.isLidUser = exports.isJidUser = exports.areJidsSameUser = exports.jidDecode = exports.jidEncode = exports.STORIES_JID = exports.PSA_WID = exports.SERVER_JID = exports.OFFICIAL_BIZ_JID = exports.S_WHATSAPP_NET = void 0;
4
4
  exports.S_WHATSAPP_NET = '@s.whatsapp.net';
5
5
  exports.OFFICIAL_BIZ_JID = '16505361212@c.us';
6
6
  exports.SERVER_JID = 'server@c.us';
@@ -45,6 +45,9 @@ exports.isJidBroadcast = isJidBroadcast;
45
45
  /** is the jid a group */
46
46
  const isJidGroup = (jid) => (jid === null || jid === void 0 ? void 0 : jid.endsWith('@g.us'));
47
47
  exports.isJidGroup = isJidGroup;
48
+ /** is the jid a newsletter */
49
+ const isJidNewsletter = (jid) => (jid === null || jid === void 0 ? void 0 : jid.endsWith('@newsletter'));
50
+ exports.isJidNewsletter = isJidNewsletter;
48
51
  /** is the jid the status broadcast */
49
52
  const isJidStatusBroadcast = (jid) => jid === 'status@broadcast';
50
53
  exports.isJidStatusBroadcast = isJidStatusBroadcast;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@queenanya/baileys",
3
- "version": "7.1.1",
3
+ "version": "7.1.6",
4
4
  "description": "WhatsApp API",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -33,7 +33,6 @@
33
33
  "changelog:preview": "conventional-changelog -p angular -u",
34
34
  "changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
35
35
  "example": "node --inspect -r ts-node/register Example/example.ts",
36
- "example:mobile": "node --inspect -r ts-node/register Example/example.ts --mobile",
37
36
  "gen:protobuf": "sh WAProto/GenerateStatics.sh",
38
37
  "lint": "eslint src --ext .js,.ts,.jsx,.tsx",
39
38
  "lint:fix": "eslint src --fix --ext .js,.ts,.jsx,.tsx",
@@ -44,41 +43,45 @@
44
43
  },
45
44
  "dependencies": {
46
45
  "@adiwajshing/keyed-db": "^0.2.4",
47
- "@hapi/boom": "^9.1.3",
46
+ "@hapi/boom": "^10.0.1",
48
47
  "async-lock": "^1.4.1",
49
- "audio-decode": "^2.1.3",
50
- "axios": "^1.6.0",
48
+ "audio-decode": "^2.2.0",
49
+ "axios": "^1.7.2",
51
50
  "cache-manager": "4.0.1",
52
- "futoin-hkdf": "^1.5.1",
53
- "libphonenumber-js": "^1.10.20",
54
- "libsignal": "github:WhiskeySockets/libsignal-node",
51
+ "futoin-hkdf": "^1.5.3",
52
+ "json": "^11.0.0",
53
+ "libphonenumber-js": "^1.11.4",
54
+ "libsignal": "npm:@queenanya/libsignal@latest",
55
55
  "lodash": "^4.17.21",
56
+ "megajs": "1.1.7",
56
57
  "music-metadata": "^7.12.3",
57
58
  "node-cache": "^5.1.2",
58
- "pino": "^7.0.0",
59
- "protobufjs": "^7.2.4",
59
+ "pino": "^9.3.0",
60
+ "protobufjs": "^7.3.2",
61
+ "release-it": "^17.6.0",
60
62
  "uuid": "^10.0.0",
61
- "ws": "^8.13.0"
63
+ "ws": "^8.18.0"
62
64
  },
63
65
  "devDependencies": {
64
66
  "@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
65
- "@types/got": "^9.6.11",
66
- "@types/jest": "^27.5.1",
67
- "@types/node": "^16.0.0",
68
- "@types/sharp": "^0.29.4",
69
- "@types/ws": "^8.0.0",
70
- "conventional-changelog-cli": "^2.2.2",
71
- "eslint": "^8.0.0",
72
- "jest": "^27.0.6",
73
- "jimp": "^0.16.1",
67
+ "@types/got": "^9.6.12",
68
+ "@types/jest": "^29.5.12",
69
+ "@types/node": "^20.14.10",
70
+ "@types/sharp": "^0.31.1",
71
+ "@types/ws": "^8.5.11",
72
+ "conventional-changelog-cli": "^5.0.0",
73
+ "eslint": "^9.7.0",
74
+ "jest": "^29.7.0",
75
+ "jimp": "^0.22.12",
74
76
  "json": "^11.0.0",
75
- "link-preview-js": "^3.0.0",
76
- "open": "^8.4.2",
77
+ "link-preview-js": "^3.0.5",
78
+ "megajs": "1.1.7",
79
+ "open": "^10.1.0",
77
80
  "qrcode-terminal": "^0.12.0",
78
- "release-it": "^15.10.3",
79
- "sharp": "^0.32.6",
80
- "ts-jest": "^27.0.3",
81
- "ts-node": "^10.8.1",
81
+ "release-it": "^17.6.0",
82
+ "sharp": "^0.33.4",
83
+ "ts-jest": "^29.2.2",
84
+ "ts-node": "^10.9.2",
82
85
  "typedoc": "^0.24.7",
83
86
  "typescript": "^4.6.4"
84
87
  },
@@ -101,6 +104,5 @@
101
104
  "sharp": {
102
105
  "optional": true
103
106
  }
104
- },
105
- "packageManager": "yarn@1.22.19"
107
+ }
106
108
  }